代码更新
This commit is contained in:
@@ -60,6 +60,7 @@ public class FlourworkServiceImpl implements FlourworkService {
|
||||
String is_all = MapUtil.getStr(whereJson, "is_all");
|
||||
String biz_date = MapUtil.getStr(whereJson, "biz_date");
|
||||
String pcsn = MapUtil.getStr(whereJson, "pcsn");
|
||||
String formula_code = MapUtil.getStr(whereJson, "formula_code");
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
map.put("device_id", MapUtil.getStr(whereJson, "device_id"));
|
||||
@@ -70,6 +71,7 @@ public class FlourworkServiceImpl implements FlourworkService {
|
||||
}
|
||||
if (StrUtil.equals(is_all, "0")) map.put("status", "99");
|
||||
if (ObjectUtil.isNotEmpty(pcsn)) map.put("pcsn", "%"+pcsn+"%");
|
||||
if (ObjectUtil.isNotEmpty(formula_code)) map.put("formula_code", "%"+formula_code+"%");
|
||||
JSONObject json = WQL.getWO("QPDM_BI_FORMULA01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "fMst.status,task.start_time,fMst.bucket_type ASC");
|
||||
return json;
|
||||
}
|
||||
@@ -383,9 +385,17 @@ public class FlourworkServiceImpl implements FlourworkService {
|
||||
String formula_code = whereJson.getString("formula_code");
|
||||
String device_id = whereJson.getString("device_id");
|
||||
|
||||
WQLObject dtlTab = WQLObject.getWQLObject("PDM_BI_FormulaDtl");
|
||||
WQLObject mstTab = WQLObject.getWQLObject("PDM_BI_Formula");
|
||||
WQLObject dtlTab = WQLObject.getWQLObject("PDM_BI_FormulaDtl"); // 配方明细表
|
||||
WQLObject mstTab = WQLObject.getWQLObject("PDM_BI_Formula"); // 配方主表
|
||||
WQLObject workTab = WQLObject.getWQLObject("PDM_BI_WorkTask"); // 工序任务表
|
||||
|
||||
JSONObject jsonDtl = dtlTab.query("formuladtl_id = '" + formuladtl_id + "'").uniqueResult(0);
|
||||
// 查询配粉槽重量
|
||||
JSONObject jsonMst = mstTab.query("formula_id ='" + jsonDtl.getString("formula_id") + "'").uniqueResult(0);
|
||||
// 校验配方状态为30生产中 或者 配方状态为20提交并且工序任务状态为30开始生产
|
||||
String statusMst = jsonMst.getString("status");
|
||||
JSONObject jsonWork = workTab.query("workorder_id = '" + jsonMst.getString("workorder_id") + "' and workprocedure_code = 'GX001' and status = '30'").uniqueResult(0);
|
||||
if (StrUtil.equals(statusMst, "30") || (StrUtil.equals(statusMst, "20") && ObjectUtil.isNotEmpty(jsonWork))) {
|
||||
HashMap<String, String> param = new HashMap<>();
|
||||
param.put("flag", "8");
|
||||
param.put("formula_code", formula_code);
|
||||
@@ -398,9 +408,6 @@ public class FlourworkServiceImpl implements FlourworkService {
|
||||
/*
|
||||
* 下发电气: 配方编号,当前配粉物料编码、物料重量、配粉槽重量、小秤误差值、中秤误差值、大秤误差值
|
||||
*/
|
||||
JSONObject jsonDtl = dtlTab.query("formuladtl_id = '" + formuladtl_id + "'").uniqueResult(0);
|
||||
// 查询配粉槽重量
|
||||
JSONObject jsonMst = mstTab.query("formula_id ='" + jsonDtl.getString("formula_id") + "'").uniqueResult(0);
|
||||
String storagevehicle_id = jsonMst.getString("storagevehicle_id");
|
||||
if (ObjectUtil.isEmpty(storagevehicle_id)) throw new BadRequestException("此配方没有配粉槽");
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
@@ -504,6 +511,11 @@ public class FlourworkServiceImpl implements FlourworkService {
|
||||
jsonDtl.put("start_name", nickName);
|
||||
jsonDtl.put("start_time", now);
|
||||
dtlTab.update(jsonDtl);
|
||||
} else {
|
||||
throw new BadRequestException("配方状态不为生产中或者工序任务不为生产中");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -900,14 +912,18 @@ public class FlourworkServiceImpl implements FlourworkService {
|
||||
|
||||
WQLObject dtlTab = WQLObject.getWQLObject("PDM_BI_FormulaDtl");
|
||||
WQLObject mstTab = WQLObject.getWQLObject("PDM_BI_Formula");
|
||||
WQLObject workTab = WQLObject.getWQLObject("PDM_BI_WorkTask"); // 工序任务表
|
||||
|
||||
/*
|
||||
* 下发电气: 配方编号,当前配粉物料编码、物料重量、配粉槽重量、小秤误差值、中秤误差值、大秤误差值
|
||||
*/
|
||||
JSONObject jsonDtl = dtlTab.query("formuladtl_id = '" + formuladtl_id + "'").uniqueResult(0);
|
||||
// 查询配粉槽重量
|
||||
JSONObject jsonMst = mstTab.query("formula_id ='" + jsonDtl.getString("formula_id") + "'").uniqueResult(0);
|
||||
|
||||
String statusMst = jsonMst.getString("status");
|
||||
JSONObject jsonWork = workTab.query("workorder_id = '" + jsonMst.getString("workorder_id") + "' and workprocedure_code = 'GX001' and status = '30'").uniqueResult(0);
|
||||
if (StrUtil.equals(statusMst, "30") || (StrUtil.equals(statusMst, "20") && ObjectUtil.isNotEmpty(jsonWork))) {
|
||||
/*
|
||||
* 下发电气: 配方编号,当前配粉物料编码、物料重量、配粉槽重量、小秤误差值、中秤误差值、大秤误差值
|
||||
*/
|
||||
// 准备下发的参数
|
||||
JSONArray array = new JSONArray();
|
||||
// 配方编码
|
||||
@@ -982,5 +998,10 @@ public class FlourworkServiceImpl implements FlourworkService {
|
||||
String message = MapUtil.getStr(result, "message");
|
||||
throw new BadRequestException("下发电气失败:" + message);
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestException("配方状态不为生产中或者工序任务不为生产中");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,6 +115,10 @@
|
||||
task.device_id = 输入.device_id
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.formula_code <> ""
|
||||
fMst.formula_code like 输入.formula_code
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.pcsn <> ""
|
||||
fMst.pcsn like 输入.pcsn
|
||||
ENDOPTION
|
||||
|
||||
@@ -428,9 +428,9 @@ export default {
|
||||
if (this.form.storagevehicle_code === '') {
|
||||
return this.crud.notify('请绑定配粉槽', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
if (this.form.status !== '30') {
|
||||
return this.crud.notify('配方状态不为生产中', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
// if (this.form.status !== '30') {
|
||||
// return this.crud.notify('配方状态不为生产中', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
// }
|
||||
const arr = this.tableDtl
|
||||
let num = 0
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
@@ -475,9 +475,9 @@ export default {
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
if (this.form.status !== '30') {
|
||||
return this.crud.notify('配方状态不为生产中', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
// if (this.form.status !== '30') {
|
||||
// return this.crud.notify('配方状态不为生产中', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
// }
|
||||
if (this.dtlJson === null) {
|
||||
this.crud.notify('请选择物料', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return false
|
||||
|
||||
@@ -34,6 +34,18 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="配方">
|
||||
<label slot="label">配 方:</label>
|
||||
<el-input
|
||||
v-model="query.formula_code"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="请输入配方编码"
|
||||
class="filter-item"
|
||||
@keyup.enter.native="crud.toQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="批次">
|
||||
<label slot="label">批 次:</label>
|
||||
<el-input
|
||||
|
||||
Reference in New Issue
Block a user