Browse Source

1.报价提交外部订单不可报价的限制
2.外部订单修改生成的轨迹表

hxl13994548489 2 years ago
parent
commit
a670d479d9

+ 15 - 0
src/main/java/com/ydtech/modules/order/aop/aspect/QuoteVerificationAspect.java

@@ -7,6 +7,7 @@ import com.ydtech.constants.enums.dict.InsOrderStatusEnum;
 import com.ydtech.constants.enums.dict.agreement.ProductsType;
 import com.ydtech.constants.sys.SystemConstant;
 import com.ydtech.core.page.HttpResult;
+import com.ydtech.exception.SystemException;
 import com.ydtech.modules.admin.model.SysUser;
 import com.ydtech.modules.admin.model.SysUserRole;
 import com.ydtech.modules.admin.service.SysUserRoleService;
@@ -32,9 +33,11 @@ import com.ydtech.modules.order.service.InsOrdersService;
 import com.ydtech.modules.protocol.constants.TaxSourceStatusConstants;
 import com.ydtech.modules.protocol.dao.PtlTaxSourceNewMapper;
 import com.ydtech.modules.protocol.entity.dto.TaxSourceExcludeDto;
+import com.ydtech.modules.protocol.entity.po.PtlAgreement;
 import com.ydtech.modules.protocol.entity.po.PtlTaxSourceNew;
 import com.ydtech.modules.protocol.service.ITaxSourceExcludeService;
 import com.ydtech.modules.protocol.service.PtlAgreementDeptService;
+import com.ydtech.modules.protocol.service.PtlAgreementService;
 import com.ydtech.modules.protocol.service.PtlTaxSourceNewService;
 import com.ydtech.modules.protocol.service.impl.TaxSourceServiceImpl;
 import com.ydtech.modules.protocols.entity.po.InsFeeOrderNew;
@@ -93,6 +96,8 @@ public class QuoteVerificationAspect {
 
     private final PtlTaxSourceNewMapper ptlTaxSourceNewMapper;
 
+    private final PtlAgreementService ptlAgreementService;
+
     @AfterReturning(pointcut = "@annotation(com.ydtech.modules.order.aop.QuoteVerification)", returning = "result")
     public void doAfter(HttpResult<QuoteRespVo> result) {
         //计算费用因子
@@ -163,6 +168,16 @@ public class QuoteVerificationAspect {
                     userId = new BaseController().getUserId();
                 }
                  **/
+                //添加外部订单的限制  add by hxl  2024-07-12
+                List<InsAreaCompany> insAreaList = insAreaCompanyService.getBaseMapper().selectList(new LambdaQueryWrapper<InsAreaCompany>().eq(InsAreaCompany::getOrderno, orderno));
+                if(insAreaList!=null  && insAreaList.size()>0 ){
+                    for(InsAreaCompany subOrder : insAreaList){
+                        PtlAgreement ptlAgreement = ptlAgreementService.getById(subOrder.getAgreementId());
+                        if(ptlAgreement!=null && ptlAgreement.getIsExternal()!=null && ptlAgreement.getIsExternal()==1){
+                            throw new SystemException("外部订单不允许报价,请到外部订单编辑页面进行编辑!!");
+                        }
+                    }
+                }
                 //税源查询
                 BaseQuoteInfoVo quoteInfo = insOrdersComponents.getQuoteInfo(orderno, agreementId);
                  //add by hxl  2024-06-12  改为从主订单表中获取数据用户id和部门id

+ 3 - 3
src/main/java/com/ydtech/modules/order/service/impl/InsAreaCompanyServiceImpl.java

@@ -781,10 +781,10 @@ public class InsAreaCompanyServiceImpl extends ServiceImpl<InsAreaCompanyMapper,
         this.updateById(insAreaCompany);
 
         //更新轨迹表
-        if(insOrdersEditingVo.getStageFlag()==1){
-            insOrdersTrackService.addingTrajectoriesNew(insAreaCompany);
+       // if(insOrdersEditingVo.getStageFlag()==1){
+            insOrdersTrackService.addingTrajectories(insAreaCompany);
             insOrdersService.updateByOrderStatus(insAreaCompany);
-        }
+       // }
         //查找协议的费用
         AgreementProductQueryVo agreementProductQueryVo = new AgreementProductQueryVo();
         List<String> productId = new ArrayList<>();