|
@@ -607,13 +607,32 @@ public class CheckStandardServiceImpl extends BaseServiceImpl<CheckStandardMappe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void packageSbInfoAndCheckStandardVO(SbInfo sbInfo, CheckStandardDTO vo, CheckStandard checkStandard) {
|
|
|
+ BeanConverterUtil.copyObjectProperties(vo, checkStandard);
|
|
|
+ checkStandard.setCreatedTime(LocalDateTime.now());
|
|
|
+ checkStandard.setCheckUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
+ checkStandard.setUpdateTime(LocalDateTime.now());
|
|
|
+ checkStandard.setUpdateUserId(SecurityUtils.getUserInfo().getUserId());
|
|
|
+ if (checkStandard.getCheckUserType() == 1) {
|
|
|
+ checkStandard.setSbId(sbInfo.getId());
|
|
|
+ checkStandard.setLevel(CheckStandardLevelEnum.A.getValue());
|
|
|
+ checkStandard.setCheckUserId(sbInfo.getSaveUser());
|
|
|
+ }
|
|
|
+ if (checkStandard.getCheckUserType() == 2 || checkStandard.getCheckUserType() == 3) {// 设备的维修员
|
|
|
+ checkStandard.setSbId(sbInfo.getId());
|
|
|
+ checkStandard.setCheckUserType(2);
|
|
|
+ checkStandard.setLevel(CheckStandardLevelEnum.B.getValue());
|
|
|
+ checkStandard.setCheckUserId(sbInfo.getRepairUser());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void packageSbInfoAndCheckStandard(SbInfo sbInfo, ExportCheckStandardVO2 vo, CheckStandard checkStandard) {
|
|
|
if ("使用人".equals(vo.getCheckUserType().trim())) {
|
|
|
checkStandard.setCheckUserType(1);
|
|
|
} else if ("维修人".equals(vo.getCheckUserType().trim())) {
|
|
|
checkStandard.setCheckUserType(2);
|
|
|
} else if ("厂家".equals(vo.getCheckUserType().trim())) {
|
|
|
- checkStandard.setCheckUserType(3);
|
|
|
+ checkStandard.setCheckUserType(2);
|
|
|
} else {
|
|
|
checkStandard.setCheckUserType(2);
|
|
|
}
|
|
@@ -645,6 +664,7 @@ public class CheckStandardServiceImpl extends BaseServiceImpl<CheckStandardMappe
|
|
|
}
|
|
|
if (checkStandard.getCheckUserType() == 2 || checkStandard.getCheckUserType() == 3) {// 设备的维修员
|
|
|
checkStandard.setSbId(sbInfo.getId());
|
|
|
+ checkStandard.setCheckUserType(2);
|
|
|
checkStandard.setLevel(CheckStandardLevelEnum.B.getValue());
|
|
|
checkStandard.setCheckUserId(sbInfo.getRepairUser());
|
|
|
}
|
|
@@ -807,7 +827,7 @@ public class CheckStandardServiceImpl extends BaseServiceImpl<CheckStandardMappe
|
|
|
* 2:可以删除:数据库查询出来的不在excel里面了
|
|
|
* 3:可以新增:id =null
|
|
|
*
|
|
|
- * @param list
|
|
|
+ * @param checkStandardBatchDTO
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
@@ -828,17 +848,17 @@ public class CheckStandardServiceImpl extends BaseServiceImpl<CheckStandardMappe
|
|
|
List<CheckStandard> deletes = new ArrayList<>();
|
|
|
for (CheckStandardDTO vo : checkStandardBatchDTO.getList()) {
|
|
|
CheckStandard checkStandard = new CheckStandard();
|
|
|
+ checkStandard.setSbId(sbId);
|
|
|
if (StringUtils.isBlank(vo.getId())) {
|
|
|
//新增
|
|
|
- packageSbInfoAndCheckStandard(sbInfo, BeanConverterUtil.copyObjectProperties(vo,ExportCheckStandardVO2.class), checkStandard);
|
|
|
+ packageSbInfoAndCheckStandardVO(sbInfo, vo, checkStandard);
|
|
|
checkStandard.setId(IdGeneratorUtils.getObjectId());
|
|
|
checkStandard.setType(2);
|
|
|
checkStandard.setEnable(1);
|
|
|
adds.add(checkStandard);
|
|
|
} else {
|
|
|
//修改
|
|
|
- checkStandard.setId(vo.getId());
|
|
|
- packageSbInfoAndCheckStandard(sbInfo, BeanConverterUtil.copyObjectProperties(vo,ExportCheckStandardVO2.class), checkStandard);
|
|
|
+ packageSbInfoAndCheckStandardVO(sbInfo, vo, checkStandard);
|
|
|
updates.add(checkStandard);
|
|
|
}
|
|
|
}
|