Quellcode durchsuchen

个贷审核报告

wucl vor 1 Jahr
Ursprung
Commit
aa2bd439ad

+ 38 - 0
biz-base/src/main/java/com/dayou/controller/PersonalProductionController.java

@@ -6,10 +6,12 @@ import com.dayou.annotation.IgnoreAuth;
 import com.dayou.common.BaseEntity;
 import com.dayou.common.DownloadModel;
 import com.dayou.dto.NameUrlDTO;
+import com.dayou.dto.TaskRecordDTO;
 import com.dayou.entity.BusinessReply;
 import com.dayou.entity.PersonalProduction;
 import com.dayou.exception.ErrorCode;
 import com.dayou.utils.HttpKit;
+import com.dayou.workflow.annotation.FinishTask;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.RequestMapping;
@@ -19,6 +21,7 @@ import com.dayou.common.RestResponse;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.validation.Valid;
 import java.io.IOException;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -105,5 +108,40 @@ public class PersonalProductionController extends BaseController {
         String orderId = newFileName.substring(0, 10);
         packageFile2Zip(orderId+"产品包", HttpKit.getResponse(), downloadModels);
     }
+
+    /**
+     * 审核产品
+     * @param id
+     * @return
+     */
+    @GetMapping("/pass/{id}")
+    public RestResponse<Boolean> checkPass(@PathVariable("id") Long id){
+        Boolean ret = personalProductionService.checkPass(id);
+        return RestResponse.data(ret);
+    }
+
+    /**
+     * 产品入库
+     * @param taskRecordDTO
+     * @return
+     */
+    @FinishTask
+    @PostMapping("/in")
+    public RestResponse<Boolean> repertoryIn(@RequestBody @Valid TaskRecordDTO<Long> taskRecordDTO){
+        Boolean ret = personalProductionService.repertoryIn(taskRecordDTO);
+        return RestResponse.data(ret);
+    }
+
+    /**
+     * 产品出库
+     * @param taskRecordDTO
+     * @return
+     */
+    @FinishTask
+    @PostMapping("/out")
+    public RestResponse<Boolean> repertoryOut(@RequestBody @Valid TaskRecordDTO<Long> taskRecordDTO){
+        Boolean ret = personalProductionService.repertoryOut(taskRecordDTO);
+        return RestResponse.data(ret);
+    }
 }
 

+ 10 - 0
biz-base/src/main/java/com/dayou/controller/PersonalTargetController.java

@@ -149,5 +149,15 @@ public class PersonalTargetController extends BaseController {
         return RestResponse.data(ret);
     }
 
+    /**
+     * 个贷客户反馈
+     */
+    @FinishTask
+    @PutMapping("/doFeedback")
+    public RestResponse<Boolean> doFeedback(@RequestBody TaskRecordDTO<PersonalTarget> taskRecordDTO) {
+        Boolean ret = personalTargetService.doFeedback(taskRecordDTO);
+        return RestResponse.data(ret);
+    }
+
 }
 

+ 1 - 0
domain/src/main/java/com/dayou/enums/ReportStatus.java

@@ -17,5 +17,6 @@ public enum ReportStatus {
     已归档,
     不审,
     待审核,
+    已审核,
 
 }

+ 7 - 0
service/src/main/java/com/dayou/service/IPersonalProductionService.java

@@ -1,4 +1,5 @@
 package com.dayou.service;
+import com.dayou.dto.TaskRecordDTO;
 import com.dayou.entity.PersonalProduction;
 import com.baomidou.mybatisplus.extension.service.IService;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -30,4 +31,10 @@ public interface IPersonalProductionService extends IService<PersonalProduction>
     Boolean upload(String filePath, MultipartFile file,Long targetId, Integer tag);
 
     Boolean removeFile(Long id);
+
+    Boolean checkPass(Long id);
+
+    Boolean repertoryIn(TaskRecordDTO<Long> taskRecordDTO);
+
+    Boolean repertoryOut(TaskRecordDTO<Long> taskRecordDTO);
 }

+ 2 - 0
service/src/main/java/com/dayou/service/IPersonalTargetService.java

@@ -39,4 +39,6 @@ public interface IPersonalTargetService extends IService<PersonalTarget> {
     Boolean backgroundInfo(PersonalBackgroundInfo backgroundInfo);
 
     Boolean sellingAbility(PersonalSellingAbilityVO sellingAbilityVO);
+
+    Boolean doFeedback(TaskRecordDTO<PersonalTarget> taskRecordDTO);
 }

+ 1 - 1
service/src/main/java/com/dayou/service/impl/MajorProductionServiceImpl.java

@@ -564,7 +564,7 @@ public class MajorProductionServiceImpl extends ServiceImpl<MajorProductionMappe
                 .select(MajorProduction::getRepertoryState,MajorProduction::getMajorId,MajorProduction::getReportNo,MajorProduction::getProduction)
                 .eq(BaseEntity::getId, productionId).eq(BaseEntity::getDeleted, Boolean.FALSE));
         if (production==null){
-            ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"产品不存在,库失败。");
+            ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"产品不存在,库失败。");
         }
         if (production.getRepertoryState()==null){
             ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"产品还未入库,无法出库。");

+ 60 - 0
service/src/main/java/com/dayou/service/impl/PersonalProductionServiceImpl.java

@@ -8,9 +8,11 @@ import com.dayou.common.BaseEntity;
 import com.dayou.configuration.DfsConfig;
 import com.dayou.dto.ItemData;
 import com.dayou.dto.NameUrlDTO;
+import com.dayou.dto.TaskRecordDTO;
 import com.dayou.entity.*;
 import com.dayou.enums.CertificateEnum;
 import com.dayou.enums.ProductionEnum;
+import com.dayou.enums.ReportStatus;
 import com.dayou.exception.ErrorCode;
 import com.dayou.exception.file.InvalidExtensionException;
 import com.dayou.mapper.PersonalCalculateMapper;
@@ -38,12 +40,14 @@ import java.io.InputStream;
 import java.lang.reflect.Field;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import static com.dayou.common.Constants.*;
 import static com.dayou.enums.CertificateEnum.*;
+import static com.dayou.enums.ProductionEnum.STATEMENT;
 
 /**
  * <p>
@@ -355,6 +359,62 @@ public class PersonalProductionServiceImpl extends ServiceImpl<PersonalProductio
         return this.update(new LambdaUpdateWrapper<PersonalProduction>().set(PersonalProduction::getFilePath,null).eq(BaseEntity::getId,id));
     }
 
+    @Override
+    public Boolean checkPass(Long id) {
+        return this.update(new LambdaUpdateWrapper<PersonalProduction>().eq(BaseEntity::getId,id).set(PersonalProduction::getCheckState, ReportStatus.已审核));
+    }
+
+    @Override
+    public Boolean repertoryIn(TaskRecordDTO<Long> taskRecordDTO) {
+        Long productionId = taskRecordDTO.getTaskData();
+        PersonalProduction production = this.getOne(new LambdaQueryWrapper<PersonalProduction>().eq(BaseEntity::getId, productionId).eq(BaseEntity::getDeleted, Boolean.FALSE));
+
+        if (production==null){
+            ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"产品不存在,入库失败。");
+        }
+
+        if (production.getRepertoryState()!=null && production.getRepertoryState()){
+            ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"产品已出库,请确认产品状态。");
+        }
+
+        if (production.getRepertoryState()!=null && !production.getRepertoryState()){
+            ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR,"产品已入库,无需再次入库");
+        }
+        return this.update(new LambdaUpdateWrapper<PersonalProduction>().set(PersonalProduction::getRepertoryState,Boolean.FALSE).set(PersonalProduction::getRepertoryInTime,new Date()).eq(BaseEntity::getId,productionId));
+    }
+
+    @Override
+    public Boolean repertoryOut(TaskRecordDTO<Long> taskRecordDTO) {
+        Long productionId = taskRecordDTO.getTaskData();
+        PersonalProduction production = this.getOne(new LambdaQueryWrapper<PersonalProduction>().eq(BaseEntity::getId, productionId).eq(BaseEntity::getDeleted, Boolean.FALSE));
+        if (production.getRepertoryState() == null) {
+            ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR, "产品还未入库,无法出库。");
+        }
+
+        if (production.getRepertoryState() != null && production.getRepertoryState()) {
+            ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR, "产品已出库,无法再次出库。");
+        }
+        if (!production.getProduction().equals(STATEMENT.name())){
+            //非价值意见书 需做出库前校验
+//            Long outId = beforeOutCheck(production);
+//            //更新申请记录中的出库状态
+//            if (outId!=null){
+//                outWarehouseService.update(new LambdaUpdateWrapper<ProductionOutWarehouse>().set(ProductionOutWarehouse::getProductionOut,Boolean.TRUE).eq(BaseEntity::getId,outId));
+//                return this.update(new LambdaUpdateWrapper<MajorProduction>().set(MajorProduction::getRepertoryState, Boolean.TRUE)
+//                        .set(MajorProduction::getRepertoryOutTime,new Date()).set(MajorProduction::getDelivery,Boolean.TRUE)
+//                        .eq(BaseEntity::getId, production.getId()));
+//            }else{
+//                ErrorCode.throwBusinessException(ErrorCode.CUSTOM_ERROR, "财务部未审核或审核不通过,产品暂时无法出库。");
+//                return Boolean.FALSE;
+//            }
+        }else{
+            //价值意见书出库无需申请审核
+            return this.update(new LambdaUpdateWrapper<PersonalProduction>().set(PersonalProduction::getRepertoryState, Boolean.TRUE).set(PersonalProduction::getRepertoryOutTime,new Date())
+                    .eq(BaseEntity::getId, production.getId()));
+        }
+        return null;
+    }
+
 
     /**
      * 创建文档

+ 6 - 0
service/src/main/java/com/dayou/service/impl/PersonalTargetServiceImpl.java

@@ -145,4 +145,10 @@ public class PersonalTargetServiceImpl extends ServiceImpl<PersonalTargetMapper,
         return this.update(new LambdaUpdateWrapper<PersonalTarget>().eq(BaseEntity::getId,targetId)
                 .set(PersonalTarget::getSellingAbility,JSON.toJSONString(sellingAbilityVO)));
     }
+
+    @Override
+    public Boolean doFeedback(TaskRecordDTO<PersonalTarget> taskRecordDTO) {
+        PersonalTarget taskData = taskRecordDTO.getTaskData();
+        return this.update(new LambdaUpdateWrapper<PersonalTarget>().eq(BaseEntity::getId,taskData.getId()).set(PersonalTarget::getFeedback,taskData.getFeedback()));
+    }
 }