代码更新

This commit is contained in:
2022-10-25 17:44:05 +08:00
parent 02a4ad78a5
commit d83898e6a4
4 changed files with 27 additions and 13 deletions

View File

@@ -353,6 +353,14 @@ public class MaterialParametersServiceImpl implements MaterialParametersService
JSONObject jsonExtMater = extTab.query("material_id = '" + material_id + "'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonExtMater)) throw new BadRequestException("此PGF扩展属性不存在");
String old_mark = jsonExtMater.getString("old_mark"); // 粉料牌号
String tech_type = "";
if (old_mark.contains("")) {
tech_type = "01";
} else {
tech_type = "02";
}
if (is_pgf) {
/*
* PG粉碳平衡修正
@@ -385,7 +393,7 @@ public class MaterialParametersServiceImpl implements MaterialParametersService
// 2.查询此碳化钨 软废碳平衡修正表获得全部软废类型的值 并转化成数组(便于处理数据)
JSONObject jsonThwMater = materTab.query("material_id = '" + thw_material_id + "'").uniqueResult(0);
JSONObject jsonWas = wasTab.query("material_id = '" + thw_material_id + "'").uniqueResult(0);
JSONObject jsonWas = wasTab.query("material_id = '" + thw_material_id + "' and tech_type = '"+tech_type+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonWas)) throw new BadRequestException("此碳化钨软废修正数据不存在:"+jsonThwMater.getString("material_code"));
// 将此碳化钨的软废类型转化为数组
@@ -447,7 +455,7 @@ public class MaterialParametersServiceImpl implements MaterialParametersService
// 3.找修正值:废类型为编码最后'-'后的内容
JSONObject jsonThwMater = materTab.query("material_id = '" + thw_material_id + "'").uniqueResult(0);
JSONObject jsonWas = wasTab.query("material_id = '" + thw_material_id + "'").uniqueResult(0);
JSONObject jsonWas = wasTab.query("material_id = '" + thw_material_id + "' and tech_type ='"+tech_type+"'").uniqueResult(0);
if (ObjectUtil.isEmpty(jsonWas)) throw new BadRequestException("此碳化钨软废修正数据不存在:"+jsonThwMater.getString("material_name"));
// 将此碳化钨的软废类型转化为数组

View File

@@ -46,13 +46,15 @@ public class WastecchangeServiceImpl implements WastecchangeService {
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
String material_code = MapUtil.getStr(whereJson, "material_code");
String tech_type = MapUtil.getStr(whereJson, "tech_type");
HashMap<String, String> map = new HashMap<>();
map.put("flag", "1");
map.put("tech_type", tech_type);
if (ObjectUtil.isNotEmpty(material_code)) map.put("material_code", "%" + material_code + "%");
map.put("class_ids", MaterOptTypeEnum.THW.getClass_idStr());
JSONObject json = WQL.getWO("PDM_WASTECCHANGE").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "mater.material_code ASC");
JSONObject json = WQL.getWO("PDM_WASTECCHANGE").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "material_code ASC");
return json;
}
@@ -216,8 +218,8 @@ public class WastecchangeServiceImpl implements WastecchangeService {
String nickName = SecurityUtils.getNickName();
// 先删除在插入
JSONObject jsonObject = wasTab.query("material_id = '" + whereJson.getString("material_id") + "'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonObject)) wasTab.delete("material_id = '"+whereJson.getString("material_id")+"'");
JSONObject jsonObject = wasTab.query("material_id = '" + whereJson.getString("material_id") + "' and tech_type ='"+whereJson.getString("tech_type")+"'").uniqueResult(0);
if (ObjectUtil.isNotEmpty(jsonObject)) wasTab.delete("material_id = '"+whereJson.getString("material_id")+"' and tech_type = '"+whereJson.getString("tech_type")+"'");
JSONObject jsonWas = new JSONObject();
jsonWas.put("change_id", IdUtil.getSnowflake(1,1).nextId());

View File

@@ -18,6 +18,7 @@
输入.class_ids TYPEAS f_string
输入.material_id TYPEAS s_string
输入.code TYPEAS s_string
输入.tech_type TYPEAS s_string
[临时表]
@@ -50,7 +51,6 @@
mater.material_name,
mater.material_model,
chan.change_id,
chan.tech_type,
chan.cf_qty,
chan.yz_qty,
chan.cx_qty,
@@ -69,10 +69,11 @@
chan.gz_qty,
chan.create_id,
chan.create_name,
chan.create_time
chan.create_time,
输入.tech_type AS tech_type
FROM
md_me_materialbase mater
LEFT JOIN PDM_BI_WasteCChange chan ON mater.material_id = chan.material_id
LEFT JOIN PDM_BI_WasteCChange chan ON mater.material_id = chan.material_id and chan.tech_type = 输入.tech_type
WHERE
mater.is_delete = '0'
AND mater.is_used = '1'
@@ -86,6 +87,7 @@
mater.material_name like 输入.material_code)
ENDOPTION
ENDSELECT
ENDPAGEQUERY
ENDIF

View File

@@ -21,8 +21,8 @@
/>
</el-form-item>
<el-form-item label="工艺">
<el-radio v-model="form.tech_type" label="01">负压脱蜡</el-radio>
<el-radio v-model="form.tech_type" label="02">氢气脱蜡</el-radio>
<el-radio v-model="query.tech_type" label="01">负压脱蜡</el-radio>
<el-radio v-model="query.tech_type" label="02">氢气脱蜡</el-radio>
</el-form-item>
<rrOperation />
&nbsp;&nbsp;&nbsp;
@@ -271,7 +271,7 @@ import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
const defaultForm = { change_id: null, material_id: null, tech_type: '01', cf_qty: null, yz_qty: null, cx_qty: null, yc_qty: null, jy_qty: null, lt_qty: null, sj_qty: null, ys_qty: null, ds_qty: null, cqx_qty: null, xqx_qty: null, qx_qty: null, jcf_qty: null, tb_qty: null, ycr_qty: null, gz_qty: null, create_id: null, create_name: null, create_time: null }
const defaultForm = { change_id: null, material_id: null, tech_type: null, cf_qty: null, yz_qty: null, cx_qty: null, yc_qty: null, jy_qty: null, lt_qty: null, sj_qty: null, ys_qty: null, ds_qty: null, cqx_qty: null, xqx_qty: null, qx_qty: null, jcf_qty: null, tb_qty: null, ycr_qty: null, gz_qty: null, create_id: null, create_name: null, create_time: null }
export default {
name: 'Wastecchange',
components: { pagination, crudOperation, rrOperation, udOperation },
@@ -289,7 +289,9 @@ export default {
del: false,
download: false,
reset: true
}})
},
query: { tech_type: '02' }
})
},
data() {
return {
@@ -316,7 +318,7 @@ export default {
}
},
confirm(row) {
row.tech_type = this.form.tech_type
// row.tech_type = this.form.tech_type
this.confirm_flg = true
crudWastecchange.confirm(row).then(res => {
this.crud.notify('操作成功', CRUD.NOTIFICATION_TYPE.SUCCESS)