任务单号获取修改
This commit is contained in:
parent
9ae1c69f71
commit
54cef0f824
|
|
@ -10,6 +10,7 @@ import com.bonus.sgzb.app.service.LeaseApplyInfoService;
|
||||||
import com.bonus.sgzb.app.service.TmTaskService;
|
import com.bonus.sgzb.app.service.TmTaskService;
|
||||||
import com.bonus.sgzb.common.core.utils.DateUtils;
|
import com.bonus.sgzb.common.core.utils.DateUtils;
|
||||||
import com.bonus.sgzb.common.core.utils.GlobalConstants;
|
import com.bonus.sgzb.common.core.utils.GlobalConstants;
|
||||||
|
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.controller.BaseController;
|
import com.bonus.sgzb.common.core.web.controller.BaseController;
|
||||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||||
|
|
@ -237,15 +238,18 @@ public class BackApplyController extends BaseController {
|
||||||
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 = tmTaskService.selectTaskNumByMonth(nowDate, 36) + 1;
|
String taskNum = tmTaskService.selectTaskNumByMonths(nowDate, 36);
|
||||||
String code = "";
|
if (StringHelper.isNotEmpty(taskNum)){
|
||||||
if (taskNum > GlobalConstants.INT_9 && taskNum < GlobalConstants.INT_100) {
|
// 将字符串转换为整数
|
||||||
code = "T" + format + "-00" + taskNum;
|
int num = Integer.parseInt(taskNum);
|
||||||
} else if (taskNum > GlobalConstants.INT_99 && taskNum < GlobalConstants.INT_1000) {
|
// 执行加一操作
|
||||||
code = "T" + format + "-0" + taskNum;
|
num++;
|
||||||
|
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||||
|
taskNum = String.format("%04d", num);
|
||||||
}else {
|
}else {
|
||||||
code = "T" + format + "-000" + taskNum;
|
taskNum = "0001";
|
||||||
}
|
}
|
||||||
|
String code = "T" + format + "-" + taskNum;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@ public interface BackReceiveMapper {
|
||||||
* 查询编号
|
* 查询编号
|
||||||
* @param date
|
* @param date
|
||||||
* @param taskType
|
* @param taskType
|
||||||
* @return int
|
* @return String
|
||||||
*/
|
*/
|
||||||
int selectTaskNumByMonthWx(@Param("date") Date date, @Param("taskType") Integer taskType);
|
String selectTaskNumByMonthWx(@Param("date") Date date, @Param("taskType") Integer taskType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加维修任务
|
* 添加维修任务
|
||||||
|
|
|
||||||
|
|
@ -85,8 +85,6 @@ public interface TmTaskMapper {
|
||||||
|
|
||||||
int batchInsert(@Param("list") List<TmTask> list);
|
int batchInsert(@Param("list") List<TmTask> list);
|
||||||
|
|
||||||
int selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
|
||||||
|
|
||||||
int insertAgreement(TmTask record);
|
int insertAgreement(TmTask record);
|
||||||
|
|
||||||
int updateAgreementByTask(TmTask record);
|
int updateAgreementByTask(TmTask record);
|
||||||
|
|
@ -124,4 +122,13 @@ public interface TmTaskMapper {
|
||||||
int getCountMachine(BackApplyInfo record);
|
int getCountMachine(BackApplyInfo record);
|
||||||
|
|
||||||
int getCountMachineByPidAndTid(MachinePart machinePart);
|
int getCountMachineByPidAndTid(MachinePart machinePart);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取任务编号
|
||||||
|
*
|
||||||
|
* @param nowDate
|
||||||
|
* @param taskType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String selectTaskNumByMonths(@Param("date") Date nowDate, @Param("taskType") Integer taskType);
|
||||||
}
|
}
|
||||||
|
|
@ -83,8 +83,6 @@ public interface TmTaskService{
|
||||||
|
|
||||||
int batchInsert(List<TmTask> list);
|
int batchInsert(List<TmTask> list);
|
||||||
|
|
||||||
int selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
|
||||||
|
|
||||||
int insertAgreement(TmTask record);
|
int insertAgreement(TmTask record);
|
||||||
|
|
||||||
List<TmTask> getLeaseListAll(TmTask task);
|
List<TmTask> getLeaseListAll(TmTask task);
|
||||||
|
|
@ -104,4 +102,13 @@ public interface TmTaskService{
|
||||||
List<TmTask> getLeaseListAllCq(TmTask task);
|
List<TmTask> getLeaseListAllCq(TmTask task);
|
||||||
|
|
||||||
List<TmTask> getLeaseOutListByUser(TmTask task);
|
List<TmTask> getLeaseOutListByUser(TmTask task);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取任务编号
|
||||||
|
*
|
||||||
|
* @param nowDate
|
||||||
|
* @param taskType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String selectTaskNumByMonths(@Param("date") Date nowDate, @Param("taskType") Integer taskType);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -454,7 +454,17 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
||||||
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 = backReceiveMapper.selectTaskNumByMonthWx(nowDate, taskType) + 1;
|
String taskNum = backReceiveMapper.selectTaskNumByMonthWx(nowDate, taskType);
|
||||||
|
if (StringHelper.isNotEmpty(taskNum)) {
|
||||||
|
// 将字符串转换为整数
|
||||||
|
int num = Integer.parseInt(taskNum);
|
||||||
|
// 执行加一操作
|
||||||
|
num++;
|
||||||
|
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||||
|
taskNum = String.format("%04d", num);
|
||||||
|
} else {
|
||||||
|
taskNum = "0001";
|
||||||
|
}
|
||||||
String code = "";
|
String code = "";
|
||||||
if (GlobalConstants.INT_41 == taskType) {
|
if (GlobalConstants.INT_41 == taskType) {
|
||||||
code = "WX";
|
code = "WX";
|
||||||
|
|
@ -462,13 +472,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
||||||
if (GlobalConstants.INT_57 == taskType) {
|
if (GlobalConstants.INT_57 == taskType) {
|
||||||
code = "BF";
|
code = "BF";
|
||||||
}
|
}
|
||||||
if (taskNum > GlobalConstants.INT_9 && taskNum < GlobalConstants.INT_100) {
|
code = code + format + "-" + taskNum;
|
||||||
code = code + format + "-00" + taskNum;
|
|
||||||
} else if (taskNum > GlobalConstants.INT_99 && taskNum < GlobalConstants.INT_1000) {
|
|
||||||
code = code + format + "-0" + taskNum;
|
|
||||||
} else {
|
|
||||||
code = code + format + "-000" + taskNum;
|
|
||||||
}
|
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -582,6 +582,11 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
return tmTaskMapper.getLeaseOutListByUser(task);
|
return tmTaskMapper.getLeaseOutListByUser(task);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String selectTaskNumByMonths(Date nowDate, Integer taskType) {
|
||||||
|
return tmTaskMapper.selectTaskNumByMonths(nowDate,taskType);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取领料申请列表
|
* 获取领料申请列表
|
||||||
|
|
@ -1166,11 +1171,6 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
return tmTaskMapper.batchInsert(list);
|
return tmTaskMapper.batchInsert(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int selectTaskNumByMonth(Date date, Integer taskType) {
|
|
||||||
return tmTaskMapper.selectTaskNumByMonth(date, taskType);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertAgreement(TmTask record) {
|
public int insertAgreement(TmTask record) {
|
||||||
return tmTaskMapper.insertAgreement(record);
|
return tmTaskMapper.insertAgreement(record);
|
||||||
|
|
|
||||||
|
|
@ -696,8 +696,12 @@
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectTaskNumByMonthWx" resultType="java.lang.Integer">
|
<select id="selectTaskNumByMonthWx" resultType="java.lang.String">
|
||||||
select count(*) from tm_task where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') and task_type = #{taskType}
|
SELECT SUBSTRING(`code`, - 4) as code
|
||||||
|
FROM tm_task
|
||||||
|
WHERE DATE_FORMAT(create_time, '%y%m') = DATE_FORMAT(#{date}, '%y%m')
|
||||||
|
AND task_type = #{taskType}
|
||||||
|
ORDER BY create_time DESC LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
<select id="getHgList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
<select id="getHgList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,6 @@
|
||||||
where task_id = #{taskId,jdbcType=BIGINT}
|
where task_id = #{taskId,jdbcType=BIGINT}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectTaskNumByMonth" resultType="java.lang.Integer">
|
|
||||||
select count(*) from tm_task where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') and task_type = #{taskType}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<update id="deleteTaskByPrimaryKey" >
|
<update id="deleteTaskByPrimaryKey" >
|
||||||
update tm_task set `status` = '0'
|
update tm_task set `status` = '0'
|
||||||
where task_id = #{taskId}
|
where task_id = #{taskId}
|
||||||
|
|
@ -1033,4 +1029,11 @@
|
||||||
WHERE
|
WHERE
|
||||||
parent_id = #{parentId} and type_id = #{modelId}
|
parent_id = #{parentId} and type_id = #{modelId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectTaskNumByMonths" resultType="java.lang.String">
|
||||||
|
SELECT SUBSTRING(`code`, - 4) as code
|
||||||
|
FROM tm_task
|
||||||
|
WHERE DATE_FORMAT(create_time, '%y%m') = DATE_FORMAT(#{date}, '%y%m')
|
||||||
|
AND task_type = #{taskType}
|
||||||
|
ORDER BY create_time DESC LIMIT 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public interface BackApplyMapper {
|
||||||
* @param taskType
|
* @param taskType
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
String selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加
|
* 增加
|
||||||
|
|
|
||||||
|
|
@ -85,4 +85,13 @@ public interface TaskMapper {
|
||||||
List<TmTask> getMaTypeDetails(BackApplyInfo backApplyInfo);
|
List<TmTask> getMaTypeDetails(BackApplyInfo backApplyInfo);
|
||||||
|
|
||||||
MachinePart getMachineParts(TmTask typeId);
|
MachinePart getMachineParts(TmTask typeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取任务编号
|
||||||
|
*
|
||||||
|
* @param nowDate
|
||||||
|
* @param taskType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String selectTaskNumByMonths(@Param("date") Date nowDate, @Param("taskType") Integer taskType);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ package com.bonus.sgzb.material.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
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;
|
||||||
|
|
@ -93,15 +94,18 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
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 = backApplyMapper.selectTaskNumByMonth(nowDate, 36) + 1;
|
String taskNum = backApplyMapper.selectTaskNumByMonth(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++;
|
||||||
|
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||||
|
taskNum = String.format("%04d", num);
|
||||||
}else {
|
}else {
|
||||||
code = "T" + format + "-000" + taskNum;
|
taskNum = "0001";
|
||||||
}
|
}
|
||||||
|
String code = "T" + format + "-" + taskNum;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.sgzb.material.service.impl;
|
package com.bonus.sgzb.material.service.impl;
|
||||||
|
|
||||||
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.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;
|
||||||
import com.bonus.sgzb.material.domain.*;
|
import com.bonus.sgzb.material.domain.*;
|
||||||
|
|
@ -341,15 +342,18 @@ public class PurchaseAccessoryServiceImpl implements IPurchaseAccessoryService {
|
||||||
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, 67) + 1;
|
String taskNum = taskMapper.selectTaskNumByMonths(nowDate, 67);
|
||||||
String code = "";
|
if (StringHelper.isNotEmpty(taskNum)) {
|
||||||
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
|
// 将字符串转换为整数
|
||||||
code = "XG" + format + "-00" + taskNum;
|
int num = Integer.parseInt(taskNum);
|
||||||
} else if (taskNum > GlobalContants.NUM3 && taskNum < GlobalContants.NUM4) {
|
// 执行加一操作
|
||||||
code = "XG" + format + "-0" + taskNum;
|
num++;
|
||||||
|
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||||
|
taskNum = String.format("%04d", num);
|
||||||
} else {
|
} else {
|
||||||
code = "XG" + format + "-000" + taskNum;
|
taskNum = "0001";
|
||||||
}
|
}
|
||||||
|
String code = "XG" + format + "-" + taskNum;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
package com.bonus.sgzb.material.service.impl;
|
package com.bonus.sgzb.material.service.impl;
|
||||||
|
|
||||||
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.PurchaseCheckDetailsMapper;
|
import com.bonus.sgzb.material.mapper.PurchaseCheckDetailsMapper;
|
||||||
|
|
@ -172,15 +173,18 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
||||||
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, 23) + 1;
|
String taskNum = taskMapper.selectTaskNumByMonths(nowDate, 23);
|
||||||
String code = "";
|
if (StringHelper.isNotEmpty(taskNum)){
|
||||||
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
|
// 将字符串转换为整数
|
||||||
code = "XG" + format + "-00" + taskNum;
|
int num = Integer.parseInt(taskNum);
|
||||||
} else if (taskNum > GlobalContants.NUM3 && taskNum < GlobalContants.NUM4) {
|
// 执行加一操作
|
||||||
code = "XG" + format + "-0" + taskNum;
|
num++;
|
||||||
|
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||||
|
taskNum = String.format("%04d", num);
|
||||||
}else {
|
}else {
|
||||||
code = "XG" + format + "-000" + taskNum;
|
taskNum = "0001";
|
||||||
}
|
}
|
||||||
|
String code = "XG" + format + "-" + taskNum;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.sgzb.material.service.impl;
|
||||||
import com.bonus.sgzb.base.api.domain.MaMachine;
|
import com.bonus.sgzb.base.api.domain.MaMachine;
|
||||||
import com.bonus.sgzb.base.api.domain.MaType;
|
import com.bonus.sgzb.base.api.domain.MaType;
|
||||||
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.PurchaseCheckDetailsMapper;
|
import com.bonus.sgzb.material.mapper.PurchaseCheckDetailsMapper;
|
||||||
|
|
@ -246,15 +247,18 @@ public class PurchaseCheckServiceCenterServiceImpl implements PurchaseCheckServi
|
||||||
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, 23) + 1;
|
String taskNum = taskMapper.selectTaskNumByMonths(nowDate, 23);
|
||||||
String code = "";
|
if (StringHelper.isNotEmpty(taskNum)){
|
||||||
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
|
// 将字符串转换为整数
|
||||||
code = "XG" + format + "-00" + taskNum;
|
int num = Integer.parseInt(taskNum);
|
||||||
} else if (taskNum > GlobalContants.NUM3 && taskNum < GlobalContants.NUM4) {
|
// 执行加一操作
|
||||||
code = "XG" + format + "-0" + taskNum;
|
num++;
|
||||||
|
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||||
|
taskNum = String.format("%04d", num);
|
||||||
}else {
|
}else {
|
||||||
code = "XG" + format + "-000" + taskNum;
|
taskNum = "0001";
|
||||||
}
|
}
|
||||||
|
String code = "XG" + format + "-" + taskNum;
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -502,8 +502,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE
|
WHERE
|
||||||
subquery1.out_num - COALESCE(subquery2.audit_num, 0)>0
|
subquery1.out_num - COALESCE(subquery2.audit_num, 0)>0
|
||||||
</select>
|
</select>
|
||||||
<select id="selectTaskNumByMonth" resultType="java.lang.Integer">
|
<select id="selectTaskNumByMonth" resultType="java.lang.String">
|
||||||
select count(*) from tm_task where DATE_FORMAT(create_time,'%y%m') = DATE_FORMAT(#{date},'%y%m') and task_type = #{taskType}
|
SELECT SUBSTRING(`code`, - 4) as code
|
||||||
|
FROM tm_task
|
||||||
|
WHERE DATE_FORMAT(create_time, '%y%m') = DATE_FORMAT(#{date}, '%y%m')
|
||||||
|
AND task_type = #{taskType}
|
||||||
|
ORDER BY create_time DESC LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getView" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
<select id="getView" resultType="com.bonus.sgzb.material.domain.BackApplyInfo">
|
||||||
|
|
|
||||||
|
|
@ -409,7 +409,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
pmi.fix_code fixCode,
|
pmi.fix_code fixCode,
|
||||||
pcd.type_id typeId,
|
pcd.type_id typeId,
|
||||||
pcd.task_id taskId,
|
pcd.task_id taskId,
|
||||||
pcd.remark remark,
|
pci.remark remark,
|
||||||
mt.CODE specsCode,
|
mt.CODE specsCode,
|
||||||
mt.unit_name unitName,
|
mt.unit_name unitName,
|
||||||
mt1.CODE typeCode,
|
mt1.CODE typeCode,
|
||||||
|
|
@ -430,6 +430,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
( pmi.ma_code IS NOT NULL, 1, pcd.check_num ) checkNum
|
( pmi.ma_code IS NOT NULL, 1, pcd.check_num ) checkNum
|
||||||
FROM
|
FROM
|
||||||
purchase_check_details pcd
|
purchase_check_details pcd
|
||||||
|
LEFT JOIN purchase_check_info pci on pci.task_id=pcd.task_id
|
||||||
LEFT JOIN purchase_macode_info pmi ON pmi.task_id = pcd.task_id
|
LEFT JOIN purchase_macode_info pmi ON pmi.task_id = pcd.task_id
|
||||||
AND pmi.type_id = pcd.type_id
|
AND pmi.type_id = pcd.type_id
|
||||||
LEFT JOIN ma_machine mm ON pmi.ma_code = mm.ma_code
|
LEFT JOIN ma_machine mm ON pmi.ma_code = mm.ma_code
|
||||||
|
|
|
||||||
|
|
@ -244,4 +244,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
WHERE
|
WHERE
|
||||||
mt.type_id = #{typeId}
|
mt.type_id = #{typeId}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectTaskNumByMonths" resultType="java.lang.String">
|
||||||
|
SELECT SUBSTRING(`code`, - 4) as code
|
||||||
|
FROM tm_task
|
||||||
|
WHERE DATE_FORMAT(create_time, '%y%m') = DATE_FORMAT(#{date}, '%y%m')
|
||||||
|
AND task_type = #{taskType}
|
||||||
|
ORDER BY create_time DESC LIMIT 1
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue