优化
This commit is contained in:
@@ -62,7 +62,7 @@ public class DailyplanServiceImpl implements DailyplanService {
|
||||
map.put("material_code", "%" + material_code + "%");
|
||||
}
|
||||
map.put("flag", "1");
|
||||
JSONObject jret = WQL.getWO("QPDM_PRODUCTDAILYPLAN").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "pp.planstart_date desc");
|
||||
JSONObject jret = WQL.getWO("QPDM_PRODUCTDAILYPLAN").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "pp.planstart_date");
|
||||
JSONArray json = jret.getJSONArray("content");
|
||||
JSONArray ja = new JSONArray();
|
||||
for(int i=0;i<json.size();i++){
|
||||
|
||||
@@ -198,7 +198,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
JSONObject jo = ja.getJSONObject(i);
|
||||
JSONObject jsonMst = PCS_IF_ProductPlanProc.query("plan_id ='" + jo.getString("plan_id") + "' and is_proc = '0'").uniqueResult(0);
|
||||
if (jsonMst == null) {
|
||||
throw new BadRequestException("当前记录状态异常,操作失败!");
|
||||
continue;
|
||||
}
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("is_proc", status);
|
||||
@@ -384,8 +384,8 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
|
||||
double fact_weight = jo.getDouble("fact_weight");
|
||||
double standard_weight = jo.getDouble("standard_weight");
|
||||
//批次数
|
||||
BigDecimal pcsn_num = NumberUtil.round(fact_weight/standard_weight,0);
|
||||
//批次数NumberUtil.ceil(fact_weight/standard_weight)
|
||||
double pcsn_num = Math.ceil(fact_weight/standard_weight);
|
||||
|
||||
JSONObject series = MPS_BD_CapacityTemplateSeries.query("captemplate_id='"+captemplate_id+"' and product_series_id='"+jo.getString("product_series")+"'").uniqueResult(0);
|
||||
if(series ==null){
|
||||
@@ -395,7 +395,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
int totalproducecapacity_qty = series.getInteger("totalproducecapacity_qty");
|
||||
//若初始日期不为空,取此初始日期
|
||||
if(finalChecked.equals("true") && StrUtil.isNotEmpty(nowstart_date)){
|
||||
while(pcsn_num.intValue() > 0){
|
||||
while(pcsn_num > 0){
|
||||
JSONObject ProcessRoute = WQL.getWO("QPDM_PRODUCTPLANPROC").addParam("flag","5")
|
||||
.addParam("material_code",jo.getString("material_id")).process().uniqueResult(0);
|
||||
if(ProcessRoute==null){
|
||||
@@ -404,7 +404,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
int total_plan_time = ProcessRoute.getInteger("total_plan_time");
|
||||
BigDecimal days = NumberUtil.round(total_plan_time/24,0);
|
||||
|
||||
if(pcsn_num.intValue() > totalproducecapacity_qty){
|
||||
if(pcsn_num > totalproducecapacity_qty){
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",totalproducecapacity_qty*standard_weight);
|
||||
jo.put("product_num",totalproducecapacity_qty);
|
||||
@@ -416,11 +416,11 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
this.createDay(jo);
|
||||
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
pcsn_num = BigDecimal.valueOf(pcsn_num.intValue() - totalproducecapacity_qty);
|
||||
pcsn_num = pcsn_num - totalproducecapacity_qty;
|
||||
}else{
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",pcsn_num.intValue()*standard_weight);
|
||||
jo.put("product_num",pcsn_num.intValue());
|
||||
jo.put("product_weight",pcsn_num*standard_weight);
|
||||
jo.put("product_num",pcsn_num);
|
||||
jo.put("product_series_id",jo.getString("product_series"));
|
||||
jo.put("planstart_date",DateUtil.formatDate(date));
|
||||
|
||||
@@ -429,7 +429,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
this.createDay(jo);
|
||||
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
pcsn_num = BigDecimal.valueOf(0);
|
||||
pcsn_num = 0;
|
||||
}
|
||||
}
|
||||
}else{//若初始日期为空,获取日计划表设备标识=此分组设备的最后一个计划
|
||||
@@ -445,7 +445,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
date = DateUtil.parse(nowstart_date);
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
|
||||
while(pcsn_num.intValue() > 0){
|
||||
while(pcsn_num > 0){
|
||||
JSONObject ProcessRoute = WQL.getWO("QPDM_PRODUCTPLANPROC").addParam("flag","5")
|
||||
.addParam("material_code",jo.getString("material_id")).process().uniqueResult(0);
|
||||
if(ProcessRoute==null){
|
||||
@@ -454,7 +454,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
int total_plan_time = ProcessRoute.getInteger("total_plan_time");
|
||||
BigDecimal days = NumberUtil.round(total_plan_time/24,0);
|
||||
|
||||
if(pcsn_num.intValue() > totalproducecapacity_qty){
|
||||
if(pcsn_num > totalproducecapacity_qty){
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",totalproducecapacity_qty*standard_weight);
|
||||
jo.put("product_num",totalproducecapacity_qty);
|
||||
@@ -466,11 +466,11 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
this.createDay(jo);
|
||||
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
pcsn_num = BigDecimal.valueOf(pcsn_num.intValue() - totalproducecapacity_qty);
|
||||
pcsn_num =pcsn_num - totalproducecapacity_qty;
|
||||
}else{
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",pcsn_num.intValue()*standard_weight);
|
||||
jo.put("product_num",pcsn_num.intValue());
|
||||
jo.put("product_weight",pcsn_num*standard_weight);
|
||||
jo.put("product_num",pcsn_num);
|
||||
jo.put("product_series_id",jo.getString("product_series"));
|
||||
jo.put("planstart_date",DateUtil.formatDate(date));
|
||||
|
||||
@@ -479,7 +479,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
this.createDay(jo);
|
||||
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
pcsn_num = BigDecimal.valueOf(0);
|
||||
pcsn_num = 0;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
@@ -487,7 +487,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
date = DateUtil.parse(nowstart_date);
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
|
||||
while(pcsn_num.intValue() > 0){
|
||||
while(pcsn_num > 0){
|
||||
JSONObject ProcessRoute = WQL.getWO("QPDM_PRODUCTPLANPROC").addParam("flag","5")
|
||||
.addParam("material_code",jo.getString("material_id")).process().uniqueResult(0);
|
||||
if(ProcessRoute==null){
|
||||
@@ -496,7 +496,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
int total_plan_time = ProcessRoute.getInteger("total_plan_time");
|
||||
BigDecimal days = NumberUtil.round(total_plan_time/24,0);
|
||||
|
||||
if(pcsn_num.intValue() > totalproducecapacity_qty){
|
||||
if(pcsn_num > totalproducecapacity_qty){
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",totalproducecapacity_qty*standard_weight);
|
||||
jo.put("product_num",totalproducecapacity_qty);
|
||||
@@ -508,11 +508,11 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
this.createDay(jo);
|
||||
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
pcsn_num = BigDecimal.valueOf(pcsn_num.intValue() - totalproducecapacity_qty);
|
||||
pcsn_num = pcsn_num - totalproducecapacity_qty;
|
||||
}else{
|
||||
jo.put("workorder_type","01");
|
||||
jo.put("product_weight",pcsn_num.intValue()*standard_weight);
|
||||
jo.put("product_num",pcsn_num.intValue());
|
||||
jo.put("product_weight",pcsn_num*standard_weight);
|
||||
jo.put("product_num",pcsn_num);
|
||||
jo.put("product_series_id",jo.getString("product_series"));
|
||||
jo.put("planstart_date",DateUtil.formatDate(date));
|
||||
|
||||
@@ -521,7 +521,7 @@ public class ProducetaskprocServiceImpl implements ProducetaskprocService {
|
||||
this.createDay(jo);
|
||||
|
||||
date = DateUtil.offsetDay(date,1);
|
||||
pcsn_num = BigDecimal.valueOf(0);
|
||||
pcsn_num = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
ext.standard_weight_pft AS standard_weight,
|
||||
materialbase.material_code,
|
||||
deviceinfo.device_code,
|
||||
deviceinfo.device_name,
|
||||
productdeptpcsn.org_id
|
||||
FROM
|
||||
MPS_BD_ProductDailyPlan pp
|
||||
@@ -100,6 +101,7 @@
|
||||
ext.standard_weight_pft AS standard_weight,
|
||||
materialbase.material_code,
|
||||
deviceinfo.device_code,
|
||||
deviceinfo.device_name,
|
||||
classstandard.class_name AS product_series_name,
|
||||
classstandard2.class_name AS mater_product_series_name,
|
||||
productdeptpcsn.org_id
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
输入.begin_time TYPEAS s_string
|
||||
输入.end_time TYPEAS s_string
|
||||
输入.device_id TYPEAS s_string
|
||||
输入.product_series TYPEAS s_string
|
||||
|
||||
|
||||
[临时表]
|
||||
@@ -88,7 +89,7 @@
|
||||
materialbase.material_type_id,
|
||||
ext.product_series,
|
||||
deviceinfo.device_id,
|
||||
deviceinfo.device_code
|
||||
deviceinfo.device_name
|
||||
FROM
|
||||
PCS_IF_ProductPlanProc pp
|
||||
LEFT JOIN MD_ME_ProducMaterialExt ext ON pp.material_id = ext.material_id
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
<el-option
|
||||
v-for="item in Devices"
|
||||
:key="item.id"
|
||||
:label="item.code"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/></el-select>
|
||||
</el-form-item>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<el-option
|
||||
v-for="item in Devices"
|
||||
:key="item.id"
|
||||
:label="item.code"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
@@ -159,7 +159,7 @@
|
||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||
<el-table-column prop="plan_code" label="日计划编码" width="120" />
|
||||
<el-table-column :formatter="seriesFormat" min-width="80" prop="product_series_id" label="系列产线" />
|
||||
<el-table-column prop="device_code" label="关键设备" width="100" />
|
||||
<el-table-column prop="device_name" label="关键设备" width="100" />
|
||||
<el-table-column prop="planstart_date" label="计划开始日期" width="100" />
|
||||
<el-table-column prop="plan_org_name" label="申报单位" width="100" />
|
||||
<el-table-column prop="workorder_type" label="计划类型" :formatter="workorder_typeFormat" min-width="120" />
|
||||
@@ -167,6 +167,7 @@
|
||||
<el-table-column prop="old_mark" label="牌号" />
|
||||
<el-table-column :formatter="seriesFormat" min-width="80" prop="mater_product_series" label="产品系列" />
|
||||
<el-table-column prop="product_weight" label="生产重量(kg)" :formatter="crud.formatNum3" min-width="120" />
|
||||
<el-table-column prop="product_num" label="批数" width="100" />
|
||||
<el-table-column prop="planend_date" label="计划结束日期" width="100" />
|
||||
<el-table-column prop="plan_finish_date" label="交货日期" width="100" />
|
||||
<el-table-column prop="day_num" label="提前天数" width="90" :formatter="crud.formatNum0" />
|
||||
@@ -210,7 +211,7 @@ export default {
|
||||
title: '日计划管理',
|
||||
url: 'api/dailyplan',
|
||||
idField: 'dailyplan_id',
|
||||
sort: 'dailyplan_id',
|
||||
sort: '',
|
||||
query: { device_id: '' },
|
||||
crudMethod: { ...dailyplan },
|
||||
optShow: {
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<el-option
|
||||
v-for="item in Devices"
|
||||
:key="item.id"
|
||||
:label="item.code"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
@@ -156,9 +156,9 @@
|
||||
<el-table-column type="index" label="序号" width="55" align="center" />
|
||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||
<el-table-column prop="plan_month" label="计划月份" />
|
||||
<el-table-column prop="task_code" label="任务号" />
|
||||
<el-table-column prop="task_code" label="任务号" min-width="130"/>
|
||||
<el-table-column prop="plan_org_name" label="申报单位" width="100" />
|
||||
<el-table-column prop="device_code" label="关键设备" width="100" />
|
||||
<el-table-column prop="device_name" label="关键设备" width="100" />
|
||||
<el-table-column prop="plan_finish_date" label="交货日期" width="90" />
|
||||
<el-table-column prop="old_mark" label="牌号" />
|
||||
<el-table-column prop="material_code" label="物料编码" min-width="150"/>
|
||||
|
||||
@@ -106,7 +106,6 @@
|
||||
type="primary"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="save_flag"
|
||||
@click="submit()"
|
||||
>
|
||||
保存
|
||||
@@ -117,7 +116,6 @@
|
||||
type="primary"
|
||||
icon="el-icon-position"
|
||||
size="mini"
|
||||
:disabled="sub_flag"
|
||||
@click="save()"
|
||||
>
|
||||
提交
|
||||
@@ -181,15 +179,17 @@
|
||||
<el-table-column prop="product_weight" label="需求重量" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="fact_weight" label="生产重量" :formatter="crud.formatNum3" width="150" align="center">
|
||||
<template scope="scope">
|
||||
<el-input-number size="mini" v-model="scope.row.fact_weight" :disabled="save_flag" :precision="3" :controls="false" :min="1" style="width: 120px" />
|
||||
<el-input-number size="mini" v-model="scope.row.fact_weight" :precision="3" :controls="false" :min="1" style="width: 120px" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="weight_unit_name" label="单位"/>
|
||||
<el-table-column prop="standard_weight" label="每批重量kg" width="90" :formatter="crud.formatNum3"/>
|
||||
<el-table-column prop="pcsn_num" label="批数" :formatter="pcsn_num_format"/>
|
||||
<el-table-column :formatter="stateFormat" min-width="80" prop="is_proc" label="状态" />
|
||||
<el-table-column prop="update_time" label="提交时间" width="140px" />
|
||||
<el-table-column prop="update_optname" label="提交人" />
|
||||
<el-table-column prop="input_time" label="生成时间" width="140px" />
|
||||
<el-table-column prop="input_optname" label="生成人" />
|
||||
<el-table-column prop="update_time" label="更新时间" width="140px" />
|
||||
<el-table-column prop="update_optname" label="更新人" />
|
||||
<el-table-column prop="remark" label="备注" />
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
@@ -360,7 +360,7 @@ export default {
|
||||
submit() {
|
||||
this.checkrows = this.$refs.table.data
|
||||
if(this.checkrows.length === 0 ){
|
||||
this.crud.notify('无可提交的记录!')
|
||||
this.crud.notify('无可操作的记录!')
|
||||
return false
|
||||
}
|
||||
crudProducetask.submit({'status': '0', rows: this.checkrows}).then(res => {
|
||||
|
||||
@@ -232,7 +232,7 @@
|
||||
<el-table-column prop="planend_time" min-width="140" label="计划结束时间"/>
|
||||
<el-table-column prop="realstart_time" min-width="140" label="实际开始时间"/>
|
||||
<el-table-column prop="realend_time" min-width="140" label="实际结束时间"/>
|
||||
<el-table-column min-width="100" prop="source_bill_type" label="源类型" />
|
||||
<el-table-column min-width="100" prop="source_bill_type" :formatter="workorder_typeFormat2" label="源类型" />
|
||||
<el-table-column prop="source_bill_code" label="来源单据编号" min-width="100" />
|
||||
<el-table-column min-width="90" prop="workprocedure_id" label="当前工序" :formatter="seriesFormat2" />
|
||||
<el-table-column prop="startwork_name" min-width="80" label="开工人"/>
|
||||
@@ -280,7 +280,7 @@ export default {
|
||||
},
|
||||
mixins: [presenter(), header(), crud()],
|
||||
// 数据字典
|
||||
dicts: ['workorder_status', 'workorder_type', 'product_series'],
|
||||
dicts: ['workorder_status', 'workorder_type', 'product_series', 'workorder_type2'],
|
||||
data() {
|
||||
return {
|
||||
height: document.documentElement.clientHeight - 180 + 'px;',
|
||||
@@ -338,6 +338,9 @@ export default {
|
||||
mySelectionChange(rows) {
|
||||
this.buttonChange(rows)
|
||||
},
|
||||
workorder_typeFormat2(row) {
|
||||
return this.dict.label.workorder_type2[row.workorder_type]
|
||||
},
|
||||
buttonChange(rows) {
|
||||
if (rows.length !== 0) {
|
||||
this.sub_flag = false
|
||||
|
||||
Reference in New Issue
Block a user