计划工序管理 12.17

zhc4dev
zhc077 2 years ago
parent 80bcfca711
commit 4ff41ec636
  1. 126
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue
  2. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java
  3. 26
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java

@ -32,6 +32,12 @@
<!-- </a-button>--> <!-- </a-button>-->
<!-- </a-dropdown>--> <!-- </a-dropdown>-->
<!-- </div>--> <!-- </div>-->
<div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<!-- <a-button @click="zyStyleFabricHandleAdd(stationId)" type="primary" icon="plus">新增</a-button>-->
<a-button type="primary" icon="download" @click="handleExportXls('1')">导出</a-button>
<a-button type="primary" @click="fanHui()">返回</a-button>
</div>
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
@ -55,32 +61,35 @@
class="j-table-force-nowrap" class="j-table-force-nowrap"
@change="handleTableChange"> @change="handleTableChange">
<span slot="stationList" slot-scope="stationList"> <span slot="stationList" slot-scope="stationList">
<a-select style="width: 120px" placeholder="请选择"> <a-select @change="getToolAndMachine" style="width: 180px" placeholder="请选择">
<a-select-option v-for="item in stationList" :value="item.id" > <a-select-option v-for="item in stationList" :value="item.id">
{{item.stationName}} {{ item.stationName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</span> </span>
<!-- <span slot="action1" slot-scope="text, record">-->
<!-- <a @click="jumpPage1(record)">班组成员管理</a>--> <span slot="toolsList" slot-scope="toolsList">
<!-- &lt;!&ndash; <a-divider type="vertical"/>&ndash;&gt;--> <a-select style="width: 180px" placeholder="请选择">
<!-- &lt;!&ndash; <a @click="jumpPage2(record)">工位工具管理</a>&ndash;&gt;--> <a-select-option v-for="item in toolsList" :value="item.id">
<!-- </span>--> {{ item.name }}
<span slot="action" slot-scope="text, record"> </a-select-option>
<!-- <a @click="handleEdit(record)">编辑</a>--> </a-select>
<!-- <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 @click="jumpPage1(record)">制定计划详情</a>-->
</span> </span>
<span slot="machineList" slot-scope="machineList">
<a-select style="width: 180px" placeholder="请选择">
<a-select-option v-for="item in machineList" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</span>
</a-table> </a-table>
</div> </div>
<div class="table-operator" style="text-align: right">
<a-button type="primary" @click="fanHui()">提交</a-button>
</div>
<!-- <zy-plan-process-modal @valueChange="valueChange" ref="modalForm" @ok="modalFormOk"></zy-plan-process-modal>--> <!-- <zy-plan-process-modal @valueChange="valueChange" ref="modalForm" @ok="modalFormOk"></zy-plan-process-modal>-->
</a-card> </a-card>
</template> </template>
@ -115,11 +124,11 @@ export default {
return parseInt(index) + 1; return parseInt(index) + 1;
} }
}, },
{ // {
title: '计划id', // title: 'id',
align: "center", // align: "center",
dataIndex: 'planId' // dataIndex: 'planId'
}, // },
{ {
title: '工单编号', title: '工单编号',
align: "center", align: "center",
@ -129,36 +138,43 @@ export default {
title: '产品id', title: '产品id',
align: "center", align: "center",
dataIndex: 'productId' dataIndex: 'productId'
}, { },
title: '车间', {
title: '产品',
align: "center", align: "center",
dataIndex: 'departId' dataIndex: 'productName'
}, },
{ {
title: '工序id', title: '车间',
align: "center", align: "center",
dataIndex: 'productProcessId' dataIndex: 'departName'
}, },
{ {
title: '工位list', title: '工',
align: "center", align: "center",
dataIndex: 'stationList', dataIndex: 'processName'
scopedSlots: {customRender: 'stationList'}
}, },
{ {
title: '工具id列表', title: '工列表',
align: "center", align: "center",
dataIndex: 'toolsIds' dataIndex: 'stationList',
width: 150,
scopedSlots: {customRender: 'stationList'}
}, },
{ {
title: '工序id列表', title: '工位工具列表',
align: "center", align: "center",
dataIndex: 'processIds' dataIndex: 'toolsList',
width: 150,
scopedSlots: {customRender: 'toolsList'}
// scopedSlots: {customRender: this.toolsList}
}, },
{ {
title: '成员id列表', title: '工具设备列表',
align: "center", align: "center",
dataIndex: 'userIds' dataIndex: 'machineList',
width: 150,
scopedSlots: {customRender: 'machineList'}
}, },
{ {
title: '操作', title: '操作',
@ -171,6 +187,8 @@ export default {
], ],
url: { url: {
list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist", list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist",
stationToolslist: "/stationTool/list",
stationMachinelist: "/stationMachine/list",
// productPlanlist: "/org.jeecg.modules.productplan/zyProductPlan/list", // productPlanlist: "/org.jeecg.modules.productplan/zyProductPlan/list",
delete: "/org.jeecg.modules.productplan/zyPlanProcess/delete", delete: "/org.jeecg.modules.productplan/zyPlanProcess/delete",
// deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcess/deleteBatch", // deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcess/deleteBatch",
@ -181,14 +199,12 @@ export default {
planId: "", planId: "",
dictOptions: {}, dictOptions: {},
superFieldList: [], superFieldList: [],
toolsList: [],
machineList: [],
} }
}, },
// mounted() {
// this.loadData()
// },
created() { created() {
this.getSuperFieldList(); this.getSuperFieldList();
// this.loadParameter();
}, },
computed: { computed: {
importExcelUrl: function () { importExcelUrl: function () {
@ -196,9 +212,31 @@ export default {
}, },
}, },
methods: { methods: {
// valueChange(value) { fanHui() {
// if (value) this.loadData() this.$router.push({
// }, path: '/productplan/ZyPlanProcessList',
});
},
getToolAndMachine(stationId) {
// alert("stationId=" + stationId);
getAction(this.url.stationToolslist, {"stationId": stationId}).then((res) => {
if (res.success) {
this.toolsList = res.result.records || res.result;
console.log("toolsList", JSON.stringify(this.toolsList))
} else {
this.$message.warning(res.message)
}
});
getAction(this.url.stationMachinelist, {"stationId": stationId}).then((res) => {
if (res.success) {
this.machineList = res.result.records || res.result;
console.log("machineList", JSON.stringify(this.toolsList))
} else {
this.$message.warning(res.message)
}
});
},
// //
loadParameter() { loadParameter() {
if (this.loadRouteType === false) { if (this.loadRouteType === false) {

@ -1,27 +1,38 @@
package org.jeecg.modules.productplan.entity.vo; package org.jeecg.modules.productplan.entity.vo;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict; import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.modules.team.entity.Station; import org.jeecg.modules.team.entity.Station;
import java.io.Serializable;
import java.util.List; import java.util.List;
@Data @Data
public class ProcessDataVo { @EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class ProcessDataVo implements Serializable {
private static final long serialVersionUID = 1009888L;
//工单id //工单id
private String workOrderId; private String workOrderId;
//产品id //产品id
private String productId; private String productId;
private String productName;
//车间 //车间
// @Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
private String departId; private String departId;
private String departName;
//工位 //工位
private List<Station> stationList; private List<Station> stationList;
// @Dict("")
//产品工序id //产品工序id
// @Dict(dictTable ="zy_process",dicText = "process_name",dicCode = "id")
private String productProcessId; private String productProcessId;
private String processName;
} }

@ -4,6 +4,8 @@ package org.jeecg.modules.productplan.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.swagger.annotations.Authorization; import io.swagger.annotations.Authorization;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.demo.base.service.IZyProcessService;
import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess; import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess;
import org.jeecg.modules.product.zyproductprocess.service.IZyProductProcessService; import org.jeecg.modules.product.zyproductprocess.service.IZyProductProcessService;
import org.jeecg.modules.productplan.entity.ZyPlanProcess; import org.jeecg.modules.productplan.entity.ZyPlanProcess;
@ -12,10 +14,13 @@ import org.jeecg.modules.productplan.entity.vo.ProcessDataVo;
import org.jeecg.modules.productplan.mapper.ZyPlanProcessMapper; import org.jeecg.modules.productplan.mapper.ZyPlanProcessMapper;
import org.jeecg.modules.productplan.service.IZyPlanProcessService; import org.jeecg.modules.productplan.service.IZyPlanProcessService;
import org.jeecg.modules.productplan.service.IZyProductPlanService; import org.jeecg.modules.productplan.service.IZyProductPlanService;
import org.jeecg.modules.system.entity.SysDepart;
import org.jeecg.modules.system.service.ISysDepartService;
import org.jeecg.modules.team.entity.Station; import org.jeecg.modules.team.entity.Station;
import org.jeecg.modules.team.service.IStationService; import org.jeecg.modules.team.service.IStationService;
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.util.ObjectUtils;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedList; import java.util.LinkedList;
@ -39,11 +44,20 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
@Autowired @Autowired
private IStationService iStationService; private IStationService iStationService;
@Autowired
private ISysDepartService iSysDepartService;
@Autowired
private IZyProcessService iZyProcessService;
public List<ProcessDataVo> getProcessDatalist(ZyPlanProcess zyPlanProcess) { public List<ProcessDataVo> getProcessDatalist(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)) {
throw new JeecgBootException("生产计划不存在!");
}
//工单id //工单id
String productCode = zyProductPlan.getProductCode(); String productCode = zyProductPlan.getProductCode();
String departId = zyProductPlan.getWorkshopId(); String departId = zyProductPlan.getWorkshopId();
@ -52,16 +66,22 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
//根据产品id获取产品工序列表 //根据产品id获取产品工序列表
// List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>().eq(ZyProductProcess::getProductId, "产品id")); // List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>().eq(ZyProductProcess::getProductId, "产品id"));
List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>().eq(ZyProductProcess::getProductId, "1")); List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>().eq(ZyProductProcess::getProductId, "1"));
Optional.ofNullable(productProcessesList).orElse(new ArrayList<>()).forEach(e -> { if (!ObjectUtils.isEmpty(productProcessesList)) {
SysDepart depart = iSysDepartService.getById(departId);
List<Station> stationList = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getDepartId, departId));
productProcessesList.forEach(e -> {
ProcessDataVo vo = new ProcessDataVo(); ProcessDataVo vo = new ProcessDataVo();
vo.setProductProcessId(e.getProcessId()); vo.setProductProcessId(e.getProcessId());
vo.setProcessName(iZyProcessService.getById(e.getProcessId()).getProcessName());
vo.setProductId(e.getProductId()); vo.setProductId(e.getProductId());
// vo.setProductName("产品名称")
vo.setWorkOrderId(productCode); vo.setWorkOrderId(productCode);
vo.setDepartId(departId); vo.setDepartId(departId);
vo.setStationList(iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getDepartId, departId))); vo.setDepartName(depart.getDepartName());
vo.setStationList(stationList);
result.add(vo); result.add(vo);
}); });
}
return result; return result;
} }
} }

Loading…
Cancel
Save