gaodm 5 anni fa
parent
commit
d43841eb69

+ 155 - 0
zzcx-service/src/main/java/com/diagbot/entity/OptInfo.java

@@ -0,0 +1,155 @@
+package com.diagbot.entity;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * <p>
+ * 操作信息
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-02
+ */
+@TableName("zzcx_opt_info")
+public class OptInfo implements Serializable {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 是否删除,N:未删除,Y:删除
+     */
+    private String isDeleted;
+
+    /**
+     * 记录创建时间
+     */
+    private Date gmtCreate;
+
+    /**
+     * 记录修改时间,如果时间是1970年则表示纪录未修改
+     */
+    private Date gmtModified;
+
+    /**
+     * 创建人,0表示无创建人值
+     */
+    private String creator;
+
+    /**
+     * 修改人,如果为0则表示纪录未修改
+     */
+    private String modifier;
+
+    /**
+     * 访问者的IP
+     */
+    private String ip;
+
+    /**
+     * 操作类型:1 开始,2 结束
+     */
+    private String optType;
+
+    /**
+     * 备注
+     */
+    private String remark;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getIsDeleted() {
+        return isDeleted;
+    }
+
+    public void setIsDeleted(String isDeleted) {
+        this.isDeleted = isDeleted;
+    }
+
+    public Date getGmtCreate() {
+        return gmtCreate;
+    }
+
+    public void setGmtCreate(Date gmtCreate) {
+        this.gmtCreate = gmtCreate;
+    }
+
+    public Date getGmtModified() {
+        return gmtModified;
+    }
+
+    public void setGmtModified(Date gmtModified) {
+        this.gmtModified = gmtModified;
+    }
+
+    public String getCreator() {
+        return creator;
+    }
+
+    public void setCreator(String creator) {
+        this.creator = creator;
+    }
+
+    public String getModifier() {
+        return modifier;
+    }
+
+    public void setModifier(String modifier) {
+        this.modifier = modifier;
+    }
+
+    public String getIp() {
+        return ip;
+    }
+
+    public void setIp(String ip) {
+        this.ip = ip;
+    }
+
+    public String getOptType() {
+        return optType;
+    }
+
+    public void setOptType(String optType) {
+        this.optType = optType;
+    }
+
+    public String getRemark() {
+        return remark;
+    }
+
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+    @Override
+    public String toString() {
+        return "OptInfo{" +
+                "id=" + id +
+                ", isDeleted=" + isDeleted +
+                ", gmtCreate=" + gmtCreate +
+                ", gmtModified=" + gmtModified +
+                ", creator=" + creator +
+                ", modifier=" + modifier +
+                ", ip=" + ip +
+                ", optType=" + optType +
+                ", remark=" + remark +
+                "}";
+    }
+}

+ 29 - 0
zzcx-service/src/main/java/com/diagbot/facade/OptInfoFacade.java

@@ -0,0 +1,29 @@
+package com.diagbot.facade;
+
+import com.diagbot.entity.OptInfo;
+import com.diagbot.service.impl.OptInfoServiceImpl;
+import com.diagbot.util.DateUtil;
+import com.diagbot.util.HttpUtils;
+import org.springframework.stereotype.Component;
+
+import java.util.Date;
+
+/**
+ * @Description:
+ * @author: gaodm
+ * @time: 2020/2/2 15:52
+ */
+@Component
+public class OptInfoFacade extends OptInfoServiceImpl {
+
+    public Boolean saveOptOnfo(String optType){
+        OptInfo optInfo = new OptInfo();
+        Date now = DateUtil.now();
+        optInfo.setGmtModified(now);
+        optInfo.setGmtCreate(now);
+        optInfo.setIp(HttpUtils.getIpAddress());
+        optInfo.setOptType(optType);
+        Boolean res = this.save(optInfo);
+        return res;
+    }
+}

+ 16 - 0
zzcx-service/src/main/java/com/diagbot/mapper/OptInfoMapper.java

@@ -0,0 +1,16 @@
+package com.diagbot.mapper;
+
+import com.diagbot.entity.OptInfo;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ * 操作信息 Mapper 接口
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-02
+ */
+public interface OptInfoMapper extends BaseMapper<OptInfo> {
+
+}

+ 16 - 0
zzcx-service/src/main/java/com/diagbot/service/OptInfoService.java

@@ -0,0 +1,16 @@
+package com.diagbot.service;
+
+import com.diagbot.entity.OptInfo;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ * 操作信息 服务类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-02
+ */
+public interface OptInfoService extends IService<OptInfo> {
+
+}

+ 20 - 0
zzcx-service/src/main/java/com/diagbot/service/impl/OptInfoServiceImpl.java

@@ -0,0 +1,20 @@
+package com.diagbot.service.impl;
+
+import com.diagbot.entity.OptInfo;
+import com.diagbot.mapper.OptInfoMapper;
+import com.diagbot.service.OptInfoService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ * 操作信息 服务实现类
+ * </p>
+ *
+ * @author zhoutg
+ * @since 2020-02-02
+ */
+@Service
+public class OptInfoServiceImpl extends ServiceImpl<OptInfoMapper, OptInfo> implements OptInfoService {
+
+}

+ 37 - 0
zzcx-service/src/main/java/com/diagbot/web/OptInfoController.java

@@ -0,0 +1,37 @@
+package com.diagbot.web;
+
+import com.diagbot.annotation.SysLogger;
+import com.diagbot.dto.RespDTO;
+import com.diagbot.facade.OptInfoFacade;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ * 操作信息 前端控制器
+ * </p>
+ *
+ * @author gaodm
+ * @since 2020-02-02
+ */
+@RestController
+@Api(value = "操作记录", tags = { "操作记录API" })
+@SuppressWarnings("unchecked")
+@RequestMapping("/optInfo")
+public class OptInfoController {
+    @Autowired
+    private OptInfoFacade optInfoFacade;
+
+    @ApiOperation(value = "操作记录保存[by:gaodm]")
+    @PostMapping("/saveOptInfo")
+    @SysLogger("saveOptInfo")
+    @Transactional
+    public RespDTO<Boolean> saveOptOnfo() {
+        return RespDTO.onSuc(optInfoFacade.saveOptOnfo("1"));
+    }
+}

+ 18 - 0
zzcx-service/src/main/resources/mapper/OptInfoMapper.xml

@@ -0,0 +1,18 @@
+<?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.diagbot.mapper.OptInfoMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.diagbot.entity.OptInfo">
+        <id column="id" property="id" />
+        <result column="is_deleted" property="isDeleted" />
+        <result column="gmt_create" property="gmtCreate" />
+        <result column="gmt_modified" property="gmtModified" />
+        <result column="creator" property="creator" />
+        <result column="modifier" property="modifier" />
+        <result column="ip" property="ip" />
+        <result column="opt_type" property="optType" />
+        <result column="remark" property="remark" />
+    </resultMap>
+
+</mapper>

+ 1 - 1
zzcx-service/src/test/java/com/diagbot/CodeGeneration.java

@@ -56,7 +56,7 @@ public class CodeGeneration {
         StrategyConfig strategy = new StrategyConfig();
         strategy.setTablePrefix(new String[] { "zzcx_" });// 此处可以修改为您的表前缀
         strategy.setNaming(NamingStrategy.underline_to_camel);// 表名生成策略
-        strategy.setInclude(new String[] { "zzcx_inquiry_info","zzcx_inquiry_detail" }); // 需要生成的表
+        strategy.setInclude(new String[] { "zzcx_opt_info" }); // 需要生成的表
 
         strategy.setSuperServiceClass(null);
         strategy.setSuperServiceImplClass(null);