|
@@ -33,6 +33,7 @@ import com.rongwei.rwcommon.base.exception.CustomException;
|
|
|
import com.rongwei.rwcommon.utils.SecurityUtil;
|
|
|
import com.rongwei.rwcommon.utils.StringUtils;
|
|
|
import com.rongwei.rwcommon.vo.generalsql.MasterSlaveUpdateVo;
|
|
|
+import com.rongwei.rwcommon.vo.generalsql.SlaveDMLVo;
|
|
|
import com.rongwei.rwcommoncomponent.excel.aspose.ExcelFormData;
|
|
|
import com.rongwei.rwcommoncomponent.excel.vo.FormData;
|
|
|
import com.rongwei.rwcommoncomponent.file.service.SysFileItemService;
|
|
@@ -140,9 +141,11 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
|
|
|
//生成修改记录
|
|
|
//报验单中编码不存在,为首次提交,不需要生成修改记录
|
|
|
- if(ObjectUtil.isNotEmpty(inspection.getInspectioncode())) {
|
|
|
- saveEditHistory(inspection, req);
|
|
|
- }
|
|
|
+ //暂存也需要产生操作记录2024年9月4日
|
|
|
+// if(ObjectUtil.isNotEmpty(inspection.getInspectioncode())) {
|
|
|
+// saveEditHistory(inspection, req);
|
|
|
+// }
|
|
|
+ saveEditHistory(inspection, req);
|
|
|
|
|
|
//保存单据
|
|
|
try {
|
|
@@ -173,6 +176,75 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 暂存-保存
|
|
|
+ *
|
|
|
+ * @param req
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void saveStaging4Insert(InsideInspectionInsertRequest req) {
|
|
|
+
|
|
|
+ SysUserVo user = zhcxCommon.getCurrentUser();
|
|
|
+ final Date nowDate = new Date();
|
|
|
+ final String nowDateStr = DateUtil.format(nowDate, "yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ req.getInsert().getMasterInsert().getInsertcolumns().put("INSPECTIONSTATUS", "10");
|
|
|
+ req.getInsert().getMasterInsert().getInsertcolumns().put("CREATEUSERID", user.getId());
|
|
|
+ req.getInsert().getMasterInsert().getInsertcolumns().put("CREATEUSERNAME", user.getName());
|
|
|
+ req.getInsert().getMasterInsert().getInsertcolumns().put("CREATEDATE", nowDateStr);
|
|
|
+ req.getInsert().getMasterInsert().getInsertcolumns().put("MODIFYUSERID", user.getId());
|
|
|
+ req.getInsert().getMasterInsert().getInsertcolumns().put("MODIFYUSERNAME", user.getName());
|
|
|
+ req.getInsert().getMasterInsert().getInsertcolumns().put("MODIFYDATE", nowDateStr);
|
|
|
+
|
|
|
+ //保存单据
|
|
|
+ try {
|
|
|
+ generalCRUDService.generalMsInsert(req.getInsert());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("保存失败: {}", e);
|
|
|
+ throw new CustomException("保存失败");
|
|
|
+ }
|
|
|
+
|
|
|
+ //生成操作记录
|
|
|
+ InsideOperLogDto operLogDto = InsideOperLogDto.builder()
|
|
|
+ .id(req.getId())
|
|
|
+ .operType("90")
|
|
|
+ .launchSource(ObjectUtil.isEmpty(req.getLaunchSource()) ? "mobile" : req.getLaunchSource())
|
|
|
+ .build();
|
|
|
+ operLogDto.setOperUser(user);
|
|
|
+ operLogDto.setOperTime(nowDate);
|
|
|
+ operLogService.saveOperLog(operLogDto);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 暂存-更新
|
|
|
+ *
|
|
|
+ * @param req
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void saveStaging4Update(InsideInspectionUpdateRequest req) {
|
|
|
+
|
|
|
+ ZhcxInsideInspectionDo inspection = this.getById(req.getId());//报验单
|
|
|
+
|
|
|
+ //生成记录
|
|
|
+ saveEditHistory(inspection, req);
|
|
|
+
|
|
|
+ SysUserVo user = zhcxCommon.getCurrentUser();
|
|
|
+ final Date nowDate = new Date();
|
|
|
+ final String nowDateStr = DateUtil.format(nowDate, "yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ req.getUpdate().getMasterUpdate().getUpdatecolumns().put("MODIFYUSERID", user.getId());
|
|
|
+ req.getUpdate().getMasterUpdate().getUpdatecolumns().put("MODIFYUSERNAME", user.getName());
|
|
|
+ req.getUpdate().getMasterUpdate().getUpdatecolumns().put("MODIFYDATE", nowDateStr);
|
|
|
+
|
|
|
+ //保存单据
|
|
|
+ try {
|
|
|
+ generalCRUDService.generalMsUpdate(req.getUpdate());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.error("保存失败: {}", e);
|
|
|
+ throw new CustomException("保存失败");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 保存重新报验
|
|
|
*
|
|
@@ -649,7 +721,19 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
private void saveEditHistory(ZhcxInsideInspectionDo inspection, InsideInspectionUpdateRequest req) {
|
|
|
Map<String, String> descMap = new HashMap<>();
|
|
|
|
|
|
+ //主表单
|
|
|
List<String> editList = editColsHistory(inspection, req.getUpdate().getMasterUpdate().getUpdatecolumns());
|
|
|
+
|
|
|
+ //核心检验指标
|
|
|
+ if(ObjectUtil.isNotEmpty(req.getUpdate().getSlaveUpdate())) {
|
|
|
+ final Optional<SlaveDMLVo> first = req.getUpdate().getSlaveUpdate().stream()
|
|
|
+ .filter(item -> "ZHCX_INSIDE_INSPECTION_CORE_INDICATORS".equals(item.getTableName())).findFirst();
|
|
|
+ if(first.isPresent()) {
|
|
|
+ final List<String> list = insideInspectionCoreIndicatorsService.editColsHistory(inspection.getId(), first.get());
|
|
|
+ editList.addAll(list);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(ObjectUtil.isNotEmpty(editList)) {
|
|
|
descMap.put(req.getId(), StringUtils.join(editList, "; "));
|
|
|
}
|
|
@@ -1027,6 +1111,18 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
.eq(ZhcxInsideInspectionDispatchDo::getDeleted, "0");
|
|
|
ZhcxInsideInspectionDispatchDo dispatch = dispatchService.getOne(dispatchLambdaQueryWrapper);
|
|
|
|
|
|
+ //操作日志
|
|
|
+ List<String> editList = editColsHistory(inside, masterSlaveUpdate.getMasterUpdate().getUpdatecolumns());
|
|
|
+ //核心检验指标
|
|
|
+ if(ObjectUtil.isNotEmpty(masterSlaveUpdate.getSlaveUpdate())) {
|
|
|
+ final Optional<SlaveDMLVo> first = masterSlaveUpdate.getSlaveUpdate().stream()
|
|
|
+ .filter(item -> "ZHCX_INSIDE_INSPECTION_CORE_INDICATORS".equals(item.getTableName())).findFirst();
|
|
|
+ if(first.isPresent()) {
|
|
|
+ final List<String> list = insideInspectionCoreIndicatorsService.editColsHistory(id, first.get());
|
|
|
+ editList.addAll(list);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
//保存历史
|
|
|
saveReHistory(inside, dispatch);
|
|
|
|
|
@@ -1034,7 +1130,7 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
saveReNew(inside, dispatch, masterSlaveUpdate);
|
|
|
|
|
|
//修改字段
|
|
|
- return editColsHistory(inside, masterSlaveUpdate.getMasterUpdate().getUpdatecolumns());
|
|
|
+ return editList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -1129,9 +1225,20 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
}
|
|
|
|
|
|
//项目工号
|
|
|
- if(!oldInside.getProjectcode().equals(updatecolumns.get("PROJECTCODE").toString())) {
|
|
|
- String projectcode = StrUtil.concat(true, "项目工号:", oldInside.getProjectcode()
|
|
|
- , " 变更为:", updatecolumns.get("PROJECTCODE").toString());
|
|
|
+ String projectcode = null;
|
|
|
+ if(ObjectUtil.isEmpty(oldInside.getProjectcode())) {
|
|
|
+ if(ObjectUtil.isNotNull(updatecolumns.get("PROJECTCODE"))) {
|
|
|
+ projectcode = StrUtil.concat(true, "项目工号"
|
|
|
+ , " 变更为:", updatecolumns.get("PROJECTCODE").toString());
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(!oldInside.getProjectcode().equals(StringUtils.toString(updatecolumns.get("PROJECTCODE"), null))) {
|
|
|
+ projectcode = StrUtil.concat(true, "项目工号:", oldInside.getProjectcode()
|
|
|
+ , " 变更为:", updatecolumns.get("PROJECTCODE").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(ObjectUtil.isNotEmpty(projectcode)) {
|
|
|
editDataList.add(projectcode);
|
|
|
}
|
|
|
|
|
@@ -1192,24 +1299,58 @@ public class ZhcxInsideInspectionServiceImpl extends ServiceImpl<ZhcxInsideInspe
|
|
|
}
|
|
|
|
|
|
//构件名称
|
|
|
- if(!oldInside.getStructurename().equals(updatecolumns.get("STRUCTURENAME").toString())) {
|
|
|
- String structurename = StrUtil.concat(true, "构件名称:", oldInside.getStructurename()
|
|
|
- , " 变更为:", updatecolumns.get("STRUCTURENAME").toString());
|
|
|
+ String structurename = null;
|
|
|
+ if(ObjectUtil.isEmpty(oldInside.getStructurename())) {
|
|
|
+ if(ObjectUtil.isNotNull(updatecolumns.get("STRUCTURENAME"))) {
|
|
|
+ structurename = StrUtil.concat(true, "构件名称"
|
|
|
+ , " 变更为:", updatecolumns.get("STRUCTURENAME").toString());
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(!oldInside.getStructurename().equals(StringUtils.toString(updatecolumns.get("STRUCTURENAME"), null))) {
|
|
|
+ structurename = StrUtil.concat(true, "构件名称:", oldInside.getStructurename()
|
|
|
+ , " 变更为:", updatecolumns.get("STRUCTURENAME").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(ObjectUtil.isNotEmpty(structurename)) {
|
|
|
editDataList.add(structurename);
|
|
|
}
|
|
|
|
|
|
//报验内容
|
|
|
- if(!oldInside.getInspectioncontent().equals(updatecolumns.get("INSPECTIONCONTENT").toString())) {
|
|
|
- String structurename = StrUtil.concat(true, "报验内容:", oldInside.getInspectioncontent()
|
|
|
- , " 变更为:", updatecolumns.get("INSPECTIONCONTENT").toString());
|
|
|
- editDataList.add(structurename);
|
|
|
+ String inspectionContent = null;
|
|
|
+ if(ObjectUtil.isEmpty(oldInside.getInspectioncontent())) {
|
|
|
+ if(ObjectUtil.isNotNull(updatecolumns.get("INSPECTIONCONTENT"))) {
|
|
|
+ inspectionContent = StrUtil.concat(true, "报验内容"
|
|
|
+ , " 变更为:", updatecolumns.get("INSPECTIONCONTENT").toString());
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(!oldInside.getInspectioncontent().equals(StringUtils.toString(updatecolumns.get("INSPECTIONCONTENT"), null))) {
|
|
|
+ inspectionContent = StrUtil.concat(true, "报验内容:", oldInside.getInspectioncontent()
|
|
|
+ , " 变更为:", updatecolumns.get("INSPECTIONCONTENT").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(ObjectUtil.isNotEmpty(inspectionContent)) {
|
|
|
+ editDataList.add(inspectionContent);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//检查地点
|
|
|
- if(!oldInside.getInspectionlocation().equals(updatecolumns.get("INSPECTIONLOCATION").toString())) {
|
|
|
- String structurename = StrUtil.concat(true, "检查地点:", oldInside.getInspectionlocation()
|
|
|
- , " 变更为:", updatecolumns.get("INSPECTIONLOCATION").toString());
|
|
|
- editDataList.add(structurename);
|
|
|
+ String inspectionLocation = null;
|
|
|
+ if(ObjectUtil.isEmpty(oldInside.getInspectionlocation())) {
|
|
|
+ if(ObjectUtil.isNotNull(updatecolumns.get("INSPECTIONLOCATION"))) {
|
|
|
+ inspectionLocation = StrUtil.concat(true, "检查地点"
|
|
|
+ , " 变更为:", updatecolumns.get("INSPECTIONLOCATION").toString());
|
|
|
+
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if(!oldInside.getInspectionlocation().equals(StringUtils.toString(updatecolumns.get("INSPECTIONLOCATION"), null))) {
|
|
|
+ inspectionLocation = StrUtil.concat(true, "检查地点:", oldInside.getInspectionlocation()
|
|
|
+ , " 变更为:", updatecolumns.get("INSPECTIONLOCATION").toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(ObjectUtil.isNotEmpty(inspectionLocation)) {
|
|
|
+ editDataList.add(inspectionLocation);
|
|
|
}
|
|
|
|
|
|
//检查地点补充
|