Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dd_school
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wangqi
dd_school
Commits
9386f13d
Commit
9386f13d
authored
Mar 18, 2024
by
wangjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-03-18 校产管理 设备台账 导入 异常及修改
parent
b18a0de5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
60 additions
and
42 deletions
+60
-42
smart-campus/src/main/java/yangtz/cs/liu/campus/domain/schoolEquipment/SchoolEquipmentLedger.java
+2
-2
smart-campus/src/main/java/yangtz/cs/liu/campus/domain/schoolEquipment/SchoolProductCategory.java
+2
-0
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/schoolEquipment/ProductCategoryMapper.java
+1
-0
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolEquipment/EquipmentLedgerServiceImpl.java
+44
-39
smart-campus/src/main/resources/mapper/schoolEquipment/ProductCategoryMapper.xml
+11
-1
No files found.
smart-campus/src/main/java/yangtz/cs/liu/campus/domain/schoolEquipment/SchoolEquipmentLedger.java
View file @
9386f13d
...
@@ -59,9 +59,9 @@ public class SchoolEquipmentLedger extends OurBaseEntity
...
@@ -59,9 +59,9 @@ public class SchoolEquipmentLedger extends OurBaseEntity
@Excel
(
name
=
"是否已借出"
,
readConverterExp
=
"1=是,0=否"
,
combo
=
{
"是"
,
"否"
})
@Excel
(
name
=
"是否已借出"
,
readConverterExp
=
"1=是,0=否"
,
combo
=
{
"是"
,
"否"
})
private
String
isLend
;
private
String
isLend
;
/**
投产日期
*/
/**
安装时间
*/
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"
投产日期
"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"
安装时间
"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
dateOfProduction
;
private
Date
dateOfProduction
;
/** 价格 */
/** 价格 */
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/domain/schoolEquipment/SchoolProductCategory.java
View file @
9386f13d
...
@@ -47,4 +47,6 @@ public class SchoolProductCategory extends BaseEntity
...
@@ -47,4 +47,6 @@ public class SchoolProductCategory extends BaseEntity
/** 管理员 */
/** 管理员 */
private
String
admin
;
private
String
admin
;
private
String
delFlag
;
}
}
smart-campus/src/main/java/yangtz/cs/liu/campus/mapper/schoolEquipment/ProductCategoryMapper.java
View file @
9386f13d
...
@@ -50,6 +50,7 @@ public interface ProductCategoryMapper extends BaseMapper<SchoolProductCategory>
...
@@ -50,6 +50,7 @@ public interface ProductCategoryMapper extends BaseMapper<SchoolProductCategory>
* @return
* @return
*/
*/
List
<
SchoolProductCategory
>
selectSchoolProductCateGoryGr
(
SchoolProductCategory
schoolProductCategory
);
List
<
SchoolProductCategory
>
selectSchoolProductCateGoryGr
(
SchoolProductCategory
schoolProductCategory
);
List
<
SchoolProductCategory
>
selectProductCategoryList
(
SchoolProductCategory
schoolProductCategory
);
/**
/**
* 获取个人设备分类下拉框
* 获取个人设备分类下拉框
...
...
smart-campus/src/main/java/yangtz/cs/liu/campus/service/impl/schoolEquipment/EquipmentLedgerServiceImpl.java
View file @
9386f13d
...
@@ -22,6 +22,7 @@ import yangtz.cs.liu.campus.vo.schoolEquipment.SchoolEquipmentLedgerVo;
...
@@ -22,6 +22,7 @@ import yangtz.cs.liu.campus.vo.schoolEquipment.SchoolEquipmentLedgerVo;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collector
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Service
@Service
...
@@ -229,6 +230,12 @@ public class EquipmentLedgerServiceImpl extends ServiceImpl<EquipmentLedgerMappe
...
@@ -229,6 +230,12 @@ public class EquipmentLedgerServiceImpl extends ServiceImpl<EquipmentLedgerMappe
*/
*/
@Override
@Override
public
void
checkImport
(
List
<
SchoolEquipmentLedger
>
list
)
{
public
void
checkImport
(
List
<
SchoolEquipmentLedger
>
list
)
{
//2024-03-15 wj add
//查询分类编码是否重复
SchoolProductCategory
wrapper
=
new
SchoolProductCategory
();
List
<
SchoolProductCategory
>
schoolProductCategories
=
productCategoryMapper
.
selectProductCategoryList
(
wrapper
);
//是否为空
//是否为空
if
(
StringUtils
.
isNull
(
list
)
||
list
.
size
()
==
0
)
{
if
(
StringUtils
.
isNull
(
list
)
||
list
.
size
()
==
0
)
{
throw
new
ServiceException
(
"导入数据不能为空"
);
throw
new
ServiceException
(
"导入数据不能为空"
);
...
@@ -240,21 +247,21 @@ public class EquipmentLedgerServiceImpl extends ServiceImpl<EquipmentLedgerMappe
...
@@ -240,21 +247,21 @@ public class EquipmentLedgerServiceImpl extends ServiceImpl<EquipmentLedgerMappe
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getEquipmentName
())){
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getEquipmentName
())){
failureNum
++;
failureNum
++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、设备名称为空,请你重新输入!"
);
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、设备名称为空,请你重新输入!"
);
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getModel
())){
//
}else if (StringUtils.isNull(schoolEquipmentLedger.getModel())){
failureNum
++;
//
failureNum++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、型号为空,请你重新输入!"
);
//
failureMsg.append("<br/>" + failureNum + "、型号为空,请你重新输入!");
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getSpecification
())){
//
}else if (StringUtils.isNull(schoolEquipmentLedger.getSpecification())){
failureNum
++;
//
failureNum++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、规格为空,请你重新输入!"
);
//
failureMsg.append("<br/>" + failureNum + "、规格为空,请你重新输入!");
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getClassificationCode
())){
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getClassificationCode
())){
failureNum
++;
failureNum
++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、分类编码为空,请你重新输入!"
);
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、分类编码为空,请你重新输入!"
);
}
else
if
(
schoolEquipmentLedger
.
getClassificationCode
().
length
()
<
4
){
}
else
if
(
schoolEquipmentLedger
.
getClassificationCode
().
length
()
<
4
){
failureNum
++;
failureNum
++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、分类编码长度最少为4位,请你核对后重新输入!"
);
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、分类编码长度最少为4位,请你核对后重新输入!"
);
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getUnit
())){
//
}else if (StringUtils.isNull(schoolEquipmentLedger.getUnit())){
failureNum
++;
//
failureNum++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、单位为空,请你重新输入!"
);
//
failureMsg.append("<br/>" + failureNum + "、单位为空,请你重新输入!");
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getAffiliationType
())){
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getAffiliationType
())){
failureNum
++;
failureNum
++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、归属类型为空,请你重新输入!"
);
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、归属类型为空,请你重新输入!"
);
...
@@ -264,43 +271,41 @@ public class EquipmentLedgerServiceImpl extends ServiceImpl<EquipmentLedgerMappe
...
@@ -264,43 +271,41 @@ public class EquipmentLedgerServiceImpl extends ServiceImpl<EquipmentLedgerMappe
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getIsAllowLend
())){
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getIsAllowLend
())){
failureNum
++;
failureNum
++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、是否允许借出为空,请你重新输入!"
);
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、是否允许借出为空,请你重新输入!"
);
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getIsLend
())){
//
}else if (StringUtils.isNull(schoolEquipmentLedger.getIsLend())){
failureNum
++;
//
failureNum++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、是否已借出为空,请你重新输入!"
);
//
failureMsg.append("<br/>" + failureNum + "、是否已借出为空,请你重新输入!");
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getDateOfProduction
())){
//
}else if (StringUtils.isNull(schoolEquipmentLedger.getDateOfProduction())){
failureNum
++;
//
failureNum++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、投产日期
为空,请你重新输入!"
);
// failureMsg.append("<br/>" + failureNum + "、安装时间
为空,请你重新输入!");
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getPrice
())){
//
}else if (StringUtils.isNull(schoolEquipmentLedger.getPrice())){
failureNum
++;
//
failureNum++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、价格为空,请你重新输入!"
);
//
failureMsg.append("<br/>" + failureNum + "、价格为空,请你重新输入!");
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getLifeOfUtility
())){
//
}else if (StringUtils.isNull(schoolEquipmentLedger.getLifeOfUtility())){
failureNum
++;
//
failureNum++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、效用年限为空,请你重新输入!"
);
//
failureMsg.append("<br/>" + failureNum + "、效用年限为空,请你重新输入!");
}
else
if
(
StringUtils
.
isNull
(
schoolEquipmentLedger
.
getPlace
())){
//
}else if (StringUtils.isNull(schoolEquipmentLedger.getPlace())){
failureNum
++;
//
failureNum++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、地点为空,请你重新输入!"
);
//
failureMsg.append("<br/>" + failureNum + "、地点为空,请你重新输入!");
}
else
{
}
else
if
(
StringUtils
.
isNotNull
(
schoolEquipmentLedger
.
getDateOfProduction
()))
{
try
{
try
{
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy
-MM-
dd"
);
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy
/MM/
dd"
);
Date
dateOfProduction
=
schoolEquipmentLedger
.
getDateOfProduction
();
Date
dateOfProduction
=
schoolEquipmentLedger
.
getDateOfProduction
();
sdf
.
format
(
dateOfProduction
);
sdf
.
format
(
dateOfProduction
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
ServiceException
(
"格式不对,请检查日期格式"
);
throw
new
ServiceException
(
schoolEquipmentLedger
.
getDateOfProduction
()
+
" 格式不对,请检查日期格式"
);
}
try
{
Integer
.
parseInt
(
schoolEquipmentLedger
.
getPlace
());
throw
new
ServiceException
(
"地点输入错误,请重新输入!"
);
}
catch
(
NumberFormatException
e
)
{
e
.
printStackTrace
();
}
}
// try {
// Integer.parseInt(schoolEquipmentLedger.getPlace());
// throw new ServiceException("地点输入错误,请重新输入!");
// } catch (NumberFormatException e) {
// e.printStackTrace();
// }
}
}
if
(
StringUtils
.
isNotNull
(
schoolEquipmentLedger
.
getClassificationCode
())){
if
(
StringUtils
.
isNotNull
(
schoolEquipmentLedger
.
getClassificationCode
())){
//查询分类编码是否重复
LambdaQueryWrapper
<
SchoolProductCategory
>
wrapper
=
new
LambdaQueryWrapper
<>();
List
<
SchoolProductCategory
>
newCateLists
=
schoolProductCategories
.
stream
().
filter
(
wrapper
.
eq
(
SchoolProductCategory:
:
getClassificationCode
,
schoolEquipmentLedger
.
getClassificationCode
())
e
->
schoolEquipmentLedger
.
getClassificationCode
().
equals
(
e
.
getClassificationCode
())).
collect
(
Collectors
.
toList
());
.
eq
(
SchoolProductCategory:
:
getDelFlag
,
"0"
);
if
(
newCateLists
.
size
()<=
0
)
{
List
<
SchoolProductCategory
>
schoolProductCategories
=
productCategoryMapper
.
selectList
(
wrapper
);
if
(
schoolProductCategories
.
size
()<=
0
)
{
failureNum
++;
failureNum
++;
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、分类编码不存在,请你重新输入!"
);
failureMsg
.
append
(
"<br/>"
+
failureNum
+
"、分类编码不存在,请你重新输入!"
);
}
}
...
...
smart-campus/src/main/resources/mapper/schoolEquipment/ProductCategoryMapper.xml
View file @
9386f13d
...
@@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -18,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateBy"
column=
"update_by"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"delF
al
g"
column=
"del_flag"
/>
<result
property=
"delF
la
g"
column=
"del_flag"
/>
</resultMap>
</resultMap>
<resultMap
type=
"SchoolProductCategoryVo"
id=
"schoolProductCategoryVoResult"
>
<resultMap
type=
"SchoolProductCategoryVo"
id=
"schoolProductCategoryVoResult"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
...
@@ -144,4 +144,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -144,4 +144,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
</select>
<select
id=
"selectProductCategoryList"
parameterType=
"yangtz.cs.liu.campus.domain.schoolEquipment.SchoolProductCategory"
resultMap=
"schoolProductCategoryResult"
>
SELECT *
FROM school_product_category
WHERE del_flag = '0'
ORDER BY order_num ASC
</select>
</mapper>
</mapper>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment