guoshilong
2024-04-19 245cf74956c41810de3e59e48a41e458f4f96693
施工上报
7 files added
269 ■■■■■ changed files
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/controller/ConstructionReportController.java 87 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/entity/ConstructionReport.java 35 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/mapper/ConstructionReportMapper.java 15 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/mapper/ConstructionReportMapper.xml 78 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/service/IConstructionReportService.java 10 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/service/impl/ConstructionReportServiceImpl.java 20 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/vo/ConstructionReportVO.java 24 ●●●●● patch | view | raw | blame | history
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/controller/ConstructionReportController.java
New file
@@ -0,0 +1,87 @@
package cn.gistack.sm.constructionReport.controller;
import cn.gistack.sm.constructionReport.entity.ConstructionReport;
import cn.gistack.sm.constructionReport.service.IConstructionReportService;
import cn.gistack.sm.constructionReport.vo.ConstructionReportVO;
import cn.gistack.sm.feedback.entity.Feedback;
import cn.gistack.sm.feedback.service.IFeedbackService;
import cn.gistack.sm.feedback.vo.FeedbackVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;
/**
 * @PROJECT_NAME: skjcmanager
 * @DESCRIPTION: 反馈记录表Controller
 * @USER: guoshilong
 * @DATE: 2023/6/2 9:38
 * */
@RestController
@RequestMapping("constructionReport")
@AllArgsConstructor
@Api(value = "反馈记录", tags = "反馈记录")
public class ConstructionReportController extends BladeController {
    private final IConstructionReportService constructionReportService;
    @GetMapping("/page")
    @ApiOperation(value = "列表", notes = "传入实体类参数")
    public R<IPage<ConstructionReportVO>> pageList(ConstructionReportVO constructionReportVO, Query query) {
        IPage<ConstructionReportVO> page = constructionReportService.selectPage(Condition.getPage(query),constructionReportVO);
        return R.data(page);
    }
    /**
     * 详情
     */
    @GetMapping("/detail")
    @ApiOperation(value = "详情", notes = "传入实体类参数")
    public R<ConstructionReport> detail(@RequestParam(name="id",required=true) String id) {
        return R.data(constructionReportService.getById(id));
    }
    /**
     * 新增
     */
    @PostMapping("/save")
    @ApiOperation(value = "新增", notes = "传入实体类参数")
    public R save(@RequestBody ConstructionReport constructionReport) {
        return R.data(constructionReportService.save(constructionReport));
    }
    /**
     * 修改
     */
    @PostMapping("/update")
    @ApiOperation(value = "修改", notes = "传入实体类参数")
    public R update(@RequestBody ConstructionReport constructionReport) {
        return R.data(constructionReportService.updateById(constructionReport));
    }
    /**
     * 新增或修改
     */
    @PostMapping("/submit")
    @ApiOperation(value = "新增或修改", notes = "传入实体类参数")
    public R submit(@RequestBody ConstructionReport constructionReport) {
        return R.data(constructionReportService.saveOrUpdate(constructionReport));
    }
    /**
     * 删除
     */
    @PostMapping("/remove")
    @ApiOperation(value = "逻辑删除", notes = "传入实体类参数")
    public R remove(@ApiParam(value = "主键集合") @RequestParam String ids) {
        return R.data(constructionReportService.removeBatchByIds(Func.toLongList(ids)));
    }
}
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/entity/ConstructionReport.java
New file
@@ -0,0 +1,35 @@
package cn.gistack.sm.constructionReport.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.mp.base.BaseEntity;
/**
 * @PROJECT_NAME: skjcmanager
 * @DESCRIPTION: 施工上报记录表
 * @USER: guoshilong
 * @DATE: 2023/6/2 9:38
 */
@Data
@TableName( value = "sm_construction_report",autoResultMap = true)
@EqualsAndHashCode(callSuper = true)
public class ConstructionReport extends BaseEntity {
    private static final long serialVersionUID = 1L;
    //水库编码
    private String resGuid;
    //水库名称
    private String resName;
    //经度
    private String lon;
    //纬度
    private String lat;
    private String description;
    private String imageUrls;
}
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/mapper/ConstructionReportMapper.java
New file
@@ -0,0 +1,15 @@
package cn.gistack.sm.constructionReport.mapper;
import cn.gistack.sm.constructionReport.entity.ConstructionReport;
import cn.gistack.sm.constructionReport.vo.ConstructionReportVO;
import cn.gistack.sm.feedback.entity.Feedback;
import cn.gistack.sm.feedback.vo.FeedbackVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface ConstructionReportMapper extends BaseMapper<ConstructionReport> {
    List<ConstructionReportVO> getPage(IPage<ConstructionReportVO> page, @Param("vo") ConstructionReportVO constructionReportVO);
}
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/mapper/ConstructionReportMapper.xml
New file
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.gistack.sm.constructionReport.mapper.ConstructionReportMapper">
    <sql id="resBaseInfo">
                case when town."ad_grad" = 4 THEN town."ad_code" ELSE NULL END AS townCode,
                case when town."ad_grad" = 4 THEN town."ad_name" ELSE NULL END AS townName,
                case
                    when town."ad_grad" = 3 THEN town."ad_code"
                    when county."ad_grad" = 3 THEN county."ad_code" END AS countyCode,
                case
                    when town."ad_grad" = 3 THEN town."ad_name"
                    when county."ad_grad" = 3 THEN county."ad_name" END AS countyName,
                case
                    when town."ad_grad" = 2 THEN town."ad_code"
                    when county."ad_grad" = 2 THEN county."ad_code"
                    ELSE city."ad_code" END   AS cityCode,
                case
                    when town."ad_grad" = 2 THEN town."ad_name"
                    when county."ad_grad" = 2 THEN county."ad_name"
                    ELSE city."ad_name" END AS cityName,
                case
                    when town."ad_grad" = 1 THEN town."ad_code"
                    when county."ad_grad" = 1 THEN county."ad_code"
                    when city."ad_grad" = 1 THEN city."ad_code"
                    ELSE province."ad_code" END AS provinceCode,
                case
                    when town."ad_grad" = 1 THEN town."ad_name"
                    when county."ad_grad" = 1 THEN county."ad_name"
                    when city."ad_grad" = 1 THEN city."ad_name"
                    ELSE province."ad_name" END  AS provinceName
    </sql>
    <select id="getPage" resultType="cn.gistack.sm.constructionReport.vo.ConstructionReportVO">
        SELECT
            scr.id,
            scr.res_name,
            scr.res_guid,
            scr.lon,
            scr.lat,
            scr.description,
            scr.image_urls,
            arb."eng_scal",
            arb."res_reg_code",
            bu.real_name reportUserName,
            scr.create_time,
            <include refid="resBaseInfo"/>
        FROM SM_CONSTRUCTION_REPORT SCR
        LEFT JOIN SJZT_MD."att_res_base" arb on arb."guid" = scr.res_guid
        LEFT JOIN SJZT_MD."att_ad_base"town ON arb."interior_ad_guid" = town."guid"
        LEFT JOIN SJZT_MD."att_ad_base" county ON town."p_ad_code" = county."guid"
        LEFT JOIN SJZT_MD."att_ad_base" city ON county."p_ad_code" = city."guid"
        LEFT JOIN SJZT_MD."att_ad_base" province ON province."guid" = city."p_ad_code"
        LEFT JOIN BLADE_USER BU ON BU.ID = SCR.CREATE_USER
        where scr.is_deleted  = 0
          <if test="vo.adCode != null and vo.adCode !=''">
            AND CONCAT(province."ad_code",city."ad_code",county."ad_code",town."ad_code") LIKE CONCAT('%',#{vo.adCode},'%')
        </if>
        <if test="vo.engScal != null and vo.engScal !=''">
            AND arb."eng_scal" = #{vo.engScal}
        </if>
        <if test="vo.resName != null and vo.resName !=''">
            AND scr.res_name LIKE CONCAT('%',#{vo.resName},'%')
        </if>
        <if test="vo.resGuid != null and vo.resGuid !=''">
            AND scr.res_guid LIKE CONCAT('%',#{vo.resGuid},'%')
        </if>
        <if test="vo.resRegCode != null and vo.resRegCode !=''">
            AND arb."res_reg_code" LIKE CONCAT('%',#{vo.resRegCode},'%')
        </if>
        <if test="vo.startTime != null and vo.startTime != ''">
            AND scr.create_time &gt;= #{dam.startTime}
        </if>
        <if test="vo.endTime != null and vo.endTime !='' ">
            AND scr.create_time &lt;= #{dam.endTime}
        </if>
    </select>
</mapper>
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/service/IConstructionReportService.java
New file
@@ -0,0 +1,10 @@
package cn.gistack.sm.constructionReport.service;
import cn.gistack.sm.constructionReport.entity.ConstructionReport;
import cn.gistack.sm.constructionReport.vo.ConstructionReportVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
public interface IConstructionReportService extends BaseService<ConstructionReport> {
    IPage<ConstructionReportVO> selectPage(IPage<ConstructionReportVO> page, ConstructionReportVO constructionReportVO);
}
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/service/impl/ConstructionReportServiceImpl.java
New file
@@ -0,0 +1,20 @@
package cn.gistack.sm.constructionReport.service.impl;
import cn.gistack.sm.constructionReport.entity.ConstructionReport;
import cn.gistack.sm.constructionReport.mapper.ConstructionReportMapper;
import cn.gistack.sm.constructionReport.service.IConstructionReportService;
import cn.gistack.sm.constructionReport.vo.ConstructionReportVO;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
@Service
public class ConstructionReportServiceImpl extends BaseServiceImpl<ConstructionReportMapper, ConstructionReport> implements IConstructionReportService {
    @Override
    public IPage<ConstructionReportVO> selectPage(IPage<ConstructionReportVO> page, ConstructionReportVO constructionReportVO) {
        return page.setRecords(baseMapper.getPage(page,constructionReportVO));
    }
}
skjcmanager/skjcmanager-service/skjcmanager-sm/src/main/java/cn/gistack/sm/constructionReport/vo/ConstructionReportVO.java
New file
@@ -0,0 +1,24 @@
package cn.gistack.sm.constructionReport.vo;
import cn.gistack.sm.constructionReport.entity.ConstructionReport;
import lombok.Data;
@Data
public class ConstructionReportVO extends ConstructionReport {
    private String adCode;
    private String provinceCode;
    private String provinceName;
    private String cityCode;
    private String cityName;
    private String countyCode;
    private String countyName;
    private String townCode;
    private String townName;
    private String engScal;
    private String resRegCode;
    private String reportUserName;
    private String startTime;
    private String endTime;
}