看板修改,物料回库分配规则修改
This commit is contained in:
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
@@ -283,7 +283,7 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
|
|||||||
String produce_uuid = MapUtil.getStr(map, "produce_uuid");
|
String produce_uuid = MapUtil.getStr(map, "produce_uuid");
|
||||||
//生产任务表【pdm_base_produceTask】
|
//生产任务表【pdm_base_produceTask】
|
||||||
WQLObject produceTaskTab = WQLObject.getWQLObject("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("生产任务已完成或被删除,操作失败!");
|
if (ObjectUtil.isEmpty(produceTaskObj)) throw new BadRequestException("生产任务已完成或被删除,操作失败!");
|
||||||
|
|
||||||
String point_code = produceTaskObj.optString("device_code");
|
String point_code = produceTaskObj.optString("device_code");
|
||||||
@@ -383,7 +383,7 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
|
|||||||
//生产任务表【pdm_base_produceTask】
|
//生产任务表【pdm_base_produceTask】
|
||||||
WQLObject produceTaskTab = WQLObject.getWQLObject("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("生产任务已完成或被删除,操作失败!");
|
if (ObjectUtil.isEmpty(produceTaskObj)) throw new BadRequestException("生产任务已完成或被删除,操作失败!");
|
||||||
String produce_status = produceTaskObj.optString("produce_status");
|
String produce_status = produceTaskObj.optString("produce_status");
|
||||||
if (StrUtil.equals("00", produce_status)) {
|
if (StrUtil.equals("00", produce_status)) {
|
||||||
@@ -423,7 +423,6 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//回显生产任务状态和结束生产时间
|
//回显生产任务状态和结束生产时间
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
int produce_qty = produceTaskObj.optInt("produce_qty");
|
int produce_qty = produceTaskObj.optInt("produce_qty");
|
||||||
@@ -448,7 +447,7 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
|
|||||||
String produce_uuid = MapUtil.getStr(map, "produce_uuid");
|
String produce_uuid = MapUtil.getStr(map, "produce_uuid");
|
||||||
//生产任务表【pdm_base_produceTask】
|
//生产任务表【pdm_base_produceTask】
|
||||||
WQLObject produceTaskTab = WQLObject.getWQLObject("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("生产任务已完成或被删除,操作失败!");
|
if (ObjectUtil.isEmpty(produceTaskObj)) throw new BadRequestException("生产任务已完成或被删除,操作失败!");
|
||||||
String point_code = produceTaskObj.optString("device_code");
|
String point_code = produceTaskObj.optString("device_code");
|
||||||
//判断点位上有没有托盘,没有托盘不允许回库
|
//判断点位上有没有托盘,没有托盘不允许回库
|
||||||
@@ -464,11 +463,19 @@ public class ProduceTaskServiceImpl implements ProduceTaskService {
|
|||||||
WQLObject taskTab = WQLObject.getWQLObject("sch_base_task");
|
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);
|
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("该设备有未完成的搬运任务,不能重复操作!");
|
if (ObjectUtil.isNotEmpty(taskJson)) throw new BadRequestException("该设备有未完成的搬运任务,不能重复操作!");
|
||||||
|
|
||||||
//判断是否有可以使用的下一个点位
|
//判断是否有可以使用的下一个点位
|
||||||
//点位基础表【sch_base_point】
|
//点位基础表【sch_base_point】
|
||||||
WQLObject pointTab = WQLObject.getWQLObject("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("库内无可用位置,无法操作!");
|
if (ObjectUtil.isEmpty(nextPoint)) throw new BadRequestException("库内无可用位置,无法操作!");
|
||||||
JSONObject startPoint = pointTab.query("point_code = '" + point_code + "'").uniqueResult(0);
|
JSONObject startPoint = pointTab.query("point_code = '" + point_code + "'").uniqueResult(0);
|
||||||
|
|
||||||
|
|||||||
@@ -89,9 +89,9 @@ public class DumpinvServiceImpl implements DumpinvService {
|
|||||||
String material_code = materialObj.getString("material_code");
|
String material_code = materialObj.getString("material_code");
|
||||||
JSONArray turnInArr = new JSONArray();
|
JSONArray turnInArr = new JSONArray();
|
||||||
if (StrUtil.equals(material_code,"1")){
|
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 {
|
}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);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ spring:
|
|||||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
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: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}
|
||||||
##username: ${DB_USER:root}
|
##username: ${DB_USER:root}
|
||||||
##password: ${DB_PWD:dzhdghmt0617}
|
##password: ${DB_PWD:dzhdghmt0617}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ spring:
|
|||||||
freemarker:
|
freemarker:
|
||||||
check-template-location: false
|
check-template-location: false
|
||||||
profiles:
|
profiles:
|
||||||
active: prod
|
active: dev
|
||||||
jackson:
|
jackson:
|
||||||
time-zone: GMT+8
|
time-zone: GMT+8
|
||||||
data:
|
data:
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
"lint-staged": "8.1.5",
|
"lint-staged": "8.1.5",
|
||||||
"plop": "2.3.0",
|
"plop": "2.3.0",
|
||||||
"runjs": "^4.3.2",
|
"runjs": "^4.3.2",
|
||||||
"sass": "^1.26.10",
|
"sass": "~1.26.5",
|
||||||
"sass-loader": "^7.1.0",
|
"sass-loader": "^7.1.0",
|
||||||
"script-ext-html-webpack-plugin": "2.1.3",
|
"script-ext-html-webpack-plugin": "2.1.3",
|
||||||
"script-loader": "0.7.2",
|
"script-loader": "0.7.2",
|
||||||
|
|||||||
@@ -32,8 +32,12 @@
|
|||||||
:data="tableData"
|
:data="tableData"
|
||||||
size="small"
|
size="small"
|
||||||
style="width: 100%;"
|
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 v-if="false" prop="produce_uuid" label="生产标识"/>
|
||||||
<el-table-column prop="produce_code" label="生产编码"/>
|
<el-table-column prop="produce_code" label="生产编码"/>
|
||||||
<el-table-column prop="produce_status_name" label="生产状态" :formatter="formatStatusName"/>
|
<el-table-column prop="produce_status_name" label="生产状态" :formatter="formatStatusName"/>
|
||||||
@@ -125,11 +129,11 @@ export default {
|
|||||||
this.notify('操作成功', 'success')
|
this.notify('操作成功', 'success')
|
||||||
},
|
},
|
||||||
callMaterial() {
|
callMaterial() {
|
||||||
if (this.tableData.length < 1) {
|
if (this.$refs.table.selection.length === 0) {
|
||||||
this.notify('没有执行中的任务', 'info')
|
this.notify('请选中一条记录!', 'info')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const data = this.tableData[0]
|
const data = this.$refs.table.selection[0]
|
||||||
crudProduceTask.callMaterial(data).then(res => {
|
crudProduceTask.callMaterial(data).then(res => {
|
||||||
this.notify('操作成功', 'success')
|
this.notify('操作成功', 'success')
|
||||||
this.queryId()
|
this.queryId()
|
||||||
@@ -138,11 +142,11 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
finish() {
|
finish() {
|
||||||
if (this.tableData.length < 1) {
|
if (this.$refs.table.selection.length === 0) {
|
||||||
this.notify('没有执行中的任务', 'info')
|
this.notify('请选中一条记录!', 'info')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const data = this.tableData[0]
|
const data = this.$refs.table.selection[0]
|
||||||
crudProduceTask.finish(data).then(res => {
|
crudProduceTask.finish(data).then(res => {
|
||||||
this.notify('操作成功', 'success')
|
this.notify('操作成功', 'success')
|
||||||
this.queryId()
|
this.queryId()
|
||||||
@@ -151,11 +155,11 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
materialBack() {
|
materialBack() {
|
||||||
if (this.tableData.length < 1) {
|
if (this.$refs.table.selection.length === 0) {
|
||||||
this.notify('没有执行中的任务', 'info')
|
this.notify('请选中一条记录!', 'info')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const data = this.tableData[0]
|
const data = this.$refs.table.selection[0]
|
||||||
crudProduceTask.materialBack(data).then(res => {
|
crudProduceTask.materialBack(data).then(res => {
|
||||||
this.notify('操作成功', 'success')
|
this.notify('操作成功', 'success')
|
||||||
this.queryId()
|
this.queryId()
|
||||||
@@ -176,6 +180,14 @@ export default {
|
|||||||
return this.$message.error('请选择一条信息操作')
|
return this.$message.error('请选择一条信息操作')
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
handleSelectionChange(val) {
|
||||||
|
this.multipleSelection = val
|
||||||
|
if (val.length > 1) {
|
||||||
|
this.$refs.table.clearSelection()
|
||||||
|
this.$refs.table.toggleRowSelection(val.pop())
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
queryId() {
|
queryId() {
|
||||||
const id = this.$route.params.id
|
const id = this.$route.params.id
|
||||||
crudProduceTask.queryIdDevice(id).then(res => {
|
crudProduceTask.queryIdDevice(id).then(res => {
|
||||||
|
|||||||
Reference in New Issue
Block a user