Commit 8ce2b5fda125347fa241faa30254a97f8cf8a9f6

Authored by yiming
1 parent c8b0ab27

档案归还

ruoyi-archives/src/main/java/com/ruoyi/controller/ArchivesBorrowController.java
@@ -38,6 +38,7 @@ public class ArchivesBorrowController extends BaseController @@ -38,6 +38,7 @@ public class ArchivesBorrowController extends BaseController
38 public TableDataInfo list(ArchivesBorrow archivesBorrow) 38 public TableDataInfo list(ArchivesBorrow archivesBorrow)
39 { 39 {
40 startPage(); 40 startPage();
  41 + archivesBorrow.setStatus("true");
41 List<ArchivesBorrow> list = archivesBorrowService.selectArchivesBorrowListByFilingDept(archivesBorrow); 42 List<ArchivesBorrow> list = archivesBorrowService.selectArchivesBorrowListByFilingDept(archivesBorrow);
42 return getDataTable(list); 43 return getDataTable(list);
43 } 44 }
ruoyi-archives/src/main/java/com/ruoyi/domain/ArchivesCollectBox.java
@@ -145,6 +145,12 @@ public class ArchivesCollectBox extends BaseEntity @@ -145,6 +145,12 @@ public class ArchivesCollectBox extends BaseEntity
145 @Excel(name = "盒号") 145 @Excel(name = "盒号")
146 private String boxMark; 146 private String boxMark;
147 147
  148 + /** 库位码 */
  149 + private String deportNodeId;
  150 +
  151 + /** 0-借出 1-归还 */
  152 + private String borrowStatus;
  153 +
148 public void setId(Long id) 154 public void setId(Long id)
149 { 155 {
150 this.id = id; 156 this.id = id;
@@ -425,44 +431,58 @@ public class ArchivesCollectBox extends BaseEntity @@ -425,44 +431,58 @@ public class ArchivesCollectBox extends BaseEntity
425 this.boxId = boxId; 431 this.boxId = boxId;
426 } 432 }
427 433
  434 + public String getDeportNodeId() {
  435 + return deportNodeId;
  436 + }
  437 +
  438 + public void setDeportNodeId(String deportNodeId) {
  439 + this.deportNodeId = deportNodeId;
  440 + }
  441 +
  442 + public String getBorrowStatus() {
  443 + return borrowStatus;
  444 + }
  445 +
  446 + public void setBorrowStatus(String borrowStatus) {
  447 + this.borrowStatus = borrowStatus;
  448 + }
  449 +
428 @Override 450 @Override
429 public String toString() { 451 public String toString() {
430 - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)  
431 - .append("id", getId())  
432 - .append("boxId", getBoxId())  
433 - .append("general", getGeneral())  
434 - .append("year", getYear())  
435 - .append("title", getTitle())  
436 - .append("sort", getSort())  
437 - .append("safekeepingDate", getSafekeepingDate())  
438 - .append("secretLevel", getSecretLevel())  
439 - .append("pages", getPages())  
440 - .append("filingNumber", getFilingNumber())  
441 - .append("zkNumber", getZkNumber())  
442 - .append("locationCode", getLocationCode())  
443 - .append("filingDept", getFilingDept())  
444 - .append("archivalCode", getArchivalCode())  
445 - .append("responsibilityName", getResponsibilityName())  
446 - .append("serialMark", getSerialMark())  
447 - .append("pieceMark", getPieceMark())  
448 - .append("registerMark", getRegisterMark())  
449 - .append("counsellors", getCounsellors())  
450 - .append("filingName", getFilingName())  
451 - .append("summaryName", getSummaryName())  
452 - .append("recordType", getRecordType())  
453 - .append("carrierType", getCarrierType())  
454 - .append("draftName", getDraftName())  
455 - .append("page", getPage())  
456 - .append("documentMark", getDocumentMark())  
457 - .append("text", getText())  
458 - .append("createBy", getCreateBy())  
459 - .append("createTime", getCreateTime())  
460 - .append("updateBy", getUpdateBy())  
461 - .append("updateTime", getUpdateTime())  
462 - .append("status", getStatus())  
463 - .append("apprvoal", getApprvoal())  
464 - .append("belongRole", getBelongRole())  
465 - .append("boxMark", getBoxMark())  
466 - .toString(); 452 + return "ArchivesCollectBox{" +
  453 + "id=" + id +
  454 + ", boxId=" + boxId +
  455 + ", general='" + general + '\'' +
  456 + ", year='" + year + '\'' +
  457 + ", title='" + title + '\'' +
  458 + ", sort='" + sort + '\'' +
  459 + ", safekeepingDate=" + safekeepingDate +
  460 + ", secretLevel='" + secretLevel + '\'' +
  461 + ", pages='" + pages + '\'' +
  462 + ", filingNumber='" + filingNumber + '\'' +
  463 + ", zkNumber='" + zkNumber + '\'' +
  464 + ", locationCode='" + locationCode + '\'' +
  465 + ", filingDept='" + filingDept + '\'' +
  466 + ", archivalCode='" + archivalCode + '\'' +
  467 + ", responsibilityName='" + responsibilityName + '\'' +
  468 + ", serialMark='" + serialMark + '\'' +
  469 + ", pieceMark='" + pieceMark + '\'' +
  470 + ", registerMark='" + registerMark + '\'' +
  471 + ", counsellors='" + counsellors + '\'' +
  472 + ", filingName='" + filingName + '\'' +
  473 + ", summaryName='" + summaryName + '\'' +
  474 + ", recordType='" + recordType + '\'' +
  475 + ", carrierType='" + carrierType + '\'' +
  476 + ", draftName='" + draftName + '\'' +
  477 + ", page='" + page + '\'' +
  478 + ", documentMark='" + documentMark + '\'' +
  479 + ", text='" + text + '\'' +
  480 + ", status='" + status + '\'' +
  481 + ", apprvoal='" + apprvoal + '\'' +
  482 + ", belongRole='" + belongRole + '\'' +
  483 + ", boxMark='" + boxMark + '\'' +
  484 + ", deportNodeId='" + deportNodeId + '\'' +
  485 + ", borrowStatus='" + borrowStatus + '\'' +
  486 + '}';
467 } 487 }
468 } 488 }
ruoyi-archives/src/main/java/com/ruoyi/mapper/ArchivesBorrowMapper.java
1 package com.ruoyi.mapper; 1 package com.ruoyi.mapper;
2 2
3 import com.ruoyi.domain.ArchivesBorrow; 3 import com.ruoyi.domain.ArchivesBorrow;
  4 +import com.ruoyi.domain.ArchivesBox;
  5 +import org.apache.ibatis.annotations.Param;
  6 +
4 import java.util.List; 7 import java.util.List;
5 8
6 /** 9 /**
@@ -28,4 +31,20 @@ public interface ArchivesBorrowMapper @@ -28,4 +31,20 @@ public interface ArchivesBorrowMapper
28 */ 31 */
29 List<ArchivesBorrow> selectArchivesBorrowListByFilingDept(ArchivesBorrow archivesBorrow); 32 List<ArchivesBorrow> selectArchivesBorrowListByFilingDept(ArchivesBorrow archivesBorrow);
30 33
  34 + /**
  35 + * 查询【请填写功能名称】列表
  36 + *
  37 + * @param ids 【请填写功能名称】
  38 + * @return 【请填写功能名称】集合
  39 + */
  40 + Long[] selectCollectBoxIds(Long[] ids);
  41 +
  42 + /**
  43 + * 查询【请填写功能名称】列表
  44 + *
  45 + * @param archivesBorrow 【请填写功能名称】
  46 + * @return 【请填写功能名称】集合
  47 + */
  48 + int updateArchivesBorrowByIds(@Param("archivesBorrow") ArchivesBorrow archivesBorrow, @Param("ids") Long[] ids);
  49 +
31 } 50 }
ruoyi-archives/src/main/java/com/ruoyi/mapper/ArchivesCollectBoxMapper.java
@@ -69,4 +69,6 @@ public interface ArchivesCollectBoxMapper @@ -69,4 +69,6 @@ public interface ArchivesCollectBoxMapper
69 * @return 69 * @return
70 */ 70 */
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 +
  73 + int updateArchivesCollectBoxByIds(@Param("archivesCollectBox") ArchivesCollectBox archivesCollectBox, @Param("ids") Long[] ids);
72 } 74 }
ruoyi-archives/src/main/java/com/ruoyi/service/impl/ArchivesBorrowServiceImpl.java
1 package com.ruoyi.service.impl; 1 package com.ruoyi.service.impl;
2 2
3 import com.ruoyi.domain.ArchivesBorrow; 3 import com.ruoyi.domain.ArchivesBorrow;
  4 +import com.ruoyi.domain.ArchivesCollectBox;
4 import com.ruoyi.mapper.ArchivesBorrowMapper; 5 import com.ruoyi.mapper.ArchivesBorrowMapper;
  6 +import com.ruoyi.mapper.ArchivesCollectBoxMapper;
5 import com.ruoyi.service.IArchivesBorrowService; 7 import com.ruoyi.service.IArchivesBorrowService;
  8 +import org.apache.ibatis.annotations.Param;
6 import org.springframework.stereotype.Service; 9 import org.springframework.stereotype.Service;
  10 +import org.springframework.transaction.annotation.Transactional;
  11 +
7 import javax.annotation.Resource; 12 import javax.annotation.Resource;
  13 +import java.time.LocalDateTime;
  14 +import java.time.format.DateTimeFormatter;
  15 +import java.util.Date;
8 import java.util.List; 16 import java.util.List;
9 17
10 /** 18 /**
@@ -19,6 +27,9 @@ public class ArchivesBorrowServiceImpl implements IArchivesBorrowService @@ -19,6 +27,9 @@ public class ArchivesBorrowServiceImpl implements IArchivesBorrowService
19 @Resource 27 @Resource
20 private ArchivesBorrowMapper archivesBorrowMapper; 28 private ArchivesBorrowMapper archivesBorrowMapper;
21 29
  30 + @Resource
  31 + private ArchivesCollectBoxMapper archivesCollectBoxMapper;
  32 +
22 33
23 /** 34 /**
24 * 查询【请填写功能名称】列表 35 * 查询【请填写功能名称】列表
@@ -45,13 +56,26 @@ public class ArchivesBorrowServiceImpl implements IArchivesBorrowService @@ -45,13 +56,26 @@ public class ArchivesBorrowServiceImpl implements IArchivesBorrowService
45 } 56 }
46 57
47 @Override 58 @Override
  59 + @Transactional
48 public int archivesReturn(Long[] ids) { 60 public int archivesReturn(Long[] ids) {
49 - return 0; 61 + ArchivesBorrow archivesBorrow=new ArchivesBorrow();
  62 + archivesBorrow.setReturnedDate(new Date());
  63 + archivesBorrow.setStatus("1");
  64 + int i=archivesBorrowMapper.updateArchivesBorrowByIds(archivesBorrow, ids);
  65 + Long[] boxIds=archivesBorrowMapper.selectCollectBoxIds(ids);
  66 + ArchivesCollectBox archivesCollectBox=new ArchivesCollectBox();
  67 + archivesCollectBox.setBorrowStatus("1");
  68 + archivesCollectBoxMapper.updateArchivesCollectBoxByIds(archivesCollectBox,boxIds);
  69 + return i;
50 } 70 }
51 71
52 @Override 72 @Override
53 public int archivesRenew(Long[] ids) { 73 public int archivesRenew(Long[] ids) {
54 - return 0; 74 + ArchivesBorrow archivesBorrow=new ArchivesBorrow();
  75 + archivesBorrow.setReturnedDate(new Date());
  76 + archivesBorrow.setStatus("3");
  77 + int i=archivesBorrowMapper.updateArchivesBorrowByIds(archivesBorrow, ids);
  78 + return i;
55 } 79 }
56 80
57 81
ruoyi-archives/src/main/resources/mapper/archives/ArchivesBorrowMapper.xml
@@ -75,6 +75,28 @@ @@ -75,6 +75,28 @@
75 <if test="borrowDateE != null and borrowDateE != ''"> and a.borrow_date &lt;= #{borrowDateE}</if> 75 <if test="borrowDateE != null and borrowDateE != ''"> and a.borrow_date &lt;= #{borrowDateE}</if>
76 <if test="borrowMark != null and borrowMark != ''"> and a.borrow_mark = #{borrowMark}</if> 76 <if test="borrowMark != null and borrowMark != ''"> and a.borrow_mark = #{borrowMark}</if>
77 <if test="filingDept != null and filingDept != ''"> AND (b.filing_dept=#{filingDept} or FIND_IN_SET(#{filingDept},c.ancestors))</if> 77 <if test="filingDept != null and filingDept != ''"> AND (b.filing_dept=#{filingDept} or FIND_IN_SET(#{filingDept},c.ancestors))</if>
  78 + <if test="filingDept != null and filingDept != ''"> AND (b.filing_dept=#{filingDept} or FIND_IN_SET(#{filingDept},c.ancestors))</if>
  79 + <if test="status == 'true'"> and a.status != '1'</if>
  80 + </select>
  81 +
  82 + <select id="selectCollectBoxIds" parameterType="Long" resultType="Long">
  83 + select collect_box_id from archives_borrow where id in
  84 + <foreach collection="array" item="id" open="(" separator="," close=")">
  85 + #{id}
  86 + </foreach>
78 </select> 87 </select>
79 88
  89 + <update id="updateArchivesBorrowByIds" parameterType="ArchivesBorrow">
  90 + update archives_borrow
  91 + <trim prefix="SET" suffixOverrides=",">
  92 + <if test="archivesBorrow.returnDate != null">return_date = #{archivesBorrow.returnDate},</if>
  93 + <if test="archivesBorrow.returnedDate != null">returned_date = #{archivesBorrow.returnedDate},</if>
  94 + <if test="archivesBorrow.status != null">status = #{archivesBorrow.status},</if>
  95 + </trim>
  96 + where id in
  97 + <foreach collection="ids" item="id" open="(" separator="," close=")">
  98 + #{id}
  99 + </foreach>
  100 + </update>
  101 +
80 </mapper> 102 </mapper>
81 \ No newline at end of file 103 \ No newline at end of file
ruoyi-archives/src/main/resources/mapper/archives/ArchivesCollectBoxMapper.xml
@@ -228,6 +228,18 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot; @@ -228,6 +228,18 @@ PUBLIC &quot;-//mybatis.org//DTD Mapper 3.0//EN&quot;
228 update archives_collect_box set 228 update archives_collect_box set
229 <if test="boxId != null">box_id =Null , status = #{status} ,apprvoal= #{apprvoal} where box_id = #{boxId}</if> 229 <if test="boxId != null">box_id =Null , status = #{status} ,apprvoal= #{apprvoal} where box_id = #{boxId}</if>
230 </update> 230 </update>
  231 +
  232 + <update id="updateArchivesCollectBoxByIds" parameterType="ArchivesCollectBox">
  233 + update archives_collect_box
  234 + <trim prefix="SET" suffixOverrides=",">
  235 + <if test="archivesCollectBox.borrowStatus != null">borrow_status = #{archivesCollectBox.borrowStatus},</if>
  236 + <if test="archivesCollectBox.deportNodeId != null">deport_node_id = #{archivesCollectBox.deportNodeId},</if>
  237 + </trim>
  238 + where id in
  239 + <foreach collection="ids" item="id" open="(" separator="," close=")">
  240 + #{id}
  241 + </foreach>
  242 + </update>
231 243
232 244
233 </mapper> 245 </mapper>
234 \ No newline at end of file 246 \ No newline at end of file
ruoyi-ui/src/api/service/borrowReturn.js
@@ -11,13 +11,13 @@ export function listPost(query) { @@ -11,13 +11,13 @@ export function listPost(query) {
11 11
12 export function archivesReturn(id) { 12 export function archivesReturn(id) {
13 return request({ 13 return request({
14 - url: '/service/expiration/archivesReturn/' + id, 14 + url: '/archives/borrow/archivesReturn/' + id,
15 method: 'post', 15 method: 'post',
16 }) 16 })
17 } 17 }
18 export function archivesRenew(id) { 18 export function archivesRenew(id) {
19 return request({ 19 return request({
20 - url: '/service/expiration/archivesRenew/' + id, 20 + url: '/archives/borrow/archivesRenew/' + id,
21 method: 'post', 21 method: 'post',
22 }) 22 })
23 } 23 }
ruoyi-ui/src/views/service/borrowReturn/index.vue
@@ -54,12 +54,12 @@ @@ -54,12 +54,12 @@
54 <el-table-column type="selection" width="50" align="center" /> 54 <el-table-column type="selection" width="50" align="center" />
55 <el-table-column label="档号" align="center" prop="archivalCode" /> 55 <el-table-column label="档号" align="center" prop="archivalCode" />
56 <el-table-column label="题名" align="center" prop="title" /> 56 <el-table-column label="题名" align="center" prop="title" />
  57 + <el-table-column label="状态" align="center" prop="status" :formatter="borrowStatusFormat"/>
57 <el-table-column label="目的" align="center" prop="borrowType" /> 58 <el-table-column label="目的" align="center" prop="borrowType" />
58 <el-table-column label="借阅人" align="center" prop="name" /> 59 <el-table-column label="借阅人" align="center" prop="name" />
59 <el-table-column label="部门" align="center" prop="dept" /> 60 <el-table-column label="部门" align="center" prop="dept" />
60 <el-table-column label="实体利用方式" align="center" prop="mode" /> 61 <el-table-column label="实体利用方式" align="center" prop="mode" />
61 - <el-table-column label="在库状态" align="center" prop="borrowStatus" />  
62 - <el-table-column label="借阅日期" align="center" prop="borrowDate" /> 62 + <el-table-column label="领取日期" align="center" prop="borrowDate" />
63 <el-table-column label="待归还日期" align="center" prop="returnDate" /> 63 <el-table-column label="待归还日期" align="center" prop="returnDate" />
64 <el-table-column label="借阅单号" align="center" prop="borrowMark" /> 64 <el-table-column label="借阅单号" align="center" prop="borrowMark" />
65 </el-table> 65 </el-table>
@@ -71,10 +71,11 @@ @@ -71,10 +71,11 @@
71 71
72 <script > 72 <script >
73 import {treeselect} from "@/api/archives/dept"; 73 import {treeselect} from "@/api/archives/dept";
74 -import {listPost} from "@/api/service/borrowReturn"; 74 +import {listPost,archivesReturn,archivesRenew} from "@/api/service/borrowReturn";
75 75
76 export default { 76 export default {
77 name: "borrowRecord", 77 name: "borrowRecord",
  78 + dicts: ['borrowStatus'],
78 data() { 79 data() {
79 return { 80 return {
80 // 部门树选项 81 // 部门树选项
@@ -93,6 +94,7 @@ export default { @@ -93,6 +94,7 @@ export default {
93 }, 94 },
94 loading: false, 95 loading: false,
95 list: [], 96 list: [],
  97 + ids: [],
96 }; 98 };
97 }, 99 },
98 100
@@ -133,7 +135,7 @@ export default { @@ -133,7 +135,7 @@ export default {
133 }, 135 },
134 // 多选框选中数据 136 // 多选框选中数据
135 handleSelectionChange(selection) { 137 handleSelectionChange(selection) {
136 - this.params.ids= selection.map(item => item.id) 138 + this.ids= selection.map(item => item.id)
137 this.single = selection.length!==1 139 this.single = selection.length!==1
138 this.multiple = !selection.length 140 this.multiple = !selection.length
139 }, 141 },
@@ -150,8 +152,9 @@ export default { @@ -150,8 +152,9 @@ export default {
150 /** 归还按钮 */ 152 /** 归还按钮 */
151 archivesReturn(row) { 153 archivesReturn(row) {
152 const ids =row.id || this.ids; 154 const ids =row.id || this.ids;
  155 + console.log(ids);
153 this.$modal.confirm('是否确认归还?').then(function() { 156 this.$modal.confirm('是否确认归还?').then(function() {
154 - return this.archivesReturn(ids); 157 + return archivesReturn(ids);
155 }).then(() => { 158 }).then(() => {
156 this.getList(); 159 this.getList();
157 this.$modal.msgSuccess("提交成功"); 160 this.$modal.msgSuccess("提交成功");
@@ -161,11 +164,14 @@ export default { @@ -161,11 +164,14 @@ export default {
161 archivesRenew(row) { 164 archivesRenew(row) {
162 const ids =row.id || this.ids; 165 const ids =row.id || this.ids;
163 this.$modal.confirm('是否确认续借?').then(function() { 166 this.$modal.confirm('是否确认续借?').then(function() {
164 - return this.archivesRenew(ids); 167 + return archivesRenew(ids);
165 }).then(() => { 168 }).then(() => {
166 this.getList(); 169 this.getList();
167 this.$modal.msgSuccess("提交成功"); 170 this.$modal.msgSuccess("提交成功");
168 }).catch(() => {}); 171 }).catch(() => {});
  172 + },
  173 + borrowStatusFormat(row, column) {
  174 + return this.selectDictLabel(this.dict.type.borrowStatus, row.status);
169 } 175 }
170 176
171 } 177 }