From c94f3c34d1c2c5a1d5e7010ab1e3cd0aded3cfac Mon Sep 17 00:00:00 2001 From: 郑永安 <zyazyz250@sina.com> Date: 星期二, 15 八月 2023 09:40:37 +0800 Subject: [PATCH] Merge branch 'zya' --- src/main/java/com/gk/hotwork/Mapper/SafetyFacilityInspectionMapper.java | 29 ++ src/main/java/com/gk/hotwork/Domain/SafetyFacilityInspection.java | 173 +++++++++++++++++ src/main/java/com/gk/hotwork/Service/SafetyFacilityInspectionService.java | 39 +++ src/main/java/com/gk/hotwork/Controller/SafetyFacilityInspectionController.java | 68 ++++++ src/main/resources/application-dev.yml | 2 src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyFacilityInspectionMapper.xml | 208 ++++++++++++++++++++ src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetyFacilityInspectionImpl.java | 62 ++++++ 7 files changed, 580 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/gk/hotwork/Controller/SafetyFacilityInspectionController.java b/src/main/java/com/gk/hotwork/Controller/SafetyFacilityInspectionController.java new file mode 100644 index 0000000..3a8f11f --- /dev/null +++ b/src/main/java/com/gk/hotwork/Controller/SafetyFacilityInspectionController.java @@ -0,0 +1,68 @@ +package com.gk.hotwork.Controller; + +import java.util.Date; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Controller.Base.BaseController; +import com.gk.hotwork.Domain.SafetyFacilityInspection; +import com.gk.hotwork.Domain.SafetyInspectionItem; +import com.gk.hotwork.Domain.Utils.FilterObject; +import com.gk.hotwork.Domain.Utils.Msg; +import com.gk.hotwork.Service.SafetyFacilityInspectionService; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; + + +@Api(tags = "安全设施审查流程") +@RestController +@RequestMapping("/safetyFacilityInspection") +public class SafetyFacilityInspectionController extends BaseController{ + + @Autowired + private SafetyFacilityInspectionService safetyFacilityInspectionService; + + + @ApiOperation("分页") + @PostMapping("/page") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageIndex",value = "当前页码"), + @ApiImplicitParam(name = "pageSize",value = "每页行数"), + @ApiImplicitParam(name = "progress",value = "进度进度(0:待受理,1:已受理,10:待评审,11:评审中,12:评审否决,19:待企业反馈,20:待审查,21:审查中,29:待企业补正,22:审查否决,30:完成)"), + @ApiImplicitParam(name = "expert",value = "审查专家"), + @ApiImplicitParam(name = "submitDateStartTime",value = "开始时间"), + @ApiImplicitParam(name = "submitDateEndTime",value = "结束时间") + }) + public Msg selectPage(@RequestBody FilterObject filterObject) { + Integer pageIndex = filterObject.getPageIndex(); + Integer pageSize = filterObject.getPageSize(); + IPage page = safetyFacilityInspectionService.selectPage(new Page<>(pageIndex, pageSize), filterObject.getFilter(), getUser()); + return success(page); + } + + + @ApiOperation("/新增") + @PostMapping("/add") + @ApiImplicitParams({ + @ApiImplicitParam(name = "submitDate",value = "提交日期"), + @ApiImplicitParam(name = "type",value = "类别(1:安全设施设计审查,2:安全条件审查)"), + @ApiImplicitParam(name = "projectName",value = "项目名称"), + @ApiImplicitParam(name = "progress",value = "进度(0:待受理,1:已受理,10:待评审,11:评审中,12:评审否决,19:待企业反馈,20:待审查,21:审查中,29:待企业补正,22:审查否决,30:完成)"), + @ApiImplicitParam(name = "expert",value = "审查专家"), + @ApiImplicitParam(name = "contact",value = "联系人"), + @ApiImplicitParam(name = "telephone",value = "联系电话") +}) + public Msg add(@RequestBody SafetyFacilityInspection param) { + safetyFacilityInspectionService.addOne(param, this.getUser()); + return success(); + } +} diff --git a/src/main/java/com/gk/hotwork/Domain/SafetyFacilityInspection.java b/src/main/java/com/gk/hotwork/Domain/SafetyFacilityInspection.java new file mode 100644 index 0000000..cb6527e --- /dev/null +++ b/src/main/java/com/gk/hotwork/Domain/SafetyFacilityInspection.java @@ -0,0 +1,173 @@ +package com.gk.hotwork.Domain; + +import java.io.Serializable; +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; + + +@TableName("safety_facility_inspection") +public class SafetyFacilityInspection implements Serializable { + /** + * + */ + private static final long serialVersionUID = 4028406973653972996L; + + /** 主键id id **/ + private Long id; + + /** 有效标识 valid_flag **/ + private Byte validFlag; + + /** 创建时间 create_time **/ + private Date createTime; + + /** 创建人 create_by **/ + private String createBy; + + /** 最新更新时间 update_time **/ + private Date updateTime; + + /** 提交日期 submit_date **/ + private Date submitDate; + + /** 类别(1:安全设施设计审查,2:安全条件审查) type **/ + private Integer type; + + /** 项目名称 project_name **/ + private String projectName; + + /** 进度(0:待受理,1:已受理,10:待评审,11:评审中,12:评审否决,19:待企业反馈,20:待审查,21:审查中,29:待企业补正,22:审查否决,30:完成) progress **/ + private Integer progress; + + /** 审查专家 expert **/ + private String expert; + + /** 联系人 contact **/ + private String contact; + + /** 联系电话 telephone **/ + private String telephone; + + /** 主键id id **/ + public Long getId() { + return id; + } + + /** 主键id id **/ + public void setId(Long id) { + this.id = id; + } + + /** 有效标识 valid_flag **/ + public Byte getValidFlag() { + return validFlag; + } + + /** 有效标识 valid_flag **/ + public void setValidFlag(Byte validFlag) { + this.validFlag = validFlag; + } + + /** 创建时间 create_time **/ + public Date getCreateTime() { + return createTime; + } + + /** 创建时间 create_time **/ + public void setCreateTime(Date createTime) { + this.createTime = createTime; + } + + /** 创建人 create_by **/ + public String getCreateBy() { + return createBy; + } + + /** 创建人 create_by **/ + public void setCreateBy(String createBy) { + this.createBy = createBy == null ? null : createBy.trim(); + } + + /** 最新更新时间 update_time **/ + public Date getUpdateTime() { + return updateTime; + } + + /** 最新更新时间 update_time **/ + public void setUpdateTime(Date updateTime) { + this.updateTime = updateTime; + } + + /** 提交日期 submit_date **/ + public Date getSubmitDate() { + return submitDate; + } + + /** 提交日期 submit_date **/ + public void setSubmitDate(Date submitDate) { + this.submitDate = submitDate; + } + + /** 类别(1:安全设施设计审查,2:安全条件审查) type **/ + public Integer getType() { + return type; + } + + /** 类别(1:安全设施设计审查,2:安全条件审查) type **/ + public void setType(Integer type) { + this.type = type; + } + + /** 项目名称 project_name **/ + public String getProjectName() { + return projectName; + } + + /** 项目名称 project_name **/ + public void setProjectName(String projectName) { + this.projectName = projectName == null ? null : projectName.trim(); + } + + /** 进度(0:待受理,1:已受理,10:待评审,11:评审中,12:评审否决,19:待企业反馈,20:待审查,21:审查中,29:待企业补正,22:审查否决,30:完成) progress **/ + public Integer getProgress() { + return progress; + } + + /** 进度(0:待受理,1:已受理,10:待评审,11:评审中,12:评审否决,19:待企业反馈,20:待审查,21:审查中,29:待企业补正,22:审查否决,30:完成) progress **/ + public void setProgress(Integer progress) { + this.progress = progress; + } + + /** 审查专家 expert **/ + public String getExpert() { + return expert; + } + + /** 审查专家 expert **/ + public void setExpert(String expert) { + this.expert = expert == null ? null : expert.trim(); + } + + /** 联系人 contact **/ + public String getContact() { + return contact; + } + + /** 联系人 contact **/ + public void setContact(String contact) { + this.contact = contact == null ? null : contact.trim(); + } + + /** 联系电话 telephone **/ + public String getTelephone() { + return telephone; + } + + /** 联系电话 telephone **/ + public void setTelephone(String telephone) { + this.telephone = telephone == null ? null : telephone.trim(); + } +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/SafetyFacilityInspectionMapper.java b/src/main/java/com/gk/hotwork/Mapper/SafetyFacilityInspectionMapper.java new file mode 100644 index 0000000..bd2c129 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/SafetyFacilityInspectionMapper.java @@ -0,0 +1,29 @@ +package com.gk.hotwork.Mapper; + +import java.util.Map; + +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Repository; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.gk.hotwork.Domain.SafetyFacilityInspection; + + +@Repository +public interface SafetyFacilityInspectionMapper extends BaseMapper<SafetyFacilityInspection>{ + int deleteByPrimaryKey(Long id); + + int insert(SafetyFacilityInspection record); + + int insertSelective(SafetyFacilityInspection record); + + SafetyFacilityInspection selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(SafetyFacilityInspection record); + + int updateByPrimaryKey(SafetyFacilityInspection record); + + IPage<SafetyFacilityInspection> selectPages(Page<SafetyFacilityInspection> page,@Param("params") Map<String, Object> params); +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyFacilityInspectionMapper.xml b/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyFacilityInspectionMapper.xml new file mode 100644 index 0000000..49ab1f9 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Mapper/mybatis/SafetyFacilityInspectionMapper.xml @@ -0,0 +1,208 @@ +<?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.gk.hotwork.Mapper.SafetyFacilityInspectionMapper" > + <resultMap id="BaseResultMap" type="com.gk.hotwork.Domain.SafetyFacilityInspection" > + <!-- --> + <id column="id" property="id" jdbcType="BIGINT" /> + <result column="valid_flag" property="validFlag" jdbcType="TINYINT" /> + <result column="create_time" property="createTime" jdbcType="TIMESTAMP" /> + <result column="create_by" property="createBy" jdbcType="VARCHAR" /> + <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" /> + <result column="submit_date" property="submitDate" jdbcType="TIMESTAMP" /> + <result column="type" property="type" jdbcType="INTEGER" /> + <result column="project_name" property="projectName" jdbcType="VARCHAR" /> + <result column="progress" property="progress" jdbcType="INTEGER" /> + <result column="expert" property="expert" jdbcType="VARCHAR" /> + <result column="contact" property="contact" jdbcType="VARCHAR" /> + <result column="telephone" property="telephone" jdbcType="VARCHAR" /> + </resultMap> + <sql id="Base_Column_List" > + <!-- --> + id, valid_flag, create_time, create_by, update_time, submit_date, type, project_name, + progress, expert, contact, telephone + </sql> + <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" > + <!-- --> + select + <include refid="Base_Column_List" /> + from safety_facility_inspection + where id = #{id,jdbcType=BIGINT} + </select> + <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" > + <!-- --> + delete from safety_facility_inspection + where id = #{id,jdbcType=BIGINT} + </delete> + <insert id="insert" parameterType="com.gk.hotwork.Domain.SafetyFacilityInspection" > + <!-- --> + insert into safety_facility_inspection (id, valid_flag, create_time, + create_by, update_time, submit_date, + type, project_name, progress, + expert, contact, telephone + ) + values (#{id,jdbcType=BIGINT}, #{validFlag,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP}, + #{createBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{submitDate,jdbcType=TIMESTAMP}, + #{type,jdbcType=INTEGER}, #{projectName,jdbcType=VARCHAR}, #{progress,jdbcType=INTEGER}, + #{expert,jdbcType=VARCHAR}, #{contact,jdbcType=VARCHAR}, #{telephone,jdbcType=VARCHAR} + ) + </insert> + <insert id="insertSelective" parameterType="com.gk.hotwork.Domain.SafetyFacilityInspection" > + <!-- --> + insert into safety_facility_inspection + <trim prefix="(" suffix=")" suffixOverrides="," > + <if test="id != null" > + id, + </if> + <if test="validFlag != null" > + valid_flag, + </if> + <if test="createTime != null" > + create_time, + </if> + <if test="createBy != null" > + create_by, + </if> + <if test="updateTime != null" > + update_time, + </if> + <if test="submitDate != null" > + submit_date, + </if> + <if test="type != null" > + type, + </if> + <if test="projectName != null" > + project_name, + </if> + <if test="progress != null" > + progress, + </if> + <if test="expert != null" > + expert, + </if> + <if test="contact != null" > + contact, + </if> + <if test="telephone != null" > + telephone, + </if> + </trim> + <trim prefix="values (" suffix=")" suffixOverrides="," > + <if test="id != null" > + #{id,jdbcType=BIGINT}, + </if> + <if test="validFlag != null" > + #{validFlag,jdbcType=TINYINT}, + </if> + <if test="createTime != null" > + #{createTime,jdbcType=TIMESTAMP}, + </if> + <if test="createBy != null" > + #{createBy,jdbcType=VARCHAR}, + </if> + <if test="updateTime != null" > + #{updateTime,jdbcType=TIMESTAMP}, + </if> + <if test="submitDate != null" > + #{submitDate,jdbcType=TIMESTAMP}, + </if> + <if test="type != null" > + #{type,jdbcType=INTEGER}, + </if> + <if test="projectName != null" > + #{projectName,jdbcType=VARCHAR}, + </if> + <if test="progress != null" > + #{progress,jdbcType=INTEGER}, + </if> + <if test="expert != null" > + #{expert,jdbcType=VARCHAR}, + </if> + <if test="contact != null" > + #{contact,jdbcType=VARCHAR}, + </if> + <if test="telephone != null" > + #{telephone,jdbcType=VARCHAR}, + </if> + </trim> + </insert> + <update id="updateByPrimaryKeySelective" parameterType="com.gk.hotwork.Domain.SafetyFacilityInspection" > + <!-- --> + update safety_facility_inspection + <set > + <if test="validFlag != null" > + valid_flag = #{validFlag,jdbcType=TINYINT}, + </if> + <if test="createTime != null" > + create_time = #{createTime,jdbcType=TIMESTAMP}, + </if> + <if test="createBy != null" > + create_by = #{createBy,jdbcType=VARCHAR}, + </if> + <if test="updateTime != null" > + update_time = #{updateTime,jdbcType=TIMESTAMP}, + </if> + <if test="submitDate != null" > + submit_date = #{submitDate,jdbcType=TIMESTAMP}, + </if> + <if test="type != null" > + type = #{type,jdbcType=INTEGER}, + </if> + <if test="projectName != null" > + project_name = #{projectName,jdbcType=VARCHAR}, + </if> + <if test="progress != null" > + progress = #{progress,jdbcType=INTEGER}, + </if> + <if test="expert != null" > + expert = #{expert,jdbcType=VARCHAR}, + </if> + <if test="contact != null" > + contact = #{contact,jdbcType=VARCHAR}, + </if> + <if test="telephone != null" > + telephone = #{telephone,jdbcType=VARCHAR}, + </if> + </set> + where id = #{id,jdbcType=BIGINT} + </update> + <update id="updateByPrimaryKey" parameterType="com.gk.hotwork.Domain.SafetyFacilityInspection" > + <!-- --> + update safety_facility_inspection + set valid_flag = #{validFlag,jdbcType=TINYINT}, + create_time = #{createTime,jdbcType=TIMESTAMP}, + create_by = #{createBy,jdbcType=VARCHAR}, + update_time = #{updateTime,jdbcType=TIMESTAMP}, + submit_date = #{submitDate,jdbcType=TIMESTAMP}, + type = #{type,jdbcType=INTEGER}, + project_name = #{projectName,jdbcType=VARCHAR}, + progress = #{progress,jdbcType=INTEGER}, + expert = #{expert,jdbcType=VARCHAR}, + contact = #{contact,jdbcType=VARCHAR}, + telephone = #{telephone,jdbcType=VARCHAR} + where id = #{id,jdbcType=BIGINT} + </update> + + <select id="selectPages" resultMap="BaseResultMap"> + select + <include refid="Base_Column_List" /> + from safety_facility_inspection + where valid_flag = 1 + <if test="params.submitDateStartTime != null and params.submitDateStartTime != ''"> + and submit_date >=#{params.submitDateStartTime,jdbcType=VARCHAR} + </if> + <if test="params.submitDateEndTime != null and params.submitDateEndTime != ''"> + and submit_date <=#{params.submitDateEndTime,jdbcType=VARCHAR} + </if> + <if test="params.expert != null"> + and expert = #{params.expert,jdbcType=VARCHAR} + </if> + <if test="params.progress != null"> + and progress = #{params.progress,jdbcType=INTEGER} + </if> + ORDER BY + type, + create_time DESC + </select> + +</mapper> \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Service/SafetyFacilityInspectionService.java b/src/main/java/com/gk/hotwork/Service/SafetyFacilityInspectionService.java new file mode 100644 index 0000000..f054a39 --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/SafetyFacilityInspectionService.java @@ -0,0 +1,39 @@ +package com.gk.hotwork.Service; + +import java.util.Map; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.IService; +import com.gk.hotwork.Domain.SafetyFacilityInspection; +import com.gk.hotwork.Domain.UserInfo; + +public interface SafetyFacilityInspectionService extends IService<SafetyFacilityInspection> { + + /** + * @Description: 分页 + */ + IPage<SafetyFacilityInspection> selectPage(Page<SafetyFacilityInspection> page, Map<String, Object> filter, UserInfo user); + + /** + * @Description: 新增 + */ + void addOne(SafetyFacilityInspection param, UserInfo user); + + /** + * @Description: 修改 + */ + void modOne(SafetyFacilityInspection param, UserInfo user); + + /** + * @Description: 删除 + */ + void delOne(Long id, UserInfo user); + + /** + * @Description: 根据ID查询 + */ + SafetyFacilityInspection info(Long id, UserInfo user); + + +} \ No newline at end of file diff --git a/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetyFacilityInspectionImpl.java b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetyFacilityInspectionImpl.java new file mode 100644 index 0000000..4ad71bd --- /dev/null +++ b/src/main/java/com/gk/hotwork/Service/ServiceImpl/SafetyFacilityInspectionImpl.java @@ -0,0 +1,62 @@ +package com.gk.hotwork.Service.ServiceImpl; + + +import java.util.Date; +import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.gk.hotwork.Domain.SafetyFacilityInspection; +import com.gk.hotwork.Domain.UserInfo; +import com.gk.hotwork.Mapper.SafetyFacilityInspectionMapper; +import com.gk.hotwork.Service.SafetyFacilityInspectionService; + +@Service("SafetyFacilityInspectionService") +@Transactional +public class SafetyFacilityInspectionImpl extends ServiceImpl<SafetyFacilityInspectionMapper,SafetyFacilityInspection> implements SafetyFacilityInspectionService { + + + @Autowired + private SafetyFacilityInspectionMapper safetyFacilityInspectionMapper; + + @Override + public IPage<SafetyFacilityInspection> selectPage(Page<SafetyFacilityInspection> page, Map<String, Object> filter, UserInfo user) { + IPage<SafetyFacilityInspection> res = safetyFacilityInspectionMapper.selectPages(page,filter); + return res; + } + + @Override + public void addOne(SafetyFacilityInspection param, UserInfo user) { + Date date = new Date(); + String username = user.getRealname(); + param.setValidFlag(Byte.valueOf("1")); + param.setCreateBy(username); + param.setUpdateTime(date); + param.setCreateTime(date); + param.setSubmitDate(date); + param.setProgress(Integer.valueOf(0)); + this.save(param); + } + + @Override + public void modOne(SafetyFacilityInspection param, UserInfo user) { + // TODO Auto-generated method stub + + } + + @Override + public void delOne(Long id, UserInfo user) { + // TODO Auto-generated method stub + + } + + @Override + public SafetyFacilityInspection info(Long id, UserInfo user) { + // TODO Auto-generated method stub + return null; + } + +} diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 0d5847e..f574ba7 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -20,7 +20,7 @@ database: 14 host: 127.0.0.1 port: 6379 - password: root + password: akj78avauba789a jedis: pool: max-idle: 8 -- Gitblit v1.9.2