zhanghua
2023-11-29 704e7207d74b6477c5f472c5aba92d484ab17f98
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;
@@ -41,6 +44,7 @@
 * @since 2022-09-24
 */
@Service
@Slf4j
public class DisposeRecordServiceImpl extends ServiceImpl<DisposeRecordMapper, DisposeRecord> implements IDisposeRecordService {
    @Resource
@@ -68,7 +72,7 @@
    public final static Short LAST_THREEMONTH = 2;
    @Override
    public Page<MyBacklogVO> listMyTask(Page<MyBacklogVO> page, String num, Long userId, Short type, Short source, Short time) {
    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)) {
@@ -81,13 +85,32 @@
            alarmTimeStart = LocalDateTime.now().minusMonths(3);
            alarmTimeEnd = LocalDateTime.now();
        }
        //TODO:出现过一次重复数据
        return disposeRecordMapper.selectMyBackList(page, userId, num, alarmTimeStart, alarmTimeEnd, source, type);
        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()) {