| | |
| | | import com.doumee.dao.business.SettleClaimsLogMapper; |
| | | import com.doumee.dao.business.SettleClaimsMapper; |
| | | import com.doumee.dao.business.dto.SCSupplementDTO; |
| | | import com.doumee.dao.business.dto.SettleClaimsDTO; |
| | | import com.doumee.dao.business.join.MultifileJoinMapper; |
| | | import com.doumee.dao.business.join.SettleClaimsJoinMapper; |
| | | import com.doumee.dao.business.join.SettleClaimsLogJoinMapper; |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.apache.commons.compress.archivers.zip.ZipArchiveEntry; |
| | | import org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | |
| | | QueryWrapper<SettleClaims> wrapper = new QueryWrapper<>(settleClaims); |
| | | return settleClaimsMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | |
| | | public void saveSettleClaims(SettleClaimsDTO settleClaimsDTO){ |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(!loginUserInfo.getType().equals(Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"éä¼ä¸åå·¥æ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | if(Objects.isNull(settleClaimsDTO) |
| | | || Objects.isNull(settleClaimsDTO.getSaveType()) |
| | | || Objects.isNull(settleClaimsDTO.getMemberId()) |
| | | ||StringUtils.isBlank(settleClaimsDTO.getIdcardNo()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(Constants.equalsInteger(settleClaimsDTO.getSaveType(),Constants.ONE)){ |
| | | if(Objects.isNull(settleClaimsDTO.getSolutionId()) |
| | | ||Objects.isNull(settleClaimsDTO.getWorktypeId()) |
| | | ||Objects.isNull(settleClaimsDTO.getDuId()) |
| | | ||StringUtils.isBlank(settleClaimsDTO.getHappenTime()) |
| | | ||StringUtils.isBlank(settleClaimsDTO.getContent()) |
| | | ||Objects.isNull(settleClaimsDTO.getType()) |
| | | ||Objects.isNull(settleClaimsDTO.getInHospital()) |
| | | ||Objects.isNull(settleClaimsDTO.getHurtType()) |
| | | ||Objects.isNull(settleClaimsDTO.getMedicalInsurance()) |
| | | ||StringUtils.isBlank(settleClaimsDTO.getInformantName()) |
| | | ||StringUtils.isBlank(settleClaimsDTO.getInformantPhone()) |
| | | ||StringUtils.isBlank(settleClaimsDTO.getReceiveUserName()) |
| | | ||StringUtils.isBlank(settleClaimsDTO.getReceiveBank()) |
| | | ||StringUtils.isBlank(settleClaimsDTO.getReceiveAccount()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | } |
| | | SettleClaims settleClaims = new SettleClaims(); |
| | | BeanUtils.copyProperties(settleClaimsDTO,settleClaims); |
| | | if(Objects.nonNull(settleClaims.getId())){ |
| | | settleClaims.setEditDate(new Date()); |
| | | settleClaims.setEditor(loginUserInfo.getId()); |
| | | settleClaimsMapper.updateById(settleClaims); |
| | | }else{ |
| | | settleClaims.setCreateDate(new Date()); |
| | | settleClaims.setIsdeleted(Constants.ZERO); |
| | | settleClaims.setCompanyId(loginUserInfo.getCompanyId()); |
| | | settleClaims.setStatus(Constants.equalsInteger(settleClaimsDTO.getSaveType(),Constants.ONE)? |
| | | Constants.SettleClaimsStatus.RETURN_ACCEPTANCE.getKey():Constants.SettleClaimsStatus.WAIT_ACCEPTANCE.getKey()); |
| | | settleClaims.setCreator(loginUserInfo.getId()); |
| | | settleClaims.setCheckUserId(loginUserInfo.getId()); |
| | | settleClaimsMapper.insert(settleClaims); |
| | | } |
| | | this.saveFile(settleClaims,settleClaimsDTO,loginUserInfo); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | public void saveFile(SettleClaims settleClaims,SettleClaimsDTO settleClaimsDTO,LoginUserInfo loginUserInfo){ |
| | | multifileJoinMapper.delete(new QueryWrapper<Multifile>().lambda() |
| | | .eq(Multifile::getObjId,settleClaims.getId()) |
| | | .in(Multifile::getObjType, |
| | | Constants.MultiFile.LP_SGXC_FILE.getKey(), |
| | | Constants.MultiFile.LP_YGGX_FILE.getKey(), |
| | | Constants.MultiFile.LP_MZCL_FILE.getKey(), |
| | | Constants.MultiFile.LP_ZYCL_FILE.getKey(), |
| | | Constants.MultiFile.LP_OTHER_FILE.getKey(), |
| | | Constants.MultiFile.LP_SCZL_FILE.getKey() |
| | | ) |
| | | ); |
| | | List<Multifile> reportVideo = settleClaimsDTO.getReportFileList(); |
| | | if(CollectionUtils.isNotEmpty(reportVideo)){ |
| | | for (int i = 0; i < reportVideo.size(); i++) { |
| | | Multifile multifile = reportVideo.get(i); |
| | | if(Objects.isNull(multifile.getFileurl()) |
| | | || Objects.isNull(multifile.getType()) |
| | | || StringUtils.isBlank(multifile.getName()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"éä»¶å
容å¼å¸¸"); |
| | | } |
| | | multifile.setCreator(loginUserInfo.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setObjId(settleClaims.getId()); |
| | | multifile.setObjType(Constants.MultiFile.LP_SGXC_FILE.getKey()); |
| | | multifile.setSortnum(i+1); |
| | | multifileJoinMapper.insert(multifile); |
| | | } |
| | | } |
| | | |
| | | List<Multifile> relationFileList = settleClaimsDTO.getRelationFileList(); |
| | | if(CollectionUtils.isNotEmpty(relationFileList)){ |
| | | for (int i = 0; i < reportVideo.size(); i++) { |
| | | Multifile multifile = reportVideo.get(i); |
| | | if(Objects.isNull(multifile.getFileurl()) |
| | | || Objects.isNull(multifile.getType()) |
| | | || StringUtils.isBlank(multifile.getName()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"éä»¶å
容å¼å¸¸"); |
| | | } |
| | | multifile.setCreator(loginUserInfo.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setObjId(settleClaims.getId()); |
| | | multifile.setObjType(Constants.MultiFile.LP_YGGX_FILE.getKey()); |
| | | multifile.setSortnum(i+1); |
| | | multifileJoinMapper.insert(multifile); |
| | | } |
| | | } |
| | | |
| | | List<Multifile> outpatientFileList = settleClaimsDTO.getOutpatientFileList(); |
| | | if(CollectionUtils.isNotEmpty(outpatientFileList)){ |
| | | for (int i = 0; i < reportVideo.size(); i++) { |
| | | Multifile multifile = reportVideo.get(i); |
| | | if(Objects.isNull(multifile.getFileurl()) |
| | | || Objects.isNull(multifile.getType()) |
| | | || StringUtils.isBlank(multifile.getName()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"éä»¶å
容å¼å¸¸"); |
| | | } |
| | | multifile.setCreator(loginUserInfo.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setObjId(settleClaims.getId()); |
| | | multifile.setObjType(Constants.MultiFile.LP_MZCL_FILE.getKey()); |
| | | multifile.setSortnum(i+1); |
| | | multifileJoinMapper.insert(multifile); |
| | | } |
| | | } |
| | | |
| | | List<Multifile> hospitalFileList = settleClaimsDTO.getHospitalFileList(); |
| | | if(CollectionUtils.isNotEmpty(hospitalFileList)){ |
| | | for (int i = 0; i < reportVideo.size(); i++) { |
| | | Multifile multifile = reportVideo.get(i); |
| | | if(Objects.isNull(multifile.getFileurl()) |
| | | || Objects.isNull(multifile.getType()) |
| | | || StringUtils.isBlank(multifile.getName()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"éä»¶å
容å¼å¸¸"); |
| | | } |
| | | multifile.setCreator(loginUserInfo.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setObjId(settleClaims.getId()); |
| | | multifile.setObjType(Constants.MultiFile.LP_ZYCL_FILE.getKey()); |
| | | multifile.setSortnum(i+1); |
| | | multifileJoinMapper.insert(multifile); |
| | | } |
| | | } |
| | | |
| | | List<Multifile> disabilityFileList = settleClaimsDTO.getDisabilityFileList(); |
| | | if(CollectionUtils.isNotEmpty(disabilityFileList)){ |
| | | for (int i = 0; i < reportVideo.size(); i++) { |
| | | Multifile multifile = reportVideo.get(i); |
| | | if(Objects.isNull(multifile.getFileurl()) |
| | | || Objects.isNull(multifile.getType()) |
| | | || StringUtils.isBlank(multifile.getName()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"éä»¶å
容å¼å¸¸"); |
| | | } |
| | | multifile.setCreator(loginUserInfo.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setObjId(settleClaims.getId()); |
| | | multifile.setObjType(Constants.MultiFile.LP_SCZL_FILE.getKey()); |
| | | multifile.setSortnum(i+1); |
| | | multifileJoinMapper.insert(multifile); |
| | | } |
| | | } |
| | | |
| | | List<Multifile> otherFileList = settleClaimsDTO.getOtherFileList(); |
| | | if(CollectionUtils.isNotEmpty(otherFileList)){ |
| | | for (int i = 0; i < reportVideo.size(); i++) { |
| | | Multifile multifile = reportVideo.get(i); |
| | | if(Objects.isNull(multifile.getFileurl()) |
| | | || Objects.isNull(multifile.getType()) |
| | | || StringUtils.isBlank(multifile.getName()) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"éä»¶å
容å¼å¸¸"); |
| | | } |
| | | multifile.setCreator(loginUserInfo.getId()); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setObjId(settleClaims.getId()); |
| | | multifile.setObjType(Constants.MultiFile.LP_OTHER_FILE.getKey()); |
| | | multifile.setSortnum(i+1); |
| | | multifileJoinMapper.insert(multifile); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |