任务单号获取修改
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.common.core.utils.DateUtils;
|
||||
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.web.controller.BaseController;
|
||||
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -237,15 +238,18 @@ public class BackApplyController extends BaseController {
|
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
int taskNum = tmTaskService.selectTaskNumByMonth(nowDate, 36) + 1;
|
||||
String code = "";
|
||||
if (taskNum > GlobalConstants.INT_9 && taskNum < GlobalConstants.INT_100) {
|
||||
code = "T" + format + "-00" + taskNum;
|
||||
} else if (taskNum > GlobalConstants.INT_99 && taskNum < GlobalConstants.INT_1000) {
|
||||
code = "T" + format + "-0" + taskNum;
|
||||
String taskNum = tmTaskService.selectTaskNumByMonths(nowDate, 36);
|
||||
if (StringHelper.isNotEmpty(taskNum)){
|
||||
// 将字符串转换为整数
|
||||
int num = Integer.parseInt(taskNum);
|
||||
// 执行加一操作
|
||||
num++;
|
||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||
taskNum = String.format("%04d", num);
|
||||
}else {
|
||||
code = "T" + format + "-000" + taskNum;
|
||||
taskNum = "0001";
|
||||
}
|
||||
String code = "T" + format + "-" + taskNum;
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ public interface BackReceiveMapper {
|
|||
* 查询编号
|
||||
* @param date
|
||||
* @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 selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
||||
|
||||
int insertAgreement(TmTask record);
|
||||
|
||||
int updateAgreementByTask(TmTask record);
|
||||
|
|
@ -124,4 +122,13 @@ public interface TmTaskMapper {
|
|||
int getCountMachine(BackApplyInfo record);
|
||||
|
||||
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 selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
||||
|
||||
int insertAgreement(TmTask record);
|
||||
|
||||
List<TmTask> getLeaseListAll(TmTask task);
|
||||
|
|
@ -104,4 +102,13 @@ public interface TmTaskService{
|
|||
List<TmTask> getLeaseListAllCq(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");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
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 = "";
|
||||
if (GlobalConstants.INT_41 == taskType) {
|
||||
code = "WX";
|
||||
|
|
@ -462,13 +472,7 @@ public class BackReceiveServiceImpl implements BackReceiveService {
|
|||
if (GlobalConstants.INT_57 == taskType) {
|
||||
code = "BF";
|
||||
}
|
||||
if (taskNum > GlobalConstants.INT_9 && taskNum < GlobalConstants.INT_100) {
|
||||
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;
|
||||
}
|
||||
code = code + format + "-" + taskNum;
|
||||
return code;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -582,6 +582,11 @@ public class TmTaskServiceImpl implements TmTaskService {
|
|||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int selectTaskNumByMonth(Date date, Integer taskType) {
|
||||
return tmTaskMapper.selectTaskNumByMonth(date, taskType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertAgreement(TmTask record) {
|
||||
return tmTaskMapper.insertAgreement(record);
|
||||
|
|
|
|||
|
|
@ -696,8 +696,12 @@
|
|||
</if>
|
||||
</select>
|
||||
|
||||
<select id="selectTaskNumByMonthWx" 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 id="selectTaskNumByMonthWx" 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>
|
||||
<select id="getHgList" resultType="com.bonus.sgzb.app.domain.BackApplyInfo">
|
||||
SELECT
|
||||
|
|
|
|||
|
|
@ -28,10 +28,6 @@
|
|||
where task_id = #{taskId,jdbcType=BIGINT}
|
||||
</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 tm_task set `status` = '0'
|
||||
where task_id = #{taskId}
|
||||
|
|
@ -1033,4 +1029,11 @@
|
|||
WHERE
|
||||
parent_id = #{parentId} and type_id = #{modelId}
|
||||
</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>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public interface BackApplyMapper {
|
|||
* @param taskType
|
||||
* @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);
|
||||
|
||||
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 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.web.domain.AjaxResult;
|
||||
import com.bonus.sgzb.common.security.utils.SecurityUtils;
|
||||
|
|
@ -93,15 +94,18 @@ public class BackApplyServiceImpl implements BackApplyService {
|
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
int taskNum = backApplyMapper.selectTaskNumByMonth(nowDate, 36) + 1;
|
||||
String code = "";
|
||||
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
|
||||
code = "T" + format + "-00" + taskNum;
|
||||
} else if (taskNum > GlobalContants.NUM3 && taskNum < GlobalContants.NUM4) {
|
||||
code = "T" + format + "-0" + taskNum;
|
||||
String taskNum = backApplyMapper.selectTaskNumByMonth(nowDate, 36);
|
||||
if (StringHelper.isNotEmpty(taskNum)){
|
||||
// 将字符串转换为整数
|
||||
int num = Integer.parseInt(taskNum);
|
||||
// 执行加一操作
|
||||
num++;
|
||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||
taskNum = String.format("%04d", num);
|
||||
}else {
|
||||
code = "T" + format + "-000" + taskNum;
|
||||
taskNum = "0001";
|
||||
}
|
||||
String code = "T" + format + "-" + taskNum;
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.sgzb.material.service.impl;
|
||||
|
||||
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.security.utils.SecurityUtils;
|
||||
import com.bonus.sgzb.material.domain.*;
|
||||
|
|
@ -341,15 +342,18 @@ public class PurchaseAccessoryServiceImpl implements IPurchaseAccessoryService {
|
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
int taskNum = taskMapper.selectTaskNumByMonth(nowDate, 67) + 1;
|
||||
String code = "";
|
||||
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
|
||||
code = "XG" + format + "-00" + taskNum;
|
||||
} else if (taskNum > GlobalContants.NUM3 && taskNum < GlobalContants.NUM4) {
|
||||
code = "XG" + format + "-0" + taskNum;
|
||||
String taskNum = taskMapper.selectTaskNumByMonths(nowDate, 67);
|
||||
if (StringHelper.isNotEmpty(taskNum)) {
|
||||
// 将字符串转换为整数
|
||||
int num = Integer.parseInt(taskNum);
|
||||
// 执行加一操作
|
||||
num++;
|
||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||
taskNum = String.format("%04d", num);
|
||||
} else {
|
||||
code = "XG" + format + "-000" + taskNum;
|
||||
taskNum = "0001";
|
||||
}
|
||||
String code = "XG" + format + "-" + taskNum;
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.sgzb.material.service.impl;
|
||||
|
||||
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.material.domain.*;
|
||||
import com.bonus.sgzb.material.mapper.PurchaseCheckDetailsMapper;
|
||||
|
|
@ -172,15 +173,18 @@ public class PurchaseCheckInfoServiceImpl implements IPurchaseCheckInfoService {
|
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
int taskNum = taskMapper.selectTaskNumByMonth(nowDate, 23) + 1;
|
||||
String code = "";
|
||||
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
|
||||
code = "XG" + format + "-00" + taskNum;
|
||||
} else if (taskNum > GlobalContants.NUM3 && taskNum < GlobalContants.NUM4) {
|
||||
code = "XG" + format + "-0" + taskNum;
|
||||
String taskNum = taskMapper.selectTaskNumByMonths(nowDate, 23);
|
||||
if (StringHelper.isNotEmpty(taskNum)){
|
||||
// 将字符串转换为整数
|
||||
int num = Integer.parseInt(taskNum);
|
||||
// 执行加一操作
|
||||
num++;
|
||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||
taskNum = String.format("%04d", num);
|
||||
}else {
|
||||
code = "XG" + format + "-000" + taskNum;
|
||||
taskNum = "0001";
|
||||
}
|
||||
String code = "XG" + format + "-" + taskNum;
|
||||
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.MaType;
|
||||
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.material.domain.*;
|
||||
import com.bonus.sgzb.material.mapper.PurchaseCheckDetailsMapper;
|
||||
|
|
@ -246,15 +247,18 @@ public class PurchaseCheckServiceCenterServiceImpl implements PurchaseCheckServi
|
|||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
Date nowDate = DateUtils.getNowDate();
|
||||
String format = dateFormat.format(nowDate);
|
||||
int taskNum = taskMapper.selectTaskNumByMonth(nowDate, 23) + 1;
|
||||
String code = "";
|
||||
if (taskNum > GlobalContants.NUM1 && taskNum < GlobalContants.NUM2) {
|
||||
code = "XG" + format + "-00" + taskNum;
|
||||
} else if (taskNum > GlobalContants.NUM3 && taskNum < GlobalContants.NUM4) {
|
||||
code = "XG" + format + "-0" + taskNum;
|
||||
String taskNum = taskMapper.selectTaskNumByMonths(nowDate, 23);
|
||||
if (StringHelper.isNotEmpty(taskNum)){
|
||||
// 将字符串转换为整数
|
||||
int num = Integer.parseInt(taskNum);
|
||||
// 执行加一操作
|
||||
num++;
|
||||
// 将结果转换回字符串格式,并确保结果是四位数,不足四位则在前面补0
|
||||
taskNum = String.format("%04d", num);
|
||||
}else {
|
||||
code = "XG" + format + "-000" + taskNum;
|
||||
taskNum = "0001";
|
||||
}
|
||||
String code = "XG" + format + "-" + taskNum;
|
||||
return code;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -502,8 +502,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
WHERE
|
||||
subquery1.out_num - COALESCE(subquery2.audit_num, 0)>0
|
||||
</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 id="selectTaskNumByMonth" 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>
|
||||
|
||||
<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,
|
||||
pcd.type_id typeId,
|
||||
pcd.task_id taskId,
|
||||
pcd.remark remark,
|
||||
pci.remark remark,
|
||||
mt.CODE specsCode,
|
||||
mt.unit_name unitName,
|
||||
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
|
||||
FROM
|
||||
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
|
||||
AND pmi.type_id = pcd.type_id
|
||||
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
|
||||
mt.type_id = #{typeId}
|
||||
</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>
|
||||
Loading…
Reference in New Issue