2 Commit-ok bb095f48e7 ... 3d56772cb1

Szerző SHA1 Üzenet Dátum
  liangbo.huang 3d56772cb1 贸易采购合同静默签署 2 hete%!(EXTRA string=óta)
  liangbo.huang ef75e5cae6 贸易采购合同静默签署 2 hete%!(EXTRA string=óta)

+ 0 - 4
trade-client/src/main/java/com/trade/client/config/CustomizeConfiguration.java

@@ -6,7 +6,6 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.context.annotation.Configuration;
 
 import java.math.BigDecimal;
-import java.util.List;
 
 @Configuration
 @Getter
@@ -43,7 +42,4 @@ public class CustomizeConfiguration {
     // 退税服务联系地址
     @Value("${taxRebate.serviceFee.contactAddress:上海市普陀区铜川路699弄2号中海中心A座1901室}")
     private String taxRebateServiceFeeContactAddress;
-    // 自动签署的企业名单(企业社会统一信用代码,逗号分隔)
-    @Value("#{'${esign.autoSignList}'.split(',')}")
-    private List<String> autoSignEnterpriseCertNoList;
 }

+ 23 - 13
trade-client/src/main/java/com/trade/client/trade/purchasecontract/service/impl/PurchaseContractServiceImpl.java

@@ -21,6 +21,7 @@ import com.trade.common.validate.ValidatorGroup;
 import com.trade.common.validate.ValidatorUtil;
 import com.trade.service.DictConstants;
 import com.trade.service.TransStruct;
+import com.trade.service.contract.config.ContractConfigProperties;
 import com.trade.service.contract.constant.ContractConstant;
 import com.trade.service.contract.dto.*;
 import com.trade.service.contract.service.ContractService;
@@ -113,6 +114,8 @@ public class PurchaseContractServiceImpl implements PurchaseContractService {
     private ContractFileService contractFileService;
     @Resource
     private PurchaseOrderService purchaseOrderService;
+    @Resource
+    private ContractConfigProperties contractConfigProperties;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -711,8 +714,8 @@ public class PurchaseContractServiceImpl implements PurchaseContractService {
         if (!DictConstants.EXPORT_TYPE_PROXY.equals(enterprise.getExportType())
                 || !DictConstants.DISTRICT_CN_MAINLAND.equals(enterprise.getProxyDistrictCode())) {
             // 自营出口或者非大陆贸易平台代理,人工录入采购单价,这里重新计算下商品金额
-            purchaseContractDto.getCommodityList().forEach(purchaseCommodityDto -> purchaseCommodityDto.setAmount(
-                    purchaseCommodityDto.getPriceUnit().multiply(purchaseCommodityDto.getNumber())));
+            purchaseContractDto.getCommodityList().forEach(purchaseCommodityDto -> purchaseCommodityDto
+                    .setAmount(purchaseCommodityDto.getPriceUnit().multiply(purchaseCommodityDto.getNumber())));
             // 含税金额 = 采购商品金额 * (1 + 增值税率)
             purchaseContractDto.getCommodityList()
                     .forEach(purchaseCommodityDto -> purchaseCommodityDto.setAmount(purchaseCommodityDto.getAmount()
@@ -891,25 +894,32 @@ public class PurchaseContractServiceImpl implements PurchaseContractService {
      */
     private List<ContractSeal> getContractSeals(SignPartyInfo signPartyInfo, String companySignKeyword,
             String personalSignKeyword) {
-        ContractSigner signer = new ContractSigner();
-        signer.setSigner(signPartyInfo.getLegalPersonName());
-        signer.setSignerIdNo(signPartyInfo.getLegalPersonCertNo());
-        signer.setSignerIdType(ESignConstant.CRED_PSN_CH_IDCARD);
-        signer.setMobile(signPartyInfo.getLegalPersonPhone());
+        boolean autoSign = CollUtil.isNotEmpty(contractConfigProperties.getESignSealIdMap())
+                && contractConfigProperties.getESignSealIdMap()
+                        .containsKey(signPartyInfo.getEnterpriseCertNo());
         List<ContractSeal> sealInfoList = new ArrayList<>();
         ContractSeal companySeal = new ContractSeal();
-        companySeal.setSigner(signer);
+        companySeal.setAutoSign(autoSign);
         companySeal.setKeyword(companySignKeyword);
         companySeal.setSealIdType(ESignConstant.CRED_ORG_USCC);
         companySeal.setSealName(signPartyInfo.getEnterpriseName());
         companySeal.setSealIdNo(signPartyInfo.getEnterpriseCertNo());
         companySeal.setWithTime(true);
-        ContractSeal legalSeal = new ContractSeal();
-        legalSeal.setSigner(signer);
-        legalSeal.setKeyword(personalSignKeyword);
-        legalSeal.setWithTime(true);
+        // 如果静默签署,则不考虑法人签署
+        if (autoSign) {
+            ContractSigner signer = new ContractSigner();
+            signer.setSigner(signPartyInfo.getLegalPersonName());
+            signer.setSignerIdNo(signPartyInfo.getLegalPersonCertNo());
+            signer.setSignerIdType(ESignConstant.CRED_PSN_CH_IDCARD);
+            signer.setMobile(signPartyInfo.getLegalPersonPhone());
+            companySeal.setSigner(signer);
+            ContractSeal legalSeal = new ContractSeal();
+            legalSeal.setSigner(signer);
+            legalSeal.setKeyword(personalSignKeyword);
+            legalSeal.setWithTime(true);
+            sealInfoList.add(legalSeal);
+        }
         sealInfoList.add(companySeal);
-        sealInfoList.add(legalSeal);
         return sealInfoList;
     }