Ver código fonte

增加模具图档的验收功能

seyason 4 anos atrás
pai
commit
59f0123816

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

@@ -234,5 +234,18 @@ public class MouldFileController {
         }
         return msg;
     }
+
+    @ApiOperation("模具圖檔驗收通過")
+    @RequestMapping(value = "/accept")
+    @ResponseBody
+    public HttpRespMsg accept(Integer fileId, HttpServletResponse response) {
+        HttpRespMsg msg = new HttpRespMsg();
+        try {
+            msg = mouldFileService.accept(fileId);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return msg;
+    }
 }
 

+ 18 - 6
cloud-model/src/main/java/com/hssx/cloudmodel/entity/MouldFile.java

@@ -6,8 +6,6 @@ import com.baomidou.mybatisplus.extension.activerecord.Model;
 import com.baomidou.mybatisplus.annotation.TableId;
 import java.time.LocalDateTime;
 import com.baomidou.mybatisplus.annotation.TableField;
-import com.fasterxml.jackson.annotation.JsonFormat;
-
 import java.io.Serializable;
 
 /**
@@ -15,8 +13,8 @@ import java.io.Serializable;
  * 
  * </p>
  *
- * @author 吴涛涛
- * @since 2019-08-21
+ * @author seya
+ * @since 2020-09-14
  */
 @TableName("tb_mould_file")
 public class MouldFile extends Model<MouldFile> {
@@ -45,7 +43,6 @@ public class MouldFile extends Model<MouldFile> {
      * 上传时间
      */
     @TableField("indate")
-    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
     private LocalDateTime indate;
 
     /**
@@ -91,7 +88,7 @@ public class MouldFile extends Model<MouldFile> {
     private String content;
 
     /**
-     * 审批状态: 0-待审核,1-资产方审核通过,2-生产方审核通过,3-双方审核通过,-1资产方审核不通过,-2生产方审核不通过
+     * 审批状态: 0-待审核,1-资产方审核通过,2-生产方审核通过,3-双方审核通过,-1资产方审核不通过,-2生产方审核不通过, 4-删除待审核,5-资产方同意删除,6-生产方同意删除,-5资产方不同意删除,-6生产方不同意删除
      */
     @TableField("state")
     private Integer state;
@@ -150,6 +147,12 @@ public class MouldFile extends Model<MouldFile> {
     @TableField("is_update")
     private Integer isUpdate;
 
+    /**
+     * 0-未验收,1-验收通过
+     */
+    @TableField("check_status")
+    private Integer checkStatus;
+
 
     public Integer getId() {
         return id;
@@ -319,6 +322,14 @@ public class MouldFile extends Model<MouldFile> {
         this.isUpdate = isUpdate;
     }
 
+    public Integer getCheckStatus() {
+        return checkStatus;
+    }
+
+    public void setCheckStatus(Integer checkStatus) {
+        this.checkStatus = checkStatus;
+    }
+
     @Override
     protected Serializable pkVal() {
         return this.id;
@@ -348,6 +359,7 @@ public class MouldFile extends Model<MouldFile> {
         ", dwgType=" + dwgType +
         ", partId=" + partId +
         ", isUpdate=" + isUpdate +
+        ", checkStatus=" + checkStatus +
         "}";
     }
 }

+ 2 - 0
cloud-model/src/main/java/com/hssx/cloudmodel/service/MouldFileService.java

@@ -36,4 +36,6 @@ public interface MouldFileService extends IService<MouldFile> {
     HttpRespMsg mouldUpdateCheck(UserVO userVO);
 
     HttpRespMsg applyDelete(MouldFile mouldFile, String token, Integer blongType, String reason);
+
+    HttpRespMsg accept(Integer fileId);
 }

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

@@ -1089,6 +1089,15 @@ public class MouldFileServiceImpl extends ServiceImpl<MouldFileMapper, MouldFile
         return msg;
     }
 
+    @Override
+    public HttpRespMsg accept(Integer fileId) {
+        MouldFile file = new MouldFile();
+        file.setId(fileId);
+        file.setCheckStatus(1);
+        mouldFileMapper.updateById(file);
+        return new HttpRespMsg();
+    }
+
     //生成.zip文件
     public String download(String downloadPath, Mould vo, List<MouldFile> mouldFiles, String oldFilePath, User user) {
         //需要压缩的文件--包括文件地址和文件名

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

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

+ 7 - 4
cloud-model/src/main/resources/mapper/MouldFileMapper.xml

@@ -1,6 +1,7 @@
 <?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.MouldFileMapper">
+
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMap" type="com.hssx.cloudmodel.entity.MouldFile">
         <id column="id" property="id" />
@@ -24,8 +25,14 @@
         <result column="dwg_type" property="dwgType" />
         <result column="part_id" property="partId" />
         <result column="is_update" property="isUpdate" />
+        <result column="check_status" property="checkStatus" />
     </resultMap>
 
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id, uplodtor_id, uploadtor, indate, model_id, sparepart_id, project_id, file_url, file_name, blong_type, content, state, file_type, file_size, file_url_2, file_name_2, file_type_2, file_size_2, dwg_type, part_id, is_update, check_status
+    </sql>
+
     <!-- 通用查询映射结果 -->
     <resultMap id="BaseResultMapVO" type="com.hssx.cloudmodel.entity.vo.MouldFileVO">
         <id column="id" property="id" />
@@ -68,10 +75,6 @@
         </collection>
     </resultMap>
 
-    <!-- 通用查询结果列 -->
-    <sql id="Base_Column_List">
-        id, uplodtor_id, uploadtor, indate, model_id, sparepart_id, project_id, file_url, file_name, blong_type, content, state, file_type, file_size, file_url_2, file_name_2, file_type_2, file_size_2, dwg_type,part_id
-    </sql>
 
     <select id="getFileListByProjectId" resultMap="BaseResultMapVO">
         select

+ 2 - 0
ys_int/src/i18n/lang/en.js

@@ -174,6 +174,8 @@ const lang = {
 		fileSize: "Size",
 		uploader: "Uploader",
 		uploadTime: "Upload Time",
+		checkStatus:"Check Status",
+		checkAccept:"Accept",
 		operation: "Operation Record",
 		operFileName: "Operation Name",
 		operator: "Operator",

+ 2 - 0
ys_int/src/i18n/lang/zh.js

@@ -174,6 +174,8 @@ const lang = {
 		fileSize: "大小",
 		uploader: "上传者",
 		uploadTime: "上传时间",
+		checkStatus:"验收状态",
+		checkAccept:"验收",
 		operation: "操作记录",
 		operFileName: "操作文档名称",
 		operator: "操作人",

+ 44 - 2
ys_int/src/views/mold/moldDetail.vue

@@ -235,7 +235,7 @@
             <!-- 文档列表部分 -->
             <el-col :span="24">
                 <el-tabs v-model="activePage" @tab-click="handleClick">
-                    <!-- 模具档 -->
+                    <!-- 模具档 -->
                     <el-tab-pane :label="$t('mold.moldFile')" name="0">
                         <el-table :data="documents.mould" highlight-current-row v-loading="listLoading" style="width: 100%;">
                             <el-table-column type="index" width="40"></el-table-column>
@@ -263,8 +263,17 @@
                                     <span v-else-if="scope.row.state == -6">生产方不同意删除</span>
                                 </template>
                             </el-table-column>
-                            <el-table-column :label="$t('base.operate')" width="200" align="center" sortable>
+                            <el-table-column prop="checkStatus" :label="$t('project.checkStatus')" width="200" sortable>
                                 <template slot-scope="scope">
+                                    <span v-if="scope.row.checkStatus == 0">未验收</span>
+                                    <span v-else-if="scope.row.checkStatus == 1" style="color:green">验收通过</span>
+                                </template>
+                            </el-table-column>
+                            <el-table-column :label="$t('base.operate')" width="220" align="center" sortable>
+                                <template slot-scope="scope">
+                                     <el-button size="small" @click="accept(scope.row)"
+                                        v-if="scope.row.state == 3 && (user.id == moldDetail.managerId) && scope.row.checkStatus == 0" 
+                                    >{{$t('project.checkAccept')}}</el-button>
                                     <el-button size="small" @click="checkOpen(scope.row)"
                                         v-if="approve == 1 && (scope.row.state == 0 || (scope.row.state == 1 && user.subordinateType == 1) || (scope.row.state == 2 && user.subordinateType == 0))" 
                                     >{{$t('project.approve')}}</el-button>
@@ -1138,6 +1147,39 @@
             };
         },
         methods: {
+            //验收
+            accept(item) {
+                var _this = this;
+                this.$confirm('确定验收通过吗?', '提示', {
+                    confirmButtonText: this.$t('el.messagebox.confirm'),
+                    cancelButtonText: this.$t('el.messagebox.cancel'),
+                    type: 'warning'
+                }).then(() => {
+                    //确认验收通过
+                    _this.http.post("/mouldfile/accept", {
+                        fileId:item.id
+                    },
+                    res => {
+                        if (res.code == "ok") {
+                            //刷新数据
+                            _this.getDetail();
+                        } else {
+                            _this.$message({
+                                message: res.msg,
+                                type: "error"
+                            });
+                        }
+                    },
+                    error => {
+                        this.listLoading = false;
+                        this.$message({
+                            message: error,
+                            type: "error"
+                        });
+                    });
+                   
+                }).catch(() => {});
+            },
             getAllProducer() {
                 this.http.post("/company/relationList", {
                    companyType:1,//获取生产方