From e5bf0d08d05f5c58224fe28cdf743a1bae88e3f0 Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期四, 30 十一月 2023 16:48:55 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java | 101 ++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 77 insertions(+), 24 deletions(-) diff --git a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java index b9c3042..6d44fa3 100644 --- a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java +++ b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java @@ -1,5 +1,7 @@ package com.ycl.service.caseHandler.impl; +import cn.hutool.core.util.PageUtil; +import com.alibaba.druid.sql.PagerUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; @@ -19,6 +21,7 @@ import com.ycl.service.caseHandler.*; import com.ycl.service.resources.IImageResourcesService; import com.ycl.vo.MyBacklogVO; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -30,6 +33,7 @@ import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; import java.util.List; +import java.util.Objects; /** * <p> @@ -40,16 +44,15 @@ * @since 2022-09-24 */ @Service +@Slf4j public class DisposeRecordServiceImpl extends ServiceImpl<DisposeRecordMapper, DisposeRecord> implements IDisposeRecordService { @Resource BaseCaseMapper baseCaseMapper; - @Resource DisposeRecordMapper disposeRecordMapper; @Resource WorkflowConfigStepMapper workflowConfigStepMapper; - @Autowired IInvestigationService iInvestigationService; @Autowired @@ -64,44 +67,89 @@ IDisposeRecordService iDisposeRecordService; @Autowired IImageResourcesService iImageResourcesService; + public final static Short LAST_WEEK = 0; + public final static Short LAST_MONTH = 1; + public final static Short LAST_THREEMONTH = 2; @Override - public Page<MyBacklogVO> listMyTask(Page<MyBacklogVO> page, String num, Long userId) { - return disposeRecordMapper.selectMyBackList(page,userId, num); + public Page<MyBacklogVO> listMyTask(String num, Long userId, Short type, Short source, Short time, Integer current, Integer pageSize) { + LocalDateTime alarmTimeStart = null; + LocalDateTime alarmTimeEnd = null; + if (Objects.equals(time, LAST_WEEK)) { + alarmTimeStart = LocalDateTime.now().minusDays(7); + alarmTimeEnd = LocalDateTime.now(); + } else if (Objects.equals(time, LAST_MONTH)) { + alarmTimeStart = LocalDateTime.now().minusMonths(1); + alarmTimeEnd = LocalDateTime.now(); + } else if (Objects.equals(time, LAST_THREEMONTH)) { + alarmTimeStart = LocalDateTime.now().minusMonths(3); + alarmTimeEnd = LocalDateTime.now(); + } + Integer pageIndex = PageUtil.getStart(current - 1, pageSize); + List<MyBacklogVO> list = disposeRecordMapper.selectMyBackList(userId, num, alarmTimeStart, alarmTimeEnd, source, type, pageIndex, pageSize); + Long total = disposeRecordMapper.selectMyBackListTotal(userId, num, alarmTimeStart, alarmTimeEnd, source, type); + + list.forEach(o -> { + if (o.getPictureList() != null && o.getPictureList().size() > 0) { + o.setPicture(o.getPictureList().get(0).getUrl()); + } + }); + Page<MyBacklogVO> page = new Page<>(); + page.setRecords(list); + page.setTotal(total); + return page; } @Override @Transactional(rollbackFor = Exception.class) public Boolean saveOrUpdateUpload(UploadDisposingResultParam uploadDisposingResultParam) { + log.info("鍙傛暟------------------>{}",uploadDisposingResultParam); + if (uploadDisposingResultParam.getArrivalTime() != null) { + uploadDisposingResultParam.setArrivalTime(uploadDisposingResultParam.getArrivalTime().replace("/", "-")); + } + if (uploadDisposingResultParam.getInvestigationTime() != null) { + uploadDisposingResultParam.setInvestigationTime(uploadDisposingResultParam.getInvestigationTime().replace("/", "-")); + } + AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); List<ArrivalSituation> list = iArrivalSituationService.list(new LambdaQueryWrapper<ArrivalSituation>().eq(ArrivalSituation::getBaseCaseId, uploadDisposingResultParam.getCaseId())); if (!list.isEmpty()) { - //褰撲簨浜� - PartyInfo partyInfo = new PartyInfo(); - BeanUtils.copyProperties(uploadDisposingResultParam, partyInfo); - partyInfo.setId(uploadDisposingResultParam.getPartyInfoId()); - iPartyInfoService.updateById(partyInfo); - //璋冩煡鍙栬瘉 - Investigation investigation = new Investigation(); - BeanUtils.copyProperties(uploadDisposingResultParam, investigation); - investigation.setBaseCaseId(uploadDisposingResultParam.getCaseId()); - investigation.setPartyId(partyInfo.getId()); - investigation.setInvestigationTime(LocalDateTime.parse(uploadDisposingResultParam.getInvestigationTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); - investigation.setId(uploadDisposingResultParam.getInvestigationId()); - iInvestigationService.updateById(investigation); + //TODO:杩濊娌℃湁褰撲簨浜篒D,杩濆缓鎵嶆湁 + if (uploadDisposingResultParam.getPartyInfoId() != null) { + //褰撲簨浜� + PartyInfo partyInfo = new PartyInfo(); + BeanUtils.copyProperties(uploadDisposingResultParam, partyInfo); + //TODO:鍓嶇鍥炴樉鍙湁褰撲簨浜哄鍚嶉渶瑕佸湪璇︽儏杩斿洖 + //TODO:鍚庡彴涓婃姤褰撲簨浜轰俊鎭~涓嶈繘鍘� + partyInfo.setId(uploadDisposingResultParam.getPartyInfoId()); + iPartyInfoService.updateById(partyInfo); + //璋冩煡鍙栬瘉 + Investigation investigation = new Investigation(); + BeanUtils.copyProperties(uploadDisposingResultParam, investigation); + investigation.setBaseCaseId(uploadDisposingResultParam.getCaseId()); + investigation.setPartyId(partyInfo.getId()); + //TODO:鏀逛负闆嗗悎鐨勫瓧绗︿覆褰㈠紡 + investigation.setPic(uploadDisposingResultParam.getPic().toString()); + //TODO:灏忕▼搴忓墠绔〉闈㈡病鏈夎皟鏌ユ椂闂达紝鏆傛椂涓嶅~ + //investigation.setInvestigationTime(LocalDateTime.parse(uploadDisposingResultParam.getInvestigationTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); + investigation.setId(uploadDisposingResultParam.getInvestigationId()); + iInvestigationService.updateById(investigation); + } //鍒拌揪 ArrivalSituation arrivalSituation = new ArrivalSituation(); BeanUtils.copyProperties(uploadDisposingResultParam, arrivalSituation); arrivalSituation.setBaseCaseId(uploadDisposingResultParam.getCaseId()); arrivalSituation.setArrivalTime(LocalDateTime.parse(uploadDisposingResultParam.getArrivalTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); arrivalSituation.setId(uploadDisposingResultParam.getArrivalSituationId()); + //TODO:鏀逛负闆嗗悎鐨勫瓧绗︿覆褰㈠紡 + arrivalSituation.setSituationPic(uploadDisposingResultParam.getSituationPic().toString()); iArrivalSituationService.updateById(arrivalSituation); //鏂囦功 String handType = "02"; ImageResources imageResources = new ImageResources(); imageResources.setType(handType); imageResources.setBelongToId(uploadDisposingResultParam.getCaseId()); - imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic(), uploadDisposingResultParam.getSituationPic())); + imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic().toString(), uploadDisposingResultParam.getSituationPic().toString())); imageResources.setId(uploadDisposingResultParam.getImageResourcesId()); iImageResourcesService.updateById(imageResources); if (uploadDisposingResultParam.getWritCode() != null && uploadDisposingResultParam.getWritType() != null) { @@ -135,9 +183,13 @@ BeanUtils.copyProperties(uploadDisposingResultParam, investigation); investigation.setBaseCaseId(uploadDisposingResultParam.getCaseId()); investigation.setCreateTime(LocalDateTime.now()); + //TODO:鏀逛负闆嗗悎鐨勫瓧绗︿覆褰㈠紡 + investigation.setPic(uploadDisposingResultParam.getPic().toString()); investigation.setCreateUser(user.getUserId()); investigation.setPartyId(partyInfo.getId()); - investigation.setInvestigationTime(LocalDateTime.parse(uploadDisposingResultParam.getInvestigationTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); + + //TODO:鍓嶇椤甸潰娌℃湁璋冩煡鏃堕棿锛屾殏鏃朵笉濉� +// investigation.setInvestigationTime(LocalDateTime.parse(uploadDisposingResultParam.getInvestigationTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); iInvestigationService.save(investigation); //鍒拌揪 ArrivalSituation arrivalSituation = new ArrivalSituation(); @@ -145,6 +197,8 @@ arrivalSituation.setBaseCaseId(uploadDisposingResultParam.getCaseId()); arrivalSituation.setCreateTime(LocalDateTime.now()); arrivalSituation.setCreateUser(user.getUserId()); + //TODO:鏀逛负闆嗗悎鐨勫瓧绗︿覆褰㈠紡 + arrivalSituation.setSituationPic(uploadDisposingResultParam.getSituationPic().toString()); arrivalSituation.setArrivalTime(LocalDateTime.parse(uploadDisposingResultParam.getArrivalTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); iArrivalSituationService.save(arrivalSituation); //鏂囦功 @@ -154,7 +208,7 @@ imageResources.setBelongToId(uploadDisposingResultParam.getCaseId()); imageResources.setCreateTime(LocalDateTime.now()); imageResources.setCreateUser(user.getUserId()); - imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic(), uploadDisposingResultParam.getSituationPic())); + imageResources.setUrl(StringUtils.joinWith(",", uploadDisposingResultParam.getPic().toString(), uploadDisposingResultParam.getSituationPic().toString())); iImageResourcesService.save(imageResources); if (uploadDisposingResultParam.getWritCode() != null && uploadDisposingResultParam.getWritType() != null) { Writ writ = new Writ(); @@ -168,8 +222,8 @@ writ.setSendTime(LocalDateTime.parse(uploadDisposingResultParam.getSendTime(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))); iWritService.save(writ); imageResources.setUrl(StringUtils - .joinWith(",", uploadDisposingResultParam.getPic() - , uploadDisposingResultParam.getSituationPic() + .joinWith(",", uploadDisposingResultParam.getPic().toString() + , uploadDisposingResultParam.getSituationPic().toString() , uploadDisposingResultParam.getOriginalPic() , uploadDisposingResultParam.getOtherPic() , uploadDisposingResultParam.getRectifiedPic() @@ -178,8 +232,6 @@ } baseCaseService.update(new LambdaUpdateWrapper<BaseCase>().eq(BaseCase::getId, uploadDisposingResultParam.getCaseId()).set(BaseCase::getState, BaseCaseStatus.DISPOSE)); - - } String stepName = StepName.CHECK.getName(); DisposeRecord disposeRecord = new DisposeRecord(); @@ -213,6 +265,7 @@ //璁剧疆娴佺▼鐜妭鏁版嵁 disposeRecord.setWorkflowConfigStepId(workflowConfigStep.getId()); disposeRecord.setHandlerRoleId(workflowConfigStep.getRoleId()); + return baseMapper.insert(disposeRecord) == 1 ? true : false; } } -- Gitblit v1.8.0