|
|
@@ -206,50 +206,40 @@ public class WfSubscriptionServiceImpl extends MPJBaseServiceImpl<WfSubscription
|
|
|
WfSubscription wfSubscription = this.getById(formId);
|
|
|
|
|
|
if(wfSubscription != null){
|
|
|
+
|
|
|
+ Date shenQingRiQi = wfSubscription.getShenQingRiQi4752();
|
|
|
+ LocalDate localDate = shenQingRiQi.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
|
|
|
+
|
|
|
+ String year = String.valueOf(localDate.getYear());
|
|
|
+
|
|
|
//获取当前内存中的最大编号
|
|
|
LambdaQueryWrapper<WfSubscription> wfSubscriptionLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
|
wfSubscriptionLambdaQueryWrapper
|
|
|
.select(WfSubscription.class, x -> VoToColumnUtil.fieldsToColumns(WfSubscription.class).contains(x.getProperty()))
|
|
|
+ .likeRight(WfSubscription::getNumber, year)
|
|
|
.orderByDesc(WfSubscription::getNumber)
|
|
|
.last("limit 1");
|
|
|
WfSubscription wfSubscriptionMax = this.getOne(wfSubscriptionLambdaQueryWrapper);
|
|
|
if(wfSubscriptionMax != null){
|
|
|
String number = wfSubscriptionMax.getNumber();
|
|
|
- String ysarStr = "";
|
|
|
- if(number != null && number.length() >= 3) {
|
|
|
- number = number.trim();
|
|
|
- ysarStr = number.substring(0, 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(number);
|
|
|
- num = num + 1;
|
|
|
- wfSubscriptionNew.setNumber(String.valueOf(num));
|
|
|
- }else {
|
|
|
- wfSubscriptionNew.setNumber(year+"001");
|
|
|
- }
|
|
|
+ int num = Integer.parseInt(number);
|
|
|
+ num = num + 1;
|
|
|
+ wfSubscriptionNew.setNumber(String.valueOf(num));
|
|
|
+
|
|
|
wfSubscriptionNew.setId(wfSubscription.getId());
|
|
|
wfSubscriptionNew.setStatus(1);
|
|
|
|
|
|
- this.updateById(wfSubscriptionNew);
|
|
|
+ return 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 this.updateById(wfSubscriptionNew);
|
|
|
}
|
|
|
}
|
|
|
return true;
|