| | |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.dto.DispatchUnitQueryDTO; |
| | | import com.doumee.dao.business.dto.SaveDispatchUnitDTO; |
| | | import com.doumee.dao.business.model.DispatchUnit; |
| | |
| | | @PostMapping("/findListByDTO") |
| | | @RequiresPermissions("business:dispatchunit:query") |
| | | public ApiResponse<List<DispatchUnit>> findListByDTO (@RequestBody DispatchUnitQueryDTO dispatchUnitQueryDTO) { |
| | | dispatchUnitQueryDTO.setDataType(Constants.TWO); |
| | | return ApiResponse.success(dispatchUnitService.findByDTO(dispatchUnitQueryDTO)); |
| | | } |
| | | |
| | |
| | | |
| | | @ApiOperation("测试实际金额") |
| | | @GetMapping("/testFee") |
| | | public ApiResponse testFee(@RequestParam Integer id) { |
| | | public ApiResponse testFee(Integer id) { |
| | | insuranceApplyService.updateApplyCurrentFee(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.business.model.Solutions; |
| | | import com.doumee.service.business.SolutionsService; |
| | | import io.swagger.annotations.Api; |
| | |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * @author 江蹄蹄 |
| | |
| | | @ApiOperation("列表查询") |
| | | @PostMapping("/list") |
| | | @RequiresPermissions("business:solutions:query") |
| | | public ApiResponse<List<Solutions>> findList () { |
| | | return ApiResponse.success(solutionsService.findListForCompany()); |
| | | public ApiResponse<List<Solutions>> findList (Solutions solutions) { |
| | | Integer dateType = Constants.TWO; |
| | | if(!Objects.isNull(solutions)&&!Objects.isNull(solutions.getDataType())){ |
| | | dateType = solutions.getDataType(); |
| | | } |
| | | return ApiResponse.success(solutionsService.findListForCompany(dateType)); |
| | | } |
| | | |
| | | @ApiOperation("根据历史版本查询当前最新启用版本") |
| | | @GetMapping("/getNewVersion") |
| | | public ApiResponse<Solutions> getNewVersion (@RequestParam Integer solutionId) { |
| | | return ApiResponse.success(solutionsService.getNewVersion(solutionId)); |
| | | } |
| | | |
| | | |
| | | // @ApiOperation("列表查询") |
| | | // @PostMapping("/page") |
| | | // public ApiResponse<List<Solutions>> findPage (@RequestBody Solutions solutions) { |
| | |
| | | return ApiResponse.success(systemMenuBiz.findTree(loginUserInfo.getId(),loginUserInfo.getType())); |
| | | } |
| | | |
| | | // @ApiOperation("查询列表树") |
| | | // @PostMapping("/treeList") |
| | | // @RequiresPermissions("system:menu:query") |
| | | // public ApiResponse<List<SystemMenuListVO>> findTree () { |
| | | // LoginUserInfo loginUserInfo = this.getLoginUser(); |
| | | // return ApiResponse.success(systemMenuBiz.findTreeByType(loginUserInfo.getType())); |
| | | // } |
| | | |
| | | |
| | | @ApiOperation("查询列表树") |
| | | @PostMapping("/treeList") |
| | | @PostMapping("/treeList/{type}") |
| | | @RequiresPermissions("system:menu:query") |
| | | public ApiResponse<List<SystemMenuListVO>> findTree () { |
| | | LoginUserInfo loginUserInfo = this.getLoginUser(); |
| | | return ApiResponse.success(systemMenuBiz.findTreeByType(loginUserInfo.getType())); |
| | | public ApiResponse<List<SystemMenuListVO>> treeList (@PathVariable Integer type) { |
| | | return ApiResponse.success(systemMenuBiz.findTreeByType(type)); |
| | | } |
| | | |
| | | @PreventRepeat |
| | |
| | | # env: production |
| | | server: |
| | | # port: 10022 |
| | | port: 10025 |
| | | port: 10031 |
| | | |
| | | spring: |
| | | # application:git |
| | |
| | | env: development |
| | | # env: production |
| | | server: |
| | | port: 10023 |
| | | port: 10030 |
| | | |
| | | spring: |
| | | # application: |
| | |
| | | |
| | | import cn.emay.sdk.core.dto.sms.response.SmsResponse; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.biz.system.SystemUserBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | |
| | | @Autowired |
| | | private SmsEmailMapper smsEmailMapper; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | @Autowired |
| | | private CompanyService companyService; |
| | | @Value("${debug_model}") |
| | |
| | | // 生成密码盐 |
| | | String salt = RandomStringUtils.randomAlphabetic(6); |
| | | // 生成密码 |
| | | systemUser.setPassword(Utils.Secure.encryptPassword(systemUser.getPassword(), salt)); |
| | | // systemUser.setPassword(Utils.Secure.encryptPassword(systemUser.getPassword(), salt)); |
| | | systemUser.setPassword(Utils.Secure.encryptPassword(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.DEFAULT_PASSWORD).getCode(), salt)); |
| | | systemUser.setSalt(salt); |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | systemUser.setType(loginUserInfo.getType()); |
| | |
| | | COMPANY_EDIT(10, "保单修改","提交意见:${param1}\n${param2}",0), |
| | | PLATFORM_CHECK_PASS(11, "投保审核通过","",0), |
| | | UPLOAD_AGAIN(26, "再次投保","",0), |
| | | PALTFORM_EDIT_BD(22, "修改保单","修改原因:${param}",0), |
| | | |
| | | |
| | | CA_PLATFORM_CHECK_PASS_NO(12, "退回投保","提交意见:${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 Date createTimeE; |
| | | |
| | | @ApiModelProperty(value = "状态 0待审核 1平台退回保单(已退回) 2已上传代签申请表待企业签章(待签署) 3已签章待上传保险单(待出单) 4保单出具失败退回(已退回) 5已上传保单(保障中)6企业申请退回中 7平台同意退回(已退回) 8企业关闭 (已关闭)", example = "1") |
| | | private Integer status; |
| | | private String status; |
| | | |
| | | @ApiModelProperty(value = "类型 0直保 1委托投保") |
| | | private Integer type; |
| | |
| | | |
| | | @ApiModelProperty(value = "即将失效订单:0=否;1=是") |
| | | private Integer loseEfficacy; |
| | | |
| | | @ApiModelProperty(value = "状态 0待审核 1待出单 2保障中 3已过期 4已撤回 5退回申请中 6已关闭", example = "1") |
| | | private Integer statusCollect; |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | |
| | | @ApiModelProperty(value = "保单主键下数据" , notes = "减保申请/换厂申请") |
| | | private Integer insuranceApplyId; |
| | | |
| | | @ApiModelProperty(value = "批单日期" , notes = "减保申请/换厂申请") |
| | | private Date validTime ; |
| | | |
| | | @ApiModelProperty(value = "企业主键") |
| | | private Integer companyId; |
| | | |
| | |
| | | @ExcelColumn(name="排序码") |
| | | private Integer sortnum; |
| | | |
| | | @ApiModelProperty(value = "方案编码(关联solutions)", example = "1") |
| | | @ExcelColumn(name="方案编码(关联solutions)") |
| | | @ApiModelProperty(value = "方案编码(关联solutions) 基表数据", example = "1") |
| | | @ExcelColumn(name="方案编码(关联solutions)基表数据") |
| | | private Integer solutionBaseId; |
| | | |
| | | @ApiModelProperty(value = "是否可加保 0否 1是", example = "1") |
| | |
| | | @ApiModelProperty(value = "方案主键(关联solutions)", example = "1") |
| | | @ExcelColumn(name="方案主键(关联solutions)") |
| | | private Integer solutionId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "方案对象", example = "1") |
| | | @TableField(exist = false) |
| | | private Solutions solution; |
| | |
| | | |
| | | @ApiModelProperty(value = "更新时间") |
| | | @ExcelColumn(name="更新时间") |
| | | |
| | | private Date editDate; |
| | | |
| | | @ApiModelProperty(value = "是否删除0否 1是", example = "1") |
| | |
| | | @TableField(exist = false) |
| | | private String statusInfo; |
| | | |
| | | @ApiModelProperty(value = "最后一次加减保/换厂日期") |
| | | @TableField(exist = false) |
| | | private Date lastChangeDate; |
| | | |
| | | |
| | | public TaxesInvoicingVO toTaxesInvoicingVO(){ |
| | |
| | | PageData<Solutions> findPageCom(PageWrap<Solutions> pageWrap); |
| | | |
| | | |
| | | List<Solutions> findListForCompany(); |
| | | List<Solutions> findListForCompany(Integer dataType); |
| | | |
| | | Solutions getNewVersion(Integer solutionId); |
| | | /** |
| | | * 条件统计 |
| | | * |
| | |
| | | if(detailList ==null || detailList.size()==0){ |
| | | return; |
| | | } |
| | | //实际批单生效日期 |
| | | Date applyStartTime = DateUtil.getMontageDate(update.getApplyStartTime(),1); |
| | | for(ApplyChagneDetail detail : detailList){ |
| | | //查询员工是在主单下 是否存在生效中的数据 |
| | | ApplyDetail oldModel = applyDetailJoinMapper.selectOne(new QueryWrapper<ApplyDetail>().lambda() |
| | | .eq(ApplyDetail::getApplyId, update.getApplyId()) |
| | | .eq(ApplyDetail::getMemberId, detail.getMemberId()) |
| | | .le(ApplyDetail::getStartTime,applyStartTime) |
| | | .ge(ApplyDetail::getEndTime,applyStartTime) |
| | | .orderByDesc(ApplyDetail::getCreateDate) |
| | | .last("limit 1")); |
| | | if(oldModel == null ){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,用户【"+detail.getMemberName()+"】原保单信息有误,当前申请不支持减保处理!"); |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,用户【"+detail.getMemberName()+"】原保单信息有误,批单日期未在保单日期内!"); |
| | | } |
| | | Date endDate = oldModel.getEndTime(); |
| | | //当前日期大于批单日期 需要回滚数据实际数据 |
| | | Boolean flag = DateUtil.getMontageDate(new Date(),2).compareTo(DateUtil.getMontageDate(update.getStartTime(),2))>0; |
| | | //换厂后历史记录的费用 fee |
| | | Integer days = DateUtil.daysBetweenDates(DateUtil.getMontageDate(update.getStartTime(),2),DateUtil.getMontageDate(oldModel.getStartTime(),1)) + 1; |
| | | BigDecimal oldFee = this.getApplyPrice(update.getApplyId(),days); |
| | | BigDecimal fee = oldModel.getFee(); |
| | | BigDecimal oldCurrentFee = oldModel.getCurrentFee(); |
| | | applyDetailJoinMapper.update(null, new UpdateWrapper<ApplyDetail>().lambda() |
| | | .set(ApplyDetail::getEditor,update.getEditor()) |
| | | .set(ApplyDetail::getEditDate,update.getEditDate()) |
| | | .set(ApplyDetail::getEndTime,DateUtil.getMontageDate(update.getStartTime(),2)) |
| | | .set(ApplyDetail::getFee,oldFee) |
| | | .set(flag,ApplyDetail::getCurrentFee,oldFee) |
| | | .eq(ApplyDetail::getId,oldModel.getApplyId()) |
| | | ); |
| | | |
| | | //修改 员工投保明细记录 历史数据 |
| | | memberInsuranceJoinMapper.update(null,new UpdateWrapper<MemberInsurance>().lambda() |
| | | .set(MemberInsurance::getEndTime,update.getApplyStartTime()) |
| | | .set(MemberInsurance::getFee,oldFee) |
| | | .eq(MemberInsurance::getRelationId,oldModel.getId()) |
| | | ); |
| | | //如果实际批单日期 和 原记录日期相等 则直接修改记录派遣单位与工种信息 |
| | | if(applyStartTime.compareTo(oldModel.getStartTime())!=Constants.ZERO){ |
| | | //当前日期大于批单日期 需要回滚数据实际数据 |
| | | Boolean flag = DateUtil.getMontageDate(new Date(),2).compareTo(DateUtil.getMontageDate(update.getApplyStartTime(),2))>0; |
| | | //换厂后历史记录的费用 fee |
| | | Integer days = DateUtil.daysBetweenDates(DateUtil.getMontageDate(update.getApplyStartTime(),3),DateUtil.getMontageDate(oldModel.getStartTime(),1))+1; |
| | | BigDecimal oldFee = this.getApplyPrice(update.getApplyId(),days); |
| | | BigDecimal fee = oldModel.getFee(); |
| | | BigDecimal oldCurrentFee = oldModel.getCurrentFee(); |
| | | |
| | | ApplyDetail applyDetail = new ApplyDetail(); |
| | | applyDetail.setApplyId(oldModel.getApplyId()); |
| | | applyDetail.setCreateDate(new Date()); |
| | | applyDetail.setCreator(update.getEditor()); |
| | | applyDetail.setMemberId(oldModel.getMemberId()); |
| | | applyDetail.setStartTime(DateUtil.getMontageDate(update.getApplyStartTime(),1)); |
| | | applyDetail.setEndTime(endDate); |
| | | applyDetail.setDuId(detail.getDuId()); |
| | | applyDetail.setWorktypeId(detail.getWorktypeId()); |
| | | applyDetail.setIdcardNo(oldModel.getIdcardNo()); |
| | | applyDetail.setFee(fee.subtract(oldFee)); |
| | | if(flag){ |
| | | applyDetail.setCurrentFee(oldCurrentFee.multiply(oldFee)); |
| | | applyDetailJoinMapper.update(null, new UpdateWrapper<ApplyDetail>().lambda() |
| | | .set(ApplyDetail::getEditor,update.getEditor()) |
| | | .set(ApplyDetail::getEditDate,update.getEditDate()) |
| | | .set(ApplyDetail::getEndTime,DateUtil.getMontageDate(update.getApplyStartTime(),3)) |
| | | .set(ApplyDetail::getFee,oldFee) |
| | | .set(flag,ApplyDetail::getCurrentFee,oldFee) |
| | | .eq(ApplyDetail::getId,oldModel.getId()) |
| | | ); |
| | | |
| | | //修改 员工投保明细记录 历史数据 |
| | | memberInsuranceJoinMapper.update(null,new UpdateWrapper<MemberInsurance>().lambda() |
| | | .set(MemberInsurance::getEndTime,update.getApplyStartTime()) |
| | | .set(MemberInsurance::getFee,oldFee) |
| | | .eq(MemberInsurance::getRelationId,oldModel.getId()) |
| | | ); |
| | | |
| | | ApplyDetail applyDetail = new ApplyDetail(); |
| | | applyDetail.setApplyId(oldModel.getApplyId()); |
| | | applyDetail.setCreateDate(new Date()); |
| | | applyDetail.setCreator(update.getEditor()); |
| | | applyDetail.setMemberId(oldModel.getMemberId()); |
| | | applyDetail.setStartTime(DateUtil.getMontageDate(update.getApplyStartTime(),1)); |
| | | applyDetail.setEndTime(endDate); |
| | | applyDetail.setDuId(detail.getDuId()); |
| | | applyDetail.setWorktypeId(detail.getWorktypeId()); |
| | | applyDetail.setIdcardNo(oldModel.getIdcardNo()); |
| | | applyDetail.setFee(fee.subtract(oldFee)); |
| | | if(flag){ |
| | | applyDetail.setCurrentFee(oldCurrentFee.multiply(oldFee)); |
| | | }else{ |
| | | applyDetail.setCurrentFee(BigDecimal.ZERO); |
| | | } |
| | | applyDetail.setSex(oldModel.getSex()); |
| | | applyDetail.setMemberName(oldModel.getMemberName()); |
| | | applyDetail.setFromId(detail.getId()); |
| | | applyDetailJoinMapper.insert(applyDetail); |
| | | |
| | | MemberInsurance memberInsurance = new MemberInsurance(applyDetail,update.getId()); |
| | | memberInsuranceJoinMapper.insert(memberInsurance); |
| | | }else{ |
| | | applyDetail.setCurrentFee(BigDecimal.ZERO); |
| | | } |
| | | applyDetail.setSex(oldModel.getSex()); |
| | | applyDetail.setMemberName(oldModel.getMemberName()); |
| | | applyDetail.setFromId(detail.getId()); |
| | | applyDetailJoinMapper.insert(applyDetail); |
| | | |
| | | MemberInsurance memberInsurance = new MemberInsurance(applyDetail,update.getId()); |
| | | memberInsuranceJoinMapper.insert(memberInsurance); |
| | | applyDetailJoinMapper.update(null, new UpdateWrapper<ApplyDetail>().lambda() |
| | | .set(ApplyDetail::getEditor,update.getEditor()) |
| | | .set(ApplyDetail::getEditDate,update.getEditDate()) |
| | | .set(ApplyDetail::getDuId,detail.getDuId()) |
| | | .set(ApplyDetail::getWorktypeId,detail.getWorktypeId()) |
| | | .eq(ApplyDetail::getId,oldModel.getId()) |
| | | ); |
| | | |
| | | //员工投保明细记录 历史数据 |
| | | memberInsuranceJoinMapper.update(null,new UpdateWrapper<MemberInsurance>().lambda() |
| | | .set(MemberInsurance::getDuId,detail.getDuId()) |
| | | .set(MemberInsurance::getDuName,detail.getDuName()) |
| | | .set(MemberInsurance::getWorktypeId,detail.getWorktypeId()) |
| | | .set(MemberInsurance::getWorktypeName,detail.getWorkTypeName()) |
| | | .eq(MemberInsurance::getRelationId,oldModel.getId()) |
| | | ); |
| | | } |
| | | |
| | | Member member = memberMapper.selectById(detail.getMemberId()); |
| | | if(Objects.isNull(member)){ |
| | |
| | | add.setEndTime(DateUtil.getMontageDate(detail.getEndTime(), 2)); |
| | | add.setFee(countCyclePriceVO_add.getCyclePrice()); |
| | | |
| | | if (DateUtil.daysBetweenDates(DateUtil.getMontageDate(detail.getStartTime(), 2), new Date()) >= 0) { |
| | | |
| | | if(new Date().compareTo(DateUtil.getMontageDate(detail.getStartTime(), 2))>=0){ |
| | | Integer days = DateUtil.daysBetweenDates(DateUtil.getMontageDate(new Date(), 2), detail.getStartTime()) + 1; |
| | | //如果已产生费用,计算已产生费用 |
| | | add.setCurrentFee(this.getApplyPrice(update.getApplyId(), days)); |
| | |
| | | } |
| | | CompanySolution companySolution = companySolutionMapper.selectOne(new QueryWrapper<CompanySolution>().lambda() |
| | | .eq(CompanySolution::getCompanyId,loginUserInfo.getCompanyId()) |
| | | .eq(CompanySolution::getSolutionBaseId,solutions.getId()) |
| | | .eq(CompanySolution::getSolutionId,solutions.getId()) |
| | | .eq(CompanySolution::getIsdeleted,Constants.ZERO) |
| | | .last(" limit 1 ") |
| | | ); |
| | |
| | | && DateUtil.compareDate( applyChange.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "申请日期未处于保单日期内,无法进行该操作"); |
| | | } |
| | | //查询保单下是否存在进行中的加减保/换厂单据 |
| | | if(applyChangeMapper.selectCount(new QueryWrapper<ApplyChange>().lambda() |
| | | .eq(ApplyChange::getApplyId,insuranceApply.getId()) |
| | | .notIn(ApplyChange::getStatus,Constants.ApplyChangeStatus.APPROVE.getKey(),Constants.ApplyChangeStatus.CLOSE.getKey()) |
| | | |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "存在进行中的加减保/换厂申请"); |
| | | }; |
| | | |
| | | |
| | | applyChange.setCreateDate(new Date()); |
| | | applyChange.setCreator(loginUserInfo.getId()); |
| | | applyChange.setEditor(loginUserInfo.getId()); |
| | |
| | | && DateUtil.compareDate( applyChange.getValidTime(),insuranceApply.getEndTime()) >= Constants.ZERO)) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "申请日期未处于保单日期内,无法进行该操作"); |
| | | } |
| | | |
| | | //查询保单下是否存在进行中的加减保/换厂单据 |
| | | if(applyChangeMapper.selectCount(new QueryWrapper<ApplyChange>().lambda() |
| | | .eq(ApplyChange::getApplyId,insuranceApply.getId()) |
| | | .ne(ApplyChange::getId,applyChange.getId()) |
| | | .notIn(ApplyChange::getStatus,Constants.ApplyChangeStatus.APPROVE.getKey(),Constants.ApplyChangeStatus.CLOSE.getKey()) |
| | | )>Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(), "存在进行中的加减保/换厂申请"); |
| | | }; |
| | | applyChange.setEditDate(new Date()); |
| | | applyChange.setEditor(loginUserInfo.getId()); |
| | | applyChange.setApplyStartTime(applyChange.getValidTime()); |
| | |
| | | BigDecimal fee = this.dealApplyChangeData(applyChange,insuranceApply,companySolution,solutions,loginUserInfo,BigDecimal.ZERO); |
| | | applyChange.setFee(fee); |
| | | applyChangeMapper.updateById(applyChange); |
| | | |
| | | |
| | | Constants.ApplyLogType applyLogType = Constants.ApplyLogType.CA_UPLOAD_AGAIN; |
| | | String info =applyLogType.getInfo(); |
| | |
| | | new MPJLambdaWrapper<ApplyChagneDetail>() |
| | | .leftJoin(ApplyChange.class, ApplyChange::getId, ApplyChagneDetail::getApplyChangeId) |
| | | .eq(ApplyChagneDetail::getMemberId, applyChagneDetail.getMemberId()) |
| | | .eq(ApplyChange::getApplyId, applyChange.getApplyId()) |
| | | .in(ApplyChange::getStatus, Constants.ZERO, Constants.ONE) |
| | | ) > Constants.ZERO) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "换厂人员【" + applyChagneDetail.getMemberName() + "】存在申请中的加减保/换厂单据"); |
| | |
| | | .collect(Collectors.toList()).size() <= Constants.ZERO) { |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(), "换厂人员【" + applyChagneDetail.getMemberName() + "】员工工种信息未查询到!"); |
| | | } |
| | | if(applyChagneDetail.getOldDuId().equals(applyChagneDetail.getDuId()) |
| | | && applyChagneDetail.getOldWorktypeId().equals(applyChagneDetail.getWorktypeId())){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(), "换厂人员【" + applyChagneDetail.getMemberName() + "】换厂数据相同!"); |
| | | } |
| | | applyChagneDetail.setCreateDate(new Date()); |
| | | applyChagneDetail.setCreator(loginUserInfo.getId()); |
| | | applyChagneDetail.setIsdeleted(Constants.ZERO); |
| | |
| | | List<CompanySolution> list = new ArrayList<>(); |
| | | int num =0; |
| | | for(CompanySolution s :company.getSolutionList()){ |
| | | if(s.getSolutionBaseId() == null){ |
| | | continue; |
| | | } |
| | | Solutions newVersion = solutionsMapper.selectOne(new QueryWrapper<Solutions>().lambda().eq(Solutions::getBaseId,s.getSolutionBaseId()) |
| | | .eq(Solutions::getDataType,Constants.TWO).last("limit 1")); |
| | | if(Objects.isNull(newVersion)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请添加有效的保险方案信息!"); |
| | | } |
| | | sIds.add(s.getSolutionBaseId()); |
| | | s.setCompanyId(company.getId()); |
| | | s.setIsdeleted(Constants.ZERO); |
| | | s.setCanAdd(Constants.formatIntegerNum(s.getCanAdd())); |
| | | s.setCanReduce(Constants.formatIntegerNum(s.getCanReduce())); |
| | | s.setCreateDate(company.getCreateDate()); |
| | | s.setCreator(company.getCreator()); |
| | | s.setSortnum(num++); |
| | | s.setSolutionBaseId( s.getSolutionBaseId() ); |
| | | s.setSolutionId( newVersion.getId() ); |
| | | s.setStatus(Constants.ZERO); |
| | | list.add(s); |
| | | } |
| | | if(list.size() ==0){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请添加有效的保险方案信息!"); |
| | | } |
| | | List<Solutions> solutionsList = solutionsMapper.selectList(new QueryWrapper<Solutions>().lambda() |
| | | .in(Solutions::getId,sIds) |
| | | .eq(Solutions::getIsdeleted,Constants.ZERO)); |
| | | if(solutionsList.size()!= list.size()){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"请添加有效的保险方案信息哦"); |
| | | } |
| | | for(Solutions s:solutionsList){ |
| | | if(Constants.equalsInteger(s.getStatus(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"保险方案【"+s.getName()+"】已被禁用,不能进行该操作"); |
| | | } |
| | | } |
| | | companySolutionJoinMapper.insertBatchSomeColumn(list); |
| | | } |
| | | |
| | | |
| | | |
| | | /* private void dealSolutionsData(Company company) { |
| | | List<Integer> sIds = new ArrayList<>(); |
| | | List<CompanySolution> list = new ArrayList<>(); |
| | | int num =0; |
| | | for(CompanySolution s :company.getSolutionList()){ |
| | | if(s.getSolution() == null || s.getSolution().getBaseId() == null ||s.getSolution().getId()==null){ |
| | | continue; |
| | | } |
| | |
| | | } |
| | | } |
| | | companySolutionJoinMapper.insertBatchSomeColumn(list); |
| | | } |
| | | |
| | | }*/ |
| | | private void isValidCreateParam(Company company) { |
| | | if(StringUtils.isBlank(company.getPhone()) |
| | | ||StringUtils.isBlank(company.getName()) |
| | |
| | | Constants.InsuranceApplyStatus insuranceApplyStatus = Constants.InsuranceApplyStatus.UPLOAD; |
| | | insuranceApply.setCreateDate(new Date()); |
| | | insuranceApply.setCreator(loginUserInfo.getId()); |
| | | insuranceApply.setEditor(loginUserInfo.getId()); |
| | | insuranceApply.setEditDate(new Date()); |
| | | insuranceApply.setIsdeleted(Constants.ZERO); |
| | | insuranceApply.setCompanyId(loginUserInfo.getCompanyId()); |
| | | insuranceApply.setCheckInfo(insuranceApplyStatus.getName()); |
| | |
| | | applyDetail.setIdcardNo(member.getIdcardNo()); |
| | | applyDetail.setSex(member.getSex()); |
| | | applyDetail.setFee(countCyclePriceVO.getCyclePrice()); |
| | | applyDetail.setCurrentFee(BigDecimal.ZERO); |
| | | //验证派遣单位信息是否存在 |
| | | if(duSolutionList.stream().filter(d->d.getDispatchUnitId().equals(applyDetail.getDuId())).collect(Collectors.toList()).size()<=Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"【"+applyDetail.getMemberName()+"】员工派遣单位未查询到!"); |
| | |
| | | queryWrapper.selectAs(Company::getName,InsuranceApply::getCompanyName); |
| | | queryWrapper.selectAs(Solutions::getName,InsuranceApply::getSolutionsName); |
| | | 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"); |
| | | queryWrapper.select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad where ad.apply_id = t.id ) as insureNum"); |
| | | if(!Objects.isNull(pageWrap.getModel())&&!Objects.isNull(pageWrap.getModel().getType())){ |
| | | 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.ge(InsuranceApply::getEndTime, Utils.Date.getStart(pageWrap.getModel().getEndTimeS())); |
| | | } |
| | | if (pageWrap.getModel().getEndTimeE() != null) { |
| | | queryWrapper.le(InsuranceApply::getEndTime, Utils.Date.getEnd(pageWrap.getModel().getEndTimeE())); |
| | | queryWrapper.lt(InsuranceApply::getEndTime, Utils.Date.getEnd(pageWrap.getModel().getEndTimeE())); |
| | | } |
| | | if (pageWrap.getModel().getStartTimeS() != null) { |
| | | queryWrapper.ge(InsuranceApply::getStartTime, Utils.Date.getStart(pageWrap.getModel().getStartTimeS())); |
| | | } |
| | | if (pageWrap.getModel().getStartTimeE() != null) { |
| | | queryWrapper.le(InsuranceApply::getStartTime, Utils.Date.getEnd(pageWrap.getModel().getStartTimeE())); |
| | | queryWrapper.lt(InsuranceApply::getStartTime, Utils.Date.getEnd(pageWrap.getModel().getStartTimeE())); |
| | | } |
| | | if (pageWrap.getModel().getCreateTimeS() != null) { |
| | | queryWrapper.ge(InsuranceApply::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateTimeS())); |
| | | } |
| | | if (pageWrap.getModel().getCreateTimeE() != null) { |
| | | queryWrapper.le(InsuranceApply::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateTimeE())); |
| | | queryWrapper.lt(InsuranceApply::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateTimeE())); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.eq(Solutions::getType, pageWrap.getModel().getType()); |
| | |
| | | queryWrapper.eq(InsuranceApply::getCode, pageWrap.getModel().getCode()); |
| | | } |
| | | if (pageWrap.getModel().getStatus() != null) { |
| | | queryWrapper.eq(InsuranceApply::getStatus, pageWrap.getModel().getStatus()); |
| | | queryWrapper.in(InsuranceApply::getStatus, pageWrap.getModel().getStatus().split(",")); |
| | | } |
| | | if(CollectionUtils.isNotEmpty(pageWrap.getSorts())){ |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | |
| | | |
| | | public void initApplyStatus(InsuranceApply apply){ |
| | | apply.setStatusCollect(Constants.InsuranceApplyStatus.getCollectStatus(apply.getStatus())); |
| | | if(Constants.equalsInteger(apply.getStatusCollect(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){ |
| | | if(Constants.equalsInteger(apply.getStatus(),Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey())){ |
| | | //如果已完成 |
| | | if(apply.getEndTime()==null || System.currentTimeMillis()>apply.getEndTime().getTime()){ |
| | | apply.setStatusCollect(Constants.THREE);//已过期 |
| | |
| | | queryWrapper.eq(InsuranceApply::getCode, model.getCode()); |
| | | } |
| | | if (model.getStatus() != null) { |
| | | queryWrapper.eq(InsuranceApply::getStatus, model.getStatus()); |
| | | queryWrapper.in(InsuranceApply::getStatus, model.getStatus().split(",")); |
| | | } |
| | | if (CollectionUtils.isNotEmpty(model.getIds())) { |
| | | queryWrapper.in(InsuranceApply::getId, model.getIds()); |
| | |
| | | .selectAll(InsuranceApply.class) |
| | | .selectAs(Solutions::getName,InsuranceApply::getSolutionsName) |
| | | .selectAs(Company::getName,InsuranceApply::getCompanyName) |
| | | .select(" ( select count(1) from apply_detail ad where ad.apply_id = t.id ) as insureNum") |
| | | .select(" ( select max(ac.APPLY_START_TIME) from apply_change ac where ac.apply_id = t.id and ac.status = 2 ) as lastChangeDate") |
| | | .select(" ( select count(DISTINCT(ad.MEMBER_ID)) from apply_detail ad where ad.apply_id = t.id ) as insureNum") |
| | | .leftJoin(Solutions.class,Solutions::getId,InsuranceApply::getSolutionId) |
| | | .leftJoin(Company.class,Company::getId,InsuranceApply::getCompanyId) |
| | | .eq(InsuranceApply::getId,id) |
| | |
| | | .selectAll(ApplyLog.class) |
| | | .selectAs(SystemUser::getRealname,ApplyLog::getCreatorName) |
| | | .selectAs(Company::getName,ApplyLog::getCompanyName) |
| | | .selectAs(SystemUser::getType,ApplyLog::getCreatorType) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,ApplyLog::getCreator) |
| | | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) |
| | | .in(ApplyLog::getObjType,Constants.ApplyLogType.getTypeList(Constants.ZERO)) |
| | |
| | | @Transactional(rollbackFor = {Exception.class,BusinessException.class}) |
| | | public void applyOpt(InsuranceApplyOptDTO insuranceApplyOptDTO){ |
| | | if(Objects.isNull(insuranceApplyOptDTO) |
| | | ||Objects.isNull(insuranceApplyOptDTO.getApplyId()) |
| | | ||StringUtils.isBlank(insuranceApplyOptDTO.getOptIllustration())){ |
| | | ||Objects.isNull(insuranceApplyOptDTO.getApplyId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | |
| | | .apply(!Objects.isNull(memberQueryDTO.getSolutionsStatus())&&memberQueryDTO.getSolutionsStatus().equals(Constants.ONE),"now() between t.start_time and t.end_time") |
| | | .apply(!Objects.isNull(memberQueryDTO.getSolutionsStatus())&&memberQueryDTO.getSolutionsStatus().equals(Constants.TWO),"now() > t.end_time") |
| | | ; |
| | | |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | queryWrapper.orderByAsc(DispatchUnit::getName); |
| | | queryWrapper.orderByAsc(Member::getName); |
| | | // for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | // if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | // queryWrapper.orderByDesc(sortData.getProperty()); |
| | | // } else { |
| | | // queryWrapper.orderByAsc(sortData.getProperty()); |
| | | // } |
| | | // } |
| | | PageData<Member> pageData = PageData.from(memberJoinMapper.selectJoinPage(page,Member.class, queryWrapper)); |
| | | return pageData; |
| | | } |
| | |
| | | .leftJoin(Worktype.class,Worktype::getId,ApplyDetail::getWorktypeId) |
| | | .eq(Member::getIsdeleted, Constants.ZERO) |
| | | .eq(InsuranceApply::getId,memberQueryDTO.getInsuranceApplyId()) |
| | | .le(!Objects.isNull(memberQueryDTO.getValidTime()),ApplyDetail::getStartTime,memberQueryDTO.getValidTime()) |
| | | .ge(!Objects.isNull(memberQueryDTO.getValidTime()),ApplyDetail::getEndTime,memberQueryDTO.getValidTime()) |
| | | .exists(!Objects.isNull(memberQueryDTO.getInsuranceApplyId()), |
| | | " select 1 from apply_detail ad where ad.apply_id = "+memberQueryDTO.getInsuranceApplyId()+" and ad.END_TIME > now() and ad.isdeleted = 0 " + |
| | | " and ad.member_id = t.id "); |
| | |
| | | if (pageWrap.getModel().getInsuranceApplyId() != null) { |
| | | queryWrapper.eq(SettleClaims::getInsuranceApplyId, pageWrap.getModel().getInsuranceApplyId()); |
| | | } |
| | | queryWrapper.orderByAsc(SettleClaims::getCreateDate); |
| | | queryWrapper.orderByDesc(SettleClaims::getCreateDate); |
| | | /*for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.InsuranceMapper; |
| | | import com.doumee.dao.business.SolutionWorktypeMapper; |
| | | import com.doumee.dao.business.SolutionsMapper; |
| | | import com.doumee.dao.business.WorktypeMapper; |
| | | import com.doumee.dao.business.*; |
| | | import com.doumee.dao.business.join.SolutionWorktypeJoinMapper; |
| | | import com.doumee.dao.business.join.SolutionsJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | |
| | | private SolutionWorktypeJoinMapper solutionWorktypeJoinMapper; |
| | | @Autowired |
| | | private InsuranceMapper insuranceMapper; |
| | | @Autowired |
| | | private CompanySolutionMapper companySolutionMapper; |
| | | @Autowired |
| | | private DuSolutionMapper duSolutionMapper; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public Integer create(Solutions solutions) { |
| | | LoginUserInfo user= (LoginUserInfo)SecurityUtils.getSubject().getPrincipal(); |
| | | initCreateParam(solutions);//工种数据有效性检验,去除空白行数据 |
| | |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,该保险公司信息不存在,请尝试刷新页面重试~" ); |
| | | } |
| | | if( !Constants.equalsInteger(model.getStatus(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,该保险公司已被,请尝试刷新页面重试~" ); |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"对不起,该保险公司已被禁用,请尝试刷新页面重试~" ); |
| | | } |
| | | List<Worktype> worktypeList = worktypeMapper.selectList(new QueryWrapper<Worktype>().lambda() |
| | | .eq(Worktype::getInsuranceId,solutions.getInsuranceId()) |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void updateById(Solutions solutions) { |
| | | LoginUserInfo user= (LoginUserInfo)SecurityUtils.getSubject().getPrincipal(); |
| | | Solutions model = findById(solutions.getId()); |
| | |
| | | solutions.setVersion(UUID.randomUUID().toString()); |
| | | solutions.setEditDate(new Date()); |
| | | solutionsMapper.updateById(solutions); |
| | | |
| | | Solutions oldVersion = solutionsMapper.selectOne(new QueryWrapper<Solutions>() |
| | | .lambda() |
| | | .eq(Solutions::getBaseId,solutions.getId()) |
| | | .eq(Solutions::getDataType,Constants.TWO) |
| | | .last("limit 1") |
| | | ); |
| | | |
| | | |
| | | if(Objects.isNull(oldVersion)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到历史版本数据"); |
| | | } |
| | | |
| | | //如果修改,则产生一个新的历史版本 ~ |
| | | Solutions newModel = new Solutions(); |
| | |
| | | .lambda() |
| | | .eq(SolutionWorktype::getSolutionId,solutions.getId()) |
| | | ); |
| | | |
| | | |
| | | solutionsMapper.update(null,new UpdateWrapper<Solutions>() |
| | | .lambda() |
| | | .ne(Solutions::getId,newModel.getId()) |
| | |
| | | ); |
| | | //处理工种信息,新增最新的,同时产生历史版本 |
| | | dealWorkType(solutions,newModel,solutions.getWorktypeIdList(),false); |
| | | |
| | | //更新company_solution 使用新版本的数据 |
| | | companySolutionMapper.update(null, |
| | | new UpdateWrapper<CompanySolution>() |
| | | .lambda() |
| | | .eq(CompanySolution::getStatus,Constants.ZERO) |
| | | .set(CompanySolution::getSolutionId,newModel.getId()) |
| | | .eq(CompanySolution::getSolutionBaseId,solutions.getId()) |
| | | ); |
| | | //更新 du_solution 使用新版本的数据 |
| | | duSolutionMapper.update(null, |
| | | new UpdateWrapper<DuSolution>() |
| | | .lambda() |
| | | .eq(DuSolution::getIsdeleted, Constants.ZERO) |
| | | .eq(DuSolution::getStatus, Constants.ONE) |
| | | .set(DuSolution::getSolutionId,newModel.getId()) |
| | | .eq(DuSolution::getSolutionId,oldVersion.getId())); |
| | | } |
| | | |
| | | @Override |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<Solutions> findListForCompany() { |
| | | public List<Solutions> findListForCompany(Integer dataType) { |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | List<Solutions> solutionsList = solutionsJoinMapper.selectJoinList(Solutions.class,new MPJLambdaWrapper<Solutions>() |
| | | .selectAll(Solutions.class) |
| | | .leftJoin(CompanySolution.class,CompanySolution::getSolutionBaseId,Solutions::getId) |
| | | .leftJoin(CompanySolution.class,CompanySolution::getSolutionId,Solutions::getId) |
| | | .eq(Solutions::getIsdeleted,Constants.ZERO) |
| | | .eq(Solutions::getDataType,Constants.TWO) |
| | | .eq(Solutions::getStatus,Constants.ZERO) |
| | | .eq(Solutions::getDataType,dataType) |
| | | .eq(CompanySolution::getIsdeleted,Constants.ZERO) |
| | | .eq(CompanySolution::getCompanyId,user.getCompanyId()) |
| | | .orderByAsc(Solutions::getSortnum) |
| | |
| | | return solutionsList; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 根据历史版本查询当前最新启用版本 |
| | | * @param solutionId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Solutions getNewVersion(Integer solutionId){ |
| | | Solutions solutions = solutionsMapper.selectById(solutionId); |
| | | if(Objects.isNull(solutions)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到历史方案信息"); |
| | | } |
| | | if(solutions.getDataType().equals(Constants.TWO)){ |
| | | return solutions; |
| | | } |
| | | Solutions newVersion = solutionsMapper.selectOne(new QueryWrapper<Solutions>().lambda() |
| | | .eq(Solutions::getIsdeleted,Constants.ZERO) |
| | | .eq(Solutions::getDataType,Constants.TWO) |
| | | .eq(Solutions::getBaseId,solutions.getBaseId()) |
| | | .last("limit 1") |
| | | ); |
| | | if(Objects.isNull(newVersion)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(),"未查询到最新版本数据"); |
| | | } |
| | | return newVersion; |
| | | } |
| | | |
| | | |
| | | @Override |