| | |
| | | return ApiResponse.success(taxesService.findPageForCompany(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("列表查询") |
| | | @PostMapping("/list") |
| | | @RequiresPermissions("business:taxes:query") |
| | | public ApiResponse<List<Taxes>> findList (@RequestBody Taxes taxes) { |
| | | return ApiResponse.success(taxesService.findListForCompany(taxes)); |
| | | } |
| | | |
| | | @ApiOperation("导出Excel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:taxes:exportExcel") |
| | |
| | | ExcelExporter.build(Taxes.class).export(taxesService.findPage(pageWrap).getRecords(), "发票信息表", response); |
| | | } |
| | | |
| | | @ApiOperation("获取企业信息") |
| | | @GetMapping("/getCompanyDetail") |
| | | |
| | | @ApiOperation("根据ID查询") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:taxes:query") |
| | | public ApiResponse<Taxes> getCompanyDetail() { |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业类用户无法进行该操作"); |
| | | public ApiResponse<Taxes> findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(taxesService.findById(id)); |
| | | } |
| | | return ApiResponse.success(taxesService.findById(loginUserInfo.getCompanyId())); |
| | | } |
| | | |
| | | // @ApiOperation("获取企业信息") |
| | | // @GetMapping("/getCompanyDetail") |
| | | // @RequiresPermissions("business:taxes:query") |
| | | // public ApiResponse<Taxes> getCompanyDetail() { |
| | | // LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | // if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业类用户无法进行该操作"); |
| | | // } |
| | | // return ApiResponse.success(taxesService.findById(loginUserInfo.getCompanyId())); |
| | | // } |
| | | |
| | | @ApiOperation("提交委托投报开票") |
| | | @PostMapping("/entrustInvoicing") |
| | |
| | | public static CountCyclePriceVO countPriceVO(Date startDate, Solutions solutions){ |
| | | CountCyclePriceVO countCyclePriceVO = new CountCyclePriceVO(); |
| | | if(solutions.getInsureCycleUnit().equals(Constants.ZERO)){ |
| | | countCyclePriceVO.setEndDate(DateUtil.afterDateByType(startDate,0,solutions.getInsureCycle())); |
| | | countCyclePriceVO.setEndDate( |
| | | DateUtil.getMontageDate( |
| | | DateUtil.afterDateByType(startDate,0,solutions.getInsureCycle()) |
| | | ,2) |
| | | ); |
| | | }else if(solutions.getInsureCycleUnit().equals(Constants.TWO)){ |
| | | //获取当月天数 |
| | | Integer monthDays = DateUtil.monthDays(startDate); |
| | | //获取天数后的日期 |
| | | Date afterDate = DateUtil.afterDateByType(startDate,0,monthDays); |
| | | countCyclePriceVO.setEndDate(DateUtil.afterDateByType(afterDate,0,-1)); |
| | | //赋值 每日结束时分秒 |
| | | countCyclePriceVO.setEndDate(DateUtil.getMontageDate(afterDate,2)); |
| | | }else if(solutions.getInsureCycleUnit().equals(Constants.THREE)){ |
| | | //获取X年后日期 多了一天 |
| | | Date afterDate = DateUtil.afterDateByType(startDate,2,solutions.getInsureCycle()); |
| | | countCyclePriceVO.setEndDate(DateUtil.afterDateByType(afterDate,0,-1)); |
| | | //赋值 每日结束时分秒 然后减少一天 |
| | | countCyclePriceVO.setEndDate(DateUtil.getMontageDate(afterDate,3)); |
| | | } |
| | | countCyclePriceVO.setCyclePrice(Constants.countDetailFee(solutions,countCyclePriceVO.getEndDate(),startDate)); |
| | | return countCyclePriceVO; |
| | |
| | | |
| | | |
| | | public enum ApplyLogType { |
| | | UPLOAD(0, "提交投保","提交意见:${param}"), |
| | | PLATFORM_RETURN(1, "退回投保","提交意见:${param}"), |
| | | WAIT_SIGNATURE(2, "上传投保单","提交意见:${param}"), |
| | | SIGNATURE(3, "企业签章",""), |
| | | FAIL_RETURN(4, "保单出具失败退回","提交意见:${param}"), |
| | | UPLOAD_INSURANCE(5, "保单完成","保险生效起期:${param1}变更为${param2}"), |
| | | COMPANY_APPLY_RETURN(6, "申请退回","提交意见:${param}"), |
| | | COMPANY_APPLY_CLOSE(7, "关闭申请",""), |
| | | PLATFORM_AGREE_BACK(8, "同意退回申请",""), |
| | | PLATFORM_UN_AGREE_BACK(9, "驳回退回申请","提交意见:${param}"), |
| | | COMPANY_EDIT(10, "保单修改","提交意见:${param1}\n${param2}"), |
| | | PLATFORM_CHECK_PASS(11, "投保审核通过",""), |
| | | CA_PLATFORM_CHECK_PASS_NO(12, "退回投保","提交意见:${param}"), |
| | | CA_PLATFORM_AGREE_BACK_APPLY(13, "同意退回申请","提交意见:${param}"), |
| | | CA_PLATFORM_APPROVE(14, "批单完成","保险生效起期:${param1}变更为${param2}"), |
| | | CA_PLATFORM_CHECK_SIGNATURE(15, "企业签章",""), |
| | | CA_COMPANY_EDIT(16, "批单修改","提交意见:${param1}\n${param2}"), |
| | | CA_COMPANY_COMMIT(17, "提交投保","提交意见:${param}"), |
| | | CA_COMPANY_BACK_APPLY(18, "申请退回","提交意见:${param}"), |
| | | CA_COMPANY_CLOSE(19, "关闭订单",""), |
| | | CA_PALTFORM_REFUSE_APPLY(20, "驳回退回申请",""), |
| | | CA_PALTFORM_EDIT_PIDAN(21, "修改批单","修改原因:${param}"), |
| | | PALTFORM_EDIT_BD(22, "修改保单","修改原因:${param}"), |
| | | CA_JIAJIAN_APPLY_SIGN(23, "加减保申请企业签章",""), |
| | | UPLOAD(0, "提交投保","提交意见:${param}",0), |
| | | PLATFORM_RETURN(1, "退回投保","提交意见:${param}",0), |
| | | WAIT_SIGNATURE(2, "上传投保单","提交意见:${param}",0), |
| | | SIGNATURE(3, "企业签章","",0), |
| | | FAIL_RETURN(4, "保单出具失败退回","提交意见:${param}",0), |
| | | UPLOAD_INSURANCE(5, "保单完成","保险生效起期:${param1}变更为${param2}",0), |
| | | COMPANY_APPLY_RETURN(6, "申请退回","提交意见:${param}",0), |
| | | COMPANY_APPLY_CLOSE(7, "关闭申请","",0), |
| | | PLATFORM_AGREE_BACK(8, "同意退回申请","",0), |
| | | PLATFORM_UN_AGREE_BACK(9, "驳回退回申请","提交意见:${param}",0), |
| | | COMPANY_EDIT(10, "保单修改","提交意见:${param1}\n${param2}",0), |
| | | PLATFORM_CHECK_PASS(11, "投保审核通过","",0), |
| | | UPLOAD_AGAIN(26, "再次投保","",0), |
| | | |
| | | CA_CHANGUNIT_APPLY_SIGN(24, "换成申请企业签章",""), |
| | | |
| | | CA_PLATFORM_CHECK_PASS_NO(12, "退回投保","提交意见:${param}",1), |
| | | CA_PLATFORM_AGREE_BACK_APPLY(13, "同意退回申请","提交意见:${param}",1), |
| | | CA_PLATFORM_APPROVE(14, "批单完成","保险生效起期:${param1}变更为${param2}",1), |
| | | CA_PLATFORM_CHECK_SIGNATURE(15, "企业签章","",1), |
| | | CA_COMPANY_EDIT(16, "批单修改","提交意见:${param1}\n${param2}",1), |
| | | CA_COMPANY_COMMIT(17, "提交投保","提交意见:${param}",1), |
| | | CA_COMPANY_BACK_APPLY(18, "申请退回","提交意见:${param}",1), |
| | | CA_COMPANY_CLOSE(19, "关闭订单","",1), |
| | | CA_PALTFORM_REFUSE_APPLY(20, "驳回退回申请","",1), |
| | | CA_PALTFORM_EDIT_PIDAN(21, "修改批单","修改原因:${param}",1), |
| | | PALTFORM_EDIT_BD(22, "修改保单","修改原因:${param}",1), |
| | | CA_JIAJIAN_APPLY_SIGN(23, "加减保申请企业签章","",1), |
| | | CA_CHANGUNIT_APPLY_SIGN(24, "换成申请企业签章","",1), |
| | | CA_UPLOAD_AGAIN(25, "再次投保","",1), |
| | | ; |
| | | // 成员变量 |
| | | private String name; |
| | | private String info; |
| | | private int key; |
| | | private int type; |
| | | |
| | | // 构造方法 |
| | | ApplyLogType(int key, String name,String info) { |
| | | ApplyLogType(int key, String name,String info,int type) { |
| | | this.name = name; |
| | | this.info = info; |
| | | this.key = key; |
| | | this.type = type; |
| | | } |
| | | |
| | | // 普通方法 |
| | |
| | | } |
| | | return null; |
| | | } |
| | | public static List<Integer> getTypeList(int type) { |
| | | List<Integer> list = new ArrayList<>(); |
| | | for (ApplyLogType c : ApplyLogType.values()) { |
| | | if (c.getType() == type) { |
| | | list.add(c.getKey()); |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | |
| | | // get set 方法 |
| | | public String getName() { |
| | |
| | | |
| | | public void setInfo(String info) { |
| | | this.info = info; |
| | | } |
| | | |
| | | |
| | | public int getType() { |
| | | return type; |
| | | } |
| | | |
| | | public void setType(int type) { |
| | | this.type = type; |
| | | } |
| | | } |
| | | |
| | |
| | | public void setInfo(String info) { |
| | | this.info = info; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public enum ApplyChangeLogStatus { |
| | | UPLOAD(0, "发起申请",""), |
| | | RETURN_APPLY(3, "发起退回申请","提交意见:${param}"), |
| | | PLATFORM_AGREE(4, "平台审批通过" ,"提交意见:${param}"), |
| | | PLATFORM_UN_AGREE(0, "审批驳回","提交意见:${param}"), |
| | | CLOSE(5, "关闭",""), |
| | | ; |
| | | // 成员变量 |
| | | private String name; |
| | | private String info; |
| | | private int key; |
| | | |
| | | // 构造方法 |
| | | ApplyChangeLogStatus(int key, String name,String info) { |
| | | this.name = name; |
| | | this.info = info; |
| | | this.key = key; |
| | | } |
| | | |
| | | // 普通方法 |
| | | public static String getName(int index) { |
| | | for (ApplyChangeLogStatus c : ApplyChangeLogStatus.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.name; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | public static String getInfo(int index) { |
| | | for (ApplyChangeLogStatus c : ApplyChangeLogStatus.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.info; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | |
| | | // get set 方法 |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | public String getInfo() { |
| | | return info; |
| | | } |
| | | |
| | | public void setInfo(String info) { |
| | | this.info = info; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | calo.setTime(oldDate); |
| | | caln.setTime(newDate); |
| | | if(type==0||type==1){ |
| | | return calculateDaysBetweenDates(caln, calo) ; |
| | | return calculateDaysBetweenDates(caln, calo) + 1 ; |
| | | }else if(type==2){ |
| | | |
| | | int day = caln.get(Calendar.DATE); |
| | |
| | | PageData<Taxes> findPage(PageWrap<Taxes> pageWrap); |
| | | |
| | | PageData<Taxes> findPageForCompany(PageWrap<Taxes> pageWrap); |
| | | |
| | | List<Taxes> findListForCompany(Taxes queryModel); |
| | | /** |
| | | * 条件统计 |
| | | * |
| | |
| | | applyChangeMapper.updateById(applyChangeFee); |
| | | |
| | | |
| | | this.saveApplyLog(applyChange,Constants.ApplyChangeLogStatus.UPLOAD,null); |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_COMPANY_COMMIT; |
| | | String info =applyLogType.getInfo(); |
| | | // info = info.replace("${param}", update.getCheckInfo()); |
| | | ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null); |
| | | applyLogMapper.insert(log); |
| | | |
| | | |
| | | return applyChange.getId(); |
| | | } |
| | | |
| | |
| | | BigDecimal fee = this.dealApplyChangeData(applyChange,insuranceApply,companySolution,solutions,loginUserInfo,BigDecimal.ZERO); |
| | | applyChange.setFee(fee); |
| | | applyChangeMapper.updateById(applyChange); |
| | | this.saveApplyLog(applyChange,Constants.ApplyChangeLogStatus.UPLOAD,null); |
| | | |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_UPLOAD_AGAIN; |
| | | String info =applyLogType.getInfo(); |
| | | // info = info.replace("${param}", update.getCheckInfo()); |
| | | ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null); |
| | | applyLogMapper.insert(log); |
| | | |
| | | |
| | | return applyChange.getId(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public void saveApplyLog(ApplyChange applyChange,Constants.ApplyChangeLogStatus applyChangeLogStatus,String content){ |
| | | public void saveApplyLog(ApplyChange applyChange,Constants.ApplyLogType applyLogType,String content){ |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | ApplyLog applyLog = new ApplyLog(); |
| | | applyLog.setCreateDate(new Date()); |
| | | applyLog.setCreator(loginUserInfo.getId()); |
| | | applyLog.setIsdeleted(Constants.ZERO); |
| | | applyLog.setApplyId(applyChange.getApplyId()); |
| | | applyLog.setTitle(applyChangeLogStatus.getName()); |
| | | applyLog.setTitle(applyLogType.getName()); |
| | | if(StringUtils.isNotBlank(content)){ |
| | | applyLog.setContent(applyChangeLogStatus.getInfo().replace("${param}",content)); |
| | | }else{ |
| | | applyLog.setContent(applyChangeLogStatus.getInfo()); |
| | | applyLog.setContent(applyLogType.getInfo().replace("${param}",content)); |
| | | } |
| | | applyLog.setObjType(applyChangeLogStatus.getKey()); |
| | | applyLog.setObjType(applyLogType.getKey()); |
| | | applyLog.setObjId( applyChange.getId()); |
| | | applyLog.setStatus(applyChange.getStatus()); |
| | | applyLogMapper.insert(applyLog); |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询方案信息"); |
| | | } |
| | | |
| | | Constants.ApplyChangeLogStatus applyChangeLogStatus = Constants.ApplyChangeLogStatus.RETURN_APPLY; |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_PLATFORM_CHECK_PASS_NO; |
| | | |
| | | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.APPLY_CHANGE; |
| | | if(applyChange.getType().equals(Constants.ONE)){ |
| | |
| | | |
| | | |
| | | }else if(applyChangeOptDTO.getOptType().equals(4)){ |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.PLATFORM_AGREE; |
| | | applyLogType = Constants.ApplyLogType.CA_PLATFORM_AGREE_BACK_APPLY; |
| | | //平台同意退回 |
| | | if(loginUserInfo.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非平台端用户无法进行该操作"); |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(5)){ |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.PLATFORM_UN_AGREE; |
| | | applyLogType = Constants.ApplyLogType.CA_PALTFORM_REFUSE_APPLY; |
| | | //平台驳回退回 |
| | | if(loginUserInfo.getType().equals(Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非平台端用户无法进行该操作"); |
| | |
| | | } |
| | | }else if(applyChangeOptDTO.getOptType().equals(6)){ |
| | | //企业关闭 |
| | | applyChangeLogStatus = Constants.ApplyChangeLogStatus.CLOSE; |
| | | applyLogType = Constants.ApplyLogType.CA_COMPANY_CLOSE; |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业端用户无法进行该操作"); |
| | | } |
| | |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态错误无法进行该操作!"); |
| | | } |
| | | applyChange.setStatus(Constants.ApplyChangeStatus.CLOSE.getKey()); |
| | | |
| | | |
| | | //存储待办信息 |
| | | //删除其他待办 |
| | |
| | | applyChange.setEditDate(new Date()); |
| | | applyChangeMapper.updateById(applyChange); |
| | | |
| | | //存储日志数据 |
| | | this.saveApplyLog(applyChange,applyChangeLogStatus,applyChangeOptDTO.getOptIllustration()); |
| | | String info = applyLogType.getInfo(); |
| | | info = info.replace("${param}", applyChangeOptDTO.getOptIllustration()); |
| | | ApplyLog log = new ApplyLog(applyChange,applyLogType.getName(),info,applyChange.getId(),applyLogType.getKey(), null, null); |
| | | applyLogMapper.insert(log); |
| | | } |
| | | |
| | | |
| | |
| | | .selectAs(Company::getName,ApplyLog::getCompanyName) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,ApplyLog::getCreator) |
| | | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) |
| | | .in(ApplyLog::getObjType,Constants.ApplyLogType.getTypeList(Constants.ONE)) |
| | | .eq(ApplyLog::getObjId,applyChange.getId()) |
| | | .orderByAsc(ApplyLog::getCreateDate) |
| | | ); |
| | |
| | | updBean.setFee(applyDetailList.stream().map(ApplyDetail::getFee).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | insuranceApplyMapper.updateById(updBean); |
| | | //存储日志数据 |
| | | this.saveApplyLog(insuranceApply,insuranceApplyStatus,null); |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.UPLOAD; |
| | | String info =applyLogType.getInfo(); |
| | | // info = info.replace("${param}", update.getCheckInfo()); |
| | | ApplyLog log = new ApplyLog(insuranceApply,applyLogType.getName(),info,insuranceApply.getId(),applyLogType.getKey(),null, null); |
| | | applyLogMapper.insert(log); |
| | | |
| | | |
| | | |
| | | //发送待办业务 |
| | | |
| | | //存储待办信息 |
| | |
| | | insuranceApply.setFee(applyDetailList.stream().map(ApplyDetail::getFee).reduce(BigDecimal.ZERO,BigDecimal::add)); |
| | | insuranceApplyMapper.updateById(insuranceApply); |
| | | //存储日志数据 |
| | | this.saveApplyLog(insuranceApply,insuranceApplyStatus,null); |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.UPLOAD_AGAIN; |
| | | String info =applyLogType.getInfo(); |
| | | // info = info.replace("${param}", update.getCheckInfo()); |
| | | ApplyLog log = new ApplyLog(insuranceApply,applyLogType.getName(),info,insuranceApply.getId(),applyLogType.getKey(),null, null); |
| | | applyLogMapper.insert(log); |
| | | |
| | | |
| | | //存储待办信息 |
| | |
| | | } |
| | | |
| | | |
| | | public void saveApplyLog(InsuranceApply insuranceApply,Constants.InsuranceApplyStatus insuranceApplyStatus,String content){ |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | ApplyLog applyLog = new ApplyLog(); |
| | | applyLog.setCreateDate(new Date()); |
| | | applyLog.setCreator(loginUserInfo.getId()); |
| | | applyLog.setIsdeleted(Constants.ZERO); |
| | | applyLog.setApplyId(insuranceApply.getId()); |
| | | applyLog.setTitle(insuranceApplyStatus.getName()); |
| | | applyLog.setContent(content); |
| | | applyLog.setObjType(insuranceApplyStatus.getKey()); |
| | | applyLog.setObjId( insuranceApply.getId()); |
| | | applyLog.setStatus(insuranceApply.getStatus()); |
| | | applyLogMapper.insert(applyLog); |
| | | } |
| | | |
| | | |
| | | |
| | | // public BigDecimal countDetailFee(Solutions solutions ,Date startDate,Date endDate){ |
| | | // //查询保险实际周期 |
| | | // Integer cycle = DateUtil.calculateBetween(endDate,startDate,solutions.getDataType()); |
| | | // if(cycle==-1){ |
| | | // throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"日期信息错误!"); |
| | | // } |
| | | // return solutions.getPrice().multiply(new BigDecimal(cycle)); |
| | | // } |
| | | |
| | | // public static void main(String[] args) { |
| | | // Date date1 = DateUtil.StringToDate("2023-03-01 00:00:00"); |
| | | // Date date2 = DateUtil.StringToDate("2023-04-01 00:00:00"); |
| | | // System.out.println(DateUtil.calculateBetween(date1,date2,0)); |
| | | // System.out.println(DateUtil.calculateBetween(date1,date2,1)); |
| | | // System.out.println(DateUtil.calculateBetween(date1,date2,2)); |
| | | // System.out.println(DateUtil.calculateBetween(date1,date2,3)); |
| | | // |
| | | // } |
| | | |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | insuranceApplyMapper.deleteById(id); |
| | |
| | | queryWrapper.select(" DATEDIFF( t.END_TIME ,now() ) AS loseEfficacyDays "); |
| | | queryWrapper.select(" ( select count(1) from apply_detail ad where ad.apply_id = t.id ) as insureNum"); |
| | | if(!Objects.isNull(pageWrap.getModel())&&!Objects.isNull(pageWrap.getModel().getType())){ |
| | | queryWrapper.select(" ( select sum(td.fee) from taxes ts inner join tax_detial td on td.TAX_ID = ts.id where ts.status != 2 and td.INSURANCE_APPLY_ID = t.id ) as taxesMoney"); |
| | | queryWrapper.select(" ifnull(( select sum(td.fee) from taxes ts inner join tax_detial td on td.TAX_ID = ts.id where ts.status != 2 and td.INSURANCE_APPLY_ID = t.id ),0) as taxesMoney"); |
| | | queryWrapper.select(" ( select td.CREATE_DATE from taxes ts inner join tax_detial td on td.TAX_ID = ts.id where ts.status != 2 and td.INSURANCE_APPLY_ID = t.id order by td.CREATE_DATE desc limit 1 ) as taxesLast "); |
| | | } |
| | | queryWrapper.leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId); |
| | |
| | | .selectAs(Company::getName,ApplyLog::getCompanyName) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,ApplyLog::getCreator) |
| | | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) |
| | | .in(ApplyLog::getObjType,Constants.ApplyLogType.getTypeList(Constants.ZERO)) |
| | | .eq(ApplyLog::getApplyId,insuranceApply.getId()) |
| | | .orderByAsc(ApplyLog::getCreateDate) |
| | | ); |
| | |
| | | info = info.replace("${param}", insuranceApplyOptDTO.getOptIllustration()); |
| | | ApplyLog log = new ApplyLog(insuranceApply,applyLogType.getName(),info,insuranceApply.getId(),applyLogType.getKey(),JSONObject.toJSONString(insuranceApply), JSONObject.toJSONString(insuranceApply)); |
| | | applyLogMapper.insert(log); |
| | | // this.saveApplyLog(insuranceApply,insuranceApplyStatus,null); |
| | | } |
| | | |
| | | |
| | |
| | | queryWrapper.selectAll(Taxes.class); |
| | | queryWrapper.selectAs(SystemUser::getRealname,Taxes::getCreatorName); |
| | | queryWrapper.leftJoin(SystemUser.class,SystemUser::getId,Taxes::getCreator); |
| | | |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | queryWrapper.eq(Taxes::getIsdeleted, Constants.ZERO); |
| | | Taxes queryModel = pageWrap.getModel(); |
| | |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<Taxes> findListForCompany(Taxes queryModel) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | MPJLambdaWrapper<Taxes> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(Taxes.class); |
| | | queryWrapper.selectAs(SystemUser::getRealname,Taxes::getCreatorName); |
| | | queryWrapper.leftJoin(SystemUser.class,SystemUser::getId,Taxes::getCreator); |
| | | |
| | | queryWrapper.eq(Taxes::getIsdeleted, Constants.ZERO); |
| | | if(!user.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业用户无法进行该业务查询"); |
| | | } |
| | | if(!Objects.isNull(queryModel)){ |
| | | queryWrapper.ge(queryModel.getStartDate() != null,Taxes::getCreateDate, (queryModel.getStartDate())); |
| | | queryWrapper.le(queryModel.getEndDate() != null,Taxes::getCreateDate, (queryModel.getEndDate())); |
| | | queryWrapper.eq(!Objects.isNull(queryModel.getInsuranceApplyId()),Taxes::getInsuranceApplyId,queryModel.getInsuranceApplyId()); |
| | | queryWrapper.eq(!Objects.isNull(queryModel.getStatus()),Taxes::getStatus,queryModel.getStatus()); |
| | | } |
| | | queryWrapper.orderByAsc(Taxes::getCreateDate); |
| | | return taxesJoinMapper.selectJoinList(Taxes.class, queryWrapper); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @Override |