|
@@ -72,13 +72,221 @@ public class ZhcxInsideInspectionCoreIndicatorsServiceImpl extends ServiceImpl<Z
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public List<String> editColsHistory(String insideId, SlaveDMLVo update) {
|
|
|
+ public List<String> editSelfColsHistory(String insideId, SlaveDMLVo update) {
|
|
|
final LambdaQueryWrapper<ZhcxInsideInspectionCoreIndicatorsDo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
queryWrapper.eq(ZhcxInsideInspectionCoreIndicatorsDo::getInsideid, insideId)
|
|
|
.eq(ZhcxInsideInspectionCoreIndicatorsDo::getDeleted, "0");
|
|
|
final List<ZhcxInsideInspectionCoreIndicatorsDo> list = list(queryWrapper);
|
|
|
|
|
|
- return editCosHistory(list, update.getSlaveUpdate());
|
|
|
+ return editSelfCosHistory(list, update.getSlaveUpdate());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 检验员更改记录
|
|
|
+ *
|
|
|
+ * @param insideId
|
|
|
+ * @param coreList
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public List<String> editCheckerColsHistory(String insideId, List<GeneralUpdateVo> coreList) {
|
|
|
+ final LambdaQueryWrapper<ZhcxInsideInspectionCoreIndicatorsDo> queryWrapper = Wrappers.lambdaQuery();
|
|
|
+ queryWrapper.eq(ZhcxInsideInspectionCoreIndicatorsDo::getInsideid, insideId)
|
|
|
+ .eq(ZhcxInsideInspectionCoreIndicatorsDo::getDeleted, "0");
|
|
|
+ final List<ZhcxInsideInspectionCoreIndicatorsDo> list = list(queryWrapper);
|
|
|
+
|
|
|
+ return editCheckerCosHistory(list, coreList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 检验员修改记录
|
|
|
+ *
|
|
|
+ * @param coreList
|
|
|
+ * @param slaveUpdate
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<String> editCheckerCosHistory(List<ZhcxInsideInspectionCoreIndicatorsDo> coreList, List<GeneralUpdateVo> slaveUpdate) {
|
|
|
+
|
|
|
+ if(ObjectUtil.isEmpty(slaveUpdate)) {
|
|
|
+ return Collections.emptyList();
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, ZhcxInsideInspectionCoreIndicatorsDo> coreMap = new HashMap<>(coreList.size());
|
|
|
+ coreList.stream().forEach(item -> coreMap.put(item.getId(), item));
|
|
|
+
|
|
|
+ List<String> result = new ArrayList<>();
|
|
|
+
|
|
|
+ for(GeneralUpdateVo update : slaveUpdate) {
|
|
|
+ String id = update.getUpdatecolumns().get("ID").toString();
|
|
|
+ ZhcxInsideInspectionCoreIndicatorsDo indicators = coreMap.get(id);
|
|
|
+
|
|
|
+ if(ObjectUtil.isNull(indicators)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ difCheckercoreIndicator(indicators, update.getUpdatecolumns(), result);
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 单个核心检验指标不同
|
|
|
+ *
|
|
|
+ * @param core
|
|
|
+ * @param updatecolumns
|
|
|
+ * @param result
|
|
|
+ */
|
|
|
+ private void difCheckercoreIndicator(ZhcxInsideInspectionCoreIndicatorsDo core, Map<String,Object> updatecolumns, List<String> result) {
|
|
|
+
|
|
|
+ List<String> updateCols = new ArrayList<>();
|
|
|
+ StringBuilder editRow = new StringBuilder("检查项:");
|
|
|
+ if(ObjectUtil.isNull(updatecolumns.get("INSPECTON_ITEMS"))) {
|
|
|
+ editRow.append(StringUtils.toString(core.getInspectonItems(), ""));
|
|
|
+ } else {
|
|
|
+ editRow.append(StringUtils.toString(updatecolumns.get("INSPECTON_ITEMS"), ""));
|
|
|
+ }
|
|
|
+
|
|
|
+ //实测记录
|
|
|
+ diffCheckerActualRecord(core, updatecolumns, updateCols);
|
|
|
+ //判定结果
|
|
|
+ diffCheckerResult(core, updatecolumns, updateCols);
|
|
|
+ //判定结果
|
|
|
+ diffCheckerRemark(core, updatecolumns, updateCols);
|
|
|
+
|
|
|
+ if(ObjectUtil.isEmpty(updateCols)) {
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ editRow.append(StringUtils.join(updateCols, ","));
|
|
|
+ result.add(editRow.toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 不同检验员备注
|
|
|
+ *
|
|
|
+ * @param core
|
|
|
+ * @param updatecolumns
|
|
|
+ * @param updateCols
|
|
|
+ */
|
|
|
+ private void diffCheckerRemark(ZhcxInsideInspectionCoreIndicatorsDo core, Map<String, Object> updatecolumns, List<String> updateCols) {
|
|
|
+ if(ObjectUtil.isEmpty(core.getCheckremark()) && ObjectUtil.isNull(updatecolumns.get("CHECKREMARK"))) {
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ObjectUtil.isEmpty(core.getCheckremark()) && ObjectUtil.isNotNull(updatecolumns.get("CHECKREMARK"))) {
|
|
|
+ String reservationinspectiontime = StrUtil.concat(true, "检验员备注:"
|
|
|
+ , "空变更为:"
|
|
|
+ , updatecolumns.get("CHECKREMARK").toString()
|
|
|
+ );
|
|
|
+ updateCols.add(reservationinspectiontime);
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ObjectUtil.isNotEmpty(core.getCheckremark()) && ObjectUtil.isNull(updatecolumns.get("CHECKREMARK"))) {
|
|
|
+ String reservationinspectiontime = StrUtil.concat(true, "检验员备注:"
|
|
|
+ , core.getCheckremark()
|
|
|
+ , "变更为空"
|
|
|
+ );
|
|
|
+ updateCols.add(reservationinspectiontime);
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(core.getCheckremark().equals(updatecolumns.get("CHECKREMARK").toString())) {
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ String reservationinspectiontime = StrUtil.concat(true, "检验员备注:"
|
|
|
+ , core.getCheckremark()
|
|
|
+ , "变更为"
|
|
|
+ , updatecolumns.get("CHECKREMARK").toString()
|
|
|
+ );
|
|
|
+ updateCols.add(reservationinspectiontime);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * 不同检验员结果判定
|
|
|
+ *
|
|
|
+ * @param core
|
|
|
+ * @param updatecolumns
|
|
|
+ * @param updateCols
|
|
|
+ */
|
|
|
+ private void diffCheckerResult(ZhcxInsideInspectionCoreIndicatorsDo core, Map<String, Object> updatecolumns, List<String> updateCols) {
|
|
|
+ if(ObjectUtil.isEmpty(core.getCheckresult()) && ObjectUtil.isNull(updatecolumns.get("CHECKRESULT"))) {
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ObjectUtil.isEmpty(core.getCheckresult()) && ObjectUtil.isNotNull(updatecolumns.get("CHECKRESULT"))) {
|
|
|
+ String reservationinspectiontime = StrUtil.concat(true, "检验员结果判定:"
|
|
|
+ , "空变更为:"
|
|
|
+ , updatecolumns.get("CHECKRESULT").toString()
|
|
|
+ );
|
|
|
+ updateCols.add(reservationinspectiontime);
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ObjectUtil.isNotEmpty(core.getCheckresult()) && ObjectUtil.isNull(updatecolumns.get("CHECKRESULT"))) {
|
|
|
+ String reservationinspectiontime = StrUtil.concat(true, "检验员结果判定:"
|
|
|
+ , core.getCheckresult()
|
|
|
+ , "变更为空"
|
|
|
+ );
|
|
|
+ updateCols.add(reservationinspectiontime);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(core.getCheckresult().equals(updatecolumns.get("CHECKRESULT").toString())) {
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ String reservationinspectiontime = StrUtil.concat(true, "检验员结果判定:"
|
|
|
+ , core.getCheckresult()
|
|
|
+ , "变更为"
|
|
|
+ , updatecolumns.get("CHECKRESULT").toString()
|
|
|
+ );
|
|
|
+ updateCols.add(reservationinspectiontime);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 不同检验员实测记录
|
|
|
+ *
|
|
|
+ * @param core
|
|
|
+ * @param updatecolumns
|
|
|
+ * @param updateCols
|
|
|
+ */
|
|
|
+ private void diffCheckerActualRecord(ZhcxInsideInspectionCoreIndicatorsDo core, Map<String, Object> updatecolumns, List<String> updateCols) {
|
|
|
+ if(ObjectUtil.isEmpty(core.getCheckactualrecord()) && ObjectUtil.isNull(updatecolumns.get("CHECKACTUALRECORD"))) {
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ObjectUtil.isEmpty(core.getCheckactualrecord()) && ObjectUtil.isNotNull(updatecolumns.get("CHECKACTUALRECORD"))) {
|
|
|
+ String reservationinspectiontime = StrUtil.concat(true, "检验员实测记录:"
|
|
|
+ , "空变更为:"
|
|
|
+ , updatecolumns.get("CHECKACTUALRECORD").toString()
|
|
|
+ );
|
|
|
+ updateCols.add(reservationinspectiontime);
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ObjectUtil.isNotEmpty(core.getCheckactualrecord()) && ObjectUtil.isNull(updatecolumns.get("CHECKACTUALRECORD"))) {
|
|
|
+ String reservationinspectiontime = StrUtil.concat(true, "检验员实测记录:"
|
|
|
+ , core.getCheckactualrecord()
|
|
|
+ , "变更为空"
|
|
|
+ );
|
|
|
+ updateCols.add(reservationinspectiontime);
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(core.getCheckactualrecord().equals(updatecolumns.get("CHECKACTUALRECORD").toString())) {
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+
|
|
|
+ String reservationinspectiontime = StrUtil.concat(true, "检验员实测记录:"
|
|
|
+ , core.getCheckactualrecord()
|
|
|
+ , "变更为"
|
|
|
+ , updatecolumns.get("CHECKACTUALRECORD").toString()
|
|
|
+ );
|
|
|
+ updateCols.add(reservationinspectiontime);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -88,7 +296,7 @@ public class ZhcxInsideInspectionCoreIndicatorsServiceImpl extends ServiceImpl<Z
|
|
|
* @param slaveUpdate
|
|
|
* @return
|
|
|
*/
|
|
|
- private List<String> editCosHistory(List<ZhcxInsideInspectionCoreIndicatorsDo> coreList, List<GeneralUpdateVo> slaveUpdate) {
|
|
|
+ private List<String> editSelfCosHistory(List<ZhcxInsideInspectionCoreIndicatorsDo> coreList, List<GeneralUpdateVo> slaveUpdate) {
|
|
|
if(ObjectUtil.isEmpty(coreList) && ObjectUtil.isEmpty(slaveUpdate)) {
|
|
|
return Collections.emptyList();
|
|
|
}
|