Ver Fonte

Merge branch 'master' of http://47.100.37.243:10080/ZHOU/yunsu

Reiskuchen há 5 anos atrás
pai
commit
91c1115a7d

+ 1 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/controller/MouldFileController.java

@@ -30,7 +30,7 @@ import javax.servlet.http.HttpServletResponse;
  * @since 2019-08-07
  */
 @RestController
-@RequestMapping("/mould-file")
+@RequestMapping("/mouldfile")
 public class MouldFileController {
 
     @Value("${upload.path}")

+ 21 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/controller/MouldOperationDynamicsController.java

@@ -0,0 +1,21 @@
+package com.hssx.cloudmodel.controller;
+
+
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * <p>
+ *  前端控制器
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-08-08
+ */
+@RestController
+@RequestMapping("/mould-operation-dynamics")
+public class MouldOperationDynamicsController {
+
+}
+

+ 19 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/controller/ProjectOperationDynamicsController.java

@@ -1,6 +1,8 @@
 package com.hssx.cloudmodel.controller;
 
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.hssx.cloudmodel.entity.ProjectOperationDynamics;
 import com.hssx.cloudmodel.service.ProjectOperationDynamicsService;
 import com.hssx.cloudmodel.util.HttpRespMsg;
 import io.swagger.annotations.ApiOperation;
@@ -9,6 +11,8 @@ import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.ResponseBody;
 
+import java.util.List;
+
 
 /**
  * <p>
@@ -22,7 +26,21 @@ import org.springframework.web.bind.annotation.ResponseBody;
 @RequestMapping("/projectoperationdynamics")
 public class ProjectOperationDynamicsController {
     @Autowired
-    private ProjectOperationDynamicsService projectOperationDynamicsService;
+    private ProjectOperationDynamicsService dynamicsService;
 
+    /**
+     *
+     * 项目操作记录列表
+     * projectId 项目id
+     * @return
+     */
+    @ApiOperation("项目操作记录列表")
+    @RequestMapping("/list")
+    @ResponseBody
+    public HttpRespMsg list(ProjectOperationDynamics projectOperationDynamics){
+        HttpRespMsg msg = new HttpRespMsg();
+        msg.data = dynamicsService.list(new QueryWrapper<ProjectOperationDynamics>().eq("project_id",projectOperationDynamics.getProjectId()).orderByDesc("id"));
+        return msg;
+    }
 }
 

+ 170 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/entity/MouldOperationDynamics.java

@@ -0,0 +1,170 @@
+package com.hssx.cloudmodel.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import com.baomidou.mybatisplus.annotation.TableId;
+import java.time.LocalDateTime;
+import com.baomidou.mybatisplus.annotation.TableField;
+import java.io.Serializable;
+
+/**
+ * <p>
+ * 
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-08-08
+ */
+@TableName("tb_mould_operation_dynamics")
+public class MouldOperationDynamics extends Model<MouldOperationDynamics> {
+
+    private static final long serialVersionUID=1L;
+
+    /**
+     * 模具文档操作记录表主键
+     */
+    @TableId(value = "id", type = IdType.AUTO)
+    private Integer id;
+
+    /**
+     * 文件id
+     */
+    @TableField("file_id")
+    private Integer fileId;
+
+    /**
+     * 下载者id
+     */
+    @TableField("operator_id")
+    private Integer operatorId;
+
+    /**
+     * 下载者姓名
+     */
+    @TableField("operator_name")
+    private String operatorName;
+
+    /**
+     * 下载的时间
+     */
+    @TableField("indate")
+    private LocalDateTime indate;
+
+    /**
+     * 文件名
+     */
+    @TableField("file_name")
+    private String fileName;
+
+    /**
+     * 所属类型
+     */
+    @TableField("belong_type")
+    private Integer belongType;
+
+    /**
+     * 内容
+     */
+    @TableField("content")
+    private String content;
+
+    /**
+     * 模具id
+     */
+    @TableField("mould_id")
+    private Integer mouldId;
+
+
+    public Integer getId() {
+        return id;
+    }
+
+    public void setId(Integer id) {
+        this.id = id;
+    }
+
+    public Integer getFileId() {
+        return fileId;
+    }
+
+    public void setFileId(Integer fileId) {
+        this.fileId = fileId;
+    }
+
+    public Integer getOperatorId() {
+        return operatorId;
+    }
+
+    public void setOperatorId(Integer operatorId) {
+        this.operatorId = operatorId;
+    }
+
+    public String getOperatorName() {
+        return operatorName;
+    }
+
+    public void setOperatorName(String operatorName) {
+        this.operatorName = operatorName;
+    }
+
+    public LocalDateTime getIndate() {
+        return indate;
+    }
+
+    public void setIndate(LocalDateTime indate) {
+        this.indate = indate;
+    }
+
+    public String getFileName() {
+        return fileName;
+    }
+
+    public void setFileName(String fileName) {
+        this.fileName = fileName;
+    }
+
+    public Integer getBelongType() {
+        return belongType;
+    }
+
+    public void setBelongType(Integer belongType) {
+        this.belongType = belongType;
+    }
+
+    public String getContent() {
+        return content;
+    }
+
+    public void setContent(String content) {
+        this.content = content;
+    }
+
+    public Integer getMouldId() {
+        return mouldId;
+    }
+
+    public void setMouldId(Integer mouldId) {
+        this.mouldId = mouldId;
+    }
+
+    @Override
+    protected Serializable pkVal() {
+        return this.id;
+    }
+
+    @Override
+    public String toString() {
+        return "MouldOperationDynamics{" +
+        "id=" + id +
+        ", fileId=" + fileId +
+        ", operatorId=" + operatorId +
+        ", operatorName=" + operatorName +
+        ", indate=" + indate +
+        ", fileName=" + fileName +
+        ", belongType=" + belongType +
+        ", content=" + content +
+        ", mouldId=" + mouldId +
+        "}";
+    }
+}

+ 16 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/mapper/MouldOperationDynamicsMapper.java

@@ -0,0 +1,16 @@
+package com.hssx.cloudmodel.mapper;
+
+import com.hssx.cloudmodel.entity.MouldOperationDynamics;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * <p>
+ *  Mapper 接口
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-08-08
+ */
+public interface MouldOperationDynamicsMapper extends BaseMapper<MouldOperationDynamics> {
+
+}

+ 16 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/service/MouldOperationDynamicsService.java

@@ -0,0 +1,16 @@
+package com.hssx.cloudmodel.service;
+
+import com.hssx.cloudmodel.entity.MouldOperationDynamics;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * <p>
+ *  服务类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-08-08
+ */
+public interface MouldOperationDynamicsService extends IService<MouldOperationDynamics> {
+
+}

+ 9 - 9
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldFileServiceImpl.java

@@ -28,7 +28,7 @@ import java.util.UUID;
 
 /**
  * <p>
- *  服务实现类
+ * 服务实现类
  * </p>
  *
  * @author 吴涛涛
@@ -46,10 +46,10 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
     ProjectOperationDynamicsMapper projectOperationDynamicsMapper;
 
     @Override
-    public HttpRespMsg addFile(UserVO userVO,Integer blongType, MultipartFile file, String path) {
+    public HttpRespMsg addFile(UserVO userVO, Integer blongType, MultipartFile file, String path) {
         HttpRespMsg msg = new HttpRespMsg();
         User user = userMapper.selectOne(new QueryWrapper<User>().eq("head_imgurl", userVO.getToken()));
-        if(user != null){
+        if (user != null) {
             if (file != null && !file.isEmpty()) {
                 MouldFile projectFile = new MouldFile();
                 projectFile.setUplodtorId(user.getId());
@@ -72,7 +72,7 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
                     String sufix = fileName.substring(pos);
                     fileName = rand + sufix;
                     projectFile.setFileType(sufix);//文件后缀
-                    projectFile.setFileUrl("/upload/"+fileName);
+                    projectFile.setFileUrl("/upload/" + fileName);
                     projectFile.setBlongType(0);
                     if (user.getSubordinateType() == 0) {
                         //上传人为资产方,自动审核通过
@@ -107,7 +107,7 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
                 }
                 msg.data = projectFile;
             }
-        }else{
+        } else {
             msg.setError("当前用户不存在或者未登录");
         }
         return msg;
@@ -120,7 +120,7 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
         MouldFile mf = new MouldFile();
         mf.setId(mouldFileId);
         MouldFile oldData = mouldFileMapper.selectById(mouldFileId);
-        if(user != null){
+        if (user != null) {
             if (user.getSubordinateType() == 0) {
                 //资产方
                 if (isPass == 1) {
@@ -158,14 +158,14 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
     public HttpRespMsg dowloadFile(MouldFile projectFile, String token) {
         HttpRespMsg msg = new HttpRespMsg();
         User user = userMapper.selectOne(new QueryWrapper<User>().eq("head_imgurl", token));
-        return null;
+        return msg;
     }
 
     @Override
     public HttpRespMsg getAllFileList(int mouldId, UserVO userVO) {
         List<HashMap> dataList = new ArrayList<HashMap>();
         int maxBlongType = 5;
-        for (int i=0;i<=maxBlongType; i++) {
+        for (int i = 0; i <= maxBlongType; i++) {
             HashMap<String, Object> data = new HashMap<>();
             data.put("blongType", i);
             List<MouldFile> list = mouldFileMapper.selectList(new QueryWrapper<MouldFile>().eq("model_id", mouldId).eq("blong_type", i).orderByDesc("id"));
@@ -178,7 +178,7 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
     }
 
     @Override
-    public HttpRespMsg getFileList(int mouldId,Integer blongType,  UserVO userVO) {
+    public HttpRespMsg getFileList(int mouldId, Integer blongType, UserVO userVO) {
         HttpRespMsg msg = new HttpRespMsg();
         User user = userMapper.selectOne(new QueryWrapper<User>().eq("head_imgurl", userVO.getToken()));
         List<MouldFile> list = mouldFileMapper.selectList(new QueryWrapper<MouldFile>().eq("model_id", mouldId).eq("blong_type", blongType).orderByDesc("id"));

+ 20 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/service/impl/MouldOperationDynamicsServiceImpl.java

@@ -0,0 +1,20 @@
+package com.hssx.cloudmodel.service.impl;
+
+import com.hssx.cloudmodel.entity.MouldOperationDynamics;
+import com.hssx.cloudmodel.mapper.MouldOperationDynamicsMapper;
+import com.hssx.cloudmodel.service.MouldOperationDynamicsService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+
+/**
+ * <p>
+ *  服务实现类
+ * </p>
+ *
+ * @author 吴涛涛
+ * @since 2019-08-08
+ */
+@Service
+public class MouldOperationDynamicsServiceImpl extends ServiceImpl<MouldOperationDynamicsMapper, MouldOperationDynamics> implements MouldOperationDynamicsService {
+
+}

+ 1 - 1
cloud-model/src/main/java/com/hssx/cloudmodel/util/CodeGenerator.java

@@ -204,7 +204,7 @@ public class CodeGenerator {
         //若想要生成的实体类继承某个Controller,则可打开下面注释。写上需要继承的Controller的位置即可
 //        strategy.setSuperControllerClass("com.baomidou.ant.common.BaseController");
         //此处user是表名,多个英文逗号分割
-        strategy.setInclude("tb_mould_file");
+        strategy.setInclude("tb_mould_operation_dynamics");
 //        strategy.setExclude();//数据库表全生成
 //        strategy.setInclude(scanner("user").split(","));//表名,多个英文逗号分割
         strategy.setControllerMappingHyphenStyle(true);

+ 23 - 0
cloud-model/src/main/resources/mapper/MouldOperationDynamicsMapper.xml

@@ -0,0 +1,23 @@
+<?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.hssx.cloudmodel.mapper.MouldOperationDynamicsMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.hssx.cloudmodel.entity.MouldOperationDynamics">
+        <id column="id" property="id" />
+        <result column="file_id" property="fileId" />
+        <result column="operator_id" property="operatorId" />
+        <result column="operator_name" property="operatorName" />
+        <result column="indate" property="indate" />
+        <result column="file_name" property="fileName" />
+        <result column="belong_type" property="belongType" />
+        <result column="content" property="content" />
+        <result column="mould_id" property="mouldId" />
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, file_id, operator_id, operator_name, indate, file_name, belong_type, content, mould_id
+    </sql>
+
+</mapper>