Explorar el Código

Merge remote-tracking branch 'origin/dev1.0' into dev1.0

zhangc hace 5 meses
padre
commit
4d5c14bcca

+ 1 - 1
build.gradle

@@ -9,7 +9,7 @@ targetCompatibility = 1.8
 
 jar {
     baseName = 'factoring-trade-prod'
-    version = '1.0.26'
+    version = '1.0.35'
 }
 
 springBoot {

+ 12 - 7
src/main/java/com/sunxung/factoring/component/aspect/OperationLogAspect.java

@@ -73,6 +73,9 @@ public class OperationLogAspect {
             StackTraceElement[] stackElements = e.getStackTrace();
             if (stackElements != null) {
                 StringBuffer error = new StringBuffer();
+                String errorName = e.toString();
+                error.append(errorName);
+                error.append("\n");
                 for (int i = 0; i < stackElements.length; i++) {
                     String className = stackElements[i].getClassName();
                     String fileName = "(" + stackElements[i].getFileName();
@@ -84,7 +87,7 @@ public class OperationLogAspect {
                     error.append(lineNumber);
                     error.append("\n");
                 }
-                log.error(error.toString());
+                log.error(error);
             }
             throw new ValidatorException(CodeUtil.FAIL, e.getMessage());
         } finally {
@@ -132,12 +135,14 @@ public class OperationLogAspect {
                     // 请求URL
                     sysOperationLog.setUrl(request.getRequestURL().toString());
                     User user = ThreadLocalUtil.getUser();
-                    sysOperationLog.setUserCreate(user.getLoginName());
-                    sysOperationLog.setUserModified(user.getLoginName());
-                    //登录日志id
-                    LoginLog loginLog = loginLogService.findLastLogInByUserAndIp(user.getLoginName(), clientIP);
-                    if(loginLog!=null){
-                        sysOperationLog.setSysLoginLogId(loginLog.getId());
+                    if(user != null){
+                        sysOperationLog.setUserCreate(user.getLoginName());
+                        sysOperationLog.setUserModified(user.getLoginName());
+                        //登录日志id
+                        LoginLog loginLog = loginLogService.findLastLogInByUserAndIp(user.getLoginName(), clientIP);
+                        if(loginLog!=null){
+                            sysOperationLog.setSysLoginLogId(loginLog.getId());
+                        }
                     }
                     sysOperationLogService.save(sysOperationLog);
                 }

+ 5 - 0
src/main/java/com/sunxung/factoring/component/config/MasterDataSourceConfiguration.java

@@ -1,5 +1,7 @@
 package com.sunxung.factoring.component.config;
 
+import com.baomidou.mybatisplus.core.config.GlobalConfig;
+import com.baomidou.mybatisplus.core.toolkit.GlobalConfigUtils;
 import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
 import org.apache.ibatis.session.SqlSessionFactory;
 import org.mybatis.spring.SqlSessionTemplate;
@@ -31,6 +33,9 @@ public class MasterDataSourceConfiguration {
     @Primary
     public MybatisSqlSessionFactoryBean sqlSessionFactory(@Qualifier("masterDataSource") DataSource dataSource) throws Exception {
         MybatisSqlSessionFactoryBean bean = new MybatisSqlSessionFactoryBean();
+        GlobalConfig globalConfig = GlobalConfigUtils.defaults();
+        globalConfig.setMetaObjectHandler(new CommonMetaObjectHandler());
+        bean.setGlobalConfig(globalConfig);
         bean.setDataSource(dataSource);
         //bean.setConfiguration(config());
         bean.setTypeAliasesPackage("com.sunxung.factoring.entity");

+ 3 - 1
src/main/java/com/sunxung/factoring/service/creditresolution/ICreditResolutionService.java

@@ -25,10 +25,12 @@ public interface ICreditResolutionService extends IService<CreditResolution> {
 
     /**
      * 开启老授信的授信决议流程
+     *
      * @param cProjectInformationId
      * @param oldCoreEnterpriseId
+     * @param estimatedAccountingPeriod
      */
-    void startProcessOld(Long cProjectInformationId, Long oldCoreEnterpriseId);
+    void startProcessOld(Long cProjectInformationId, Long oldCoreEnterpriseId, Long estimatedAccountingPeriod);
 
     /**
      * 根据id查询

+ 3 - 9
src/main/java/com/sunxung/factoring/service/creditresolution/impl/CreditResolutionServiceImpl.java

@@ -13,19 +13,13 @@ import com.sunxung.factoring.entity.creditresolution.*;
 import com.sunxung.factoring.entity.entprise.Enterprise;
 import com.sunxung.factoring.entity.project.*;
 import com.sunxung.factoring.entity.project.vo.SearchBusinessProcessingTask;
-import com.sunxung.factoring.entity.supplier.DueDiligenceAllocation;
 import com.sunxung.factoring.entity.supplier.SupplierInfo;
-import com.sunxung.factoring.entity.supplier.VideoDueDiligence;
-import com.sunxung.factoring.entity.supplier.VideoDueDiligenceComprehensiveEvaluation;
 import com.sunxung.factoring.entity.sys.*;
 import com.sunxung.factoring.mapper.creditresolution.CreditResolutionMapper;
 import com.sunxung.factoring.service.creditresolution.*;
 import com.sunxung.factoring.service.entprise.IEnterpriseService;
 import com.sunxung.factoring.service.project.*;
-import com.sunxung.factoring.service.supplier.IDueDiligenceAllocationService;
 import com.sunxung.factoring.service.supplier.ISupplierInfoService;
-import com.sunxung.factoring.service.supplier.IVideoDueDiligenceComprehensiveEvaluationService;
-import com.sunxung.factoring.service.supplier.IVideoDueDiligenceService;
 import com.sunxung.factoring.service.sys.*;
 import com.sunxung.factoring.service.sys.flowable.FlowableService;
 import org.flowable.engine.runtime.ProcessInstance;
@@ -190,7 +184,7 @@ public class CreditResolutionServiceImpl extends ServiceImpl<CreditResolutionMap
     }
 
     @Override
-    public void startProcessOld(Long cProjectInformationId, Long oldCoreEnterpriseId) {
+    public void startProcessOld(Long cProjectInformationId, Long oldCoreEnterpriseId, Long estimatedAccountingPeriod) {
         if(oldCoreEnterpriseId == null){
             throw new ServiceException(CodeUtil.FAIL,"项目核心企业id为空,无法开启授信决议流程!");
         }
@@ -230,8 +224,8 @@ public class CreditResolutionServiceImpl extends ServiceImpl<CreditResolutionMap
             creditResolution.setCurrency("CNY");
             creditResolution.setProposedCreditTerm(360);
             creditResolution.setStatusStr(ProjectInitiationStatusDict.ChildEnum.PROCESSING.getCode());
-            creditResolution.setUpstreamAccountingPeriod(projectInformation.getEstimatedAccountingPeriod() * 30 + 60);
-            creditResolution.setFactoringFinancingPeriod(projectInformation.getEstimatedAccountingPeriod() * 30 + 60);
+            creditResolution.setUpstreamAccountingPeriod(estimatedAccountingPeriod * 30 + 60);
+            creditResolution.setFactoringFinancingPeriod(estimatedAccountingPeriod * 30 + 60);
             creditResolution.setCreditReport(1);
             baseMapper.add(creditResolution);
             //开启流程

+ 3 - 0
src/main/java/com/sunxung/factoring/service/project/impl/ProjectAuditServiceImpl.java

@@ -1022,6 +1022,9 @@ public class ProjectAuditServiceImpl extends ServiceImpl<ProjectAuditMapper, Pro
         if(admitted.equals(ProjectCoreEnterpriseScoringModel.NOT_ADMITTED)){
             totalScore = BigDecimal.ZERO;
             creditLimit = BigDecimal.ZERO;
+        }else {
+            creditLimit = creditLimit.compareTo(projectInformation.getCooperationAmount()) == 1? projectInformation.getCooperationAmount() : creditLimit;
+            creditLimit = creditLimit.compareTo(projectInformation.getHighPeakUsage()) == 1? projectInformation.getHighPeakUsage() : creditLimit;
         }
         ProjectOwnerComprehensiveEvaluation projectOwnerComprehensiveEvaluation = new ProjectOwnerComprehensiveEvaluation();
         projectOwnerComprehensiveEvaluation.setErrors(errors);

+ 2 - 2
src/main/java/com/sunxung/factoring/web/creditresolution/CreditResolutionController.java

@@ -58,8 +58,8 @@ public class CreditResolutionController {
      * @param id
      */
     @RequestMapping("startProcessOld")
-    public void startProcess(@RequestParam Long id,@RequestParam Long oldCoreEnterpriseId){
-        creditResolutionService.startProcessOld(id,oldCoreEnterpriseId);
+    public void startProcess(@RequestParam Long id,@RequestParam Long oldCoreEnterpriseId,@RequestParam Long estimatedAccountingPeriod){
+        creditResolutionService.startProcessOld(id,oldCoreEnterpriseId,estimatedAccountingPeriod);
     }
 
     /**