|
|
@@ -6,11 +6,13 @@ import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.ReUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.jzg.commons.constants.Constants;
|
|
|
+import com.jzg.commons.constants.Crud;
|
|
|
import com.jzg.commons.constants.ReturnInformation;
|
|
|
import com.jzg.commons.core.base.BaseController;
|
|
|
import com.jzg.commons.core.base.StateResult;
|
|
|
@@ -22,8 +24,10 @@ import com.jzg.commons.entity.vo.CostsListVo;
|
|
|
import com.jzg.commons.entity.vo.PtlAgreementCostRuleVo;
|
|
|
import com.jzg.commons.entity.vo.PtlAgreementCostVo;
|
|
|
import com.jzg.commons.exception.SystemException;
|
|
|
+import com.jzg.commons.service.OperatorTrajectoryService;
|
|
|
import com.jzg.commons.util.ListUtils;
|
|
|
import com.jzg.commons.util.StringUtils;
|
|
|
+import com.jzg.commons.util.comparble.CompatibleUtils;
|
|
|
import com.jzg.commons.util.idgen.IdGenerate;
|
|
|
import com.jzg.organization.client.EsmInsCompanyClient;
|
|
|
import com.jzg.organization.component.BuildDescUtils;
|
|
|
@@ -99,6 +103,8 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
private SysUserJzgInfoService sysUserJzgInfoService;
|
|
|
@Autowired
|
|
|
private PtlAreaLicenseService ptlAreaLicenseService;
|
|
|
+ @Autowired
|
|
|
+ private OperatorTrajectoryService operatorTrajectoryService;
|
|
|
|
|
|
/**
|
|
|
* 报价配置/费用管理/新增费用
|
|
|
@@ -665,6 +671,9 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
return HttpResult.error("未找到需要调整的费用类型记录");
|
|
|
}
|
|
|
|
|
|
+ // 备份调整前的数据 用于操作轨迹 beforeJson
|
|
|
+ List<PtlAgreementCostType> beforeCostTypeList = BeanUtil.copyToList(costTypeList, PtlAgreementCostType.class);
|
|
|
+
|
|
|
boolean isAdd = "ADD".equalsIgnoreCase(param.getOperationType());
|
|
|
|
|
|
// 校验:至少传递一种险种的比例
|
|
|
@@ -706,7 +715,31 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
|
|
|
|
|
|
// 批量更新
|
|
|
ptlAgreementCostTypeService.updateBatchById(costTypeList);
|
|
|
-
|
|
|
+ // 插入操作轨迹表记录
|
|
|
+ OperatorTrajectory operatorTrajectory = new OperatorTrajectory();
|
|
|
+ operatorTrajectory.setId(IdGenerate.nextId());
|
|
|
+ operatorTrajectory.setModuleName("报价配置/费用管理/批量调整费用比例");
|
|
|
+ operatorTrajectory.setServiceTag(
|
|
|
+ "com.jzg.organization.service.impl.PtlAgreementCostServiceImpl.batchAdjustCostRatio()");
|
|
|
+ operatorTrajectory.setEntityName(
|
|
|
+ "com.jzg.commons.entity.po.PtlAgreementCostType");
|
|
|
+ operatorTrajectory.setPrimaryValue(String.join(",", param.getCostIds()));
|
|
|
+ operatorTrajectory.setOperatorType(Crud.U.getCode());
|
|
|
+ Map<String, Object> beforeWrapper = new HashMap<>();
|
|
|
+ beforeWrapper.put("costTypeList", beforeCostTypeList);
|
|
|
+ operatorTrajectory.setBeforeJson(JSONUtil.toJsonStr(beforeWrapper));
|
|
|
+
|
|
|
+ Map<String, Object> afterWrapper = new HashMap<>();
|
|
|
+ afterWrapper.put("costTypeList", costTypeList);
|
|
|
+ operatorTrajectory.setAfterJson(JSONUtil.toJsonStr(afterWrapper));
|
|
|
+ operatorTrajectory.setOperationContent("批量调整费用比例");
|
|
|
+ operatorTrajectory.setSystemCode(baseController.getSystemCode());
|
|
|
+ String userTokenString = baseController.getUserTokenString();
|
|
|
+ JSONObject userInfo = JSONObject.parseObject(userTokenString);
|
|
|
+ operatorTrajectory.setCreateBy(userInfo.getString("username"));
|
|
|
+ operatorTrajectory.setCreateByName(userInfo.getString("name"));
|
|
|
+ operatorTrajectory.setCreateTime(LocalDateTime.now());
|
|
|
+ operatorTrajectoryService.save(operatorTrajectory);
|
|
|
return HttpResult.ok("批量调整成功,共调整 " + adjustedCount + " 条记录");
|
|
|
}
|
|
|
|