Commit eab3bef4503dcfbb0c897673389ca2b472d8ed48
1 parent
8ce2b5fd
档案上下架时修改文件状态和库位码
Showing
4 changed files
with
42 additions
and
3 deletions
ruoyi-archives/src/main/java/com/ruoyi/mapper/ArchivesCollectBoxMapper.java
| ... | ... | @@ -71,4 +71,6 @@ public interface ArchivesCollectBoxMapper |
| 71 | 71 | public int Scatter(@Param("apprvoal")String apprvoal, @Param("boxId") Long boxId,@Param("status") String status); |
| 72 | 72 | |
| 73 | 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 | 240 | #{id} |
| 241 | 241 | </foreach> |
| 242 | 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 | 254 | </mapper> |
| 246 | 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 | 2 | |
| 3 | 3 | |
| 4 | 4 | import com.ruoyi.domain.ArchivesBox; |
| 5 | +import com.ruoyi.domain.ArchivesCollectBox; | |
| 5 | 6 | import com.ruoyi.mapper.ArchivesBoxMapper; |
| 7 | +import com.ruoyi.mapper.ArchivesCollectBoxMapper; | |
| 6 | 8 | import com.ruoyi.service.domain.ArchivesDepot; |
| 7 | 9 | import com.ruoyi.service.mapper.ArchivesDepotMapper; |
| 8 | 10 | import com.ruoyi.service.service.ArchivesDepotService; |
| ... | ... | @@ -27,6 +29,8 @@ public class ArchivesDepotImpl implements ArchivesDepotService |
| 27 | 29 | @Resource |
| 28 | 30 | private ArchivesBoxMapper archivesBoxMapper; |
| 29 | 31 | |
| 32 | + @Resource | |
| 33 | + private ArchivesCollectBoxMapper archivesCollectBoxMapper; | |
| 30 | 34 | |
| 31 | 35 | @Override |
| 32 | 36 | public int insert(ArchivesDepot archivesDepot) { |
| ... | ... | @@ -38,14 +42,23 @@ public class ArchivesDepotImpl implements ArchivesDepotService |
| 38 | 42 | public int shelve(ArchivesDepot archivesDepot) { |
| 39 | 43 | Long[] ids=archivesDepot.getIds(); |
| 40 | 44 | ArchivesBox archivesBox; |
| 45 | + ArchivesCollectBox archivesCollectBox; | |
| 41 | 46 | for (long id : ids) { |
| 47 | + //插入中间表 | |
| 42 | 48 | archivesDepot.setArchivesId(id); |
| 43 | 49 | archivesDepot.setStatus("1"); |
| 44 | 50 | archivesDepotMapper.insert(archivesDepot); |
| 51 | + //修改盒表 | |
| 45 | 52 | archivesBox=new ArchivesBox(); |
| 46 | 53 | archivesBox.setId(id); |
| 47 | 54 | archivesBox.setDeportNodeId(archivesDepot.getDepotCode()); |
| 55 | + //修改文件表 | |
| 48 | 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 | 63 | return ids.length; |
| 51 | 64 | } |
| ... | ... | @@ -57,11 +70,18 @@ public class ArchivesDepotImpl implements ArchivesDepotService |
| 57 | 70 | Long[] ids=archivesDepot.getIds(); |
| 58 | 71 | archivesDepotMapper.shelveDown(ids); |
| 59 | 72 | ArchivesBox archivesBox; |
| 73 | + ArchivesCollectBox archivesCollectBox; | |
| 60 | 74 | for (long id : ids) { |
| 61 | 75 | archivesBox=new ArchivesBox(); |
| 62 | 76 | archivesBox.setId(id); |
| 63 | 77 | archivesBox.setDeportNodeId("isNull"); |
| 64 | 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 | 86 | return ids.length; |
| 67 | 87 | } | ... | ... |
ruoyi-ui/src/views/archives/box/shelveindex.vue
| ... | ... | @@ -89,6 +89,7 @@ export default { |
| 89 | 89 | this.params.depotNodeId=data.id; |
| 90 | 90 | this.params.depotCode=data.depotCode; |
| 91 | 91 | this.queryParams.deportNodeId=data.depotCode; |
| 92 | + this.deportNodeId=data.depotCode; | |
| 92 | 93 | this.getList(); |
| 93 | 94 | }, |
| 94 | 95 | clearCheck(){ |
| ... | ... | @@ -97,6 +98,9 @@ export default { |
| 97 | 98 | this.$refs.tree.setChecked(k,false,false); |
| 98 | 99 | }) |
| 99 | 100 | this.queryParams.deportNodeId=undefined; |
| 101 | + this.params.depotNodeId=undefined; | |
| 102 | + this.params.ids=undefined; | |
| 103 | + this.params.depotCode=undefined; | |
| 100 | 104 | }, |
| 101 | 105 | getList() { |
| 102 | 106 | this.loading = true; |
| ... | ... | @@ -118,7 +122,11 @@ export default { |
| 118 | 122 | this.multiple = !selection.length |
| 119 | 123 | }, |
| 120 | 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 | 130 | this.$modal.msgWarning("至少选择一条") |
| 123 | 131 | return; |
| 124 | 132 | } |
| ... | ... | @@ -128,7 +136,7 @@ export default { |
| 128 | 136 | }); |
| 129 | 137 | }, |
| 130 | 138 | shelveDown(){ |
| 131 | - if(this.params.ids==undefined){ | |
| 139 | + if(this.params.ids==undefined||this.params.ids.length==0){ | |
| 132 | 140 | this.$modal.msgWarning("至少选择一条") |
| 133 | 141 | return; |
| 134 | 142 | } | ... | ... |