生成单号修改 统一 字母+年月日+三位序号
This commit is contained in:
parent
f6f08286bc
commit
1b38fbe62f
|
|
@ -46,17 +46,32 @@ public class MaterialConstants {
|
||||||
|
|
||||||
public final static String STRING_ADMIN = "admin";
|
public final static String STRING_ADMIN = "admin";
|
||||||
|
|
||||||
|
/** 新购号的开头字母 */
|
||||||
|
public final static String PURCHASE_TASK_TYPE_LABEL = "XG";
|
||||||
|
|
||||||
/** 协议号的开头字母 */
|
/** 协议号的开头字母 */
|
||||||
public static final String AGREEMENT_PREFIX = "H";
|
public static final String AGREEMENT_PREFIX = "H";
|
||||||
|
|
||||||
/** 领料单号的开头字母 */
|
/** 领料单号的开头字母 */
|
||||||
public static final String LEASE_TASK_TYPE_LABEL = "L";
|
public static final String LEASE_TASK_TYPE_LABEL = "L";
|
||||||
|
|
||||||
|
/** 退料单号的开头字母 */
|
||||||
|
public static final String BACK_TASK_TYPE_LABEL = "T";
|
||||||
|
|
||||||
/** 维修单号的开头字母 */
|
/** 维修单号的开头字母 */
|
||||||
public static final String REPAIR_TASK_TYPE_LABEL = "WX";
|
public static final String REPAIR_TASK_TYPE_LABEL = "WX";
|
||||||
|
|
||||||
public static final String INNER_PROTOCAL = "1"; //内部单位协议
|
/** 报废单号的开头字母 */
|
||||||
|
public static final String SCRAP_TASK_TYPE_LABEL = "BF";
|
||||||
|
|
||||||
public static final String OUTER_PROTOCAL = "2"; //外部单位协议
|
/**
|
||||||
|
* 内部单位协议
|
||||||
|
*/
|
||||||
|
public static final String INNER_PROTOCAL = "1";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外部单位协议
|
||||||
|
*/
|
||||||
|
public static final String OUTER_PROTOCAL = "2";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ import java.util.stream.Collectors;
|
||||||
|
|
||||||
import cn.hutool.core.util.PhoneUtil;
|
import cn.hutool.core.util.PhoneUtil;
|
||||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||||
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
import com.bonus.common.biz.enums.BackTaskStatusEnum;
|
import com.bonus.common.biz.enums.BackTaskStatusEnum;
|
||||||
import com.bonus.common.biz.enums.HttpCodeEnum;
|
import com.bonus.common.biz.enums.HttpCodeEnum;
|
||||||
import com.bonus.common.biz.enums.MaMachineStatusEnum;
|
import com.bonus.common.biz.enums.MaMachineStatusEnum;
|
||||||
|
|
@ -245,14 +246,10 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//生成退料单号
|
|
||||||
String code = getString();
|
|
||||||
if (StringUtils.isBlank(code)) {
|
|
||||||
return AjaxResult.error("后台退料编号生成异常,请重试!");
|
|
||||||
}
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
try {
|
try {
|
||||||
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
||||||
|
String code = genderTaskCode(thisMonthMaxOrder);
|
||||||
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(),
|
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(),
|
||||||
BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
||||||
null,thisMonthMaxOrder + 1, code);
|
null,thisMonthMaxOrder + 1, code);
|
||||||
|
|
@ -280,6 +277,19 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
return result > 0 ? AjaxResult.success() : AjaxResult.error("保存失败,请重试!");
|
return result > 0 ? AjaxResult.success() : AjaxResult.error("保存失败,请重试!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成退料单号
|
||||||
|
* @param thisMonthMaxOrder
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private String genderTaskCode(int thisMonthMaxOrder) {
|
||||||
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date nowDate = DateUtils.getNowDate();
|
||||||
|
String format = dateFormat.format(nowDate);
|
||||||
|
String result = format.replace("-", "");
|
||||||
|
return MaterialConstants.BACK_TASK_TYPE_LABEL + result + String.format("-%03d", thisMonthMaxOrder + 1);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存退料详情
|
* 保存退料详情
|
||||||
* @param dto
|
* @param dto
|
||||||
|
|
@ -380,29 +390,6 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
details.setBackStatus("1");
|
details.setBackStatus("1");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成退料单号
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private String getString() {
|
|
||||||
//根据前台传过来的数据,生成退料单号
|
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
|
||||||
Date nowDate = DateUtils.getNowDate();
|
|
||||||
String format = dateFormat.format(nowDate);
|
|
||||||
String taskNum = backApplyInfoMapper.selectTaskNumByMonth(nowDate, 3);
|
|
||||||
if (StringUtils.isNotBlank(taskNum)) {
|
|
||||||
// 将字符串转换为整数
|
|
||||||
int num = Integer.parseInt(taskNum);
|
|
||||||
// 执行加一操作
|
|
||||||
num++;
|
|
||||||
// 将结果转换回字符串格式,并确保结果是2位数,不足2位则在前面补0
|
|
||||||
taskNum = String.format("%02d", num);
|
|
||||||
} else {
|
|
||||||
taskNum = "01";
|
|
||||||
}
|
|
||||||
return "T" + format + "-" + taskNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改退料任务
|
* 修改退料任务
|
||||||
*
|
*
|
||||||
|
|
@ -639,7 +626,7 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑打印状态
|
* 编辑打印状态
|
||||||
* @param dto
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -664,12 +651,8 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
if (StringUtils.isNotBlank(dto.getBackApplyInfo().getPhone()) && !PhoneUtil.isMobile(dto.getBackApplyInfo().getPhone())) {
|
if (StringUtils.isNotBlank(dto.getBackApplyInfo().getPhone()) && !PhoneUtil.isMobile(dto.getBackApplyInfo().getPhone())) {
|
||||||
return AjaxResult.error("手机号格式不正确,请重新填写!");
|
return AjaxResult.error("手机号格式不正确,请重新填写!");
|
||||||
}
|
}
|
||||||
//生成退料单号
|
|
||||||
String code = getString();
|
|
||||||
if (StringUtils.isBlank(code)) {
|
|
||||||
return AjaxResult.error("后台退料编号生成异常,请重试!");
|
|
||||||
}
|
|
||||||
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
||||||
|
String code = genderTaskCode(thisMonthMaxOrder);
|
||||||
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(),
|
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(),
|
||||||
BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
||||||
null, thisMonthMaxOrder + 1, code);
|
null, thisMonthMaxOrder + 1, code);
|
||||||
|
|
@ -703,12 +686,8 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
if (StringUtils.isNotBlank(dto.getBackApplyInfo().getPhone()) && !PhoneUtil.isMobile(dto.getBackApplyInfo().getPhone())) {
|
if (StringUtils.isNotBlank(dto.getBackApplyInfo().getPhone()) && !PhoneUtil.isMobile(dto.getBackApplyInfo().getPhone())) {
|
||||||
return AjaxResult.error("手机号格式不正确,请重新填写!");
|
return AjaxResult.error("手机号格式不正确,请重新填写!");
|
||||||
}
|
}
|
||||||
//生成退料单号
|
|
||||||
String code = getString();
|
|
||||||
if (StringUtils.isBlank(code)) {
|
|
||||||
return AjaxResult.error("后台退料编号生成异常,请重试!");
|
|
||||||
}
|
|
||||||
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId());
|
||||||
|
String code = genderTaskCode(thisMonthMaxOrder);
|
||||||
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(),
|
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(),
|
||||||
BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
||||||
null, thisMonthMaxOrder + 1, code);
|
null, thisMonthMaxOrder + 1, code);
|
||||||
|
|
@ -1169,10 +1148,10 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
*/
|
*/
|
||||||
private Long insertTt(String createBy) {
|
private Long insertTt(String createBy) {
|
||||||
Long newTask = null;
|
Long newTask = null;
|
||||||
// 生成维修单号
|
|
||||||
String code = genCodeRule();
|
|
||||||
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId());
|
int thisMonthMaxOrder = taskMapper.getMonthMaxOrderByDate(DateUtils.getCurrentYear(), DateUtils.getCurrentMonth(), TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId());
|
||||||
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_BACK.getTaskTypeId(), BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
// 生成维修单号
|
||||||
|
String code = genderWxTaskCode(thisMonthMaxOrder);
|
||||||
|
TmTask tmTask = new TmTask(null, TmTaskTypeEnum.TM_TASK_REPAIR.getTaskTypeId(), BackTaskStatusEnum.BACK_TASK_NO_FINISHED.getStatus(),
|
||||||
null,thisMonthMaxOrder + 1, code);
|
null,thisMonthMaxOrder + 1, code);
|
||||||
tmTask.setCreateTime(DateUtils.getNowDate());
|
tmTask.setCreateTime(DateUtils.getNowDate());
|
||||||
tmTask.setCreateBy(createBy);
|
tmTask.setCreateBy(createBy);
|
||||||
|
|
@ -1187,25 +1166,15 @@ public class BackApplyInfoServiceImpl implements IBackApplyInfoService {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成维修单号
|
* 生成维修单号
|
||||||
|
* @param thisMonthMaxOrder
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
private String genCodeRule() {
|
private String genderWxTaskCode(int thisMonthMaxOrder) {
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
Date nowDate = DateUtils.getNowDate();
|
Date nowDate = DateUtils.getNowDate();
|
||||||
String format = dateFormat.format(nowDate);
|
String format = dateFormat.format(nowDate);
|
||||||
Integer taskNum = backApplyInfoMapper.selectTaskNumByMonthWx(nowDate);
|
String result = format.replace("-", "");
|
||||||
String taskNumStr = "";
|
return MaterialConstants.REPAIR_TASK_TYPE_LABEL + result + String.format("-%03d", thisMonthMaxOrder + 1);
|
||||||
if (taskNum != null) {
|
|
||||||
// 将字符串转换为整数
|
|
||||||
// int num = Integer.parseInt(taskNum);
|
|
||||||
// 执行加一操作
|
|
||||||
taskNum++;
|
|
||||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
|
||||||
taskNumStr = String.format("%02d", taskNum);
|
|
||||||
} else {
|
|
||||||
taskNumStr = "01";
|
|
||||||
}
|
|
||||||
return "WX" + format + "-" + taskNumStr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -112,8 +112,7 @@ public class BmAgreementInfoServiceImpl implements IBmAgreementInfoService
|
||||||
String format = dateFormat.format(nowDate);
|
String format = dateFormat.format(nowDate);
|
||||||
String result = format.replace("-", "");
|
String result = format.replace("-", "");
|
||||||
int num = bmAgreementInfoMapper.selectNumByMonth(nowDate);
|
int num = bmAgreementInfoMapper.selectNumByMonth(nowDate);
|
||||||
num = num + 1;
|
return MaterialConstants.AGREEMENT_PREFIX + result + String.format("-%03d", num + 1);
|
||||||
return MaterialConstants.AGREEMENT_PREFIX + result + String.format("-%04d", num);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
package com.bonus.material.lease.service.impl;
|
package com.bonus.material.lease.service.impl;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
|
@ -202,7 +204,11 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
* @return 任务对象
|
* @return 任务对象
|
||||||
*/
|
*/
|
||||||
private static String genderTaskCode(Integer thisMonthMaxOrder) {
|
private static String genderTaskCode(Integer thisMonthMaxOrder) {
|
||||||
return MaterialConstants.LEASE_TASK_TYPE_LABEL + DateUtils.getCurrentYear() + DateUtils.getCurrentMonth() + String.format("%06d", thisMonthMaxOrder + 1);
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date nowDate = DateUtils.getNowDate();
|
||||||
|
String format = dateFormat.format(nowDate);
|
||||||
|
String result = format.replace("-", "");
|
||||||
|
return MaterialConstants.LEASE_TASK_TYPE_LABEL + result + String.format("-%03d", thisMonthMaxOrder + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@ package com.bonus.material.purchase.service.impl;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
|
||||||
import java.util.concurrent.atomic.AtomicReference;
|
import java.util.concurrent.atomic.AtomicReference;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import com.bonus.common.biz.constant.BmConfigItems;
|
import com.bonus.common.biz.constant.BmConfigItems;
|
||||||
|
|
@ -37,6 +37,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
import static com.bonus.common.biz.constant.MaterialConstants.PURCHASE_TASK_TYPE_LABEL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 新购验收任务Service业务层处理
|
* 新购验收任务Service业务层处理
|
||||||
*
|
*
|
||||||
|
|
@ -45,8 +47,6 @@ import javax.annotation.Resource;
|
||||||
@Service
|
@Service
|
||||||
public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
|
|
||||||
public static final String PURCHASE_TASK_TYPE_LABEL = "XG";
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private IBmConfigService bmConfigService;
|
private IBmConfigService bmConfigService;
|
||||||
|
|
||||||
|
|
@ -376,7 +376,11 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
* @return 任务对象
|
* @return 任务对象
|
||||||
*/
|
*/
|
||||||
private static String genderTaskCode(Integer thisMonthMaxOrder) {
|
private static String genderTaskCode(Integer thisMonthMaxOrder) {
|
||||||
return PURCHASE_TASK_TYPE_LABEL + DateUtils.getCurrentYear() + DateUtils.getCurrentMonth() + String.format("%06d", thisMonthMaxOrder + 1);
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
Date nowDate = DateUtils.getNowDate();
|
||||||
|
String format = dateFormat.format(nowDate);
|
||||||
|
String result = format.replace("-", "");
|
||||||
|
return PURCHASE_TASK_TYPE_LABEL + result + String.format("-%03d", thisMonthMaxOrder + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.bonus.common.biz.constant.MaterialConstants.SCRAP_TASK_TYPE_LABEL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修试审核详细Service业务层处理
|
* 修试审核详细Service业务层处理
|
||||||
*
|
*
|
||||||
|
|
@ -230,7 +232,7 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
if (scrapNumList.get(0).getCompanyId() != null) {
|
if (scrapNumList.get(0).getCompanyId() != null) {
|
||||||
companyId = scrapNumList.get(0).getCompanyId();
|
companyId = scrapNumList.get(0).getCompanyId();
|
||||||
}
|
}
|
||||||
taskCode = purchaseCodeRule("BF", TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId());
|
taskCode = purchaseCodeRule(SCRAP_TASK_TYPE_LABEL, TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId());
|
||||||
//创建报废任务
|
//创建报废任务
|
||||||
long scrapTaskId = genTask(taskCode, TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId(), RepairTaskStatusEnum.SCRAP_UNDER_REVIEW.getStatus(), tmTaskAgreement, companyId);
|
long scrapTaskId = genTask(taskCode, TmTaskTypeEnum.TM_TASK_SCRAP.getTaskTypeId(), RepairTaskStatusEnum.SCRAP_UNDER_REVIEW.getStatus(), tmTaskAgreement, companyId);
|
||||||
for (RepairAuditDetails scrapDetails : scrapNumList) {
|
for (RepairAuditDetails scrapDetails : scrapNumList) {
|
||||||
|
|
@ -285,9 +287,9 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
if (repairDetailList.get(0).getCompanyId() != null) {
|
if (repairDetailList.get(0).getCompanyId() != null) {
|
||||||
companyId = repairDetailList.get(0).getCompanyId();
|
companyId = repairDetailList.get(0).getCompanyId();
|
||||||
}
|
}
|
||||||
taskCode = purchaseCodeRule(MaterialConstants.REPAIR_TASK_TYPE_LABEL, 41);
|
taskCode = purchaseCodeRule(MaterialConstants.REPAIR_TASK_TYPE_LABEL, 4);
|
||||||
taskStatus = 43;
|
taskStatus = 43;
|
||||||
taskType = 41;
|
taskType = 4;
|
||||||
long inputTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
|
long inputTaskId = genTask(taskCode, taskType, taskStatus, tmTaskAgreement, companyId);
|
||||||
for (RepairAuditDetails inputDetails : repairDetailList) {
|
for (RepairAuditDetails inputDetails : repairDetailList) {
|
||||||
Long backId = repairAuditDetailsMapper.getBackId(inputDetails.getRepairId());
|
Long backId = repairAuditDetailsMapper.getBackId(inputDetails.getRepairId());
|
||||||
|
|
@ -351,10 +353,10 @@ public class RepairAuditDetailsServiceImpl implements IRepairAuditDetailsService
|
||||||
if (StringUtils.isNotEmpty(taskNum)){
|
if (StringUtils.isNotEmpty(taskNum)){
|
||||||
// 将字符串转换为整数并加一
|
// 将字符串转换为整数并加一
|
||||||
int num = Integer.parseInt(taskNum) + 1;
|
int num = Integer.parseInt(taskNum) + 1;
|
||||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
// 将结果转换回字符串格式
|
||||||
taskNum = String.format("%04d", num);
|
taskNum = String.format("%03d", num);
|
||||||
}else {
|
}else {
|
||||||
taskNum = "0001";
|
taskNum = "001";
|
||||||
}
|
}
|
||||||
String codeNum = code + format + "-" + taskNum;
|
String codeNum = code + format + "-" + taskNum;
|
||||||
return codeNum;
|
return codeNum;
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="selectTaskNumByMonths" resultType="java.lang.String">
|
<select id="selectTaskNumByMonths" resultType="java.lang.String">
|
||||||
SELECT SUBSTRING(`code`, - 4) as code
|
SELECT SUBSTRING(`code`, - 3) as code
|
||||||
FROM tm_task
|
FROM tm_task
|
||||||
WHERE DATE_FORMAT(create_time, '%y%m') = DATE_FORMAT(#{date}, '%y%m')
|
WHERE DATE_FORMAT(create_time, '%y%m') = DATE_FORMAT(#{date}, '%y%m')
|
||||||
AND task_type = #{taskType}
|
AND task_type = #{taskType}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue