Selaa lähdekoodia

Merge branch 'v1.0' into bocom

# Conflicts:
#	build/resources/main/application-dev.yml
#	build/resources/main/application-prod.yml
#	src/main/java/com/inkasso/factoring/file/service/impl/FileServiceImpl.java
liutao 1 kuukausi sitten
vanhempi
commit
45894126d3

+ 1 - 1
build.gradle

@@ -5,7 +5,7 @@ plugins {
 }
 
 group = 'com.inkasso'
-version = '1.0.28-prod'
+version = '1.0.32-prod'
 sourceCompatibility = '1.8'
 
 configurations {

+ 32 - 36
build/resources/main/application-dev.yml

@@ -130,44 +130,40 @@ fdd:
   contractUrl: "http://192.168.125.194:8888/#/register"
   caykCustomId: "8210513B14FE854DF1061E2D54665AF9"
   yhrzzpCustomId: "2291B7F84D6340530A5469FB6FC15BF3"
-  registerUrl: "http://localhost:8870/fdd/accountRegister"
-  authUrl: "http://localhost:8870/fdd/getAuthAddress/sop"
-  removeAuthInfoUrl: "http://localhost:8870/fdd/removeAuthInfoUrl"
-  authUrlV3: "http://localhost:8870/fdd/v3/getAuthAddress"
-  authUrlV3PersonalFaceRecognition: "http://localhost:8870/fdd/v3/getAuthAddress/face/recognition"
-  uploadContractUrl: "http://localhost:8870/fdd/uploadContract"
-  batchSignUrl: "http://localhost:8870/fdd/manualBatchSign"
-  batchSignUrlSearchLocation: "http://localhost:8870/fdd/manualBatchSign/searchLocation"
-  authSignUrl: "http://localhost:8870/fdd/autoSign"
-  downloadContractUrl: "http://localhost:8870/fdd/downloadContract"
-  filedContractUrl: "http://localhost:8870/fdd/contractFiled"
-  beforeAutoSignUrl: "http://localhost:8870/fdd/before_autoSign"
-  shortUrl: "http://localhost:8870/fdd/short_url"
-  reportUrl: "http://localhost:8870/fdd/compliance_contract_report"
-  authInfoUrl: "http://localhost:8870/fdd/getAuthInfo"
-  getAuthInfoDetail: "http://localhost:8870/fdd/getAuthInfoDetail"
-  signInfoUrl: "http://localhost:8870/fdd/getSignInfo"
+  registerUrl: "http://192.168.3.6:8870/fdd/accountRegister"
+  authUrl: "http://192.168.3.6:8870/fdd/getAuthAddress/sop"
+  removeAuthInfoUrl: "http://192.168.3.6:8870/fdd/removeAuthInfoUrl"
+  authUrlV3: "http://192.168.3.6:8870/fdd/v3/getAuthAddress"
+  authUrlV3PersonalFaceRecognition: "http://192.168.3.6:8870/fdd/v3/getAuthAddress/face/recognition"
+  uploadContractUrl: "http://192.168.3.6:8870/fdd/uploadContract"
+  batchSignUrl: "http://192.168.3.6:8870/fdd/manualBatchSign"
+  batchSignUrlSearchLocation: "http://192.168.3.6:8870/fdd/manualBatchSign/searchLocation"
+  authSignUrl: "http://192.168.3.6:8870/fdd/autoSign"
+  downloadContractUrl: "http://192.168.3.6:8870/fdd/downloadContract"
+  filedContractUrl: "http://192.168.3.6:8870/fdd/contractFiled"
+  beforeAutoSignUrl: "http://192.168.3.6:8870/fdd/before_autoSign"
+  shortUrl: "http://192.168.3.6:8870/fdd/short_url"
+  reportUrl: "http://192.168.3.6:8870/fdd/compliance_contract_report"
+  authInfoUrl: "http://192.168.3.6:8870/fdd/getAuthInfo"
+  getAuthInfoDetail: "http://192.168.3.6:8870/fdd/getAuthInfoDetail"
+  signInfoUrl: "http://192.168.3.6:8870/fdd/getSignInfo"
 
 sop:
-  getBusinessByKeyWordUrl: http://localhost:8868/api/trade/findBusinessName
-  comprehensiveRiskInvestigationUrl: http://localhost:8868/api/trade/comprehensiveRiskInvestigation
-  judgmentDocumentsUrl: http://localhost:8868/api/trade/judgmentDocuments
-  dongjiangaoRisksUrl: http://localhost:8868/api/trade/dongjiangaoRisk
-  pubStockUrl: http://localhost:8868/api/trade/pubStock
-  addBusinessUrl: http://localhost:8868/api/trade/addBusiness
-  sixSearchUrl: http://localhost:8868/api/trade/sixSearch
-  twoSearchUrl: http://localhost:8868/api/trade/twoSearch
-  getChangesUrl: http://localhost:8868/api/trade/getChanges
-  getBusinesssScoreUrl: http://localhost:8868/api/trade/getBusinesssScore
-  synchronizeInformation: http://localhost:8868/sys/customer/synchronize/information
-  getEnterpriseAreaUrl: http://localhost:8868/api/trade/getEnterpriseArea
-  viewLatestPlanUrl: http://localhost:8868/api/payColl/viewLatestPlan
-  judgeCustomerGradeUrl: http://localhost:8868/api/judgeCustomerGrade
-  getReturnedPrincipalByBusinessNo: http://localhost:8868/api/trade/getReturnedPrincipalByBusinessNo
-  getEnterpriseDetail: http://localhost:8868/api/trade/getEnterpriseDetail
-  partnerList: http://localhost:8868/api/trade/partnerList
-  actualControl: http://localhost:8868/api/trade/actualControl
-  beneficialOwner: http://localhost:8868/api/trade/beneficialOwner
+  getBusinessByKeyWordUrl: http://192.168.3.6:8868/api/trade/findBusinessName
+  comprehensiveRiskInvestigationUrl: http://192.168.3.6:8868/api/trade/comprehensiveRiskInvestigation
+  judgmentDocumentsUrl: http://192.168.3.6:8868/api/trade/judgmentDocuments
+  dongjiangaoRisksUrl: http://192.168.3.6:8868/api/trade/dongjiangaoRisk
+  pubStockUrl: http://192.168.3.6:8868/api/trade/pubStock
+  addBusinessUrl: http://192.168.3.6:8868/api/trade/addBusiness
+  sixSearchUrl: http://192.168.3.6:8868/api/trade/sixSearch
+  twoSearchUrl: http://192.168.3.6:8868/api/trade/twoSearch
+  getChangesUrl: http://192.168.3.6:8868/api/trade/getChanges
+  getBusinesssScoreUrl: http://192.168.3.6:8868/api/trade/getBusinesssScore
+  synchronizeInformation: http://192.168.3.6:8868/sys/customer/synchronize/information
+  getEnterpriseAreaUrl: http://192.168.3.6:8868/api/trade/getEnterpriseArea
+  viewLatestPlanUrl: http://192.168.3.6:8868/api/payColl/viewLatestPlan
+  judgeCustomerGradeUrl: http://192.168.3.6:8868/api/judgeCustomerGrade
+  getReturnedPrincipalByBusinessNo: http://192.168.3.6:8868/api/trade/getReturnedPrincipalByBusinessNo
 
 trade:
   biddingManagementStartProcessUrl: http://localhost:8888/api/biddingManagement/startProcess

+ 1 - 1
src/main/java/com/inkasso/factoring/common/service/impl/SerialNumberGeneratorImpl.java

@@ -65,7 +65,7 @@ public class SerialNumberGeneratorImpl implements SerialNumberGenerator {
 
     @Override
     @Transactional
-    public String nextValue(String prefixType) {
+    public synchronized String nextValue(String prefixType) {
         //获取前置字符
         String prefix = getCurrentPrefix(prefixType);
         //获取当前数据库中对应SystemSerialNum

+ 49 - 41
src/main/java/com/inkasso/factoring/creditmanagement/service/impl/SupplierInfoServiceImpl.java

@@ -323,10 +323,11 @@ public class SupplierInfoServiceImpl extends ServiceImpl<SupplierInfoMapper, Sup
             zxCountBig = zxCount;
             stCountBig = stCount;
         } else {
+            int num = 1;
             //判定没名字超过4个字  就是公司
             if (stockName.length() > 4) {
                 //公司循环找出大股东
-                findBig(cPartner.getCreditCode(), comprehensiveRiskInvestigationId, existEnterprise);
+                findBig(cPartner.getCreditCode(), comprehensiveRiskInvestigationId, existEnterprise,num);
                 sxCountBig = existEnterprise.getSxCountBig();
                 zxCountBig = existEnterprise.getZxCountBig();
                 stCountBig = existEnterprise.getStCountBig();
@@ -1135,48 +1136,55 @@ public class SupplierInfoServiceImpl extends ServiceImpl<SupplierInfoMapper, Sup
         return flag;
     }
 
-    private void findBig(String creditCode, Long comprehensiveRiskInvestigationId, Enterprise enterprise) {
-        // 股东信息 工商登记
-        String pubStockUrl = pubStock + "?socialCreditCode=" + creditCode + "&comprehensiveRiskInvestigationId=" + comprehensiveRiskInvestigationId;
-        ResponseJson forObject;
-        try {
-            forObject = restTemplate.getForObject(pubStockUrl, ResponseJson.class);
-        } catch (Exception e) {
-            throw new ServiceException(CodeUtil.FAIL, "网络异常,请稍后重试!");
-        }
-        if (forObject != null) {
-            JSONObject jsonObject = new JSONObject(forObject.getData());
-            List<CRegStock> list = jsonObject.getBeanList("list", CRegStock.class);
-            CRegStock cRegStock = list.stream().map(r -> {
-                String stockPercent = r.getStockPercent();
-                stockPercent = stockPercent.replace("%", "");
-                double percent = Double.valueOf(stockPercent);
-                r.setPercent(percent);
-                return r;
-            }).max(Comparator.comparing(CRegStock::getPercent)).get();
-            String cRegStockStockName = cRegStock.getStockName();
-            if (cRegStockStockName.length() > 4) {
-                findBig(cRegStock.getCreditCode(), comprehensiveRiskInvestigationId, enterprise);
-            } else {
-                //大股东 763-董监高风险扫描
-                enterprise.setMajorShareholders(cRegStock.getStockName());
-                String bigDongjiangaoRisksUrl = dongjiangaoRisks + "?socialCreditCode=" + creditCode + "&personName=" + cRegStockStockName;
-                ResponseJson bigDongjiangaoRisksObject;
-                try {
-                    bigDongjiangaoRisksObject = restTemplate.getForObject(bigDongjiangaoRisksUrl, ResponseJson.class);
-                } catch (Exception e) {
-                    throw new ServiceException(CodeUtil.FAIL, "网络异常,请稍后重试!");
+    private void findBig(String creditCode, Long comprehensiveRiskInvestigationId, Enterprise enterprise, int num) {
+        if(num < 5){
+            num ++;
+            // 股东信息 工商登记
+            String pubStockUrl = pubStock + "?socialCreditCode=" + creditCode + "&comprehensiveRiskInvestigationId=" + comprehensiveRiskInvestigationId;
+            ResponseJson forObject;
+            try {
+                forObject = restTemplate.getForObject(pubStockUrl, ResponseJson.class);
+            } catch (Exception e) {
+                throw new ServiceException(CodeUtil.FAIL, "网络异常,请稍后重试!");
+            }
+            if (forObject != null) {
+                JSONObject jsonObject = new JSONObject(forObject.getData());
+                List<CRegStock> list = jsonObject.getBeanList("list", CRegStock.class);
+                CRegStock cRegStock = list.stream().map(r -> {
+                    String stockPercent = r.getStockPercent();
+                    stockPercent = stockPercent.replace("%", "");
+                    double percent = Double.valueOf(stockPercent);
+                    r.setPercent(percent);
+                    return r;
+                }).max(Comparator.comparing(CRegStock::getPercent)).get();
+                String cRegStockStockName = cRegStock.getStockName();
+                if (cRegStockStockName.length() > 4) {
+                    findBig(cRegStock.getCreditCode(), comprehensiveRiskInvestigationId, enterprise, num);
+                } else {
+                    //大股东 763-董监高风险扫描
+                    enterprise.setMajorShareholders(cRegStock.getStockName());
+                    String bigDongjiangaoRisksUrl = dongjiangaoRisks + "?socialCreditCode=" + creditCode + "&personName=" + cRegStockStockName;
+                    ResponseJson bigDongjiangaoRisksObject;
+                    try {
+                        bigDongjiangaoRisksObject = restTemplate.getForObject(bigDongjiangaoRisksUrl, ResponseJson.class);
+                    } catch (Exception e) {
+                        throw new ServiceException(CodeUtil.FAIL, "网络异常,请稍后重试!");
+                    }
+                    JSONObject bigDongjiangaoRisks = new JSONObject(bigDongjiangaoRisksObject.getData());
+                    Integer sxCountBig = bigDongjiangaoRisks.getInt("sxCount");
+                    Integer zxCountBig = bigDongjiangaoRisks.getInt("zxCount");
+                    Integer stCountBig = bigDongjiangaoRisks.getInt("stCount");
+                    Long dongjiangaoRiskBigId = bigDongjiangaoRisks.getLong("id");
+                    enterprise.setcDongjiangaoRiskBigId(dongjiangaoRiskBigId);
+                    enterprise.setSxCountBig(sxCountBig);
+                    enterprise.setZxCountBig(zxCountBig);
+                    enterprise.setStCountBig(stCountBig);
                 }
-                JSONObject bigDongjiangaoRisks = new JSONObject(bigDongjiangaoRisksObject.getData());
-                Integer sxCountBig = bigDongjiangaoRisks.getInt("sxCount");
-                Integer zxCountBig = bigDongjiangaoRisks.getInt("zxCount");
-                Integer stCountBig = bigDongjiangaoRisks.getInt("stCount");
-                Long dongjiangaoRiskBigId = bigDongjiangaoRisks.getLong("id");
-                enterprise.setcDongjiangaoRiskBigId(dongjiangaoRiskBigId);
-                enterprise.setSxCountBig(sxCountBig);
-                enterprise.setZxCountBig(zxCountBig);
-                enterprise.setStCountBig(stCountBig);
             }
+        }else {
+            enterprise.setSxCountBig(0);
+            enterprise.setZxCountBig(0);
+            enterprise.setStCountBig(0);
         }
     }
 }

+ 48 - 34
src/main/java/com/inkasso/factoring/financingmanagement/service/impl/FinancingApplyServiceImpl.java

@@ -19,6 +19,7 @@ import com.inkasso.factoring.common.entity.ResponseJson;
 import com.inkasso.factoring.common.enums.ProjectInitiationStatusEnum;
 import com.inkasso.factoring.creditmanagement.entity.Enterprise;
 import com.inkasso.factoring.creditmanagement.entity.ProjectInformation;
+import com.inkasso.factoring.creditmanagement.enums.ProjectInitiationStatusDict;
 import com.inkasso.factoring.creditmanagement.service.IEnterpriseService;
 import com.inkasso.factoring.creditmanagement.service.IProjectInformationService;
 import com.inkasso.factoring.dict.entity.Dictionary;
@@ -181,39 +182,49 @@ public class FinancingApplyServiceImpl implements FinancingApplyService {
                             .eq("c_acceptance_basic_info_id", cAcceptanceBasicInfo.getId()));
                     if (CollectionUtil.isNotEmpty(goodsInfoList)) {
                         List<Long> settlementBasicInfoIds = goodsInfoList.stream().map(SettlementGoodsInfo::getSettlementBasicInfoId).distinct().collect(Collectors.toList());
-                        SettlementBasicInfo settlementBasicInfo = settlementBasicInfoService.getById(settlementBasicInfoIds.get(0));
+
+                        SettlementBasicInfo settlementBasicInfo = null;
+                        for (Long settlementBasicInfoId : settlementBasicInfoIds) {
+                            SettlementBasicInfo info = settlementBasicInfoService.getById(settlementBasicInfoId);
+                            if (info != null && ProjectInitiationStatusDict.COMPLETED.getCode().equals(info.getSettlementStatus())) {
+                                settlementBasicInfo = info;
+                                break;
+                            }
+                        }
                         if (settlementBasicInfo != null) {
                             vo.setSettlementNumber(settlementBasicInfo.getSettlementNumber());
                             vo.setSettlementStatus(dictService.getByCode(settlementBasicInfo.getSettlementStatus()).getName());
+
+                            List<SettlementGoodsInfo> settlementGoodsInfoList = settlementGoodsInfoService.list(new QueryWrapper<SettlementGoodsInfo>()
+                                    .eq("acceptance_goods_number", cAcceptanceBasicInfo.getAcceptanceGoodsNumber())
+                                    .eq("c_settlement_basic_info_id", settlementBasicInfo.getId()));
+                            if (CollectionUtil.isNotEmpty(settlementGoodsInfoList)) {
+                                List<CAcceptanceGoodsInfo> acceptanceGoodsInfoList = settlementGoodsInfoList.stream().map(settlementGoodsInfo -> {
+                                    CAcceptanceGoodsInfo cAcceptanceGoodsInfo = acceptanceGoodsInfoService.getById(settlementGoodsInfo.getAcceptanceGoodsInfoId());
+                                    cAcceptanceGoodsInfo.setSettlementGoodsInfoId(settlementGoodsInfo.getId());
+                                    cAcceptanceGoodsInfo.setSettlementBasicInfoId(settlementGoodsInfo.getSettlementBasicInfoId());
+                                    cAcceptanceGoodsInfo.setSalesPrice(settlementGoodsInfo.getSalesPrice());
+                                    cAcceptanceGoodsInfo.setSalesTotalPrice(settlementGoodsInfo.getSalesTotalPrice());
+                                    cAcceptanceGoodsInfo.setSalesGuaranteeMoney(settlementGoodsInfo.getSalesGuaranteeMoney());
+                                    cAcceptanceGoodsInfo.setPurchasePrice(settlementGoodsInfo.getPurchasePrice());
+                                    cAcceptanceGoodsInfo.setPurchaseTotalPrice(settlementGoodsInfo.getPurchaseTotalPrice());
+                                    cAcceptanceGoodsInfo.setPurchGuaranteeMoney(settlementGoodsInfo.getPurchaseGuaranteeMoney());
+                                    cAcceptanceGoodsInfo.setFloatingPrice(settlementGoodsInfo.getFloatingPrice());
+                                    cAcceptanceGoodsInfo.setReferencePrice(settlementGoodsInfo.getReferencePrice());
+                                    return cAcceptanceGoodsInfo;
+                                }).collect(Collectors.toList());
+                                //计算验收数量
+                                BigDecimal acceptanceNumTotal = settlementGoodsInfoList.stream().filter(goods -> goods.getGoodsQuantity() != null).map(SettlementGoodsInfo::getGoodsQuantity)
+                                        .reduce(BigDecimal.ZERO, BigDecimal::add);
+                                vo.setAcceptanceNumTotal(acceptanceNumTotal);
+                                //计算结算总价
+                                BigDecimal settlementAmountTotal = settlementGoodsInfoList.stream().filter(goods -> goods.getSalesTotalPrice() != null).map(SettlementGoodsInfo::getSalesTotalPrice)
+                                        .reduce(BigDecimal.ZERO, BigDecimal::add);
+                                vo.setSettlementAmountTotal(settlementAmountTotal);
+                                vo.setAcceptanceGoodInfos(acceptanceGoodsInfoList);
+                            }
                         }
                     }
-                    List<SettlementGoodsInfo> settlementGoodsInfoList = settlementGoodsInfoService.list(new QueryWrapper<SettlementGoodsInfo>()
-                            .eq("acceptance_goods_number", cAcceptanceBasicInfo.getAcceptanceGoodsNumber()));
-                    if (CollectionUtil.isNotEmpty(settlementGoodsInfoList)) {
-                        List<CAcceptanceGoodsInfo> acceptanceGoodsInfoList = settlementGoodsInfoList.stream().map(settlementGoodsInfo -> {
-                            CAcceptanceGoodsInfo cAcceptanceGoodsInfo = acceptanceGoodsInfoService.getById(settlementGoodsInfo.getAcceptanceGoodsInfoId());
-                            cAcceptanceGoodsInfo.setSettlementGoodsInfoId(settlementGoodsInfo.getId());
-                            cAcceptanceGoodsInfo.setSettlementBasicInfoId(settlementGoodsInfo.getSettlementBasicInfoId());
-                            cAcceptanceGoodsInfo.setSalesPrice(settlementGoodsInfo.getSalesPrice());
-                            cAcceptanceGoodsInfo.setSalesTotalPrice(settlementGoodsInfo.getSalesTotalPrice());
-                            cAcceptanceGoodsInfo.setSalesGuaranteeMoney(settlementGoodsInfo.getSalesGuaranteeMoney());
-                            cAcceptanceGoodsInfo.setPurchasePrice(settlementGoodsInfo.getPurchasePrice());
-                            cAcceptanceGoodsInfo.setPurchaseTotalPrice(settlementGoodsInfo.getPurchaseTotalPrice());
-                            cAcceptanceGoodsInfo.setPurchGuaranteeMoney(settlementGoodsInfo.getPurchaseGuaranteeMoney());
-                            cAcceptanceGoodsInfo.setFloatingPrice(settlementGoodsInfo.getFloatingPrice());
-                            cAcceptanceGoodsInfo.setReferencePrice(settlementGoodsInfo.getReferencePrice());
-                            return cAcceptanceGoodsInfo;
-                        }).collect(Collectors.toList());
-                        //计算验收数量
-                        BigDecimal acceptanceNumTotal = settlementGoodsInfoList.stream().filter(goods -> goods.getGoodsQuantity() != null).map(SettlementGoodsInfo::getGoodsQuantity)
-                                .reduce(BigDecimal.ZERO, BigDecimal::add);
-                        vo.setAcceptanceNumTotal(acceptanceNumTotal);
-                        //计算结算总价
-                        BigDecimal settlementAmountTotal = settlementGoodsInfoList.stream().filter(goods -> goods.getSalesTotalPrice() != null).map(SettlementGoodsInfo::getSalesTotalPrice)
-                                .reduce(BigDecimal.ZERO, BigDecimal::add);
-                        vo.setSettlementAmountTotal(settlementAmountTotal);
-                        vo.setAcceptanceGoodInfos(acceptanceGoodsInfoList);
-                    }
                 } else {
                     //如果该笔验收单未做过结算
                     List<CAcceptanceGoodsInfo> goodsInfoList = acceptanceGoodsInfoService
@@ -519,14 +530,17 @@ public class FinancingApplyServiceImpl implements FinancingApplyService {
      * @param businessNumber
      */
     private void checkAcceptance(String businessNumber) {
-        List<CAcceptanceBasicInfo> acceptanceBasicInfoList = acceptanceBasicInfoService.list(new QueryWrapper<CAcceptanceBasicInfo>().eq("business_number", businessNumber));
+        List<CAcceptanceBasicInfo> acceptanceBasicInfoList = acceptanceBasicInfoService.list(new QueryWrapper<CAcceptanceBasicInfo>()
+                .eq("business_number", businessNumber));
         if (CollectionUtil.isNotEmpty(acceptanceBasicInfoList)) {
             for (CAcceptanceBasicInfo acceptanceBasicInfo : acceptanceBasicInfoList) {
-                if (acceptanceBasicInfo.getSettlement() != null && !acceptanceBasicInfo.getSettlement()) {
-                    //未结算
-                    if (acceptanceBasicInfo.getExpectedSettlementDate() != null
-                            && DateUtil.beginOfDay(new Date()).compareTo(acceptanceBasicInfo.getExpectedSettlementDate()) > 0) {
-                        throw new BusinessException(CodeUtil.FAIL, "存在到期未结算的验收单,请联系业务经理");
+                if (ProjectInitiationStatusEnum.COMPLETED.getCode().equals(acceptanceBasicInfo.getAcceptanceStatus())) {
+                    if (acceptanceBasicInfo.getSettlement() != null && !acceptanceBasicInfo.getSettlement()) {
+                        //未结算
+                        if (acceptanceBasicInfo.getExpectedSettlementDate() != null
+                                && DateUtil.beginOfDay(new Date()).compareTo(acceptanceBasicInfo.getExpectedSettlementDate()) > 0) {
+                            throw new BusinessException(CodeUtil.FAIL, "存在到期未结算的验收单,请联系业务经理");
+                        }
                     }
                 }
             }