From 0d6bb65549a15f9681710c283f21927ff861aa56 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 25 一月 2024 09:57:14 +0800
Subject: [PATCH] 开发业务接口
---
server/service/src/main/java/com/doumee/core/utils/Constants.java | 6 +
server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java | 120 ++++++++++++++++++++++++++++++++++++---
server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java | 7 ++
3 files changed, 121 insertions(+), 12 deletions(-)
diff --git a/server/service/src/main/java/com/doumee/core/utils/Constants.java b/server/service/src/main/java/com/doumee/core/utils/Constants.java
index 278dcd8..2325066 100644
--- a/server/service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/service/src/main/java/com/doumee/core/utils/Constants.java
@@ -406,8 +406,9 @@
BD_SIGNED_PDF(9, "绛剧讲鍚庝繚鍗曠敵璇疯〃PDF", "绛剧讲鍚庝繚鍗曠敵璇疯〃PDF"),
COM_SING_IMG(10, "浼佷笟鍗扮珷", "浼佷笟鍗扮珷"),
BD_DONE_PDF(11, "鏈�缁堟姤鍗�", "鏈�缁堟姤鍗�"),
-
CA_PD_PDF(12, "鏈�缁堟姤鍗�", "鏈�缁堟姤鍗�"),
+ CA_APPLY_JIAJIAN_SIGN(13, "鍔犲噺淇濈敵璇风绔犳枃浠�", "鍔犲噺淇濈敵璇风绔犳枃浠�"),
+ CA_APPLY_CHANGEUNIT_SIGN(14, "鎹㈠巶鐢宠绛剧珷鏂囦欢", "鎹㈠巶鐢宠绛剧珷鏂囦欢"),
;
@@ -683,6 +684,9 @@
CA_PALTFORM_REFUSE_APPLY(20, "椹冲洖閫�鍥炵敵璇�",""),
CA_PALTFORM_EDIT_PIDAN(21, "淇敼鎵瑰崟","淇敼鍘熷洜锛�${param}"),
PALTFORM_EDIT_BD(22, "淇敼淇濆崟","淇敼鍘熷洜锛�${param}"),
+
+ CA_CHANGUNIT_APPLY_SIGN(24, "鎹㈡垚鐢宠浼佷笟绛剧珷",""),
+ CA_JIAJIAN_APPLY_SIGN(23, "鍔犲噺淇濈敵璇蜂紒涓氱绔�",""),
;
// 鎴愬憳鍙橀噺
private String name;
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
index 4be1bc8..57e08ea 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/InsuranceApplyServiceImpl.java
@@ -10,6 +10,7 @@
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
+import com.doumee.core.utils.aliyun.ALiYunUtil;
import com.doumee.dao.business.*;
import com.doumee.dao.business.dto.InsuranceApplyOptDTO;
import com.doumee.dao.business.dto.InsuranceApplyQueryDTO;
@@ -331,23 +332,122 @@
insuranceApplyMapper.updateById(update);
return link;
}
+ public String uploadSignFile(String link){
+ try {
+ String bucketName = systemDictDataBiz.queryByCode(Constants.OSS,Constants.BUCKETNAME).getCode();
+ String access_id= systemDictDataBiz.queryByCode(Constants.OSS,Constants.ACCESS_ID).getCode();
+ String access_key= systemDictDataBiz.queryByCode(Constants.OSS,Constants.ACCESS_KEY).getCode();
+ String endpoint = systemDictDataBiz.queryByCode(Constants.OSS,Constants.ENDPOINT).getCode();
+ String folder = systemDictDataBiz.queryByCode(Constants.OSS,Constants.APPLY_FILE).getCode();
+ String tempFileName = DateUtil.getNowShortDate() + "/" + UUID.randomUUID().toString() + ".pdf";
+ String key = folder + tempFileName;// 鏂囦欢鍚�
+ ALiYunUtil obs = new ALiYunUtil(endpoint,access_id, access_key);
+ if (obs.uploadOnlineObject(link,bucketName, key,null)) {
+ // 绉诲姩鎴愬姛,杩斿洖鏂囦欢鍚�
+ return tempFileName;
+ }
+ }catch (Exception e){
+
+ }
+ return null;
+
+ }
+
+
+ public Integer uploadSignedFileDo(InsuranceApply model,String fileurl) {
+ InsuranceApply update = new InsuranceApply();
+ update.setEditDate(new Date());
+ update.setEditor(model.getCreator());
+ update.setStatus(Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey());
+ update.setCheckDate(update.getEditDate());
+ update.setCheckInfo("浼佷笟瀹屾垚绛剧讲");
+ update.setCheckUserId(model.getCreator());
+ update.setId(model.getId());
+ insuranceApplyMapper.updateById(update);
+
+ Multifile f = new Multifile();
+ f.setIsdeleted(Constants.ZERO);
+ f.setCreator(model.getCreator());
+ f.setObjId(update.getId());
+ f.setCreateDate(update.getEditDate());
+ f.setObjType(Constants.MultiFile.BD_SIGNED_PDF.getKey());
+ f.setType(Constants.TWO);
+ f.setFileurl(fileurl);
+ f.setName("鎶曚繚鍗曠绾﹀悎鍚�.pdf");
+ multifileMapper.insert(f);
+ Constants.ApplyLogType applyLogType = Constants.ApplyLogType.SIGNATURE;
+ ApplyLog log = new ApplyLog(update,applyLogType.getName(), null,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));
+ applyLogMapper.insert(log);
+ return 1;
+
+ }
+ public Integer uploadChangeSignedFileDo(ApplyChange model,String fileurl) {
+ ApplyChange update = new ApplyChange();
+ update.setEditDate(new Date());
+ update.setEditor(model.getCreator());
+ update.setStatus(Constants.ApplyChangeStatus.SIGNATURE.getKey());
+ update.setCheckDate(update.getEditDate());
+ update.setCheckInfo("浼佷笟瀹屾垚绛剧讲");
+ update.setCheckUserId(model.getCreator());
+ update.setId(model.getId());
+ applyChangeMapper.updateById(update);
+
+ Multifile f = new Multifile();
+ f.setIsdeleted(Constants.ZERO);
+ f.setCreator(model.getCreator());
+ f.setObjId(update.getId());
+ f.setCreateDate(update.getEditDate());
+ f.setObjType(Constants.equalsInteger(Constants.ZERO,model.getType())?Constants.MultiFile.CA_APPLY_JIAJIAN_SIGN.getKey() : Constants.MultiFile.CA_APPLY_CHANGEUNIT_SIGN.getKey());
+ f.setType(Constants.TWO);
+ f.setFileurl(fileurl);
+ f.setName("绛剧珷鐢宠琛�.pdf");
+ multifileMapper.insert(f);
+ Constants.ApplyLogType applyLogType =Constants.equalsInteger(Constants.ZERO,model.getType())? Constants.ApplyLogType.CA_JIAJIAN_APPLY_SIGN: Constants.ApplyLogType.CA_CHANGUNIT_APPLY_SIGN;
+ ApplyLog log = new ApplyLog(update,applyLogType.getName(), null,update.getId(),applyLogType.getKey(),JSONObject.toJSONString(model), JSONObject.toJSONString(update));
+ applyLogMapper.insert(log);
+ return 1;
+
+ }
@Override
public void dealSignResult(NotifyDataReq data){
if(data.getApplyNo() == null ){
throw new BusinessException(ResponseStatus.BAD_REQUEST);
}
- InsuranceApply model = insuranceApplyMapper.selectOne(new QueryWrapper<InsuranceApply>().lambda().eq(InsuranceApply::getSignApplyNo,data.getApplyNo()).last("limit 1" ));
- if(model != null ){
- //-----------------TUDO--------瀹屽杽绛剧害瀹屾垚涓氬姟------
-
- }else{
- ApplyChange applyChange = applyChangeMapper.selectOne(new QueryWrapper<ApplyChange>().lambda().eq(ApplyChange::getSignApplyNo,data.getApplyNo()).last("limit 1" ));
- if(applyChange == null){
- throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"绯荤粺鏈壘鍒板尮閰嶅悎鍚屽彿!");
+ if(Constants.equalsInteger(data.getSignStatus(), Constants.THREE )){
+ //濡傛灉宸蹭繚鍏�,鍙笅杞界绾﹂檮浠�
+ InsuranceApply model = insuranceApplyMapper.selectOne(new QueryWrapper<InsuranceApply>().lambda().eq(InsuranceApply::getSignApplyNo,data.getApplyNo()).last("limit 1" ));
+ if(model != null && Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_WAIT_SIGNATURE.getKey())){
+ //瀹屾垚绛剧讲宸插畬鎴愭搷浣�
+ String link = signService.linkFile(data.getApplyNo());
+ String fileUrl = uploadSignFile(link);
+ if(StringUtils.isBlank(fileUrl)){
+ //濡傛灉涓嬭浇澶辫触锛屾竻闄ゅ悎鍚岋紝涓嬫绛剧珷閲嶆柊鐢熸垚鏂板悎鍚�
+ return;
+ }
+ uploadSignedFileDo(model,fileUrl);
+ return;
}
- //-----------------TUDO-------瀹屽杽绛剧害瀹屾垚-------
- }
+ ApplyChange applyChange = applyChangeMapper.selectOne(new QueryWrapper<ApplyChange>().lambda().eq(ApplyChange::getSignApplyNo,data.getApplyNo()).last("limit 1" ));
+ if(applyChange != null &&Constants.equalsInteger(applyChange.getStatus(),Constants.ApplyChangeStatus.UPLOAD.getKey())){
+ String link = signService.linkFile(data.getApplyNo());
+ String fileUrl = uploadSignFile(link);
+ if(StringUtils.isBlank(fileUrl)){
+ //濡傛灉涓嬭浇澶辫触锛屾竻闄ゅ悎鍚岋紝涓嬫绛剧珷閲嶆柊鐢熸垚鏂板悎鍚�
+ return;
+ }
+ uploadChangeSignedFileDo(applyChange,fileUrl);
+ }
+ }else if(Constants.equalsInteger(data.getSignStatus(), Constants.TWO )){
+ //濡傛灉宸叉嫆绛撅紝娓呴櫎鍚堝悓锛屼笅娆$绔犻噸鏂扮敓鎴愭柊鍚堝悓
+ insuranceApplyMapper.update(null,new UpdateWrapper<InsuranceApply>().lambda()
+ .set(InsuranceApply::getSignApplyNo,null)
+ .eq(InsuranceApply::getSignApplyNo,data.getApplyNo()));
+ //濡傛灉宸叉嫆绛撅紝娓呴櫎鍚堝悓锛屼笅娆$绔犻噸鏂扮敓鎴愭柊鍚堝悓
+ applyChangeMapper.update(null,new UpdateWrapper<ApplyChange>().lambda()
+ .set(ApplyChange::getSignApplyNo,null)
+ .eq(ApplyChange::getSignApplyNo,data.getApplyNo()));
+ }
}
@Override
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
index d87ceeb..d46df3d 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/SolutionsServiceImpl.java
@@ -229,7 +229,12 @@
}
@Override
public Solutions findById(Integer id) {
- Solutions model = solutionsMapper.selectById(id);
+ MPJLambdaWrapper<Solutions> queryWrapper = new MPJLambdaWrapper<>();
+ queryWrapper.selectAll(Solutions.class);
+ queryWrapper.selectAs(Insurance::getName,Solutions::getInsuranceName);
+ queryWrapper.leftJoin(Insurance.class,Insurance::getId,Solutions::getInsuranceId);
+ queryWrapper.eq(Solutions::getId,id);
+ Solutions model = solutionsJoinMapper.selectJoinOne(Solutions.class,queryWrapper);
if(model == null || !Constants.equalsInteger(model.getIsdeleted(),Constants.ZERO)){
throw new BusinessException(ResponseStatus.DATA_EMPTY );
}
--
Gitblit v1.9.3