|
|
@@ -55,16 +55,10 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
|
|
|
|
|
|
private final XjrUserMapper xjrUserMapper;
|
|
|
|
|
|
- private final TextbookMapper textbookMapper;
|
|
|
-
|
|
|
- private final TextbookSubscriptionItemMapper textbookSubscriptionItemMapper;
|
|
|
-
|
|
|
private final TextbookIssueRecordMapper textbookIssueRecordMapper;
|
|
|
|
|
|
private final TextbookClaimUserMapper textbookClaimUserMapper;
|
|
|
|
|
|
- private final ClaimItemSubscriptionItemMapper claimItemSubscriptionItemMapper;
|
|
|
-
|
|
|
private final WorkflowFormRelationMapper workflowFormRelationMapper;
|
|
|
private final TextbookWarehouseRecordMapper textbookWarehouseRecordMapper;
|
|
|
|
|
|
@@ -241,7 +235,7 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
|
|
|
if (ObjectUtils.isNotEmpty(wfTextbookClaimVo)) {
|
|
|
//拆分代领人
|
|
|
String receiveUserIdStr = wfTextbookClaimVo.getReceiveUserId();
|
|
|
- if (ObjectUtils.isNotEmpty(receiveUserIdStr) && !receiveUserIdStr.equals("")) {
|
|
|
+ if (ObjectUtils.isNotEmpty(receiveUserIdStr) && !receiveUserIdStr.isEmpty()) {
|
|
|
String[] receiveUserIdStrs = receiveUserIdStr.split(",");
|
|
|
List<Long> receiveUserIdList = new ArrayList<>();
|
|
|
for (String str : receiveUserIdStrs) {
|
|
|
@@ -262,7 +256,7 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
|
|
|
//加上申领项
|
|
|
List<WfTextbookClaimItemVo> wfTextbookClaimItemVoList = wfTextbookClaimWfTextbookClaimItemMapper.getListByWfTextbookClaimId(Long.parseLong(wfTextbookClaimVo.getId()));
|
|
|
|
|
|
- if (ObjectUtils.isNotEmpty(wfTextbookClaimItemVoList) && wfTextbookClaimItemVoList.size() > 0) {
|
|
|
+ if (ObjectUtils.isNotEmpty(wfTextbookClaimItemVoList) && !wfTextbookClaimItemVoList.isEmpty()) {
|
|
|
wfTextbookClaimVo.setWfTextbookClaimItemList(wfTextbookClaimItemVoList);
|
|
|
}
|
|
|
}
|
|
|
@@ -274,6 +268,8 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
|
|
|
public Boolean confirmDistribute(ConfirmDistributeDto dto) {
|
|
|
WfTextbookClaim wfTextbookClaim = this.getByIdDeep(dto.getTextbookClaimId());
|
|
|
List<WfTextbookClaimItem> wfTextbookClaimItemList = wfTextbookClaim.getWfTextbookClaimItemList();
|
|
|
+ int issueTimes = wfTextbookClaim.getIssueTimes() + 1;
|
|
|
+ Date nowDate = new Date();
|
|
|
|
|
|
int claimTotalNum = 0;
|
|
|
int issueTotalNum = 0;
|
|
|
@@ -333,6 +329,10 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
|
|
|
}
|
|
|
|
|
|
TextbookIssueRecord textbookIssueRecord;
|
|
|
+ // 出库单号前缀
|
|
|
+ oldOrderInteger += 1;
|
|
|
+ String newOrder = String.format("%03d", oldOrderInteger); // 补零并格式化为三位数
|
|
|
+ String oldPrex = sb + newOrder + "-";
|
|
|
for (ConfirmDistributeDto.TextbookWarehouseRecords textbookWarehouseRecords : textbookClaimItem.getTextbookWarehouseRecords()){
|
|
|
TextbookWarehouseRecord textbookWarehouseRecord = textbookWarehouseRecordMap.get(textbookWarehouseRecords.getTextbookWarehouseRecordId());
|
|
|
if (ObjectUtils.isEmpty(textbookWarehouseRecord)) {
|
|
|
@@ -342,7 +342,7 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
|
|
|
//更新教材入库中的的库存数量
|
|
|
textbookWarehouseRecordMapper.updateById(new TextbookWarehouseRecord() {{
|
|
|
setModifyUserId(StpUtil.getLoginIdAsLong());
|
|
|
- setModifyDate(new Date());
|
|
|
+ setModifyDate(nowDate);
|
|
|
setId(textbookWarehouseRecord.getId());
|
|
|
setIssuedNumber(ObjectUtils.isEmpty(textbookWarehouseRecord.getIssuedNumber()) ? 0 : textbookWarehouseRecord.getIssuedNumber()
|
|
|
+ confirmNumber);
|
|
|
@@ -351,9 +351,6 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
|
|
|
);
|
|
|
}});
|
|
|
|
|
|
- oldOrderInteger += 1;
|
|
|
- String newOrder = String.format("%03d", oldOrderInteger); // 补零并格式化为三位数
|
|
|
- String oldPrex = sb + newOrder + "-";
|
|
|
//增加出库记录
|
|
|
textbookIssueRecord = new TextbookIssueRecord();
|
|
|
textbookIssueRecord.setBaseSemesterId(wfTextbookClaim.getBaseSemesterId());
|
|
|
@@ -406,8 +403,10 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
|
|
|
textbookIssueRecord.setReceiveUserId(StpUtil.getLoginIdAsLong());
|
|
|
}
|
|
|
textbookIssueRecord.setIssueUserId(StpUtil.getLoginIdAsLong());
|
|
|
- textbookIssueRecord.setCreateDate(new Date());;
|
|
|
+ textbookIssueRecord.setCreateDate(nowDate);;
|
|
|
textbookIssueRecord.setRemark(dto.getRemark());
|
|
|
+ textbookIssueRecord.setIssueTimes(issueTimes);
|
|
|
+
|
|
|
int sortCode = SortCodeUtil.getMaxSortCode(textbookIssueRecordMapper, TextbookIssueRecord.class, "sort_code");
|
|
|
textbookIssueRecord.setSortCode(sortCode + 1);
|
|
|
|
|
|
@@ -417,7 +416,7 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
|
|
|
|
|
|
WfTextbookClaim updateWfTextbookClaim = new WfTextbookClaim();
|
|
|
updateWfTextbookClaim.setModifyUserId(StpUtil.getLoginIdAsLong());
|
|
|
- updateWfTextbookClaim.setModifyDate(new Date());
|
|
|
+ updateWfTextbookClaim.setModifyDate(nowDate);
|
|
|
updateWfTextbookClaim.setId(wfTextbookClaim.getId());
|
|
|
if(claimTotalNum > issueTotalNum){
|
|
|
updateWfTextbookClaim.setStatus(2);
|
|
|
@@ -425,9 +424,10 @@ public class WfTextbookClaimServiceImpl extends MPJBaseServiceImpl<WfTextbookCla
|
|
|
if(claimTotalNum > issueTotalNum){
|
|
|
updateWfTextbookClaim.setStatus(3);
|
|
|
}
|
|
|
-
|
|
|
+ updateWfTextbookClaim.setIssueTimes(issueTimes);
|
|
|
//更新申领项中的已经发放数量
|
|
|
wfTextbookClaimWfTextbookClaimMapper.updateById(updateWfTextbookClaim);
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|