计划班组管理 12.20

zhc4dev
zhc077 2 years ago
parent fd931f6dba
commit 6fb9df8a63
  1. 6
      ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue
  2. 331
      ant-design-vue-jeecg/src/views/productplan/ZyPlanTeamDataList.vue
  3. 257
      ant-design-vue-jeecg/src/views/productplan/ZyPlanTeamList.vue
  4. 75
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java
  5. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java
  6. 5
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java
  7. 2
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java
  8. 41
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java

@ -104,7 +104,7 @@
<a>删除</a>
</a-popconfirm>
<a-divider type="vertical"/>
<a @click="jumpPage1(record)">制定计划详情</a>
<a @click="jumpPage1(record)">制定计划工序</a>
</span>
</a-table>
@ -187,8 +187,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/zyPlanProcess/list2",
productPlanlist: "/org.jeecg.modules.productplan/zyProductPlan/list",
delete: "/org.jeecg.modules.productplan/zyPlanProcess/delete",
deleteBatch: "/org.jeecg.modules.productplan/zyPlanProcess/deleteBatch",

@ -0,0 +1,331 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<div class="table-operator">
<!-- <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>-->
<!-- <a-button @click="zyStyleFabricHandleAdd(stationId)" type="primary" icon="plus">新增</a-button>-->
<a-button type="primary" icon="download" @click="handleExportXls('1')">导出</a-button>
<a-button type="primary" @click="fanHui()">返回</a-button>
</div>
<!-- table区域-begin -->
<div>
<!-- <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"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<!-- <span slot="machineIds_dictText" slot-scope="text, record">-->
<span slot="groupMemberList" slot-scope="record,text">
<a-select mode="multiple"
@select="selectData($event,text)"
style="width: 220px"
placeholder="请选择">
<a-select-option v-for="item in record" :value="item.id">
{{ item.userId }}
</a-select-option>
</a-select>
</span>
<!-- <span slot="toolsList" slot-scope="toolsList">-->
<!-- <a-select style="width: 180px" placeholder="请选择">-->
<!-- <a-select-option v-for="item in toolsList" :value="item.id">-->
<!-- {{ item.name }}-->
<!-- </a-select-option>-->
<!-- </a-select>-->
<!-- </span>-->
<!-- <span slot="machineList" slot-scope="machineList">-->
<!-- <a-select style="width: 180px" placeholder="请选择">-->
<!-- <a-select-option v-for="item in machineList" :value="item.id">-->
<!-- {{ item.name }}-->
<!-- </a-select-option>-->
<!-- </a-select>-->
<!-- </span>-->
</a-table>
</div>
<div class="table-operator" style="text-align: right">
<a-button type="primary" @click="saveBatch">提交</a-button>
</div>
<!-- <zy-plan-process-modal @valueChange="valueChange" ref="modalForm" @ok="modalFormOk"></zy-plan-process-modal>-->
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyPlanProcessModal from './modules/ZyPlanProcessModal2'
import {getAction, httpAction, downFile, postAction} from "@api/manage";
import {filterObj} from "@/utils/util";
export default {
name: 'ZyPlanProcessList',
mixins: [JeecgListMixin, mixinDevice],
components: {
ZyPlanProcessModal
},
data() {
return {
description: '生产计划班组管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
// {
// title: 'id',
// align: "center",
// dataIndex: 'planId'
// },
{
title: '工单编号',
align: "center",
dataIndex: 'workOrderId'
},
{
title: '产品id',
align: "center",
dataIndex: 'productId'
},
{
title: '产品',
align: "center",
dataIndex: 'productName'
},
{
title: '车间',
align: "center",
dataIndex: 'departName'
},
{
title: '工序',
align: "center",
dataIndex: 'processName'
},
{
title: '班组成员',
align: "center",
dataIndex: 'groupMemberList',
width: 150,
scopedSlots: {customRender: 'groupMemberList'}
},
// {
// 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: '操作',
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: {customRender: 'action'}
}
],
url: {
list: "/org.jeecg.modules.productplan/zyPlanProcess/getTeamDatalist",
// getTeamDatalistByPlanId: "/org.jeecg.modules.productplan/zyPlanProcess/getTeamDatalistByPlanId",
groupMemberlist: "/groupxMember/list",
addTeamBatch: "/org.jeecg.modules.productplan/zyPlanProcess/addTeamBatch",
// 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",
},
loadRouteType: false,
planId: "",
dictOptions: {},
superFieldList: [],
toolsList: [],
machineList: [],
processIds: [],
memberIds: [],
}
},
created() {
this.getSuperFieldList();
// this.model = Object.assign({}, record);
},
computed: {
importExcelUrl: function () {
return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
},
},
methods: {
saveBatch() {
alert("保存开始")
postAction(this.url.addTeamBatch, this.processIds).then((res) => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok')
this.close()
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
},
fanHui() {
this.$router.push({
path: '/productplan/ZyPlanTeamList',
});
},
//$eventkey
selectData($event, row) {
console.log("group_member key $event=" + $event);
// console.log("group_member key row=" + JSON.stringify(row));
console.log("productProcessId=" + JSON.stringify(row.productProcessId));
this.processIds.push({"processId": row.productProcessId, "userIds": $event});
// for (var i = 0; i < processIds.length; i++) {
console.log("the processIds length:" + this.processIds.length);
},
//
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: ''})
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/ZyProductPlanList',
// path: '/productplan/ZyPlanProcessDataList',
//
// // query: { //
// // 'stationId': record.id,
// // 'stationName': record.stationName,
// // },
// });
// },
// pf(record) {
// this.$router.push({
// path: '/productplan/ZyPlanProcessAddList',
// query: { //
// }
// });
// 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)
// }
// });
// },
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -0,0 +1,257 @@
<template>
<a-card :bordered="false">
<!-- 查询区域 -->
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
</a-row>
</a-form>
</div>
<!-- 查询区域-END -->
<!-- 操作按钮区域 -->
<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 -->
<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"
size="middle"
:scroll="{x:true}"
bordered
rowKey="id"
:columns="columns"
:dataSource="dataSource"
:pagination="ipagination"
:loading="loading"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
class="j-table-force-nowrap"
@change="handleTableChange">
<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-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
<a-divider type="vertical"/>
<a @click="jumpPage1(record)">制定计划班组</a>
</span>
</a-table>
</div>
<zy-plan-process-modal ref="modalForm" @ok="modalFormOk"></zy-plan-process-modal>
</a-card>
</template>
<script>
import '@/assets/less/TableExpand.less'
import {mixinDevice} from '@/utils/mixin'
import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import ZyPlanProcessModal from './modules/ZyPlanProcessModal2'
export default {
name: 'ZyPlanProcessList',
mixins: [JeecgListMixin, mixinDevice],
components: {
ZyPlanProcessModal
},
data() {
return {
description: '生产计划工序管理页面',
//
columns: [
{
title: '#',
dataIndex: '',
key: 'rowIndex',
width: 60,
align: "center",
customRender: function (t, r, index) {
return parseInt(index) + 1;
}
},
{
title: '生产计划',
align: "center",
dataIndex: 'planId'
},
{
title: '工序',
align: "center",
dataIndex: 'processId_dictText',
scopedSlots: {customRender: 'stationId_dictText'}
},
{
title: '工位',
align: "center",
dataIndex: 'stationId_dictText',
scopedSlots: {customRender: 'stationId_dictText'}
},
{
title: '设备',
align: "center",
dataIndex: 'machineIds_dictText',
scopedSlots: {customRender: 'machineIds_dictText'}
},
{
title: '工具',
align: "center",
dataIndex: 'toolsIds_dictText',
scopedSlots: {customRender: 'toolsIds_dictText'}
},
{
title: '成员',
align: "center",
dataIndex: 'userIds_dictText',
scopedSlots: {customRender: 'userIds_dictText'}
},
{
title: '操作',
dataIndex: 'action',
align: "center",
fixed: "right",
width: 147,
scopedSlots: {customRender: 'action'}
}
],
url: {
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",
exportXlsUrl: "/org.jeecg.modules.productplan/zyPlanProcess/exportXls",
importExcelUrl: "org.jeecg.modules.productplan/zyPlanProcess/importExcel",
},
dictOptions: {},
superFieldList: [],
}
},
created() {
this.getSuperFieldList();
},
computed: {
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/ZyPlanTeamDataList',
query: { //
'planId': record.planId,
// 'stationName': record.stationName,
},
});
},
// pf(record) {
// this.$router.push({
// path: '/productplan/ZyPlanProcessAddList',
// query: { //
// }
// });
// 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)
// }
// });
// },
}
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>

@ -1,7 +1,10 @@
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.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.PageList;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -10,11 +13,14 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController;
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.GroupxMember;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
@ -22,9 +28,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @Description: 生产计划工序
@ -111,6 +115,33 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
return Result.OK(processDatalist);
}
@ApiOperation(value = "计划班组管理-查询产品工序&班组", notes = "计划班组管理-查询产品工序&班组")
@GetMapping(value = "/getTeamDatalist")
public Result<?> getTeamDatalist(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);
List<ProcessDataVo> processDatalist = zyPlanProcessService.getTeamDatalist(zyPlanProcess);
// PageList<ProcessDataVo> processDataVos = new PageList<>(processDatalist, processDatalist.size());
return Result.OK(processDatalist);
}
@ApiOperation(value = "计划班组管理-查询产品工序&班组", notes = "计划班组管理-查询产品工序&班组")
@GetMapping(value = "/getTeamDatalistByPlanId")
public Result<?> getTeamDatalistByPlanId(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());
queryWrapper.eq("plan_id", zyPlanProcess.getPlanId());
Page<ZyPlanProcess> page = new Page<ZyPlanProcess>(pageNo, pageSize);
IPage<ZyPlanProcess> pageList = zyPlanProcessService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
@ -125,6 +156,29 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
return Result.OK("添加成功!");
}
// @AutoLog(value = "生产计划工序-添加")
@ApiOperation(value = "计划工序管理-批量添加工序、工位、设备", notes = "计划工序管理-批量添加工序、工位、设备")
@PostMapping(value = "/addProcessBatch")
public Result<?> addProcessBatch(@RequestBody List<ZyPlanProcess> zyPlanProcessList) {
zyPlanProcessService.saveBatch(zyPlanProcessList);
return Result.OK("添加成功!");
}
// @AutoLog(value = "计划班组管理-批量添加成员")
@ApiOperation(value = "计划班组管理-批量添zyPlanProcessList = {ArrayList@21228} size = 7加工序-班组成员", notes = "批量添加工序-班组成员")
@PostMapping(value = "/addTeamBatch")
public Result<?> addTeamBatch(@RequestBody List<ZyPlanProcess> zyPlanProcessList) {
if (!ObjectUtils.isEmpty(zyPlanProcessList)) {
zyPlanProcessList.forEach(e -> {
zyPlanProcessService.update(new LambdaUpdateWrapper<ZyPlanProcess>()
.set(ZyPlanProcess::getUserIds, e.getUserIds())
.eq(ZyPlanProcess::getProcessId, e.getProcessId()));
});
}
return Result.OK("添加成功!");
}
/**
* 编辑
*
@ -145,7 +199,6 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
* @param id
* @return
*/
@AutoLog(value = "生产计划工序-通过id删除")
@ApiOperation(value = "生产计划工序-通过id删除", notes = "生产计划工序-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
@ -159,11 +212,19 @@ public class ZyPlanProcessController extends JeecgController<ZyPlanProcess, IZyP
* @param ids
* @return
*/
@AutoLog(value = "生产计划工序-批量删除")
@ApiOperation(value = "生产计划工序-批量删除", notes = "生产计划工序-批量删除")
@ApiOperation(value = "计划班组管理-批量删除工序-班组成员", notes = "计划班组管理-批量删除工序-班组成员")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
this.zyPlanProcessService.removeByIds(Arrays.asList(ids.split(",")));
List<ZyPlanProcess> zyPlanProcessList = zyPlanProcessService.list(new LambdaQueryWrapper<ZyPlanProcess>().in(ZyPlanProcess::getId, Arrays.asList(ids.split(","))));
if (ObjectUtils.isEmpty(zyPlanProcessList)) throw new JeecgBootException("计划工序数据异常");
List<ZyPlanProcess> updateList = new LinkedList<>();
zyPlanProcessList.forEach(e -> {
ZyPlanProcess en = new ZyPlanProcess();
BeanUtils.copyProperties(e, en);
en.setUserIds("");
updateList.add(en);
});
zyPlanProcessService.updateBatchById(updateList);
return Result.OK("批量删除成功!");
}

@ -100,6 +100,6 @@ public class ZyPlanProcess implements Serializable {
*/
@Excel(name = "成员id列表", width = 15)
@ApiModelProperty(value = "成员id列表")
// @Dict(dictTable = "sys_user", dicText = "name", dicCode = "id")
@Dict(dictTable = "groupx_member", dicText = "user_id", dicCode = "id")
private String userIds;
}

@ -4,6 +4,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.modules.team.entity.GroupxMember;
import org.jeecg.modules.team.entity.Station;
import java.io.Serializable;
@ -16,6 +17,7 @@ public class ProcessDataVo implements Serializable {
private static final long serialVersionUID = 1009888L;
private String id;
//工单id
private String workOrderId;
@ -31,6 +33,9 @@ public class ProcessDataVo implements Serializable {
//工位
private List<Station> stationList;
//班组成员列表
private List<GroupxMember> groupMemberList;
//产品工序id
// @Dict(dictTable ="zy_process",dicText = "process_name",dicCode = "id")
private String productProcessId;

@ -16,4 +16,6 @@ import java.util.List;
public interface IZyPlanProcessService extends IService<ZyPlanProcess> {
List<ProcessDataVo> getProcessDatalist(ZyPlanProcess zyPlanProcess);
List<ProcessDataVo> getTeamDatalist(ZyPlanProcess zyPlanProcess);
}

@ -16,7 +16,9 @@ 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.GroupxMember;
import org.jeecg.modules.team.entity.Station;
import org.jeecg.modules.team.service.IGroupxMemberService;
import org.jeecg.modules.team.service.IStationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -48,6 +50,8 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
private ISysDepartService iSysDepartService;
@Autowired
private IZyProcessService iZyProcessService;
@Autowired
private IGroupxMemberService iGroupxMemberService;
public List<ProcessDataVo> getProcessDatalist(ZyPlanProcess zyPlanProcess) {
@ -83,4 +87,41 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl<ZyPlanProcessMapper, Z
}
return result;
}
@Override
public List<ProcessDataVo> getTeamDatalist(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"));
List<ZyProductProcess> productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper<ZyProductProcess>().eq(ZyProductProcess::getProductId, "1"));
if (!ObjectUtils.isEmpty(productProcessesList)) {
SysDepart depart = iSysDepartService.getById(departId);
List<GroupxMember> groupxMemberList = iGroupxMemberService.list(new LambdaQueryWrapper<GroupxMember>().eq(GroupxMember::getGroupxId, zyProductPlan.getTeamId()));
productProcessesList.forEach(e -> {
ProcessDataVo vo = new ProcessDataVo();
// vo.setId()
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);
vo.setGroupMemberList(groupxMemberList);
result.add(vo);
});
}
return result;
}
}

Loading…
Cancel
Save