喻忠伟 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'
// },
{
title: '合计(手工TMU',
title: '手工TMU',
align: "center",
dataIndex: 'totalManualTmu'
},
{
title: '合计(机器TMU',
title: '机器TMU',
align: "center",
dataIndex: 'totalMachineTmu'
},

@ -163,12 +163,12 @@
<!-- </a-form-model-item>-->
<!-- </a-col>-->
<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-form-model-item>
</a-col>
<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-form-model-item>
</a-col>

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

@ -8,7 +8,7 @@
:okButtonProps="{ class:{'jee-hidden': disableSubmit} }"
@cancel="handleCancel"
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>
</template>
@ -29,7 +29,10 @@
disableSubmit: false,
model:{
machineId:'',
processId:''
processId:'',
code:'',
processCode:"",
codeName:""
},
url:{
add: "/pro/zyProcessMachine/add",
@ -46,6 +49,7 @@
add1 (id) {
this.visible=true
this.model.processId=id;
this.model.processCode=id;
},
edit (record) {
this.visible=true
@ -61,6 +65,13 @@
this.model.machineId=res;
console.log(res)
},
changecode(res){
this.model.code=res;
console.log(res)
},
changecodename(res){
this.model.codeName=res;
},
handleOk () {
postAction(this.url.add,this.model).then((res)=>{
if(res.success){

@ -127,11 +127,11 @@
dataIndex: 'code'
},
{
title:'设备名称',
title:'名称',
align:"center",
dataIndex: 'name'
},
// {
// title: '',
// dataIndex: 'action',
@ -166,7 +166,16 @@
for (var a = 0; a < this.selectedRowKeys.length; 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) {
},

@ -81,18 +81,13 @@ public class ZyProcessMachineController extends JeecgController<ZyProcessMachine
@AutoLog(value = "zy_process_machine-分页列表查询")
@ApiOperation(value="zy_process_machine-分页列表查询", notes="zy_process_machine-分页列表查询")
@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="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
//QueryWrapper<ZyProcessMachine> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessMachine, req.getParameterMap());
String s=zyProcessMachine.getProcessId(),t=null;
if(zyProcessMachine.getMachineId()!=null){
t="%"+zyProcessMachine.getMachineId()+"%";
}
QueryWrapper<ZyProcessMachine> queryWrapper = QueryGenerator.initQueryWrapper(zyProcessMachine, req.getParameterMap());
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);
}
/**
@ -106,8 +101,12 @@ public class ZyProcessMachineController extends JeecgController<ZyProcessMachine
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyProcessMachine zyProcessMachine) {
String[] split = zyProcessMachine.getMachineId().split(",");
for (String k : split) {
zyProcessMachine.setMachineId(k);
String[] splitc = zyProcessMachine.getCode().split(",");
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();
s.eq("process_id",zyProcessMachine.getProcessId());
s.eq("machine_id",zyProcessMachine.getMachineId());

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

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

@ -6,6 +6,8 @@ import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.demo.pro.entity.ZyProcessMachine;
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.service.IZyOperationtoolService;
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<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> zyProcessCodes = machineList.stream().map(ZyProcessMachine::getCode).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)) {
b.set(false);
@ -447,21 +450,28 @@ public class IZyProductPlanAutoServiceImpl extends ServiceImpl<ZyProductPlanMapp
zyPlanProcessService.saveOrUpdateBatch(zyPlanProcessList);
}
ZyPlanProcess diffMachine(ZyPlanProcess zyPlanProcess, List<String> zyProcessMachineIds, List<Station> stationList) {
for (int j = 0; j < stationList.size(); j++) {
Station station = stationList.get(j);
List<StationMachine> stationMachineList = iStationMachineService.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, station.getId()));
List<String> stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream()
.map(StationMachine::getMachineId).collect(Collectors.toList());
// 设备匹配成功
if (stationMachineIds.containsAll(zyProcessMachineIds)) {
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;
@Autowired
private IZyDeviceService iZyDeviceService;
ZyPlanProcess diffMachine(ZyPlanProcess zyPlanProcess, List<String> zyProcessMachineIds, List<String> zyProcessCodes, List<Station> stationList) {
if (!ObjectUtils.isEmpty(zyProcessCodes) && !ObjectUtils.isEmpty(zyProcessMachineIds)) {
for (int j = 0; j < stationList.size(); j++) {
Station station = stationList.get(j);
List<StationMachine> stationMachineList = iStationMachineService.list(new LambdaQueryWrapper<StationMachine>().eq(StationMachine::getStationId, station.getId()));
//工位设备ids
List<String> stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList());
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(zyProcessCodes)) {
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;

@ -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.zyorders.entity.ZyOrders;
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.service.IZyProductProcessService;
import org.jeecg.modules.productplan.entity.*;
@ -128,7 +130,7 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
private IZyPlanProcessAccessoriesService iZyPlanProcessAccessoriesService;
@Autowired
private IZyProcessFabricService iZyProcessFabricService;
private IZyDeviceService iZyDeviceService;
@Autowired
private IZyProcessAccessoriesService iZyProcessAccessoriesService;
@ -248,8 +250,9 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
* 根据工序查询工序设备表zy_process_machine
*/
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)) {
List<String> machineList1 = machineList.stream().map(ZyProcessMachine::getMachineId).collect(Collectors.toList());
/**
* @param zyPlanProcess 生产计划工序
* @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 -> {
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());
if (machineList2.containsAll(machineList1)) {
String collect = machineList1.stream().collect(Collectors.joining(","));
//工位设备ids
List<String> stationMachineIds = Optional.ofNullable(stationMachineList).orElse(new ArrayList<>()).stream().map(StationMachine::getMachineId).collect(Collectors.toList());
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.setMachineNames(iStationMachineService.convertByMachineIds(machineList1));
zyPlanProcess.setMachineNames(iStationMachineService.convertByMachineIds(stationMachineIds));
zyPlanProcess.setStationId(e.getId());
zyPlanProcess.setStationName(e.getStationName());
zyPlanProcess.setStationNum(e.getStationNum());
@ -373,15 +389,13 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
//第一个没有前导工序
if (i == 0) {
//判断是否有下到工序
if(planProcessList.size()>1)
{
if (planProcessList.size() > 1) {
ZyPlanProcess process1 = planProcessList.get(i);
ZyPlanProcess process2 = planProcessList.get(i + 1);
process1.setPostProcess(process2.getProcessId());
process1.setPostProcessName(process2.getProcessName());
updateList.add(process1);
}else
{
} else {
ZyPlanProcess process1 = planProcessList.get(i);
updateList.add(process1);
}

Loading…
Cancel
Save