FinalYu 4 ヶ月 前
コミット
c2237f9676

+ 11 - 0
nasc-system/src/main/java/com/nasc/custom/domain/NascManualVerify.java

@@ -27,6 +27,9 @@ public class NascManualVerify {
     /** 材料ID */
     private Long materialId;
 
+    /** 材料ID */
+    private String materialName;
+
     /** 受理表ID */
     private Long dealId;
 
@@ -81,6 +84,14 @@ public class NascManualVerify {
         this.materialId = materialId;
     }
 
+    public String getMaterialName() {
+        return materialName;
+    }
+
+    public void setMaterialName(String materialName) {
+        this.materialName = materialName;
+    }
+
     public Long getDealId() {
         return dealId;
     }

+ 2 - 0
nasc-system/src/main/java/com/nasc/custom/mapper/NascDealRecordMapper.java

@@ -27,4 +27,6 @@ public interface NascDealRecordMapper {
     Map<String, Object> getDealRecordById(Long id);
 
     int updateDealRecordStatus(NascDealRecord dealRecord);
+
+    int updateDealRecord(NascDealRecord dealRecord);
 }

+ 11 - 2
nasc-system/src/main/java/com/nasc/custom/service/impl/NascRecordServiceImpl.java

@@ -7,6 +7,7 @@ import com.nasc.common.core.text.Convert;
 import com.nasc.custom.domain.*;
 import com.nasc.custom.mapper.*;
 import com.nasc.custom.service.INascRecordService;
+import org.apache.commons.lang3.ObjectUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -48,6 +49,10 @@ public class NascRecordServiceImpl implements INascRecordService {
     @Override
     @Transactional
     public int addDealRecord(NascDealRecord dealRecord) {
+        if (ObjectUtils.isNotEmpty(dealRecord.getId()) && dealRecord.getWithStatus() == 1) {
+            dealRecordMapper.updateDealRecordStatus(dealRecord);
+            return Convert.toInt(dealRecord.getId());
+        }
         JSONArray materials = JSON.parseArray(dealRecord.getMaterials());
         List<Long> manualVerifyList = new ArrayList<>();
         materials.forEach(item -> {
@@ -57,8 +62,12 @@ public class NascRecordServiceImpl implements INascRecordService {
                 manualVerifyList.add(manualVerifyId);
             }
         });
-        int result = dealRecordMapper.insertDealRecord(dealRecord);
-        if (manualVerifyList.size() > 0 && result > 0) {
+        if (ObjectUtils.isNotEmpty(dealRecord.getId())) {
+            dealRecordMapper.updateDealRecord(dealRecord);
+        } else {
+            dealRecordMapper.insertDealRecord(dealRecord);
+        }
+        if (manualVerifyList.size() > 0) {
             manualVerifyMapper.updateManualVerifyDealId(dealRecord.getId(), manualVerifyList);
         }
         return Convert.toInt(dealRecord.getId());

+ 8 - 0
nasc-system/src/main/resources/mapper/custom/NascDealRecordMapper.xml

@@ -66,4 +66,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         WHERE id = #{id}
     </update>
 
+    <update id="updateDealRecord">
+        UPDATE nasc_deal_record
+        SET with_type = #{withType}, contacts = #{contacts}, phone = #{phone}, id_card = #{idCard},
+            with_status = #{withStatus}, enterprise_name = #{enterpriseName}, materials = #{materials},
+            matter_id = #{matterId}, deal_user = #{dealUser}, update_time = sysdate()
+        WHERE id = #{id}
+    </update>
+
 </mapper> 

+ 13 - 6
nasc-system/src/main/resources/mapper/custom/NascManualVerifyMapper.xml

@@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="dealStatus" column="deal_status"/>
         <result property="matterId" column="matter_id"/>
         <result property="materialId" column="material_id"/>
+        <result property="materialName" column="material_name"/>
         <result property="dealId" column="deal_id"/>
         <result property="reason" column="reason"/>
         <result property="createTime" column="create_time"/>
@@ -17,8 +18,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </resultMap>
 
     <insert id="insertManualVerify" parameterType="NascManualVerify" useGeneratedKeys="true" keyProperty="id">
-        INSERT INTO nasc_manual_verify (deal_user, deal_status, matter_id, material_id, deal_id, create_time)
-        VALUES (#{dealUser}, #{dealStatus}, #{matterId}, #{materialId}, #{dealId}, sysdate());
+        INSERT INTO nasc_manual_verify (deal_user, deal_status, matter_id, material_id, material_name, deal_id, create_time)
+        VALUES (#{dealUser}, #{dealStatus}, #{matterId}, #{materialId}, #{materialName}, #{dealId}, sysdate());
     </insert>
 
     <update id="updateManualVerifyDealId">
@@ -36,8 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="createTime" column="create_time"/>
         <result property="verifyTime" column="verify_time"/>
         <result property="itemName" column="item_name"/>
-        <result property="listName" column="list_name"/>
+        <result property="materialName" column="material_name"/>
         <result property="serialNumber" column="serial_number"/>
+        <result property="withType" column="with_type"/>
+        <result property="contacts" column="contacts"/>
+        <result property="enterpriseName" column="enterprise_name"/>
+        <result property="idCard" column="id_card"/>
+        <result property="phone" column="phone"/>
         <result property="userName" column="user_name"/>
         <result property="deptName" column="dept_name"/>
         <result property="reason" column="reason"/>
@@ -47,10 +53,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         SELECT mv.id, mv.deal_status, mv.reason,
                DATE_FORMAT(mv.create_time, '%Y-%m-%d %H:%i:%s') AS create_time,
                DATE_FORMAT(mv.verify_time, '%Y-%m-%d %H:%i:%s') AS verify_time,
-               m.item_name, ml.list_name, dr.serial_number, u.user_name, d.dept_name
+               mv.material_name, m.item_name,
+               dr.serial_number, dr.with_type, dr.contacts, dr.enterprise_name, dr.id_card, dr.phone,
+               u.user_name, d.dept_name
         FROM nasc_manual_verify mv
         LEFT JOIN nasc_matter m ON m.id = mv.matter_id
-        LEFT JOIN nasc_material_list ml ON ml.id = mv.material_id
         LEFT JOIN nasc_deal_record dr ON dr.id = mv.deal_id
         LEFT JOIN sys_user u ON u.user_id = mv.deal_user
         LEFT JOIN sys_dept d ON d.dept_id = u.dept_id
@@ -71,7 +78,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </update>
 
     <select id="getManualVerifyByIds" resultMap="manualVerifyEntity">
-        SELECT mv.id, mv.deal_user, mv.deal_status, mv.matter_id, mv.material_id, mv.deal_id, mv.reason
+        SELECT mv.id, mv.deal_user, mv.deal_status, mv.matter_id, mv.material_id, mv.material_name, mv.deal_id, mv.reason,
                DATE_FORMAT(mv.create_time, '%Y-%m-%d %H:%i:%s') AS create_time,
                DATE_FORMAT(mv.verify_time, '%Y-%m-%d %H:%i:%s') AS verify_time
         FROM nasc_manual_verify mv

+ 1 - 1
nasc-ui/src/views/matter/deal/index.vue

@@ -205,7 +205,7 @@ export default {
         let obj = JSON.parse(row.materials)
         let manualVerifyList = []
         obj.forEach((item, index) => {
-          if (item.verification === 1) {
+          if (item.verification === 1 && item.manualVerifyId) {
             manualVerifyList.push(item.manualVerifyId)
           }
         })

+ 42 - 27
nasc-ui/src/views/matter/index/index.vue

@@ -493,6 +493,7 @@ export default {
       },
       dealWithKey: 0,
       dealWithForm: {
+        id: undefined,
         serialNumber: '',
         withType: 1,
         enterpriseName: '',
@@ -923,32 +924,40 @@ export default {
     },
     /** 人工核验 **/
     handleManualVerify(data, event) {
-      let params = {
-        "dealStatus": 0,
-        "matterId": this.currMatter.id,
-        "materialId": data.id
-      }
-      this.$confirm('您正在提交人工核验申请, 是否继续?', '温馨提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        addManualVerify(params).then((response) => {
-          if (response.data > 0) {
-            this.$modal.msgSuccess("提交成功");
-            this.dealWithForm.materials.forEach((d) => {
-              if (d.id === data.id) {
-                d.manualVerifyId = response.data
-              }
-            })
-            this.$nextTick(() => {
-              this.dealWithKey ++
-            })
-          } else {
-            this.$modal.msgError("提交失败");
+      this.$refs['dealWithForm'].validate((valid) => {
+        if (valid) {
+          let params = {
+            "dealStatus": 0,
+            "matterId": this.currMatter.id,
+            "materialId": data.id,
+            "materialName": data.listName
           }
-        });
-      }).catch(() => {
+          this.$confirm('您正在提交人工核验申请, 是否继续?', '温馨提示', {
+            confirmButtonText: '确定',
+            cancelButtonText: '取消',
+            type: 'warning'
+          }).then(() => {
+            addManualVerify(params).then((response) => {
+              if (response.data > 0) {
+                this.$modal.msgSuccess("提交成功");
+                this.dealWithForm.materials.forEach((d) => {
+                  if (d.id === data.id) {
+                    d.manualVerifyId = response.data
+                  }
+                })
+                this.$nextTick(() => {
+                  this.dealWithKey ++
+                })
+              } else {
+                this.$modal.msgError("提交失败");
+              }
+            });
+          }).catch(() => {
+          })
+        } else {
+          this.$modal.msgError("请检查必填项")
+          return false;
+        }
       })
     },
     /** 打印事件参数校验 **/
@@ -990,12 +999,14 @@ export default {
             })
           }
         } else {
+          this.$modal.msgError("请检查必填项")
           return false;
         }
       })
     },
     /** 取消受理弹出框 **/
     handleCancelDealWith() {
+      this.dealWithForm.id = undefined
       if (this.$refs['dealWithForm']) this.$refs['dealWithForm'].resetFields();
     },
     printDetail(id) {
@@ -1009,7 +1020,7 @@ export default {
             let obj = JSON.parse(this.currDealRecord.materials)
             let manualVerifyList = []
             obj.forEach((item, index) => {
-              if (item.verification === 1) {
+              if (item.verification === 1 && item.manualVerifyId) {
                 manualVerifyList.push(item.manualVerifyId)
               }
             })
@@ -1059,22 +1070,26 @@ export default {
             }
           }
           let data = JSON.parse(JSON.stringify(this.dealWithForm))
+          data.id = this.dealWithForm.id
           data.serialNumber = this.dealWithForm.serialNumber
           data.withStatus = withStatus
           data.matterId = this.currMatter.id
           data.materials = JSON.stringify(this.dealWithForm.materials)
           addDealRecord(data).then((response) => {
             if (response.code == 200) {
+              this.dealWithForm.id = response.data
               this.$modal.msgSuccess("保存成功");
-              // this.handleCancelDealWith()
               if (withStatus == 1) {
                 this.printDetail(response.data)
+                this.handleCancelDealWith()
+                this.handleDealWith()
               }
               return
             }
             this.$modal.msgError("保存失败")
           });
         } else {
+          this.$modal.msgError("请检查必填项")
           return false;
         }
       })

+ 15 - 2
nasc-ui/src/views/matter/manual/index.vue

@@ -17,7 +17,20 @@
 
         <el-table v-loading="loading" :data="manualVerifyList">
           <el-table-column label="受理编号" align="center" prop="serialNumber" width="160" />
-          <el-table-column label="事项名称" align="center" prop="itemName" :show-overflow-tooltip="true" />
+          <el-table-column label="业务类型" align="center" prop="withType">
+            <template slot-scope="scope">
+              <span v-if="scope.row.withType === 1">个人</span>
+              <span v-if="scope.row.withType === 2">企业</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="企业名称" align="center" prop="enterpriseName">
+            <template slot-scope="scope">
+              <span v-if="scope.row.withType === 2">{{ scope.row.enterpriseName }}</span>
+            </template>
+          </el-table-column>
+          <el-table-column label="联系人" align="center" prop="contacts" width="100"/>
+          <el-table-column label="联系电话" align="center" prop="phone" width="120"/>
+          <el-table-column label="事项名称" align="center" prop="materialName" :show-overflow-tooltip="true" />
           <el-table-column label="材料名称" align="center" prop="listName" :show-overflow-tooltip="true" />
           <el-table-column label="核验状态" align="center" prop="dealStatus">
             <template slot-scope="scope">
@@ -33,7 +46,7 @@
           </el-table-column>
           <el-table-column label="核验时间" align="center" prop="verifyTime" width="160" />
           <el-table-column label="创建时间" align="center" prop="createTime" width="160" />
-          <el-table-column label="操作" align="center" width="160" class-name="small-padding fixed-width">
+          <el-table-column label="操作" align="center" width="160" fixed="right" class-name="small-padding fixed-width">
             <template slot-scope="scope" v-if="scope.row.dealStatus !== 1 && scope.row.dealStatus !== 2">
               <el-button size="mini" type="text" icon="el-icon-check" @click="handleVerify(scope.row, 1)">通过</el-button>
               <el-button size="mini" type="text" icon="el-icon-close" @click="handleVerify(scope.row, 2)" style="color: red;">不通过</el-button>