|
@@ -4,7 +4,10 @@ package com.ydtech.modules.protocol.controller;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.ydtech.core.page.HttpResult;
|
|
import com.ydtech.core.page.HttpResult;
|
|
|
import com.ydtech.core.page.PageResult;
|
|
import com.ydtech.core.page.PageResult;
|
|
|
|
|
+import com.ydtech.exception.SystemException;
|
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
import com.ydtech.modules.base.controller.BaseController;
|
|
|
|
|
+import com.ydtech.modules.order.entity.po.InsUploadFiles;
|
|
|
|
|
+import com.ydtech.modules.order.service.InsUploadFilesService;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreement;
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreement;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementNonCarProductCosts;
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementNonCarProductCosts;
|
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts;
|
|
import com.ydtech.modules.protocol.entity.po.PtlAgreementProductCosts;
|
|
@@ -12,16 +15,20 @@ import com.ydtech.modules.protocol.entity.po.PtlAgreementUndwrtRules;
|
|
|
import com.ydtech.modules.protocol.entity.vo.*;
|
|
import com.ydtech.modules.protocol.entity.vo.*;
|
|
|
import com.ydtech.modules.protocol.service.*;
|
|
import com.ydtech.modules.protocol.service.*;
|
|
|
import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
import com.ydtech.modules.protocol.utils.AssertionUtils;
|
|
|
|
|
+import com.ydtech.validation.annotation.CheckObjectNotNull;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
+import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
|
|
|
|
+import java.io.IOException;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Objects;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author wenks
|
|
* @author wenks
|
|
@@ -46,15 +53,19 @@ public class PtlAgreementController extends BaseController {
|
|
|
|
|
|
|
|
private final PtlAgreementTrajectoryService ptlAgreementTrajectoryService;
|
|
private final PtlAgreementTrajectoryService ptlAgreementTrajectoryService;
|
|
|
|
|
|
|
|
|
|
+ private final InsUploadFilesService insUploadFilesService;
|
|
|
|
|
+
|
|
|
public PtlAgreementController(PtlAgreementService ptlAgreementService, PtlAgreementUndwrtRulesService ptlAgreementUndwrtRulesService,
|
|
public PtlAgreementController(PtlAgreementService ptlAgreementService, PtlAgreementUndwrtRulesService ptlAgreementUndwrtRulesService,
|
|
|
PtlAgreementProductCostsService ptlAgreementProductCostsService,
|
|
PtlAgreementProductCostsService ptlAgreementProductCostsService,
|
|
|
PtlAgreementNonCarProductCostsService ptlAgreementNonCarProductCostsService,
|
|
PtlAgreementNonCarProductCostsService ptlAgreementNonCarProductCostsService,
|
|
|
- PtlAgreementTrajectoryService ptlAgreementTrajectoryService) {
|
|
|
|
|
|
|
+ PtlAgreementTrajectoryService ptlAgreementTrajectoryService,
|
|
|
|
|
+ InsUploadFilesService insUploadFilesService) {
|
|
|
this.ptlAgreementService = ptlAgreementService;
|
|
this.ptlAgreementService = ptlAgreementService;
|
|
|
this.ptlAgreementProductCostsService = ptlAgreementProductCostsService;
|
|
this.ptlAgreementProductCostsService = ptlAgreementProductCostsService;
|
|
|
this.ptlAgreementUndwrtRulesService = ptlAgreementUndwrtRulesService;
|
|
this.ptlAgreementUndwrtRulesService = ptlAgreementUndwrtRulesService;
|
|
|
this.ptlAgreementNonCarProductCostsService = ptlAgreementNonCarProductCostsService;
|
|
this.ptlAgreementNonCarProductCostsService = ptlAgreementNonCarProductCostsService;
|
|
|
this.ptlAgreementTrajectoryService = ptlAgreementTrajectoryService;
|
|
this.ptlAgreementTrajectoryService = ptlAgreementTrajectoryService;
|
|
|
|
|
+ this.insUploadFilesService = insUploadFilesService;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("/page")
|
|
@PostMapping("/page")
|
|
@@ -245,4 +256,17 @@ public class PtlAgreementController extends BaseController {
|
|
|
public HttpResult getAgreementTrajectory(@RequestBody PtlAgreementVo ptlAgreementVo) {
|
|
public HttpResult getAgreementTrajectory(@RequestBody PtlAgreementVo ptlAgreementVo) {
|
|
|
return ptlAgreementTrajectoryService.getAgreementTrajectory(ptlAgreementVo);
|
|
return ptlAgreementTrajectoryService.getAgreementTrajectory(ptlAgreementVo);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("/updateFeeFile")
|
|
|
|
|
+ @ApiOperation("上传费用文件")
|
|
|
|
|
+ public HttpResult updateFeeFile(@CheckObjectNotNull(message = "上传文件不能为空") MultipartFile multipartFile, String agreementId) throws IOException {
|
|
|
|
|
+ agreementId = agreementId.replace(",","");
|
|
|
|
|
+ InsUploadFiles insUploadFiles = insUploadFilesService.uploadFile(multipartFile, getUserName(), "file");
|
|
|
|
|
+ PtlAgreement byId = ptlAgreementService.getById(agreementId);
|
|
|
|
|
+ if(Objects.isNull(byId)){
|
|
|
|
|
+ throw new SystemException("找不到协议");
|
|
|
|
|
+ }
|
|
|
|
|
+ byId.setFeeFileId(insUploadFiles.getId());
|
|
|
|
|
+ return ptlAgreementService.updateById(byId) ? HttpResult.ok("上传费用文件成功") : HttpResult.error("上传文件失败");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|