计划工序管理 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. 40
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java

@ -32,6 +32,12 @@
<!-- </a-button>-->
<!-- </a-dropdown>-->
<!-- </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 -->
<div>
@ -55,32 +61,35 @@
class="j-table-force-nowrap"
@change="handleTableChange">
<span slot="stationList" slot-scope="stationList">
<a-select style="width: 120px" placeholder="请选择">
<a-select-option v-for="item in stationList" :value="item.id" >
{{item.stationName}}
<a-select @change="getToolAndMachine" style="width: 180px" placeholder="请选择">
<a-select-option v-for="item in stationList" :value="item.id">
{{ item.stationName }}
</a-select-option>
</a-select>
</span>
<!-- <span slot="action1" slot-scope="text, record">-->
<!-- <a @click="jumpPage1(record)">班组成员管理</a>-->
<!-- &lt;!&ndash; <a-divider type="vertical"/>&ndash;&gt;-->
<!-- &lt;!&ndash; <a @click="jumpPage2(record)">工位工具管理</a>&ndash;&gt;-->
<!-- </span>-->
<span slot="action" slot-scope="text, record">
<!-- <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 @click="jumpPage1(record)">制定计划详情</a>-->
<span slot="toolsList" slot-scope="toolsList">
<a-select style="width: 180px" placeholder="请选择">
<a-select-option v-for="item in toolsList" :value="item.id">
{{ item.name }}
</a-select-option>
</a-select>
</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>
</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>-->
</a-card>
</template>
@ -115,11 +124,11 @@ export default {
return parseInt(index) + 1;
}
},
{
title: '计划id',
align: "center",
dataIndex: 'planId'
},
// {
// title: 'id',
// align: "center",
// dataIndex: 'planId'
// },
{
title: '工单编号',
align: "center",
@ -129,36 +138,43 @@ export default {
title: '产品id',
align: "center",
dataIndex: 'productId'
}, {
title: '车间',
},
{
title: '产品',
align: "center",
dataIndex: 'departId'
dataIndex: 'productName'
},
{
title: '工序id',
title: '车间',
align: "center",
dataIndex: 'productProcessId'
dataIndex: 'departName'
},
{
title: '工位list',
title: '工',
align: "center",
dataIndex: 'stationList',
scopedSlots: {customRender: 'stationList'}
dataIndex: 'processName'
},
{
title: '工具id列表',
title: '工列表',
align: "center",
dataIndex: 'toolsIds'
dataIndex: 'stationList',
width: 150,
scopedSlots: {customRender: 'stationList'}
},
{
title: '工序id列表',
title: '工位工具列表',
align: "center",
dataIndex: 'processIds'
dataIndex: 'toolsList',
width: 150,
scopedSlots: {customRender: 'toolsList'}
// scopedSlots: {customRender: this.toolsList}
},
{
title: '成员id列表',
title: '工具设备列表',
align: "center",
dataIndex: 'userIds'
dataIndex: 'machineList',
width: 150,
scopedSlots: {customRender: 'machineList'}
},
{
title: '操作',
@ -171,6 +187,8 @@ export default {
],
url: {
list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist",
stationToolslist: "/stationTool/list",
stationMachinelist: "/stationMachine/list",
// productPlanlist: "/org.jeecg.modules.productplan/zyProductPlan/list",
delete: "/org.jeecg.modules.productplan/zyPlanProcess/delete",
// deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcess/deleteBatch",
@ -181,14 +199,12 @@ export default {
planId: "",
dictOptions: {},
superFieldList: [],
toolsList: [],
machineList: [],
}
},
// mounted() {
// this.loadData()
// },
created() {
this.getSuperFieldList();
// this.loadParameter();
},
computed: {
importExcelUrl: function () {
@ -196,9 +212,31 @@ export default {
},
},
methods: {
// valueChange(value) {
// if (value) this.loadData()
// },
fanHui() {
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() {
if (this.loadRouteType === false) {

@ -1,27 +1,38 @@
package org.jeecg.modules.productplan.entity.vo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.modules.team.entity.Station;
import java.io.Serializable;
import java.util.List;
@Data
public class ProcessDataVo {
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class ProcessDataVo implements Serializable {
private static final long serialVersionUID = 1009888L;
//工单id
private String workOrderId;
//产品id
private String productId;
private String productName;
//车间
// @Dict(dictTable ="sys_depart",dicText = "depart_name",dicCode = "id")
private String departId;
private String departName;
//工位
private List<Station> stationList;
// @Dict("")
//产品工序id
// @Dict(dictTable ="zy_process",dicText = "process_name",dicCode = "id")
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.extension.service.impl.ServiceImpl;
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.service.IZyProductProcessService;
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.service.IZyPlanProcessService;
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.service.IStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.LinkedList;
@ -39,11 +44,20 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
@Autowired
private IStationService iStationService;
@Autowired
private ISysDepartService iSysDepartService;
@Autowired
private IZyProcessService iZyProcessService;
public List<ProcessDataVo> getProcessDatalist(ZyPlanProcess zyPlanProcess) {
//生产计划id
String planId = zyPlanProcess.getPlanId();
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId);
if (ObjectUtils.isEmpty(zyPlanProcess)) {
throw new JeecgBootException("生产计划不存在!");
}
//工单id
String productCode = zyProductPlan.getProductCode();
String departId = zyProductPlan.getWorkshopId();
@ -52,16 +66,22 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
//根据产品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"));
Optional.ofNullable(productProcessesList).orElse(new ArrayList<>()).forEach(e -> {
ProcessDataVo vo = new ProcessDataVo();
vo.setProductProcessId(e.getProcessId());
vo.setProductId(e.getProductId());
vo.setWorkOrderId(productCode);
vo.setDepartId(departId);
vo.setStationList(iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getDepartId, departId)));
result.add(vo);
});
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();
vo.setProductProcessId(e.getProcessId());
vo.setProcessName(iZyProcessService.getById(e.getProcessId()).getProcessName());
vo.setProductId(e.getProductId());
// vo.setProductName("产品名称")
vo.setWorkOrderId(productCode);
vo.setDepartId(departId);
vo.setDepartName(depart.getDepartName());
vo.setStationList(stationList);
result.add(vo);
});
}
return result;
}
}

Loading…
Cancel
Save