Просмотр исходного кода

新复制的协议应该是禁用的,以免出错

lipf 5 месяцев назад
Родитель
Сommit
5fd1e4169c

+ 6 - 1
platform/src/main/java/com/jzg/controller/EsmInsCompanyController.java

@@ -26,6 +26,8 @@ import com.jzg.service.EsmInsCompanyService;
 import com.jzg.service.SysSystemService;
 import io.swagger.v3.oas.annotations.Operation;
 import io.swagger.v3.oas.annotations.tags.Tag;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.validation.annotation.Validated;
@@ -49,6 +51,8 @@ import java.util.stream.Collectors;
 @RequestMapping("esmInsCompany")
 public class EsmInsCompanyController extends BaseController {
 
+    private static final Logger log = LoggerFactory.getLogger(EsmInsCompanyController.class);
+
     @Autowired
     private EsmInsCompanyService esmInsCompanyService;
 
@@ -179,6 +183,7 @@ public class EsmInsCompanyController extends BaseController {
     @Operation(summary = "根据主键查询")
     @GetMapping(value = "/findById")
     public HttpResult<EsmInsCompany> findById(@RequestParam String id) {
+        log.debug("根据公司id[{}]查询公司信息",id);
         return HttpResult.ok(esmInsCompanyService.getById(id));
     }
 
@@ -402,7 +407,7 @@ public class EsmInsCompanyController extends BaseController {
     /**
      * @version
      * @author: hxl
-     * @Date: 2025/1/18 15:26
+     * @date: 2025/1/18 15:26
      * @Description: 查询子订单的合作公司列表
      */
     @Operation(summary = "查询子订单中的合作公司列表")

+ 11 - 2
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementServiceImpl.java

@@ -322,9 +322,16 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         baseMapper.updateById(agreement);
     }
 
+    /**
+     * 协议复制
+     *
+     * @author lipf
+     * @date 2026/4/14 9:46
+     */
     @Override
     @Transactional(rollbackFor = {Exception.class})
     public void agreementCopy(AgreementCopyParam param) {
+        log.info("协议复制。 param=[{}]", JSONUtil.toJsonStr(param));
         PtlAgreement agreement = getById(param.getId());
         // 获取保险公司信息
         HttpResult<EsmInsCompany> result = companyClient.findById(agreement.getCompanyId());
@@ -332,7 +339,8 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         if(result.getCode() == 200 && Objects.nonNull(result.getData())){
             companyCode = result.getData().getCompanyCode();
         }else{
-            throw new SystemException("无法获取到保险公司信息");
+            log.info("根据协议agreement[{}]中的companyId[{}]无法获取到保险公司信息", JSONUtil.toJsonStr(agreement), agreement.getId());
+            throw new SystemException("根据公司id"+agreement.getCompanyId()+"无法获取到保险公司信息");
         }
         String sysCode = baseController.getUserSystemCode();
         PtlAgreement newAgreement = new PtlAgreement();
@@ -341,7 +349,8 @@ public class PtlAgreementServiceImpl extends ServiceImpl<PtlAgreementMapper, Ptl
         newAgreement.setAgreementTitle(LocalDateTime.now().getSecond() + agreement.getAgreementTitle());
         newAgreement.setAgreementCode(sysCode + companyCode + System.currentTimeMillis());
         newAgreement.setAuditStatus(0);
-        newAgreement.setIsEnable(0);
+        // 根据测试反馈,复制后的协议,默认应该是停用状态
+        newAgreement.setIsEnable(1);
         save(newAgreement);
 
         List<String> costIds = param.getCostIds();