Merge remote-tracking branch 'origin/zhc4dev'

zhc4dev
zhc077 2 years ago
commit 7e5b1782fe
  1. 293
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue
  2. 119
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue
  3. 4
      ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue
  4. 6
      ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue
  5. 52
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java
  6. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java
  7. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java
  8. 15
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java
  9. 46
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java

@ -10,36 +10,42 @@
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<!-- <div class="table-operator">-->
<!--&lt;!&ndash; <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>&ndash;&gt;-->
<!-- <a-button type="primary" icon="download" @click="handleExportXls('生产计划工序')">导出</a-button>-->
<!-- &lt;!&ndash; <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"&ndash;&gt;-->
<!-- &lt;!&ndash; @change="handleImportExcel">&ndash;&gt;-->
<!-- &lt;!&ndash; <a-button type="primary" icon="import">导入</a-button>&ndash;&gt;-->
<!-- &lt;!&ndash; </a-upload>&ndash;&gt;-->
<!-- &lt;!&ndash; 高级查询区域 &ndash;&gt;-->
<!-- <j-super-query :fieldList="superFieldList" ref="superQueryModal"-->
<!-- @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>-->
<!-- <a-button style="margin-left: 8px"> 批量操作-->
<!-- <a-icon type="down"/>-->
<!-- </a-button>-->
<!-- </a-dropdown>-->
<!-- </div>-->
<div class="table-operator">
<a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
<a-button type="primary" icon="download" @click="handleExportXls('生产计划工序')">导出</a-button>
<!-- <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl"-->
<!-- @change="handleImportExcel">-->
<!-- <a-button type="primary" icon="import">导入</a-button>-->
<!-- </a-upload>-->
<!-- 高级查询区域 -->
<j-super-query :fieldList="superFieldList" ref="superQueryModal"
@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>
<a-button style="margin-left: 8px"> 批量操作
<a-icon type="down"/>
</a-button>
</a-dropdown>
<!-- <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>
<div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
<i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a
style="font-weight: 600">{{ selectedRowKeys.length }}</a>
<a style="margin-left: 24px" @click="onClearSelected">清空</a>
</div>
<!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">-->
<!-- <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a-->
<!-- style="font-weight: 600">{{ selectedRowKeys.length }}</a>-->
<!-- <a style="margin-left: 24px" @click="onClearSelected">清空</a>-->
<!-- </div>-->
<a-table
ref="table"
@ -54,28 +60,37 @@
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<span slot="stationList" slot-scope="stationList">
<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>
<zy-plan-process-modal ref="modalForm" @ok="modalFormOk"></zy-plan-process-modal>
<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>
@ -85,6 +100,8 @@ import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyPlanProcessModal from './modules/ZyPlanProcessModal2'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default {
name: 'ZyPlanProcessList',
@ -94,7 +111,7 @@ export default {
},
data() {
return {
description: '计划工序制定数据列表',
description: '生产计划工序管理页面',
//
columns: [
{
@ -107,35 +124,57 @@ export default {
return parseInt(index) + 1;
}
},
// {
// title: 'id',
// align: "center",
// dataIndex: 'planId'
// },
{
title: '生产计划id',
title: '工单编号',
align: "center",
dataIndex: 'planId'
dataIndex: 'workOrderId'
},
{
title: '车间名称',
title: '产品id',
align: "center",
dataIndex: 'teamName'
dataIndex: 'productId'
},
{
title: '工单编号',
title: '产品',
align: "center",
dataIndex: 'productCode'
dataIndex: 'productName'
},
{
title: '产品名称',
title: '车间',
align: "center",
dataIndex: 'productCode2'
dataIndex: 'departName'
},
{
title:'工序名称',
align:"center",
dataIndex: 'processId_dictText'
title: '工序',
align: "center",
dataIndex: 'processName'
},
{
title:'序号',
align:"center",
dataIndex: 'number'
title: '工位列表',
align: "center",
dataIndex: 'stationList',
width: 150,
scopedSlots: {customRender: 'stationList'}
},
{
title: '工位工具列表',
align: "center",
dataIndex: 'toolsList',
width: 150,
scopedSlots: {customRender: 'toolsList'}
// scopedSlots: {customRender: this.toolsList}
},
{
title: '工具设备列表',
align: "center",
dataIndex: 'machineList',
width: 150,
scopedSlots: {customRender: 'machineList'}
},
{
title: '操作',
@ -147,16 +186,21 @@ export default {
}
],
url: {
list: "/org.jeecg.modules.productplan/zyPlanProcess/list",
productPlanlist: "/org.jeecg.modules.productplan/zyProductPlan/list",
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",
exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanProcess/exportXls",
importExcelUrl: "org.jeecg.modules.productplan/zyPlanProcess/importExcel",
// deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcess/deleteBatch",
// exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanProcess/exportXls",
// importExcelUrl: "org.jeecg.modules.productplan/zyPlanProcess/importExcel",
},
loadRouteType: false,
planId: "",
dictOptions: {},
superFieldList: [],
toolsList: [],
machineList: [],
}
},
created() {
@ -168,8 +212,88 @@ export default {
},
},
methods: {
initDictConfig() {
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) {
this.planId = this.$route.query.planId;
// this.biaoTi = this.$route.query.styleNames+"";
console.log("*******传递的planId:" + this.planId)
this.loadRouteType = true;
}
},
loadData(arg) {
if (!this.url.list) {
this.$message.error("请设置url.list属性!")
return
}
// 1
if (arg === 1) {
this.ipagination.current = 1;
}
this.loadParameter();
var params = this.getQueryParams();//
this.loading = true;
console.log("----------------the params:", params);
getAction(this.url.list, params).then((res) => {
if (res.success) {
this.dataSource = res.result.records || res.result;
if (res.result.total) {
this.ipagination.total = res.result.total;
} else {
this.ipagination.total = 0;
}
} else {
this.$message.warning(res.message)
}
}).finally(() => {
// this.dataSource.forEach(item => {
// item['stationName'] = this.stationName;
// item['stationNum'] = this.stationNum;
// })
this.loading = false
})
},
getQueryParams() {
//
let sqp = {}
if (this.superQueryParams) {
sqp['superQueryParams'] = encodeURI(this.superQueryParams)
sqp['superQueryMatchType'] = this.superQueryMatchType
}
var param = Object.assign(sqp, this.queryParam, this.isorter, this.filters);
param.field = this.getQueryField();
param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize;
param.planId = this.planId;
return filterObj(param);
},
// initDictConfig() {
// },
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'planId', text: '生产计划id', dictCode: ''})
@ -180,16 +304,17 @@ export default {
fieldList.push({type: 'string', value: 'userIds', text: '成员id列表', dictCode: ''})
this.superFieldList = fieldList
},
jumpPage1(record) {
this.$router.push({
path: '/productplan/ZyProductPlanList',
// query: { //
// 'stationId': record.id,
// 'stationName': record.stationName,
// },
});
},
// jumpPage1(record) {
// this.$router.push({
// // path: '/productplan/ZyProductPlanList',
// path: '/productplan/ZyPlanProcessDataList',
//
// // query: { //
// // 'stationId': record.id,
// // 'stationName': record.stationName,
// // },
// });
// },
// pf(record) {
// this.$router.push({
// path: '/productplan/ZyPlanProcessAddList',
@ -197,17 +322,17 @@ export default {
// }
// });
// getAction("productPlanlist", {id: record.id}).then((res) => {
// if (res.success) {
// this.$router.push({
// path: '/src/views/processassessment/assessmentCourse/ClassOpeningTaskList',
// query: { //
// }
// });
// } else {
// this.$message.error(res.message)
// }
// });
// getAction("productPlanlist", {id: record.id}).then((res) => {
// if (res.success) {
// this.$router.push({
// path: '/src/views/processassessment/assessmentCourse/ClassOpeningTaskList',
// query: { //
// }
// });
// } else {
// this.$message.error(res.message)
// }
// });
// },
}
}

@ -55,16 +55,51 @@
class="j-table-force-nowrap"
@change="handleTableChange">
<!-- <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="processId_dictText" slot-scope="text, record">
<a-popover>
<template slot="content">
<p>{{ text }}</p>
</template>
<a style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;display: inline-block;width: 100px">{{ text }}</a>
</a-popover>
</span>
<span slot="stationId_dictText" slot-scope="text, record">
<a-popover>
<template slot="content">
<p>{{ text }}</p>
</template>
<a style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;display: inline-block;width: 100px">{{ text }}</a>
</a-popover>
</span>
<span slot="toolsIds_dictText" slot-scope="text, record">
<a-popover>
<template slot="content">
<p>{{ text }}</p>
</template>
<a style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;display: inline-block;width: 100px">{{ text }}</a>
</a-popover>
</span>
<span slot="machineIds_dictText" slot-scope="text, record">
<a-popover>
<template slot="content">
<p>{{ text }}</p>
</template>
<a style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;display: inline-block;width: 100px">{{ text }}</a>
</a-popover>
</span>
<span slot="userIds" slot-scope="text, record">
<a-popover>
<template slot="content">
<p>{{ text }}</p>
</template>
<a style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;display: inline-block;width: 100px">{{ text }}</a>
</a-popover>
</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>
@ -108,33 +143,39 @@ export default {
}
},
{
title: '生产计划id',
title: '生产计划',
align: "center",
dataIndex: 'planId'
}, {
title: '工位id',
},
{
title: '工序',
align: "center",
dataIndex: 'stationId'
dataIndex: 'processId_dictText',
scopedSlots: {customRender: 'stationId_dictText'}
},
{
title: '设备id列表',
title: '工位',
align: "center",
dataIndex: 'machineIds'
dataIndex: 'stationId_dictText',
scopedSlots: {customRender: 'stationId_dictText'}
},
{
title: '工具id列表',
title: '设备',
align: "center",
dataIndex: 'toolsIds'
dataIndex: 'machineIds_dictText',
scopedSlots: {customRender: 'machineIds_dictText'}
},
{
title: '工序id列表',
title: '工',
align: "center",
dataIndex: 'processIds'
dataIndex: 'toolsIds_dictText',
scopedSlots: {customRender: 'toolsIds_dictText'}
},
{
title: '成员id列表',
title: '成员',
align: "center",
dataIndex: 'userIds'
dataIndex: 'userIds',
scopedSlots: {customRender: 'userIds'}
},
{
title: '操作',
@ -146,7 +187,8 @@ export default {
}
],
url: {
list: "/org.jeecg.modules.productplan/zyPlanProcess/list",
// list: "/org.jeecg.modules.productplan/zyPlanProcess/list",
list: "/org.jeecg.modules.productplan/zyPlanProcess/list2",
productPlanlist: "/org.jeecg.modules.productplan/zyProductPlan/list",
delete: "/org.jeecg.modules.productplan/zyPlanProcess/delete",
deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcess/deleteBatch",
@ -181,12 +223,11 @@ export default {
},
jumpPage1(record) {
this.$router.push({
path: '/productplan/ZyProductPlanList',
// query: { //
// 'stationId': record.id,
// 'stationName': record.stationName,
// },
path: '/productplan/ZyPlanProcessDataList',
query: { //
'planId': record.planId,
// 'stationName': record.stationName,
},
});
},
// pf(record) {
@ -196,17 +237,17 @@ export default {
// }
// });
// getAction("productPlanlist", {id: record.id}).then((res) => {
// if (res.success) {
// this.$router.push({
// path: '/src/views/processassessment/assessmentCourse/ClassOpeningTaskList',
// query: { //
// }
// });
// } else {
// this.$message.error(res.message)
// }
// });
// getAction("productPlanlist", {id: record.id}).then((res) => {
// if (res.success) {
// this.$router.push({
// path: '/src/views/processassessment/assessmentCourse/ClassOpeningTaskList',
// query: { //
// }
// });
// } else {
// this.$message.error(res.message)
// }
// });
// },
}
}

@ -184,7 +184,7 @@ export default {
{
title: '生产时长',
align: "center",
dataIndex: 'offTime'
dataIndex: 'duration'
},
{
title: '状态',
@ -252,7 +252,7 @@ export default {
fieldList.push({type: 'string', value: 'teamId', text: '班组', dictCode: ''})
fieldList.push({type: 'string', value: 'teamLeader', text: '组长', dictCode: ''})
fieldList.push({type: 'date', value: 'workTime', text: '生产开始时间'})
fieldList.push({type: 'int', value: 'offTime', text: '生产时长', dictCode: ''})
fieldList.push({type: 'int', value: 'duration', text: '生产时长', dictCode: ''})
fieldList.push({type: 'int', value: 'status', text: '状态', dictCode: ''})
fieldList.push({type: 'int', value: 'speedUp', text: '是否加急', dictCode: ''})
fieldList.push({type: 'string', value: 'auditBy', text: '审核人', dictCode: ''})

@ -57,8 +57,8 @@
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="生产时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="offTime">
<a-input-number v-model="model.offTime" placeholder="请输入生产时长" style="width: 100%"/>
<a-form-model-item label="生产时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="duration">
<a-input-number v-model="model.duration" placeholder="请输入生产时长" style="width: 100%"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
@ -134,7 +134,7 @@ export default {
// status: [
// {required: true,message: ""},
// ],
offTime: [
duration: [
{required: true, message: "生产时长不能不空"},
{pattern: /^[0-9]{0,100}$/, message: '生产时间不能为空且长度为正整数'}
],

@ -3,6 +3,7 @@ package org.jeecg.modules.productplan.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.PageList;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -15,6 +16,7 @@ import org.jeecg.modules.productplan.entity.ZyPlanProcess;
import org.jeecg.modules.productplan.entity.vo.ProcessDataVo;
import org.jeecg.modules.productplan.service.IZyPlanProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
@ -47,7 +49,7 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
* @param req
* @return
*/
@AutoLog(value = "生产计划工序-分页列表查询")
// @AutoLog(value = "生产计划工序-分页列表查询")
@ApiOperation(value = "生产计划工序-分页列表查询", notes = "生产计划工序-分页列表查询")
@GetMapping(value = "/list")
public Result<?> queryPageList(ZyPlanProcess zyPlanProcess,
@ -60,17 +62,53 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
return Result.OK(pageList);
}
// @AutoLog(value = "生产计划工序-分页列表查询")
@ApiOperation(value = "生产计划工序-分页列表查询", notes = "生产计划工序-分页列表查询")
@GetMapping(value = "/list2")
public Result<?> queryPageList2(ZyPlanProcess zyPlanProcess,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyPlanProcess> queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap());
Page<ZyPlanProcess> page = new Page<ZyPlanProcess>(pageNo, pageSize);
IPage<ZyPlanProcess> pageList = zyPlanProcessService.page(page, queryWrapper);
if (!ObjectUtils.isEmpty(pageList)) {
String processIdList = "";
String stationIdList = "";
String machineIdList = "";
String toolsIdList = "";
String userIdList = "";
List<ZyPlanProcess> records = pageList.getRecords();
for (ZyPlanProcess e : records) {
processIdList += e.getProcessId();
stationIdList += e.getStationId();
machineIdList += e.getMachineIds();
toolsIdList += e.getToolsIds();
userIdList += e.getUserIds();
}
for (ZyPlanProcess e : records) {
e.setProcessId(processIdList);
e.setStationId(stationIdList);
e.setMachineIds(machineIdList);
e.setToolsIds(toolsIdList);
e.setUserIds(userIdList);
}
}
return Result.OK(pageList);
}
@ApiOperation(value = "生产计划工序-查询产品工序&计划", notes = "生产计划工序-查询产品工序&计划")
@GetMapping(value = "/getProcessDatalist")
public Result<?> getProcessDatalist(ZyPlanProcess zyPlanProcess,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<ZyPlanProcess> queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap());
Page<ZyPlanProcess> page = new Page<ZyPlanProcess>(pageNo, pageSize);
// IPage<ZyPlanProcess> pageList = zyPlanProcessService.getProcessDatalist(page, queryWrapper);
List<ProcessDataVo> pageList = zyPlanProcessService.getProcessDatalist(zyPlanProcess);
return Result.OK(pageList);
List<ProcessDataVo> processDatalist = zyPlanProcessService.getProcessDatalist(zyPlanProcess);
PageList<ProcessDataVo> processDataVos = new PageList<>(processDatalist, processDatalist.size());
return Result.OK(processDatalist);
}
/**

@ -10,6 +10,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
@ -66,34 +67,39 @@ public class ZyPlanProcess implements Serializable {
@Excel(name = "生产计划id", width = 15)
@ApiModelProperty(value = "生产计划id")
private String planId;
/**
* 工序id列表
*/
@Excel(name = "工序id", width = 15)
@ApiModelProperty(value = "工序id列表")
@Dict(dictTable = "zy_process",dicText = "process_name",dicCode = "id")
private String processId;
/**
* 工位id
*/
@Excel(name = "工位id", width = 15)
@ApiModelProperty(value = "工位id")
@Dict(dictTable = "station",dicText = "station_name",dicCode = "id")
private String stationId;
/**
* 设备id列表
*/
@Excel(name = "设备id列表", width = 15)
@ApiModelProperty(value = "设备id列表")
@Dict(dictTable = "zy_devicetype", dicText = "name", dicCode = "id")
private String machineIds;
/**
* 工具id列表
*/
@Excel(name = "工具id列表", width = 15)
@ApiModelProperty(value = "工具id列表")
@Dict(dictTable = "zy_tool", dicText = "name", dicCode = "id")
private String toolsIds;
/**
* 工序id列表
*/
@Excel(name = "工序id列表", width = 15)
@ApiModelProperty(value = "工序id列表")
private String processIds;
/**
* 成员id列表
*/
@Excel(name = "成员id列表", width = 15)
@ApiModelProperty(value = "成员id列表")
// @Dict(dictTable = "sys_user", dicText = "name", dicCode = "id")
private String userIds;
}

@ -103,7 +103,7 @@ public class ZyProductPlan implements Serializable {
*/
@Excel(name = "生产时长", width = 15)
@ApiModelProperty(value = "生产时长")
private Integer offTime;
private Integer duration;
/**
* 未审核0已审核1生产中2已完成3已撤销8异常9默认0
*/

@ -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,12 +14,16 @@ 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;
import java.util.List;
import java.util.Optional;
@ -38,27 +44,43 @@ 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();
// TODO zy_product产品表,根据工单id获取产品id,
List<ProcessDataVo> result = new LinkedList<>();
//根据产品id获取产品工序列表
List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>().eq(ZyProductProcess::getProductId, "产品id"));
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)));
});
return null;
// List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>().eq(ZyProductProcess::getProductId, "产品id"));
List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>().eq(ZyProductProcess::getProductId, "1"));
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