Forráskód Böngészése

Merge branch 'V0.0.1' of http://10.87.10.227:4000/jzyd_yyds/soc into V0.0.1

zhulu 2 éve
szülő
commit
e9c3f969fb

+ 95 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/controller/CoreResumptionDataProtectionController.java

@@ -0,0 +1,95 @@
+package com.xunmei.core.resumption.controller;
+
+import java.util.List;
+import java.io.IOException;
+import javax.servlet.http.HttpServletResponse;
+
+import com.xunmei.core.resumption.domain.CoreResumptionDataProtection;
+import com.xunmei.core.resumption.service.ICoreResumptionDataProtectionService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.xunmei.common.log.annotation.Log;
+import com.xunmei.common.log.enums.BusinessType;
+import com.xunmei.common.security.annotation.RequiresPermissions;
+import com.xunmei.common.core.web.controller.BaseController;
+import com.xunmei.common.core.web.domain.AjaxResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+/**
+ * 【请填写功能名称】Controller
+ *
+ * @author xunmei
+ * @date 2023-09-01
+ */
+@Api(tags = {"CoreResumptionDataProtection"})
+@RestController
+@RequestMapping("/protection")
+public class CoreResumptionDataProtectionController extends BaseController {
+    @Autowired
+    private ICoreResumptionDataProtectionService coreResumptionDataProtectionService;
+
+    /**
+     * 查询【请填写功能名称】列表
+     */
+    @ApiOperation(value = "查询CoreResumptionDataProtection列表")
+    @RequiresPermissions("system:protection:list")
+    @GetMapping("/list")
+    public TableDataInfo<CoreResumptionDataProtection> list(CoreResumptionDataProtection coreResumptionDataProtection) {
+
+        return coreResumptionDataProtectionService.selectPage(coreResumptionDataProtection);
+    }
+
+
+    /**
+     * 获取【请填写功能名称】详细信息
+     */
+    @ApiOperation(value = "获取CoreResumptionDataProtection详细信息")
+    @RequiresPermissions("system:protection:query")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id) {
+        return success(coreResumptionDataProtectionService.selectCoreResumptionDataProtectionById(id));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     */
+    @ApiOperation(value = "新增CoreResumptionDataProtection")
+    @RequiresPermissions("system:protection:add")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody CoreResumptionDataProtection coreResumptionDataProtection) {
+        return toAjax(coreResumptionDataProtectionService.insertCoreResumptionDataProtection(coreResumptionDataProtection));
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     */
+    @ApiOperation(value = "修改CoreResumptionDataProtection")
+    @RequiresPermissions("system:protection:edit")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody CoreResumptionDataProtection coreResumptionDataProtection) {
+        return toAjax(coreResumptionDataProtectionService.updateCoreResumptionDataProtection(coreResumptionDataProtection));
+    }
+
+    /**
+     * 删除【请填写功能名称】
+     */
+    @ApiOperation(value = "删除CoreResumptionDataProtection")
+    @RequiresPermissions("system:protection:remove")
+    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids) {
+        return toAjax(coreResumptionDataProtectionService.deleteCoreResumptionDataProtectionByIds(ids));
+    }
+}

+ 92 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/domain/CoreResumptionDataProtection.java

@@ -0,0 +1,92 @@
+package com.xunmei.core.resumption.domain;
+
+import java.util.Date;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+import com.xunmei.common.core.web.domain.BaseEntity;
+
+/**
+ * 【请填写功能名称】对象 core_resumption_data_protection
+ *
+ * @author xunmei
+ * @date 2023-09-01
+ */
+@Data
+@EqualsAndHashCode(callSuper = false)
+@Accessors(chain = true)
+@TableName("core_resumption_data_protection")
+@ApiModel(value = "CoreResumptionDataProtection对象", description = "【请填写功能名称】")
+public class CoreResumptionDataProtection extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * $column.columnComment
+     */
+    private Long id;
+
+    /**
+     * core_resumption_data表id
+     */
+    @ApiModelProperty(value = "core_resumption_data表id")
+    private Long resumptionDataId;
+
+    /**
+     * 履职任务表id
+     */
+    @ApiModelProperty(value = "履职任务表id")
+    private Long resumptionId;
+
+    /**
+     * 防区id
+     */
+    @ApiModelProperty(value = "防区id")
+    private Long protectionId;
+
+    /**
+     * 防区状态
+     */
+    @ApiModelProperty(value = "防区状态")
+    private String protectionStatus;
+
+    /**
+     * 防区状态变化的时间
+     */
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @ApiModelProperty(value = "防区状态变化的时间")
+    private Date protectionTime;
+
+
+    @Override
+    public String toString() {
+        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
+
+
+                .append("id", getId())
+
+
+                .append("resumptionDataId", getResumptionDataId())
+
+
+                .append("resumptionId", getResumptionId())
+
+
+                .append("protectionId", getProtectionId())
+
+
+                .append("protectionStatus", getProtectionStatus())
+
+
+                .append("protectionTime", getProtectionTime())
+                .toString();
+    }
+}

+ 62 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/mapper/CoreResumptionDataProtectionMapper.java

@@ -0,0 +1,62 @@
+package com.xunmei.core.resumption.mapper;
+
+import java.util.List;
+
+import com.xunmei.core.resumption.domain.CoreResumptionDataProtection;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * 【请填写功能名称】Mapper接口
+ *
+ * @author xunmei
+ * @date 2023-09-01
+ */
+public interface CoreResumptionDataProtectionMapper extends BaseMapper<CoreResumptionDataProtection> {
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    CoreResumptionDataProtection selectCoreResumptionDataProtectionById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param coreResumptionDataProtection 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    List<CoreResumptionDataProtection> selectCoreResumptionDataProtectionList(CoreResumptionDataProtection coreResumptionDataProtection);
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param coreResumptionDataProtection 【请填写功能名称】
+     * @return 结果
+     */
+    int insertCoreResumptionDataProtection(CoreResumptionDataProtection coreResumptionDataProtection);
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param coreResumptionDataProtection 【请填写功能名称】
+     * @return 结果
+     */
+    int updateCoreResumptionDataProtection(CoreResumptionDataProtection coreResumptionDataProtection);
+
+    /**
+     * 删除【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    int deleteCoreResumptionDataProtectionById(Long id);
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteCoreResumptionDataProtectionByIds(Long[] ids);
+}

+ 72 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/ICoreResumptionDataProtectionService.java

@@ -0,0 +1,72 @@
+package com.xunmei.core.resumption.service;
+
+import java.util.List;
+
+import com.xunmei.core.resumption.domain.CoreResumptionDataProtection;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+/**
+ * 【请填写功能名称】Service接口
+ *
+ * @author xunmei
+ * @date 2023-09-01
+ */
+public interface ICoreResumptionDataProtectionService extends IService<CoreResumptionDataProtection> {
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+     CoreResumptionDataProtection selectCoreResumptionDataProtectionById(Long id);
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param coreResumptionDataProtection 【请填写功能名称】
+     * @return 【请填写功能名称】集合
+     */
+    List<CoreResumptionDataProtection> selectCoreResumptionDataProtectionList(CoreResumptionDataProtection coreResumptionDataProtection);
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param coreResumptionDataProtection 【请填写功能名称】
+     * @return 结果
+     */
+    int insertCoreResumptionDataProtection(CoreResumptionDataProtection coreResumptionDataProtection);
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param coreResumptionDataProtection 【请填写功能名称】
+     * @return 结果
+     */
+    int updateCoreResumptionDataProtection(CoreResumptionDataProtection coreResumptionDataProtection);
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的【请填写功能名称】主键集合
+     * @return 结果
+     */
+    int deleteCoreResumptionDataProtectionByIds(Long[] ids);
+
+    /**
+     * 删除【请填写功能名称】信息
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    int deleteCoreResumptionDataProtectionById(Long id);
+
+    /**
+     * 查询【请填写功能名称】分页数据
+     *
+     * @param coreResumptionDataProtection 查询条件对象
+     * @return Page
+     */
+    TableDataInfo<CoreResumptionDataProtection> selectPage(CoreResumptionDataProtection coreResumptionDataProtection);
+}

+ 131 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/service/impl/CoreResumptionDataProtectionServiceImpl.java

@@ -0,0 +1,131 @@
+package com.xunmei.core.resumption.service.impl;
+
+import java.util.List;
+
+import com.xunmei.core.resumption.domain.CoreResumptionDataProtection;
+import com.xunmei.core.resumption.mapper.CoreResumptionDataProtectionMapper;
+import com.xunmei.core.resumption.service.ICoreResumptionDataProtectionService;
+import com.xunmei.system.api.RemoteOrgService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.Arrays;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.xunmei.common.core.web.page.TableDataInfo;
+
+/**
+ * 【请填写功能名称】Service业务层处理
+ *
+ * @author xunmei
+ * @date 2023-09-01
+ */
+@Service
+public class CoreResumptionDataProtectionServiceImpl extends ServiceImpl<CoreResumptionDataProtectionMapper, CoreResumptionDataProtection> implements ICoreResumptionDataProtectionService {
+    @Autowired
+    private CoreResumptionDataProtectionMapper coreResumptionDataProtectionMapper;
+//    @Autowired
+//    private RemoteOrgService orgService;
+
+    @Override
+    public TableDataInfo<CoreResumptionDataProtection> selectPage(CoreResumptionDataProtection coreResumptionDataProtection) {
+        //未删除
+//        coreResumptionDataProtection.setDeleted(0L);
+        Page<CoreResumptionDataProtection> page;
+        //分页
+        if (coreResumptionDataProtection.getPageNum() != null && coreResumptionDataProtection.getPageSize() != null) {
+            page = new Page<>(coreResumptionDataProtection.getPageNum(), coreResumptionDataProtection.getPageSize());
+        } else {
+            page = new Page<>();
+        }
+        //查询条件
+        QueryWrapper<CoreResumptionDataProtection> query = new QueryWrapper<>(coreResumptionDataProtection);
+        //下穿
+//        if (coreResumptionDataProtection.getCheckSub()){
+//            List<Long> ids = orgService.selectCheckSubOrgIdList(coreResumptionDataProtection.getOrgId());
+//            //清空前端传递的org_id
+////            coreResumptionDataProtection.setOrgId(null);
+//            //添加in条件
+//            query.in("org_id",ids);
+//        }
+        //时间范围查询
+        if (coreResumptionDataProtection.getParams().get("beginTime") != null && coreResumptionDataProtection.getParams().get("endTime") != null) {
+            query.between("create_time", coreResumptionDataProtection.getParams().get("beginTime"), coreResumptionDataProtection.getParams().get("endTime"));
+        }
+        //获取数据
+        page = coreResumptionDataProtectionMapper.selectPage(page, query);
+        //抓换为TableDataInfo适配前端
+        return TableDataInfo.build(page);
+
+
+    }
+
+
+    /**
+     * 查询【请填写功能名称】
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public CoreResumptionDataProtection selectCoreResumptionDataProtectionById(Long id) {
+        return coreResumptionDataProtectionMapper.selectById(id);
+    }
+
+    /**
+     * 查询【请填写功能名称】列表
+     *
+     * @param coreResumptionDataProtection 【请填写功能名称】
+     * @return 【请填写功能名称】
+     */
+    @Override
+    public List<CoreResumptionDataProtection> selectCoreResumptionDataProtectionList(CoreResumptionDataProtection coreResumptionDataProtection) {
+        return coreResumptionDataProtectionMapper.selectList(new QueryWrapper<>(coreResumptionDataProtection));
+    }
+
+    /**
+     * 新增【请填写功能名称】
+     *
+     * @param coreResumptionDataProtection 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int insertCoreResumptionDataProtection(CoreResumptionDataProtection coreResumptionDataProtection) {
+        return coreResumptionDataProtectionMapper.insert(coreResumptionDataProtection);
+    }
+
+    /**
+     * 修改【请填写功能名称】
+     *
+     * @param coreResumptionDataProtection 【请填写功能名称】
+     * @return 结果
+     */
+    @Override
+    public int updateCoreResumptionDataProtection(CoreResumptionDataProtection coreResumptionDataProtection) {
+        return coreResumptionDataProtectionMapper.updateById(coreResumptionDataProtection);
+    }
+
+    /**
+     * 批量删除【请填写功能名称】
+     *
+     * @param ids 需要删除的【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreResumptionDataProtectionByIds(Long[] ids) {
+        return coreResumptionDataProtectionMapper.deleteBatchIds(Arrays.asList((ids)));
+    }
+
+    /**
+     * 删除【请填写功能名称】信息
+     *
+     * @param id 【请填写功能名称】主键
+     * @return 结果
+     */
+    @Override
+    public int deleteCoreResumptionDataProtectionById(Long id) {
+        return coreResumptionDataProtectionMapper.deleteById(id);
+    }
+}

+ 2 - 0
soc-modules/soc-modules-core/src/main/java/com/xunmei/core/resumption/vo/ResumptionNfcVo.java

@@ -14,10 +14,12 @@ import lombok.NoArgsConstructor;
 public class ResumptionNfcVo {
     @JsonSerialize(using = ToStringSerializer.class)
     private Long nfcdataid;
+    @JsonSerialize(using = ToStringSerializer.class)
     private Long checkId;
     private String checkName;
     private String nfccdoe;
     private int status = 0;
+    @JsonSerialize(using = ToStringSerializer.class)
     private Long pointId;
     //private Long taskDataId;
     @JsonSerialize(using = ToStringSerializer.class)

+ 114 - 0
soc-modules/soc-modules-core/src/main/resources/mapper/resumption/CoreResumptionDataProtectionMapper.xml

@@ -0,0 +1,114 @@
+<?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.xunmei.core.resumption.mapper.CoreResumptionDataProtectionMapper">
+
+    <resultMap type="com.xunmei.core.resumption.domain.CoreResumptionDataProtection" id="CoreResumptionDataProtectionResult">
+                <result property="id" column="id"/>
+                <result property="resumptionDataId" column="resumption_data_id"/>
+                <result property="resumptionId" column="resumption_id"/>
+                <result property="protectionId" column="protection_id"/>
+                <result property="protectionStatus" column="protection_status"/>
+                <result property="protectionTime" column="protection_time"/>
+    </resultMap>
+
+    <sql id="selectCoreResumptionDataProtectionVo">
+        select id, resumption_data_id, resumption_id, protection_id, protection_status, protection_time
+        from core_resumption_data_protection
+    </sql>
+
+    <select id="selectCoreResumptionDataProtectionList" parameterType="com.xunmei.core.resumption.domain.CoreResumptionDataProtection"
+            resultMap="CoreResumptionDataProtectionResult">
+        <include refid="selectCoreResumptionDataProtectionVo"/>
+        <where>
+                        <if test="resumptionDataId != null ">
+                            and resumption_data_id = #{resumptionDataId}
+                        </if>
+                        <if test="resumptionId != null ">
+                            and resumption_id = #{resumptionId}
+                        </if>
+                        <if test="protectionId != null ">
+                            and protection_id = #{protectionId}
+                        </if>
+                        <if test="protectionStatus != null  and protectionStatus != ''">
+                            and protection_status = #{protectionStatus}
+                        </if>
+                        <if test="protectionTime != null ">
+                            and protection_time = #{protectionTime}
+                        </if>
+        </where>
+    </select>
+
+    <select id="selectCoreResumptionDataProtectionById" parameterType="Long"
+            resultMap="CoreResumptionDataProtectionResult">
+            <include refid="selectCoreResumptionDataProtectionVo"/>
+            where id = #{id}
+    </select>
+
+    <insert id="insertCoreResumptionDataProtection" parameterType="com.xunmei.core.resumption.domain.CoreResumptionDataProtection">
+        insert into core_resumption_data_protection
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+                    <if test="id != null">id,
+                    </if>
+                    <if test="resumptionDataId != null">resumption_data_id,
+                    </if>
+                    <if test="resumptionId != null">resumption_id,
+                    </if>
+                    <if test="protectionId != null">protection_id,
+                    </if>
+                    <if test="protectionStatus != null">protection_status,
+                    </if>
+                    <if test="protectionTime != null">protection_time,
+                    </if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+                    <if test="id != null">#{id},
+                    </if>
+                    <if test="resumptionDataId != null">#{resumptionDataId},
+                    </if>
+                    <if test="resumptionId != null">#{resumptionId},
+                    </if>
+                    <if test="protectionId != null">#{protectionId},
+                    </if>
+                    <if test="protectionStatus != null">#{protectionStatus},
+                    </if>
+                    <if test="protectionTime != null">#{protectionTime},
+                    </if>
+        </trim>
+    </insert>
+
+    <update id="updateCoreResumptionDataProtection" parameterType="com.xunmei.core.resumption.domain.CoreResumptionDataProtection">
+        update core_resumption_data_protection
+        <trim prefix="SET" suffixOverrides=",">
+                    <if test="resumptionDataId != null">resumption_data_id =
+                        #{resumptionDataId},
+                    </if>
+                    <if test="resumptionId != null">resumption_id =
+                        #{resumptionId},
+                    </if>
+                    <if test="protectionId != null">protection_id =
+                        #{protectionId},
+                    </if>
+                    <if test="protectionStatus != null">protection_status =
+                        #{protectionStatus},
+                    </if>
+                    <if test="protectionTime != null">protection_time =
+                        #{protectionTime},
+                    </if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteCoreResumptionDataProtectionById" parameterType="Long">
+        delete
+        from core_resumption_data_protection where id = #{id}
+    </delete>
+
+    <delete id="deleteCoreResumptionDataProtectionByIds" parameterType="String">
+        delete from core_resumption_data_protection where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>