喻忠伟 2 years ago
commit 5aaa7cbc21
  1. 18
      ant-design-vue-jeecg/src/views/hanger/HangerList.vue
  2. 4
      ant-design-vue-jeecg/src/views/jeecg/SelectDemo.vue
  3. 110
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue
  4. 149
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue
  5. 234
      ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue
  6. 81
      ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue
  7. 18
      ant-design-vue-jeecg/src/views/team/modules/GroupxModal.vue
  8. 35
      ant-design-vue-jeecg/src/views/team/modules/StationModal.vue
  9. 24
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java
  10. 28
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java
  11. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java
  12. 10
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java
  13. 31
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/PaiWeiTuVo.java
  14. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java
  15. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java
  16. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyProductPlanService.java
  17. 108
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java
  18. 94
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyProductPlanServiceImpl.java
  19. 30
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationServiceImpl.java
  20. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/entity/ZyProduct.java

@ -9,16 +9,16 @@
<a-input placeholder="请输入衣架编号" v-model="queryParam.hangerCode"></a-input>
</a-form-item>
</a-col>
<!-- <a-col :xl="6" :lg="7" :md="8" :sm="24">-->
<!-- <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">-->
<!-- <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>-->
<!-- <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>-->
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<!-- <a @click="handleToggleSearch" style="margin-left: 8px">-->
<!-- {{ toggleSearchStatus ? '收起' : '展开' }}-->
<!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
<!-- </a>-->
<!-- </span>-->
<!-- </a-col>-->
<!-- {{ toggleSearchStatus ? '收起' : '展开' }}-->
<!-- <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>-->
<!-- </a>-->
</span>
</a-col>
</a-row>
</a-form>
</div>

@ -110,7 +110,9 @@
<a-row :gutter="24">
<a-col :span="12">
<a-form-model-item label="选择用户" prop="userIds">
<j-select-user-by-dep v-model="formData.userIds" :multi="true"></j-select-user-by-dep>
<j-select-user-by-dep v-model="formData.userIds" :multi="true"
value="id,realname">
</j-select-user-by-dep>
</a-form-model-item>
</a-col>
<a-col :span="12">选中的用户(v-model):{{ formData.userIds }}</a-col>

@ -1,10 +1,10 @@
<template>
<a-card :bordered="false">
<div class="table-operator">
<a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>
<!-- <a-button type="primary" @click="handleTableSave($event)">保存</a-button>-->
<a-button type="primary" @click="fanHui()">返回</a-button>
</div>
<!-- <div class="table-operator">-->
<!-- <a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>-->
<!-- &lt;!&ndash; <a-button type="primary" @click="handleTableSave($event)">保存</a-button>&ndash;&gt;-->
<!-- <a-button type="primary" @click="fanHui()">返回</a-button>-->
<!-- </div>-->
<!-- table区域-begin -->
<div>
@ -23,7 +23,12 @@
:dataSource="dataSource"
@valueChange="handleValueChange"
@save="handleTableSave"
/>
>
<template v-slot:toolbarSuffix>
<a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>
<a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>
</template>
</j-vxe-table>
</div>
</a-card>
</template>
@ -44,7 +49,7 @@ export default {
return {
toolbarConfig: {
// add remove clearSelection
btn: ['save']
btn: ['save',]
},
description: '生产计划工序管理页面',
loading: false,
@ -65,69 +70,76 @@ export default {
dataSource: [],
// columns,
columns: [
{key: 'workOrderId', title: '工单编号', width: '180px'},
{key: 'productName', title: '产品名称', width: '180px'},
{key: 'departName', title: '车间名称', width: '180px'},
{key: 'processName', title: '工序名称', width: '180px'},
{key: 'workOrderId', title: '工单编号', width: '200px'},
// {key: 'productName', title: '', width: '120px'},
{key: 'departName', title: '车间名称', width: '120px'},
{key: 'processName', title: '工序名称', width: '120px'},
{
title: '工位列表',
title: '工位ID',
key: 'stationId',
type: JVXETypes.hidden,
// width: '200px',
// options: [],
// placeholder: '${title}',
},{
title: '工位名称',
key: 'stationName',
type: JVXETypes.select,
width: '200px',
options: [],
placeholder: '请选择${title}',
},
{
title: 'stationIds',
key: 'stationIds',
type: JVXETypes.hidden,
},
{
title: '设备列表',
key: 'machineIds',
key: 'machineNames',
type: JVXETypes.selectMultiple,
width: '200px',
options: [],
placeholder: '请选择${title}',
}, {
title: '工具列表',
},
{
title: 'toodsIds',
key: 'toolsIds',
type: JVXETypes.hidden,
},
{
title: '工具列表',
key: 'toolsIdNames',
type: JVXETypes.selectMultiple,
width: '200px',
options: [],
placeholder: '请选择${title}',
},
// {
// title: 'JPopup',
// key: 'popup',
// type: JVXETypes.popup,
// width: '180px',
// popupCode: 'demo',
// field: 'name,sex,age',
// orgFields: 'name,sex,age',
// destFields: 'popup,popup_sex,popup_age'
// },
{key: 'proProcess', type: JVXETypes.hidden, title: '前导工序ID', width: '120px'},
{
title: '前导工序',
key: 'proProcess',
key: 'proProcessName',
type: JVXETypes.popup,
width: '180px',
popupCode: 'zy_process',
field: 'id,process_code,process_name,process_describe',
orgFields: 'id,process_code,process_name,process_describe',
destFields: 'proProcess,process_code,process_name,process_describe',
// orgFields: 'id,process_code,process_name,process_describe',
// destFields: 'proProcessName,process_code,process_name,process_describe',
orgFields: 'process_name,id',
destFields: 'proProcessName,proProcess',
},
// {
// key: 'proProcess',
// title: '',
// dictCode: 'zy_process,process_name,id,id in(select process_id from zy_product_process where product_id="1")',
// width: '150',
// type: JVXETypes.select
// },
{key: 'postProcess', type: JVXETypes.hidden, title: '后导工序ID', width: '120px'},
{
title: '后导工序',
key: 'postProcess',
key: 'postProcessName',
type: JVXETypes.popup,
width: '180px',
popupCode: 'zy_process',
field: 'id,process_code,process_name,process_describe',
orgFields: 'id,process_code,process_name,process_describe',
destFields: 'postProcess,process_code,process_name,process_describe',
// orgFields: 'id,process_code,process_name,process_describe',
// destFields: 'proProcessName,process_code,process_name,process_describe',
orgFields: 'process_name,id',
destFields: 'postProcessName,postProcess',
},
{key: 'inputProduct', title: '输入产品', width: '150', type: JVXETypes.input},
{key: 'semiProduct', title: '成品/半成品', width: '150', type: JVXETypes.input},
@ -142,6 +154,7 @@ export default {
planId: "",
dictOptions: {},
superFieldList: [],
stationId: [],
stationList: [],
toolsList: [],
machineList: [],
@ -154,24 +167,14 @@ export default {
//
handleTableSave({$table, target}) {
console.log("保存开始-----")
console.log("生产计划工序保存开始-----------------")
//
$table.validate().then((errMap) => {
//
if (!errMap) {
//
let tableData = target.getTableData()
tableData.forEach(item => {
item.id = '';
})
console.log('当前保存的数据是:', tableData)
// //
// let newData = target.getNewData()
// console.log('-- ', newData)
// //
// let deleteData = target.getDeleteData()
// console.log('-- ', deleteData)
//
this.loading = true
postAction(this.url.addProcessBatch, tableData).then(res => {
@ -219,6 +222,7 @@ export default {
getAction(this.url.list, params).then((res) => {
if (res.success) {
this.dataSource = res.result.records || res.result;
// this.stationId = this.dataSource[0].stationId;
this.stationList = this.dataSource[0].stationList;
} else {
// this.stationIdCode = "station,station_name,id,depart_id in (select workshop_id from zy_product_plan where id='" + this.planId + "')";
@ -248,15 +252,9 @@ export default {
console.log("handleSelectRowChange")
console.log("handleSelectRowChange-event:", event)
const {type, row, column, value, target, $table} = event
console.log(JSON.stringify(this.stationList));
console.log(JSON.stringify(this.stationIdList));
// target.$refs.vxe.columns[6].dictCode = this.stationIdCode;
target.$refs.vxe.columns[6].options = this.stationList;
//
// target.setValues([{
// rowKey: row.id,
// values: {machineIds: '', toolsIds: ''}
// }])
// target.$refs.vxe.columns[4].options = []
},
/** 当选项被改变时,联动其他组件 */
handleValueChange(event) {

@ -63,41 +63,41 @@
<!-- <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="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="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="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="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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
@ -143,59 +143,14 @@ export default {
}
},
{
title: '生产计划',
align: "center",
dataIndex: 'planId'
},
{
title: '工序',
align: "center",
dataIndex: 'processId_dictText',
// scopedSlots: {customRender: 'processId_dictText'}
},
{
title: '工位',
align: "center",
dataIndex: 'stationId_dictText',
scopedSlots: {customRender: 'stationId_dictText'}
},
{
title: '设备',
title: '工单编号',
align: "center",
dataIndex: 'machineIds_dictText',
scopedSlots: {customRender: 'machineIds_dictText'}
dataIndex: 'productCode'
},
{
title: '工具',
title: '生产计划',
align: "center",
dataIndex: 'toolsIds_dictText',
scopedSlots: {customRender: 'toolsIds_dictText'}
},
// {
// title: '',
// align: "center",
// dataIndex: 'userIds_dictText',
// scopedSlots: {customRender: 'userIds_dictText'}
// },
{
title:'前导工序',
align:"center",
dataIndex: 'proProcess_dictText'
},
{
title:'后导工序',
align:"center",
dataIndex: 'postProcess_dictText'
},
{
title:'输入产品',
align:"center",
dataIndex: 'inputProduct'
},
{
title:'成品/半成品',
align:"center",
dataIndex: 'semiProduct'
dataIndex: 'id'
},
{
title: '操作',
@ -207,8 +162,8 @@ export default {
}
],
url: {
list: "/org.jeecg.modules.productplan/zyPlanProcess/list",
// list: "/org.jeecg.modules.productplan/zyPlanProcess/list2",
// list: "/org.jeecg.modules.productplan/zyPlanProcess/list",
list: "/org.jeecg.modules.productplan/zyProductPlan/list",
productPlanlist: "/org.jeecg.modules.productplan/zyProductPlan/list",
delete: "/org.jeecg.modules.productplan/zyPlanProcess/delete",
deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcess/deleteBatch",
@ -221,32 +176,19 @@ export default {
}
},
created() {
this.getSuperFieldList();
// this.getSuperFieldList();
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
// importExcelUrl: function () {
// return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
// },
},
methods: {
initDictConfig() {
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'planId', text: '生产计划id', dictCode: ''})
fieldList.push({type: 'string', value: 'stationId', text: '工位id', dictCode: ''})
fieldList.push({type: 'string', value: 'machineIds', text: '设备id列表', dictCode: ''})
fieldList.push({type: 'string', value: 'toolsIds', text: '工具id列表', dictCode: ''})
fieldList.push({type: 'string', value: 'processIds', text: '工序id列表', dictCode: ''})
fieldList.push({type: 'string', value: 'userIds', text: '成员id列表', dictCode: ''})
this.superFieldList = fieldList
},
jumpPage1(record) {
this.$router.push({
path: '/productplan/ZyPlanProcessDataList',
query: { //
'planId': record.planId,
// 'stationName': record.stationName,
'planId': record.id,
},
});
},
@ -271,7 +213,4 @@ export default {
// },
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>
</script>

@ -1,9 +1,80 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="工单编号">
<a-input placeholder="请输入工单编号" v-model="queryParam.productCode"></a-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="车间名称">
<j-select-depart placeholder="请选择车间" v-model="queryParam.departId"/>
<!-- <j-dict-select-tag type="list" v-model="queryParam.workshopId"-->
<!-- dictCode="sys_depart,depart_name,id,org_category='2'"/>-->
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="车间负责人">
<j-select-multi-user
v-model="queryParam.responsiblePerson"
:multiple="false"
placeholder="请选择车间负责人"
/>
<!-- <j-select-user-by-dep v-model="queryParam.responsiblePerson" :multi="false"-->
<!-- :back-user="true"-->
<!-- >-->
<!-- </j-select-user-by-dep>-->
<!-- <j-select-user-by-dep placeholder="请输入车间负责人" v-model="queryParam.responsiblePerson"/>-->
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="班组名称">
<!-- <a-input placeholder="请输入班组名称" v-model="queryParam.teamId"></a-input>-->
<j-dict-select-tag type="list" v-model="queryParam.teamId" dict-code="groupx,group_name,id"
placeholder="请输入班组名称"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<!-- <a-input placeholder="请输入班组长" v-model="queryParam.teamLeader"></a-input>-->
<a-form-item label="班组长">
<j-select-multi-user
v-model="queryParam.teamLeader"
:multiple="false"
placeholder="请选择班组长"
/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="生产开始时间">
<!-- <a-date-picker valueFormat="YYYY-MM-DD" v-model="model.birthday"/>-->
<a-date-picker placeholder="请选生产开始时间" valueFormat="YYYY-MM-DD HH:mm:ss"
v-model="queryParam.workTime" style="width: 100%"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="生产状态">
<j-dict-select-tag type="list" v-model="queryParam.status" dictCode="productplanStatus"
placeholder="请选择状态"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<a-form-item label="是否加急">
<!-- <j-dict-select-tag type="radio" v-model="queryParam.speedUp" dictCode="sfjj" placeholder="请选择是否加急"/>-->
<j-dict-select-tag type="list" v-model="queryParam.speedUp" dictCode="sfjj"
placeholder="请选择是否加急"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
<a-button type="primary" @click="searchReset" icon="reload"
style="margin-left: 8px">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
@ -13,23 +84,6 @@
<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>
</div>
<!-- table区域-begin -->
@ -54,46 +108,14 @@
class="j-table-force-nowrap"
@change="handleTableChange">
<template slot="htmlSlot" slot-scope="text">
<div v-html="text"></div>
</template>
<template slot="imgSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无图片</span>
<img v-else :src="getImgView(text)" height="25px" alt=""
style="max-width:80px;font-size: 12px;font-style: italic;"/>
</template>
<template slot="fileSlot" slot-scope="text">
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
<a-button
v-else
:ghost="true"
type="primary"
icon="download"
size="small"
@click="downloadFile(text)">
下载
</a-button>
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a-divider type="vertical"/>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<!-- <a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>-->
<a-divider type="vertical"/>
<a @click="getPaiWeiTu(record)">生产计划排位图</a>
</span>
</a-table>
@ -109,6 +131,8 @@ import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyProductPlanModal from './modules/ZyProductPlanModal'
import {getAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default {
name: 'ZyProductPlanList',
@ -136,11 +160,20 @@ export default {
align: "center",
dataIndex: 'productCode'
},
// {
// title: '',
// align: "center",
// dataIndex: 'workshopId'
// },
{
title: '产品编号',
align: "center",
dataIndex: 'productNo'
}, {
title: '产品名称',
align: "center",
dataIndex: 'productName'
},
{
title: '生产企业',
align: "center",
dataIndex: 'productOrg'
},
{
title: '车间名称',
align: "center",
@ -164,11 +197,11 @@ export default {
{
title: '组长',
align: "center",
dataIndex: 'teamLeader'
dataIndex: 'teamLeader_dictText'
},
{
title: '生产开始时间',
width:150,
width: 150,
align: "center",
dataIndex: 'workTime',
// customRender: function (text) {
@ -205,7 +238,7 @@ export default {
},
{
title: '审核时间',
width:150,
width: 150,
align: "center",
dataIndex: 'auditTimr',
// customRender: function (text) {
@ -223,6 +256,7 @@ export default {
],
url: {
list: "/org.jeecg.modules.productplan/zyProductPlan/list",
paiweitu: "/org.jeecg.modules.productplan/zyProductPlan/paiweitu",
delete: "/org.jeecg.modules.productplan/zyProductPlan/delete",
deleteBatch: "/org.jeecg.modules.productplan/zyProductPlan/deleteBatch",
exportXlsUrl: "/org.jeecg.modules.productplan/zyProductPlan/exportXls",
@ -234,7 +268,7 @@ export default {
}
},
created() {
this.getSuperFieldList();
// this.getSuperFieldList();
},
computed: {
// importExcelUrl: function(){
@ -242,23 +276,71 @@ export default {
// },
},
methods: {
initDictConfig() {
getPaiWeiTu(record) {
// alert(JSON.stringify(record));
getAction(this.url.paiweitu, record).then((res) => {
if (res.success) {
// this.dataSource = res.result.records || res.result;
console.log("the paiweitu----------" + JSON.stringify(res.result))
} else {
this.$message.warning(res.message)
}
}).finally(() => {
// this.dataSource.forEach(item => {
// item['stationName'] = this.stationName;
// item['stationNum'] = this.stationNum;
// })
this.loading = false
})
},
getSuperFieldList() {
let fieldList = [];
fieldList.push({type: 'string', value: 'productCode', text: '工单编号', dictCode: ''})
fieldList.push({type: 'string', value: 'workshopId', text: '车间id', dictCode: ''})
fieldList.push({type: 'string', value: 'responsiblePerson', text: '车间负责人', dictCode: ''})
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: '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: ''})
fieldList.push({type: 'date', value: 'auditTimr', text: '审核时间'})
this.superFieldList = fieldList
}
// 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);
// },
}
}
</script>

@ -29,8 +29,11 @@
prop="responsiblePerson">
<!-- <j-select-multi-user placeholder="请选择车间负责人"-->
<!-- v-model="model.responsiblePerson"></j-select-multi-user>-->
<j-select-multi-user placeholder="请选择车间负责人" v-model="model.responsiblePerson"
:multiple="false"></j-select-multi-user>
<!-- <j-select-multi-user placeholder="请选择车间负责人" v-model="model.responsiblePerson"-->
<!-- :multiple="false"></j-select-multi-user>-->
<j-dict-select-tag type="list" v-model="model.responsiblePerson"
placeholder="请选择车间负责人" :disabled="model.workshopId==null"/>
</a-form-model-item>
</a-col>
@ -53,11 +56,12 @@
<a-col :span="24">
<a-form-model-item label="生产开始时间" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="workTime">
<!-- <j-date placeholder="请选择生产开始时间" v-model="model.workTime" style="width: 100%"/>-->
<a-date-picker placeholder="请选择生产开始时间" showTime valueFormat='YYYY-MM-DD HH:mm:ss' v-model="model.workTime" style="width: 100%"/>
<a-date-picker placeholder="请选择生产开始时间" showTime valueFormat='YYYY-MM-DD HH:mm:ss'
v-model="model.workTime" style="width: 100%"/>
</a-form-model-item>
</a-col>
<a-col :span="24">
<a-form-model-item label="生产时长" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="duration">
<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>
@ -110,8 +114,14 @@ export default {
data() {
return {
groupxVal: "groupx,group_name,id",
groupxVal2: "groupx,enterprises_manager,id",
model: {},
groupxVal2: "sys_user,realname,id",
model: {
workTime: new Date(),
status:0,
auditBy:66,
auditTimr: new Date(),
speedUp:0,
},
labelCol: {
xs: {span: 24},
sm: {span: 5},
@ -126,7 +136,7 @@ export default {
{required: true, message: "工单不能为空"},
],
workshopId: [
{required: true, message: "工单不能为空"},
{required: true, message: "车间不能为空"},
],
teamId: [
{required: true, message: "班组不能为空"},
@ -140,6 +150,7 @@ export default {
],
},
url: {
groupxList: "/groupx/list",
add: "/org.jeecg.modules.productplan/zyProductPlan/add",
edit: "/org.jeecg.modules.productplan/zyProductPlan/edit",
queryById: "/org.jeecg.modules.productplan/zyProductPlan/queryById"
@ -154,16 +165,31 @@ export default {
created() {
//model
this.modelDefault = JSON.parse(JSON.stringify(this.model));
// console.log(this.getNowDate())
// this.getNowDate(); //
},
methods: {
departSelected() {
let that = this;
let param = {
"id": that.model.workshopId,
}
// alert(param.toString());
getAction(that.url.groupxList, param).then((res) => {
if (res.success) {
// console.log("----------" + JSON.stringify(res.result.records))
let phone = JSON.stringify(res.result.records[0].enterprisesNanager);
that.model = Object.assign(that.model, {'mobile': phone});
this.$forceUpdate();
}
});
},
getGroupxValChange() {
// alert("" + this.model.workshopId);
// this.basicInfoCode = "py_basic_info,chart_head,id, major_id='" + this.queryParam.majorId + "'";
this.groupxVal = "groupx,group_name,id,depart_id='" + this.model.workshopId + "'";
// this.groupxVal2 = "groupx,enterprises_manager,enterprises_manager,depart_id='" + this.model.workshopId + "'";
this.departSelected();
},
getEnterprisesManagerValChange() {
this.groupxVal2 = "groupx,enterprises_manager,enterprises_manager,id='" + this.model.teamId + "'";
this.groupxVal2 = "sys_user,realname,id,id=(select enterprises_manager from groupx where id='" + this.model.teamId + "')";
},
add() {
this.edit(this.modelDefault);
@ -201,6 +227,37 @@ export default {
})
},
}
getNowDate() {
var date = new Date();
var sign2 = ":";
var year = date.getFullYear() //
var month = date.getMonth() + 1; //
var day = date.getDate(); //
var hour = date.getHours(); //
var minutes = date.getMinutes(); //
var seconds = date.getSeconds() //
var weekArr = ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六', '星期天'];
var week = weekArr[date.getDay()];
// 0
if (month >= 1 && month <= 9) {
month = "0" + month;
}
if (day >= 0 && day <= 9) {
day = "0" + day;
}
if (hour >= 0 && hour <= 9) {
hour = "0" + hour;
}
if (minutes >= 0 && minutes <= 9) {
minutes = "0" + minutes;
}
if (seconds >= 0 && seconds <= 9) {
seconds = "0" + seconds;
}
this.model.workTime = year + "-" + month + "-" + day + " " + hour + sign2 + minutes + sign2 + seconds;
},
},
}
</script>

@ -11,13 +11,22 @@
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departId" label="部门">
<!-- <a-input placeholder="请输入部门编号" v-model="model.departId"/>-->
<!-- <j-select-depart placeholder="请选择部门" v-model="model.departId"/>-->
<j-dict-select-tag type="list" v-model="model.departId" dictCode="sys_depart,depart_name,id,org_category='2'"
@change="getEnterprisesManagerValChange()"
placeholder="请选择部门"/>
<!-- <j-dict-select-tag type="list" v-model="model.departId" dictCode="sys_depart,depart_name,id,org_category='2'"-->
<!-- @change="getEnterprisesManagerValChange()"-->
<!-- placeholder="请选择部门"/>-->
<j-tree-select v-model="model.departId"
dict="sys_depart,depart_name,id"
pidField="parent_id"
placeholder="请选择车间"
condition='{"org_category":"2"}'
hasChildField="1"
@change="getEnterprisesManagerValChange()"
>
</j-tree-select>
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="groupName" label="班组名称">
@ -117,6 +126,7 @@ export default {
methods: {
getEnterprisesManagerValChange() {
console.log("the departId=", this.model.departId)
this.enterprisesManager = "sys_user,realname,id,id in (select user_id from sys_user_depart where dep_id='" + this.model.departId + "')";
// this.enterprisesManager = "zy_process,process_name,id,id in(select process_id from zy_product_process where product_id='1')";
},

@ -12,14 +12,19 @@
<a-spin :spinning="confirmLoading">
<a-form-model ref="form" :model="model" :rules="validatorRules">
<!-- <a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departId"-->
<!-- label="车间ID">-->
<!-- <a-input placeholder="请输入车间ID" v-model="model.departId"/>-->
<!-- </a-form-model-item>-->
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="departId" label="车间名称">
<!-- <a-input placeholder="请输入部门编号" v-model="model.departId"/>-->
<!-- <j-select-depart placeholder="请选择车间" v-model="model.departId"/>-->
<j-dict-select-tag type="list" v-model="model.departId" dictCode="sys_depart,depart_name,id,org_category='2'" placeholder="请选择车间" />
<!-- <j-dict-select-tag type="list" v-model="model.departId" dictCode="sys_depart,depart_name,id,org_category='2'" placeholder="请选择车间" />-->
<j-tree-select v-model="model.departId"
dict="sys_depart,depart_name,id"
pidField="parent_id"
placeholder="请选择车间"
condition='{"org_category":"2"}'
hasChildField="1"
>
</j-tree-select>
</a-form-model-item>
<a-form-model-item :labelCol="labelCol" :wrapperCol="wrapperCol" prop="stationName" label="工位名称">
<a-input placeholder="请输入工位名称" v-model="model.stationName"/>
@ -37,7 +42,7 @@
</template>
<script>
import {httpAction} from '@/api/manage'
import {getAction, httpAction} from '@/api/manage'
import moment from "moment"
export default {
@ -79,6 +84,20 @@ export default {
created() {
},
methods: {
async bianhao() {
//var n=6
getAction(this.url.sort, {id: this.model.clothsTypeId}).then((res) => {
//let num = res.result;
console.log("+6++++aaa: " + res.result)
//num=num.toString()
//while(num.length<n){
//num="0"+num
//}
//console.log(num)
this.model.nums = res.result;
})
},
add() {
//
this.edit({});

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.exception.JeecgBootException;
@ -18,6 +19,8 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.productplan.entity.ZyPlanProcess;
import org.jeecg.modules.productplan.entity.vo.ProcessDataVo;
import org.jeecg.modules.productplan.service.IZyPlanProcessService;
import org.jeecg.modules.team.entity.Station;
import org.jeecg.modules.team.service.IStationService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
@ -44,6 +47,9 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
@Autowired
private IZyPlanProcessService zyPlanProcessService;
@Autowired
private IStationService iStationService;
/**
* 分页列表查询
*
@ -109,8 +115,9 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
HttpServletRequest req) {
QueryWrapper<ZyPlanProcess> queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap());
Page<ZyPlanProcess> page = new Page<ZyPlanProcess>(pageNo, pageSize);
List<ProcessDataVo> processDatalist = zyPlanProcessService.getProcessDatalist(zyPlanProcess);
PageList<ProcessDataVo> processDataVos = new PageList<>(processDatalist, processDatalist.size());
// List<ProcessDataVo> processDatalist = zyPlanProcessService.getProcessDatalist(zyPlanProcess);
List<ZyPlanProcess> processDatalist = zyPlanProcessService.getProcessDatalist(zyPlanProcess);
// PageList<ProcessDataVo> processDataVos = new PageList<>(processDatalist, processDatalist.size());
return Result.OK(processDatalist);
}
@ -156,14 +163,17 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
return Result.OK("添加成功!");
}
@ApiOperation(value = "计划工序管理-批量添加工序、工位、设备", notes = "计划工序管理-批量添加工序、工位、设备")
@ApiOperation(value = "计划工序管理-批量更新工序、工位、设备", notes = "计划工序管理-批量更新工序、工位、设备")
@PostMapping(value = "/addProcessBatch")
public Result<?> addProcessBatch(@RequestBody List<ZyPlanProcess> zyPlanProcessList) {
if (!ObjectUtils.isEmpty(zyPlanProcessList)) {
zyPlanProcessService.remove(new LambdaQueryWrapper<ZyPlanProcess>()
.eq(ZyPlanProcess::getPlanId, zyPlanProcessList.get(0).getPlanId()));
zyPlanProcessService.saveBatch(zyPlanProcessList);
// zyPlanProcessService.remove(new LambdaQueryWrapper<ZyPlanProcess>()
// .eq(ZyPlanProcess::getPlanId, zyPlanProcessList.get(0).getPlanId()));
zyPlanProcessList.forEach(e -> {
Station station = iStationService.getById(e.getStationId());
e.setStationName(StringUtils.isNotBlank(station.getStationName()) ? station.getStationName() : "");
});
zyPlanProcessService.saveOrUpdateBatch(zyPlanProcessList);
}
return Result.OK("添加成功!");
}

@ -1,22 +1,30 @@
package org.jeecg.modules.productplan.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.productplan.entity.ZyProductPlan;
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo;
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.workproduct.entity.ZyProduct;
import org.jeecg.modules.workproduct.service.IZyProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.jws.Oneway;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
@ -35,6 +43,11 @@ public class ZyProductPlanController extends JeecgController<ZyProductPlan, IZyP
@Autowired
private IZyProductPlanService zyProductPlanService;
@Autowired
private IZyProductService iZyProductService;
@Autowired
private ISysDepartService iSysDepartService;
/**
* 分页列表查询
*
@ -57,6 +70,13 @@ public class ZyProductPlanController extends JeecgController<ZyProductPlan, IZyP
return Result.OK(pageList);
}
@ApiOperation(value = "生产计划-排位图", notes = "生产计划-排位图")
@GetMapping(value = "/paiweitu")
public Result<?> getPaiweitu(ZyProductPlan zyProductPlan, HttpServletRequest request) {
PaiWeiTuVo paiweitu = zyProductPlanService.paiweitu(zyProductPlan);
return Result.OK(paiweitu);
}
/**
* 添加
*
@ -67,6 +87,14 @@ public class ZyProductPlanController extends JeecgController<ZyProductPlan, IZyP
@ApiOperation(value = "生产计划-添加", notes = "生产计划-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody ZyProductPlan zyProductPlan) {
String productCode = zyProductPlan.getProductCode();
ZyProduct zyProduct = iZyProductService.getOne(new LambdaQueryWrapper<ZyProduct>().eq(ZyProduct::getWorkOrderId, productCode));
zyProductPlan.setProductNo(StringUtils.isNotBlank(zyProduct.getProductCode()) ? zyProduct.getProductCode() : "");
zyProductPlan.setProductName(StringUtils.isNotBlank(zyProduct.getProductName()) ? zyProduct.getProductName() : "");
if (StringUtils.isNotBlank(zyProduct.getEnterprisesId())) {
SysDepart sysDepart = iSysDepartService.getById(zyProduct.getEnterprisesId());
zyProductPlan.setProductOrg(StringUtils.isNotBlank(sysDepart.getDepartName()) ? sysDepart.getDepartName() : "");
}
zyProductPlanService.save(zyProductPlan);
//TODO 更新work_order表work_order_status为“1” (不能为其新增生产计划)
return Result.OK("添加成功!");

@ -2,6 +2,7 @@ package org.jeecg.modules.productplan.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
@ -11,11 +12,14 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.modules.team.vo.StationVo;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @Description: 生产计划工序
@ -81,6 +85,12 @@ public class ZyPlanProcess implements Serializable {
@ApiModelProperty(value = "工位id")
@Dict(dictTable = "station", dicText = "station_name", dicCode = "id")
private String stationId;
@ApiModelProperty(value = "工序名称")
private String stationName;
@TableField(exist = false)
private List<StationVo> stationIdList;
/**
* 设备id列表
*/
@ -108,15 +118,19 @@ public class ZyPlanProcess implements Serializable {
*/
@Excel(name = "前导工序", width = 15)
@ApiModelProperty(value = "前导工序")
@Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id")
// @Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id")
private String proProcess;
private String proProcessName;
/**
* 后导工序
*/
@Excel(name = "后导工序", width = 15)
@ApiModelProperty(value = "后导工序")
@Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id")
// @Dict(dictTable = "zy_process", dicText = "process_name", dicCode = "id")
private String postProcess;
private String postProcessName;
/**
* 输入产品
*/

@ -64,6 +64,15 @@ public class ZyProductPlan implements Serializable {
@Excel(name = "工单编号", width = 15)
@ApiModelProperty(value = "工单编号")
private String productCode;
//产品编码
private String productNo;
//产品名称
private String productName;
//生产企业
private String productOrg;
/**
* 车间id
*/
@ -89,6 +98,7 @@ public class ZyProductPlan implements Serializable {
*/
@Excel(name = "组长", width = 15)
@ApiModelProperty(value = "组长")
@Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
private String teamLeader;
/**
* 生产开始时间

@ -0,0 +1,31 @@
package org.jeecg.modules.productplan.entity.vo;
import lombok.Data;
import org.jeecg.modules.productplan.entity.ZyPlanProcess;
import java.util.List;
@Data
public class PaiWeiTuVo {
// 订单总件数
private Integer goodsNum;
// 生产人数
private Integer memberNum;
// 客户名称
private String user;
// 制单号
private String makerId;
// 款式号
private String style;
// 班组
private String teamName;
// 标准工时(分)
private Integer duration;
private List<ZyPlanProcess> list;
}

@ -17,7 +17,7 @@ public class ProcessDataVo implements Serializable {
private static final long serialVersionUID = 1009888L;
// private String id;
private String id;
//工单id
private String workOrderId;
@ -35,6 +35,9 @@ public class ProcessDataVo implements Serializable {
//工位
private List<StationVo> stationList;
//工位
private List<StationVo> stationId;
private String groupName;
//班组成员列表

@ -15,7 +15,7 @@ import java.util.List;
*/
public interface IZyPlanProcessService extends IService<ZyPlanProcess> {
List<ProcessDataVo> getProcessDatalist(ZyPlanProcess zyPlanProcess);
List<ZyPlanProcess> getProcessDatalist(ZyPlanProcess zyPlanProcess);
List<ProcessDataVo> getTeamDatalist(ZyPlanProcess zyPlanProcess);
}

@ -2,6 +2,9 @@ package org.jeecg.modules.productplan.service;
import org.jeecg.modules.productplan.entity.ZyProductPlan;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo;
import java.util.List;
/**
* @Description: 生产计划
@ -11,4 +14,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface IZyProductPlanService extends IService<ZyProductPlan> {
PaiWeiTuVo paiweitu(ZyProductPlan zyProductPlan);
}

@ -25,13 +25,17 @@ import org.jeecg.modules.team.service.IGroupxService;
import org.jeecg.modules.team.service.IStationService;
import org.jeecg.modules.team.vo.GroupxMemeberVo;
import org.jeecg.modules.team.vo.StationVo;
import org.jeecg.modules.workproduct.entity.ZyProduct;
import org.jeecg.modules.workproduct.service.IZyProductService;
import org.springframework.beans.BeanUtils;
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;
/**
@ -63,8 +67,11 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
@Autowired
private IGroupxService iGroupxService;
@Autowired
private IZyProductService iZyProductService;
public List<ProcessDataVo> getProcessDatalist(ZyPlanProcess zyPlanProcess) {
public List<ZyPlanProcess> getProcessDatalist(ZyPlanProcess zyPlanProcess) {
//生产计划id
String planId = zyPlanProcess.getPlanId();
ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId);
@ -73,61 +80,62 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
}
//工单id
String productCode = zyProductPlan.getProductCode();
String workOrderId = zyProductPlan.getProductCode();
String departId = zyProductPlan.getWorkshopId();
// TODO zy_product产品表,根据工单id获取产品id,
ZyProduct zyProduct = iZyProductService.getOne(new LambdaQueryWrapper<ZyProduct>().eq(ZyProduct::getWorkOrderId, workOrderId));
if (ObjectUtils.isEmpty(zyProduct)) {
throw new JeecgBootException("产品不存在!");
}
List<ProcessDataVo> result = new LinkedList<>();
SysDepart depart = iSysDepartService.getById(departId);
List<Station> stationList = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getDepartId, departId));
List<StationVo> stationVoList = new LinkedList<>();
if (!ObjectUtils.isEmpty(stationList)) {
stationList.forEach(en -> {
StationVo stationVo = new StationVo();
stationVo.setId(en.getId());
stationVo.setValue(en.getId());
stationVo.setText(en.getStationName());
stationVo.setTitle(en.getStationName());
stationVoList.add(stationVo);
});
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, planId));
//生产计划工序表没有对应工序时,说明没有制定过该产品的生产工序计划,先把该产品对应的基本工序数据插入到生产计划工序表
if (ObjectUtils.isEmpty(planProcessList)) {
List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>().eq(ZyProductProcess::getProductId, zyProduct.getId()));
if (!ObjectUtils.isEmpty(planProcessList)) {
List<ZyPlanProcess> saveList = new LinkedList<>();
productProcessesList.forEach(o -> {
ZyPlanProcess en = new ZyPlanProcess();
en.setProcessId(o.getProcessId());
en.setPlanId(planId);
saveList.add(en);
});
this.saveBatch(saveList);
//重新查询已录入工序数据
planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, planId));
}
}
List<ZyPlanProcess> planProcessList = this.list(new LambdaQueryWrapper<ZyPlanProcess>().eq(ZyPlanProcess::getPlanId, planId));
//TODO暂定有一条数据时,查询产品工序记录,多条时说明已定制计划工序
if (!ObjectUtils.isEmpty(planProcessList) && planProcessList.size() > 1) {
planProcessList.forEach(e -> {
ProcessDataVo vo = new ProcessDataVo();
vo.setPlanId(planId);
vo.setProcessId(e.getProcessId());
vo.setProcessName(iZyProcessService.getById(e.getProcessId()).getProcessName());
vo.setProductName("产品名称");
vo.setWorkOrderId(productCode);
vo.setDepartId(departId);
vo.setDepartName(depart.getDepartName());
vo.setStationList(stationVoList);
result.add(vo);
});
} else {
//根据产品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"));
if (!ObjectUtils.isEmpty(productProcessesList)) {
productProcessesList.forEach(e -> {
ProcessDataVo vo = new ProcessDataVo();
vo.setPlanId(planId);
vo.setProcessId(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(stationVoList);
result.add(vo);
if (!ObjectUtils.isEmpty(planProcessList)) {
// SysDepart depart = iSysDepartService.getById(departId);
List<Station> stationList = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getDepartId, departId));
List<StationVo> stationVoList = new LinkedList<>();
if (!ObjectUtils.isEmpty(stationList)) {
stationList.forEach(en -> {
StationVo stationVo = new StationVo();
stationVo.setId(en.getId());
stationVo.setValue(en.getId());
stationVo.setText(en.getStationName());
stationVo.setTitle(en.getStationName());
stationVoList.add(stationVo);
});
}
planProcessList.forEach(e -> {
// ProcessDataVo vo = new ProcessDataVo();
// vo.setId(e.getId());
// vo.setPlanId(planId);
// vo.setProcessId(e.getProcessId());
// e.setProcessName(iZyProcessService.getById(e.getProcessId()).getProcessName());
// vo.setProductName("产品名称");
// vo.setWorkOrderId(workOrderId);
// vo.setDepartId(departId);
// vo.setDepartName(depart.getDepartName());
// vo.setStationList(stationVoList);
// vo.setStationId(stationVoList);
e.setStationIdList(stationVoList);
// result.add(vo);
});
}
return result;
return planProcessList;
}
@Override

@ -1,18 +1,110 @@
package org.jeecg.modules.productplan.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods;
import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.demo.zyorders.service.IZyOrdersService;
import org.jeecg.modules.productplan.entity.ZyPlanProcess;
import org.jeecg.modules.productplan.entity.ZyProductPlan;
import org.jeecg.modules.productplan.entity.vo.PaiWeiTuVo;
import org.jeecg.modules.productplan.mapper.ZyProductPlanMapper;
import org.jeecg.modules.productplan.service.IZyPlanProcessService;
import org.jeecg.modules.productplan.service.IZyProductPlanService;
import org.jeecg.modules.system.service.ISysUserService;
import org.jeecg.modules.team.entity.Groupx;
import org.jeecg.modules.team.service.IGroupxService;
import org.jeecg.modules.workorder.entity.WorkOrder;
import org.jeecg.modules.workorder.service.IWorkOrderService;
import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle;
import org.jeecg.modules.zyclothsstyle.service.IZyClothsStyleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/**
* @Description: 生产计划
* @Author: jeecg-boot
* @Date: 2022-12-12
* @Date: 2022-12-12
* @Version: V1.0
*/
@Service
public class ZyProductPlanServiceImpl extends ServiceImpl<ZyProductPlanMapper, ZyProductPlan> implements IZyProductPlanService {
@Autowired
private IZyProductPlanService iZyProductPlanService;
@Autowired
private IZyPlanProcessService iZyPlanProcessService;
// 订单基本信息
@Autowired
private IZyOrdersService iZyOrdersService;
// 工单信息
@Autowired
private IWorkOrderService iWorkOrderService;
//商品订单信息
@Autowired
private IOrderGoodsService iOrderGoodsService;
@Autowired
private ISysUserService iSysUserService;
@Autowired
private IZyClothsStyleService iZyClothsStyleService;
@Autowired
private IGroupxService iGroupxService;
@Override
public PaiWeiTuVo paiweitu(ZyProductPlan plan) {
ZyProductPlan productPlan = iZyProductPlanService.getById(plan.getId());
if (ObjectUtils.isEmpty(productPlan)) throw new JeecgBootException(plan.getId() + "生产计划不存在");
// 工单信息
WorkOrder workOrder = iWorkOrderService.getOne(new LambdaQueryWrapper<WorkOrder>().eq(WorkOrder::getProductCode, productPlan.getProductCode()));
if (ObjectUtils.isEmpty(workOrder))
throw new JeecgBootException(productPlan.getProductCode() + "工单信息不存在");
String ordersId = workOrder.getOrdersId();
OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper<OrderGoods>().eq(OrderGoods::getOrdersId, ordersId));
if (ObjectUtils.isEmpty(orderGoods)) throw new JeecgBootException(ordersId + "订单商品信息不存在");
ZyOrders zyOrders = iZyOrdersService.getOne(new LambdaQueryWrapper<ZyOrders>().eq(ZyOrders::getId, ordersId));
if (ObjectUtils.isEmpty(zyOrders)) throw new JeecgBootException(ordersId + "订单信息不存在");
PaiWeiTuVo vo = new PaiWeiTuVo();
ZyClothsStyle zyClothsStyle = iZyClothsStyleService.getById(orderGoods.getStyleId());
vo.setStyle(StringUtils.isNotBlank(zyClothsStyle.getStyleNames()) ? zyClothsStyle.getStyleNames() : "");
vo.setGoodsNum(orderGoods.getGoodsNum());
// SysUser sysUser = iSysUserService.getById(zyOrders.getUserId());
// vo.setUser(StringUtils.isNotBlank(sysUser.getRealname()) ? sysUser.getRealname() : "");
vo.setUser(zyOrders.getUserId());
AtomicInteger memberNum = new AtomicInteger(0);
List<ZyPlanProcess> planProcessList = iZyPlanProcessService
.list(new LambdaQueryWrapper<ZyPlanProcess>()
.eq(ZyPlanProcess::getPlanId, plan.getId()));
if (!ObjectUtils.isEmpty(planProcessList)) {
planProcessList.forEach(e -> {
if (StringUtils.isNotBlank(e.getUserIds())) {
List<String> userList = Arrays.asList(e.getUserIds().split(","));
memberNum.addAndGet(userList.size());
}
});
vo.setList(planProcessList);
}
vo.setMemberNum(memberNum.intValue());
Groupx groupx = iGroupxService.getById(productPlan.getTeamId());
vo.setTeamName(StringUtils.isNotBlank(groupx.getGroupName()) ? groupx.getGroupName() : "");
vo.setDuration(productPlan.getDuration());
return vo;
}
}

@ -16,6 +16,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.List;
/**
* @Description: 车间工位管理
* @Author: jeecg-boot
@ -45,10 +47,18 @@ public class StationServiceImpl extends ServiceImpl<StationMapper, Station> impl
if (ObjectUtils.isEmpty(entity)) {
throw new JeecgBootException(id + "不存在");
}
Station station = new Station();
station.setId(id);
station.setStationNum(entity.getStationNum() + 1);
this.updateById(station);
List<Station> list = this.list(new LambdaQueryWrapper<Station>().orderByDesc(Station::getStationNum));
Integer maxStationNum = list.get(0).getStationNum();
//最后一条不能下移
if (maxStationNum.intValue() != entity.getStationNum()) {
//先把下一编号减1
Station station1 = this.getOne(new LambdaQueryWrapper<Station>().eq(Station::getStationNum, entity.getStationNum() + 1));
this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, station1.getId()).update();
this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, id).update();
this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum() + 1).eq(Station::getId, id).update();
this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum()).eq(Station::getId, station1.getId()).update();
}
}
@Override
@ -57,11 +67,15 @@ public class StationServiceImpl extends ServiceImpl<StationMapper, Station> impl
if (ObjectUtils.isEmpty(entity)) {
throw new JeecgBootException(id + "不存在");
}
//第一条不能上移
if (entity.getStationNum() > 1) {
Station station = new Station();
station.setId(id);
station.setStationNum(entity.getStationNum() - 1);
this.updateById(station);
//先把上一编号加1
Station station1 = this.getOne(new LambdaQueryWrapper<Station>().eq(Station::getStationNum, entity.getStationNum() - 1));
this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, station1.getId()).update();
this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, id).update();
this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum() - 1).eq(Station::getId, id).update();
this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum()).eq(Station::getId, station1.getId()).update();
}
}
}

@ -58,6 +58,10 @@ public class ZyProduct implements Serializable {
@Excel(name = "产品编号", width = 15)
@ApiModelProperty(value = "产品编号")
private String productCode;
@Excel(name = "产品编号", width = 50)
@ApiModelProperty(value = "产品名称")
private String productName;
/**工单*/
@Excel(name = "工单", width = 15)
@ApiModelProperty(value = "工单")

Loading…
Cancel
Save