From ec597288f2bb4d25d8752e2e24402306719833d4 Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期五, 29 三月 2024 15:25:28 +0800
Subject: [PATCH] 提交一把
---
server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java | 69 ++++++++++++++++++++++++++++++----
1 files changed, 60 insertions(+), 9 deletions(-)
diff --git a/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java b/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java
index ade3466..d9a2a12 100644
--- a/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java
+++ b/server/service/src/main/java/com/doumee/service/business/impl/UnionChangeServiceImpl.java
@@ -14,10 +14,7 @@
import com.doumee.dao.business.dto.SaveUnionApplyDTO;
import com.doumee.dao.business.dto.SaveUnionChangeDTO;
import com.doumee.dao.business.dto.UnionChangeBXDDTO;
-import com.doumee.dao.business.join.ApplyChagneDetailJoinMapper;
-import com.doumee.dao.business.join.ApplyChangeJoinMapper;
-import com.doumee.dao.business.join.ApplyDetailJoinMapper;
-import com.doumee.dao.business.join.MemberInsuranceJoinMapper;
+import com.doumee.dao.business.join.*;
import com.doumee.dao.business.model.*;
import com.doumee.dao.business.vo.CountCyclePriceVO;
import com.doumee.service.business.UnionChangeService;
@@ -35,6 +32,7 @@
import org.springframework.transaction.annotation.Transactional;
import java.math.BigDecimal;
+import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Objects;
@@ -50,6 +48,9 @@
@Autowired
private UnionChangeMapper unionChangeMapper;
+
+ @Autowired
+ private UnionChangeJoinMapper unionChangeJoinMapper;
@Autowired
private ApplyChangeJoinMapper applyChangeJoinMapper;
@@ -233,7 +234,7 @@
.leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId)
.eq(ApplyChange::getIsdeleted, Constants.ZERO)
.eq(InsuranceApply::getUnionApplyId,saveUnionChangeDTO.getUnionApplyId())
- .eq(ApplyChange::getStatus,Constants.ApplyChangeStatus.COMPANY_SIGN.getKey())
+ .eq(ApplyChange::getStatus,Constants.ApplyChangeStatus.PALTFORM_CHECK_PASS.getKey())
.eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())
.eq(ApplyChange::getType,saveUnionChangeDTO.getBusinessType())
.in(ApplyChange::getId,saveUnionChangeDTO.getApplyIds())
@@ -315,6 +316,57 @@
}
+ public UnionChange unionChangeDetail(Integer unionChangeId){
+
+ UnionChange unionChange = unionChangeJoinMapper.selectJoinOne(UnionChange.class,
+ new MPJLambdaWrapper<UnionChange>()
+ .selectAll(UnionChange.class)
+ .selectAs(Company::getName,UnionChange::getShopName)
+ .selectAs(Solutions::getName,UnionChange::getSolutionsName)
+ .selectAs(UnionApply::getCode,UnionChange::getApplyCode)
+ .selectAs(UnionApply::getStartTime,UnionChange::getStartTime)
+ .selectAs(UnionApply::getEndTime,UnionChange::getEndTime)
+ .leftJoin(UnionApply.class,UnionApply::getId,UnionChange::getUnionApplyId)
+ .leftJoin(Company.class,Company::getId,UnionChange::getShopId)
+ .leftJoin(Solutions.class,Solutions::getId,UnionApply::getSolutionId)
+ .eq(UnionChange::getId,unionChangeId)
+ .last(" limit 1 ")
+ );
+ //浼佷笟鍚嶇О
+ List<ApplyChange> applyChangeList = applyChangeJoinMapper.selectJoinList(ApplyChange.class,new MPJLambdaWrapper<ApplyChange>()
+ .selectAs(Company::getName,ApplyChange::getCompanyName)
+ .leftJoin(Company.class,Company::getId,ApplyChange::getCompanyId)
+ .eq(ApplyChange::getUnionChangeId,unionChangeId)
+ );
+
+ String companyNames = String.join(",",applyChangeList.stream().map(m->m.getCompanyName()).collect(Collectors.toList()));
+
+ List<ApplyChagneDetail> applyChagneDetailList = applyChagneDetailJoinMapper.selectJoinList(ApplyChagneDetail.class,new MPJLambdaWrapper<ApplyChagneDetail>()
+ .selectAll(ApplyChagneDetail.class)
+ .selectAs(Member::getName,ApplyChagneDetail::getMemberName)
+ .selectAs(Member::getIdcardNo,ApplyChagneDetail::getIdcardNo)
+ .selectAs(Member::getSex,ApplyChagneDetail::getSex)
+ .selectAs(Company::getName,ApplyChagneDetail::getCompanyName)
+ .select("t2.name",ApplyChagneDetail::getWorkTypeName)
+ .select("t3.name",ApplyChagneDetail::getDuName)
+ .select("t4.name",ApplyChagneDetail::getOldWorkTypeName)
+ .select("t5.name",ApplyChagneDetail::getOldDuName)
+ .leftJoin(Member.class,Member::getId,ApplyChagneDetail::getMemberId)
+ .leftJoin(Worktype.class,Worktype::getId,ApplyChagneDetail::getWorktypeId)
+ .leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyChagneDetail::getDuId)
+ .leftJoin(Worktype.class,Worktype::getId,ApplyChagneDetail::getOldWorktypeId)
+ .leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyChagneDetail::getOldDuId)
+ .leftJoin(Company.class,Company::getId,Member::getCompanyId)
+ .eq(ApplyChagneDetail::getUnionChangeId,unionChangeId)
+ );
+
+ unionChange.setCompanyNames(companyNames);
+ unionChange.setApplyChagneDetailList(applyChagneDetailList);
+ return unionChange;
+ }
+
+
+
/**
* 鍚堝苟鍗曪紙鍔犲噺淇�/鎹㈠巶锛� - 鎶曚繚鐢宠绛剧讲
* @param id
@@ -327,7 +379,7 @@
throw new BusinessException(ResponseStatus.BAD_REQUEST);
}
LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
- UnionChange unionChange = unionChangeMapper.selectById(id);
+ UnionChange unionChange = this.unionChangeDetail(id);
if(Objects.isNull(unionChange)||!Constants.equalsInteger(unionChange.getIsdeleted(),Constants.ZERO)){
throw new BusinessException(ResponseStatus.DATA_EMPTY);
}
@@ -350,11 +402,10 @@
String fileUrl = null;
if(Constants.equalsObject(unionChange.getType(), Constants.ONE)){
-// fileUrl = ExcelExporter.build(ApplyChange.class).exportChangeUnitExcelToPdf(model,"鎹㈠巶鐢宠琛�","琚繚闄╀汉");
+ fileUrl = ExcelExporter.build(UnionChange.class).exportUnionChangeOtherUnitExcelToPdf(unionChange,"鎹㈠巶鐢宠琛�");
}else{
-// fileUrl = ExcelExporter.build(ApplyChange.class).exportJiajianBaoExcelToPdf(model,"鍔犲噺淇濈敵璇疯〃","琚繚闄╀汉");
+ fileUrl = ExcelExporter.build(UnionChange.class).exportUnionChangeExcelToPdf(unionChange,"鍔犲噺淇濈敵璇疯〃");
}
-
String notifyUrl = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.SIGN_DONE_NOTIFY_URL).getCode();
notifyUrl = notifyUrl.replace("${type}","0").replace("${id}",unionChange.getId().toString());
String applyNo = signService.applySignLocalFile(company.getName(),company.getName(),fileUrl,company.getCode(),company.getEmail(),"鍚堝苟鍗曪紙鍔犲噺淇�/鎹㈠巶锛夌敵璇风缃�",company.getSignId(),notifyUrl);
--
Gitblit v1.9.3