This commit is contained in:
2022-08-05 16:53:53 +08:00
32 changed files with 423 additions and 233 deletions

View File

@@ -131,6 +131,8 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
public Map<String, Object> orderFinish(String string) {
JSONObject result = new JSONObject();
try {
JSONObject orderJson = JSONObject.parseObject(string);
String ext_order_id = orderJson.getString("ext_order_id");
// JSONArray array = JSONArray.parseArray(string);
@@ -139,20 +141,26 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
JSONObject map = new JSONObject();
map.put("produceorder_id", ext_order_id);
map.put("order_status", "04");
map.put("update_optid", 1111111111);
map.put("update_optid", 1001001);
map.put("device_id", "");
map.put("update_optname", "acs");
map.put("update_time", now);
map.put("realproduceend_date", now);
wo.update(map, "produceorder_id = '" + ext_order_id + "'");
JSONObject result = new JSONObject();
} catch (Exception e){
result.put("status", 400);
result.put("message", e.getMessage());
return result;
}
result.put("status", HttpStatus.OK.value());
result.put("message", "任务状态反馈成功!");
result.put("message", "订单完成状态反馈成功!");
return result;
}
@Override
public Map<String, Object> feedDeviceStatusType(String string) {
JSONObject result = new JSONObject();
try {
JSONObject param = JSONObject.parseObject(string);
String device_code = param.getString("device_code");
String status_type = param.getString("status_type");
@@ -164,25 +172,29 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
String device_id = device_json.getString("device_id");
WQLObject wo_status = WQLObject.getWQLObject("PDM_BI_DeviceRunStatusRecord");
JSONObject status_json = wo_status.query("device_id = '" + device_id + "' and (end_time is null or end_time = '' )").uniqueResult(0);
if (ObjectUtil.isNotEmpty(status_json)){
if (ObjectUtil.isNotEmpty(status_json)) {
status_json.put("end_time", start_time);
wo_status.update(status_json);
log.warn("上一次设备状态结束时间修改成功:{}",device_code);
}
JSONObject map = new JSONObject();
map.put("record_id", IdUtil.getSnowflake(1, 1).nextId());
map.put("device_id", device_id);
map.put("status_type", status_type);
map.put("start_time", start_time);
if (error_code > 0 && error_code < 50){
map.put("err_status_id",error_code);
} else if (error_code > 50){
map.put("err_status_id", error_code - 50);
if (error_code > 0) {
map.put("err_status_id", error_code);
} else {
map.put("err_status_id", null);
}
wo_status.insert(map);
log.warn("设备状态新增成功{}",device_code);
}
} catch (Exception e){
result.put("status", 400);
result.put("message", e.getMessage());
return result;
}
JSONObject result = new JSONObject();
result.put("status", HttpStatus.OK.value());
result.put("message", "设备状态反馈成功");
return result;
@@ -190,14 +202,20 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
public Map<String, Object> feedOrderRealQty(String string) {
JSONObject result = new JSONObject();
try {
JSONObject param = JSONObject.parseObject(string);
String order_code = param.getString("order");
String real_qty = param.getString("real_qty");
WQLObject wo = WQLObject.getWQLObject("mps_bd_produceshiftorder");
JSONObject map = new JSONObject();
map.put("real_qty",real_qty);
wo.update(map,"produceorder_code = '"+order_code+"'");
JSONObject result = new JSONObject();
map.put("real_qty", real_qty);
wo.update(map, "produceorder_code = '" + order_code + "' and order_status != '04'");
} catch (Exception e){
result.put("status", 400);
result.put("message", e.getMessage());
}
result.put("status", HttpStatus.OK.value());
result.put("message", "设备状态反馈成功");
return result;

View File

@@ -61,6 +61,7 @@
where
shiftorder.is_delete='0'
and shiftorder.order_status<>'00'
OPTION 输入.worksection_type_scode <> ""
workprocedure.worksection_type_scode = 输入.worksection_type_scode
ENDOPTION
@@ -134,6 +135,7 @@ ENDIF
mps_bd_produceshiftorder shiftorder
where
shiftorder.is_delete='0'
and shiftorder.order_status<>'00'
OPTION 输入.produce_date <> ""
shiftorder.produce_date = 输入.produce_date
ENDOPTION
@@ -149,6 +151,7 @@ ENDIF
mps_bd_produceshiftorder shiftorder
where
shiftorder.realproduceend_date > shiftorder.planproduceend_date
and shiftorder.order_status<>'00'
OPTION 输入.produce_date <> ""
shiftorder.produce_date = 输入.produce_date
ENDOPTION
@@ -168,6 +171,7 @@ ENDIF
LEFT JOIN pdm_bi_workprocedure workprocedure ON workprocedure.workprocedure_id = shiftorder.workprocedure_id
WHERE
shiftorder.is_delete='0'
and shiftorder.order_status<>'00'
and workprocedure.workprocedure_code IN ( '07', '06', '02' )
OPTION 输入.produce_date <> ""
shiftorder.produce_date = 输入.produce_date
@@ -268,6 +272,7 @@ IF 输入.flag = "11"
left join md_me_materialbase material on material.material_id =shiftorder.material_id
WHERE
shiftorder.is_delete='0'
and shiftorder.order_status<>'00'
and workprocedure.workprocedure_code IN ( '07', '06', '02' )
and shiftorder. real_qty < shiftorder.plan_qty
OPTION 输入.produce_date <> ""
@@ -379,9 +384,6 @@ IF 输入.flag = "14"
OPTION 输入.worksection_type_scode <> ""
workprocedure.worksection_type_scode = 输入.worksection_type_scode
ENDOPTION
OPTION 输入.produce_date <> ""
shiftorder.produce_date = 输入.produce_date
ENDOPTION
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -205,14 +205,14 @@
device.device_id
FROM
pdm_bi_device device
LEFT JOIN mps_bd_produceshiftorder shift ON shift.device_id = device.device_id
LEFT JOIN pdm_bi_devicerunstatusrecord run ON run.device_id = device.device_id
INNER JOIN mps_bd_produceshiftorder shift ON shift.device_id = device.device_id
INNER JOIN pdm_bi_devicerunstatusrecord run ON run.device_id = device.device_id AND IFNULL(run.end_time,'') =''
WHERE
shift.is_delete = '0'
AND
shift.order_status <> '04'
AND
(run.status_type <> '05' OR (run.status_type = '05' AND IFNULL(run.end_time,'') <> '') OR run.status_type IS NULL)
run.status_type <> '05'
OPTION 输入.workprocedure_id <> ""
device.workprocedure_id = 输入.workprocedure_id
ENDOPTION

View File

@@ -102,4 +102,6 @@ public class ProduceshiftorderDto implements Serializable {
private Long device_id;
private Long sale_id;
private Integer orderNum;
}

View File

@@ -13,6 +13,8 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.exception.BadRequestException;
import org.nl.modules.security.service.dto.JwtUserDto;
import org.nl.modules.system.service.UserService;
import org.nl.modules.system.service.dto.UserDto;
import org.nl.modules.system.util.CodeUtil;
import org.nl.utils.SecurityUtils;
import org.nl.wms.basedata.master.service.ClassstandardService;
@@ -22,6 +24,7 @@ import org.nl.wms.mps.service.dto.ProduceshiftorderDto;
import org.nl.wql.WQL;
import org.nl.wql.core.bean.WQLObject;
import org.nl.wql.util.WqlUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +45,9 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
private final ClassstandardService classstandardService;
private final WmsToAcsService wmsToAcsService;
@Autowired
UserService userService;
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
String produceorder_code = MapUtil.getStr(whereJson, "produceorder_code");
@@ -83,7 +89,24 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
if (StrUtil.isNotEmpty(sale_id)) {
map.put("sale_id", "%" + sale_id + "%");
}
WQLObject wo = WQLObject.getWQLObject("mps_bd_macoperaterecord");
JSONObject jsonObject = WQL.getWO("MPS_PRODUCEDURE001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "ShiftOrder.update_time desc");
JSONArray jsonArray = jsonObject.getJSONArray("content");
for (int i = 0; i < jsonArray.size(); i++) {
JSONObject arrayJSONObject = jsonArray.getJSONObject(i);
String produceorder_id = arrayJSONObject.getString("produceorder_id");
JSONArray resultJSONArray = wo.query("produceorder_id = '" + produceorder_id + "'", "operatetime_start desc").getResultJSONArray(0);
if (ObjectUtil.isNotEmpty(resultJSONArray)){
JSONObject resultJSONArrayJSONObject = resultJSONArray.getJSONObject(0);
String jockey_id = resultJSONArrayJSONObject.getString("jockey_id");
UserDto user = userService.findById(Long.valueOf(jockey_id));
String nick_name = "";
if (ObjectUtil.isNotEmpty(user)){
nick_name = user.getNickName();
}
arrayJSONObject.put("jockey_name",nick_name);
}
}
return jsonObject;
}
@@ -118,6 +141,8 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
@Override
@Transactional(rollbackFor = Exception.class)
public void create(ProduceshiftorderDto dto) {
Integer orderNum = dto.getOrderNum();
for (Integer i = 0; i < orderNum; i++) {
Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getNickName();
String now = DateUtil.now();
@@ -141,6 +166,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService {
json.put("syscompanyid", deptId);
wo.insert(json);
}
}
@Override
@Transactional(rollbackFor = Exception.class)

View File

@@ -63,9 +63,12 @@
WorkProcedure.workprocedure_code,
WorkProcedure.workprocedure_name,
classstandard.class_id,
classstandard.class_name
classstandard.class_name,
device.device_code,
device.device_name
FROM
MPS_BD_ProduceShiftOrder ShiftOrder
left join pdm_bi_device device on ShiftOrder.device_id = device.device_id
LEFT JOIN md_me_materialbase material ON material.material_id = ShiftOrder.material_id
LEFT JOIN PDM_BI_WorkProcedure WorkProcedure ON WorkProcedure.workprocedure_id = ShiftOrder.workprocedure_id
LEFT JOIN md_pb_classstandard classstandard ON classstandard.class_id = material.product_series

View File

@@ -1,5 +1,5 @@
server:
port: 8010
port: 8011
#海亮sqlserver
erp:
sqlserver:
@@ -18,11 +18,11 @@ spring:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
#url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
username: ${DB_USER:root}
#password: ${DB_PWD:P@ssw0rd}
#password: ${DB_PWD:root}
password: ${DB_PWD:Root.123456}
password: ${DB_PWD:password}
# 初始连接数
initial-size: 5
# 最小连接数
@@ -68,14 +68,14 @@ spring:
multi-statement-alagvslow: true
data:
mongodb:
host: 47.111.78.178
host: 127.0.0.1
port: 27017
database: nlwms
redis:
#数据库索引
database: ${REDIS_DB:1}
host: ${REDIS_HOST:47.111.78.178}
host: ${REDIS_HOST:127.0.0.1}
# host: ${REDIS_HOST:localhost}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:}
@@ -173,5 +173,5 @@ jetcache:
maxIdle: 200
maxTotal: 1000
uri:
- redis://47.111.78.178:6379
- redis://127.0.0.1:6379

View File

@@ -8,7 +8,7 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.225}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
username: ${DB_USER:root}
password: ${DB_PWD:123456}
#password: ${DB_PWD:Root.123456}
@@ -57,14 +57,14 @@ spring:
multi-statement-alagvslow: true
data:
mongodb:
host: 192.168.46.225
host: 192.168.46.5
port: 27017
database: nlacs
redis:
#数据库索引
database: ${REDIS_DB:6}
host: ${REDIS_HOST:192.168.46.225}
host: ${REDIS_HOST:192.168.46.5}
#host: ${REDIS_HOST:localhost}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:}
@@ -162,5 +162,5 @@ jetcache:
maxIdle: 200
maxTotal: 1000
uri:
- redis://localhost:6379
- redis://192.168.46.5:6379

View File

@@ -123,7 +123,7 @@ https://juejin.cn/post/6844903775631572999
<!--生产环境:打印控制台和输出到文件-->
<springProfile name="prod">
<root level="off">
<root level="warn">
<appender-ref ref="asyncFileAppender"/>
</root>
</springProfile>

View File

@@ -1,8 +1,8 @@
ENV = 'development'
# 接口地址
VUE_APP_BASE_API = 'http://localhost:8010'
VUE_APP_WS_API = 'ws://localhost:8010'
VUE_APP_BASE_API = 'http://localhost:8011'
VUE_APP_WS_API = 'ws://localhost:8011'
# 是否启用 babel-plugin-dynamic-import-node插件
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@@ -119,6 +119,16 @@
/>
</template>
</el-table-column>
<el-table-column prop="planproduceend_date" label="计划结束时间" align="center" width="250px">
<template slot-scope="scope">
<el-date-picker
v-model="scope.row.planproduceend_date"
value-format="yyyy-MM-dd HH:mm:ss"
type="datetime"
style="width: 200px;"
/>
</template>
</el-table-column>
<el-table-column prop="sale_id" label="销售单标识" align="center" width="150px">
<template scope="scope">
<el-input v-model="scope.row.sale_id"/>
@@ -146,9 +156,14 @@
</el-radio>
</template>
</el-table-column>
<el-table-column prop="orderNum" label="订单数量" align="center" width="150px">
<template scope="scope">
<el-input v-model="scope.row.orderNum" type="number" :min="1" oninput="value = value.replace(/[^\d]/g, '')" style="width: 200px;"/>
</template>
</el-table-column>
</el-table>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
<el-button type="text" @click="cancle">取消</el-button>
<el-button :loading="crud.cu === 2" type="primary" @click="submit">确认</el-button>
</div>
<MaterDtl
@@ -197,8 +212,12 @@ export default {
}
},
methods: {
cancle() {
this.$emit('update:dialogShow', false)
},
insertDtl() {
const date = this.dateFormatter(new Date())
const formatter1 = this.dateFormatter1(new Date())
this.tableData.push({
produceorder_id: '',
produceorder_code: '',
@@ -213,7 +232,7 @@ export default {
material_code: '',
material_weight: '',
planproducestart_date: date,
planproduceend_date: '',
planproduceend_date: formatter1,
realproducestart_date: '',
realproduceend_date: '',
order_status: '00',
@@ -223,7 +242,8 @@ export default {
device_id: '',
is_canupdate_update: '1',
material_spec: '',
sale_id: ''
sale_id: '',
orderNum: 1
})
},
open() {
@@ -256,12 +276,14 @@ export default {
const year = d.getFullYear()
const month = (d.getMonth() + 1) < 10 ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1)
const day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
debugger
if (val === '02') {
row.planproducestart_date = [year, month, day].join('-') + ' ' + ['18', '30', '00'].join(':')
const day1 = d.getDate() < 10 ? '0' + (d.getDate() + 1) : d.getDate() + 1
row.planproduceend_date = [year, month, day1].join('-') + ' ' + ['07', '30', '00'].join(':')
}
if (val === '01') {
row.planproducestart_date = [year, month, day].join('-') + ' ' + ['07', '30', '00'].join(':')
row.planproduceend_date = [year, month, day].join('-') + ' ' + ['18', '30', '00'].join(':')
}
this.tableData.splice(index, 1, row)
},
@@ -283,6 +305,13 @@ export default {
const day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
return [year, month, day].join('-') + ' ' + ['07', '30', '00'].join(':')
},
dateFormatter1(str) {
const d = new Date(str)
const year = d.getFullYear()
const month = (d.getMonth() + 1) < 10 ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1)
const day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
return [year, month, day].join('-') + ' ' + ['18', '30', '00'].join(':')
},
deleteRow(index, rows) {
rows.splice(index, 1)
},
@@ -312,6 +341,7 @@ export default {
}
crudProduceshiftorder.addRows(this.tableData)
this.$emit('update:dialogShow', false)
this.$emit('AddChanged')
}
}
}

View File

@@ -118,7 +118,7 @@
class="filter-item"
/>
</el-form-item>
<rrOperation :crud="crud"/>
<rrOperation :crud="crud" />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
@@ -150,8 +150,8 @@
type="success"
icon="el-icon-position"
size="mini"
:disabled="is_disabled(crud.selections.length,crud.selections[0])"
@click="submits(crud.selections[0])"
:disabled="is_disabled(crud.selections)"
@click="submits(crud.selections)"
>
下发
</el-button>
@@ -203,10 +203,10 @@
</el-select>
</el-form-item>
<el-form-item label="生产日期" prop="produce_date">
<el-date-picker v-model="form.produce_date" type="date" value-format="yyyy-MM-dd" style="width: 200px;"/>
<el-date-picker v-model="form.produce_date" type="date" value-format="yyyy-MM-dd" style="width: 200px;" />
</el-form-item>
<el-form-item v-if="false" label="物料标识" prop="material_id">
<el-input v-model="form.material_id" style="width: 200px;"/>
<el-input v-model="form.material_id" style="width: 200px;" />
</el-form-item>
<el-form-item label="物料编码" prop="material_code">
<el-input
@@ -232,10 +232,10 @@
/>
</el-form-item>
<el-form-item label="物料单重" prop="material_weight">
<el-input v-model="form.material_weight" style="width: 200px;"/>
<el-input v-model="form.material_weight" style="width: 200px;" />
</el-form-item>
<el-form-item label="计划数量" prop="plan_qty">
<el-input v-model="form.plan_qty" style="width: 200px;"/>
<el-input v-model="form.plan_qty" style="width: 200px;" />
</el-form-item>
<el-form-item label="计划开始时间" prop="planproducestart_date">
<el-date-picker
@@ -254,10 +254,10 @@
/>
</el-form-item>
<el-form-item v-if="crud.status.edit" label="报工数量" prop="report_qty">
<el-input v-model="form.report_qty" style="width: 200px;"/>
<el-input v-model="form.report_qty" style="width: 200px;" />
</el-form-item>
<el-form-item v-if="crud.status.edit" label="实际数量" prop="report_qty">
<el-input v-model="form.real_qty" style="width: 200px;"/>
<el-input v-model="form.real_qty" style="width: 200px;" />
</el-form-item>
<el-form-item label="班次类型" prop="shift_type_scode">
<el-select
@@ -265,6 +265,7 @@
style="width: 200px"
clearable
filterable
@change="change"
placeholder="请选择"
>
<el-option
@@ -276,7 +277,7 @@
</el-select>
</el-form-item>
<el-form-item label="销售单标识">
<el-input v-model="form.sale_id" style="width: 200px;"/>
<el-input v-model="form.sale_id" style="width: 200px;" />
</el-form-item>
<el-form-item label="是否搬运" prop="is_needmove">
<el-radio
@@ -297,6 +298,10 @@
>{{ item.label }}
</el-radio>
</el-form-item>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<el-form-item label="工单数量" prop="orderNum">
<el-input v-model="form.orderNum" type="number" :min="1" oninput="value = value.replace(/[^\d]/g, '')" style="width: 200px;" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button>
@@ -312,14 +317,14 @@
style="width: 100%;"
@selection-change="crud.selectionChangeHandler"
>
<el-table-column type="selection" width="55"/>
<el-table-column v-if="false" prop="produceorder_id" label="生产班次工单标识"/>
<el-table-column type="selection" width="55" />
<el-table-column v-if="false" prop="produceorder_id" label="生产班次工单标识" />
<el-table-column prop="produceorder_code" label="工单编号" width="140px">
<template slot-scope="scope">
<el-link type="warning" @click="toView(scope.row)">{{ scope.row.produceorder_code }}</el-link>
</template>
</el-table-column>
<el-table-column prop="producedeviceorder_code" label="机台工单号" width="100px"/>
<el-table-column prop="producedeviceorder_code" label="机台工单号" width="100px" />
<el-table-column prop="order_status" label="工单状态">
<template slot-scope="scope">
{{ dict.label.MPS_BD_ORDERSTATUS[scope.row.order_status] }}
@@ -330,22 +335,25 @@
{{ dict.label.PDM_BI_SHIFTTYPE[scope.row.shift_type_scode] }}
</template>
</el-table-column>
<el-table-column v-if="false" prop="workprocedure_id" label="工序标识"/>
<el-table-column prop="produce_date" label="生产日期" width="100px"/>
<el-table-column prop="plan_qty" label="计划数量"/>
<el-table-column prop="real_qty" label="实际数量"/>
<el-table-column prop="report_qty" label="报工数量"/>
<el-table-column v-if="false" prop="material_id" label="物料标识"/>
<el-table-column prop="material_code" label="物料编码" width="100" show-overflow-tooltip/>
<el-table-column prop="material_name" label="物料名称" width="100" show-overflow-tooltip/>
<el-table-column prop="material_spec" label="物料规格" width="100" show-overflow-tooltip/>
<el-table-column prop="sale_id" label="销售单标识" width="100" show-overflow-tooltip/>
<el-table-column prop="class_name" label="产品系列" width="100" show-overflow-tooltip/>
<el-table-column prop="material_weight" label="物料单重" :formatter="rounding"/>
<el-table-column prop="planproducestart_date" label="计划生产开始时间" width="150"/>
<el-table-column prop="planproduceend_date" label="计划生产结束时间" width="150"/>
<el-table-column prop="realproducestart_date" label="实际生产开始时间" width="150"/>
<el-table-column prop="realproduceend_date" label="实际生产结束时间" width="150"/>
<el-table-column v-if="false" prop="workprocedure_id" label="工序标识" />
<el-table-column prop="produce_date" label="生产日期" width="100px" />
<el-table-column prop="device_code" label="设备编码" />
<el-table-column prop="device_name" label="设备名称" />
<el-table-column prop="jockey_name" label="操作工" />
<el-table-column prop="plan_qty" label="计划数量" />
<el-table-column prop="real_qty" label="实际数量" />
<el-table-column prop="report_qty" label="报工数量" />
<el-table-column v-if="false" prop="material_id" label="物料标识" />
<el-table-column prop="material_code" label="物料编码" width="100" show-overflow-tooltip />
<el-table-column prop="material_name" label="物料名称" width="100" show-overflow-tooltip />
<el-table-column prop="material_spec" label="物料规格" width="100" show-overflow-tooltip />
<el-table-column prop="sale_id" label="销售单标识" width="100" show-overflow-tooltip />
<el-table-column prop="class_name" label="产品系列" width="100" show-overflow-tooltip />
<el-table-column prop="material_weight" label="物料单重" :formatter="rounding" />
<el-table-column prop="planproducestart_date" label="计划生产开始时间" width="150" />
<el-table-column prop="planproduceend_date" label="计划生产结束时间" width="150" />
<el-table-column prop="realproducestart_date" label="实际生产开始时间" width="150" />
<el-table-column prop="realproduceend_date" label="实际生产结束时间" width="150" />
<el-table-column prop="is_needmove" label="是否搬运">
<template slot-scope="scope">
{{ dict.label.IS_OR_NOT[scope.row.is_needmove] }}
@@ -356,10 +364,10 @@
{{ dict.label.PDM_BI_ORDERTYPE[scope.row.order_type_scode] }}
</template>
</el-table-column>
<el-table-column prop="create_name" label="创建人"/>
<el-table-column prop="create_time" label="创建时间" width="150"/>
<el-table-column prop="update_optname" label="修改人"/>
<el-table-column prop="update_time" label="修改时间" width="150"/>
<el-table-column prop="create_name" label="创建人" />
<el-table-column prop="create_time" label="创建时间" width="150" />
<el-table-column prop="update_optname" label="修改人" />
<el-table-column prop="update_time" label="修改时间" width="150" />
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
<template slot-scope="scope">
<udOperation
@@ -370,7 +378,7 @@
</el-table-column>
</el-table>
<!--分页组件-->
<pagination/>
<pagination />
</div>
<MaterDtl
:dialog-show.sync="materialShow"
@@ -378,21 +386,21 @@
:mater-opt-code="materType"
@setMaterValue="setMaterValue"
/>
<ViewDialog ref="child3"/>
<AddDialog :dialog-show.sync="addShow" @AddChanged="querytable"/>
<ViewDialog ref="child3" />
<AddDialog :dialog-show.sync="addShow" @AddChanged="querytable" />
</div>
</template>
<script>
import crudProduceshiftorder from '@/api/wms/mps/produceshiftorder'
import CRUD, {presenter, header, form, crud} from '@crud/crud'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import crudWorkProcedure from '@/api/wms/basedata/pdm/workProcedure'
import MaterDtl from '@/views/wms/pub/MaterDialog'
import Treeselect, {LOAD_CHILDREN_OPTIONS} from '@riophae/vue-treeselect'
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import ViewDialog from '@/views/wms/mps/produce/ViewDialog'
import crudClassstandard from '@/api/wms/basedata/master/classstandard'
@@ -431,11 +439,12 @@ const defaultForm = {
device_id: null,
is_canupdate_update: '1',
material_spec: null,
sale_id: null
sale_id: null,
orderNum: 1
}
export default {
name: 'Produceshiftorder',
components: {AddDialog, pagination, crudOperation, rrOperation, udOperation, MaterDtl, Treeselect, ViewDialog},
components: { AddDialog, pagination, crudOperation, rrOperation, udOperation, MaterDtl, Treeselect, ViewDialog },
mixins: [presenter(), header(), form(defaultForm), crud()],
dicts: ['PDM_BI_SHIFTTYPE', 'MPS_BD_ORDERSTATUS', 'is_used', 'PDM_BI_ORDERTYPE', 'IS_OR_NOT'],
cruds() {
@@ -451,7 +460,7 @@ export default {
query: {
order_status: '-1'
},
crudMethod: {...crudProduceshiftorder}
crudMethod: { ...crudProduceshiftorder }
})
},
data() {
@@ -465,40 +474,40 @@ export default {
permission: {},
rules: {
produceorder_code: [
{required: true, message: '生产班次工单编号不能为空', trigger: 'blur'}
{ required: true, message: '生产班次工单编号不能为空', trigger: 'blur' }
],
producedeviceorder_code: [
{required: true, message: '机台工单号不能为空', trigger: 'blur'}
{ required: true, message: '机台工单号不能为空', trigger: 'blur' }
],
shift_type_scode: [
{required: true, message: '班次类型不能为空', trigger: 'blur'}
{ required: true, message: '班次类型不能为空', trigger: 'blur' }
],
workprocedure_id: [
{required: true, message: '工序标识不能为空', trigger: 'blur'}
{ required: true, message: '工序标识不能为空', trigger: 'blur' }
],
produce_date: [
{required: true, message: '生产日期不能为空', trigger: 'blur'}
{ required: true, message: '生产日期不能为空', trigger: 'blur' }
],
plan_qty: [
{required: true, message: '计划数量不能为空', trigger: 'blur'}
{ required: true, message: '计划数量不能为空', trigger: 'blur' }
],
material_code: [
{required: true, message: '物料编码不能为空', trigger: 'change'}
],
planproducestart_date: [
{required: true, message: '计划生产开始时间不能为空', trigger: 'blur'}
{ required: true, message: '物料编码不能为空', trigger: 'change' }
],
order_status: [
{required: true, message: '工单状态不能为空', trigger: 'blur'}
{ required: true, message: '工单状态不能为空', trigger: 'blur' }
],
is_needmove: [
{required: true, message: '是否搬运不能为空', trigger: 'blur'}
{ required: true, message: '是否搬运不能为空', trigger: 'blur' }
],
order_type_scode: [
{required: true, message: '工单类型不能为空', trigger: 'blur'}
{ required: true, message: '工单类型不能为空', trigger: 'blur' }
],
orderNum: [
{ required: true, message: '生成工单数量不能为空', trigger: 'blur' }
],
is_canupdate_update: [
{required: true, message: '不能为空', trigger: 'blur'}
{ required: true, message: '不能为空', trigger: 'blur' }
]
}
}
@@ -508,6 +517,42 @@ export default {
this.initClass3()
},
methods: {
initDataPlan() {
const date = this.dateFormatter(new Date())
const formatter1 = this.dateFormatter1(new Date())
this.form.planproducestart_date = date
this.form.planproduceend_date = formatter1
this.form.produce_date = date
},
change(val) {
const d = new Date()
const year = d.getFullYear()
const month = (d.getMonth() + 1) < 10 ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1)
const day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
if (val === '02') {
this.form.planproducestart_date = [year, month, day].join('-') + ' ' + ['18', '30', '00'].join(':')
const day1 = d.getDate() < 10 ? '0' + (d.getDate() + 1) : d.getDate() + 1
this.form.planproduceend_date = [year, month, day1].join('-') + ' ' + ['07', '30', '00'].join(':')
}
if (val === '01') {
this.form.planproducestart_date = [year, month, day].join('-') + ' ' + ['07', '30', '00'].join(':')
this.form.planproduceend_date = [year, month, day].join('-') + ' ' + ['18', '30', '00'].join(':')
}
},
dateFormatter(str) {
const d = new Date(str)
const year = d.getFullYear()
const month = (d.getMonth() + 1) < 10 ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1)
const day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
return [year, month, day].join('-') + ' ' + ['07', '30', '00'].join(':')
},
dateFormatter1(str) {
const d = new Date(str)
const year = d.getFullYear()
const month = (d.getMonth() + 1) < 10 ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1)
const day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
return [year, month, day].join('-') + ' ' + ['18', '30', '00'].join(':')
},
queryClassId() {
const param = {
'class_idStr': this.class_idStr
@@ -532,10 +577,10 @@ export default {
})
},
// 获取子节点数据
loadChildNodes({action, parentNode, callback}) {
loadChildNodes({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
crudClassstandard.getClass({pid: parentNode.id}).then(res => {
parentNode.children = res.content.map(function (obj) {
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
parentNode.children = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
@@ -578,7 +623,7 @@ export default {
},
// 强制完成
forceFinish(data) {
crudProduceshiftorder.forceFinish({row: data}).then(res => {
crudProduceshiftorder.forceFinish({ row: data }).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
@@ -588,8 +633,18 @@ export default {
return parseFloat(row[column.property]).toFixed(2)
},
// 下发按钮禁用条件
is_disabled(len, row) {
if (len === 1 && row.order_status === '00') {
is_disabled(rows) {
var length = rows.length
if (length > 1) {
var flag = false
for (let i = 0; i < rows.length; i++) {
if (rows[i].order_status !== '00') {
flag = true
break
}
}
return flag
} else if (length === 1 && rows[0].order_status === '00') {
return false
} else {
return true
@@ -609,17 +664,23 @@ export default {
})
},
// 下发
submits(row) {
crudProduceshiftorder.submits({produceorder_id: row.produceorder_id}).then(res => {
submits(rows) {
rows.forEach((item) => {
var produceorder_id = item.produceorder_id
crudProduceshiftorder.submits({ produceorder_id: produceorder_id }).then(res => {
})
})
this.crud.notify('下发成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
})
},
add() {
this.addShow = true
},
copyAdd(data) {
this.crud.toCopy(data)
},
[CRUD.HOOK.beforeToAdd]() {
this.initDataPlan()
}
}
}

View File

@@ -542,7 +542,7 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
list.add(new ItemDto(item_mode, "手自动状态", "DB1.B0.0", Boolean.valueOf(true)));
list.add(new ItemDto(item_matching_barcode, "开始条码匹配", "DB1.B1.0"));
list.add(new ItemDto(item_move, "对接位有货", "DB1.B1.2"));

View File

@@ -57,7 +57,7 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
list.add(new ItemDto(item_move, "光电信号", "DB1.W22"));
list.add(new ItemDto(item_mode, "模式", "DB1.B0.6"));
return list;

View File

@@ -280,15 +280,17 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
if (order_now != last_order_now) {
logServer.deviceLog(this.device_code,"order_now" ,String.valueOf(order_now));
logServer.deviceLogToacs(this.device_code,"","","信号order_now:" + last_order_now + "->" + order_now);
}
if (one_now != last_one_now) {
logServer.deviceLog(this.device_code,"one_now" ,String.valueOf(one_now));
logServer.deviceLogToacs(this.device_code,"","","信号one_now:" + last_one_now + "->" + one_now);
if (mode == 1 && order > 0){
JSONObject map = new JSONObject();
map.put("order",order);
map.put("real_qty",order_now);
acsToWmsService.feedOrderRealQty(map);
}
}
if (one_now != last_one_now) {
logServer.deviceLog(this.device_code,"one_now" ,String.valueOf(one_now));
logServer.deviceLogToacs(this.device_code,"","","信号one_now:" + last_one_now + "->" + one_now);
}
if (task != last_task) {
logServer.deviceLog(this.device_code,"task" ,String.valueOf(task));
logServer.deviceLogToacs(this.device_code,"","","信号task:" + last_task + "->" + task);
@@ -317,7 +319,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
synchronized (this){
long now_feedTime = System.currentTimeMillis();
if (now_feedTime - last_feedDeviceStatusTime >= 10000){
if (now_feedTime - last_feedDeviceStatusTime >= 3000){
heartbeat = this.itemProtocol.getItem_heartbeat();
if (heartbeat == last_heartbeat){
status_type = 01;
@@ -390,6 +392,7 @@ public class HailiangEngravingMachineDeviceDriver extends AbstractOpcDeviceDrive
produceshiftorderService.updateByOrderCode(dto);
this.writing("to_confirm_finished","1");
this.writing("to_clear","1");
this.writing("to_order", "0");
this.writing("to_pause","1");
logServer.deviceLogToacs(this.device_code,"","",device_code+":,任务确认完成,电器信号写入成功");
}else {

View File

@@ -181,7 +181,7 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
list.add(new ItemDto(item_status, "线体状态", "DB1.B0.0"));
list.add(new ItemDto(item_is_open, "线体开机状态", "DB1.B0.1"));
list.add(new ItemDto(item_is_running, "刻字机运行状态", "DB1.B0.3"));

View File

@@ -236,11 +236,12 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
if (order_now != last_order_now) {
logServer.deviceLog(this.device_code, "order_now", String.valueOf(order_now));
logServer.deviceLogToacs(this.device_code, "", "", "信号order_now:" + last_order_now + "->" + order_now);
if (mode == 1 && order > 0){
JSONObject map = new JSONObject();
map.put("order",order);
map.put("real_qty",order_now);
acsToWmsService.feedOrderRealQty(map);
System.out.println(device_code + "当前数量:" + order_now);
}
}
/* if (open_ready_time != last_open_ready_time) {
@@ -262,7 +263,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
synchronized (this){
long now_feedTime = System.currentTimeMillis();
if (now_feedTime - last_feedDeviceStatusTime >= 10000){
if (now_feedTime - last_feedDeviceStatusTime >= 3000){
heartbeat = this.itemProtocol.getItem_heartbeat();
if (heartbeat == last_heartbeat){
status_type = 01;
@@ -338,6 +339,7 @@ public class HailiangPackerStationDeviceDriver extends AbstractOpcDeviceDriver i
this.writing("to_confirm_finished", "1");
this.writing("to_clear", "1");
this.writing("to_pause", "1");
this.writing("to_order", "0");
logServer.deviceLogToacs(this.device_code, "", "", device_code + ":,任务确认完成,电器信号写入成功");
}

View File

@@ -136,7 +136,7 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
list.add(new ItemDto(item_packer_ready, "包装机就绪", "DB1.B0.5"));
list.add(new ItemDto(item_mode, "模式", "DB1.B0.6"));
list.add(new ItemDto(item_move, "光电信号", "DB1.B1.0"));

View File

@@ -313,10 +313,11 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
logServer.deviceLog(this.device_code,"now_order_prod_num" ,String.valueOf(now_order_prod_num));
logServer.deviceLogToacs(this.device_code,"","","信号now_order_prod_num:" + last_now_order_prod_num + "->" + now_order_prod_num);
JSONObject map = new JSONObject();
if (mode == 1 && order > 0){
map.put("order",order);
map.put("real_qty",now_order_prod_num);
acsToWmsService.feedOrderRealQty(map);
System.out.println(device_code + "当前数量:" + now_order_prod_num);
}
}
if (full_number != last_full_number) {
logServer.deviceLog(this.device_code,"full_number" ,String.valueOf(full_number));
@@ -352,7 +353,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
}
synchronized (this){
long now_feedTime = System.currentTimeMillis();
if (now_feedTime - last_feedDeviceStatusTime >= 10000){
if (now_feedTime - last_feedDeviceStatusTime >= 3000){
heartbeat = this.itemProtocol.getHeartbeat();
if (heartbeat == last_heartbeat){
status_type = 01;
@@ -427,6 +428,7 @@ public class HailiangSpecialDeviceDriver extends AbstractOpcDeviceDriver impleme
produceshiftorderService.updateByOrderCode(dto);
this.writing("to_confirm_finished","1");
this.writing("to_clear","1");
this.writing("to_order", "0");
this.writing("to_pause","1");
} else {
logServer.deviceLogToacs(this.device_code,"","",device_code+":,order_finish>"+ finish +",last_finish>"+last_finish);

View File

@@ -212,7 +212,7 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
list.add(new ItemDto(item_mode, "手自动状态", "DB1.B1.7", Boolean.valueOf(true)));
list.add(new ItemDto(item_is_open, "线体是否启动", "DB1.B0.1"));
list.add(new ItemDto(item_running, "是否运行", "DB1.B0.6"));

View File

@@ -86,7 +86,7 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
list.add(new ItemDto(item_mode, "是否启动", "DB1.B0.1"));
list.add(new ItemDto(item_status, "手自动状态", "DB1.B0.0", Boolean.valueOf(true)));
list.add(new ItemDto(item_move, "光电开关信号(取反)", "DB1.B0.5"));

View File

@@ -86,7 +86,7 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
list.add(new ItemDto(item_mode, "是否启动", "DB1.B0.1"));
list.add(new ItemDto(item_move, "光电开关信号", "DB1.B1.0"));
list.add(new ItemDto(item_status, "手自动状态", "DB1.B0.0", Boolean.valueOf(true)));

View File

@@ -77,7 +77,7 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
list.add(new ItemDto(item_mode, "是否启动", "DB1.B0.1"));
list.add(new ItemDto(item_status, "手自动状态", "DB1.B0.0", Boolean.valueOf(true)));
list.add(new ItemDto(item_finish, "是否完成", "DB1.B0.7"));

View File

@@ -85,7 +85,7 @@ public class ItemProtocol {
public static List<ItemDto> getReadableItemDtos() {
ArrayList list = new ArrayList();
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.D82"));
list.add(new ItemDto(item_heartbeat, "心跳", "DB1.W82"));
list.add(new ItemDto(item_mode, "是否启动", "DB1.B0.1"));
list.add(new ItemDto(item_status, "手自动状态", "DB1.B0.0", Boolean.valueOf(true)));
list.add(new ItemDto(item_running, "是否运行", "DB1.B0.6"));

View File

@@ -1,6 +1,7 @@
package org.nl.acs.ext.wms.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
@@ -15,6 +16,8 @@ import org.nl.acs.device.address.service.dto.AddressDto;
import org.nl.acs.device.service.DeviceService;
import org.nl.acs.ext.wms.service.AcsToWmsService;
import org.nl.acs.log.service.LogServer;
import org.nl.acs.order.service.ProduceshiftorderService;
import org.nl.acs.order.service.dto.ProduceshiftorderDto;
import org.nl.acs.task.service.TaskService;
import org.nl.acs.task.service.dto.TaskDto;
import org.nl.exception.BadRequestException;
@@ -31,6 +34,8 @@ import java.util.Map;
@RequiredArgsConstructor
@Slf4j
public class AcsToWmsServiceImpl implements AcsToWmsService {
@Autowired
ProduceshiftorderService produceshiftorderService;
@Autowired
AcsConfigService acsConfigService;
@@ -579,6 +584,12 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
@Override
public HttpResponse feedOrderRealQty(JSONObject param) {
if (StrUtil.equals(acsConfigService.findConfigFromCache().get(AcsConfig.HASWMS).toString(), "1")) {
String order_code = param.getString("order");
ProduceshiftorderDto produceshiftorderDto = produceshiftorderService.findByCode(order_code);
if (ObjectUtil.isEmpty(produceshiftorderDto)){
return null;
}
if (!produceshiftorderDto.getOrder_status().equals("2") || !produceshiftorderDto.getOrder_status().equals("3")){
String wmsUrl = acsConfigService.findConfigFromCache().get(AcsConfig.WMSURL);
// TODO 还没向地址表中添加 feedDeviceStatusType
AddressDto addressDto = addressService.findByCode("feedOrderRealQty");
@@ -605,6 +616,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
}
return result;
}
}
return null;
}

View File

@@ -6,6 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import lombok.RequiredArgsConstructor;
import org.nl.acs.device.service.DeviceExtraService;
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_cleaning_machine_storage_station.HailiangCleaningMachineStorageStationDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_engraving_machine.HailiangEngravingMachineDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_packer_station.HailiangPackerStationDeviceDriver;
import org.nl.acs.device_driver.basedriver.hailiang_one.hailiang_smart_plc_test.HailiangSmartplcTestDeviceDriver;
@@ -49,7 +50,7 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, ApplicationAutoInitial {
private final org.nl.acs.opc.DeviceAppService DeviceAppService;
private final org.nl.acs.opc.DeviceAppService deviceAppService;
private final DeviceExtraService deviceExtraService;
List<ProduceshiftorderDto> order = new ArrayList();
@@ -110,7 +111,7 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
@Transactional(rollbackFor = Exception.class)
public void create(ProduceshiftorderDto dto) {
WQLObject wo = WQLObject.getWQLObject("acs_produceshiftorder");
Device device = DeviceAppService.findDeviceByCode(dto.getDevice_code());
Device device = deviceAppService.findDeviceByCode(dto.getDevice_code());
if (ObjectUtil.isEmpty(device)) {
throw new BadRequestException("未找到对应设备:" + dto.getDevice_code());
}
@@ -228,6 +229,23 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
if (StrUtil.equals(dto.getOrder_status(), "0") || StrUtil.equals(dto.getOrder_status(), "1")) {
order.add(dto);
}
if (StrUtil.equals(dto.getOrder_status(), "3")){
String device_code = dto.getDevice_code();
Device device = deviceAppService.findDeviceByCode(device_code);
HailiangEngravingMachineDeviceDriver hailiangEngravingMachineDeviceDriver;
HailiangPackerStationDeviceDriver hailiangPackerStationDeviceDriver;
HailiangSpecialDeviceDriver hailiangSpecialDeviceDriver;
if (device.getDeviceDriver() instanceof HailiangSpecialDeviceDriver){
hailiangSpecialDeviceDriver = (HailiangSpecialDeviceDriver) device.getDeviceDriver();
hailiangSpecialDeviceDriver.writing("to_order","0");
} else if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver){
hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver();
hailiangPackerStationDeviceDriver.writing("to_order","0");
} else if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver){
hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver();
hailiangEngravingMachineDeviceDriver.writing("to_order","0");
}
}
}
@Override
@@ -308,21 +326,24 @@ public class ProduceshiftorderServiceImpl implements ProduceshiftorderService, A
param.put("type", "2");
acsToWmsService.feedbackOrderStatus(param);
}
Device device = DeviceAppService.findDeviceByCode(param.getString("device_code"));
Device device = deviceAppService.findDeviceByCode(param.getString("device_code"));
HailiangSpecialDeviceDriver hailiangSpecialDeviceDriver;
HailiangPackerStationDeviceDriver hailiangPackerStationDeviceDriver;
HailiangEngravingMachineDeviceDriver hailiangEngravingMachineDeviceDriver;
if (device.getDeviceDriver() instanceof HailiangSpecialDeviceDriver) {
hailiangSpecialDeviceDriver = (HailiangSpecialDeviceDriver) device.getDeviceDriver();
hailiangSpecialDeviceDriver.writing("to_order_compel_finished", "1");
hailiangSpecialDeviceDriver.writing("to_order", "0");
}
if (device.getDeviceDriver() instanceof HailiangPackerStationDeviceDriver) {
hailiangPackerStationDeviceDriver = (HailiangPackerStationDeviceDriver) device.getDeviceDriver();
hailiangPackerStationDeviceDriver.writing("to_order_compel_finished", "1");
hailiangPackerStationDeviceDriver.writing("to_order", "0");
}
if (device.getDeviceDriver() instanceof HailiangEngravingMachineDeviceDriver) {
hailiangEngravingMachineDeviceDriver = (HailiangEngravingMachineDeviceDriver) device.getDeviceDriver();
hailiangEngravingMachineDeviceDriver.writing("to_order_compel_finished", "1");
hailiangEngravingMachineDeviceDriver.writing("to_order", "0");
}
JSONObject map = new JSONObject();
map.put("order_id", order_id);

View File

@@ -7,6 +7,7 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.device.service.DeviceService;
import org.nl.modules.log.service.RootLogService;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.MongoTemplate;
@@ -93,17 +94,25 @@ public class RootLogServiceImpl implements RootLogService {
.lte(end_time));
}
//根据条件得到的总条数
Pageable pageable = PageRequest.of(page.getPageNumber(), page.getPageSize());
long totalCount = mongoTemplate.count(query,device_code);
List<Map> result = mongoTemplate.find(query.with(pageable), Map.class, device_code);
long totalPage = totalCount % page.getPageSize() == 0 ? totalCount / page.getPageSize() : totalCount / page.getPageSize() + 1;
/* //根据条件得到的总条数
long totalSize = mongoTemplate.count(query, Map.class, device_code);
//处理分页
query.skip(page.getPageNumber()).limit(page.getPageSize());
List<Map> list = mongoTemplate.find(query,Map.class, device_code);
List<Map> list = mongoTemplate.find(query,Map.class, device_code);*/
//封装前端分页查询结果
JSONObject result = new JSONObject();
result.put("content", list);
result.put("totalElements", totalSize);
return result;
JSONObject jo = new JSONObject();
jo.put("content", result);
jo.put("totalElements", totalCount);
return jo;
}
@Override

View File

@@ -8,12 +8,12 @@ spring:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_acs}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:hl_acs_one}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.225}:${DB_PORT:3306}/${DB_NAME:hl_acs_one}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true
username: ${DB_USER:root}
# password: ${DB_PWD:123456}
password: ${DB_PWD:Root.123456}
#password: ${DB_PWD:password}
#password: ${DB_PWD:Root.123456}
password: ${DB_PWD:password}
# 初始连接数
initial-size: 5
# 最小连接数
@@ -59,13 +59,13 @@ spring:
multi-statement-alagvslow: true
data:
mongodb:
host: 47.111.78.178
host: 127.0.0.1
port: 27017
database: nlacs
redis:
#数据库索引
database: ${REDIS_DB:10}
host: ${REDIS_HOST:47.111.78.178}
host: ${REDIS_HOST:127.0.0.1}
port: ${REDIS_PORT:6379}
password: ${REDIS_PWD:}
#连接超时时间
@@ -162,5 +162,5 @@ jetcache:
maxIdle: 200
maxTotal: 1000
uri:
- redis://47.111.78.178:6379
- redis://127.0.0.1:6379

View File

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

View File

@@ -184,7 +184,7 @@
<el-radio-button :label="1"></el-radio-button>
</el-radio-group>
</el-form-item>
<el-form-item label="空请求成功" prop="fullrequireSucess" label-width="120px">
<el-form-item label="空请求成功" prop="fullrequireSucess" label-width="120px">
<el-radio-group v-model="form.fullrequireSucess">
<el-radio-button :label="0"></el-radio-button>
<el-radio-button :label="1"></el-radio-button>

View File

@@ -29,7 +29,6 @@
<el-date-picker
v-model="query.createTime"
type="datetimerange"
:picker-options="pickerOptions"
class="filter-item"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator=""