|
@@ -2,6 +2,7 @@ package com.yh.saas.plugin.yiliangyiyun.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.plugins.Page;
|
|
|
import com.google.common.collect.Lists;
|
|
|
+import com.winsea.svc.base.security.util.AuthSecurityUtils;
|
|
|
import com.yh.saas.common.support.util.IdGenerator;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.GeneralAuditInfo;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.GeneralAuditInfoMapper;
|
|
@@ -11,10 +12,8 @@ import com.yh.saas.plugin.yiliangyiyun.service.INewWorkflowService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* <p>
|
|
@@ -87,6 +86,39 @@ public class GeneralAuditInfoServiceImpl extends ServiceImpl<GeneralAuditInfoMap
|
|
|
public String insertGeneralAuditInfo(GeneralAuditInfo generalAuditInfo) {
|
|
|
//新增主键id
|
|
|
generalAuditInfo.setId(IdGenerator.generateUUID());
|
|
|
+ //当天零点
|
|
|
+ SimpleDateFormat now = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
|
|
|
+ Calendar c = Calendar.getInstance();
|
|
|
+ c.setTime(new Date());
|
|
|
+ c.add(Calendar.YEAR, 0);
|
|
|
+ Date y = c.getTime();
|
|
|
+ String year = now.format(y);
|
|
|
+ Map<String, Object> pageView = new HashMap<>();
|
|
|
+ pageView.put("compId", AuthSecurityUtils.getCurrentUserInfo().getCompId());
|
|
|
+ pageView.put("year", year);
|
|
|
+ //查询当天提交的数据包括已删除的
|
|
|
+ Integer dataCount = baseMapper.getNumByCondition(pageView);
|
|
|
+ SimpleDateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
+ Integer num=dataCount+1;
|
|
|
+ String newNo="";
|
|
|
+ //一位数
|
|
|
+ if (num < 10) {
|
|
|
+ newNo="000" + num;
|
|
|
+ }
|
|
|
+ //两位数
|
|
|
+ else if (num < 100) {
|
|
|
+ newNo="00" + num;
|
|
|
+ }
|
|
|
+ //三位数
|
|
|
+ else if (num < 1000) {
|
|
|
+ newNo="0" + num;
|
|
|
+ }
|
|
|
+ //四位数
|
|
|
+ else if (num < 10000) {
|
|
|
+ newNo=String.valueOf(num);
|
|
|
+ }
|
|
|
+ String no = "TYSH"+df.format(new Date())+newNo;
|
|
|
+ generalAuditInfo.setAuditBusinessNo(no);
|
|
|
// 操作主表数据
|
|
|
this.insert(generalAuditInfo);
|
|
|
return generalAuditInfo.getId();
|