任务单号获取修改
This commit is contained in:
parent
f015b6cad5
commit
720ac160e6
|
|
@ -8,6 +8,7 @@ import java.util.List;
|
||||||
|
|
||||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.sgzb.material.domain.*;
|
import com.bonus.sgzb.material.domain.*;
|
||||||
import com.bonus.sgzb.material.mapper.*;
|
import com.bonus.sgzb.material.mapper.*;
|
||||||
|
|
@ -387,15 +388,18 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||||
Date nowDate = DateUtils.getNowDate();
|
Date nowDate = DateUtils.getNowDate();
|
||||||
String format = dateFormat.format(nowDate);
|
String format = dateFormat.format(nowDate);
|
||||||
int taskNum = taskMapper.selectTaskNumByMonth(nowDate, taskType) + 1;
|
String taskNum = taskMapper.selectTaskNumByMonths(nowDate, taskType);
|
||||||
String codeNum = "";
|
if (StringHelper.isNotEmpty(taskNum)){
|
||||||
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
|
// 将字符串转换为整数
|
||||||
codeNum = code + format + "-00" + taskNum;
|
int num = Integer.parseInt(taskNum);
|
||||||
} else if (taskNum > GlobalContants.NUM3 && taskNum < GlobalContants.NUM4) {
|
// 执行加一操作
|
||||||
codeNum = code + format + "-0" + taskNum;
|
num++;
|
||||||
} else {
|
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||||
codeNum = code + format + "-000" + taskNum;
|
taskNum = String.format("%04d", num);
|
||||||
|
}else {
|
||||||
|
taskNum = "0001";
|
||||||
}
|
}
|
||||||
|
String codeNum = code + format + "-" + taskNum;
|
||||||
return codeNum;
|
return codeNum;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.bonus.sgzb.common.core.constant.HttpStatus;
|
||||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||||
import com.bonus.sgzb.common.core.utils.DateTimeHelper;
|
import com.bonus.sgzb.common.core.utils.DateTimeHelper;
|
||||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||||
import com.bonus.sgzb.common.core.utils.StringUtils;
|
import com.bonus.sgzb.common.core.utils.StringUtils;
|
||||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||||
|
|
@ -164,15 +165,18 @@ public class RepairTestInputServiceImpl implements RepairTestInputService {
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||||
Date nowDate = DateUtils.getNowDate();
|
Date nowDate = DateUtils.getNowDate();
|
||||||
String format = dateFormat.format(nowDate);
|
String format = dateFormat.format(nowDate);
|
||||||
int taskNum = taskMapper.selectTaskNumByMonth(nowDate, taskType) + 1;
|
String taskNum = taskMapper.selectTaskNumByMonths(nowDate, taskType);
|
||||||
String codeNum = "";
|
if (StringHelper.isNotEmpty(taskNum)){
|
||||||
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
|
// 将字符串转换为整数
|
||||||
codeNum = code + format + "-00" + taskNum;
|
int num = Integer.parseInt(taskNum);
|
||||||
} else if (taskNum > GlobalContants.NUM3 && taskNum < GlobalContants.NUM4) {
|
// 执行加一操作
|
||||||
codeNum = code + format + "-0" + taskNum;
|
num++;
|
||||||
} else {
|
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||||
codeNum = code + format + "-000" + taskNum;
|
taskNum = String.format("%04d", num);
|
||||||
|
}else {
|
||||||
|
taskNum = "0001";
|
||||||
}
|
}
|
||||||
|
String codeNum = code + format + "-" + taskNum;
|
||||||
return codeNum;
|
return codeNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import java.util.List;
|
||||||
|
|
||||||
import com.bonus.sgzb.common.core.exception.ServiceException;
|
import com.bonus.sgzb.common.core.exception.ServiceException;
|
||||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||||
import com.bonus.sgzb.material.domain.*;
|
import com.bonus.sgzb.material.domain.*;
|
||||||
import com.bonus.sgzb.material.mapper.PurchaseCheckInfoMapper;
|
import com.bonus.sgzb.material.mapper.PurchaseCheckInfoMapper;
|
||||||
|
|
@ -285,15 +286,18 @@ public class ScrapApplyDetailsServiceImpl implements IScrapApplyDetailsService {
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||||
Date nowDate = DateUtils.getNowDate();
|
Date nowDate = DateUtils.getNowDate();
|
||||||
String format = dateFormat.format(nowDate);
|
String format = dateFormat.format(nowDate);
|
||||||
int taskNum = taskMapper.selectTaskNumByMonth(nowDate, taskType) + 1;
|
String taskNum = taskMapper.selectTaskNumByMonths(nowDate, taskType);
|
||||||
String codeNum = "";
|
if (StringHelper.isNotEmpty(taskNum)){
|
||||||
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
|
// 将字符串转换为整数
|
||||||
codeNum = code + format + "-00" + taskNum;
|
int num = Integer.parseInt(taskNum);
|
||||||
} else if (taskNum > GlobalContants.NUM3 && taskNum < GlobalContants.NUM4) {
|
// 执行加一操作
|
||||||
codeNum = code + format + "-0" + taskNum;
|
num++;
|
||||||
} else {
|
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||||
codeNum = code + format + "-000" + taskNum;
|
taskNum = String.format("%04d", num);
|
||||||
|
}else {
|
||||||
|
taskNum = "0001";
|
||||||
}
|
}
|
||||||
|
String codeNum = code + format + "-" + taskNum;
|
||||||
return codeNum;
|
return codeNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||||
|
import com.bonus.sgzb.common.core.utils.StringHelper;
|
||||||
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
import com.bonus.sgzb.material.domain.BackApplyInfo;
|
||||||
import com.bonus.sgzb.material.domain.TmTask;
|
import com.bonus.sgzb.material.domain.TmTask;
|
||||||
import com.bonus.sgzb.material.vo.GlobalContants;
|
import com.bonus.sgzb.material.vo.GlobalContants;
|
||||||
|
|
@ -133,15 +134,18 @@ public class TaskServiceImpl implements TaskService
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||||
Date nowDate = DateUtils.getNowDate();
|
Date nowDate = DateUtils.getNowDate();
|
||||||
String format = dateFormat.format(nowDate);
|
String format = dateFormat.format(nowDate);
|
||||||
int taskNum = tmTaskMapper.selectTaskNumByMonth(nowDate, 36) + 1;
|
String taskNum = tmTaskMapper.selectTaskNumByMonths(nowDate, 36);
|
||||||
String code = "";
|
if (StringHelper.isNotEmpty(taskNum)){
|
||||||
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
|
// 将字符串转换为整数
|
||||||
code = "T" + format + "-00" + taskNum;
|
int num = Integer.parseInt(taskNum);
|
||||||
} else if (taskNum > GlobalContants.NUM3 && taskNum < GlobalContants.NUM4) {
|
// 执行加一操作
|
||||||
code = "T" + format + "-0" + taskNum;
|
num++;
|
||||||
} else {
|
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||||
code = "T" + format + "-000" + taskNum;
|
taskNum = String.format("%04d", num);
|
||||||
}
|
}else {
|
||||||
|
taskNum = "0001";
|
||||||
|
}
|
||||||
|
String code = "T" + format + "-" + taskNum;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue