| | |
| | | ApplyChange applyChange = applyChangeJoinMapper.selectOne(queryWrapper); |
| | | return applyChange; |
| | | } |
| | | /** |
| | | * 导出换厂申请表 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ApplyChange exportChangeUnitExcel(ApplyChange param){ |
| | | ApplyChange model = findJoinDetail(param); |
| | | if(Objects.isNull(model) ||! Constants.equalsInteger(Constants.ZERO,model.getType())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | |
| | | //查询明细 |
| | | List<ApplyChagneDetail> detailList =findJoinChangeDetailList(model); |
| | | model.setChangeDetailList(detailList!=null?detailList:new ArrayList<>()); |
| | | model.setChangeNum(model.getChangeDetailList().size()); |
| | | return model; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导出加减保申请表 |
| | | * @param param |
| | | * @return |
| | | */ |
| | | @Override |
| | | public ApplyChange exportJiajianBaoExcel(ApplyChange param){ |
| | | |
| | | ApplyChange model = findJoinDetail(param); |
| | | if(Objects.isNull(model) ||! Constants.equalsInteger(Constants.ZERO,model.getType())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | |
| | | //查询明细 |
| | | List<ApplyChagneDetail> detailList =findJoinDetailList(model); |
| | | model.setAddDetailList(new ArrayList<>()); |
| | | model.setDelDetailList(new ArrayList<>()); |
| | | if(detailList!=null){ |
| | | for(ApplyChagneDetail ad :detailList){ |
| | | if(Constants.equalsInteger(ad.getType(),Constants.ZERO)){ |
| | | model.getAddDetailList().add(ad); |
| | | }else{ |
| | | model.getDelDetailList().add(ad); |
| | | } |
| | | } |
| | | } |
| | | model.setDelNum(model.getDelDetailList().size()); |
| | | model.setAddNum(model.getAddDetailList().size()); |
| | | return model; |
| | | } |
| | | private ApplyChange findJoinDetail(ApplyChange param) { |
| | | MPJLambdaWrapper wrapper= new MPJLambdaWrapper<ApplyChange>() |
| | | .selectAll(ApplyChange.class) |
| | | .selectAs(Solutions::getName,ApplyChange::getSolutionsName) |
| | | .selectAs(Company::getName,ApplyChange::getCompanyName) |
| | | .selectAs(InsuranceApply::getCode,ApplyChange::getApplyCode) |
| | | .selectAs(InsuranceApply::getStartTime,ApplyChange::getStartTime) |
| | | .selectAs(InsuranceApply::getStartTime,ApplyChange::getEndTime) |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,ApplyChange::getCompanyId) |
| | | .eq(ApplyChange::getId,param.getId()) |
| | | .last("limit 1"); |
| | | |
| | | ApplyChange model = applyChangeJoinMapper.selectJoinOne(ApplyChange.class,wrapper); |
| | | return model; |
| | | } |
| | | private List<ApplyChagneDetail> findJoinDetailList(ApplyChange model) { |
| | | MPJLambdaWrapper wrapper1= new MPJLambdaWrapper<ApplyChagneDetail>() |
| | | .selectAll(ApplyChagneDetail.class) |
| | | .selectAs(Member::getName,ApplyChagneDetail::getMemberName) |
| | | .selectAs(Member::getSex,ApplyChagneDetail::getSex) |
| | | .selectAs(Member::getIdcardNo,ApplyChagneDetail::getIdcardNo) |
| | | .selectAs(Worktype::getName,ApplyChagneDetail::getWorkTypeName) |
| | | .selectAs(DispatchUnit::getName,ApplyChagneDetail::getDuName) |
| | | .leftJoin(Worktype.class,Worktype::getId,ApplyChagneDetail::getWorktypeId) |
| | | .leftJoin(DispatchUnit.class,DispatchUnit::getId,ApplyChagneDetail::getDuId) |
| | | .leftJoin(Member.class,Member::getId,ApplyChagneDetail::getMemberId) |
| | | .eq(ApplyChagneDetail::getIsdeleted,Constants.ZERO) |
| | | .eq(ApplyChagneDetail::getApplyChangeId,model.getId()); |
| | | //查询明细 |
| | | List<ApplyChagneDetail> detailList =applyChagneDetailJoinMapper.selectJoinList(ApplyChagneDetail.class,wrapper1); |
| | | return detailList; |
| | | } |
| | | private List<ApplyChagneDetail> findJoinChangeDetailList(ApplyChange model) { |
| | | MPJLambdaWrapper wrapper1= new MPJLambdaWrapper<ApplyChagneDetail>() |
| | | .selectAll(ApplyChagneDetail.class) |
| | | .selectAs(Member::getName,ApplyChagneDetail::getMemberName) |
| | | .selectAs(Member::getSex,ApplyChagneDetail::getSex) |
| | | .select("t1.name as worktypeName") |
| | | .select("t2.name as duName") |
| | | .select("t3.name as oldWorktypeName") |
| | | .select("t4.name as oldDuName") |
| | | .selectAs(Member::getSex,ApplyChagneDetail::getSex) |
| | | .selectAs(Member::getIdcardNo,ApplyChagneDetail::getIdcardNo) |
| | | .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(Member.class,Member::getId,ApplyChagneDetail::getMemberId) |
| | | .eq(ApplyChagneDetail::getIsdeleted,Constants.ZERO) |
| | | .eq(ApplyChagneDetail::getApplyChangeId,model.getId()); |
| | | //查询明细 |
| | | List<ApplyChagneDetail> detailList =applyChagneDetailJoinMapper.selectJoinList(ApplyChagneDetail.class,wrapper1); |
| | | return detailList; |
| | | } |
| | | |
| | | |
| | | } |