瀏覽代碼

检测表-绝缘子清扫记录

wuhonghao 4 年之前
父節點
當前提交
91e74cee18

+ 82 - 0
railway-admin/src/main/java/com/railway/web/controller/business/catenary/BusJcebJyzqsjlController.java

@@ -0,0 +1,82 @@
+package com.railway.web.controller.business.catenary;
+
+import com.railway.business.catenary.domain.BusJcebGjsfx;
+import com.railway.business.catenary.domain.BusJcebJyzqsjl;
+import com.railway.business.catenary.service.IBusJcebJyzqsjlService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.WebDataBinder;
+import com.railway.common.core.controller.BaseController;
+import com.railway.common.core.domain.AjaxResult;
+import com.railway.common.core.page.TableDataInfo;
+import javax.validation.Valid;
+import java.util.List;
+
+import javax.validation.Valid;
+
+@Api(value = "rest/catenary/bus/jceb/jyzqsjl", tags = "检测表-绝缘子清扫记录")
+@RestController
+@Validated
+@RequestMapping(value = "business/catenary/bus/jceb/jyzqsjl")
+public class BusJcebJyzqsjlController extends BaseController {
+    @Autowired
+    private IBusJcebJyzqsjlService busJcebJyzqsjlService;
+
+    @ApiOperation(value = "新增")
+    @PostMapping("/add")
+    public AjaxResult add(@Validated @RequestBody BusJcebJyzqsjl busJcebJyzqsjl) {
+        return toAjax(busJcebJyzqsjlService.create(busJcebJyzqsjl));
+    }
+
+    @ApiOperation(value = "删除")
+    @DeleteMapping("/{ids}")
+    public AjaxResult delete(@RequestParam String[] ids) {
+        return toAjax(busJcebJyzqsjlService.delete(ids));
+    }
+
+    @ApiOperation(value = "更新")
+    @PutMapping("/update")
+    public AjaxResult update(@RequestBody @Valid BusJcebJyzqsjl busJcebJyzqsjl) {
+        return toAjax(busJcebJyzqsjlService.update(busJcebJyzqsjl));
+    }
+
+    @ApiOperation(value = "单个")
+    @GetMapping(value = {"/", "/{id}"})
+    public AjaxResult getInfo(String id) {
+        BusJcebJyzqsjl info = busJcebJyzqsjlService.getInfo(id);
+        AjaxResult ajax = AjaxResult.success();
+        ajax.put("info",info);
+        return ajax;
+    }
+
+    @ApiOperation(value = "列表")
+    @GetMapping(value = "list")
+    public TableDataInfo getList(BusJcebJyzqsjl busJcebJyzqsjl) {
+        startPage();
+        List<BusJcebJyzqsjl> list = busJcebJyzqsjlService.getList(busJcebJyzqsjl);
+        return getDataTable(list);
+    }
+
+    @ApiOperation(value = "提交")
+    @PutMapping("/submit")
+    public AjaxResult submit(@RequestBody BusJcebJyzqsjl busJcebJyzqsjl) {
+        return toAjax(busJcebJyzqsjlService.submit(busJcebJyzqsjl));
+    }
+
+    @ApiOperation(value = "退回")
+    @PutMapping("/reject")
+    public AjaxResult reject(@RequestBody BusJcebJyzqsjl busJcebJyzqsjl) {
+        return toAjax(busJcebJyzqsjlService.reject(busJcebJyzqsjl));
+    }
+
+    @ApiOperation(value = "确认")
+    @PutMapping("/confirm")
+    public AjaxResult confirm(@RequestBody BusJcebJyzqsjl busJcebJyzqsjl) {
+        return toAjax(busJcebJyzqsjlService.confirm(busJcebJyzqsjl));
+    }
+
+}

+ 80 - 0
railway-business/src/main/java/com/railway/business/catenary/domain/BusJcebJyzqsjl.java

@@ -0,0 +1,80 @@
+package com.railway.business.catenary.domain;
+
+import com.railway.common.core.domain.BaseEntity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import java.util.Date;
+
+import org.hibernate.validator.constraints.Length;
+import javax.validation.constraints.NotNull;
+/**
+ * 检测表-绝缘子清扫记录
+ * @author author 2021-10-21
+ */
+@Data
+@ApiModel("检测表-绝缘子清扫记录")
+@EqualsAndHashCode(callSuper = true)
+public class BusJcebJyzqsjl extends BaseEntity{
+
+    @ApiModelProperty(value = "主键", hidden = true)
+    private String id;
+
+    @ApiModelProperty(value = "周期")
+    @Length(min = 1, max = 10, message = "【周期】长度必须介于 {min} 和 {max} 之间")
+    private String zq;
+
+    @ApiModelProperty(value = "线别")
+    @Length(min = 1, max = 10, message = "【线别】长度必须介于 {min} 和 {max} 之间")
+    private String xb;
+
+    @ApiModelProperty(value = "行别")
+    @Length(min = 1, max = 10, message = "【行别】长度必须介于 {min} 和 {max} 之间")
+    private String hb;
+
+    @ApiModelProperty(value = "站场/区间")
+    @Length(min = 1, max = 50, message = "【站场/区间】长度必须介于 {min} 和 {max} 之间")
+    private String qj;
+
+    @ApiModelProperty(value = "支柱号")
+    @Length(min = 1, max = 50, message = "【支柱号】长度必须介于 {min} 和 {max} 之间")
+    private String zzh;
+
+    @ApiModelProperty(value = "数量")
+    private Integer sl;
+
+    @ApiModelProperty(value = "日期")
+    private Date rq;
+
+    @ApiModelProperty(value = "清扫人员")
+    @Length(min = 1, max = 50, message = "【清扫人员】长度必须介于 {min} 和 {max} 之间")
+    private String qsry;
+
+    @ApiModelProperty(value = "备注")
+    @Length(min = 1, max = 255, message = "【备注】长度必须介于 {min} 和 {max} 之间")
+    private String bz;
+
+    @ApiModelProperty(value = "提交状态 0未提交 1已提交 2已退回 9已确认")
+    @Length(min = 1, max = 1, message = "【提交状态 0未提交 1已提交 2已退回 9已确认】长度必须介于 {min} 和 {max} 之间")
+    private String submitState;
+
+    @ApiModelProperty(value = "del_flag")
+    @Length(min = 1, max = 1, message = "【del_flag】长度必须介于 {min} 和 {max} 之间")
+    private String delFlag;
+
+    @ApiModelProperty(value = "create_by")
+    @Length(min = 1, max = 64, message = "【create_by】长度必须介于 {min} 和 {max} 之间")
+    private String createBy;
+
+    @ApiModelProperty(value = "update_by")
+    @Length(min = 1, max = 64, message = "【update_by】长度必须介于 {min} 和 {max} 之间")
+    private String updateBy;
+
+    @ApiModelProperty(value = "update_time")
+    private Date updateTime;
+
+    public BusJcebJyzqsjl() {
+    }
+
+}

+ 43 - 0
railway-business/src/main/java/com/railway/business/catenary/mapper/BusJcebJyzqsjlMapper.java

@@ -0,0 +1,43 @@
+package com.railway.business.catenary.mapper;
+
+import com.github.pagehelper.Page;
+import com.railway.business.catenary.domain.BusJcebJyzqsjl;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+/**
+* 检测表-绝缘子清扫记录
+* @author author
+* @date 2021/10/21
+*/
+@Mapper
+@Repository
+public interface BusJcebJyzqsjlMapper {
+
+    /**
+    * @Description: 新增
+    */
+    int insert(BusJcebJyzqsjl busJcebJyzqsjl);
+
+    /**
+    * @Description: 删除
+    */
+    int delete(@Param("id") String id);
+
+    /**
+    * @Description: 更新
+    */
+    int update(BusJcebJyzqsjl busJcebJyzqsjl);
+
+    /**
+    * @Description: 获取单个
+    */
+    BusJcebJyzqsjl getInfo(@Param("id") String id);
+
+    /**
+    * @Description: 查询列表
+    */
+    Page<BusJcebJyzqsjl> getList(BusJcebJyzqsjl busJcebJyzqsjl);
+
+}

+ 60 - 0
railway-business/src/main/java/com/railway/business/catenary/service/IBusJcebJyzqsjlService.java

@@ -0,0 +1,60 @@
+package com.railway.business.catenary.service;
+
+import com.railway.business.catenary.domain.BusJcebGjsfx;
+import com.railway.business.catenary.domain.BusJcebJyzqsjl;
+import java.util.List;
+/**
+* 检测表-绝缘子清扫记录
+* @author author
+* @date 2021/10/21
+*/
+public interface IBusJcebJyzqsjlService{
+
+    /**
+    * @Description: 新增
+    */
+    int create(BusJcebJyzqsjl busJcebJyzqsjl);
+
+    /**
+    * @Description: 删除
+    */
+    int delete(String[] ids);
+
+    /**
+    * @Description: 更新
+    */
+    int update(BusJcebJyzqsjl busJcebJyzqsjl);
+
+    /**
+    * @Description: 获取单个
+    */
+    BusJcebJyzqsjl getInfo(String id);
+
+    /**
+    * @Description: 查询列表
+    */
+    List<BusJcebJyzqsjl> getList(BusJcebJyzqsjl busJcebJyzqsjl);
+
+    /**
+     * 提交
+     * @param busJcebJyzqsjl
+     * @return
+     */
+    int submit(BusJcebJyzqsjl busJcebJyzqsjl);
+
+    /**
+     * 退回
+     * @param busJcebJyzqsjl
+     * @return
+     */
+    int reject(BusJcebJyzqsjl busJcebJyzqsjl);
+
+    /**
+     * 确认
+     * @param busJcebJyzqsjl
+     * @return
+     */
+    int confirm(BusJcebJyzqsjl busJcebJyzqsjl);
+
+
+}

+ 115 - 0
railway-business/src/main/java/com/railway/business/catenary/service/impl/BusJcebJyzqsjlServiceImpl.java

@@ -0,0 +1,115 @@
+package com.railway.business.catenary.service.impl;
+
+import com.github.pagehelper.Page;
+import com.github.pagehelper.PageHelper;
+import com.railway.business.catenary.domain.BusJcebGjsfx;
+import com.railway.business.catenary.enums.TestTableStatusEnum;
+import com.railway.business.catenary.mapper.BusJcebJyzqsjlMapper;
+import com.railway.business.catenary.domain.BusJcebJyzqsjl;
+import com.railway.business.catenary.service.IBusJcebJyzqsjlService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.railway.common.utils.SecurityUtils;
+import org.springframework.transaction.annotation.Transactional;
+import java.util.List;
+import java.util.Date;
+/**
+* 检测表-绝缘子清扫记录
+* @author author
+* @date 2021/10/21
+*/
+@Service
+@Transactional(readOnly = true)
+public class BusJcebJyzqsjlServiceImpl implements IBusJcebJyzqsjlService{
+@Autowired
+private BusJcebJyzqsjlMapper busJcebJyzqsjlMapper;
+
+	/**
+	* @Description: 新增
+	*/
+	@Transactional(rollbackFor = Exception.class)
+	public int create(BusJcebJyzqsjl busJcebJyzqsjl) {
+	    busJcebJyzqsjl.setCreateTime(new Date());
+        busJcebJyzqsjl.setCreateBy(SecurityUtils.getUsername());
+		return busJcebJyzqsjlMapper.insert(busJcebJyzqsjl);
+	}
+
+	/**
+	* @Description: 删除
+	*/
+	@Transactional(rollbackFor = Exception.class)
+	public int delete(String[] ids) {
+		int r =0;
+		for (String id : ids) {
+			int j= busJcebJyzqsjlMapper.delete(id);
+			r = r + j;
+		}
+		return	r;
+	}
+
+	/**
+	* @Description: 更新
+	*/
+	@Transactional(rollbackFor = Exception.class)
+	public int update(BusJcebJyzqsjl busJcebJyzqsjl) {
+		busJcebJyzqsjl.setUpdateTime(new Date());
+    	busJcebJyzqsjl.setUpdateBy(SecurityUtils.getUsername());
+		return busJcebJyzqsjlMapper.update(busJcebJyzqsjl);
+	}
+
+	/**
+	* @Description: 获取单个
+	*/
+	public BusJcebJyzqsjl getInfo(String id) {
+		return busJcebJyzqsjlMapper.getInfo(id);
+	}
+
+	/**
+	* @Description: 查询列表
+	*/
+	public List<BusJcebJyzqsjl> getList(BusJcebJyzqsjl busJcebJyzqsjl) {
+		return busJcebJyzqsjlMapper.getList(busJcebJyzqsjl);
+	}
+
+	/**
+	 * 提交
+	 * @param busJcebJyzqsjl
+	 * @return
+	 */
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public int submit(BusJcebJyzqsjl busJcebJyzqsjl) {
+		busJcebJyzqsjl.setUpdateTime(new Date());
+		busJcebJyzqsjl.setUpdateBy(SecurityUtils.getUsername());
+		busJcebJyzqsjl.setSubmitState(TestTableStatusEnum.REPORTED.getCode());
+		return busJcebJyzqsjlMapper.update(busJcebJyzqsjl);
+	}
+
+	/**
+	 * 退回
+	 * @param busJcebJyzqsjl
+	 * @return
+	 */
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public int reject(BusJcebJyzqsjl busJcebJyzqsjl) {
+		busJcebJyzqsjl.setUpdateTime(new Date());
+		busJcebJyzqsjl.setUpdateBy(SecurityUtils.getUsername());
+		busJcebJyzqsjl.setSubmitState(TestTableStatusEnum.RETURNED.getCode());
+		return busJcebJyzqsjlMapper.update(busJcebJyzqsjl);
+	}
+
+	/**
+	 * 确认
+	 * @param busJcebJyzqsjl
+	 * @return
+	 */
+	@Override
+	@Transactional(rollbackFor = Exception.class)
+	public int confirm(BusJcebJyzqsjl busJcebJyzqsjl) {
+		busJcebJyzqsjl.setUpdateTime(new Date());
+		busJcebJyzqsjl.setUpdateBy(SecurityUtils.getUsername());
+		busJcebJyzqsjl.setSubmitState(TestTableStatusEnum.COMPLETED.getCode());
+		return busJcebJyzqsjlMapper.update(busJcebJyzqsjl);
+	}
+}

+ 236 - 0
railway-business/src/main/resources/mapper/business/BusJcebJyzqsjlMapper.xml

@@ -0,0 +1,236 @@
+<?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="com.railway.business.catenary.mapper.BusJcebJyzqsjlMapper">
+
+    <resultMap id="BaseResultMap" type="com.railway.business.catenary.domain.BusJcebJyzqsjl">
+                <result column="id" property="id"/>
+                <result column="zq" property="zq"/>
+                <result column="xb" property="xb"/>
+                <result column="hb" property="hb"/>
+                <result column="qj" property="qj"/>
+                <result column="zzh" property="zzh"/>
+                <result column="sl" property="sl"/>
+                <result column="rq" property="rq"/>
+                <result column="qsry" property="qsry"/>
+                <result column="bz" property="bz"/>
+                <result column="submit_state" property="submitState"/>
+                <result column="del_flag" property="delFlag"/>
+                <result column="create_by" property="createBy"/>
+                <result column="create_time" property="createTime"/>
+                <result column="update_by" property="updateBy"/>
+                <result column="update_time" property="updateTime"/>
+    </resultMap>
+
+    <sql id="Base_Column_List">
+                id,
+                zq,
+                xb,
+                hb,
+                qj,
+                zzh,
+                sl,
+                rq,
+                qsry,
+                bz,
+                submit_state,
+                del_flag,
+                create_by,
+                create_time,
+                update_by,
+                update_time
+    </sql>
+
+    <insert id="insert" parameterType="com.railway.business.catenary.domain.BusJcebJyzqsjl">
+        <selectKey keyProperty="id" order="BEFORE" resultType="String">
+            select replace(uuid(), '-', '') from dual
+        </selectKey>
+        INSERT INTO bus_jceb_jyzqsjl
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                    <if test ='null != zq'>
+                    zq,
+                    </if>
+                    <if test ='null != xb'>
+                    xb,
+                    </if>
+                    <if test ='null != hb'>
+                    hb,
+                    </if>
+                    <if test ='null != qj'>
+                    qj,
+                    </if>
+                    <if test ='null != zzh'>
+                    zzh,
+                    </if>
+                    <if test ='null != sl'>
+                    sl,
+                    </if>
+                    <if test ='null != rq'>
+                    rq,
+                    </if>
+                    <if test ='null != qsry'>
+                    qsry,
+                    </if>
+                    <if test ='null != bz'>
+                    bz,
+                    </if>
+                    <if test ='null != submitState'>
+                    submit_state,
+                    </if>
+                    <if test ='null != delFlag'>
+                    del_flag,
+                    </if>
+                    <if test ='null != createBy'>
+                    create_by,
+                    </if>
+                    <if test ='null != createTime'>
+                    create_time,
+                    </if>
+                    <if test ='null != updateBy'>
+                    update_by,
+                    </if>
+                    <if test ='null != updateTime'>
+                    update_time
+                    </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                    <if test ='null != zq'>
+                    #{zq},
+                    </if>
+                    <if test ='null != xb'>
+                    #{xb},
+                    </if>
+                    <if test ='null != hb'>
+                    #{hb},
+                    </if>
+                    <if test ='null != qj'>
+                    #{qj},
+                    </if>
+                    <if test ='null != zzh'>
+                    #{zzh},
+                    </if>
+                    <if test ='null != sl'>
+                    #{sl},
+                    </if>
+                    <if test ='null != rq'>
+                    #{rq},
+                    </if>
+                    <if test ='null != qsry'>
+                    #{qsry},
+                    </if>
+                    <if test ='null != bz'>
+                    #{bz},
+                    </if>
+                    <if test ='null != submitState'>
+                    #{submitState},
+                    </if>
+                    <if test ='null != delFlag'>
+                    #{delFlag},
+                    </if>
+                    <if test ='null != createBy'>
+                    #{createBy},
+                    </if>
+                    <if test ='null != createTime'>
+                    #{createTime},
+                    </if>
+                    <if test ='null != updateBy'>
+                    #{updateBy},
+                    </if>
+                    <if test ='null != updateTime'>
+                    #{updateTime}
+                    </if>
+        </trim>
+    </insert>
+
+    <delete id="delete">
+        UPDATE bus_jceb_jyzqsjl
+        set del_flag='1'
+        WHERE id = #{id}
+    </delete>
+
+    <update id="update" parameterType="com.railway.business.catenary.domain.BusJcebJyzqsjl">
+        UPDATE bus_jceb_jyzqsjl
+        <set>
+                    <if test ='null != zq'>zq = #{zq},</if>
+                    <if test ='null != xb'>xb = #{xb},</if>
+                    <if test ='null != hb'>hb = #{hb},</if>
+                    <if test ='null != qj'>qj = #{qj},</if>
+                    <if test ='null != zzh'>zzh = #{zzh},</if>
+                    <if test ='null != sl'>sl = #{sl},</if>
+                    <if test ='null != rq'>rq = #{rq},</if>
+                    <if test ='null != qsry'>qsry = #{qsry},</if>
+                    <if test ='null != bz'>bz = #{bz},</if>
+                    <if test ='null != submitState'>submit_state = #{submitState},</if>
+                    <if test ='null != delFlag'>del_flag = #{delFlag},</if>
+                    <if test ='null != createBy'>create_by = #{createBy},</if>
+                    <if test ='null != createTime'>create_time = #{createTime},</if>
+                    <if test ='null != updateBy'>update_by = #{updateBy},</if>
+                    <if test ='null != updateTime'>update_time = #{updateTime}</if>
+        </set>
+        WHERE id = #{id}
+    </update>
+
+
+    <select id="getInfo" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM bus_jceb_jyzqsjl
+        WHERE del_flag='0' and id = #{id}
+
+    </select>
+
+    <select id="getList" resultMap="BaseResultMap">
+        SELECT
+        <include refid="Base_Column_List"/>
+        FROM bus_jceb_jyzqsjl
+        <where>
+            del_flag='0'
+                <if test="zq!=null and zq!=''">
+                    and zq=#{zq}
+                </if>
+                <if test="xb!=null and xb!=''">
+                    and xb=#{xb}
+                </if>
+                <if test="hb!=null and hb!=''">
+                    and hb=#{hb}
+                </if>
+                <if test="qj!=null and qj!=''">
+                    and qj=#{qj}
+                </if>
+                <if test="zzh!=null and zzh!=''">
+                    and zzh=#{zzh}
+                </if>
+                <if test="sl!=null and sl!=''">
+                    and sl=#{sl}
+                </if>
+                <if test="rq!=null and rq!=''">
+                    and rq=#{rq}
+                </if>
+                <if test="qsry!=null and qsry!=''">
+                    and qsry=#{qsry}
+                </if>
+                <if test="bz!=null and bz!=''">
+                    and bz=#{bz}
+                </if>
+                <if test="submitState!=null and submitState!=''">
+                    and submit_state=#{submitState}
+                </if>
+                <if test="delFlag!=null and delFlag!=''">
+                    and del_flag=#{delFlag}
+                </if>
+                <if test="createBy!=null and createBy!=''">
+                    and create_by=#{createBy}
+                </if>
+                <if test="createTime!=null and createTime!=''">
+                    and create_time=#{createTime}
+                </if>
+                <if test="updateBy!=null and updateBy!=''">
+                    and update_by=#{updateBy}
+                </if>
+                <if test="updateTime!=null and updateTime!=''">
+                    and update_time=#{updateTime}
+                </if>
+        </where>
+    </select>
+
+</mapper>