|
|
@@ -2,6 +2,7 @@ package org.jeecg.modules.smscheck.controller;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
@@ -144,38 +145,38 @@ public class SmsLotCustomerController extends JeecgController<SmsLotCustomerData
|
|
|
|
|
|
List<SmsCheckZGHistory> smsCheckZGHistories = new ArrayList<>();
|
|
|
|
|
|
- // SmsCheckCustomerDataLog 如果id不是空的 则存在以前数据
|
|
|
-// if (StringUtils.isNotBlank(lotCheckLog.getId())){
|
|
|
-// SmcLotCheckLog logServiceById = smcLotCheckLogService.getById(lotCheckLog.getId());
|
|
|
-// Map<String, Object> diffProperties = ObjectComparator.compareObjects(lotCheckLog, logServiceById);
|
|
|
-// for (Map.Entry<String, Object> entry : diffProperties.entrySet()) {
|
|
|
-// SmsCheckZGHistory checkZGHistory = new SmsCheckZGHistory();
|
|
|
-// checkZGHistory.setDataId(byId.getDataId());
|
|
|
-// checkZGHistory.setContext(entry.getValue().toString());
|
|
|
-// checkZGHistory.setUpdateField(entry.getKey());
|
|
|
-// Date date = new Date();
|
|
|
-// SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
|
|
|
-// checkZGHistory.setUpdateDate(dateFormat.format(date));
|
|
|
-// smsCheckZGHistories.add(checkZGHistory);
|
|
|
-// System.out.println("Property: " + entry.getKey() + ", Value: " + entry.getValue());
|
|
|
-// }
|
|
|
-// }
|
|
|
-// //SmsCheckCustomerData 如果id不是空的 则存在以前数据
|
|
|
-// if (StringUtils.isNotBlank(lotCustomerData.getId())){
|
|
|
-// SmsLotCustomerData dataServiceById = smsLotCustomerService.getById(lotCustomerData.getId());
|
|
|
-// Map<String, Object> diffProperties = ObjectComparator.compareObjects(lotCustomerData, dataServiceById);
|
|
|
-// for (Map.Entry<String, Object> entry : diffProperties.entrySet()) {
|
|
|
-// SmsCheckZGHistory checkZGHistory = new SmsCheckZGHistory();
|
|
|
-// checkZGHistory.setDataId(byId.getDataId());
|
|
|
-// checkZGHistory.setContext(entry.getValue().toString());
|
|
|
-// checkZGHistory.setUpdateField(entry.getKey());
|
|
|
-// Date date = new Date();
|
|
|
-// SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
|
|
|
-// checkZGHistory.setUpdateDate(dateFormat.format(date));
|
|
|
-// smsCheckZGHistories.add(checkZGHistory);
|
|
|
-// System.out.println("Property: " + entry.getKey() + ", Value: " + entry.getValue());
|
|
|
-// }
|
|
|
-// }
|
|
|
+// SmsCheckCustomerDataLog 如果id不是空的 则存在以前数据
|
|
|
+ if (StringUtils.isNotBlank(lotCheckLog.getId())){
|
|
|
+ SmcLotCheckLog logServiceById = smcLotCheckLogService.getById(lotCheckLog.getId());
|
|
|
+ Map<String, Object> diffProperties = ObjectComparator.compareObjects(lotCheckLog, logServiceById);
|
|
|
+ for (Map.Entry<String, Object> entry : diffProperties.entrySet()) {
|
|
|
+ SmsCheckZGHistory checkZGHistory = new SmsCheckZGHistory();
|
|
|
+ checkZGHistory.setDataId(byId.getDataId());
|
|
|
+ checkZGHistory.setContext(entry.getValue().toString());
|
|
|
+ checkZGHistory.setUpdateField(entry.getKey());
|
|
|
+ Date date = new Date();
|
|
|
+ SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
|
|
|
+ checkZGHistory.setUpdateDate(dateFormat.format(date));
|
|
|
+ smsCheckZGHistories.add(checkZGHistory);
|
|
|
+ System.out.println("Property: " + entry.getKey() + ", Value: " + entry.getValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //SmsCheckCustomerData 如果id不是空的 则存在以前数据
|
|
|
+ if (StringUtils.isNotBlank(lotCustomerData.getId())){
|
|
|
+ SmsLotCustomerData dataServiceById = smsLotCustomerService.getById(lotCustomerData.getId());
|
|
|
+ Map<String, Object> diffProperties = ObjectComparator.compareObjects(lotCustomerData, dataServiceById);
|
|
|
+ for (Map.Entry<String, Object> entry : diffProperties.entrySet()) {
|
|
|
+ SmsCheckZGHistory checkZGHistory = new SmsCheckZGHistory();
|
|
|
+ checkZGHistory.setDataId(byId.getDataId());
|
|
|
+ checkZGHistory.setContext(entry.getValue().toString());
|
|
|
+ checkZGHistory.setUpdateField(entry.getKey());
|
|
|
+ Date date = new Date();
|
|
|
+ SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");
|
|
|
+ checkZGHistory.setUpdateDate(dateFormat.format(date));
|
|
|
+ smsCheckZGHistories.add(checkZGHistory);
|
|
|
+ System.out.println("Property: " + entry.getKey() + ", Value: " + entry.getValue());
|
|
|
+ }
|
|
|
+ }
|
|
|
if (smsCheckZGHistories.size()>0){
|
|
|
smsCheckZGHistoryService.saveBatch(smsCheckZGHistories);
|
|
|
}
|
|
|
@@ -189,9 +190,9 @@ public class SmsLotCustomerController extends JeecgController<SmsLotCustomerData
|
|
|
|
|
|
boolean saveData = lotCustomerService.saveOrUpdate(lotCustomerData);
|
|
|
|
|
|
-
|
|
|
+ List<StepsNowVo> strings = JSONArray.parseArray(lotCheckCustomerDataAndLog.getStepsNow(), StepsNowVo.class);
|
|
|
if (saveLog && saveData){
|
|
|
- Map<String, String> mapByResult = getMapByResult(lotCheckLog);
|
|
|
+ Map<String, String> mapByResult = getMapByResult(lotCheckLog,strings);
|
|
|
// 修改客户状态为 未完善/未上传
|
|
|
SmsCheckCustomerInfo smsCheckCustomerInfo = new SmsCheckCustomerInfo();
|
|
|
/** 稽核状态 0:未处理;1:未完善;2:待稽核;3:已整改;4:待整改;5:稽核通过; */
|
|
|
@@ -214,34 +215,54 @@ public class SmsLotCustomerController extends JeecgController<SmsLotCustomerData
|
|
|
}
|
|
|
|
|
|
|
|
|
- private Map<String,String>getMapByResult(SmcLotCheckLog smsCheckCustomerDataLog){
|
|
|
+ private Map<String,String>getMapByResult(SmcLotCheckLog smsCheckCustomerDataLog,List<StepsNowVo>string){
|
|
|
HashMap <String,String> map =new HashMap<>();
|
|
|
- if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getTestCardResult() ) && !smsCheckCustomerDataLog.getTestCardResult().equals("1")){
|
|
|
- map.put("getTestCardResult","未通过");
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getContractResult() ) && !smsCheckCustomerDataLog.getContractResult().equals("1")){
|
|
|
- map.put("getContractResult","未通过");
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getHandlingCardResult() ) && !smsCheckCustomerDataLog.getHandlingCardResult().equals("1")){
|
|
|
- map.put("getHandlingCardResult","未通过");
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getHandlingContractResult() ) && !smsCheckCustomerDataLog.getHandlingContractResult().equals("1")){
|
|
|
- map.put("getHandlingContractResult","未通过");
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getCustomerCardScanningResult() ) && !smsCheckCustomerDataLog.getCustomerCardScanningResult().equals("1")){
|
|
|
- map.put("getCustomerCardScanningResult","未通过");
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getRiskTableResult() ) && !smsCheckCustomerDataLog.getRiskTableResult().equals("1")){
|
|
|
- map.put("getRiskTableResult","未通过");
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getPriceTableResult() ) && !smsCheckCustomerDataLog.getPriceTableResult().equals("1")){
|
|
|
- map.put("getPriceTableResult","未通过");
|
|
|
+ for (StepsNowVo stepsNowVo : string) {
|
|
|
+ if (stepsNowVo.getId().equals("testCard")){
|
|
|
+ if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getTestCardResult() ) && !smsCheckCustomerDataLog.getTestCardResult().equals("1")){
|
|
|
+ map.put("getTestCardResult","未通过");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (stepsNowVo.getId().equals("contract")){
|
|
|
+ if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getContractResult() ) && !smsCheckCustomerDataLog.getContractResult().equals("1")){
|
|
|
+ map.put("getContractResult","未通过");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (stepsNowVo.getId().equals("handlingCard")){
|
|
|
+ if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getHandlingCardResult() ) && !smsCheckCustomerDataLog.getHandlingCardResult().equals("1")){
|
|
|
+ map.put("getHandlingCardResult","未通过");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (stepsNowVo.getId().equals("handlingContract")){
|
|
|
+ if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getHandlingContractResult() ) && !smsCheckCustomerDataLog.getHandlingContractResult().equals("1")){
|
|
|
+ map.put("getHandlingContractResult","未通过");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (stepsNowVo.getId().equals("customerCardScanning")){
|
|
|
+ if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getCustomerCardScanningResult() ) && !smsCheckCustomerDataLog.getCustomerCardScanningResult().equals("1")){
|
|
|
+ map.put("getCustomerCardScanningResult","未通过");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (stepsNowVo.getId().equals("riskTable")){
|
|
|
+ if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getRiskTableResult() ) && !smsCheckCustomerDataLog.getRiskTableResult().equals("1")){
|
|
|
+ map.put("getRiskTableResult","未通过");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (stepsNowVo.getId().equals("priceTable")){
|
|
|
+ if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getPriceTableResult() ) && !smsCheckCustomerDataLog.getPriceTableResult().equals("1")){
|
|
|
+ map.put("getPriceTableResult","未通过");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (stepsNowVo.getId().equals("commitment")){
|
|
|
+ if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getCommitmentResult() ) && !smsCheckCustomerDataLog.getCommitmentResult().equals("1")){
|
|
|
+ map.put("getCommitmentResult","未通过");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getCommitmentResult() ) && !smsCheckCustomerDataLog.getCommitmentResult().equals("1")){
|
|
|
+ if (StringUtils.isNotBlank(smsCheckCustomerDataLog.getInfoResult() ) && !smsCheckCustomerDataLog.getInfoResult().equals("1")){
|
|
|
map.put("getCommitmentResult","未通过");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
return map;
|
|
|
}
|
|
|
|