Browse Source

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

zhangc 8 months ago
parent
commit
1ba8705f8a

+ 1 - 1
src/main/java/com/sunxung/factoring/component/config/RedisConfig.java

@@ -57,7 +57,7 @@ public class RedisConfig {
         JedisPool jp = new JedisPool(jpc, url, port);
         Jedis jedis = jp.getResource();
         jedis.select(indexDB);
-//        jedis.flushDB();
+        jedis.flushDB();
         jedis.close();
         return jp;
     }

+ 6 - 0
src/main/java/com/sunxung/factoring/dict/impl/FileModuleDict.java

@@ -609,6 +609,12 @@ public class FileModuleDict extends Dict {
 
         PROJECT_CORE_ENTERPRISE_CREDIT_REPORT("projectCoreEnterpriseCreditReport", "项目核心企业授信报告"),
 
+        /** 电子签身份证正面 **/
+        ENTERPRISE_CARD_PHOTO("enterpriseCardPhoto", "身份证正面"),
+
+        /** 电子签身份证反面 **/
+        ENTERPRISE_CARD_REV_PHOTO("enterpriseCardRevPhoto", "身份证反面"),
+
         OTHER("other","其他");
 
         /**

+ 64 - 0
src/main/java/com/sunxung/factoring/entity/customerinformation/ElectronicSignaturePersonal.java

@@ -3,6 +3,9 @@ package com.sunxung.factoring.entity.customerinformation;
 import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.sunxung.factoring.entity.BaseEntity;
+import com.sunxung.factoring.entity.sys.FileStorage;
+
+import java.util.List;
 
 /**
  * <p>
@@ -29,6 +32,9 @@ public class ElectronicSignaturePersonal extends BaseEntity {
     @TableField("card_type")
     private String cardType;
 
+    @TableField(exist = false)
+    private String cardTypeName;
+
     /**
      * 证件号码
      */
@@ -71,6 +77,64 @@ public class ElectronicSignaturePersonal extends BaseEntity {
     @TableField("auth_status")
     private Integer authStatus;
 
+    //身份证正面文件
+    @TableField(exist = false)
+    private FileStorage cardPhotoFile;
+
+    //身份证反面文件
+    @TableField(exist = false)
+    private FileStorage cardRevPhotoFile;
+
+
+    //删除文件id
+    @TableField(exist = false)
+    private List<Long> deleteIds;
+
+    //上传文件id
+    @TableField(exist = false)
+    private List<Long> fileIds;
+
+
+    public String getCardTypeName() {
+        return cardTypeName;
+    }
+
+    public void setCardTypeName(String cardTypeName) {
+        this.cardTypeName = cardTypeName;
+    }
+
+    public List<Long> getDeleteIds() {
+        return deleteIds;
+    }
+
+    public void setDeleteIds(List<Long> deleteIds) {
+        this.deleteIds = deleteIds;
+    }
+
+    public List<Long> getFileIds() {
+        return fileIds;
+    }
+
+    public void setFileIds(List<Long> fileIds) {
+        this.fileIds = fileIds;
+    }
+
+    public FileStorage getCardPhotoFile() {
+        return cardPhotoFile;
+    }
+
+    public void setCardPhotoFile(FileStorage cardPhotoFile) {
+        this.cardPhotoFile = cardPhotoFile;
+    }
+
+    public FileStorage getCardRevPhotoFile() {
+        return cardRevPhotoFile;
+    }
+
+    public void setCardRevPhotoFile(FileStorage cardRevPhotoFile) {
+        this.cardRevPhotoFile = cardRevPhotoFile;
+    }
+
     public String getOpenId() {
         return openId;
     }

+ 3 - 0
src/main/java/com/sunxung/factoring/entity/sys/FileStorage.java

@@ -44,6 +44,9 @@ public class FileStorage extends BaseEntity {
         String fileName = FileUtil.randomFileName();
         String path = FileUtil.getFilePath(fileName, suffix, moudleName);
         String absolutePath = FileUtil.getAbsolutePath(fileName, suffix, moudleName);
+        Belong belong = new Belong();
+        belong.setBelongType(moudleName);
+        setBelong(belong);
         setOriginalName(multipartFile.getOriginalFilename());
         setSize(multipartFile.getSize());
         setName(fileName + suffix);

+ 1 - 0
src/main/java/com/sunxung/factoring/mapper/sys/FileStorageMapper.java

@@ -34,4 +34,5 @@ public interface FileStorageMapper {
 
     List<Long> selectInvalidFileStorage();
 
+    void updateBusinessId(@Param("fileId")Long fileId, @Param("businessId")Long businessId);
 }

+ 2 - 0
src/main/java/com/sunxung/factoring/service/customerinformation/IElectronicSignaturePersonalService.java

@@ -75,4 +75,6 @@ public interface IElectronicSignaturePersonalService extends IService<Electronic
     GridPage findByComName(String name,Integer status, Integer page, Integer rows);
 
     void flush(Long id);
+
+    ElectronicSignaturePersonal getDetail(Long id);
 }

+ 47 - 0
src/main/java/com/sunxung/factoring/service/customerinformation/impl/ElectronicSignaturePersonalServiceImpl.java

@@ -6,15 +6,21 @@ import com.github.pagehelper.Page;
 import com.github.pagehelper.PageHelper;
 import com.sunxung.factoring.component.exception.ValidatorException;
 import com.sunxung.factoring.component.util.*;
+import com.sunxung.factoring.dict.impl.FileModuleDict;
 import com.sunxung.factoring.entity.GridPage;
 import com.sunxung.factoring.entity.acceptance.AcceptanceSignConfirmationElectronicInfo;
 import com.sunxung.factoring.entity.customerinformation.ElectronicSignaturePersonal;
 import com.sunxung.factoring.entity.entprise.Enterprise;
 import com.sunxung.factoring.entity.signconfirmation.SignConfirmationElectronicInfo;
+import com.sunxung.factoring.entity.sys.Dictionary;
+import com.sunxung.factoring.entity.sys.FileStorage;
 import com.sunxung.factoring.mapper.customerinformation.ElectronicSignaturePersonalMapper;
 import com.sunxung.factoring.service.acceptancesheet.IAcceptanceSignConfirmationElectronicInfoService;
 import com.sunxung.factoring.service.customerinformation.IElectronicSignaturePersonalService;
 import com.sunxung.factoring.service.signconfirmation.ISignConfirmationElectronicInfoService;
+import com.sunxung.factoring.service.sys.DictionaryService;
+import com.sunxung.factoring.service.sys.FileStorageService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -42,10 +48,22 @@ public class ElectronicSignaturePersonalServiceImpl extends ServiceImpl<Electron
     @Autowired
     private ElectronicSignaturePersonalMapper  electronicSignaturePersonalMapper;
 
+    @Autowired
+    private FileStorageService fileStorageService;
+
+    @Autowired
+    private DictionaryService dictionaryService;
+
     @Override
     public GridPage findByName(String name,Integer status, Integer page, Integer rows) {
         Page objectPage = PageHelper.startPage(page, rows);
         List<ElectronicSignaturePersonal> list  = electronicSignaturePersonalMapper.findByName(name,status);
+        for (ElectronicSignaturePersonal personal : list){
+            if (StringUtils.isNotEmpty(personal.getCardType())){
+                Dictionary dictionary = dictionaryService.getByCode(personal.getCardType());
+                personal.setCardTypeName(dictionary.getName());
+            }
+        }
         return new GridPage(rows,page,objectPage.getTotal(),list);
     }
 
@@ -67,6 +85,24 @@ public class ElectronicSignaturePersonalServiceImpl extends ServiceImpl<Electron
         }
     }
 
+    @Override
+    public ElectronicSignaturePersonal getDetail(Long id) {
+        ElectronicSignaturePersonal electronicSignaturePersonal = getById(id);
+        if (StringUtils.isNotEmpty(electronicSignaturePersonal.getCardType())){
+            Dictionary dictionary = dictionaryService.getByCode(electronicSignaturePersonal.getCardType());
+            electronicSignaturePersonal.setCardTypeName(dictionary.getName());
+        }
+        List<FileStorage> fileStorages = fileStorageService.findByBelongIdAndBelongType(id.toString(), FileModuleDict.ChildEnum.ENTERPRISE_CARD_PHOTO.getCode());
+        if (CollectionUtil.isNotEmpty(fileStorages)){
+            electronicSignaturePersonal.setCardPhotoFile(fileStorages.get(0));
+        }
+        List<FileStorage> list = fileStorageService.findByBelongIdAndBelongType(id.toString(), FileModuleDict.ChildEnum.ENTERPRISE_CARD_REV_PHOTO.getCode());
+        if (CollectionUtil.isNotEmpty(list)){
+            electronicSignaturePersonal.setCardRevPhotoFile(list.get(0));
+        }
+        return electronicSignaturePersonal;
+    }
+
     @Override
     public List<ElectronicSignaturePersonal> findByIdForC(Long id) {
         List<ElectronicSignaturePersonal> list ;
@@ -94,6 +130,17 @@ public class ElectronicSignaturePersonalServiceImpl extends ServiceImpl<Electron
                 throw new ValidatorException(CodeUtil.FAIL, "已认证,不能修改!");
             } else if (oldInfo.getAuthStatus().equals(0)) {
                 electronicSignaturePersonal = getAuthInfo(electronicSignaturePersonal);
+                //更新附件
+                if (CollectionUtil.isNotEmpty(electronicSignaturePersonal.getDeleteIds())){
+                    for (Long id : electronicSignaturePersonal.getDeleteIds()){
+                        fileStorageService.deleteFileStorage(id);
+                    }
+                }
+                if (CollectionUtil.isNotEmpty(electronicSignaturePersonal.getFileIds())){
+                    for (Long id : electronicSignaturePersonal.getFileIds()){
+                        fileStorageService.updateBusinessId(id,electronicSignaturePersonal.getId());
+                    }
+                }
                 updateById(electronicSignaturePersonal);
             } else {
                 throw new ValidatorException(CodeUtil.FAIL, "数据状态错误!");

+ 3 - 2
src/main/java/com/sunxung/factoring/service/salescontractmanagement/impl/CSalesSignConfirmationServiceImpl.java

@@ -148,8 +148,9 @@ public class CSalesSignConfirmationServiceImpl extends ServiceImpl<CSalesSignCon
                             .setChildEnum(FileModuleDict.ChildEnum.SIGN_CONFIRM_BACK_FILE)
                             .build();
                     List<FileStorage> files = sysAttachmentRefService.getFiles(attachmentDto);
-                    fileStorageList.add(files.get(0));
-
+                    if (CollectionUtil.isNotEmpty(files)){
+                        fileStorageList.add(files.get(0));
+                    }
                 });
                 signConfirmation.setFiles(fileStorageList);
             }

+ 4 - 2
src/main/java/com/sunxung/factoring/service/settlement/impl/SettlementManagementServiceImpl.java

@@ -1163,6 +1163,8 @@ public class SettlementManagementServiceImpl implements SettlementManagementServ
 
     private void startProcess(SettlementBasicInfo settlementBasicInfo) {
         Long odlId = settlementBasicInfo.getId();
+        User user = userService.getByLoginName("admin");
+        ThreadLocalUtil.setUser(user);
         //2.新增处理人-- C端用户
         SupplierInfo supplierInfo = iSupplierInfoService.get(settlementBasicInfo.getSupplierId());
         //审核处理人
@@ -1182,8 +1184,8 @@ public class SettlementManagementServiceImpl implements SettlementManagementServ
 
         //3.开启流程实例
         Map<String, Object> procVariables = new HashMap<>();
-        procVariables.put(ConstantUtil.BILL_ASSIGNEE,supplierInfo.getSysUserId());
-        procVariables.put(ConstantUtil.BILL_SIGN_ASSIGNEE,supplierInfo.getSysUserId());
+        procVariables.put(ConstantUtil.BILL_ASSIGNEE,user.getId());
+        procVariables.put(ConstantUtil.BILL_SIGN_ASSIGNEE,user.getId());
         Map<String, Object> msgVariables = new HashMap<>();
         //查询条件:结算单编号/业务编号/核心企业名称/业务名称/供应商名称
         Enterprise enterprise = iEnterpriseService.getById(supplierInfo.getcEnterpriseId());

+ 2 - 1
src/main/java/com/sunxung/factoring/service/sys/FileStorageService.java

@@ -187,4 +187,5 @@ public interface FileStorageService {
      */
     List<FileStorage> saveFileStorage(List<Long> fileIds);
 
-    }
+    void updateBusinessId(Long fileId, Long businessId);
+}

+ 7 - 0
src/main/java/com/sunxung/factoring/service/sys/impl/FileStorageServiceImpl.java

@@ -633,5 +633,12 @@ public class FileStorageServiceImpl implements FileStorageService {
         return list;
     }
 
+    @Override
+    public void updateBusinessId(Long fileId, Long businessId) {
+        if (fileId != null) {
+            fileStorageMapper.updateBusinessId(fileId,businessId);
+        }
+    }
+
 
 }

+ 1 - 1
src/main/java/com/sunxung/factoring/web/customerinformation/ElectronicSignaturePersonalController.java

@@ -77,7 +77,7 @@ public class ElectronicSignaturePersonalController {
     @ResponseBody
     @RequestMapping("get")
     public ResponseJson get(Long id){
-        ElectronicSignaturePersonal electronicSignaturePersonal = electronicSignaturePersonalService.getById(id);
+        ElectronicSignaturePersonal electronicSignaturePersonal = electronicSignaturePersonalService.getDetail(id);
         return new ResponseJson(electronicSignaturePersonal);
     }
 

+ 1 - 1
src/main/resources/application.yml

@@ -1,4 +1,4 @@
 #环境配置
 spring:
   profiles:
-    active: dev
+    active: prod

+ 17 - 0
src/main/resources/data/update/v1.0/fengxuan.sql

@@ -151,3 +151,20 @@ CREATE TABLE `trading_platform` (
 
 
 
+CREATE TABLE `sign_confirmation_electronic_info` (
+                                                     `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+                                                     `sign_confirmation_id` bigint(20) NOT NULL COMMENT '签署确认表Id',
+                                                     `contract_name` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '合同名称',
+                                                     `contract_id` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '合同id',
+                                                     `file_id` bigint(20) DEFAULT NULL COMMENT '电子签文件',
+                                                     `electronic_signature_personal_id` bigint(20) NOT NULL COMMENT '电子签个人信息表Id',
+                                                     `transaction_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '客户合同交易id',
+                                                     `sign_status` tinyint(1) DEFAULT NULL COMMENT '客户签署状态',
+                                                     `back_file_id` bigint(20) DEFAULT NULL COMMENT '电子签回调文件',
+                                                     `report_file_id` bigint(20) DEFAULT NULL COMMENT '出证电子签文件',
+                                                     `user_create` varchar(32) COLLATE utf8_unicode_ci DEFAULT '' COMMENT '创建人',
+                                                     `user_modified` varchar(32) COLLATE utf8_unicode_ci DEFAULT '' COMMENT '修改人',
+                                                     `gmt_create` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+                                                     `gmt_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+                                                     PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='--签署确认合同信息';

+ 55 - 0
src/main/resources/data/update/v1.0/yafan0226.sql

@@ -0,0 +1,55 @@
+--  豁免事项跟进sql
+CREATE TABLE `exemption_matters`
+(
+    `id`                     bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+    `payment_apply_basic_id` bigint(20) unsigned DEFAULT '0' COMMENT '付款申请基础ID',
+    `statusId`               tinyint(3) DEFAULT NULL COMMENT '状态 0 处理中 1 已完成 2 已逾期',
+    `user_create`            varchar(50)        DEFAULT '' COMMENT '创建人',
+    `user_modified`          varchar(50)        DEFAULT '' COMMENT '修改人',
+    `gmt_create`             timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`           timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB COMMENT='豁免事项跟进和付款关系表';
+
+CREATE TABLE `exemption_matters_approval`
+(
+    `id`                   bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+    `exemption_matters_id` bigint(20) unsigned DEFAULT '0' COMMENT '豁免事项跟进和付款关系表Id',
+    `approval_conclusion`  varchar(50)        DEFAULT '' COMMENT '通过pass/退回back',
+    `approval_comments`    varchar(3000)      DEFAULT '' COMMENT '审批意见',
+    `user_create`          varchar(32)        DEFAULT '' COMMENT '创建人',
+    `user_modified`        varchar(32)        DEFAULT '' COMMENT '修改人',
+    `gmt_create`           timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`         timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB COMMENT='--豁免事项跟进审核表';
+
+CREATE TABLE `exemption_matters_history`
+(
+    `id`                     bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+    `payment_apply_basic_id` bigint(20) unsigned DEFAULT '0' COMMENT '付款申请基础ID',
+    `statusId`               tinyint(3) DEFAULT NULL COMMENT '状态 0 处理中 1 已完成 2 已逾期',
+    `user_create`            varchar(50)        DEFAULT '' COMMENT '创建人',
+    `user_modified`          varchar(50)        DEFAULT '' COMMENT '修改人',
+    `gmt_create`             timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
+    `gmt_modified`           timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB COMMENT='豁免事项跟进和付款关系历史表';
+
+CREATE TABLE `exemption_matters_ref`
+(
+    `id`                   bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+    `exemption_matters_id` bigint(20) unsigned DEFAULT '0' COMMENT '豁免事项跟进和付款关系表Id',
+    `payment_condition_id` bigint(20) unsigned DEFAULT '0' COMMENT '付款条件ID',
+    `file_id`              bigint(20) unsigned DEFAULT '0' COMMENT '附件ID',
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB COMMENT='豁免事项跟进附件';
+
+CREATE TABLE `exemption_matters_ref_history`
+(
+    `id`                   bigint(20) unsigned NOT NULL AUTO_INCREMENT,
+    `exemption_matters_id` bigint(20) unsigned DEFAULT '0' COMMENT '豁免事项跟进和付款关系表Id',
+    `payment_condition_id` bigint(20) unsigned DEFAULT '0' COMMENT '付款条件ID',
+    `file_id`              bigint(20) unsigned DEFAULT '0' COMMENT '附件ID',
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB COMMENT='付款条件豁免事项跟进附件历史';

+ 4 - 0
src/main/resources/mapper/sys/FileStorageMapper.xml

@@ -74,4 +74,8 @@
 
     </select>
 
+	<update id="updateBusinessId">
+		update t_file_storage set belongId = #{businessId}
+		where id = #{fileId}
+	</update>
 </mapper>