| | |
| | | @ApiImplicitParam(name = "file", value = "file", required = true, paramType = "query", dataType = "file", dataTypeClass = File.class), |
| | | }) |
| | | @RequiresPermissions("business:worktype:create") |
| | | public ApiResponse<List<MemberImport>> importExcel (@ApiParam(value = "file") MultipartFile file) { |
| | | return ApiResponse.success(memberService.importBatch(file)); |
| | | public ApiResponse<List<MemberImport>> importExcel (@ApiParam(value = "file") MultipartFile file,Integer solutionId) { |
| | | return ApiResponse.success(memberService.importBatch(file,solutionId)); |
| | | } |
| | | |
| | | } |
| | |
| | | return ApiResponse.success(smsEmailService.sendSms(smsEmail)); |
| | | } |
| | | |
| | | @ApiOperation("短信验证 - 企业验签") |
| | | @GetMapping("/validateCode") |
| | | // @RequiresPermissions("business:smsemail:sendSms") |
| | | public ApiResponse validateCode(@RequestParam String code) { |
| | | smsEmailService.validateCode(code); |
| | | return ApiResponse.success("操作成功"); |
| | | } |
| | | |
| | | @ApiOperation("根据ID删除") |
| | | @GetMapping("/delete/{id}") |
| | |
| | | * @date 2021-10-10 14:40:35 |
| | | * https://www.bejson.com/othertools/cron/ cron 表达式生成地址 |
| | | */ |
| | | //@Component |
| | | //@EnableScheduling |
| | | @Component |
| | | @EnableScheduling |
| | | @Slf4j |
| | | public class ScheduleTool { |
| | | @Autowired |
| | |
| | | COMPANY_BACK_APPLY_SIGNATURE(8, "企业申请退回(已签章)","提交意见:${param}",5), |
| | | CLOSE(9, "订单关闭","",6), |
| | | PLATFORM_CHECK_PASS(10,"平台投保审核通过","提交意见:${param}",0), |
| | | COMPANY_BACK_APPLY_PASS(11, "企业申请退回(平台投保审核通过)","提交意见:${param}",5), |
| | | ; |
| | | // 成员变量 |
| | | private String name; |
| | |
| | | @ExcelColumn(name="身份证号",value = "idCard") |
| | | private String idCard; |
| | | |
| | | @ExcelColumn(name="派遣单位" , value = "duName") |
| | | private String duName; |
| | | |
| | | @ExcelColumn(name="工种" , value = "workTypeName") |
| | | private String workTypeName; |
| | | |
| | | |
| | | @ExcelColumn(name="年龄",value = "age") |
| | | private Integer age; |
| | | |
| | | // @ApiModelProperty(value = "派遣单位主键") |
| | | // private Integer duId; |
| | | |
| | | @ApiModelProperty(value = "性别") |
| | | private Integer sex; |
| | | |
| | | // @ApiModelProperty(value = "所属工种主键") |
| | | // private Integer workTypeId; |
| | | // |
| | | // @ApiModelProperty(value = "派遣单位名称") |
| | | // private String duName; |
| | | // |
| | | // @ApiModelProperty(value = "所属工种名称") |
| | | // private String workTypeName; |
| | | @ApiModelProperty(value = "派遣单位主键") |
| | | private Integer duId; |
| | | |
| | | @ApiModelProperty(value = "所属工种主键") |
| | | private Integer worktypeId; |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String companyName; |
| | | |
| | | |
| | | @ApiModelProperty(value = "派遣单位下的工种信息") |
| | | @TableField(exist = false) |
| | | private List<Worktype> worktypeList; |
| | | } |
| | |
| | | |
| | | List<Member> findListByDTO(MemberQueryDTO memberQueryDTO); |
| | | |
| | | List<MemberImport> importBatch(MultipartFile file); |
| | | List<MemberImport> importBatch(MultipartFile file,Integer solutionId); |
| | | |
| | | } |
| | |
| | | Integer create(SmsEmail smsEmail); |
| | | Integer sendSms(SmsEmail smsEmail); |
| | | Integer sendEmail(SmsEmail smsEmail); |
| | | void validateCode(String code); |
| | | /** |
| | | * 主键删除 |
| | | * |
| | |
| | | queryWrapper.eq(!Objects.isNull(applyDetailPageDTO.getDuId()),ApplyDetail::getDuId,applyDetailPageDTO.getDuId()); |
| | | queryWrapper.eq(!Objects.isNull(applyDetailPageDTO.getWorkTypeId()),ApplyDetail::getWorktypeId,applyDetailPageDTO.getWorkTypeId()); |
| | | queryWrapper.like(StringUtils.isNotBlank(applyDetailPageDTO.getMemberName()),Member::getName,applyDetailPageDTO.getMemberName()); |
| | | queryWrapper.ge(StringUtils.isNotBlank(applyDetailPageDTO.getStartTimeS()),ApplyDetail::getStartTime,applyDetailPageDTO.getStartTimeS()+" 00:00:00"); |
| | | queryWrapper.le(StringUtils.isNotBlank(applyDetailPageDTO.getStartTimeE()),ApplyDetail::getStartTime,applyDetailPageDTO.getStartTimeE()+" 23:59:59"); |
| | | queryWrapper.ge(StringUtils.isNotBlank(applyDetailPageDTO.getEndTimeS()),ApplyDetail::getEndTime,applyDetailPageDTO.getEndTimeS()+" 00:00:00"); |
| | | queryWrapper.le(StringUtils.isNotBlank(applyDetailPageDTO.getEndTimeE()),ApplyDetail::getEndTime,applyDetailPageDTO.getEndTimeE()+" 23:59:59"); |
| | | queryWrapper.ge(StringUtils.isNotBlank(applyDetailPageDTO.getStartTimeS()),ApplyDetail::getStartTime,applyDetailPageDTO.getStartTimeS()+" 00:00:00.0"); |
| | | queryWrapper.le(StringUtils.isNotBlank(applyDetailPageDTO.getStartTimeE()),ApplyDetail::getStartTime,applyDetailPageDTO.getStartTimeE()+" 23:59:59.0"); |
| | | queryWrapper.ge(StringUtils.isNotBlank(applyDetailPageDTO.getEndTimeS()),ApplyDetail::getEndTime,applyDetailPageDTO.getEndTimeS()+" 00:00:00.0"); |
| | | queryWrapper.le(StringUtils.isNotBlank(applyDetailPageDTO.getEndTimeE()),ApplyDetail::getEndTime,applyDetailPageDTO.getEndTimeE()+" 23:59:59.0"); |
| | | |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | |
| | | queryWrapper.eq(!Objects.isNull(applyDetailPageDTO.getWorkTypeId()),ApplyDetail::getWorktypeId,applyDetailPageDTO.getWorkTypeId()); |
| | | queryWrapper.like(StringUtils.isNotBlank(applyDetailPageDTO.getMemberName()),Member::getName,applyDetailPageDTO.getMemberName()); |
| | | queryWrapper.eq(!Objects.isNull(applyDetailPageDTO.getMemberId()),Member::getId,applyDetailPageDTO.getMemberId()); |
| | | queryWrapper.ge(StringUtils.isNotBlank(applyDetailPageDTO.getStartTimeS()),ApplyDetail::getStartTime,applyDetailPageDTO.getStartTimeS()+" 00:00:00"); |
| | | queryWrapper.le(StringUtils.isNotBlank(applyDetailPageDTO.getStartTimeE()),ApplyDetail::getStartTime,applyDetailPageDTO.getStartTimeE()+" 23:59:59"); |
| | | queryWrapper.ge(StringUtils.isNotBlank(applyDetailPageDTO.getEndTimeS()),ApplyDetail::getEndTime,applyDetailPageDTO.getEndTimeS()+" 00:00:00"); |
| | | queryWrapper.le(StringUtils.isNotBlank(applyDetailPageDTO.getEndTimeE()),ApplyDetail::getEndTime,applyDetailPageDTO.getEndTimeE()+" 23:59:59"); |
| | | queryWrapper.ge(StringUtils.isNotBlank(applyDetailPageDTO.getStartTimeS()),ApplyDetail::getStartTime,applyDetailPageDTO.getStartTimeS()+" 00:00:00.0"); |
| | | queryWrapper.le(StringUtils.isNotBlank(applyDetailPageDTO.getStartTimeE()),ApplyDetail::getStartTime,applyDetailPageDTO.getStartTimeE()+" 23:59:59.0"); |
| | | queryWrapper.ge(StringUtils.isNotBlank(applyDetailPageDTO.getEndTimeS()),ApplyDetail::getEndTime,applyDetailPageDTO.getEndTimeS()+" 00:00:00.0"); |
| | | queryWrapper.le(StringUtils.isNotBlank(applyDetailPageDTO.getEndTimeE()),ApplyDetail::getEndTime,applyDetailPageDTO.getEndTimeE()+" 23:59:59.0"); |
| | | return applyDetailJoinMapper.selectJoinList(ApplyDetail.class,queryWrapper); |
| | | } |
| | | |
| | |
| | | public Integer create(SaveDispatchUnitDTO saveDispatchUnitDTO) { |
| | | if(Objects.isNull(saveDispatchUnitDTO) |
| | | || StringUtils.isEmpty(saveDispatchUnitDTO.getName()) |
| | | || StringUtils.isEmpty(saveDispatchUnitDTO.getCode()) |
| | | || StringUtils.isEmpty(saveDispatchUnitDTO.getContent()) |
| | | || CollectionUtils.isEmpty(saveDispatchUnitDTO.getSaveDuSolutionDTOList()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | |
| | | )> Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【派遣单位名称】已存在"); |
| | | }; |
| | | if(dispatchUnitMapper.selectCount(new QueryWrapper<DispatchUnit>().lambda() |
| | | .eq(DispatchUnit::getCompanyId,loginUserInfo.getCompanyId()) |
| | | .eq(DispatchUnit::getCode,saveDispatchUnitDTO.getCode()) |
| | | .eq(DispatchUnit::getIsdeleted,Constants.ZERO) |
| | | )> Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【派遣单位信用代码】已存在"); |
| | | }; |
| | | // if(dispatchUnitMapper.selectCount(new QueryWrapper<DispatchUnit>().lambda() |
| | | // .eq(DispatchUnit::getCompanyId,loginUserInfo.getCompanyId()) |
| | | // .eq(DispatchUnit::getCode,saveDispatchUnitDTO.getCode()) |
| | | // .eq(DispatchUnit::getIsdeleted,Constants.ZERO) |
| | | // )> Constants.ZERO){ |
| | | // throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【派遣单位信用代码】已存在"); |
| | | // }; |
| | | DispatchUnit dispatchUnit = new DispatchUnit(); |
| | | dispatchUnit.setCreateDate(new Date()); |
| | | dispatchUnit.setCreator(loginUserInfo.getId()); |
| | |
| | | )> Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【派遣单位名称】已存在"); |
| | | }; |
| | | if(dispatchUnitMapper.selectCount(new QueryWrapper<DispatchUnit>().lambda() |
| | | .ne(DispatchUnit::getId,saveDispatchUnitDTO.getId()) |
| | | .eq(DispatchUnit::getCompanyId,loginUserInfo.getCompanyId()) |
| | | .eq(DispatchUnit::getCode,saveDispatchUnitDTO.getCode()) |
| | | .eq(DispatchUnit::getIsdeleted,Constants.ZERO) |
| | | )> Constants.ZERO){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"【派遣单位信用代码】已存在"); |
| | | } |
| | | dispatchUnit.setCode(saveDispatchUnitDTO.getCode()); |
| | | dispatchUnit.setContent(saveDispatchUnitDTO.getContent()); |
| | | dispatchUnit.setName(saveDispatchUnitDTO.getName()); |
| | |
| | | |
| | | //存储操作记录 |
| | | this.saveDuLog(dispatchUnit,Constants.DispatchUnitLogType.EDIT_UNIT,null); |
| | | |
| | | // this.dealDuData(saveDispatchUnitDTO,loginUserInfo); |
| | | |
| | | |
| | | //存储待办信息 |
| | | Constants.NoticeObjectType noticeObjectType = Constants.NoticeObjectType.DISPATCH_UNIT; |
| | |
| | | .eq(DispatchUnit::getStatus,Constants.ZERO) |
| | | .select("(select b.id from du_solution b where b.isdeleted=0 and b.dispatch_unit_id=t.id and b.solution_id="+dispatchUnitQueryDTO.getSolutionId()+" limit 1) as du_solution_id" ) |
| | | .eq(loginUserInfo.getType().equals(Constants.ONE),DispatchUnit::getCompanyId,loginUserInfo.getCompanyId()) |
| | | .eq(DispatchUnit::getStatus,Constants.ZERO) |
| | | .eq(Objects.isNull(dispatchUnitQueryDTO.getDataType()),DispatchUnit::getDataType,Constants.TWO) |
| | | .eq(!Objects.isNull(dispatchUnitQueryDTO.getDataType()),DispatchUnit::getDataType,dispatchUnitQueryDTO.getDataType()) |
| | | .exists(!Objects.isNull(dispatchUnitQueryDTO.getSolutionId()), |
| | | "select b.id from du_solution b where b.isdeleted=0 and b.dispatch_unit_id=t.id and b.solution_id="+dispatchUnitQueryDTO.getSolutionId() ) |
| | | "select b.id from du_solution b where b.isdeleted=0 and b.dispatch_unit_id=t.id and b.status = 1 and b.solution_id="+dispatchUnitQueryDTO.getSolutionId() ) |
| | | .exists(!Objects.isNull(dispatchUnitQueryDTO.getApplyId()), |
| | | " select 1 from apply_detail ad where ad.isdeleted = 0 and ad.apply_id = "+dispatchUnitQueryDTO.getApplyId()+" " + |
| | | " and ad.du_id = t.id ") |
| | |
| | | //如果是驳回,只能可驳回已签章状态下的退回申请状态进行操作 |
| | | if(!(Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE.getKey())|| |
| | | Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_WAIT_SIGNATURE.getKey())|| |
| | | Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_UPLOAD.getKey())) |
| | | Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_UPLOAD.getKey())|| |
| | | Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_PASS.getKey())) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"对不起,该申请状态已流转,当前不支持该操作~"); |
| | | } |
| | |
| | | update.setStatus(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey()); |
| | | }else if( Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_UPLOAD.getKey())){ |
| | | update.setStatus(Constants.InsuranceApplyStatus.UPLOAD.getKey()); |
| | | }else if( Constants.equalsInteger(model.getStatus(),Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_PASS.getKey())){ |
| | | update.setStatus(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey()); |
| | | } |
| | | }else{ |
| | | //如果是同意,两种申请退回状态都可操作 |
| | |
| | | noticesMapper.delete(new QueryWrapper<Notices>().lambda().eq(Notices::getObjType,noticeObjectType.getKey()) |
| | | .ne(Notices::getType,Constants.NoticeType.SIX.getStatus()) |
| | | .eq(Notices::getObjId,model.getId())); |
| | | Notices notices = new Notices(noticeObjectType,Constants.ONE,model.getId(),solutions.getName(),model.getCompanyId(),noticeType); |
| | | noticesMapper.insert(notices); |
| | | // Notices notices = new Notices(noticeObjectType,Constants.ONE,model.getId(),solutions.getName(),model.getCompanyId(),noticeType); |
| | | // noticesMapper.insert(notices); |
| | | |
| | | String info =applyLogType.getInfo(); |
| | | if(StringUtils.isNotBlank(update.getCheckInfo())){ |
| | |
| | | queryWrapper.in(InsuranceApply::getStatus, pageWrap.getModel().getStatus().split(",")); |
| | | } |
| | | if (pageWrap.getModel().getLoseEfficacy() != null && pageWrap.getModel().getLoseEfficacy() ==1) { |
| | | queryWrapper.apply(" DATEDIFF(t.END_TIME,CURRENT_DATE() ) <= 5 "); |
| | | queryWrapper.apply(" DATEDIFF(t.END_TIME,CURRENT_DATE() ) <= 5 and t.END_TIME >= now() "); |
| | | } |
| | | if(CollectionUtils.isNotEmpty(pageWrap.getSorts())){ |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | |
| | | if(insuranceApplyOptDTO.getOptType().equals(Constants.ONE)){ |
| | | if(!(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.UPLOAD.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.WAIT_SIGNATURE.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey()) |
| | | ||insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.SIGNATURE.getKey()))){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"数据状态非可申请退回!"); |
| | | } |
| | |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_WAIT_SIGNATURE; |
| | | }else if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.SIGNATURE.getKey())){ |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_SIGNATURE; |
| | | }else if(insuranceApply.getStatus().equals(Constants.InsuranceApplyStatus.PLATFORM_CHECK_PASS.getKey())){ |
| | | insuranceApplyStatus = Constants.InsuranceApplyStatus.COMPANY_BACK_APPLY_PASS; |
| | | } |
| | | |
| | | //存储待办信息 |
| | |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.MemberMapper; |
| | | import com.doumee.dao.business.WorktypeMapper; |
| | | import com.doumee.dao.business.dto.MemberImport; |
| | | import com.doumee.dao.business.dto.MemberQueryDTO; |
| | | import com.doumee.dao.business.dto.WorktypeImport; |
| | | import com.doumee.dao.business.join.DispatchUnitJoinMapper; |
| | | import com.doumee.dao.business.join.MemberJoinMapper; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.service.business.MemberService; |
| | |
| | | |
| | | @Autowired |
| | | private MemberJoinMapper memberJoinMapper; |
| | | |
| | | @Autowired |
| | | private DispatchUnitJoinMapper dispatchUnitJoinMapper; |
| | | |
| | | @Autowired |
| | | private WorktypeMapper worktypeMapper; |
| | | |
| | | @Override |
| | | public Integer create(Member member) { |
| | |
| | | |
| | | |
| | | @Override |
| | | public List<MemberImport> importBatch(MultipartFile file){ |
| | | public List<MemberImport> importBatch(MultipartFile file,Integer solutionId){ |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非企业人员无法进行该操作"); |
| | |
| | | if(idCardList.size() != set.size()){ |
| | | throw new BusinessException(ResponseStatus.DATA_ERRO.getCode(),"对不起,录入数据存在身份证号相同数据!"); |
| | | } |
| | | List<DispatchUnit> dispatchUnitList = new ArrayList<>(); |
| | | if(!Objects.isNull(solutionId)){ |
| | | dispatchUnitList = dispatchUnitJoinMapper.selectJoinList(DispatchUnit.class, |
| | | new MPJLambdaWrapper<DispatchUnit>() |
| | | .selectAll(DispatchUnit.class) |
| | | .select("(select b.id from du_solution b where b.isdeleted=0 and b.dispatch_unit_id=t.id and b.solution_id="+solutionId+" limit 1) as du_solution_id" ) |
| | | .eq(DispatchUnit::getIsdeleted,Constants.ZERO) |
| | | .eq(DispatchUnit::getStatus,Constants.ZERO) |
| | | .eq(DispatchUnit::getDataType,Constants.TWO) |
| | | .eq(loginUserInfo.getType().equals(Constants.ONE),DispatchUnit::getCompanyId,loginUserInfo.getCompanyId()) |
| | | .exists("select b.id from du_solution b where b.isdeleted=0 and b.dispatch_unit_id=t.id and b.status = 1 and b.solution_id="+solutionId ) |
| | | ); |
| | | if(CollectionUtils.isNotEmpty(dispatchUnitList)){ |
| | | for (DispatchUnit dispatchUnit:dispatchUnitList) { |
| | | List<Worktype> worktypeList = worktypeMapper.selectList(new QueryWrapper<Worktype>().lambda() |
| | | .eq(Worktype::getIsdeleted,Constants.ZERO) |
| | | .eq(Worktype::getDataType,Constants.TWO) |
| | | .eq(Worktype::getStatus,Constants.ZERO) |
| | | .apply("id in ( select dw.work_type_id from du_worktype dw where dw.status = 1" + |
| | | " and dw.du_solution_id = "+dispatchUnit.getDuSolutionId()+" )") |
| | | ); |
| | | dispatchUnit.setWorktypeList(worktypeList); |
| | | } |
| | | } |
| | | } |
| | | long index = Constants.TWO; |
| | | for(MemberImport model : dataList){ |
| | | if(StringUtils.isBlank(model.getIdCard())||model.getIdCard().length()!=18){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第"+index+"行数据身份证信息异常!"); |
| | | } |
| | | if(StringUtils.isBlank(model.getName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第"+index+"行数据姓名信息异常!"); |
| | | } |
| | | index = index + Constants.ONE; |
| | | if(CollectionUtils.isNotEmpty(list)){ |
| | | Optional<Member> memberOptional= list.stream().filter(m->m.getIdcardNo().equals(model.getIdCard())).findFirst(); |
| | | if(memberOptional.isPresent()){ |
| | |
| | | }else{ |
| | | model.setSex(Constants.getSexByIdCard(model.getIdCard())); |
| | | } |
| | | if(StringUtils.isNotBlank(model.getDuName())&&CollectionUtils.isNotEmpty(dispatchUnitList)){ |
| | | Optional<DispatchUnit> dispatchUnitOptional= dispatchUnitList.stream().filter(m->m.getName().equals(model.getDuName())).findFirst(); |
| | | if(dispatchUnitOptional.isPresent()){ |
| | | DispatchUnit dispatchUnit = dispatchUnitOptional.get(); |
| | | model.setDuId(dispatchUnit.getId()); |
| | | if(StringUtils.isNotBlank(model.getWorkTypeName())&&CollectionUtils.isNotEmpty(dispatchUnit.getWorktypeList())){ |
| | | Optional<Worktype> worktypeOptional= dispatchUnit.getWorktypeList().stream().filter(m->m.getName().equals(model.getWorkTypeName())).findFirst(); |
| | | if(worktypeOptional.isPresent()){ |
| | | Worktype worktype = worktypeOptional.get(); |
| | | model.setWorktypeId(worktype.getId()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(Objects.isNull(model.getDuId())){ |
| | | model.setWorkTypeName(null); |
| | | model.setDuName(null); |
| | | }else if(Objects.isNull(model.getWorktypeId())){ |
| | | model.setWorkTypeName(null); |
| | | } |
| | | } |
| | | return dataList; |
| | | } |
| | |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.SmsEmailMapper; |
| | | import com.doumee.dao.business.model.Company; |
| | | import com.doumee.dao.business.model.SmsEmail; |
| | | import com.doumee.service.business.SmsEmailService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | import com.doumee.service.business.third.EmailService; |
| | | import com.doumee.service.business.third.EmayService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 短信邮件信息表Service实现 |
| | |
| | | if(!Constants.equalsInteger(model.getStatus(),Constants.ZERO)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,验证码已失效,请重新发送再试!"); |
| | | } |
| | | if(model.getCreateDate() !=null && System.currentTimeMillis() - model.getCreateDate().getTime() > 3*60*100){ |
| | | if(model.getCreateDate() !=null && |
| | | System.currentTimeMillis() - model.getCreateDate().getTime() > 3*60*1000){ |
| | | model.setStatus(Constants.ONE); |
| | | model.setEditDate(new Date()); |
| | | smsEmailMapper.updateById(model); |
| | |
| | | )>=3){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,超出发送次数,请稍后重试!"); |
| | | } |
| | | |
| | | String code = Constants.getRandom6Num(); |
| | | boolean result= emayService.sendSingleSms(smsEmail.getPhone(),code); |
| | | |
| | | String content = systemDictDataBiz.queryByCode(Constants.SMS,Constants.SMS_COMNAME).getCode()+"验证码为:"+code+",此验证码有效为3分钟。请勿泄露"; |
| | | |
| | | boolean result= emayService.sendSingleSms(smsEmail.getPhone(),content); |
| | | if(!result){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(),"对不起,短信验证码发送失败,请稍后重试!"); |
| | | } |
| | |
| | | smsEmail.setStatus(Constants.ZERO); |
| | | smsEmail.setType(Constants.ZERO); |
| | | smsEmail.setTitle("短信验证码"); |
| | | smsEmail.setContent(systemDictDataBiz.queryByCode(Constants.SMS,Constants.SMS_COMNAME).getCode()+"验证码为:"+code+",此验证码有效为3分钟。请勿泄露"); |
| | | smsEmail.setContent(content); |
| | | smsEmailMapper.insert(smsEmail); |
| | | |
| | | return smsEmail.getId(); |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void validateCode(String code) { |
| | | if(StringUtils.isBlank(code)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"用户类别错误"); |
| | | }; |
| | | Company company = loginUserInfo.getCompany(); |
| | | SmsEmailServiceImpl.isCaptcheValide(smsEmailMapper,company.getPhone(),code); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | smsEmailMapper.deleteById(id); |