代码更新

This commit is contained in:
2022-07-06 15:25:06 +08:00
parent de55ae98ea
commit ecde2f60ec
4 changed files with 226 additions and 189 deletions

View File

@@ -60,6 +60,7 @@ public class FlourworkServiceImpl implements FlourworkService {
String is_all = MapUtil.getStr(whereJson, "is_all"); String is_all = MapUtil.getStr(whereJson, "is_all");
String biz_date = MapUtil.getStr(whereJson, "biz_date"); String biz_date = MapUtil.getStr(whereJson, "biz_date");
String pcsn = MapUtil.getStr(whereJson, "pcsn"); String pcsn = MapUtil.getStr(whereJson, "pcsn");
String formula_code = MapUtil.getStr(whereJson, "formula_code");
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
map.put("flag", "1"); map.put("flag", "1");
map.put("device_id", MapUtil.getStr(whereJson, "device_id")); 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 (StrUtil.equals(is_all, "0")) map.put("status", "99");
if (ObjectUtil.isNotEmpty(pcsn)) map.put("pcsn", "%"+pcsn+"%"); 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"); JSONObject json = WQL.getWO("QPDM_BI_FORMULA01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "fMst.status,task.start_time,fMst.bucket_type ASC");
return json; return json;
} }
@@ -383,9 +385,17 @@ public class FlourworkServiceImpl implements FlourworkService {
String formula_code = whereJson.getString("formula_code"); String formula_code = whereJson.getString("formula_code");
String device_id = whereJson.getString("device_id"); String device_id = whereJson.getString("device_id");
WQLObject dtlTab = WQLObject.getWQLObject("PDM_BI_FormulaDtl"); WQLObject dtlTab = WQLObject.getWQLObject("PDM_BI_FormulaDtl"); // 配方明细表
WQLObject mstTab = WQLObject.getWQLObject("PDM_BI_Formula"); 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<>(); HashMap<String, String> param = new HashMap<>();
param.put("flag", "8"); param.put("flag", "8");
param.put("formula_code", formula_code); 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"); String storagevehicle_id = jsonMst.getString("storagevehicle_id");
if (ObjectUtil.isEmpty(storagevehicle_id)) throw new BadRequestException("此配方没有配粉槽"); if (ObjectUtil.isEmpty(storagevehicle_id)) throw new BadRequestException("此配方没有配粉槽");
HashMap<String, String> map = new HashMap<>(); HashMap<String, String> map = new HashMap<>();
@@ -504,6 +511,11 @@ public class FlourworkServiceImpl implements FlourworkService {
jsonDtl.put("start_name", nickName); jsonDtl.put("start_name", nickName);
jsonDtl.put("start_time", now); jsonDtl.put("start_time", now);
dtlTab.update(jsonDtl); dtlTab.update(jsonDtl);
} else {
throw new BadRequestException("配方状态不为生产中或者工序任务不为生产中");
}
} }
@Override @Override
@@ -900,14 +912,18 @@ public class FlourworkServiceImpl implements FlourworkService {
WQLObject dtlTab = WQLObject.getWQLObject("PDM_BI_FormulaDtl"); WQLObject dtlTab = WQLObject.getWQLObject("PDM_BI_FormulaDtl");
WQLObject mstTab = WQLObject.getWQLObject("PDM_BI_Formula"); 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 jsonDtl = dtlTab.query("formuladtl_id = '" + formuladtl_id + "'").uniqueResult(0);
// 查询配粉槽重量 // 查询配粉槽重量
JSONObject jsonMst = mstTab.query("formula_id ='" + jsonDtl.getString("formula_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(); JSONArray array = new JSONArray();
// 配方编码 // 配方编码
@@ -982,5 +998,10 @@ public class FlourworkServiceImpl implements FlourworkService {
String message = MapUtil.getStr(result, "message"); String message = MapUtil.getStr(result, "message");
throw new BadRequestException("下发电气失败:" + message); throw new BadRequestException("下发电气失败:" + message);
} }
} else {
throw new BadRequestException("配方状态不为生产中或者工序任务不为生产中");
}
} }
} }

View File

@@ -115,6 +115,10 @@
task.device_id = 输入.device_id task.device_id = 输入.device_id
ENDOPTION ENDOPTION
OPTION 输入.formula_code <> ""
fMst.formula_code like 输入.formula_code
ENDOPTION
OPTION 输入.pcsn <> "" OPTION 输入.pcsn <> ""
fMst.pcsn like 输入.pcsn fMst.pcsn like 输入.pcsn
ENDOPTION ENDOPTION

View File

@@ -428,9 +428,9 @@ export default {
if (this.form.storagevehicle_code === '') { if (this.form.storagevehicle_code === '') {
return this.crud.notify('请绑定配粉槽', CRUD.NOTIFICATION_TYPE.INFO) return this.crud.notify('请绑定配粉槽', CRUD.NOTIFICATION_TYPE.INFO)
} }
if (this.form.status !== '30') { // if (this.form.status !== '30') {
return this.crud.notify('配方状态不为生产中', CRUD.NOTIFICATION_TYPE.INFO) // return this.crud.notify('配方状态不为生产中', CRUD.NOTIFICATION_TYPE.INFO)
} // }
const arr = this.tableDtl const arr = this.tableDtl
let num = 0 let num = 0
for (let i = 0; i < arr.length; i++) { for (let i = 0; i < arr.length; i++) {
@@ -475,9 +475,9 @@ export default {
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
if (this.form.status !== '30') { // if (this.form.status !== '30') {
return this.crud.notify('配方状态不为生产中', CRUD.NOTIFICATION_TYPE.INFO) // return this.crud.notify('配方状态不为生产中', CRUD.NOTIFICATION_TYPE.INFO)
} // }
if (this.dtlJson === null) { if (this.dtlJson === null) {
this.crud.notify('请选择物料', CRUD.NOTIFICATION_TYPE.INFO) this.crud.notify('请选择物料', CRUD.NOTIFICATION_TYPE.INFO)
return false return false

View File

@@ -34,6 +34,18 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="配方">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</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="批次"> <el-form-item label="批次">
<label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label> <label slot="label">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:</label>
<el-input <el-input