计划工序管理-列表、读取工序 1.18

zhc4dev
zhc077 2 years ago
parent 7e2aa9da1b
commit 0ad37f7090
  1. 52
      ant-design-vue-jeecg/src/views/productplan/ProductplanManage.vue
  2. 15
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue
  3. 4
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessAccessories.java
  4. 4
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessFabric.java
  5. 39
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java

@ -50,6 +50,13 @@
<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>
</template> </template>
<template v-slot:action="props">
<a @click="jump2MianLiao('mianLiao',props)">面料</a>
<a-divider type="vertical"/>
<a @click="jump2FuLiao('fuLiao',props)">辅料</a>
<a-divider type="vertical"/>
<a @click="detail(props)">详情</a>
</template>
</j-vxe-table> </j-vxe-table>
</div> </div>
</a-card> </a-card>
@ -102,10 +109,10 @@ export default {
type: JVXETypes.hidden type: JVXETypes.hidden
}, },
{ {
title: '设备列表', title: '设备名称',
key: 'machineNames', key: 'machineNames',
type: JVXETypes.selectMultiple, type: JVXETypes.selectMultiple,
width: '200px', width: '180px',
options: [], options: [],
placeholder: '请选择${title}', placeholder: '请选择${title}',
}, },
@ -115,10 +122,10 @@ export default {
type: JVXETypes.hidden, type: JVXETypes.hidden,
}, },
{ {
title: '工具列表', title: '工具名称',
key: 'toolsNames', key: 'toolsNames',
type: JVXETypes.selectMultiple, type: JVXETypes.selectMultiple,
width: '200px', width: '180px',
options: [], options: [],
placeholder: '请选择${title}', placeholder: '请选择${title}',
}, },
@ -143,15 +150,23 @@ export default {
width: '180px', width: '180px',
popupCode: 'zy_process', popupCode: 'zy_process',
field: 'id,process_code,process_name,process_describe', field: 'id,process_code,process_name,process_describe',
// orgFields: 'id,process_code,process_name,process_describe',
// destFields: 'proProcessName,process_code,process_name,process_describe',
orgFields: 'process_name,id', orgFields: 'process_name,id',
destFields: 'postProcessName,postProcess', destFields: 'postProcessName,postProcess',
}, },
{key: 'inputProduct', title: '输入产品', width: '150', type: JVXETypes.input}, {key: 'inputProduct', title: '输入产品', width: '150', type: JVXETypes.input},
{key: 'semiProduct', title: '成品/半成品', width: '150', type: JVXETypes.input}, {key: 'semiProduct', title: '成品/半成品', width: '150', type: JVXETypes.input},
{key: 'totalMachine', title: '机器时长', width: '150', type: JVXETypes.normal}, // {key: 'semiProduct', title: '', width: '150', type: JVXETypes.input},
{key: 'totalMaunal', title: '人工时长', width: '150', type: JVXETypes.normal}, {key: 'totalMachine', title: '机器时长', width: '80', type: JVXETypes.normal},
{key: 'totalMaunal', title: '人工时长', width: '80', type: JVXETypes.normal},
{
title: '管理',
key: 'action',
type: JVXETypes.slot,
fixed: 'right',
minWidth: '150px',
align: 'center',
slotName: 'action',
},
], ],
url: { url: {
list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist", list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist",
@ -166,7 +181,6 @@ export default {
dictOptions: {}, dictOptions: {},
planInfo: {}, planInfo: {},
superFieldList: [], superFieldList: [],
// stationId: [],
stationIdList: [], stationIdList: [],
toolsList: [], toolsList: [],
machineList: [], machineList: [],
@ -178,12 +192,30 @@ export default {
this.getPlanInfo(this.planId); this.getPlanInfo(this.planId);
}, },
methods: { methods: {
jump2MianLiao(key,props){
console.log("mianLiao() ----key:",key)
console.log("mianLiao() ----props:",props)
this.$router.push({
path: '/productplan/ZyPlanProcessFabricList',
// query: { //
// 'planProcessId': record.id,
// },
});
},
jump2FuLiao(key,props){
console.log("fuLiao() ----key:",key)
console.log("fuLiao() ----props:",props)
},
detail(props){
alert("稍等,正在开发中。。。")
},
getPlanInfo(planId) { getPlanInfo(planId) {
// debugger; // debugger;
getAction(this.url.getPlanInfo, {"planId": planId}).then((res) => { getAction(this.url.getPlanInfo, {"planId": planId}).then((res) => {
if (res.success) { if (res.success) {
this.planInfo = res.result.records || res.result; this.planInfo = res.result.records || res.result;
console.log("getPlanInfo------------:" + JSON.stringify(this.planInfo)); // console.log("getPlanInfo------------:" + JSON.stringify(this.planInfo));
} else { } else {
// this.stationIdCode = "station,station_name,id,depart_id in (select workshop_id from zy_product_plan where id='" + this.planId + "')"; // this.stationIdCode = "station,station_name,id,depart_id in (select workshop_id from zy_product_plan where id='" + this.planId + "')";
this.$message.warning(res.message) this.$message.warning(res.message)

@ -18,19 +18,8 @@
<!-- <a-button type="primary" icon="import">导入</a-button>--> <!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>--> <!-- </a-upload>-->
<!-- 高级查询区域 --> <!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal" <!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal"-->
@handleSuperQuery="handleSuperQuery"></j-super-query> <!-- @handleSuperQuery="handleSuperQuery"></j-super-query>-->
<!-- <a-dropdown v-if="selectedRowKeys.length > 0">-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item key="1" @click="batchDel">-->
<!-- <a-icon type="delete"/>-->
<!-- 删除-->
<!-- </a-menu-item>-->
<!-- </a-menu>-->
<!--&lt;!&ndash; <a-button style="margin-left: 8px"> 批量操作&ndash;&gt;-->
<!--&lt;!&ndash; <a-icon type="down"/>&ndash;&gt;-->
<!--&lt;!&ndash; </a-button>&ndash;&gt;-->
<!-- </a-dropdown>-->
</div> </div>
<!-- table区域-begin --> <!-- table区域-begin -->

@ -65,7 +65,7 @@ public class ZyProcessAccessories implements Serializable {
@ApiModelProperty(value = "面料表id") @ApiModelProperty(value = "面料表id")
private String accessoriesId; private String accessoriesId;
private String processCode; // private String processCode;
private String nums; // private String nums;
} }

@ -50,7 +50,7 @@ public class ZyProcessFabric implements Serializable {
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
private String processCode; // private String processCode;
private String fabricNumber; // private String fabricNumber;
} }

@ -57,6 +57,7 @@ import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle;
import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService; import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.*; import java.util.*;
@ -167,6 +168,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
} }
@Override @Override
@Transactional(readOnly = false, rollbackFor = Exception.class)
public List<ZyPlanProcess> syncProductBaseProcess(ZyPlanProcess zyPlanProcess) { public List<ZyPlanProcess> syncProductBaseProcess(ZyPlanProcess zyPlanProcess) {
int count = this.count(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId())); int count = this.count(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, zyPlanProcess.getPlanId()));
//生产计划工序表没有对应工序时,说明没有制定过该产品的生产工序计划,先把该产品对应的基本工序数据插入到生产计划工序表 //生产计划工序表没有对应工序时,说明没有制定过该产品的生产工序计划,先把该产品对应的基本工序数据插入到生产计划工序表
@ -191,7 +193,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
productProcessesList.forEach(o -> { productProcessesList.forEach(o -> {
ZyPlanProcess en = new ZyPlanProcess(); ZyPlanProcess en = new ZyPlanProcess();
en.setProcessId(o.getProcessId()); en.setProcessId(o.getProcessId());
ZyProcess zyProcess = iZyProcessService.getById(o.getId()); ZyProcess zyProcess = iZyProcessService.getById(o.getProcessId());
en.setProcessName(zyProcess.getProcessName()); en.setProcessName(zyProcess.getProcessName());
en.setPlanId(zyPlanProcess.getPlanId()); en.setPlanId(zyPlanProcess.getPlanId());
en.setTotalMachine(zyProcess.getTotalMachine()); en.setTotalMachine(zyProcess.getTotalMachine());
@ -209,6 +211,37 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
//工序辅料同步到计划工序辅料表 //工序辅料同步到计划工序辅料表
this.saveBatchAccessoriesByProcessIdList(planProcessList); this.saveBatchAccessoriesByProcessIdList(planProcessList);
//填充前导工序、和后导工序
List<ZyPlanProcess> updateList = new LinkedList<>();
for (int i = 0; i < planProcessList.size(); i++) {
//第一个没有前导工序
if (i == 0) {
ZyPlanProcess process1 = planProcessList.get(i);
ZyPlanProcess process2 = planProcessList.get(i + 1);
process1.setPostProcess(process2.getProcessId());
process1.setPostProcessName(process2.getProcessName());
updateList.add(process1);
} else if (i > 0 && i < planProcessList.size() - 1) {
ZyPlanProcess process = planProcessList.get(i - 1);
ZyPlanProcess process1 = planProcessList.get(i);
ZyPlanProcess process2 = planProcessList.get(i + 1);
process1.setProProcess(process.getProcessId());
process1.setProProcessName(process.getProcessName());
process1.setPostProcess(process2.getProcessId());
process1.setPostProcessName(process2.getProcessName());
updateList.add(process1);
}
// 最后一个没有后导工序
else if (i == planProcessList.size() - 1) {
ZyPlanProcess process = planProcessList.get(i - 1);
ZyPlanProcess process1 = planProcessList.get(i);
process1.setProProcess(process.getProcessId());
process1.setProProcessName(process.getProcessName());
updateList.add(process1);
}
}
this.saveOrUpdateBatch(updateList);
} }
return null; return null;
} }
@ -224,7 +257,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
en.setPlanId(e.getPlanId()); en.setPlanId(e.getPlanId());
en.setAccessoriesId(obj.getAccessoriesId()); en.setAccessoriesId(obj.getAccessoriesId());
ZyAccessories zyAccessories = iZyAccessoriesService.getById(obj.getAccessoriesId()); ZyAccessories zyAccessories = iZyAccessoriesService.getById(obj.getAccessoriesId());
en.setAccessoriesName(zyAccessories.getContents()); en.setAccessoriesName(StringUtils.isNotBlank(zyAccessories.getContents()) ? zyAccessories.getContents() : "");
list.add(en); list.add(en);
}); });
iZyPlanProcessAccessoriesService.saveBatch(list); iZyPlanProcessAccessoriesService.saveBatch(list);
@ -242,7 +275,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
en.setPlanId(e.getPlanId()); en.setPlanId(e.getPlanId());
en.setFabricId(obj.getFabricId()); en.setFabricId(obj.getFabricId());
ZyFabric zyFabric = iZyFabricService.getById(obj.getFabricId()); ZyFabric zyFabric = iZyFabricService.getById(obj.getFabricId());
en.setFabricName(zyFabric.getName()); en.setFabricName(StringUtils.isNotBlank(zyFabric.getName()) ? zyFabric.getName() : "");
list.add(en); list.add(en);
}); });
iZyPlanProcessFabricService.saveBatch(list); iZyPlanProcessFabricService.saveBatch(list);

Loading…
Cancel
Save