|
|
@@ -1,6 +1,7 @@
|
|
|
package com.xjrsoft.module.ledger.service.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
@@ -20,6 +21,7 @@ import com.xjrsoft.module.ledger.vo.WfSubscriptionPageVo;
|
|
|
import com.xjrsoft.module.ledger.vo.WorkflowRecordVo;
|
|
|
import com.xjrsoft.module.system.entity.File;
|
|
|
import com.xjrsoft.module.system.service.IFileService;
|
|
|
+import com.xjrsoft.module.textbook.entity.WfTextbookRecede;
|
|
|
import com.xjrsoft.module.workflow.entity.WorkflowExtra;
|
|
|
import com.xjrsoft.module.workflow.entity.WorkflowFormRelation;
|
|
|
import com.xjrsoft.module.workflow.entity.WorkflowRecord;
|
|
|
@@ -31,11 +33,9 @@ import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Objects;
|
|
|
+import java.time.LocalDate;
|
|
|
+import java.time.ZoneId;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
@@ -198,4 +198,60 @@ public class WfSubscriptionServiceImpl extends MPJBaseServiceImpl<WfSubscription
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Boolean dataHandle(Long formId) {
|
|
|
+ WfSubscription wfSubscription = this.getById(formId);
|
|
|
+
|
|
|
+ if(wfSubscription != null){
|
|
|
+ //获取当前内存中的最大编号
|
|
|
+ LambdaQueryWrapper<WfSubscription> wfSubscriptionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
+ wfSubscriptionLambdaQueryWrapper
|
|
|
+ .select(WfSubscription::getNumber)
|
|
|
+ .orderByDesc(WfSubscription::getNumber)
|
|
|
+ .last("limit 1");
|
|
|
+ WfSubscription wfSubscriptionMax = this.getOne(wfSubscriptionLambdaQueryWrapper);
|
|
|
+ if(wfSubscriptionMax != null){
|
|
|
+ String number = wfSubscriptionMax.getNumber();
|
|
|
+ String ysarStr = "";
|
|
|
+ String lastThreeChars = "";
|
|
|
+ if(number != null && number.length() >= 3) {
|
|
|
+ number = number.trim();
|
|
|
+ ysarStr = number.substring(0, number.length() - 3);
|
|
|
+ lastThreeChars = number.substring(number.length() - 3);
|
|
|
+ }
|
|
|
+
|
|
|
+ Date shenQingRiQi = wfSubscription.getShenQingRiQi4752();
|
|
|
+ LocalDate localDate = shenQingRiQi.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
|
+
|
|
|
+ String year = String.valueOf(localDate.getYear());
|
|
|
+
|
|
|
+ WfSubscription wfSubscriptionNew = new WfSubscription();
|
|
|
+
|
|
|
+ if(year.equals(ysarStr)){
|
|
|
+ int num = Integer.parseInt(lastThreeChars);
|
|
|
+ num = num + 1;
|
|
|
+ wfSubscriptionNew.setNumber(ysarStr+num);
|
|
|
+ }else {
|
|
|
+ wfSubscriptionNew.setNumber(ysarStr+"001");
|
|
|
+ }
|
|
|
+ wfSubscriptionNew.setId(wfSubscription.getId());
|
|
|
+ wfSubscriptionNew.setStatus(1);
|
|
|
+
|
|
|
+ this.updateById(wfSubscriptionNew);
|
|
|
+ }else{
|
|
|
+ Date shenQingRiQi = wfSubscription.getShenQingRiQi4752();
|
|
|
+ LocalDate localDate = shenQingRiQi.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
|
+
|
|
|
+ String year = String.valueOf(localDate.getYear());
|
|
|
+ WfSubscription wfSubscriptionNew = new WfSubscription();
|
|
|
+ wfSubscriptionNew.setNumber(year+"001");
|
|
|
+ wfSubscriptionNew.setId(wfSubscription.getId());
|
|
|
+ wfSubscriptionNew.setStatus(1);
|
|
|
+
|
|
|
+ this.updateById(wfSubscriptionNew);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|