计划工序管理-生成物料单、自动排位 1.30

zhc4dev
zhc077 2 years ago
parent cb125e41e2
commit 7df5c8cfec
  1. 1
      ant-design-vue-jeecg/src/mixins/JeecgListMixin.js
  2. 21
      ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue
  3. 291
      ant-design-vue-jeecg/src/views/productplan/ZyPlanWuLiaoDataDetail.vue
  4. 38
      ant-design-vue-jeecg/src/views/zyclothsstyle/modules/ZyClothsStyleListDetail.vue
  5. 8
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java
  6. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanAccessories.java
  7. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanFabric.java
  8. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java
  9. 42
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java

@ -374,6 +374,7 @@ export const JeecgListMixin = {
if(!fileName || typeof fileName != "string"){ if(!fileName || typeof fileName != "string"){
fileName = "导出文件" fileName = "导出文件"
} }
debugger;
let param = this.getQueryParams(); let param = this.getQueryParams();
if(this.selectedRowKeys && this.selectedRowKeys.length>0){ if(this.selectedRowKeys && this.selectedRowKeys.length>0){
param['selections'] = this.selectedRowKeys.join(",") param['selections'] = this.selectedRowKeys.join(",")

@ -51,9 +51,9 @@
<a-button type="primary" icon="plus-circle" @click="autoFilling()">自动排位</a-button> <a-button type="primary" icon="plus-circle" @click="autoFilling()">自动排位</a-button>
<a-button type="primary" icon="plus-circle" @click="createMaterialBill()">生成物料单 <a-button type="primary" icon="plus-circle" @click="createMaterialBill()">生成物料单
</a-button> </a-button>
<a-button type="primary" icon="unordered-list" @click="viewMaterialBill()">查看物料单(计划面料&计划辅料) <a-button type="primary" icon="unordered-list" @click="viewMaterialBill()">查看物料单
</a-button> </a-button>
<a-button type="primary" icon="unordered-list" @click="viewMaterialBill()">发送到仓库 <a-button type="primary" icon="unordered-list" @click="sendToRepository()">发送到仓库
</a-button> </a-button>
<a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button> <a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>
<a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button> <a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>
@ -351,9 +351,20 @@ export default {
}, },
// //
viewMaterialBill(props) { viewMaterialBill() {
// alert("deatil row id:"+props.row.id); // alert("deatil this.planId:"+this.planId);
this.$refs.zyPlanProcessDataDetail.showModal(props.row.id) // this.$refs.zyPlanProcessDataDetail.showModal(this.planId)
this.$router.push({
path: '/productplan/ZyPlanWuLiaoDataDetail',
query: { //
'planId': this.planId,
},
});
},
//
sendToRepository(){
}, },
// //

@ -0,0 +1,291 @@
<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'>
<el-descriptions-item label="工单编号 ">{{ planInfo.productCode }}</el-descriptions-item>
<el-descriptions-item label="生产企业">{{ planInfo.productOrg }}</el-descriptions-item>
<!-- <el-descriptions-item label="企业负责人 ">admin</el-descriptions-item>-->
<el-descriptions-item label="车间 ">{{ planInfo.workshop }}</el-descriptions-item>
<!-- <el-descriptions-item label="车间负责人 ">admin</el-descriptions-item>-->
<el-descriptions-item label="班组">{{ planInfo.team }}</el-descriptions-item>
<el-descriptions-item label="班组长">{{ planInfo.teamLade }}</el-descriptions-item>
<!-- <el-descriptions-item label="产品类型">{{ planInfo.productType }}</el-descriptions-item>-->
<!-- <el-descriptions-item label="产品编号">{{ planInfo.productNo }}</el-descriptions-item>-->
<!-- <el-descriptions-item label="产品名称">{{ planInfo.productName }}</el-descriptions-item>-->
<el-descriptions-item label="开始时间">{{ planInfo.workTime }}</el-descriptions-item>
<el-descriptions-item label="生产时长(天)">{{ planInfo.duration }}</el-descriptions-item>
<el-descriptions-item label="生产状态">{{ planInfo.status }}</el-descriptions-item>
<el-descriptions-item label="加急">{{ planInfo.speedUp }}</el-descriptions-item>
<!-- <el-descriptions-item label="销售企业">{{ planInfo.salesEnterprise }}</el-descriptions-item>-->
<!-- <el-descriptions-item label="订货期">{{ planInfo.orderTime }}</el-descriptions-item>-->
<!-- <el-descriptions-item label="制定人">100</el-descriptions-item>-->
<!-- <el-descriptions-item label="制定时间">100</el-descriptions-item>-->
<el-descriptions-item label="审核人">{{ planInfo.auditBy }}</el-descriptions-item>
<el-descriptions-item label="审核时间">{{ planInfo.auditTimr }}</el-descriptions-item>
</el-descriptions>
</div>
</template>
<!-- 查询区域-END -->
<div class="table-operator">
<a-button type="primary" icon="download" @click="handleExportXls('计划面料')">导出</a-button>
<a-button type="primary" @click="fanHui()">返回</a-button>
</div>
<!-- table区域-begin -->
<div>
<a-spin :spinning="confirmLoading">
<h3 style="width: 98%;;margin:20px auto 0">计划面料清单</h3>
<a-table style="width: 98%;font-size:14px;margin:10px auto" :columns="columns1" :data-source="data1" bordered
rowKey="nums" :pagination="false">
</a-table>
<h3 style="width: 98%;;margin:20px auto 0">计划辅料清单</h3>
<a-table style="width: 98%;font-size:14px;margin:10px auto 0" :columns="columns2" :data-source="data2"
rowKey="id"
bordered :pagination="false">
</a-table>
<h3 style="width: 98%;;margin:20px auto 0">工序面料清单</h3>
<a-table style="width: 98%;font-size:14px;margin:10px auto 0" :columns="columns3" :data-source="data3"
rowKey="id" bordered :pagination="false">
</a-table>
<h3 style="width: 98%;;margin:20px auto 0">工序辅料清单</h3>
<a-table style="width: 98%;font-size:14px;margin:10px auto 0" :columns="columns4" :data-source="data4"
rowKey="id" bordered :pagination="false">
</a-table>
</a-spin>
<!-- </a-modal>-->
</div>
</a-card>
</template>
<script>
import {getAction} from "@api/manage";
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {filterObj} from "@/utils/util";
const columns1 = [
{
title: '计划ID',
align: "center",
dataIndex: 'planId'
},
{
title: '面料',
align: "center",
dataIndex: 'fabricName'
},
{
title: '用量(合计)',
align: "center",
dataIndex: 'amount'
},
];
const columns2 = [
{
title: '计划ID',
align: "center",
dataIndex: 'planId'
},
{
title: '辅料',
align: "center",
dataIndex: 'accessoriesName'
},
{
title: '用量(合计)',
align: "center",
dataIndex: 'amount'
},
];
const columns3 = [
// {
// title:'ID',
// align:"center",
// dataIndex: 'planId'
// },
{
title: '计划工序ID',
align: "center",
dataIndex: 'planProcessId'
},
{
title: '面料',
align: "center",
dataIndex: 'fabricName'
},
{
title: '用量',
align: "center",
dataIndex: 'amount'
},
];
const columns4 = [
// {
// title: 'ID',
// align: "center",
// dataIndex: 'planId'
// },
{
title: '计划工序ID',
align: "center",
dataIndex: 'planProcessId'
},
{
title: '辅料',
align: "center",
dataIndex: 'accessoriesName'
},
{
title: '用量',
align: "center",
dataIndex: 'amount'
},
];
export default {
name: "ZyStyleModelListDetails",
mixins: [JeecgListMixin, mixinDevice],
data() {
return {
data: [],
visible: false,
model: {},
confirmLoading: true,
//
data1: [],
columns1,
//
data2: [],
columns2,
//
data3: [],
columns3,
//
columns4,
data4: [],
planInfo: {},
wuLiaoInfo: {},
id: '',
planId: '',
loadRouteType: false,
url: {
list: "/org.jeecg.modules.productplan/zyPlanProcess/list",
getPlanInfo: "/org.jeecg.modules.productplan/zyPlanProcess/getPlanInfo",
getWuLiaoDetail: "/org.jeecg.modules.productplan/zyPlanProcess/getWuLiaoDetail",
exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanProcess/exportXls",
},
}
},
created() {
this.confirmLoading = false;
this.visible = true;
this.loadParameter();
this.getPlanInfo(this.planId);
this.getWuLiaoDetail(this.planId);
},
methods: {
fanHui(record) {
this.$router.push({
path: '/productplan/ProductplanManage',
query: { //
'planId': this.planId,
},
});
},
getQueryParams(){
var param = Object.assign({}, this.queryParam);
// delete param.createTimeRange; //
return filterObj(param);
},
getWuLiaoDetail(planId) {
getAction(this.url.getWuLiaoDetail, {"planId": planId}).then((res) => {
if (res.success) {
this.wuLiaoInfo = res.result.records || res.result;
// console.log("wuLiaoInfo------------:" + JSON.stringify(this.wuLiaoInfo));
this.data1 = this.wuLiaoInfo.fabricList
this.data2 = this.wuLiaoInfo.accessoriesList
this.data3 = this.wuLiaoInfo.processFabricList
this.data4 = this.wuLiaoInfo.processAccessoriesList
// console.log("data1------------:" + JSON.stringify(this.data1));
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
getPlanInfo(planId) {
getAction(this.url.getPlanInfo, {"planId": planId}).then((res) => {
if (res.success) {
this.planInfo = res.result.records || res.result;
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
//
loadParameter() {
if (this.loadRouteType === false) {
this.planId = this.$route.query.planId;
console.log("*******传递的planId:" + this.planId)
this.loadRouteType = true;
}
},
// showModal(id) {
// this.visible = true;
// this.id = id
// this.getDetailData()
// },
// getDetailData() {
// getAction(this.url.detail, {id: this.id}).then((res) => {
// if (res.success) {
// this.data = res.result.records || res.result.records;
// console.log("data------------:" + JSON.stringify(this.data));
// } else {
// this.$message.warning(res.message)
// }
// }).finally(() => {
// this.confirmLoading = false
// })
// },
handleOk(e) {
this.confirmLoading = true;
setTimeout(() => {
this.visible = false;
this.confirmLoading = false;
}, 1);
},
handleCancel(e) {
this.visible = false;
},
},
}
</script>
<style scoped>
.table {
border-color: #d9d9d9;
border-radius: 3px
}
.table td {
padding: 10px 20px;
max-width: 380px;
}
.table td span {
color: #333
}
</style>

@ -8,44 +8,6 @@
:width='1000' :width='1000'
@ok="handleOk" @ok="handleOk"
@cancel="handleCancel"> @cancel="handleCancel">
<!-- <table border="1" style="width: 98%;font-size:14px;margin:30px auto 0" class="table">-->
<!-- <tr>-->
<!-- <td><span>款式名称</span>tttt</td>-->
<!-- <td><span>款式编号</span>QIYE80301100000130</td>-->
<!-- <td><span>款式规格</span>123</td>-->
<!-- <td><span>款式形式</span>预制</td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><span>企业</span>黄淮服装智能制造中心</td>-->
<!-- <td><span>款式创建时间</span>2022-12-06 10:02:59</td>-->
<!-- &lt;!&ndash; 模块&ndash;&gt;-->
<!-- <td><span>服装类型</span>tttt</td>-->
<!-- <td><span>模块编号</span>QIYE80301100000130</td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><span>模块名称</span>2</td>-->
<!-- <td><span>模块创建时间</span>2022-12-06 10:02:59</td>-->
<!-- &lt;!&ndash; 面料&ndash;&gt;-->
<!-- <td><span>面料编号</span>2</td>-->
<!-- <td><span>面料名称</span>2A01</td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><span>面料创建时间</span>2022-12-06 10:02:59</td>-->
<!-- &lt;!&ndash; 辅料&ndash;&gt;-->
<!-- <td><span>辅料名称</span>2A01</td>-->
<!-- <td><span>辅料创建时间</span>2022-12-06 10:02:59</td>-->
<!-- &lt;!&ndash; 工序&ndash;&gt;-->
<!-- <td><span>工序名称</span>2A01</td>-->
<!-- </tr>-->
<!-- <tr>-->
<!-- <td><span>工序创建时间</span>2022-12-06 10:02:59</td>-->
<!-- <td><span>面料编号</span>2</td>-->
<!-- <td><span>面料名称</span>2A01</td>-->
<!-- <td><span>面料名称</span>2A01</td>-->
<!-- </tr>-->
<!-- </table>-->
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<h3 style="width: 98%;;margin:0px auto">款式详情</h3> <h3 style="width: 98%;;margin:0px auto">款式详情</h3>
<a-table style="width: 98%;font-size:14px;margin:10px auto" :columns="columns1" :data-source="data1" bordered <a-table style="width: 98%;font-size:14px;margin:10px auto" :columns="columns1" :data-source="data1" bordered

@ -100,6 +100,14 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
return Result.OK(map); return Result.OK(map);
} }
@ApiOperation(value = "查看物料清单", notes = "查看物料清单")
@GetMapping(value = "/getWuLiaoDetail")
public Result<?> getWuLiaoDetail(ZyPlanProcess zyPlanProcess,
HttpServletRequest req) {
Map<String, Object> map = zyPlanProcessService.getWuLiaoDetail(zyPlanProcess);
return Result.OK(map);
}
@ApiOperation(value = "读取工序", notes = "读取工序") @ApiOperation(value = "读取工序", notes = "读取工序")
@GetMapping(value = "/syncProductProcess") @GetMapping(value = "/syncProductProcess")
public Result<?> syncProductProcess(ZyPlanProcess zyPlanProcess, public Result<?> syncProductProcess(ZyPlanProcess zyPlanProcess,

@ -75,6 +75,11 @@ public class ZyPlanAccessories implements Serializable {
@ApiModelProperty(value = "辅料id") @ApiModelProperty(value = "辅料id")
@Dict(dictTable = "zy_accessories", dicText = "contents", dicCode = "id") @Dict(dictTable = "zy_accessories", dicText = "contents", dicCode = "id")
private String accessoriesId; private String accessoriesId;
@Excel(name = "辅料名称", width = 15)
@ApiModelProperty(value = "辅料名称")
private String accessoriesName;
/** /**
* 用量合计 * 用量合计
*/ */

@ -76,6 +76,10 @@ public class ZyPlanFabric implements Serializable {
@ApiModelProperty(value = "面料id") @ApiModelProperty(value = "面料id")
@Dict(dictTable = "zy_fabric", dicText = "name", dicCode = "id") @Dict(dictTable = "zy_fabric", dicText = "name", dicCode = "id")
private String fabricId; private String fabricId;
@Excel(name = "面料名称", width = 15)
@ApiModelProperty(value = "面料名称")
private String fabricName;
/** /**
* 用量合计 * 用量合计
*/ */

@ -27,4 +27,5 @@ public interface IZyPlanProcessService extends IService<ZyPlanProcess> {
void createMaterialBill(ZyPlanProcess zyPlanProcess); void createMaterialBill(ZyPlanProcess zyPlanProcess);
Map<String, Object> getWuLiaoDetail(ZyPlanProcess zyPlanProcess);
} }

@ -239,7 +239,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
this.delBillData(zyPlanProcess); this.delBillData(zyPlanProcess);
List<String> idList = planProcessList.stream().map(ZyPlanProcess::getId).collect(Collectors.toList()); List<String> idList = planProcessList.stream().map(ZyPlanProcess::getId).collect(Collectors.toList());
QueryWrapper qw = new QueryWrapper(); QueryWrapper qw = new QueryWrapper();
qw.select("fabric_id", "sum(amount) as count"); qw.select("fabric_id", "fabric_name", "sum(amount) as count");
qw.in("plan_process_id", idList); qw.in("plan_process_id", idList);
qw.groupBy("fabric_id"); qw.groupBy("fabric_id");
List<Map<String, Object>> maplist = zyPlanProcessFabricMapper.selectMaps(qw); List<Map<String, Object>> maplist = zyPlanProcessFabricMapper.selectMaps(qw);
@ -248,13 +248,14 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
ZyPlanFabric zyPlanFabric = new ZyPlanFabric(); ZyPlanFabric zyPlanFabric = new ZyPlanFabric();
zyPlanFabric.setPlanId(zyPlanProcess.getPlanId()); zyPlanFabric.setPlanId(zyPlanProcess.getPlanId());
zyPlanFabric.setFabricId(mp.get("fabric_id").toString()); zyPlanFabric.setFabricId(mp.get("fabric_id").toString());
zyPlanFabric.setFabricName(mp.get("fabric_name").toString());
zyPlanFabric.setAmount(new BigDecimal(mp.get("count").toString())); zyPlanFabric.setAmount(new BigDecimal(mp.get("count").toString()));
zyPlanFabricList.add(zyPlanFabric); zyPlanFabricList.add(zyPlanFabric);
} }
iZyPlanFabricService.saveBatch(zyPlanFabricList); iZyPlanFabricService.saveBatch(zyPlanFabricList);
QueryWrapper qw2 = new QueryWrapper(); QueryWrapper qw2 = new QueryWrapper();
qw2.select("accessories_id", "sum(amount) as count"); qw2.select("accessories_id", "accessories_name", "sum(amount) as count");
qw2.in("plan_process_id", idList); qw2.in("plan_process_id", idList);
qw2.groupBy("accessories_id"); qw2.groupBy("accessories_id");
List<Map<String, Object>> maplist2 = zyPlanProcessAccessoriesMapper.selectMaps(qw2); List<Map<String, Object>> maplist2 = zyPlanProcessAccessoriesMapper.selectMaps(qw2);
@ -263,6 +264,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
ZyPlanAccessories zyPlanAccessories = new ZyPlanAccessories(); ZyPlanAccessories zyPlanAccessories = new ZyPlanAccessories();
zyPlanAccessories.setPlanId(zyPlanProcess.getPlanId()); zyPlanAccessories.setPlanId(zyPlanProcess.getPlanId());
zyPlanAccessories.setAccessoriesId(mp.get("accessories_id").toString()); zyPlanAccessories.setAccessoriesId(mp.get("accessories_id").toString());
zyPlanAccessories.setAccessoriesName(mp.get("accessories_name").toString());
zyPlanAccessories.setAmount(new BigDecimal(mp.get("count").toString())); zyPlanAccessories.setAmount(new BigDecimal(mp.get("count").toString()));
zyPlanAccessoriesList.add(zyPlanAccessories); zyPlanAccessoriesList.add(zyPlanAccessories);
} }
@ -270,6 +272,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
} }
void diffMachine(ZyPlanProcess zyPlanProcess, List<Station> stationList, List<ZyProcessMachine> machineList) { void diffMachine(ZyPlanProcess zyPlanProcess, List<Station> stationList, List<ZyProcessMachine> machineList) {
if (!ObjectUtils.isEmpty(machineList)) { if (!ObjectUtils.isEmpty(machineList)) {
List<String> machineList1 = machineList.stream().map(ZyProcessMachine::getMachineId).collect(Collectors.toList()); List<String> machineList1 = machineList.stream().map(ZyProcessMachine::getMachineId).collect(Collectors.toList());
@ -505,12 +508,45 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
return result; return result;
} }
@Override
public Map<String, Object> getWuLiaoDetail(ZyPlanProcess zyPlanProcess) {
String planId = zyPlanProcess.getPlanId();
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId);
if (ObjectUtils.isEmpty(zyProductPlan)) {
throw new JeecgBootException("生产计划不存在!");
}
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>()
.eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId()));
List<String> ids = Optional.ofNullable(planProcessList).orElse(new LinkedList<>())
.stream().map(ZyPlanProcess::getId).collect(Collectors.toList());
Map<String, Object> result = new HashMap<>();
List<ZyPlanFabric> fabricList = iZyPlanFabricService.list(new LambdaQueryWrapper<ZyPlanFabric>()
.eq(ZyPlanFabric::getPlanId, zyPlanProcess.getPlanId()));
result.put("fabricList", fabricList);
List<ZyPlanAccessories> accessoriesList = iZyPlanAccessoriesService.list(new LambdaQueryWrapper<ZyPlanAccessories>()
.eq(ZyPlanAccessories::getPlanId, zyPlanProcess.getPlanId()));
result.put("accessoriesList", accessoriesList);
List<ZyPlanProcessFabric> processFabricList = iZyPlanProcessFabricService.list(new LambdaQueryWrapper<ZyPlanProcessFabric>()
.in(ZyPlanProcessFabric::getPlanProcessId, ids));
result.put("processFabricList", processFabricList);
List<ZyPlanProcessAccessories> processAccessoriesList = iZyPlanProcessAccessoriesService.list(new LambdaQueryWrapper<ZyPlanProcessAccessories>()
.in(ZyPlanProcessAccessories::getPlanProcessId, ids));
result.put("processAccessoriesList", processAccessoriesList);
return result;
}
@Override @Override
public List<ProcessDataVo> getTeamDatalist(ZyPlanProcess zyPlanProcess) { public List<ProcessDataVo> getTeamDatalist(ZyPlanProcess zyPlanProcess) {
//生产计划id //生产计划id
String planId = zyPlanProcess.getPlanId(); String planId = zyPlanProcess.getPlanId();
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId); ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId);
if (ObjectUtils.isEmpty(zyPlanProcess)) { if (ObjectUtils.isEmpty(zyProductPlan)) {
throw new JeecgBootException("生产计划不存在!"); throw new JeecgBootException("生产计划不存在!");
} }
//工单id //工单id

Loading…
Cancel
Save