代码更新
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package org.nl.modules.quartz.task;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
@@ -25,17 +26,9 @@ import org.springframework.stereotype.Component;
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class TestTask {
|
||||
public class AutoCleanLog {
|
||||
|
||||
public void run(){
|
||||
log.info("run 执行成功");
|
||||
}
|
||||
|
||||
public void run1(String str){
|
||||
log.info("run1 执行成功,参数为: {}" + str);
|
||||
}
|
||||
|
||||
public void run2(){
|
||||
log.info("run2 执行成功");
|
||||
WQLObject.getWQLObject("sys_log").delete("1=1");
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
package org.nl.modules.quartz.task;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class AutoDelLogTask {
|
||||
|
||||
public void run () {
|
||||
WQLObject logTab = WQLObject.getWQLObject("sys_log");
|
||||
String delete_time= SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("LOG_DELETE_TIME").getValue();
|
||||
JSONArray jsonArray = WQL.getWO("SYS_LOGS01").addParam("flag", "1").process().getResultJSONArray(0);
|
||||
for (int i = 0; i < jsonArray.size(); i++) {
|
||||
JSONObject json = jsonArray.getJSONObject(i);
|
||||
if (Long.parseLong(delete_time) < json.getLong("time")) {
|
||||
logTab.delete(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
[交易说明]
|
||||
交易名: 日志
|
||||
所属模块:
|
||||
功能简述:
|
||||
版权所有:
|
||||
表引用:
|
||||
版本经历:
|
||||
|
||||
[数据库]
|
||||
--指定数据库,为空采用默认值,默认为db.properties中列出的第一个库
|
||||
|
||||
[IO定义]
|
||||
#################################################
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
--这边列出来的临时表就会在运行期动态创建
|
||||
|
||||
[临时变量]
|
||||
--所有中间过程变量均可在此处定义
|
||||
|
||||
[业务过程]
|
||||
|
||||
##########################################
|
||||
# 1、输入输出检查 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 2、主过程前处理 #
|
||||
##########################################
|
||||
|
||||
|
||||
##########################################
|
||||
# 3、业务主过程 #
|
||||
##########################################
|
||||
|
||||
IF 输入.flag = "1"
|
||||
QUERY
|
||||
SELECT
|
||||
TIMESTAMPDIFF(DAY,create_time,now()) AS time,request_ip,log_id
|
||||
FROM
|
||||
sys_log
|
||||
WHERE
|
||||
1=1
|
||||
ORDER BY
|
||||
create_time
|
||||
LIMIT 100
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
@@ -26,15 +26,19 @@ import org.nl.modules.quartz.domain.QuartzJob;
|
||||
import org.nl.modules.quartz.domain.QuartzLog;
|
||||
import org.nl.modules.quartz.repository.QuartzLogRepository;
|
||||
import org.nl.modules.quartz.service.QuartzJobService;
|
||||
import org.nl.service.EmailService;
|
||||
import org.nl.utils.RedisUtils;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
import org.nl.utils.ThrowableUtil;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.quartz.QuartzJobBean;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
* 参考人人开源,https://gitee.com/renrenio/renren-security
|
||||
@@ -106,12 +110,12 @@ public class ExecutionJob extends QuartzJobBean {
|
||||
//更新状态
|
||||
quartzJobService.updateIsPause(quartzJob);
|
||||
}
|
||||
if(quartzJob.getEmail() != null){
|
||||
/*if(quartzJob.getEmail() != null){
|
||||
EmailService emailService = SpringContextHolder.getBean(EmailService.class);
|
||||
// 邮箱报警
|
||||
EmailVo emailVo = taskAlarm(quartzJob, ThrowableUtil.getStackTrace(e));
|
||||
emailService.send(emailVo, emailService.find());
|
||||
}
|
||||
}*/
|
||||
quartzLogRepository.save(log);
|
||||
} finally {
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import net.sf.json.JSONObject;
|
||||
import org.nl.wms.ext.acs.service.AcsToWmsService;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.service.TaskService;
|
||||
import org.nl.wms.sch.service.dto.TaskDto;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -48,7 +47,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
|
||||
JSONArray errArr = new JSONArray();
|
||||
for (int i = 0; i < array.size(); i++) {
|
||||
JSONObject row = array.getJSONObject(i);
|
||||
String task_uuid = row.optString("task_uuid");
|
||||
String task_uuid = row.optString("ext_task_uuid");
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("sch_base_task");
|
||||
JSONObject taskObj = wo.query("task_uuid ='" + task_uuid + "'").uniqueResult(0);
|
||||
|
||||
@@ -13,7 +13,6 @@ import net.sf.json.JSONObject;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
import org.nl.wms.pc.service.PCOutStoreService;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
@@ -22,8 +21,6 @@ import org.nl.wms.sch.tasks.OutTask;
|
||||
import org.nl.wms.sch.tasks.TaskTypeEnum;
|
||||
import org.nl.wms.st.core.IOStoreMst;
|
||||
import org.nl.wms.st.core.service.IOStoreService;
|
||||
import org.nl.wms.st.ivt.IvtChangeTypeEnum;
|
||||
import org.nl.wms.st.ivt.StoreIvtServiceImpl;
|
||||
import org.nl.wms.st.util.StructFindUtil;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -103,7 +100,7 @@ public class PCOutStoreServiceImpl implements PCOutStoreService {
|
||||
//更新分配表
|
||||
disTable.update(disjo, "bill_uuid = '" + bill_uuid + "'");
|
||||
//减少库存可用数量
|
||||
StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl();
|
||||
/*StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("material_uuid", disjo.optString("material_uuid"));
|
||||
param.put("bill_uuid", disjo.optString("bill_uuid"));
|
||||
@@ -117,7 +114,7 @@ public class PCOutStoreServiceImpl implements PCOutStoreService {
|
||||
param.put("label_uuid",disjo.optString("label_uuid"));
|
||||
param.put("labeldtl_uuid",disjo.optString("labeldtl_uuid"));
|
||||
param.put("label_code",disjo.optString("label_code"));
|
||||
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE);
|
||||
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE);*/
|
||||
//下发任务
|
||||
JSONObject taskObj = new JSONObject();
|
||||
String task_status = TaskStatusEnum.START_AND_POINT.getCode();
|
||||
|
||||
@@ -24,8 +24,6 @@ import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.nl.wms.sch.tasks.QualityTestTask;
|
||||
import org.nl.wms.st.ivt.IvtChangeTypeEnum;
|
||||
import org.nl.wms.st.ivt.StoreIvtServiceImpl;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.nl.wql.util.WqlUtil;
|
||||
@@ -265,7 +263,8 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
|
||||
//仓库质检单表【st_qt_qualityTestOrder】
|
||||
WQLObject qtoTab = WQLObject.getWQLObject("st_qt_qualityTestOrder");
|
||||
final JSONObject qtoObj = qtoTab.query("bill_uuid = '" + bill_uuid + "'").uniqueResult(0);
|
||||
if (StrUtil.equals(QTBillStatusEnum.FINISHED.getCode(), qtoObj.optString("bill_status")))
|
||||
|
||||
if (StrUtil.equals(QTBillStatusEnum.FINISHED.getCode(), qtoObj.optString("bill_status")) || StrUtil.equals(QTBillStatusEnum.COERCIVE_MEASURE_FINISHED.getCode(), qtoObj.optString("bill_status")))
|
||||
throw new BadRequestException("已经是完成状态!");
|
||||
|
||||
qtoObj.put("bill_status", "06");
|
||||
@@ -284,11 +283,14 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
|
||||
|
||||
//更新质检次数
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structIvt");
|
||||
int qc_num = ivtTab.query("struct_uuid = '" + qtoObj.optString("struct_uuid") + "'").uniqueResult(0).optInt("qc_num");
|
||||
qc_num++;
|
||||
JSONObject ivtParam = new JSONObject();
|
||||
ivtParam.put("qc_num", qc_num);
|
||||
ivtTab.update(ivtParam, "label_uuid = '" + qtoObj.optString("label_uuid") + "'");
|
||||
JSONObject ivtObj = ivtTab.query("struct_uuid = '" + qtoObj.optString("struct_uuid") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(ivtObj)) {
|
||||
int qc_num = ivtTab.query("struct_uuid = '" + qtoObj.optString("struct_uuid") + "'").uniqueResult(0).optInt("qc_num");
|
||||
qc_num++;
|
||||
JSONObject ivtParam = new JSONObject();
|
||||
ivtParam.put("qc_num", qc_num);
|
||||
ivtTab.update(ivtParam, "struct_uuid = '" + qtoObj.optString("struct_uuid") + "'");
|
||||
}
|
||||
|
||||
|
||||
//任务基础表【sch_base_task】
|
||||
@@ -301,7 +303,7 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
|
||||
taskTab.update(outTask);
|
||||
}
|
||||
JSONObject inTask = taskTab.query("task_uuid = '" + qtoObj.optString("intask_uuid") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(outTask)) {
|
||||
if (ObjectUtil.isNotEmpty(inTask)) {
|
||||
inTask.put("update_time", DateUtil.now());
|
||||
inTask.put("update_by", SecurityUtils.getCurrentUsername());
|
||||
inTask.put("task_status", TaskStatusEnum.FINISHED.getCode());
|
||||
@@ -379,13 +381,17 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void outStock(String bill_uuid) {
|
||||
JSONObject jsonQc = WQLObject.getWQLObject("st_qt_qualitytestorder").query("bill_uuid = '" + bill_uuid + "' and is_delete = '0' and is_active = '1'").uniqueResult(0);
|
||||
JSONObject jsonIvt = WQLObject.getWQLObject("st_ivt_structivt").query("struct_uuid = '" + jsonQc.optString("struct_uuid") + "'").uniqueResult(0);
|
||||
JSONObject jsonQc = WQLObject.getWQLObject("st_qt_qualitytestorder").query("bill_uuid = '" + bill_uuid + "' and is_delete = '0'").uniqueResult(0);
|
||||
|
||||
if (StrUtil.equals(QTBillStatusEnum.COERCIVE_MEASURE_FINISHED.getCode(),jsonQc.getString("bill_status"))) throw new BadRequestException("已经是出库状态");
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structivt");
|
||||
|
||||
JSONObject jsonIvt = ivtTab.query("struct_uuid = '" + jsonQc.optString("struct_uuid") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonIvt)) {
|
||||
throw new BadRequestException("当前没有可出库的物料");
|
||||
}
|
||||
//减去库存
|
||||
StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl();
|
||||
/*StoreIvtServiceImpl ivtService = new StoreIvtServiceImpl();
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("material_uuid", jsonQc.optString("material_uuid"));
|
||||
param.put("bill_uuid", jsonQc.optString("bill_uuid"));
|
||||
@@ -396,7 +402,10 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
|
||||
param.put("struct_uuid", jsonIvt.optString("struct_uuid"));
|
||||
param.put("vehicle_code", jsonIvt.optString("vehicle_code"));
|
||||
param.put("label_uuid", jsonIvt.optString("label_uuid"));
|
||||
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_IVT_AND_CAN_USE);
|
||||
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_IVT_AND_CAN_USE);*/
|
||||
ivtTab.delete("struct_uuid = '" + jsonQc.optString("struct_uuid") + "'");
|
||||
|
||||
|
||||
//修改点位状态
|
||||
PointService pointService = SpringContextHolder.getBean(PointService.class);
|
||||
PointDto dto = pointService.findById(jsonIvt.optString("struct_uuid"));
|
||||
@@ -404,11 +413,14 @@ public class QualityTestOrderServiceImpl implements QualityTestOrderService {
|
||||
dto.setPoint_status("00");
|
||||
dto.setVehicle_code("");
|
||||
JSONObject jsonTask = WQLObject.getWQLObject("sch_base_task").query("task_uuid = '" + jsonQc.optString("outtask_uuid") + "'").uniqueResult(0);
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + jsonTask.optString("next_point_code") + "'").uniqueResult(0);
|
||||
jsonPoint.put("lock_type", "00");
|
||||
pointTab.update(JSONObject.fromObject(dto));
|
||||
pointTab.update(jsonPoint);
|
||||
if (ObjectUtil.isNotEmpty(jsonTask)) {
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
JSONObject jsonPoint = pointTab.query("point_code = '" + jsonTask.optString("next_point_code") + "'").uniqueResult(0);
|
||||
jsonPoint.put("lock_type", "00");
|
||||
pointTab.update(JSONObject.fromObject(dto));
|
||||
pointTab.update(jsonPoint);
|
||||
}
|
||||
|
||||
//更新质检单
|
||||
jsonQc.put("bill_status", QTBillStatusEnum.COERCIVE_MEASURE_FINISHED.getCode());
|
||||
WQLObject.getWQLObject("st_qt_qualitytestorder").update(jsonQc);
|
||||
|
||||
@@ -5,11 +5,8 @@ import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.system.service.impl.ParamServiceImpl;
|
||||
import org.nl.utils.SpringContextHolder;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
||||
/**
|
||||
@@ -31,6 +28,7 @@ public class AcsUtil {
|
||||
JSONObject object = list.getJSONObject(i);
|
||||
String value = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode(object.getString("task_type")).getValue();
|
||||
object.put("priority", value);
|
||||
object.put("ext_task_uuid", object.getString("task_uuid"));
|
||||
}
|
||||
//ACS地址:127.0.0.1:8010
|
||||
String acsUrl = SpringContextHolder.getBean(ParamServiceImpl.class).findByCode("ACS_URL").getValue();
|
||||
|
||||
@@ -141,6 +141,7 @@ public class TaskServiceImpl implements TaskService {
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Override
|
||||
public void operation(Map<String, Object> map) {
|
||||
String task_uuid = MapUtil.getStr(map, "task_uuid");
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
package org.nl.wms.sch.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
|
||||
/**
|
||||
* @author geng by
|
||||
* 自动清理大于十五天的日志
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
@RequiredArgsConstructor
|
||||
public class AutoCleanUpLogs {
|
||||
|
||||
private ExecutorService threadPool = Executors.newCachedThreadPool();
|
||||
|
||||
public void run() throws Exception {
|
||||
try {
|
||||
System.out.println("开始清理日志");
|
||||
// 0 0/10 0,1 * * ? * 每天0-1点执行间隔10分钟一次
|
||||
//sys_log
|
||||
//delete from sys_log where DATE(create_time) <= DATE(DATE_SUB(NOW(),INTERVAL 30 day)) limit 10;
|
||||
WQLObject logTab = WQLObject.getWQLObject("sys_log");
|
||||
String days = WQLObject.getWQLObject("sys_param").query("code='clean_day'").uniqueResult(0).getString("value");
|
||||
logTab.delete("DATE(create_time) <= DATE(DATE_SUB(NOW(),INTERVAL '" + days + "' day))");
|
||||
log.info("自动清理日志执行成功...!");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -54,26 +54,35 @@ public class OutEmptyVehicleTask extends AbstractAcsTask {
|
||||
|
||||
//更新空载具表状态
|
||||
JSONObject jsonEtv = etvTab.query("task_uuid='" + taskObj.optString("task_uuid") + "'").uniqueResult(0);
|
||||
jsonEtv.put("update_by", SecurityUtils.getCurrentUsername());
|
||||
jsonEtv.put("update_time", DateUtil.now());
|
||||
jsonEtv.put("bill_status", EmptyVehicleBillStatusEnum.FINISHED.getCode());
|
||||
etvTab.update(jsonEtv);
|
||||
if (ObjectUtil.isNotEmpty(jsonEtv)){
|
||||
jsonEtv.put("update_by", SecurityUtils.getCurrentUsername());
|
||||
jsonEtv.put("update_time", DateUtil.now());
|
||||
jsonEtv.put("bill_status", EmptyVehicleBillStatusEnum.FINISHED.getCode());
|
||||
etvTab.update(jsonEtv);
|
||||
}
|
||||
|
||||
//解锁货位
|
||||
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
|
||||
//解锁起始点位
|
||||
JSONObject startPoint = pointTab.query("point_code='" + jsonEtv.optString("start_point_code") + "'").uniqueResult(0);
|
||||
startPoint.put("lock_type", "00");
|
||||
startPoint.put("point_status", "00");
|
||||
startPoint.put("vehicle_code", "");
|
||||
pointTab.update(startPoint);
|
||||
if (ObjectUtil.isNotEmpty(startPoint)){
|
||||
startPoint.put("lock_type", "00");
|
||||
startPoint.put("point_status", "00");
|
||||
startPoint.put("vehicle_code", "");
|
||||
pointTab.update(startPoint);
|
||||
|
||||
|
||||
}
|
||||
//解锁下一点位
|
||||
JSONObject nextPoint = pointTab.query("point_code='" + jsonEtv.optString("next_point_code") + "'").uniqueResult(0);
|
||||
nextPoint.put("lock_type", "00");
|
||||
nextPoint.put("point_status", "01");
|
||||
nextPoint.put("vehicle_code", jsonEtv.optString("vehicle_code"));
|
||||
pointTab.update(nextPoint);
|
||||
if (ObjectUtil.isNotEmpty(nextPoint)){
|
||||
nextPoint.put("lock_type", "00");
|
||||
nextPoint.put("point_status", "01");
|
||||
if (ObjectUtil.isNotEmpty(jsonEtv)){
|
||||
nextPoint.put("vehicle_code", jsonEtv.optString("vehicle_code"));
|
||||
}
|
||||
pointTab.update(nextPoint);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,14 +14,11 @@ import org.nl.wms.sch.manage.AbstractAcsTask;
|
||||
import org.nl.wms.sch.manage.TaskStatusEnum;
|
||||
import org.nl.wms.sch.service.PointService;
|
||||
import org.nl.wms.sch.service.dto.PointDto;
|
||||
import org.nl.wms.st.ivt.IvtChangeTypeEnum;
|
||||
import org.nl.wms.st.ivt.StoreIvtServiceImpl;
|
||||
import org.nl.wms.st.util.StructFindUtil;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 出库任务生成
|
||||
*/
|
||||
@@ -178,7 +175,11 @@ public class OutTask extends AbstractAcsTask {
|
||||
json.put("vehicle_code", structObj.optString("vehicle_code"));
|
||||
json.put("task_uuid", task_uuid);
|
||||
disTab.update(json);
|
||||
//减少库存可用数量
|
||||
|
||||
//直接删除起点
|
||||
|
||||
|
||||
/* //减少库存可用数量
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("material_uuid", disObj.optString("material_uuid"));
|
||||
param.put("label_uuid", disObj.optString("label_uuid"));
|
||||
@@ -190,7 +191,7 @@ public class OutTask extends AbstractAcsTask {
|
||||
PointService pointService = SpringContextHolder.getBean(PointService.class);
|
||||
param.put("struct_uuid", pointService.findByCode(struct_code).getPoint_uuid());
|
||||
param.put("vehicle_code", structObj.optString("vehicle_code"));
|
||||
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE);
|
||||
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE);*/
|
||||
//修改明细表中的状态
|
||||
JSONObject dtljson = dtlTab.query("billdtl_uuid='" + billdtl_uuid + "'").uniqueResult(0);
|
||||
dtljson.put("bill_status", "30");
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.sch.tasks;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.nl.exception.BadRequestException;
|
||||
@@ -75,13 +76,16 @@ public class QualityTestTask extends AbstractAcsTask {
|
||||
qtoTab.update(qtObj, "intask_uuid = '" + task_uuid + "'");
|
||||
//更新质检次数
|
||||
//仓位库存表【st_ivt_structIvt】
|
||||
String label_uuid = qtoTab.query("intask_uuid = '" + task_uuid + "'").uniqueResult(0).optString("label_uuid");
|
||||
String struct_uuid = qtoTab.query("intask_uuid = '" + task_uuid + "'").uniqueResult(0).optString("struct_uuid");
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structIvt");
|
||||
int qc_num = ivtTab.query("label_uuid = '" + label_uuid + "'").uniqueResult(0).optInt("qc_num");
|
||||
qc_num++;
|
||||
JSONObject ivtParam = new JSONObject();
|
||||
ivtParam.put("qc_num", qc_num);
|
||||
ivtTab.update(ivtParam, "label_uuid = '" + label_uuid + "'");
|
||||
JSONObject ivtObj= ivtTab.query("struct_uuid = '" + struct_uuid + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(ivtObj)){
|
||||
int qc_num = ivtTab.query("struct_uuid = '" + struct_uuid + "'").uniqueResult(0).optInt("qc_num");
|
||||
qc_num++;
|
||||
JSONObject ivtParam = new JSONObject();
|
||||
ivtParam.put("qc_num", qc_num);
|
||||
ivtTab.update(ivtParam, "struct_uuid = '" + struct_uuid + "'");
|
||||
}
|
||||
|
||||
//更新质检点位状态
|
||||
JSONObject pointObj = new JSONObject();
|
||||
|
||||
@@ -245,7 +245,7 @@ public class IOStoreServiceImpl implements IOStoreService {
|
||||
//出库
|
||||
if (StrUtil.equals("20", buss_type)) {
|
||||
param.put("struct_uuid", pointService.findByCode(disObj.optString("start_point_code")).getPoint_uuid());
|
||||
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE);
|
||||
/*ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE);*/
|
||||
}
|
||||
|
||||
}
|
||||
@@ -375,7 +375,7 @@ public class IOStoreServiceImpl implements IOStoreService {
|
||||
param.put("change_weight", disObj.optString("realassign_weight"));
|
||||
param.put("struct_uuid", startPoint.getPoint_uuid());
|
||||
param.put("vehicle_code", vehicle_code);
|
||||
ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE);
|
||||
/*ivtService.addIvtFlow(param, IvtChangeTypeEnum.SUB_CAN_USE)*/;
|
||||
}
|
||||
}
|
||||
AbstractIOStoreManager manager = new IOStoreManager();
|
||||
|
||||
@@ -56,7 +56,7 @@ https://juejin.cn/post/6844903775631572999
|
||||
|
||||
<!--生产环境:打印控制台和输出到文件-->
|
||||
<springProfile name="prod">
|
||||
<root level="debug">
|
||||
<root level="info">
|
||||
<appender-ref ref="asyncFileAppender"/>
|
||||
</root>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user