fuliqi
2023-11-24 d885ffc9f9ed909b0f7cb27da26e8b8fff1f89ea
20:25 我的待办分页查询条件修改,处置表单 修改
10个文件已修改
173 ■■■■ 已修改文件
ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/caseHandler/DisposeRecordController.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/dto/dispatch/UploadDisposingResultParam.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/entity/caseHandler/BaseCase.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/IDisposeRecordService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java 25 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/vo/MyBacklogVO.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java
@@ -34,6 +34,7 @@
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.context.SecurityContextHolder;
@@ -57,6 +58,7 @@
@RestController
@RequestMapping("/base_case")
@Api(tags = "案件池")
@Slf4j
public class BaseCaseController extends BaseController {
    private IBaseCaseService baseCaseService;
ycl-platform/src/main/java/com/ycl/controller/caseHandler/DisposeRecordController.java
@@ -10,12 +10,16 @@
import com.ycl.vo.MyBacklogVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
/**
@@ -44,9 +48,13 @@
    @LogSave(operationType = "我的待办", contain = "查询")
    public CommonResult searchMyTask(@RequestParam(required = false) String num,
                                     @RequestParam Integer pageSize,
                                     @RequestParam Integer current) {
                                     @RequestParam Integer current,
                                     @RequestParam(required = false) Short source,
                                     @RequestParam(required = false) Short type,
                                     @RequestParam(required = false) Short time
                                     ) {
        AdminUserDetails user = (AdminUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        return CommonResult.success(iDisposeRecordService.listMyTask(new Page<>(current,pageSize),num, user.getUserId()));
        return CommonResult.success(iDisposeRecordService.listMyTask(new Page<>(current,pageSize),num, user.getUserId(),type,source,time));
    }
}
ycl-platform/src/main/java/com/ycl/dto/dispatch/UploadDisposingResultParam.java
@@ -5,6 +5,8 @@
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel("UploadDisposingResultParam")
public class UploadDisposingResultParam {
@@ -72,7 +74,7 @@
     * 照片
     */
    @ApiModelProperty(value = "照片")
    private String pic;
    private List<String> pic;
    //现场
@@ -105,7 +107,7 @@
     * 现场情况照片
     */
    @ApiModelProperty(value = "现场情况照片")
    private String situationPic;
    private List<String> situationPic;
    //文书
    /**
ycl-platform/src/main/java/com/ycl/entity/caseHandler/BaseCase.java
@@ -141,7 +141,8 @@
    @TableField("state")
    @ApiModelProperty(value = "处理状态(0误报 1上报 2立案 3派遣 4处置 5核查 6结案)")
    private Integer state;
    @ApiModelProperty(value = "处理状态名")
    private String stateName;
    /**
     * 处理意见
     */
ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java
@@ -6,6 +6,7 @@
import com.ycl.vo.MyBacklogVO;
import org.apache.ibatis.annotations.Param;
import java.time.LocalDateTime;
import java.util.List;
/**
@@ -18,5 +19,5 @@
 */
public interface DisposeRecordMapper extends BaseMapper<DisposeRecord> {
    Page<MyBacklogVO> selectMyBackList(Page<MyBacklogVO> page, @Param("id") Long id, @Param("code") String code);
    Page<MyBacklogVO> selectMyBackList(Page<MyBacklogVO> page, @Param("id") Long id, @Param("code") String code, LocalDateTime alarmTimeStart, LocalDateTime alarmTimeEnd, Short source, Short type);
}
ycl-platform/src/main/java/com/ycl/service/caseHandler/IDisposeRecordService.java
@@ -6,6 +6,7 @@
import com.ycl.entity.caseHandler.DisposeRecord;
import com.ycl.vo.MyBacklogVO;
import java.time.LocalDateTime;
import java.util.List;
/**
@@ -18,7 +19,7 @@
 */
public interface IDisposeRecordService extends IService<DisposeRecord> {
    Page<MyBacklogVO> listMyTask(Page<MyBacklogVO> page, String num, Long userId);
    Page<MyBacklogVO> listMyTask(Page<MyBacklogVO> page, String num, Long userId, Short type, Short source, Short time);
    Boolean saveOrUpdateUpload(UploadDisposingResultParam uploadDisposingResultParam);
}
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
@@ -407,21 +407,40 @@
        LocalDateTime now = LocalDateTime.now();
        if (Objects.nonNull(time) && time == 0) {
            end = now;
            start = now.plusWeeks(1);
            start = now.minusWeeks(1);
        }
        if (Objects.nonNull(time) && time == 1) {
            end = now;
            start = now.plusMonths(1);
            start = now.minusMonths(1);
        }
        if (Objects.nonNull(time) && time == 2) {
            end = now;
            start = now.plusMonths(3);
            start = now.minusMonths(3);
        }
        Page<BaseCase> baseCasePage = baseCaseMapper.selectBaseCasePage(page, number, communityId, categories, start, end, site, state, streetId);
        if (Objects.isNull(baseCasePage) && CollUtil.isNotEmpty(baseCasePage.getRecords())) {
            List<BaseCase> records = baseCasePage.getRecords();
            //TODO:将状态state改为状态名stateName
            records.stream().forEach(baseCase -> {
                Integer stateInt = baseCase.getState();
                if (stateInt == 0) {
                    baseCase.setStateName("误报");
                }else if(stateInt == 1){
                    baseCase.setStateName("上报");
                }else if(stateInt == 2){
                    baseCase.setStateName("立案");
                }else if(stateInt == 3){
                    baseCase.setStateName("派遣");
                }else if(stateInt == 4){
                    baseCase.setStateName("处置");
                }else if(stateInt == 5){
                    baseCase.setStateName("核查");
                }else if(stateInt == 6 ){
                    baseCase.setStateName("结案");
                }
            });
            Set<Long> caseIds = records.stream().map(BaseCase::getId).collect(Collectors.toSet());
            Map<Long, String> urlMap = imageResourcesService.getUrlMap(caseIds, "01");
            records.stream().forEach(item -> {
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java
@@ -30,6 +30,7 @@
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.List;
import java.util.Objects;
/**
 * <p>
@@ -44,12 +45,10 @@
    @Resource
    BaseCaseMapper baseCaseMapper;
    @Resource
    DisposeRecordMapper disposeRecordMapper;
    @Resource
    WorkflowConfigStepMapper workflowConfigStepMapper;
    @Autowired
    IInvestigationService iInvestigationService;
    @Autowired
@@ -64,10 +63,26 @@
    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(Page<MyBacklogVO> page, String num, Long userId, Short type, Short source, Short time) {
        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();
        }
        //TODO:出现过一次重复数据
        return disposeRecordMapper.selectMyBackList(page, userId, num, alarmTimeStart, alarmTimeEnd, source, type);
    }
    @Override
@@ -76,32 +91,40 @@
        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:违规没有当事人ID,违建才有
            if (uploadDisposingResultParam.getPartyInfoId() != null) {
                //当事人
                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());
                //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 +158,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 +172,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 +183,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 +197,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 +207,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();
ycl-platform/src/main/java/com/ycl/vo/MyBacklogVO.java
@@ -26,7 +26,11 @@
     */
    @ApiModelProperty(value = "事件来源(1-视频 2-手动登记)")
    private Integer eventSource;
    /**
     * 来源(社区)
     */
    @ApiModelProperty(value = "来源(社区)")
    private String source;
    /**
     * 问题类别(1-违规 2-违建)
     */
@@ -52,4 +56,10 @@
    @ApiModelProperty(value = "开始时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private LocalDateTime limitTime;
    /**
     * 图片
     */
    @ApiModelProperty(value = "图片")
    private String picture;
}
ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml
@@ -27,43 +27,69 @@
        select distinct * from (
        SELECT
        t3.event_source,
        t5.region_name source,
        t3.category,
        t2.step_name,
        t3.`id` caseId,
        t3.`code`,
        t2.create_time,
        t2.limit_time
        t2.limit_time,
        t4.url picture
        FROM
        ums_admin_role_relation t1
        left JOIN ums_dispose_record t2 ON t1.role_id = t2.handler_role_id
        left JOIN ums_base_case t3 ON t2.base_case_id=t3.id
        left JOIN ums_image_resources t4 ON t2.base_case_id=t4.belong_to_id
        inner join ums_sccg_region t5 on t5.id = t3.community_id
        <where>
            t1.admin_id = #{id} and t3.`code` is not null
            AND t2.state = 0
            <if test="code!='' and code!=null">
                and t3.`code` LIKE CONCAT('%',#{code},'%')
            </if>
            <if test="alarmTimeStart!=null and alarmTimeEnd!=null">
                and t3.alarm_time <![CDATA[ <= ]]> #{alarmTimeEnd} and t3.alarm_time >= #{alarmTimeStart}
            </if>
            <if test="type !=null">
                and t3.category = #{type}
            </if>
            <if test="source !=null">
                and t5.parent_id = #{source}
            </if>
        </where>
        union all
        SELECT
        t3.event_source,
        t5.region_name source,
        t3.category,
        t2.step_name,
        t3.`id` caseId,
        t3.`code`,
        t2.create_time,
        t2.limit_time
        t2.limit_time,
        t4.url picture
        FROM
        ums_dispose_record t2
        LEFT JOIN ums_base_case t3 ON t2.base_case_id = t3.id
        left JOIN ums_image_resources t4 ON t2.base_case_id=t4.belong_to_id
        inner join ums_sccg_region t5 on t5.id = t3.community_id
        <where>
            t2.handler_id = #{id}
            AND t2.state = 0
            <if test="code!='' and code!=null">
                and t3.`code` LIKE CONCAT('%',#{code},'%')
            </if>
            <if test="alarmTimeStart!=null and alarmTimeEnd!=null">
                and t3.alarm_time <![CDATA[ <= ]]> #{alarmTimeEnd} and t3.alarm_time >= #{alarmTimeStart}
            </if>
            <if test="type !=null">
                and t3.category = #{type}
            </if>
            <if test="source !=null">
                and t5.parent_id = #{source}
            </if>
        </where>
        ) as t
         order by create_time
         order by create_time desc
    </select>
</mapper>