소스 검색

协议费用新增的时候,新增对关联协议费用的校验

lipf 4 달 전
부모
커밋
cc8e36606e

+ 0 - 1
platform/src/main/resources/mapper/PtlAgreementAttributionMapper.xml

@@ -37,7 +37,6 @@
         <if test="ptlAgreementAttributionQueryVo.username != null and ptlAgreementAttributionQueryVo.username != ''">
             and paa.username like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
             or paa.user_abbr like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
-            or eic.name_simple like concat('%',#{ptlAgreementAttributionQueryVo.username},'%')
         </if>
         <if test="ptlAgreementAttributionQueryVo.quoteStatus != null and ptlAgreementAttributionQueryVo.quoteStatus != ''">
             and paa.quote_status = #{ptlAgreementAttributionQueryVo.quoteStatus}

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/controller/PtlAgreementCostController.java

@@ -38,7 +38,7 @@ public class PtlAgreementCostController {
     @OperatorTrajectory(moduleName = "报价配置/费用管理/新增费用",OperationDict = OperationTypeEnum.IN_AGREEMENT,mapperClass = PtlAgreementCostMapper.class,entityClass = PtlAgreemenCostAdd.class)
     @Operation(summary = "协议费用管理新增")
     @PostMapping("save")
-    public HttpResult add(@RequestBody @Valid PtlAgreemenCostAdd ptlAgreemenCostAdd){
+    public HttpResult<String> add(@RequestBody @Valid PtlAgreemenCostAdd ptlAgreemenCostAdd){
         return ptlAgreementCostService.save(ptlAgreemenCostAdd);
     }
 

+ 1 - 1
tenant/organization/src/main/java/com/jzg/organization/service/PtlAgreementCostService.java

@@ -19,7 +19,7 @@ public interface PtlAgreementCostService extends IService<PtlAgreementCost> {
      * @author lipf
      * @date 2026/4/13 14:16
      */
-    HttpResult save(PtlAgreemenCostAdd ptlAgreemenCostAdd);
+    HttpResult<String> save(PtlAgreemenCostAdd ptlAgreemenCostAdd);
 
 
     /**

+ 5 - 3
tenant/organization/src/main/java/com/jzg/organization/service/impl/PtlAgreementCostServiceImpl.java

@@ -35,7 +35,6 @@ import com.jzg.organization.state.listener.CostStateListener;
 import io.seata.spring.annotation.GlobalTransactional;
 import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
-import org.redisson.api.IdGenerator;
 import org.redisson.api.RList;
 import org.redisson.api.RedissonClient;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -48,7 +47,6 @@ import org.springframework.util.CollectionUtils;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.Arrays;
-import java.util.Collections;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -99,8 +97,12 @@ public class PtlAgreementCostServiceImpl extends ServiceImpl<PtlAgreementCostMap
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public HttpResult save(PtlAgreemenCostAdd ptlAgreemenCostAdd) {
+    public HttpResult<String> save(PtlAgreemenCostAdd ptlAgreemenCostAdd) {
         log.info("报价配置/费用管理/新增费用. ptlAgreemenCostAdd=[{}]", JSONUtil.toJsonStr(ptlAgreemenCostAdd));
+        if(StrUtil.isEmpty(ptlAgreemenCostAdd.getPtlAgreementId()) || StrUtil.isEmpty(ptlAgreemenCostAdd.getPtlAgreementCode())){
+            log.info("新增费用的时候,需要指定关联的协议信息。ptlAgreemenCostAdd=[{}]", JSONUtil.toJsonStr(ptlAgreemenCostAdd));
+            return HttpResult.error("新增费用的时候,需要指定关联的协议信息");
+        }
         List<CostAdd> costAddList = ptlAgreemenCostAdd.getCostAddList();
         if (costAddList.isEmpty()) {
             log.info("费用管理:保存数据不能为空");