|
@@ -16,14 +16,13 @@ import com.jzg.commons.entity.quote.vo.aggregated.*;
|
|
|
import com.jzg.commons.entity.vo.AdjustAllRefundVo;
|
|
import com.jzg.commons.entity.vo.AdjustAllRefundVo;
|
|
|
import com.jzg.commons.entity.vo.PtlAgreementCostRatioVo;
|
|
import com.jzg.commons.entity.vo.PtlAgreementCostRatioVo;
|
|
|
import com.jzg.commons.entity.vo.QuestionOrder;
|
|
import com.jzg.commons.entity.vo.QuestionOrder;
|
|
|
|
|
+import com.jzg.commons.util.JsonDiffUtil;
|
|
|
import com.jzg.quotation.commons.constant.SpElMapping;
|
|
import com.jzg.quotation.commons.constant.SpElMapping;
|
|
|
import com.jzg.quotation.commons.utils.SpElFieldExtractor;
|
|
import com.jzg.quotation.commons.utils.SpElFieldExtractor;
|
|
|
import com.jzg.quotation.summary.aop.aspect.OrderOperationLog;
|
|
import com.jzg.quotation.summary.aop.aspect.OrderOperationLog;
|
|
|
import com.jzg.quotation.summary.constants.QuoteNumberConstant;
|
|
import com.jzg.quotation.summary.constants.QuoteNumberConstant;
|
|
|
-import com.jzg.quotation.summary.service.InsOrderAdjustService;
|
|
|
|
|
-import com.jzg.quotation.summary.service.InsOrdersCarInfoService;
|
|
|
|
|
-import com.jzg.quotation.summary.service.InsOrdersService;
|
|
|
|
|
-import com.jzg.quotation.summary.service.InsOrdersTrackService;
|
|
|
|
|
|
|
+import com.jzg.quotation.summary.service.*;
|
|
|
|
|
+import com.jzg.quotation.taikang.crawler.JsonUtil;
|
|
|
import org.aspectj.lang.ProceedingJoinPoint;
|
|
import org.aspectj.lang.ProceedingJoinPoint;
|
|
|
import org.aspectj.lang.annotation.Around;
|
|
import org.aspectj.lang.annotation.Around;
|
|
|
import org.aspectj.lang.annotation.Aspect;
|
|
import org.aspectj.lang.annotation.Aspect;
|
|
@@ -38,9 +37,10 @@ import org.springframework.expression.spel.standard.SpelExpressionParser;
|
|
|
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
|
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
|
|
-import java.util.List;
|
|
|
|
|
-import java.util.Map;
|
|
|
|
|
-import java.util.Objects;
|
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
|
|
+import java.nio.file.Files;
|
|
|
|
|
+import java.nio.file.Path;
|
|
|
|
|
+import java.util.*;
|
|
|
|
|
|
|
|
@Aspect
|
|
@Aspect
|
|
|
@Component
|
|
@Component
|
|
@@ -60,7 +60,8 @@ public class OrderOperationLogAspect {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private SpElFieldExtractor fieldExtractor;
|
|
private SpElFieldExtractor fieldExtractor;
|
|
|
-
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private InsFeeAuditService insFeeAuditService;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private InsOrderAdjustService insOrderAdjustService;
|
|
private InsOrderAdjustService insOrderAdjustService;
|
|
|
|
|
|
|
@@ -162,8 +163,11 @@ public class OrderOperationLogAspect {
|
|
|
case 15:
|
|
case 15:
|
|
|
logger.info("费用调整log.orderSpEl()=[{}]",log.orderSpEl());
|
|
logger.info("费用调整log.orderSpEl()=[{}]",log.orderSpEl());
|
|
|
PtlAgreementCostRatioVo vo = parser.parseExpression(log.orderSpEl()).getValue(context, PtlAgreementCostRatioVo.class);
|
|
PtlAgreementCostRatioVo vo = parser.parseExpression(log.orderSpEl()).getValue(context, PtlAgreementCostRatioVo.class);
|
|
|
|
|
+ QuoteEchoVo detailVoOld = insFeeAuditService.auditInfo(vo.getOrderNo());
|
|
|
result = joinPoint.proceed();
|
|
result = joinPoint.proceed();
|
|
|
- this.saveCostInfo(result,log, vo);
|
|
|
|
|
|
|
+ QuoteEchoVo detailVoNew = insFeeAuditService.auditInfo(vo.getOrderNo());
|
|
|
|
|
+ Map<String, List<String>> diffMap = JsonDiffUtil.compareJson(JSONUtil.toJsonStr(detailVoOld), JSONUtil.toJsonStr(detailVoNew), new HashSet<>());
|
|
|
|
|
+ this.saveCostInfo(result,log, vo,diffMap);
|
|
|
break;
|
|
break;
|
|
|
// 批量修改比例
|
|
// 批量修改比例
|
|
|
case 16:
|
|
case 16:
|
|
@@ -255,7 +259,7 @@ public class OrderOperationLogAspect {
|
|
|
* @author lipf
|
|
* @author lipf
|
|
|
* @date 2026/7/8 15:28
|
|
* @date 2026/7/8 15:28
|
|
|
*/
|
|
*/
|
|
|
- private void saveCostInfo(Object result, OrderOperationLog log, PtlAgreementCostRatioVo vo) {
|
|
|
|
|
|
|
+ private void saveCostInfo(Object result, OrderOperationLog log, PtlAgreementCostRatioVo vo,Map<String, List<String>> diffMap) {
|
|
|
InsOrdersTrack track = new InsOrdersTrack();
|
|
InsOrdersTrack track = new InsOrdersTrack();
|
|
|
String orderNo = vo.getOrderNo();
|
|
String orderNo = vo.getOrderNo();
|
|
|
track.setModule(log.module());
|
|
track.setModule(log.module());
|
|
@@ -273,8 +277,22 @@ public class OrderOperationLogAspect {
|
|
|
track.setResult("要进行费用调整的订单不存在");
|
|
track.setResult("要进行费用调整的订单不存在");
|
|
|
}
|
|
}
|
|
|
track.setStatus(1);
|
|
track.setStatus(1);
|
|
|
- track.setChangeBefore("");
|
|
|
|
|
- track.setChangeAfter("费用调整完成");
|
|
|
|
|
|
|
+ if(CollUtil.isNotEmpty(diffMap)){
|
|
|
|
|
+ List<String> oldItems = new ArrayList<>(diffMap.keySet());
|
|
|
|
|
+ List<String> newItems = new ArrayList<>(diffMap.keySet());
|
|
|
|
|
+ diffMap.forEach((path, values) ->{
|
|
|
|
|
+ System.out.println("路径: " + path + " -> 值1: " + values.get(0) + " | 值2: " + values.get(1));
|
|
|
|
|
+ oldItems.add(path + ": " + values.get(0));
|
|
|
|
|
+ newItems.add(path + ": " + values.get(1));
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ logger.info("oldItem=[{}]", JSONUtil.toJsonStr(oldItems));
|
|
|
|
|
+ logger.info("newItem=[{}]", JSONUtil.toJsonStr(newItems));
|
|
|
|
|
+
|
|
|
|
|
+ track.setChangeBefore(String.join("\r\n", oldItems));
|
|
|
|
|
+ track.setChangeAfter(String.join("\r\n", newItems));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
track.setOrderNo(orderNo);
|
|
track.setOrderNo(orderNo);
|
|
|
track.setResult(JSONUtil.toJsonStr(result));
|
|
track.setResult(JSONUtil.toJsonStr(result));
|
|
|
traceService.save(track);
|
|
traceService.save(track);
|