|
@@ -1,10 +1,12 @@
|
|
package com.rongwei.bscommon.sys.service.impl;
|
|
package com.rongwei.bscommon.sys.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.FileUtil;
|
|
import cn.hutool.core.io.file.FileNameUtil;
|
|
import cn.hutool.core.io.file.FileNameUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.IdUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.core.util.ZipUtil;
|
|
import cn.hutool.core.util.ZipUtil;
|
|
import com.aspose.words.Document;
|
|
import com.aspose.words.Document;
|
|
@@ -18,6 +20,7 @@ import com.rongwei.bsentity.domain.*;
|
|
import com.rongwei.bscommon.sys.dao.ZhcxOutsideInspectionItpDao;
|
|
import com.rongwei.bscommon.sys.dao.ZhcxOutsideInspectionItpDao;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.rongwei.bsentity.dto.NotifyDto;
|
|
import com.rongwei.bsentity.dto.NotifyDto;
|
|
|
|
+import com.rongwei.bsentity.dto.ReInspectionRequest;
|
|
import com.rongwei.bsentity.dto.ZhcxItpProjectNodeStateResultDto;
|
|
import com.rongwei.bsentity.dto.ZhcxItpProjectNodeStateResultDto;
|
|
import com.rongwei.bsentity.vo.*;
|
|
import com.rongwei.bsentity.vo.*;
|
|
import com.rongwei.commonservice.serial.service.SysSerialNumberService;
|
|
import com.rongwei.commonservice.serial.service.SysSerialNumberService;
|
|
@@ -421,6 +424,18 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
return R.ok();
|
|
return R.ok();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 修改历史记录
|
|
|
|
+ *
|
|
|
|
+ * @param res
|
|
|
|
+ */
|
|
|
|
+ @Override
|
|
|
|
+ public void modifyItpHistory(ReInspectionRequest res) {
|
|
|
|
+ ZhcxOutsideInspectionItpDo inspectionItpDo = getById(res.getId());
|
|
|
|
+
|
|
|
|
+ saveEditHistory(inspectionItpDo, res.getMasterSlaveUpdate());
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 再次报验
|
|
* 再次报验
|
|
* 1、复制一份作为历史记录
|
|
* 1、复制一份作为历史记录
|
|
@@ -444,10 +459,207 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
//保存历史
|
|
//保存历史
|
|
saveReHistory(itpDo, dispatchDo);
|
|
saveReHistory(itpDo, dispatchDo);
|
|
|
|
|
|
|
|
+ //添加修改记录
|
|
|
|
+// saveEditHistory(itpDo, masterSlaveUpdate);
|
|
|
|
+
|
|
//保存新的报验单
|
|
//保存新的报验单
|
|
saveReNewItp(itpDo, dispatchDo, masterSlaveUpdate);
|
|
saveReNewItp(itpDo, dispatchDo, masterSlaveUpdate);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 保存修改历史记录
|
|
|
|
+ *
|
|
|
|
+ * @param oldItp
|
|
|
|
+ * @param masterSlaveUpdate
|
|
|
|
+ */
|
|
|
|
+ private void saveEditHistory(ZhcxOutsideInspectionItpDo oldItp, MasterSlaveUpdateVo masterSlaveUpdate) {
|
|
|
|
+
|
|
|
|
+ List<String> colsHistoryList = editColsHistory(oldItp, masterSlaveUpdate);
|
|
|
|
+
|
|
|
|
+ if(ObjectUtil.isEmpty(colsHistoryList)) {
|
|
|
|
+ return ;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //操作记录
|
|
|
|
+ ZhcxOutsideInspectionItpOperLogDo itpLog = zhcxOutsideInspectionItpOperLogService
|
|
|
|
+ .getNew(oldItp.getId(), "80", new Date());
|
|
|
|
+ itpLog.setOperdescription(StringUtils.join(colsHistoryList, "; "));
|
|
|
|
+ zhcxOutsideInspectionItpOperLogService.save(itpLog);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改字段历史
|
|
|
|
+ *
|
|
|
|
+ * @param oldItp
|
|
|
|
+ * @param masterSlaveUpdate
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ private List<String> editColsHistory(ZhcxOutsideInspectionItpDo oldItp, MasterSlaveUpdateVo masterSlaveUpdate) {
|
|
|
|
+
|
|
|
|
+ List<String> editDataList = new ArrayList<>();
|
|
|
|
+
|
|
|
|
+ Map<String, Object> updatecolumns = masterSlaveUpdate.getMasterUpdate().getUpdatecolumns();
|
|
|
|
+ //预约报验时间
|
|
|
|
+// if(ObjectUtil.isNotEmpty(updatecolumns.get("RESERVATIONINSPECTIONTIME"))) {
|
|
|
|
+// String reservationinspectiontime = updatecolumns.get("RESERVATIONINSPECTIONTIME").toString();
|
|
|
|
+// if(reservationinspectiontime.split(":").length == 3) {
|
|
|
|
+//
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+ String reTime = DateUtil.format(oldItp.getReservationinspectiontime(), "yyyy-MM-dd HH:mm:ss");
|
|
|
|
+ if(!reTime.equals(updatecolumns.get("RESERVATIONINSPECTIONTIME").toString())) {
|
|
|
|
+ String reservationinspectiontime = StrUtil.concat(true, "预约报验时间:"
|
|
|
|
+ , DateUtil.format(oldItp.getReservationinspectiontime(), "yyyy-MM-dd HH:mm")
|
|
|
|
+ , " 变更为:"
|
|
|
|
+ , updatecolumns.get("RESERVATIONINSPECTIONTIME").toString()
|
|
|
|
+ );
|
|
|
|
+
|
|
|
|
+ editDataList.add(reservationinspectiontime);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //项目工号
|
|
|
|
+ if(!oldItp.getProjectcode().equals(updatecolumns.get("PROJECTCODE").toString())) {
|
|
|
|
+ String projectcode = StrUtil.concat(true, "项目工号:", oldItp.getProjectcode()
|
|
|
|
+ , " 变更为:", updatecolumns.get("PROJECTCODE").toString());
|
|
|
|
+ editDataList.add(projectcode);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //总装机号
|
|
|
|
+ String machineno = null;
|
|
|
|
+ //同时不为空
|
|
|
|
+ if(ObjectUtil.isNotEmpty(oldItp.getMachineno())
|
|
|
|
+ && ObjectUtil.isNotEmpty(updatecolumns.get("MACHINENO")) ) {
|
|
|
|
+ if(!oldItp.getMachineno().equals(updatecolumns.get("MACHINENO"))) {
|
|
|
|
+ machineno = StrUtil.concat(true, "总装机号:", oldItp.getMachineno()
|
|
|
|
+ , " 变更为:", StringUtils.toString(updatecolumns.get("MACHINENO"), ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //旧数据不为空
|
|
|
|
+ else if(ObjectUtil.isNotEmpty(oldItp.getMachineno())) {
|
|
|
|
+ if(!oldItp.getMachineno().equals(updatecolumns.get("MACHINENO"))) {
|
|
|
|
+ machineno = StrUtil.concat(true, "总装机号:", oldItp.getMachineno()
|
|
|
|
+ , " 变更为:", StringUtils.toString(updatecolumns.get("MACHINENO"), ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //新数据不为空
|
|
|
|
+ else if(ObjectUtil.isNotEmpty(updatecolumns.get("MACHINENO"))) {
|
|
|
|
+ if(!updatecolumns.get("MACHINENO").toString().equals(oldItp.getMachineno())) {
|
|
|
|
+ machineno = StrUtil.concat(true, "总装机号:", oldItp.getMachineno()
|
|
|
|
+ , " 变更为:", StringUtils.toString(updatecolumns.get("MACHINENO"), ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(ObjectUtil.isNotNull(machineno)) {
|
|
|
|
+ editDataList.add(machineno);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //结构机号
|
|
|
|
+ String structuremachineno = null;
|
|
|
|
+ //同时不为空
|
|
|
|
+ if(ObjectUtil.isNotEmpty(oldItp.getStructuremachineno())
|
|
|
|
+ && ObjectUtil.isNotEmpty(updatecolumns.get("STRUCTUREMACHINENO")) ) {
|
|
|
|
+ if(!oldItp.getStructuremachineno().equals(updatecolumns.get("STRUCTUREMACHINENO"))) {
|
|
|
|
+ structuremachineno = StrUtil.concat(true, "机构机号:", oldItp.getStructuremachineno()
|
|
|
|
+ , " 变更为:", StringUtils.toString(updatecolumns.get("STRUCTUREMACHINENO"), ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //旧数据不为空
|
|
|
|
+ else if(ObjectUtil.isNotEmpty(oldItp.getStructuremachineno())) {
|
|
|
|
+ if(!oldItp.getStructuremachineno().equals(updatecolumns.get("STRUCTUREMACHINENO"))) {
|
|
|
|
+ structuremachineno = StrUtil.concat(true, "机构机号:", oldItp.getStructuremachineno()
|
|
|
|
+ , " 变更为:", StringUtils.toString(updatecolumns.get("STRUCTUREMACHINENO"), ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //新数据不为空
|
|
|
|
+ else if(ObjectUtil.isNotEmpty(updatecolumns.get("STRUCTUREMACHINENO"))) {
|
|
|
|
+ if(!updatecolumns.get("STRUCTUREMACHINENO").toString().equals(oldItp.getStructuremachineno())) {
|
|
|
|
+ structuremachineno = StrUtil.concat(true, "机构机号:", oldItp.getStructuremachineno()
|
|
|
|
+ , " 变更为:", StringUtils.toString(updatecolumns.get("STRUCTUREMACHINENO"), ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(ObjectUtil.isNotNull(structuremachineno)) {
|
|
|
|
+ editDataList.add(structuremachineno);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //构件名称
|
|
|
|
+ if(!oldItp.getStructurename().equals(updatecolumns.get("STRUCTURENAME").toString())) {
|
|
|
|
+ String structurename = StrUtil.concat(true, "构件名称:", oldItp.getStructurename()
|
|
|
|
+ , " 变更为:", updatecolumns.get("STRUCTURENAME").toString());
|
|
|
|
+ editDataList.add(structurename);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //报验内容
|
|
|
|
+ if(!oldItp.getInspectioncontent().equals(updatecolumns.get("INSPECTIONCONTENT").toString())) {
|
|
|
|
+ String structurename = StrUtil.concat(true, "报验内容:", oldItp.getInspectioncontent()
|
|
|
|
+ , " 变更为:", updatecolumns.get("INSPECTIONCONTENT").toString());
|
|
|
|
+ editDataList.add(structurename);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //检查地点
|
|
|
|
+ if(!oldItp.getInspectionlocation().equals(updatecolumns.get("INSPECTIONLOCATION").toString())) {
|
|
|
|
+ String structurename = StrUtil.concat(true, "检查地点:", oldItp.getInspectionlocation()
|
|
|
|
+ , " 变更为:", updatecolumns.get("INSPECTIONLOCATION").toString());
|
|
|
|
+ editDataList.add(structurename);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //检查地点补充
|
|
|
|
+ String inspectionlocationsupplement = null;
|
|
|
|
+ //同时不为空
|
|
|
|
+ if(ObjectUtil.isNotEmpty(oldItp.getInspectionlocationsupplement())
|
|
|
|
+ && ObjectUtil.isNotEmpty(updatecolumns.get("INSPECTIONLOCATIONSUPPLEMENT")) ) {
|
|
|
|
+ if(!oldItp.getInspectionlocationsupplement().equals(updatecolumns.get("INSPECTIONLOCATIONSUPPLEMENT"))) {
|
|
|
|
+ inspectionlocationsupplement = StrUtil.concat(true, "检查地点补充:", oldItp.getInspectionlocationsupplement()
|
|
|
|
+ , " 变更为:", StringUtils.toString(updatecolumns.get("INSPECTIONLOCATIONSUPPLEMENT"), ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //旧数据不为空
|
|
|
|
+ else if(ObjectUtil.isNotEmpty(oldItp.getInspectionlocationsupplement())) {
|
|
|
|
+ if(!oldItp.getInspectionlocationsupplement().equals(updatecolumns.get("INSPECTIONLOCATIONSUPPLEMENT"))) {
|
|
|
|
+ inspectionlocationsupplement = StrUtil.concat(true, "检查地点补充:", oldItp.getInspectionlocationsupplement()
|
|
|
|
+ , " 变更为:", StringUtils.toString(updatecolumns.get("INSPECTIONLOCATIONSUPPLEMENT"), ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //新数据不为空
|
|
|
|
+ else if(ObjectUtil.isNotEmpty(updatecolumns.get("INSPECTIONLOCATIONSUPPLEMENT"))) {
|
|
|
|
+ if(!updatecolumns.get("INSPECTIONLOCATIONSUPPLEMENT").toString().equals(oldItp.getInspectionlocationsupplement())) {
|
|
|
|
+ inspectionlocationsupplement = StrUtil.concat(true, "检查地点补充:", oldItp.getInspectionlocationsupplement()
|
|
|
|
+ , " 变更为:", StringUtils.toString(updatecolumns.get("INSPECTIONLOCATIONSUPPLEMENT"), ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(ObjectUtil.isNotNull(inspectionlocationsupplement)) {
|
|
|
|
+ editDataList.add(inspectionlocationsupplement);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //备注
|
|
|
|
+ String remark = null;
|
|
|
|
+ //同时不为空
|
|
|
|
+ if(ObjectUtil.isNotEmpty(oldItp.getRemark())
|
|
|
|
+ && ObjectUtil.isNotEmpty(updatecolumns.get("REMARK")) ) {
|
|
|
|
+ if(!oldItp.getRemark().equals(updatecolumns.get("REMARK"))) {
|
|
|
|
+ remark = StrUtil.concat(true, "备注:", oldItp.getRemark()
|
|
|
|
+ , " 变更为:", StringUtils.toString(updatecolumns.get("REMARK"), ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //旧数据不为空
|
|
|
|
+ else if(ObjectUtil.isNotEmpty(oldItp.getRemark())) {
|
|
|
|
+ if(!oldItp.getRemark().equals(updatecolumns.get("REMARK"))) {
|
|
|
|
+ remark = StrUtil.concat(true, "备注:", oldItp.getRemark()
|
|
|
|
+ , " 变更为:", StringUtils.toString(updatecolumns.get("REMARK"), ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ //新数据不为空
|
|
|
|
+ else if(ObjectUtil.isNotEmpty(updatecolumns.get("REMARK"))) {
|
|
|
|
+ if(!oldItp.getRemark().equals(updatecolumns.get("REMARK"))) {
|
|
|
|
+ remark = StrUtil.concat(true, "备注:", oldItp.getRemark()
|
|
|
|
+ , " 变更为:", StringUtils.toString(updatecolumns.get("REMARK"), ""));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(ObjectUtil.isNotNull(remark)) {
|
|
|
|
+ editDataList.add(remark);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return editDataList;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 重新报验-保存新的报验单
|
|
* 重新报验-保存新的报验单
|
|
*
|
|
*
|
|
@@ -485,6 +697,12 @@ public class ZhcxOutsideInspectionItpServiceImpl extends ServiceImpl<ZhcxOutside
|
|
//操作记录
|
|
//操作记录
|
|
ZhcxOutsideInspectionItpOperLogDo itpLog = zhcxOutsideInspectionItpOperLogService
|
|
ZhcxOutsideInspectionItpOperLogDo itpLog = zhcxOutsideInspectionItpOperLogService
|
|
.getNew(itpDo.getId(), "70", new Date());
|
|
.getNew(itpDo.getId(), "70", new Date());
|
|
|
|
+
|
|
|
|
+ List<String> colsHistoryList = editColsHistory(itpDo, masterSlaveUpdate);
|
|
|
|
+ if(ObjectUtil.isNotEmpty(colsHistoryList)) {
|
|
|
|
+ itpLog.setOperdescription(StringUtils.join(colsHistoryList, "; "));
|
|
|
|
+ }
|
|
|
|
+
|
|
zhcxOutsideInspectionItpOperLogService.save(itpLog);
|
|
zhcxOutsideInspectionItpOperLogService.save(itpLog);
|
|
}
|
|
}
|
|
|
|
|