看板修改,物料回库分配规则修改

This commit is contained in:
18188916393
2022-10-13 10:13:07 +08:00
parent a33417f74d
commit bc632ec293
9 changed files with 124 additions and 21 deletions

View File

@@ -0,0 +1,27 @@
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);
}
}
}
}

View File

@@ -0,0 +1,57 @@
[交易说明]
交易名: 日志
所属模块:
功能简述:
版权所有:
表引用:
版本经历:
[数据库]
--指定数据库为空采用默认值默认为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

View File

@@ -283,7 +283,7 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
String produce_uuid = MapUtil.getStr(map, "produce_uuid");
//生产任务表【pdm_base_produceTask】
WQLObject produceTaskTab = WQLObject.getWQLObject("pdm_base_produceTask");
JSONObject produceTaskObj = produceTaskTab.query("is_delete='0' and produce_status<> '02' and produce_uuid = '" + produce_uuid + "'").uniqueResult(0);
JSONObject produceTaskObj = produceTaskTab.query("is_delete='0' and produce_uuid = '" + produce_uuid + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(produceTaskObj)) throw new BadRequestException("生产任务已完成或被删除,操作失败!");
String point_code = produceTaskObj.optString("device_code");
@@ -383,7 +383,7 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
//生产任务表【pdm_base_produceTask】
WQLObject produceTaskTab = WQLObject.getWQLObject("pdm_base_produceTask");
JSONObject produceTaskObj = produceTaskTab.query("is_delete='0' and produce_status<> '02' and produce_uuid = '" + produce_uuid + "'").uniqueResult(0);
JSONObject produceTaskObj = produceTaskTab.query("is_delete='0' and produce_uuid = '" + produce_uuid + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(produceTaskObj)) throw new BadRequestException("生产任务已完成或被删除,操作失败!");
String produce_status = produceTaskObj.optString("produce_status");
if (StrUtil.equals("00", produce_status)) {
@@ -423,7 +423,6 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
}
//回显生产任务状态和结束生产时间
String now = DateUtil.now();
int produce_qty = produceTaskObj.optInt("produce_qty");
@@ -448,7 +447,7 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
String produce_uuid = MapUtil.getStr(map, "produce_uuid");
//生产任务表【pdm_base_produceTask】
WQLObject produceTaskTab = WQLObject.getWQLObject("pdm_base_produceTask");
JSONObject produceTaskObj = produceTaskTab.query("is_delete='0' and produce_status<> '02' and produce_uuid = '" + produce_uuid + "'").uniqueResult(0);
JSONObject produceTaskObj = produceTaskTab.query("is_delete='0' and produce_uuid = '" + produce_uuid + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(produceTaskObj)) throw new BadRequestException("生产任务已完成或被删除,操作失败!");
String point_code = produceTaskObj.optString("device_code");
//判断点位上有没有托盘,没有托盘不允许回库
@@ -464,11 +463,19 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
JSONObject taskJson = taskTab.query(" is_delete='0' and task_status<>'06' and start_point_code = '" + point_code + "' and handle_class = '" + MaterialBackTask.class.getName() + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(taskJson)) throw new BadRequestException("该设备有未完成的搬运任务,不能重复操作!");
//判断是否有可以使用的下一个点位
//点位基础表【sch_base_point】
WQLObject pointTab = WQLObject.getWQLObject("sch_base_point");
JSONObject nextPoint = pointTab.query("area_type ='03' and point_status ='00' and lock_type='00' and is_active='1' and is_delete='0'").uniqueResult(0);
//JSONObject nextPoint = pointTab.query("area_type ='03' and point_status ='00' and lock_type='00' and is_active='1' and is_delete='0'").uniqueResult(0);
JSONObject nextPoint = new JSONObject();
String material_code = WQLObject.getWQLObject("md_base_materiallabelmst")
.query("label_uuid ='" + produceTaskObj.getString("label_uuid") + "'").uniqueResult(0).getString("material_code");
if (StrUtil.equals(material_code, "1")) {
nextPoint = pointTab.query("area_type = '03' and point_status ='00' and lock_type='00' and is_active='1' and is_delete='0' and point_name like'%01层%'").uniqueResult(0);
} else {
nextPoint = pointTab.query("area_type = '03' and point_status ='00' and lock_type='00' and is_active='1' and is_delete='0' and point_name not like'%01层%'").uniqueResult(0);
}
if (ObjectUtil.isEmpty(nextPoint)) throw new BadRequestException("库内无可用位置,无法操作!");
JSONObject startPoint = pointTab.query("point_code = '" + point_code + "'").uniqueResult(0);

View File

@@ -89,9 +89,9 @@ public class DumpinvServiceImpl implements DumpinvService {
String material_code = materialObj.getString("material_code");
JSONArray turnInArr = new JSONArray();
if (StrUtil.equals(material_code,"1")){
turnInArr = pointTab.query("area_type = '03' and point_status ='00' and lock_type='00' and is_active='1' and is_delete='0' and point_name like'%层%'").getResultJSONArray(0);
turnInArr = pointTab.query("area_type = '03' and point_status ='00' and lock_type='00' and is_active='1' and is_delete='0' and point_name like'%01层%'").getResultJSONArray(0);
}else {
turnInArr = pointTab.query("area_type = '03' and point_status ='00' and lock_type='00' and is_active='1' and is_delete='0' and point_name not like'%层%'").getResultJSONArray(0);
turnInArr = pointTab.query("area_type = '03' and point_status ='00' and lock_type='00' and is_active='1' and is_delete='0' and point_name not like'%01层%'").getResultJSONArray(0);
}

View File

@@ -7,7 +7,7 @@ spring:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
##url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.57}:${DB_PORT:3306}/${DB_NAME:ch_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:ch_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:ch_wms}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: ${DB_USER:root}
##username: ${DB_USER:root}
##password: ${DB_PWD:dzhdghmt0617}

View File

@@ -2,7 +2,7 @@ spring:
freemarker:
check-template-location: false
profiles:
active: prod
active: dev
jackson:
time-zone: GMT+8
data:

View File

@@ -102,7 +102,7 @@
"lint-staged": "8.1.5",
"plop": "2.3.0",
"runjs": "^4.3.2",
"sass": "^1.26.10",
"sass": "~1.26.5",
"sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "0.7.2",

View File

@@ -32,8 +32,12 @@
:data="tableData"
size="small"
style="width: 100%;"
@selection-change="changeFun"
@selection-change="handleSelectionChange"
>
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column v-if="false" prop="produce_uuid" label="生产标识"/>
<el-table-column prop="produce_code" label="生产编码"/>
<el-table-column prop="produce_status_name" label="生产状态" :formatter="formatStatusName"/>
@@ -125,11 +129,11 @@ export default {
this.notify('操作成功', 'success')
},
callMaterial() {
if (this.tableData.length < 1) {
this.notify('没有执行中的任务', 'info')
if (this.$refs.table.selection.length === 0) {
this.notify('请选中一条记录!', 'info')
return
}
const data = this.tableData[0]
const data = this.$refs.table.selection[0]
crudProduceTask.callMaterial(data).then(res => {
this.notify('操作成功', 'success')
this.queryId()
@@ -138,11 +142,11 @@ export default {
})
},
finish() {
if (this.tableData.length < 1) {
this.notify('没有执行中的任务', 'info')
if (this.$refs.table.selection.length === 0) {
this.notify('请选中一条记录!', 'info')
return
}
const data = this.tableData[0]
const data = this.$refs.table.selection[0]
crudProduceTask.finish(data).then(res => {
this.notify('操作成功', 'success')
this.queryId()
@@ -151,11 +155,11 @@ export default {
})
},
materialBack() {
if (this.tableData.length < 1) {
this.notify('没有执行中的任务', 'info')
if (this.$refs.table.selection.length === 0) {
this.notify('请选中一条记录!', 'info')
return
}
const data = this.tableData[0]
const data = this.$refs.table.selection[0]
crudProduceTask.materialBack(data).then(res => {
this.notify('操作成功', 'success')
this.queryId()
@@ -176,6 +180,14 @@ export default {
return this.$message.error('请选择一条信息操作')
}
},
handleSelectionChange(val) {
this.multipleSelection = val
if (val.length > 1) {
this.$refs.table.clearSelection()
this.$refs.table.toggleRowSelection(val.pop())
}
},
queryId() {
const id = this.$route.params.id
crudProduceTask.queryIdDevice(id).then(res => {