生产计划管理优化 1.19

zhc4dev
zhc077 2 years ago
parent 0ad37f7090
commit 39c8513297
  1. 30
      ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue
  2. 21
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessAccessoriesDataList.vue
  3. 21
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessFabricDataList.vue
  4. 54
      ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue
  5. 14
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanProcessAccessoriesForm.vue
  6. 16
      ant-design-vue-jeecg/src/views/productplan/modules/ZyPlanProcessFabricForm.vue
  7. 71
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java

@ -1,5 +1,6 @@
<template>
<a-card :bordered="false">
<p style="font-size: 30px;color:#333; padding-left: 30% ">{{ planInfo.productCode }}工单生产计划管理</p>
<template>
<div>
<el-descriptions border :column='4'>
@ -47,13 +48,15 @@
>
<template v-slot:toolbarSuffix>
<a-button type="primary" icon="plus-circle" @click="syncProductProcess()">读取工序</a-button>
<!-- <a-button type="primary" icon="plus-circle" @click="syncProductProcess()">生成物料单(计划面料&计划辅料)</a-button>-->
<!-- <a-button type="primary" icon="plus-circle" @click="syncProductProcess()">自动排位(计划面料&计划辅料)</a-button>-->
<a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>
<a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>
</template>
<template v-slot:action="props">
<a @click="jump2MianLiao('mianLiao',props)">面料</a>
<a @click="jump2MianLiao(props)">面料</a>
<a-divider type="vertical"/>
<a @click="jump2FuLiao('fuLiao',props)">辅料</a>
<a @click="jump2FuLiao(props)">辅料</a>
<a-divider type="vertical"/>
<a @click="detail(props)">详情</a>
</template>
@ -192,20 +195,26 @@ export default {
this.getPlanInfo(this.planId);
},
methods: {
jump2MianLiao(key,props){
console.log("mianLiao() ----key:",key)
jump2MianLiao(props){
console.log("mianLiao() ----props:",props)
this.$router.push({
path: '/productplan/ZyPlanProcessFabricList',
// query: { //
// 'planProcessId': record.id,
// },
path: '/productplan/ZyPlanProcessFabricDataList',
query: { //
'planId': props.row.planId,
'planProcessId': props.row.processId,
},
});
},
jump2FuLiao(key,props){
console.log("fuLiao() ----key:",key)
jump2FuLiao(props){
console.log("fuLiao() ----props:",props)
this.$router.push({
path: '/productplan/ZyPlanProcessAccessoriesDataList',
query: { //
'planId': props.row.planId,
'planProcessId': props.row.processId,
},
});
},
detail(props){
alert("稍等,正在开发中。。。")
@ -257,6 +266,7 @@ export default {
//
syncProductProcess() {
this.loading = true;
getAction(this.url.syncProductProcess, {"planId": this.planId}).then((res) => {
if (res.success) {
this.$message.success("操作成功");

@ -9,7 +9,7 @@
</div>
<!-- 查询区域-END -->
<div class="table-operator">
<a-button @click="zyStyleFabricHandleAdd(planProcessId)" type="primary" icon="plus">新增</a-button>
<!-- <a-button @click="zyStyleFabricHandleAdd(planProcessId)" type="primary" icon="plus">新增</a-button>-->
<a-button type="primary" icon="download" @click="handleExportXls('计划面料')">导出</a-button>
<a-button type="primary" @click="fanHui()">返回</a-button>
</div>
@ -33,10 +33,10 @@
<a @click="handleEdit(record)">编辑</a>
<!-- <a-divider type="vertical"/>-->
<!-- <a @click="handleDetail(record)">详情</a>-->
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<!-- <a-divider type="vertical"/>-->
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
</span>
</a-table>
</div>
@ -76,7 +76,7 @@
}
},
{
title: '计划工序ID',
title: '计划工序编号',
align: "center",
dataIndex: 'planProcessId',
},
@ -111,6 +111,7 @@
superFieldList:[],
loadRouteType: false,
planProcessId: '',
planId: '',
}
},
created() {
@ -124,8 +125,12 @@
methods: {
fanHui(record) {
this.$router.push({
path: '/productplan/ZyPlanProcessAccessoriesList',
path: '/productplan/ProductplanManage',
query: { //
'planId': this.planId,
},
});
},
valueChange(value) {
if (value) this.loadData()
@ -134,7 +139,9 @@
loadParameter() {
if (this.loadRouteType === false) {
this.planProcessId = this.$route.query.planProcessId;
this.planId = this.$route.query.planId;
// this.biaoTi = this.$route.query.styleNames+"";
console.log("*******传递的planId:" + this.planId)
console.log("*******传递的planProcessId:" + this.planProcessId)
this.loadRouteType = true;
}

@ -9,7 +9,7 @@
</div>
<!-- 查询区域-END -->
<div class="table-operator">
<a-button @click="zyStyleFabricHandleAdd(planProcessId)" type="primary" icon="plus">新增</a-button>
<!-- <a-button @click="zyStyleFabricHandleAdd(planProcessId)" type="primary" icon="plus">新增</a-button>-->
<a-button type="primary" icon="download" @click="handleExportXls('计划面料')">导出</a-button>
<a-button type="primary" @click="fanHui()">返回</a-button>
</div>
@ -33,10 +33,10 @@
<a @click="handleEdit(record)">编辑</a>
<!-- <a-divider type="vertical"/>-->
<!-- <a @click="handleDetail(record)">详情</a>-->
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<!-- <a-divider type="vertical"/>-->
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
</span>
</a-table>
</div>
@ -82,7 +82,7 @@ export default {
// dataIndex: 'planId'
// },
{
title: '计划工序ID',
title: '计划工序编号',
align: "center",
dataIndex: 'planProcessId',
},
@ -117,6 +117,7 @@ export default {
superFieldList: [],
loadRouteType: false,
planProcessId: '',
planId: '',
}
},
created() {
@ -130,7 +131,11 @@ export default {
methods: {
fanHui(record) {
this.$router.push({
path: '/productplan/ZyPlanProcessFabricList',
// path: '/productplan/ZyPlanProcessFabricList',
path: '/productplan/ProductplanManage',
query: { //
'planId': this.planId,
},
});
},
valueChange(value) {
@ -140,7 +145,9 @@ export default {
loadParameter() {
if (this.loadRouteType === false) {
this.planProcessId = this.$route.query.planProcessId;
this.planId = this.$route.query.planId;
// this.biaoTi = this.$route.query.styleNames+"";
console.log("*******传递的planId:" + this.planId)
console.log("*******传递的planProcessId:" + this.planProcessId)
this.loadRouteType = true;
}

@ -313,69 +313,17 @@ export default {
getPaiWeiTu(record) {
// alert(JSON.stringify(record));
alert("请稍等,正在开发中。。。")
getAction(this.url.paiweitu, record).then((res) => {
if (res.success) {
// this.dataSource = res.result.records || res.result;
console.log("the paiweitu----------" + JSON.stringify(res.result))
} else {
this.$message.warning(res.message)
}
}).finally(() => {
// this.dataSource.forEach(item => {
// item['stationName'] = this.stationName;
// item['stationNum'] = this.stationNum;
// })
this.loading = false
})
},
// loadData(arg) {
// if (!this.url.list) {
// this.$message.error("url.list!")
// return
// }
// // 1
// if (arg === 1) {
// this.ipagination.current = 1;
// }
// this.loadParameter();
// var params = this.getQueryParams();//
// this.loading = true;
// console.log("----------------the params:", params);
// getAction(this.url.list, params).then((res) => {
// if (res.success) {
// this.dataSource = res.result.records || res.result;
// if (res.result.total) {
// this.ipagination.total = res.result.total;
// } else {
// this.ipagination.total = 0;
// }
// } else {
// this.$message.warning(res.message)
// }
// }).finally(() => {
// // this.dataSource.forEach(item => {
// // item['stationName'] = this.stationName;
// // item['stationNum'] = this.stationNum;
// // })
// this.loading = false
// })
// },
// getQueryParams() {
// //
// let sqp = {}
// if (this.superQueryParams) {
// sqp['superQueryParams'] = encodeURI(this.superQueryParams)
// sqp['superQueryMatchType'] = this.superQueryMatchType
// }
// var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
// param.field = this.getQueryField();
// param.pageNo = this.ipagination.current;
// param.pageSize = this.ipagination.pageSize;
// param.planId = this.planId;
// return filterObj(param);
// },
}
}
</script>

@ -3,12 +3,12 @@
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="辅料id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="accessoriesId">
<j-dict-select-tag type="list" v-model="model.accessoriesId" dictCode="zy_accessories,contents,id"
placeholder="请选择辅料"/>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="辅料id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="accessoriesId">-->
<!-- <j-dict-select-tag type="list" v-model="model.accessoriesId" dictCode="zy_accessories,contents,id"-->
<!-- placeholder="请选择辅料"/>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="用量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="amount">
<a-input-number v-model="model.amount" placeholder="请输入用量" style="width: 100%" />
@ -57,7 +57,7 @@
],
amount: [
{required: true, message: "用量不能不空"},
{pattern: /^[0-9]{0,1000}$/, message: '用量不能为空且长度为正数'}
{pattern: /^[0-9]{0,1000}$/, message: '用量不能为空且长度为正数'}
],
},
url: {

@ -3,13 +3,13 @@
<j-form-container :disabled="formDisabled">
<a-form-model ref="form" :model="model" :rules="validatorRules" slot="detail">
<a-row>
<a-col :span="24">
<a-form-model-item label="面料id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fabricId">
<!-- <j-multi-select-tag type="list_multi" v-model="model.fabricId" dictCode="zy_fabric,name,id"-->
<!-- placeholder="请选择面料"/>-->
<j-dict-select-tag type="list" v-model="model.fabricId" dictCode="zy_fabric,name,id" placeholder="请选择面料"/>
</a-form-model-item>
</a-col>
<!-- <a-col :span="24">-->
<!-- <a-form-model-item label="面料id" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="fabricId">-->
<!--&lt;!&ndash; <j-multi-select-tag type="list_multi" v-model="model.fabricId" dictCode="zy_fabric,name,id"&ndash;&gt;-->
<!--&lt;!&ndash; placeholder="请选择面料"/>&ndash;&gt;-->
<!-- <j-dict-select-tag type="list" v-model="model.fabricId" dictCode="zy_fabric,name,id" placeholder="请选择面料"/>-->
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<a-col :span="24">
<a-form-model-item label="用量" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="amount">
<a-input-number v-model="model.amount" placeholder="请输入用量" style="width: 100%"/>
@ -57,7 +57,7 @@ export default {
],
amount: [
{required: true, message: "用量不能不空"},
{pattern: /^[0-9]{0,1000}$/, message: '用量不能为空且长度为正数'}
{pattern: /^[0-9]{0,1000}$/, message: '用量不能为空且长度为正数'}
],
},
url: {

@ -61,6 +61,7 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -170,6 +171,11 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
@Override
@Transactional(readOnly = false, rollbackFor = Exception.class)
public List<ZyPlanProcess> syncProductBaseProcess(ZyPlanProcess zyPlanProcess) {
//重新同步数据,先删除之前已同步数据
this.delSyncData(zyPlanProcess);
int count = this.count(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId()));
//生产计划工序表没有对应工序时,说明没有制定过该产品的生产工序计划,先把该产品对应的基本工序数据插入到生产计划工序表
if (count == 0) {
@ -187,17 +193,16 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
//产品基本工序
List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>()
.eq(ZyProductProcess::getProductId, zyProduct.getId()));
if (!ObjectUtils.isEmpty(productProcessesList)) {
List<ZyPlanProcess> saveList = new LinkedList<>();
productProcessesList.forEach(o -> {
ZyPlanProcess en = new ZyPlanProcess();
en.setProcessId(o.getProcessId());
ZyProcess zyProcess = iZyProcessService.getById(o.getProcessId());
en.setProcessName(zyProcess.getProcessName());
en.setProcessName(StringUtils.isNotBlank(zyProcess.getProcessName()) ? zyProcess.getProcessName() : "");
en.setPlanId(zyPlanProcess.getPlanId());
en.setTotalMachine(zyProcess.getTotalMachine());
en.setTotalMaunal(zyProcess.getTotalMaunal());
en.setTotalMachine(!ObjectUtils.isEmpty(zyProcess.getTotalMachine()) ? zyProcess.getTotalMachine() : 0);
en.setTotalMaunal(!ObjectUtils.isEmpty(zyProcess.getTotalMaunal()) ? zyProcess.getTotalMaunal() : 0);
saveList.add(en);
});
this.saveBatch(saveList);
@ -246,6 +251,18 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
return null;
}
@Transactional(readOnly = false, rollbackFor = Exception.class)
public void delSyncData(ZyPlanProcess zyPlanProcess) {
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId()));
if (!ObjectUtils.isEmpty(planProcessList)) {
List<String> collect = Optional.ofNullable(planProcessList).orElse(new ArrayList<>()).stream().map(ZyPlanProcess::getProcessId).collect(Collectors.toList());
iZyPlanProcessFabricService.remove(new LambdaQueryWrapper<ZyPlanProcessFabric>().in(ZyPlanProcessFabric::getPlanProcessId, collect));
iZyPlanProcessAccessoriesService.remove(new LambdaQueryWrapper<ZyPlanProcessAccessories>().in(ZyPlanProcessAccessories::getPlanProcessId, collect));
this.remove(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId()));
}
}
void saveBatchAccessoriesByProcessIdList(List<ZyPlanProcess> planProcessList) {
Optional.ofNullable(planProcessList).orElse(new ArrayList<>()).forEach(e -> {
List<ZyProcessAccessories> accessoriesList = this.iZyProcessAccessoriesService.list(new LambdaQueryWrapper<ZyProcessAccessories>()
@ -265,21 +282,39 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
}
void saveBatchFabricByProcessIdList(List<ZyPlanProcess> planProcessList) {
Optional.ofNullable(planProcessList).orElse(new ArrayList<>()).forEach(e -> {
List<ZyProcessFabric> fabricList = this.iZyProcessFabricService.list(new LambdaQueryWrapper<ZyProcessFabric>()
.eq(ZyProcessFabric::getProcessId, e.getProcessId()));
List<ZyPlanProcessFabric> list = new LinkedList<>();
Optional.ofNullable(fabricList).orElse(new ArrayList<>()).forEach(obj -> {
ZyPlanProcessFabric en = new ZyPlanProcessFabric();
en.setPlanProcessId(e.getProcessId());
en.setPlanId(e.getPlanId());
en.setFabricId(obj.getFabricId());
ZyFabric zyFabric = iZyFabricService.getById(obj.getFabricId());
en.setFabricName(StringUtils.isNotBlank(zyFabric.getName()) ? zyFabric.getName() : "");
list.add(en);
if (!org.springframework.util.StringUtils.isEmpty(planProcessList)) {
planProcessList.forEach(e -> {
List<ZyProcessFabric> fabricList = this.iZyProcessFabricService.list(new LambdaQueryWrapper<ZyProcessFabric>()
.eq(ZyProcessFabric::getProcessId, e.getProcessId()));
List<ZyPlanProcessFabric> list = new LinkedList<>();
if (!org.springframework.util.StringUtils.isEmpty(fabricList)) {
fabricList.forEach(obj -> {
ZyPlanProcessFabric en = new ZyPlanProcessFabric();
en.setPlanProcessId(e.getProcessId());
en.setPlanId(e.getPlanId());
en.setFabricId(obj.getFabricId());
ZyFabric zyFabric = iZyFabricService.getById(obj.getFabricId());
en.setFabricName(StringUtils.isNotBlank(zyFabric.getName()) ? zyFabric.getName() : "");
list.add(en);
});
iZyPlanProcessFabricService.saveBatch(list);
}
});
iZyPlanProcessFabricService.saveBatch(list);
});
}
// Optional.ofNullable(planProcessList).orElse(null).forEach(e -> {
// Optional.ofNullable(fabricList).orElse(null).forEach(obj -> {
// ZyPlanProcessFabric en = new ZyPlanProcessFabric();
// en.setPlanProcessId(e.getProcessId());
// en.setPlanId(e.getPlanId());
// en.setFabricId(obj.getFabricId());
// ZyFabric zyFabric = iZyFabricService.getById(obj.getFabricId());
// en.setFabricName(StringUtils.isNotBlank(zyFabric.getName()) ? zyFabric.getName() : "");
// list.add(en);
// });
// iZyPlanProcessFabricService.saveBatch(list);
// });
}

Loading…
Cancel
Save