|
|
@@ -7,10 +7,12 @@ 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;
|
|
|
import com.ydtech.modules.admin.service.SysUserService;
|
|
|
+import com.ydtech.modules.base.controller.BaseController;
|
|
|
import com.ydtech.modules.esm.model.EsmInsCompany;
|
|
|
import com.ydtech.modules.esm.service.EsmInsCompanyService;
|
|
|
import com.ydtech.modules.fee.service.CostsCalcService;
|
|
|
@@ -31,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;
|
|
|
@@ -92,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) {
|
|
|
//计算费用因子
|
|
|
@@ -108,14 +114,19 @@ public class QuoteVerificationAspect {
|
|
|
InsFeeOrderNew insFeeOrderNew = insFeeOrderNewService.getInsFeeOrderNewByCompanyId(insAreaCompany.getId());
|
|
|
if (insFeeOrderNew != null) {
|
|
|
//出口
|
|
|
- SubOrderExportFeeVo subOrderExportFeeVo = costsCalcService.getExportFee(insFeeOrderNew);
|
|
|
-
|
|
|
- result.getData().setJqExportFee(subOrderExportFeeVo.getJqExportCosts());
|
|
|
- result.getData().setSyExportFee(subOrderExportFeeVo.getSyExportCosts());
|
|
|
- result.getData().setNoExportFee(subOrderExportFeeVo.getNoExportCosts());
|
|
|
- result.getData().setSumExportFee(subOrderExportFeeVo.getJqExportCosts()
|
|
|
- .add(subOrderExportFeeVo.getSyExportCosts())
|
|
|
- .add(subOrderExportFeeVo.getNoExportCosts()));
|
|
|
+ //add by hxl 添加出单员不能查看优惠的限制 2024-07-11
|
|
|
+ String userId = new BaseController().getUserId();
|
|
|
+ SysUserRole sysUserRole = sysUserRoleService.selectByUserId(userId);
|
|
|
+ if(sysUserRole!=null && sysUserRole.getRoleId()!=19){
|
|
|
+ //出口
|
|
|
+ SubOrderExportFeeVo subOrderExportFeeVo = costsCalcService.getExportFee(insFeeOrderNew);
|
|
|
+ result.getData().setJqExportFee(subOrderExportFeeVo.getJqExportCosts());
|
|
|
+ result.getData().setSyExportFee(subOrderExportFeeVo.getSyExportCosts());
|
|
|
+ result.getData().setNoExportFee(subOrderExportFeeVo.getNoExportCosts());
|
|
|
+ result.getData().setSumExportFee(subOrderExportFeeVo.getJqExportCosts()
|
|
|
+ .add(subOrderExportFeeVo.getSyExportCosts())
|
|
|
+ .add(subOrderExportFeeVo.getNoExportCosts()));
|
|
|
+ }
|
|
|
}else{
|
|
|
//输出费用匹配失败日志
|
|
|
result.getData().setFeeNoDescription(logs.toString());
|
|
|
@@ -157,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
|