Commit eab3bef4503dcfbb0c897673389ca2b472d8ed48

Authored by yiming
1 parent 8ce2b5fd

档案上下架时修改文件状态和库位码

ruoyi-archives/src/main/java/com/ruoyi/mapper/ArchivesCollectBoxMapper.java
@@ -71,4 +71,6 @@ public interface ArchivesCollectBoxMapper @@ -71,4 +71,6 @@ public interface ArchivesCollectBoxMapper
71 public int Scatter(@Param("apprvoal")String apprvoal, @Param("boxId") Long boxId,@Param("status") String status); 71 public int Scatter(@Param("apprvoal")String apprvoal, @Param("boxId") Long boxId,@Param("status") String status);
72 72
73 int updateArchivesCollectBoxByIds(@Param("archivesCollectBox") ArchivesCollectBox archivesCollectBox, @Param("ids") Long[] ids); 73 int updateArchivesCollectBoxByIds(@Param("archivesCollectBox") ArchivesCollectBox archivesCollectBox, @Param("ids") Long[] ids);
  74 +
  75 + int updateArchivesCollectBoxByBoxId(ArchivesCollectBox archivesCollectBox);
74 } 76 }
ruoyi-archives/src/main/resources/mapper/archives/ArchivesCollectBoxMapper.xml
@@ -240,6 +240,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" @@ -240,6 +240,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
240 #{id} 240 #{id}
241 </foreach> 241 </foreach>
242 </update> 242 </update>
243 - 243 +
  244 + <update id="updateArchivesCollectBoxByBoxId" parameterType="ArchivesCollectBox">
  245 + update archives_collect_box
  246 + <trim prefix="SET" suffixOverrides=",">
  247 + <if test="deportNodeId != null and deportNodeId != 'isNull'">deport_node_id = #{deportNodeId},</if>
  248 + <if test="borrowStatus != null ">borrow_status = #{borrowStatus},</if>
  249 + <if test="deportNodeId == 'isNull'">deport_node_id = NULL,</if>
  250 + </trim>
  251 + where box_id = #{boxId}
  252 + </update>
244 253
245 </mapper> 254 </mapper>
246 \ No newline at end of file 255 \ No newline at end of file
ruoyi-service/src/main/java/com/ruoyi/service/service/impl/ArchivesDepotImpl.java
@@ -2,7 +2,9 @@ package com.ruoyi.service.service.impl; @@ -2,7 +2,9 @@ package com.ruoyi.service.service.impl;
2 2
3 3
4 import com.ruoyi.domain.ArchivesBox; 4 import com.ruoyi.domain.ArchivesBox;
  5 +import com.ruoyi.domain.ArchivesCollectBox;
5 import com.ruoyi.mapper.ArchivesBoxMapper; 6 import com.ruoyi.mapper.ArchivesBoxMapper;
  7 +import com.ruoyi.mapper.ArchivesCollectBoxMapper;
6 import com.ruoyi.service.domain.ArchivesDepot; 8 import com.ruoyi.service.domain.ArchivesDepot;
7 import com.ruoyi.service.mapper.ArchivesDepotMapper; 9 import com.ruoyi.service.mapper.ArchivesDepotMapper;
8 import com.ruoyi.service.service.ArchivesDepotService; 10 import com.ruoyi.service.service.ArchivesDepotService;
@@ -27,6 +29,8 @@ public class ArchivesDepotImpl implements ArchivesDepotService @@ -27,6 +29,8 @@ public class ArchivesDepotImpl implements ArchivesDepotService
27 @Resource 29 @Resource
28 private ArchivesBoxMapper archivesBoxMapper; 30 private ArchivesBoxMapper archivesBoxMapper;
29 31
  32 + @Resource
  33 + private ArchivesCollectBoxMapper archivesCollectBoxMapper;
30 34
31 @Override 35 @Override
32 public int insert(ArchivesDepot archivesDepot) { 36 public int insert(ArchivesDepot archivesDepot) {
@@ -38,14 +42,23 @@ public class ArchivesDepotImpl implements ArchivesDepotService @@ -38,14 +42,23 @@ public class ArchivesDepotImpl implements ArchivesDepotService
38 public int shelve(ArchivesDepot archivesDepot) { 42 public int shelve(ArchivesDepot archivesDepot) {
39 Long[] ids=archivesDepot.getIds(); 43 Long[] ids=archivesDepot.getIds();
40 ArchivesBox archivesBox; 44 ArchivesBox archivesBox;
  45 + ArchivesCollectBox archivesCollectBox;
41 for (long id : ids) { 46 for (long id : ids) {
  47 + //插入中间表
42 archivesDepot.setArchivesId(id); 48 archivesDepot.setArchivesId(id);
43 archivesDepot.setStatus("1"); 49 archivesDepot.setStatus("1");
44 archivesDepotMapper.insert(archivesDepot); 50 archivesDepotMapper.insert(archivesDepot);
  51 + //修改盒表
45 archivesBox=new ArchivesBox(); 52 archivesBox=new ArchivesBox();
46 archivesBox.setId(id); 53 archivesBox.setId(id);
47 archivesBox.setDeportNodeId(archivesDepot.getDepotCode()); 54 archivesBox.setDeportNodeId(archivesDepot.getDepotCode());
  55 + //修改文件表
48 archivesBoxMapper.updateArchivesBox(archivesBox); 56 archivesBoxMapper.updateArchivesBox(archivesBox);
  57 + archivesCollectBox=new ArchivesCollectBox();
  58 + archivesCollectBox.setBoxId(id);
  59 + archivesCollectBox.setBorrowStatus("1");
  60 + archivesCollectBox.setDeportNodeId(archivesDepot.getDepotCode());
  61 + archivesCollectBoxMapper.updateArchivesCollectBoxByBoxId(archivesCollectBox);
49 } 62 }
50 return ids.length; 63 return ids.length;
51 } 64 }
@@ -57,11 +70,18 @@ public class ArchivesDepotImpl implements ArchivesDepotService @@ -57,11 +70,18 @@ public class ArchivesDepotImpl implements ArchivesDepotService
57 Long[] ids=archivesDepot.getIds(); 70 Long[] ids=archivesDepot.getIds();
58 archivesDepotMapper.shelveDown(ids); 71 archivesDepotMapper.shelveDown(ids);
59 ArchivesBox archivesBox; 72 ArchivesBox archivesBox;
  73 + ArchivesCollectBox archivesCollectBox;
60 for (long id : ids) { 74 for (long id : ids) {
61 archivesBox=new ArchivesBox(); 75 archivesBox=new ArchivesBox();
62 archivesBox.setId(id); 76 archivesBox.setId(id);
63 archivesBox.setDeportNodeId("isNull"); 77 archivesBox.setDeportNodeId("isNull");
64 archivesBoxMapper.updateArchivesBox(archivesBox); 78 archivesBoxMapper.updateArchivesBox(archivesBox);
  79 + archivesBoxMapper.updateArchivesBox(archivesBox);
  80 + archivesCollectBox=new ArchivesCollectBox();
  81 + archivesCollectBox.setBoxId(id);
  82 + archivesCollectBox.setBorrowStatus("0");
  83 + archivesCollectBox.setDeportNodeId("isNull");
  84 + archivesCollectBoxMapper.updateArchivesCollectBoxByBoxId(archivesCollectBox);
65 } 85 }
66 return ids.length; 86 return ids.length;
67 } 87 }
ruoyi-ui/src/views/archives/box/shelveindex.vue
@@ -89,6 +89,7 @@ export default { @@ -89,6 +89,7 @@ export default {
89 this.params.depotNodeId=data.id; 89 this.params.depotNodeId=data.id;
90 this.params.depotCode=data.depotCode; 90 this.params.depotCode=data.depotCode;
91 this.queryParams.deportNodeId=data.depotCode; 91 this.queryParams.deportNodeId=data.depotCode;
  92 + this.deportNodeId=data.depotCode;
92 this.getList(); 93 this.getList();
93 }, 94 },
94 clearCheck(){ 95 clearCheck(){
@@ -97,6 +98,9 @@ export default { @@ -97,6 +98,9 @@ export default {
97 this.$refs.tree.setChecked(k,false,false); 98 this.$refs.tree.setChecked(k,false,false);
98 }) 99 })
99 this.queryParams.deportNodeId=undefined; 100 this.queryParams.deportNodeId=undefined;
  101 + this.params.depotNodeId=undefined;
  102 + this.params.ids=undefined;
  103 + this.params.depotCode=undefined;
100 }, 104 },
101 getList() { 105 getList() {
102 this.loading = true; 106 this.loading = true;
@@ -118,7 +122,11 @@ export default { @@ -118,7 +122,11 @@ export default {
118 this.multiple = !selection.length 122 this.multiple = !selection.length
119 }, 123 },
120 shelve(){ 124 shelve(){
121 - if(this.params.ids==undefined){ 125 + if(this.params.depotNodeId==undefined){
  126 + this.$modal.msgWarning("请选择档案架")
  127 + return;
  128 + }
  129 + if(this.params.ids==undefined||this.params.ids.length==0){
122 this.$modal.msgWarning("至少选择一条") 130 this.$modal.msgWarning("至少选择一条")
123 return; 131 return;
124 } 132 }
@@ -128,7 +136,7 @@ export default { @@ -128,7 +136,7 @@ export default {
128 }); 136 });
129 }, 137 },
130 shelveDown(){ 138 shelveDown(){
131 - if(this.params.ids==undefined){ 139 + if(this.params.ids==undefined||this.params.ids.length==0){
132 this.$modal.msgWarning("至少选择一条") 140 this.$modal.msgWarning("至少选择一条")
133 return; 141 return;
134 } 142 }