| | |
| | | import lombok.extern.java.Log; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.checkerframework.checker.units.qual.C; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | |
| | | Map<String,String> idCardMap = new HashMap<>(); |
| | | for(MemberReduceImport model : dataList){ |
| | | //校验参数是否合法 |
| | | validReduceImportParam(model,idCardMap,dataList,index); |
| | | validReduceImportParam(model,idCardMap,index); |
| | | index += 1; |
| | | } |
| | | index = Constants.TWO; |
| | |
| | | .le(ApplyDetail::getStartTime,DateUtil.getMontageDate(new Date(),1)) |
| | | .ge(ApplyDetail::getEndTime,DateUtil.getMontageDate(new Date(),3))); |
| | | if(detail == null){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "当前保单下,员工【" + model.getName()+model.getIdCard() + "】非在保人员,如法进行该操作"); |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "当前保单下,员工【" + model.getName()+model.getIdCard() + "】非在保人员,无法进行该操作"); |
| | | } |
| | | if(!StringUtils.equals(model.getName(), detail.getMemberName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "当前保单下,员工【" +model.getName()+ model.getIdCard() + "】与其登记在保记录姓名不一致,请核实填写正确再操作"); |
| | | } |
| | | if(!Constants.equalsInteger(Constants.ZERO, detail.getChangeStatus())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "当前保单下,员工【" +model.getName()+ model.getIdCard() + "】已进行过减保申请,不能再次进行该操作"); |
| | | } |
| | | model.setDuId(detail.getDuId()); |
| | | model.setDuName(detail.getDuName()); |
| | |
| | | return dataList; |
| | | } |
| | | |
| | | private void validReduceImportParam(MemberReduceImport model, Map<String, String> idCardMap, List<MemberReduceImport> dataList, int index) { |
| | | private void validReduceImportParam(MemberReduceImport model, Map<String, String> idCardMap, int index) { |
| | | if(StringUtils.isBlank(model.getName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"对不起,第"+index+"行数据姓名不能为空!"); |
| | | } |