|
|
@ -1,15 +1,19 @@ |
|
|
|
package com.storeroom.modules.archives.service.impl; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.TypeReference; |
|
|
|
import com.storeroom.modules.archives.domain.BorrowArchives; |
|
|
|
import com.storeroom.modules.archives.domain.BorrowBill; |
|
|
|
import com.storeroom.modules.archives.domain.BorrowBillArchives; |
|
|
|
import com.storeroom.modules.archives.domain.Borrower; |
|
|
|
import com.storeroom.modules.archives.domain.vo.BorrowBillDetailsVO; |
|
|
|
import com.storeroom.modules.archives.repository.*; |
|
|
|
import com.storeroom.modules.archives.service.BorrowService; |
|
|
|
import com.storeroom.utils.ChinesePinyinUtil; |
|
|
|
import com.storeroom.utils.PageUtil; |
|
|
|
import com.storeroom.utils.StringUtils; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.data.domain.Pageable; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
@ -17,6 +21,7 @@ import javax.transaction.Transactional; |
|
|
|
import java.beans.Transient; |
|
|
|
import java.sql.Timestamp; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
@ -32,11 +37,12 @@ public class BorrowServiceImpl implements BorrowService { |
|
|
|
private final ArchivesSummaryRepository archivesSummaryRepository; |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object initWaitRegisterList(String archiveNo, String maintitle, String caseName, Pageable page) { |
|
|
|
public Object initWaitRegisterList(String archiveNo, String maintitle, String caseName,String folderLocationDetails, Pageable page) { |
|
|
|
archiveNo = StringUtils.isEmpty(archiveNo) ? null : "%"+ archiveNo +"%"; |
|
|
|
maintitle = StringUtils.isEmpty(maintitle) ? null : "%"+ maintitle +"%"; |
|
|
|
caseName = StringUtils.isEmpty(caseName) ? null : "%"+ caseName +"%"; |
|
|
|
return PageUtil.toPage(borrowArchivesRepository.initWaitRegisterList(archiveNo,maintitle,caseName,page)); |
|
|
|
folderLocationDetails = StringUtils.isEmpty(folderLocationDetails) ? null : "%"+ folderLocationDetails +"%"; |
|
|
|
return PageUtil.toPage(borrowArchivesRepository.initWaitRegisterList(archiveNo,maintitle,caseName,folderLocationDetails,page)); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -46,7 +52,8 @@ public class BorrowServiceImpl implements BorrowService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object addArchivesWaitRegister(List<String> archiveIds) { |
|
|
|
List<BorrowArchives> addBorrowArchives = borrowArchivesRepository.findAllByArchivesIdss(archiveIds); |
|
|
|
List<Map<String,Object>> ret = borrowArchivesRepository.findAllByArchivesIdss(archiveIds); |
|
|
|
List<BorrowArchives> addBorrowArchives = JSON.parseObject(JSON.toJSONString(ret), new TypeReference<List<BorrowArchives>>() {}); |
|
|
|
addBorrowArchives = borrowArchivesRepository.saveAll(addBorrowArchives); |
|
|
|
return addBorrowArchives; |
|
|
|
} |
|
|
@ -106,9 +113,11 @@ public class BorrowServiceImpl implements BorrowService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object initBillDetailsByOrderNo(String orderNo) { |
|
|
|
BorrowBillDetailsVO vo = new BorrowBillDetailsVO(); |
|
|
|
BorrowBill bill = borrowBillRepository.findBillById(orderNo); |
|
|
|
|
|
|
|
return null; |
|
|
|
BeanUtils.copyProperties(bill,vo); |
|
|
|
vo.setBorrowArchives(borrowArchivesRepository.initArchivesByOrderNo(orderNo)); |
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -129,6 +138,7 @@ public class BorrowServiceImpl implements BorrowService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@Transactional |
|
|
|
public Object removeWaitBorrow(List<String> orderNos) { |
|
|
|
//删除待借阅档案 |
|
|
|
borrowArchivesRepository.deleteAllByOrderNos(orderNos); |
|
|
@ -139,6 +149,29 @@ public class BorrowServiceImpl implements BorrowService { |
|
|
|
return orderNos.size(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object initBorrowRule() { |
|
|
|
return borrowSettingRepository.findFirstToIsType(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object readyBorrowShowTid(List<String> orderNos) { |
|
|
|
Map<String,Object> map = new HashMap<>(); |
|
|
|
//根据单据号获取有标签的档案基本信息 |
|
|
|
List<Map<String,Object>> archives = borrowBillRepository.findArchivesTidByOrderNos(orderNos); |
|
|
|
//根据单据号获取所有有标签的盒信息 |
|
|
|
// List<Map<String,Object>> cases = borrowBillRepository.findCaseidByOrderNos(orderNos); |
|
|
|
map.put("archives",archives); |
|
|
|
// map.put("cases",cases); |
|
|
|
return map; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object billBorrowConfirm(List<String> orderNos) { |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//生成清单 |
|
|
|
public BorrowBill createBill(Integer borrowNum,String borrowerId,Timestamp startTime,Timestamp endTime,String purpose,Integer loop){ |
|
|
|