喻忠伟 2 years ago
commit b449a43324
  1. 4
      ant-design-vue-jeecg/src/views/process/ZyProcessList.vue
  2. 4
      ant-design-vue-jeecg/src/views/process/modules/ZyProcessForm.vue
  3. 17
      ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineList.vue
  4. 15
      ant-design-vue-jeecg/src/views/process/modules/ZyProcessMachineModal.vue
  5. 15
      ant-design-vue-jeecg/src/views/process/modules/list/ZyMachine.vue
  6. 19
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/controller/ZyProcessMachineController.java
  7. 3
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessMachine.java
  8. 13
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/device/controller/ZyDeviceController.java
  9. 42
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/IZyProductPlanAutoServiceImpl.java
  10. 42
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java

@ -276,12 +276,12 @@ export default {
// dataIndex: 'contractNum' // dataIndex: 'contractNum'
// }, // },
{ {
title: '合计(手工TMU', title: '手工TMU',
align: "center", align: "center",
dataIndex: 'totalManualTmu' dataIndex: 'totalManualTmu'
}, },
{ {
title: '合计(机器TMU', title: '机器TMU',
align: "center", align: "center",
dataIndex: 'totalMachineTmu' dataIndex: 'totalMachineTmu'
}, },

@ -163,12 +163,12 @@
<!-- </a-form-model-item>--> <!-- </a-form-model-item>-->
<!-- </a-col>--> <!-- </a-col>-->
<a-col :span="11"> <a-col :span="11">
<a-form-model-item label="合计(手工TMU" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="totalManualTmu"> <a-form-model-item label="手工TMU" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="totalManualTmu">
<a-input-number v-model="model.totalManualTmu" placeholder="请输入合计(手工TMU)" style="width: 100%" /> <a-input-number v-model="model.totalManualTmu" placeholder="请输入合计(手工TMU)" style="width: 100%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-model-item label="合计(机器TMU" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="totalMachineTmu"> <a-form-model-item label="机器TMU" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="totalMachineTmu">
<a-input-number v-model="model.totalMachineTmu" placeholder="请输入合计(机器TMU)" style="width: 100%" /> <a-input-number v-model="model.totalMachineTmu" placeholder="请输入合计(机器TMU)" style="width: 100%" />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>

@ -10,8 +10,8 @@
<!-- </a-form-model-item>--> <!-- </a-form-model-item>-->
<!-- </a-col>--> <!-- </a-col>-->
<a-col :sm="5"> <a-col :sm="5">
<a-form-model-item label="设备" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer"> <a-form-model-item label="设备类型名称" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="organizer">
<a-input v-model="queryParam.machineId" placeholder="请输入设备名称" ></a-input> <a-input v-model="queryParam.codeName" placeholder="请输入设备类型名称" ></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24"> <a-col :xl="6" :lg="7" :md="8" :sm="24">
@ -21,6 +21,7 @@
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
<!-- <a-input v-model="queryParam.processId" hidden ></a-input>-->
</a-form> </a-form>
</div> </div>
<!-- 查询区域-END --> <!-- 查询区域-END -->
@ -140,7 +141,7 @@
{ {
title:'工序编号', title:'工序编号',
align:"center", align:"center",
dataIndex: 'processCode' dataIndex: 'processCode_dictText'
}, },
{ {
title:'工序', title:'工序',
@ -148,14 +149,14 @@
dataIndex: 'processId_dictText' dataIndex: 'processId_dictText'
}, },
{ {
title:'设备编号', title:'设备类型编号',
align:"center", align:"center",
dataIndex: 'code' dataIndex: 'code'
}, },
{ {
title:'设备名称', title:'设备类型名称',
align:"center", align:"center",
dataIndex: 'machineId_dictText' dataIndex: 'codeName'
}, },
{ {
title: '操作', title: '操作',
@ -193,9 +194,9 @@
edit (record) { edit (record) {
this.id = record; this.id = record;
this.queryParam.processId=this.id; this.queryParam.processId=this.id;
this.loadData(); // this.loadData();
this.visible = true; this.visible = true;
this.loadData();
}, },
initDictConfig(){ initDictConfig(){
}, },

@ -8,7 +8,7 @@
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }" :okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel" @cancel="handleCancel"
cancelText="关闭"> cancelText="关闭">
<zy-machine ref="realForm" @onChangeRowKey="chuancan" @ok="submitCallback" :disabled="disableSubmit"></zy-machine> <zy-machine ref="realForm" @onChangeRowKey="chuancan" @ok="submitCallback" :disabled="disableSubmit" @onChangeCode="changecode" @onChangeCodeName="changecodename"></zy-machine>
</j-modal> </j-modal>
</template> </template>
@ -29,7 +29,10 @@
disableSubmit: false, disableSubmit: false,
model:{ model:{
machineId:'', machineId:'',
processId:'' processId:'',
code:'',
processCode:"",
codeName:""
}, },
url:{ url:{
add: "/pro/zyProcessMachine/add", add: "/pro/zyProcessMachine/add",
@ -46,6 +49,7 @@
add1 (id) { add1 (id) {
this.visible=true this.visible=true
this.model.processId=id; this.model.processId=id;
this.model.processCode=id;
}, },
edit (record) { edit (record) {
this.visible=true this.visible=true
@ -61,6 +65,13 @@
this.model.machineId=res; this.model.machineId=res;
console.log(res) console.log(res)
}, },
changecode(res){
this.model.code=res;
console.log(res)
},
changecodename(res){
this.model.codeName=res;
},
handleOk () { handleOk () {
postAction(this.url.add,this.model).then((res)=>{ postAction(this.url.add,this.model).then((res)=>{
if(res.success){ if(res.success){

@ -127,11 +127,11 @@
dataIndex: 'code' dataIndex: 'code'
}, },
{ {
title:'设备名称', title:'名称',
align:"center", align:"center",
dataIndex: 'name' dataIndex: 'name'
}, },
// { // {
// title: '', // title: '',
// dataIndex: 'action', // dataIndex: 'action',
@ -166,7 +166,16 @@
for (var a = 0; a < this.selectedRowKeys.length; a++) { for (var a = 0; a < this.selectedRowKeys.length; a++) {
ids += this.selectedRowKeys[a] + ","; ids += this.selectedRowKeys[a] + ",";
} }
this.$emit('onChangeRowKey',ids) let codes = "";
let codenames = "";
for (var a = 0; a < this.selectionRows.length; a++) {
codes += this.selectionRows[a].code + ",";
codenames += this.selectionRows[a].name + ",";
}
this.$emit('onChangeRowKey',ids);
this.$emit('onChangeCode',codes);
this.$emit('onChangeCodeName',codenames);
}, },
add (code) { add (code) {
}, },

@ -81,18 +81,13 @@ public class ZyProcessMachineController extends JeecgController<ZyProcessMachine
@AutoLog(value = "zy_process_machine-分页列表查询") @AutoLog(value = "zy_process_machine-分页列表查询")
@ApiOperation(value="zy_process_machine-分页列表查询", notes="zy_process_machine-分页列表查询") @ApiOperation(value="zy_process_machine-分页列表查询", notes="zy_process_machine-分页列表查询")
@GetMapping(value = "/list1") @GetMapping(value = "/list1")
public Result<?> queryPageList1(ZyProcessMachine zyProcessMachine, public Result<?> queryPageList1(ZyProcessMachine zyProcessMachine,@RequestParam(name="processId",required=true) String processId,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) { HttpServletRequest req) {
//QueryWrapper<ZyProcessMachine> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessMachine, req.getParameterMap()); QueryWrapper<ZyProcessMachine> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessMachine, req.getParameterMap());
String s=zyProcessMachine.getProcessId(),t=null;
if(zyProcessMachine.getMachineId()!=null){
t="%"+zyProcessMachine.getMachineId()+"%";
}
Page<ZyProcessMachine> page = new Page<ZyProcessMachine>(pageNo, pageSize); Page<ZyProcessMachine> page = new Page<ZyProcessMachine>(pageNo, pageSize);
IPage<ZyProcessMachine> pageList = zyProcessMachineService.page1(page, s,t); IPage<ZyProcessMachine> pageList = zyProcessMachineService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
} }
/** /**
@ -106,8 +101,12 @@ public class ZyProcessMachineController extends JeecgController<ZyProcessMachine
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyProcessMachine zyProcessMachine) { public Result<?> add(@RequestBody ZyProcessMachine zyProcessMachine) {
String[] split = zyProcessMachine.getMachineId().split(","); String[] split = zyProcessMachine.getMachineId().split(",");
for (String k : split) { String[] splitc = zyProcessMachine.getCode().split(",");
zyProcessMachine.setMachineId(k); String[] splitcn = zyProcessMachine.getCodeName().split(",");
for (int i = 0 ; i < splitc.length; i++) {
zyProcessMachine.setMachineId(split[i]);
zyProcessMachine.setCode(splitc[i]);
zyProcessMachine.setCodeName(splitcn[i]);
QueryWrapper s=new QueryWrapper(); QueryWrapper s=new QueryWrapper();
s.eq("process_id",zyProcessMachine.getProcessId()); s.eq("process_id",zyProcessMachine.getProcessId());
s.eq("machine_id",zyProcessMachine.getMachineId()); s.eq("machine_id",zyProcessMachine.getMachineId());

@ -49,6 +49,9 @@ public class ZyProcessMachine implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd") @DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "创建时间") @ApiModelProperty(value = "创建时间")
private Date createTime; private Date createTime;
@Dict(dictTable = "zy_process", dicText = "process_code", dicCode = "id")
@ApiModelProperty(value = "工序编号")
private String processCode; private String processCode;
private String code; private String code;
private String codeName;
} }

@ -29,6 +29,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.zydevice.devicemodel.entity.ZyDevicemodel; import org.jeecg.modules.zydevice.devicemodel.entity.ZyDevicemodel;
import org.jeecg.modules.zydevice.devicetype.entity.ZyDevicetype;
import org.jeecg.modules.zydevice.devicetype.service.IZyDevicetypeService;
import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants; import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ExportParams;
@ -58,6 +60,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class ZyDeviceController extends JeecgController<ZyDevice, IZyDeviceService> { public class ZyDeviceController extends JeecgController<ZyDevice, IZyDeviceService> {
@Autowired @Autowired
private IZyDeviceService zyDeviceService; private IZyDeviceService zyDeviceService;
@Autowired
private IZyDevicetypeService zyDevicetypeService;
/** /**
* 分页列表查询 * 分页列表查询
@ -131,13 +135,14 @@ public class ZyDeviceController extends JeecgController<ZyDevice, IZyDeviceServi
@AutoLog(value = "设备信息-分页列表查询") @AutoLog(value = "设备信息-分页列表查询")
@ApiOperation(value="设备信息-分页列表查询", notes="设备信息-分页列表查询") @ApiOperation(value="设备信息-分页列表查询", notes="设备信息-分页列表查询")
@GetMapping(value = "/list1") @GetMapping(value = "/list1")
public Result<?> queryPageList1(ZyDevice zyDevice, public Result<?> queryPageList1(ZyDevicetype zyDevicetype,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) throws WriterException, IOException { HttpServletRequest req) throws WriterException, IOException {
QueryWrapper<ZyDevice> queryWrapper = QueryGenerator.initQueryWrapper(zyDevice, req.getParameterMap()); QueryWrapper<ZyDevicetype> queryWrapper = QueryGenerator.initQueryWrapper(zyDevicetype, req.getParameterMap());
Page<ZyDevice> page = new Page<ZyDevice>(pageNo, pageSize); queryWrapper.orderByDesc("code");
IPage<ZyDevice> pageList = zyDeviceService.page(page, queryWrapper); Page<ZyDevicetype> page = new Page<ZyDevicetype>(pageNo, pageSize);
IPage<ZyDevicetype> pageList = zyDevicetypeService.page(page, queryWrapper);
return Result.OK(pageList); return Result.OK(pageList);
} }

@ -6,6 +6,8 @@ import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.exception.JeecgBootException; import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.demo.pro.entity.ZyProcessMachine; import org.jeecg.modules.demo.pro.entity.ZyProcessMachine;
import org.jeecg.modules.demo.pro.service.IZyProcessMachineService; import org.jeecg.modules.demo.pro.service.IZyProcessMachineService;
import org.jeecg.modules.device.entity.ZyDevice;
import org.jeecg.modules.device.service.IZyDeviceService;
import org.jeecg.modules.operationtool.entity.ZyOperationtool; import org.jeecg.modules.operationtool.entity.ZyOperationtool;
import org.jeecg.modules.operationtool.service.IZyOperationtoolService; import org.jeecg.modules.operationtool.service.IZyOperationtoolService;
import org.jeecg.modules.productplan.entity.ZyPlanProcess; import org.jeecg.modules.productplan.entity.ZyPlanProcess;
@ -380,9 +382,10 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
List<ZyProcessMachine> machineList = iZyProcessMachineService.list(new LambdaQueryWrapper<ZyProcessMachine>().eq(ZyProcessMachine::getProcessId, obj.getProcessId())); List<ZyProcessMachine> machineList = iZyProcessMachineService.list(new LambdaQueryWrapper<ZyProcessMachine>().eq(ZyProcessMachine::getProcessId, obj.getProcessId()));
List<ZyOperationtool> toolList = iZyOperationtoolService.list(new LambdaQueryWrapper<ZyOperationtool>().eq(ZyOperationtool::getOperationid, obj.getProcessId())); List<ZyOperationtool> toolList = iZyOperationtoolService.list(new LambdaQueryWrapper<ZyOperationtool>().eq(ZyOperationtool::getOperationid, obj.getProcessId()));
List<String> zyProcessMachineIds = machineList.stream().map(ZyProcessMachine::getMachineId).collect(Collectors.toList()); List<String> zyProcessMachineIds = machineList.stream().map(ZyProcessMachine::getMachineId).collect(Collectors.toList());
List<String> zyProcessCodes = machineList.stream().map(ZyProcessMachine::getCode).collect(Collectors.toList());
List<String> zyProcessToolIds = toolList.stream().map(ZyOperationtool::getOperationid).collect(Collectors.toList()); List<String> zyProcessToolIds = toolList.stream().map(ZyOperationtool::getOperationid).collect(Collectors.toList());
ZyPlanProcess diffMachine = this.diffMachine(obj, zyProcessMachineIds, stationList); ZyPlanProcess diffMachine = this.diffMachine(obj, zyProcessMachineIds, zyProcessCodes, stationList);
//设备匹配失败,直接结束 //设备匹配失败,直接结束
if (ObjectUtils.isEmpty(diffMachine)) { if (ObjectUtils.isEmpty(diffMachine)) {
b.set(false); b.set(false);
@ -447,21 +450,28 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
zyPlanProcessService.saveOrUpdateBatch(zyPlanProcessList); zyPlanProcessService.saveOrUpdateBatch(zyPlanProcessList);
} }
ZyPlanProcess diffMachine(ZyPlanProcess zyPlanProcess, List<String> zyProcessMachineIds, List<Station> stationList) { @Autowired
for (int j = 0; j < stationList.size(); j++) { private IZyDeviceService iZyDeviceService;
Station station = stationList.get(j);
List<StationMachine> stationMachineList = iStationMachineService.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, station.getId())); ZyPlanProcess diffMachine(ZyPlanProcess zyPlanProcess, List<String> zyProcessMachineIds, List<String> zyProcessCodes, List<Station> stationList) {
List<String> stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream() if (!ObjectUtils.isEmpty(zyProcessCodes) && !ObjectUtils.isEmpty(zyProcessMachineIds)) {
.map(StationMachine::getMachineId).collect(Collectors.toList()); for (int j = 0; j < stationList.size(); j++) {
// 设备匹配成功 Station station = stationList.get(j);
if (stationMachineIds.containsAll(zyProcessMachineIds)) { List<StationMachine> stationMachineList = iStationMachineService.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, station.getId()));
String machineIds = zyProcessMachineIds.stream().collect(Collectors.joining(",")); //工位设备ids
zyPlanProcess.setMachineIds(machineIds); List<String> stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList());
zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(zyProcessMachineIds)); List<ZyDevice> zyDeviceList = iZyDeviceService.list(new LambdaQueryWrapper<ZyDevice>().in(ZyDevice::getId, stationMachineIds));
zyPlanProcess.setStationId(station.getId()); List<String> zyDevice_typeCodes = Optional.ofNullable(zyDeviceList).orElse(new ArrayList<>()).stream().map(ZyDevice::getTypeCode).collect(Collectors.toList());
zyPlanProcess.setStationName(station.getStationName()); // 工位设备包含工序设备即匹配成功
zyPlanProcess.setStationNum(station.getStationNum()); if (zyDevice_typeCodes.containsAll(zyProcessCodes)) {
return zyPlanProcess; String machineIds = zyProcessMachineIds.stream().collect(Collectors.joining(","));
zyPlanProcess.setMachineIds(machineIds);
zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(zyProcessMachineIds));
zyPlanProcess.setStationId(station.getId());
zyPlanProcess.setStationName(station.getStationName());
zyPlanProcess.setStationNum(station.getStationNum());
return zyPlanProcess;
}
} }
} }
return null; return null;

@ -25,6 +25,8 @@ import org.jeecg.modules.demo.pro.service.IZyProcessFabricService;
import org.jeecg.modules.demo.pro.service.IZyProcessMachineService; import org.jeecg.modules.demo.pro.service.IZyProcessMachineService;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; import org.jeecg.modules.demo.zyorders.service.IZyOrdersService;
import org.jeecg.modules.device.entity.ZyDevice;
import org.jeecg.modules.device.service.IZyDeviceService;
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.*; import org.jeecg.modules.productplan.entity.*;
@ -128,7 +130,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
private IZyPlanProcessAccessoriesService iZyPlanProcessAccessoriesService; private IZyPlanProcessAccessoriesService iZyPlanProcessAccessoriesService;
@Autowired @Autowired
private IZyProcessFabricService iZyProcessFabricService; private IZyDeviceService iZyDeviceService;
@Autowired @Autowired
private IZyProcessAccessoriesService iZyProcessAccessoriesService; private IZyProcessAccessoriesService iZyProcessAccessoriesService;
@ -248,8 +250,9 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
* 根据工序查询工序设备表zy_process_machine * 根据工序查询工序设备表zy_process_machine
*/ */
Optional.ofNullable(planProcessList).orElse(new ArrayList<>()).forEach(e -> { Optional.ofNullable(planProcessList).orElse(new ArrayList<>()).forEach(e -> {
List<ZyProcessMachine> machineList = iZyProcessMachineService.list(new LambdaQueryWrapper<ZyProcessMachine>().eq(ZyProcessMachine::getProcessId, e.getProcessId())); //工序设备列表
this.diffMachine(e, stationList, machineList); List<ZyProcessMachine> zyProcessMachineList = iZyProcessMachineService.list(new LambdaQueryWrapper<ZyProcessMachine>().eq(ZyProcessMachine::getProcessId, e.getProcessId()));
this.diffMachine(e, stationList, zyProcessMachineList);
}); });
} }
@ -298,16 +301,29 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
} }
void diffMachine(ZyPlanProcess zyPlanProcess, List<Station> stationList, List<ZyProcessMachine> machineList) { /**
if (!ObjectUtils.isEmpty(machineList)) { * @param zyPlanProcess 生产计划工序
List<String> machineList1 = machineList.stream().map(ZyProcessMachine::getMachineId).collect(Collectors.toList()); * @param stationList 车间工位
* @param zyProcessMachineList 工序设备列表
*/
void diffMachine(ZyPlanProcess zyPlanProcess, List<Station> stationList, List<ZyProcessMachine> zyProcessMachineList) {
if (!ObjectUtils.isEmpty(zyProcessMachineList)) {
//工序设备类型列表
List<String> zyDevicetype_codes = zyProcessMachineList.stream().map(ZyProcessMachine::getCode).collect(Collectors.toList());
Optional.ofNullable(stationList).orElse(new ArrayList<>()).forEach(e -> { Optional.ofNullable(stationList).orElse(new ArrayList<>()).forEach(e -> {
List<StationMachine> stationMachineList = iStationMachineService.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, e.getId())); List<StationMachine> stationMachineList = iStationMachineService.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, e.getId()));
List<String> machineList2 = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList()); //工位设备ids
if (machineList2.containsAll(machineList1)) { List<String> stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList());
String collect = machineList1.stream().collect(Collectors.joining(",")); List<ZyDevice> zyDeviceList = iZyDeviceService.list(new LambdaQueryWrapper<ZyDevice>().in(ZyDevice::getId, stationMachineIds));
List<String> zyDevice_typeCodes = Optional.ofNullable(zyDeviceList).orElse(new ArrayList<>()).stream().map(ZyDevice::getTypeCode).collect(Collectors.toList());
/**
* 工位设备包含工序设备即匹配成功
*/
if (zyDevice_typeCodes.containsAll(zyDevicetype_codes)) {
String collect = zyProcessMachineList.stream().map(ZyProcessMachine::getMachineId).collect(Collectors.joining(","));
zyPlanProcess.setMachineIds(collect); zyPlanProcess.setMachineIds(collect);
zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(machineList1)); zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(stationMachineIds));
zyPlanProcess.setStationId(e.getId()); zyPlanProcess.setStationId(e.getId());
zyPlanProcess.setStationName(e.getStationName()); zyPlanProcess.setStationName(e.getStationName());
zyPlanProcess.setStationNum(e.getStationNum()); zyPlanProcess.setStationNum(e.getStationNum());
@ -373,15 +389,13 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
//第一个没有前导工序 //第一个没有前导工序
if (i == 0) { if (i == 0) {
//判断是否有下到工序 //判断是否有下到工序
if(planProcessList.size()>1) if (planProcessList.size() > 1) {
{
ZyPlanProcess process1 = planProcessList.get(i); ZyPlanProcess process1 = planProcessList.get(i);
ZyPlanProcess process2 = planProcessList.get(i + 1); ZyPlanProcess process2 = planProcessList.get(i + 1);
process1.setPostProcess(process2.getProcessId()); process1.setPostProcess(process2.getProcessId());
process1.setPostProcessName(process2.getProcessName()); process1.setPostProcessName(process2.getProcessName());
updateList.add(process1); updateList.add(process1);
}else } else {
{
ZyPlanProcess process1 = planProcessList.get(i); ZyPlanProcess process1 = planProcessList.get(i);
updateList.add(process1); updateList.add(process1);
} }

Loading…
Cancel
Save