guoshilong
2024-03-18 3848ff83401d249c1caa5cb57658665b29afed95
校核接口修改
8 files modified
61 ■■■■ changed files
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/controller/TbDykeInvestigationController.java 17 ●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/controller/TbResGeneralInvestigationController.java 15 ●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/entity/TbDykeInvestigationState.java 6 ●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/entity/TbResGeneralInvestigationState.java 6 ●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/mapper/AttResBaseMapper.xml 7 ●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/mapper/TbResDykeMapper.xml 6 ●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/vo/AttResBaseGeneralInvestigationVO.java 2 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/vo/TbResDykeVO.java 2 ●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/controller/TbDykeInvestigationController.java
@@ -1,8 +1,10 @@
package cn.gistack.sm.sjztmd.controller;
import cn.gistack.sm.sjztmd.entity.TbDykeInvestigation;
import cn.gistack.sm.sjztmd.entity.TbDykeInvestigationState;
import cn.gistack.sm.sjztmd.service.IAttResBaseService;
import cn.gistack.sm.sjztmd.service.ITbDykeInvestigationService;
import cn.gistack.sm.sjztmd.service.ITbDykeInvestigationStateService;
import cn.gistack.sm.sjztmd.vo.AttResBaseGeneralInvestigationVO;
import cn.gistack.sm.sjztmd.vo.TbDykeInvestigationParam;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -38,6 +40,7 @@
public class TbDykeInvestigationController {
    private ITbDykeInvestigationService tbDykeInvestigationService;
    private ITbDykeInvestigationStateService tbDykeInvestigationStateService;
    private IAttResBaseService attResBaseService;
    @ApiOperation(value = "中台水库-分页列表查询", notes = "中台水库-分页列表查询")
@@ -70,19 +73,27 @@
    @PostMapping("/checkInfoByDykeGuid")
    public R checkInfoByResGuid(@RequestBody TbDykeInvestigation tbDykeInvestigation) {
        if (tbDykeInvestigation.getDykeGuid() == null || tbDykeInvestigation.getCheckState() == null) {
        if (tbDykeInvestigation.getTbStateId() == null || tbDykeInvestigation.getCheckState() == null) {
            return R.fail(-1,"参数不对");
        }
        //查询根据状态id查询普查记录表
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("\"dyke_guid\"", tbDykeInvestigation.getDykeGuid());
        queryWrapper.eq("\"tb_state_id\"", tbDykeInvestigation.getTbStateId());
        List<TbDykeInvestigation> list = tbDykeInvestigationService.list(queryWrapper);
        List<TbDykeInvestigation> editList = list.stream().map(categoryEntity -> {
                categoryEntity.setCheckState(tbDykeInvestigation.getCheckState());  // 给每个categoryEntity对象的EvaluateTaskId属性设置新值
                return categoryEntity;  // 返回修改后的对象
            })
            .collect(Collectors.toList());
        return R.status(tbDykeInvestigationService.updateBatchById(editList));
        TbDykeInvestigationState tbDykeInvestigationState = new TbDykeInvestigationState();
        tbDykeInvestigationState.setGuid(tbDykeInvestigation.getTbStateId());
        tbDykeInvestigationState.setCheckState(tbDykeInvestigation.getCheckState());
        //更新普查记录表状态和状态表状态
        return R.status(tbDykeInvestigationService.updateBatchById(editList) && tbDykeInvestigationStateService.updateById(tbDykeInvestigationState) );
    }
    @ApiOperation(value = "白蚁普查-添加或者修改", notes = "白蚁普查-添加或者修改")
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/controller/TbResGeneralInvestigationController.java
@@ -2,8 +2,10 @@
import cn.gistack.sm.sjztmd.entity.AttResBase;
import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigation;
import cn.gistack.sm.sjztmd.entity.TbResGeneralInvestigationState;
import cn.gistack.sm.sjztmd.service.IAttResBaseService;
import cn.gistack.sm.sjztmd.service.ITbResGeneralInvestigationService;
import cn.gistack.sm.sjztmd.service.ITbResGeneralInvestigationStateService;
import cn.gistack.sm.sjztmd.vo.AttResBaseGeneralInvestigationVO;
import cn.gistack.sm.sjztmd.vo.TbResGeneralInvestigationParam;
import cn.gistack.sm.sjztmd.wrapper.AttResBaseWrapper;
@@ -41,6 +43,7 @@
public class TbResGeneralInvestigationController {
    private ITbResGeneralInvestigationService tbResGeneralInvestigationService;
    private ITbResGeneralInvestigationStateService tbResGeneralInvestigationStateService;
    private IAttResBaseService attResBaseService;
    @ApiOperation(value = "中台水库-分页列表查询", notes = "中台水库-分页列表查询")
@@ -73,19 +76,25 @@
    @PostMapping("/checkInfoByResGuid")
    public R checkInfoByResGuid(@RequestBody TbResGeneralInvestigation tbResGeneralInvestigation) {
        if (tbResGeneralInvestigation.getResGuid() == null || tbResGeneralInvestigation.getCheckState() == null) {
        if (tbResGeneralInvestigation.getTbStateId() == null || tbResGeneralInvestigation.getCheckState() == null) {
            return R.fail(-1,"参数不对");
        }
        //查询根据状态id查询普查记录表
        QueryWrapper queryWrapper = new QueryWrapper();
        queryWrapper.eq("\"res_guid\"", tbResGeneralInvestigation.getResGuid());
        queryWrapper.eq("\"tb_state_id\"", tbResGeneralInvestigation.getTbStateId());
        List<TbResGeneralInvestigation> list = tbResGeneralInvestigationService.list(queryWrapper);
        List<TbResGeneralInvestigation> editList = list.stream().map(categoryEntity -> {
                categoryEntity.setCheckState(tbResGeneralInvestigation.getCheckState());  // 给每个categoryEntity对象的EvaluateTaskId属性设置新值
                return categoryEntity;  // 返回修改后的对象
            })
            .collect(Collectors.toList());
        return R.status(tbResGeneralInvestigationService.updateBatchById(editList));
        TbResGeneralInvestigationState tbResGeneralInvestigationState = new TbResGeneralInvestigationState();
        tbResGeneralInvestigationState.setGuid(tbResGeneralInvestigation.getTbStateId());
        tbResGeneralInvestigationState.setCheckState(tbResGeneralInvestigation.getCheckState());
        //更新普查记录表状态和状态表状态
        return R.status(tbResGeneralInvestigationService.updateBatchById(editList) && tbResGeneralInvestigationStateService.updateById(tbResGeneralInvestigationState));
    }
    @ApiOperation(value = "白蚁普查-添加或者修改", notes = "白蚁普查-添加或者修改")
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/entity/TbDykeInvestigationState.java
@@ -44,14 +44,14 @@
     * 填报季度
     */
    @ApiModelProperty(value = "填报季度")
    @TableField(value = "\"tb_quarter\"", fill = FieldFill.UPDATE)
    @TableField(value = "\"tb_quarter\"")
    private String tbQuarter;
    /**
     * 水库编码
     */
    @ApiModelProperty(value = "水库编码")
    @TableField(value = "\"dyke_guid\"", fill = FieldFill.UPDATE)
    @TableField(value = "\"dyke_guid\"")
    private String dykeGuid;
@@ -76,7 +76,7 @@
     * 纬度
     */
    @ApiModelProperty(value = "纬度")
    @TableField(value = "\"create_user\"", fill = FieldFill.UPDATE)
    @TableField(value = "\"create_user\"")
    private String createUser;
}
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/entity/TbResGeneralInvestigationState.java
@@ -45,14 +45,14 @@
     * 填报季度
     */
    @ApiModelProperty(value = "填报季度")
    @TableField(value = "\"tb_quarter\"", fill = FieldFill.UPDATE)
    @TableField(value = "\"tb_quarter\"")
    private String tbQuarter;
    /**
     * 水库编码
     */
    @ApiModelProperty(value = "水库编码")
    @TableField(value = "\"res_guid\"", fill = FieldFill.UPDATE)
    @TableField(value = "\"res_guid\"")
    private String resGuid;
@@ -77,7 +77,7 @@
     * 纬度
     */
    @ApiModelProperty(value = "纬度")
    @TableField(value = "\"create_user\"", fill = FieldFill.UPDATE)
    @TableField(value = "\"create_user\"")
    private String createUser;
}
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/mapper/AttResBaseMapper.xml
@@ -14,7 +14,9 @@
    <select id="selectAttResBaseGeneralInvestigation"
            resultType="cn.gistack.sm.sjztmd.vo.AttResBaseGeneralInvestigationVO">
        select
            a.*,b."check_state" AS tb_state,
            a.*,
            b."check_state" AS tb_state,
            b."guid" as tbStateId,
            b."tb_year",
            b."tb_quarter",
            tmp.totalLength,
@@ -46,8 +48,9 @@
            SUM(CASE WHEN (trgi."investigation_variety" = '白蚁' and trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS termiteNum,
            SUM(CASE WHEN (trgi."investigation_variety" != '白蚁' and trgi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS otherNum
            from sjzt_md."tb_res_general_investigation" trgi
            where 1=1
            <if test="attResBase.tbYear !=null and attResBase.tbYear !=''">
                AND trgi."tb_year" = #{attResBase.tbYear}
                AND TRGI."tb_year" = #{attResBase.tbYear}
            </if>
            group by TRGI."tb_state_id",TRGI."res_guid"
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/mapper/TbResDykeMapper.xml
@@ -65,6 +65,7 @@
        DISTINCT
        a.*,
        b."check_state" AS tb_state,
        b."guid" as tbStateId,
        aa."p_ad_code" as pAdCode,
        aa."p_ad_name" as pAdName,
@@ -98,17 +99,16 @@
        SUM(CASE WHEN (tdi."investigation_variety" = '白蚁' and tdi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS termiteNum,
        SUM(CASE WHEN (tdi."investigation_variety" != '白蚁' and tdi."hazard_rating" != '无危害') THEN 1 ELSE 0 END) AS otherNum
        from sjzt_md."tb_dyke_investigation" tdi
        where 1=1
        <if test="vo.tbYear !=null and vo.tbYear !=''">
            AND tdi."tb_year" = #{vo.tbYear}
        </if>
        group by tdi."tb_state_id",tdi."dyke_guid"
        ) tmp on tmp."tb_state_id" = b."guid"
        where 1 = 1
        <if test="vo.tbYear !=null and vo.tbYear !=''">
            AND tdi."tb_year" = #{vo.tbYear}
            AND b."tb_year" = #{vo.tbYear}
        </if>
        <if test="vo.name !=null and vo.name !=''">
            AND a."name" LIKE CONCAT('%',#{vo.name},'%')
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/vo/AttResBaseGeneralInvestigationVO.java
@@ -44,4 +44,6 @@
    private Boolean isPage;
    private String tbStateId;
}
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/sjztmd/vo/TbResDykeVO.java
@@ -37,5 +37,5 @@
    //其他危害处数
    private int otherNum;
    private String tbStateId;
}