吊挂管理-吊挂基本信息-管面页面 2.8

zhc4dev
zhc077 2 years ago
parent 1c5620c3ec
commit 9876f10b56
  1. 429
      ant-design-vue-jeecg/src/views/hanger/HangerManage.vue
  2. 2
      ant-design-vue-jeecg/src/views/hanger/ZyHangList.vue
  3. 54
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangController.java
  4. 16
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/controller/ZyHangPointController.java
  5. 11
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/entity/ZyHangPoint.java
  6. 6
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/IZyHangPointService.java
  7. 37
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/hanger/service/impl/ZyHangPointServiceImpl.java

@ -1,32 +1,32 @@
<template> <template>
<a-card :bordered="false"> <a-card :bordered="false">
<p style="font-size: 30px;color:#333; padding-left: 30% ">{{ planInfo.productCode }}工单生产计划管理</p> <p style="font-size: 30px;color:#333; padding-left: 30% ">{{ this.workshopName + this.code }}吊挂管理</p>
<template> <!-- <template>-->
<div> <!-- <div>-->
<el-descriptions border :column='4'> <!-- <el-descriptions border :column='4'>-->
<el-descriptions-item label="工单编号 ">{{ planInfo.productCode }}</el-descriptions-item> <!-- <el-descriptions-item label="工单编号 ">{{ planInfo.productCode }}</el-descriptions-item>-->
<el-descriptions-item label="生产企业">{{ planInfo.productOrg }}</el-descriptions-item> <!-- <el-descriptions-item label="生产企业">{{ planInfo.productOrg }}</el-descriptions-item>-->
<!-- <el-descriptions-item label="企业负责人 ">admin</el-descriptions-item>--> <!-- &lt;!&ndash; <el-descriptions-item label="企业负责人 ">admin</el-descriptions-item>&ndash;&gt;-->
<el-descriptions-item label="车间 ">{{ planInfo.workshop }}</el-descriptions-item> <!-- <el-descriptions-item label="车间 ">{{ planInfo.workshop }}</el-descriptions-item>-->
<!-- <el-descriptions-item label="车间负责人 ">admin</el-descriptions-item>--> <!-- &lt;!&ndash; <el-descriptions-item label="车间负责人 ">admin</el-descriptions-item>&ndash;&gt;-->
<el-descriptions-item label="班组">{{ planInfo.team }}</el-descriptions-item> <!-- <el-descriptions-item label="班组">{{ planInfo.team }}</el-descriptions-item>-->
<el-descriptions-item label="班组长">{{ planInfo.teamLade }}</el-descriptions-item> <!-- <el-descriptions-item label="班组长">{{ planInfo.teamLade }}</el-descriptions-item>-->
<el-descriptions-item label="产品类型">{{ planInfo.productType }}</el-descriptions-item> <!-- <el-descriptions-item label="产品类型">{{ planInfo.productType }}</el-descriptions-item>-->
<el-descriptions-item label="产品编号">{{ planInfo.productNo }}</el-descriptions-item> <!-- <el-descriptions-item label="产品编号">{{ planInfo.productNo }}</el-descriptions-item>-->
<el-descriptions-item label="产品名称">{{ planInfo.productName }}</el-descriptions-item> <!-- <el-descriptions-item label="产品名称">{{ planInfo.productName }}</el-descriptions-item>-->
<el-descriptions-item label="开始时间">{{ planInfo.workTime }}</el-descriptions-item> <!-- <el-descriptions-item label="开始时间">{{ planInfo.workTime }}</el-descriptions-item>-->
<el-descriptions-item label="生产时长">{{ planInfo.duration }}</el-descriptions-item> <!-- <el-descriptions-item label="生产时长">{{ planInfo.duration }}</el-descriptions-item>-->
<el-descriptions-item label="生产状态">{{ planInfo.status }}</el-descriptions-item> <!-- <el-descriptions-item label="生产状态">{{ planInfo.status }}</el-descriptions-item>-->
<el-descriptions-item label="加急">{{ planInfo.speedUp }}</el-descriptions-item> <!-- <el-descriptions-item label="加急">{{ planInfo.speedUp }}</el-descriptions-item>-->
<el-descriptions-item label="销售企业">{{ planInfo.salesEnterprise }}</el-descriptions-item> <!-- <el-descriptions-item label="销售企业">{{ planInfo.salesEnterprise }}</el-descriptions-item>-->
<el-descriptions-item label="订货期">{{ planInfo.orderTime }}</el-descriptions-item> <!-- <el-descriptions-item label="订货期">{{ planInfo.orderTime }}</el-descriptions-item>-->
<!-- <el-descriptions-item label="制定人">100</el-descriptions-item>--> <!-- &lt;!&ndash; <el-descriptions-item label="制定人">100</el-descriptions-item>&ndash;&gt;-->
<!-- <el-descriptions-item label="制定时间">100</el-descriptions-item>--> <!-- &lt;!&ndash; <el-descriptions-item label="制定时间">100</el-descriptions-item>&ndash;&gt;-->
<el-descriptions-item label="审核人">{{ planInfo.auditBy }}</el-descriptions-item> <!-- <el-descriptions-item label="审核人">{{ planInfo.auditBy }}</el-descriptions-item>-->
<el-descriptions-item label="审核时间">{{ planInfo.auditTimr }}</el-descriptions-item> <!-- <el-descriptions-item label="审核时间">{{ planInfo.auditTimr }}</el-descriptions-item>-->
</el-descriptions> <!-- </el-descriptions>-->
</div> <!-- </div>-->
</template> <!-- </template>-->
<!-- table区域-begin --> <!-- table区域-begin -->
<div> <div>
@ -37,37 +37,33 @@
row-number row-number
row-selection row-selection
keep-source keep-source
:rowSelection="clickTrue"
:clickSelectRow="clickTrue"
:loading="loading" :loading="loading"
:columns="columns" :columns="columns"
@selectRowChange="handleSelectRowChange"
:dataSource="dataSource" :dataSource="dataSource"
@selectRowChange="handleSelectRowChange"
@valueChange="handleValueChange" @valueChange="handleValueChange"
@save="handleTableSave" @save="handleTableSave"
> >
<template v-slot:toolbarSuffix> <template v-slot:toolbarSuffix>
<a-button type="primary" icon="plus-circle" @click="syncProductProcess()">读取工序</a-button> <a-button type="primary" icon="plus-circle" @click="syncHangRecord()">同步吊挂运行记录</a-button>
<a-button type="primary" icon="plus-circle" @click="autoFilling()">自动排位</a-button> <!-- <a-button type="primary" icon="plus-circle" @click="autoFilling()">自动排位</a-button>-->
<a-button type="primary" icon="plus-circle" @click="createMaterialBill()">生成物料单 <!-- <a-button type="primary" icon="plus-circle" @click="createMaterialBill()">生成物料单-->
</a-button> <!-- </a-button>-->
<a-button type="primary" icon="unordered-list" @click="viewMaterialBill">查看物料单 <!-- <a-button type="primary" icon="unordered-list" @click="viewMaterialBill">查看物料单-->
</a-button> <!-- </a-button>-->
<a-button type="primary" icon="redo" @click="sendToRepository()">发送到仓库 <!-- <a-button type="primary" icon="redo" @click="sendToRepository()">发送到仓库-->
</a-button> <!-- </a-button>-->
<!-- <a-button type="primary" icon="download" @click="handleExportXls('计划工序')">导出</a-button>-->
<a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button> <a-button type="primary" icon="rollback" @click="fanHui()">返回</a-button>
</template> </template>
<template v-slot:action="props"> <!-- <template v-slot:action="props">-->
<a @click="jump2MianLiao(props)">面料</a> <!-- <a @click="jump2MianLiao(props)">面料</a>-->
<a-divider type="vertical"/> <!-- <a-divider type="vertical"/>-->
<a @click="jump2FuLiao(props)">辅料</a> <!-- <a @click="jump2FuLiao(props)">辅料</a>-->
<a-divider type="vertical"/> <!-- <a-divider type="vertical"/>-->
<a @click="viewDetail(props)">详情</a> <!-- <a @click="viewDetail(props)">详情</a>-->
</template> <!-- </template>-->
</j-vxe-table> </j-vxe-table>
</div> </div>
<ZyPlanProcessDataDetail ref="zyPlanProcessDataDetail"></ZyPlanProcessDataDetail>
</a-card> </a-card>
</template> </template>
@ -80,195 +76,110 @@ import {JeecgListMixin} from '@/mixins/JeecgListMixin'
import {getAction, postAction} from "@api/manage"; import {getAction, postAction} from "@api/manage";
import {filterObj, pushIfNotExist, randomNumber, randomUUID} from "@/utils/util"; import {filterObj, pushIfNotExist, randomNumber, randomUUID} from "@/utils/util";
import {JVXETypes} from '@/components/jeecg/JVxeTable' import {JVXETypes} from '@/components/jeecg/JVxeTable'
import Area from "@comp/_util/Area";
import ZyPlanProcessDataDetail from '@views/productplan/ZyPlanProcessDataDetail'
export default { export default {
name: 'ZyPlanProcessDataList', name: 'ZyPlanProcessDataList',
mixins: [JeecgListMixin, mixinDevice], mixins: [JeecgListMixin, mixinDevice],
components: {
ZyPlanProcessDataDetail,
},
data() { data() {
return { return {
toolbarConfig: { toolbarConfig: {
// add remove clearSelection // add remove clearSelection
btn: ['save',] btn: ['save',]
}, },
description: '生产计划工序管理页面', description: '吊挂管理页面',
loading: false, loading: false,
dataSource: [], dataSource: [],
columns: [ columns: [
{ {
title: '工序名称', title: '车间',
key: 'processName', key: 'workshopName',
width: '180px', width: '180px',
}, },
{ {
title: '工位ID', title: '吊挂编号',
key: 'stationId', key: 'code',
type: JVXETypes.hidden,
},
{
title: '工位名称',
key: 'stationName',
type: JVXETypes.select,
width: '200px',
options: [],
placeholder: '请选择${title}',
},
{
title: '工位序号',
key: 'stationNum',
width: '80px',
},
{
title: '设备名称',
key: 'machineIds',
type: JVXETypes.hidden
},
{
title: '设备名称',
key: 'machineNames',
type: JVXETypes.selectMultiple,
width: '180px', width: '180px',
options: [],
placeholder: '请选择${title}',
},
{
title: 'toodsIds',
key: 'toolsIds',
type: JVXETypes.hidden,
}, },
{ {
title: '工具名称', title: '工站编号',
key: 'toolsNames', key: 'point',
type: JVXETypes.selectMultiple, type: JVXETypes.input,
width: '180px', width: '180px',
options: [], /*validateRules: [
placeholder: '请选择${title}', {
required: true, //
message: '请输入${title}' //
}, },
{key: 'proProcess', type: JVXETypes.hidden, title: '前导工序ID', width: '120px'},
{ {
title: '前导工序', // pattern: /^[P][0-9]{4}$/, //
key: 'proProcessName', // pattern: /^[0-9a-zA-Z_]{1,}$/,
type: JVXETypes.popup, pattern: /^[P]\d[0-9]{4,}$/, //
width: '180px', // pattern: /^[a-z|A-Z][a-z|A-Z\d_-]{0,}$/, //
popupCode: 'zy_process',
field: 'id,process_code,process_name,process_describe', message: '${title}必须以字母开头,可包含数字、下划线、横杠'
// orgFields: 'id,process_code,process_name,process_describe',
// destFields: 'proProcessName,process_code,process_name,process_describe',
orgFields: 'process_name,id',
destFields: 'proProcessName,proProcess',
}, },
{key: 'postProcess', type: JVXETypes.hidden, title: '后导工序ID', width: '120px'},
{ {
title: '后导工序', unique: true,
key: 'postProcessName', message: '${point}不能重复'
type: JVXETypes.popup, },
width: '180px', // {
popupCode: 'zy_process', // handler({cellValue, row, column}, callback, target) {
field: 'id,process_code,process_name,process_describe', // // cellValue
orgFields: 'process_name,id', // // callback(flag, message)
destFields: 'postProcessName,postProcess', // // flag = null
// // message = 使 message
// // target
// if (cellValue === 'abc') {
// callback(false, '${title}abc') // false =
// } else {
// callback(true) // true =
// }
// },
// message: '${title}'
// }
]*/
}, },
{key: 'inputProduct', title: '输入产品', width: '150', type: JVXETypes.input},
{key: 'semiProduct', title: '成品/半成品', width: '150', type: JVXETypes.input},
{ {
title: '工人id', title: '工位ID',
key: 'userIds', key: 'stationId',
type: JVXETypes.hidden, type: JVXETypes.hidden,
}, },
{ {
title: '工人名称', title: '工名称',
key: 'userNames', key: 'stationName',
type: JVXETypes.selectMultiple, type: JVXETypes.select,
width: '200px', width: '220px',
options: [], options: [],
placeholder: '请选择${title}', placeholder: '请选择${title}',
}, },
{key: 'totalMachine', title: '机器时长', width: '80', type: JVXETypes.normal}, // {
{key: 'totalMaunal', title: '人工时长', width: '80', type: JVXETypes.normal}, // title: '',
{ // key: 'action',
title: '管理', // type: JVXETypes.slot,
key: 'action', // fixed: 'right',
type: JVXETypes.slot, // minWidth: '150px',
fixed: 'right', // align: 'center',
minWidth: '150px', // slotName: 'action',
align: 'center', // },
slotName: 'action',
},
], ],
url: { url: {
list: "/org.jeecg.modules.productplan/zyPlanProcess/getProcessDatalist", list: "/org.jeecg.modules.hanger/zyHang/getPointById",
getPlanInfo: "/org.jeecg.modules.productplan/zyPlanProcess/getPlanInfo", syncHangRecord: "/org.jeecg.modules.productplan/zyPlanProcess/syncHangRecord",
syncProductProcess: "/org.jeecg.modules.productplan/zyPlanProcess/syncProductProcess", addBatch: "/org.jeecg.modules.hanger/zyHangPoint/addBatch",
autoFilling: "/org.jeecg.modules.productplan/zyPlanProcess/autoFilling",
createMaterialBill: "/org.jeecg.modules.productplan/zyPlanProcess/createMaterialBill",
sendToRepository: "/org.jeecg.modules.productplan/zyPlanProcess/sendToRepository",
stationToolslist: "/stationTool/list2",
stationMachinelist: "/stationMachine/list2",
addProcessBatch: "/org.jeecg.modules.productplan/zyPlanProcess/addProcessBatch",
}, },
loadRouteType: false, loadRouteType: false,
planId: "", id: "",
workshopName: "",
code: "",
dictOptions: {}, dictOptions: {},
planInfo: {},
superFieldList: [],
stationIdList: [], stationIdList: [],
userIdList: [],
toolsList: [],
machineList: [],
clickTrue: true, clickTrue: true,
} }
}, },
created() { created() {
this.loadParameter(); this.loadParameter();
this.getPlanInfo(this.planId);
}, },
methods: { methods: {
//
viewDetail(props) {
// alert("deatil row id:"+props.row.id);
this.$refs.zyPlanProcessDataDetail.showModal(props.row.id)
},
jump2MianLiao(props) {
console.log("mianLiao() ----props:", props)
this.$router.push({
path: '/productplan/ZyPlanProcessFabricDataList',
query: { //
'planId': props.row.planId,
'planProcessId': props.row.processId,
},
});
},
jump2FuLiao(props) {
console.log("fuLiao() ----props:", props)
this.$router.push({
path: '/productplan/ZyPlanProcessAccessoriesDataList',
query: { //
'planId': props.row.planId,
'planProcessId': props.row.processId,
},
});
},
getPlanInfo(planId) {
// debugger;
getAction(this.url.getPlanInfo, {"planId": planId}).then((res) => {
if (res.success) {
this.planInfo = res.result.records || res.result;
// console.log("getPlanInfo------------:" + JSON.stringify(this.planInfo));
} else {
// this.stationIdCode = "station,station_name,id,depart_id in (select workshop_id from zy_product_plan where id='" + this.planId + "')";
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
// //
handleTableSave({$table, target}) { handleTableSave({$table, target}) {
console.log("生产计划工序保存开始-----------------") console.log("生产计划工序保存开始-----------------")
@ -281,7 +192,7 @@ export default {
console.log('当前保存的数据是:', tableData) console.log('当前保存的数据是:', tableData)
// //
this.loading = true this.loading = true
postAction(this.url.addProcessBatch, tableData).then(res => { postAction(this.url.addBatch, tableData).then(res => {
if (res.success) { if (res.success) {
this.$message.success(`保存成功!`) this.$message.success(`保存成功!`)
} else { } else {
@ -296,80 +207,17 @@ export default {
}, },
fanHui() { fanHui() {
this.$router.push({ this.$router.push({
path: '/productplan/ZyProductPlanList', path: '/src/views/hanger/ZyHangList',
}); });
}, },
// //
syncProductProcess() { syncHangRecord() {
this.loading = true; this.loading = true;
getAction(this.url.syncProductProcess, {"planId": this.planId}).then((res) => { getAction(this.url.syncHangRecord, {"code": this.code}).then((res) => {
if (res.success) { if (res.success) {
this.$message.success("操作成功"); this.$message.success("操作成功");
this.loadData(); // this.loadData();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
//
/**
* 根据工序id查询工序设备表zy_process_machine用工序设备表数据与工位设备进行匹配(工位设备包含工序设备即是匹配成功则自动填充工位设备字段数据匹配不上则不自动填充由用户自己录入)
*/
autoFilling() {
this.loading = true;
getAction(this.url.autoFilling, {"planId": this.planId}).then((res) => {
if (res.success) {
this.$message.success("操作成功");
this.loadData();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
//
/**
* 根据该生产计划的工序面料工序辅料按类统计各种面料辅料的用量汇总到计划面料计划辅料表
*/
createMaterialBill() {
this.loading = true;
getAction(this.url.createMaterialBill, {"planId": this.planId}).then((res) => {
if (res.success) {
this.$message.success("操作成功");
this.loadData();
} else {
this.$message.warning(res.message)
}
}).finally(() => {
this.loading = false
})
},
//
viewMaterialBill() {
// alert("deatil this.planId:"+this.planId);
// this.$refs.zyPlanProcessDataDetail.showModal(this.planId)
this.$router.push({
path: '/productplan/ZyPlanWuLiaoDataDetail',
query: { //
'planId': this.planId,
},
});
},
//
sendToRepository(){
this.loading = true;
getAction(this.url.sendToRepository, {"planId": this.planId}).then((res) => {
if (res.success) {
this.$message.success("操作成功");
this.loadData();
} else { } else {
this.$message.warning(res.message) this.$message.warning(res.message)
} }
@ -382,8 +230,10 @@ export default {
loadParameter() { loadParameter() {
// debugger; // debugger;
if (this.loadRouteType === false) { if (this.loadRouteType === false) {
this.planId = this.$route.query.planId; this.id = this.$route.query.id;
console.log("*******传递的planId:" + this.planId) this.workshopName = this.$route.query.workshopName;
this.code = this.$route.query.code;
console.log("*******传递的id:" + this.id)
this.loadRouteType = true; this.loadRouteType = true;
} }
}, },
@ -403,12 +253,16 @@ export default {
if (res.success) { if (res.success) {
this.dataSource = res.result.records || res.result; this.dataSource = res.result.records || res.result;
this.stationIdList = this.dataSource[0].stationIdList; this.stationIdList = this.dataSource[0].stationIdList;
this.userIdList = this.dataSource[0].userIdList;
// alert(this.stationIdList)
} else { } else {
// this.stationIdCode = "station,station_name,id,depart_id in (select workshop_id from zy_product_plan where id='" + this.planId + "')";
this.$message.warning(res.message) this.$message.warning(res.message)
} }
}).finally(() => { }).finally(() => {
this.dataSource.forEach(item => {
item['workshopName'] = this.workshopName;
// item['stationNum'] = this.stationNum;
})
this.loading = false this.loading = false
}) })
}, },
@ -423,20 +277,18 @@ export default {
param.field = this.getQueryField(); param.field = this.getQueryField();
param.pageNo = this.ipagination.current; param.pageNo = this.ipagination.current;
param.pageSize = this.ipagination.pageSize; param.pageSize = this.ipagination.pageSize;
param.planId = this.planId; param.id = this.id;
return filterObj(param); return filterObj(param);
}, },
// //
handleSelectRowChange(event) { handleSelectRowChange(event) {
// console.log("handleSelectRowChange")
console.log("handleSelectRowChange-event:", event) console.log("handleSelectRowChange-event:", event)
const {type, row, column, value, target, $table} = event const {type, row, column, value, target, $table} = event
console.log("stationIdList", JSON.stringify(this.stationIdList)); console.log("stationIdList", JSON.stringify(this.stationIdList));
console.log("---------userIdList", JSON.stringify(this.userIdList)); target.$refs.vxe.columns[6].options = this.stationIdList;
target.$refs.vxe.columns[4].options = this.stationIdList;
target.$refs.vxe.columns[17].options = this.userIdList;
}, },
/** 当选项被改变时,联动其他组件 */ /** 当选项被改变时,联动其他组件 */
handleValueChange(event) { handleValueChange(event) {
const {type, row, column, value, target} = event const {type, row, column, value, target} = event
@ -445,51 +297,14 @@ export default {
// console.log("row", row) // console.log("row", row)
// //
if (column.key === 'stationName') { if (column.key === 'stationName') {
// target.$refs.vxe.columns[6].options = this.stationIdList;
// debugger;
let selectedStationId = event.value; let selectedStationId = event.value;
// options
// console.log('id---------:', selectedStationId) // console.log('id---------:', selectedStationId)
row.stationId = selectedStationId; row.stationId = selectedStationId;
//
target.setValues([{
rowKey: row.id,
values: {machineIds: '', toolsIds: '', machineNames: '', toolsNames: ''}
}])
target.$refs.vxe.columns[7].options = []
target.$refs.vxe.columns[9].options = []
getAction(this.url.stationMachinelist, {"stationId": selectedStationId}).then((res) => {
if (res.success) {
this.machineList = res.result.records || res.result;
console.log("machineList", JSON.stringify(this.machineList))
target.$refs.vxe.columns[7].options = this.machineList;
} else {
this.$message.warning(res.message)
} }
});
getAction(this.url.stationToolslist, {"stationId": selectedStationId}).then((res) => {
if (res.success) {
this.toolsList = res.result.records || res.result;
console.log("toolsList", JSON.stringify(this.toolsList))
target.$refs.vxe.columns[9].options = this.toolsList;
} else {
this.$message.warning(res.message)
}
});
} }
//
if (column.key === 'machineNames') {
row.machineIds = event.value;
}
if (column.key === 'toolsNames') {
row.toolsIds = event.value;
}
if (column.key === 'userNames') {
row.userIds = event.value;
}
}
}, },
}; };
</script> </script>

@ -265,6 +265,8 @@ export default {
path: '/src/views/hanger/HangerManage', path: '/src/views/hanger/HangerManage',
query: { // query: { //
'id': record.id, 'id': record.id,
'code': record.code,
'workshopName': record.workshopId_dictText,
}, },
}); });
}, },

@ -4,6 +4,7 @@ package org.jeecg.modules.hanger.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.api.R;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.zxing.BarcodeFormat; import com.google.zxing.BarcodeFormat;
import com.google.zxing.EncodeHintType; import com.google.zxing.EncodeHintType;
@ -21,7 +22,12 @@ import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.base.controller.JeecgController;
import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.hanger.entity.ZyHang; import org.jeecg.modules.hanger.entity.ZyHang;
import org.jeecg.modules.hanger.entity.ZyHangPoint;
import org.jeecg.modules.hanger.service.IZyHangPointService;
import org.jeecg.modules.hanger.service.IZyHangService; import org.jeecg.modules.hanger.service.IZyHangService;
import org.jeecg.modules.team.entity.Station;
import org.jeecg.modules.team.service.IStationService;
import org.jeecg.modules.team.vo.StationVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@ -47,6 +53,12 @@ public class ZyHangController extends JeecgController<ZyHang, IZyHangService> {
@Autowired @Autowired
private IZyHangService zyHangService; private IZyHangService zyHangService;
@Autowired
private IZyHangPointService iZyHangPointService;
@Autowired
private IStationService iStationService;
/** /**
* 分页列表查询 * 分页列表查询
* *
@ -101,6 +113,48 @@ public class ZyHangController extends JeecgController<ZyHang, IZyHangService> {
return Result.OK(pageList); return Result.OK(pageList);
} }
@ApiOperation(value = "吊挂表-通过吊挂查询工站列表", notes = "吊挂表-通过吊挂查询工站列表")
@GetMapping(value = "/getPointById")
public Result<?> getPointById(ZyHang zyHang) {
ZyHang entity = zyHangService.getById(zyHang.getId());
Optional.ofNullable(entity).orElseThrow(() -> new JeecgBootException(zyHang.getId() + ":吊挂不存在"));
List<ZyHangPoint> pointList = new LinkedList<>();
pointList = iZyHangPointService.list(new LambdaQueryWrapper<ZyHangPoint>().eq(ZyHangPoint::getCode, entity.getCode()));
List<Station> stationList = iStationService.list(new LambdaQueryWrapper<Station>().eq(Station::getDepartId, entity.getWorkshopId()));
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);
});
}
//未配置工站,未绑定工位
if (entity.getPointnumber() > 0 && ObjectUtils.isEmpty(pointList)) {
String lastPointCode = iZyHangPointService.getLastPointCode();
String[] dgs = lastPointCode.split("P");
int val = new Integer(dgs[1]).intValue();
for (int i = 0; i < entity.getPointnumber(); i++) {
int currVal = val + i;
ZyHangPoint zyHangPoint = new ZyHangPoint();
zyHangPoint.setCode(entity.getCode());
zyHangPoint.setPoint("P" + currVal);
zyHangPoint.setStationIdList(stationVoList);
pointList.add(zyHangPoint);
}
iZyHangPointService.saveBatch(pointList);
pointList.clear();
pointList = iZyHangPointService.list(new LambdaQueryWrapper<ZyHangPoint>().eq(ZyHangPoint::getCode, entity.getCode()));
}
pointList.forEach(e -> {
e.setStationIdList(stationVoList);
});
return Result.OK(pointList);
}
/** /**
* 添加 * 添加
* *

@ -20,6 +20,7 @@ import org.springframework.web.servlet.ModelAndView;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Arrays; import java.util.Arrays;
import java.util.List;
/** /**
* @Description: 吊挂工位表 * @Description: 吊挂工位表
@ -64,6 +65,21 @@ public class ZyHangPointController extends JeecgController<ZyHangPoint, IZyHangP
return Result.OK(zyHangPointService.getLastPointCode()); return Result.OK(zyHangPointService.getLastPointCode());
} }
@ApiOperation(value = "吊挂工位表-同步生产记录表数据到吊挂运行记录表", notes = "吊挂工位表-同步生产记录表数据到吊挂运行记录表")
@GetMapping(value = "/syncHangRecord")
public Result<?> syncHangRecord(ZyHangPoint zyHangPoint) {
return Result.OK(zyHangPointService.syncHangRecord(zyHangPoint));
}
@ApiOperation(value = "吊挂工位表-工站、工位绑定批量添加", notes = "吊挂工位表-工站、工位绑定批量添加")
@PostMapping(value = "/addBatch")
public Result<?> addBatch(@RequestBody List<ZyHangPoint> pointList) {
zyHangPointService.addBatch(pointList);
return Result.OK("添加成功!");
}
/** /**
* 添加 * 添加
* *

@ -2,6 +2,7 @@ package org.jeecg.modules.hanger.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@ -11,11 +12,13 @@ import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict; import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.modules.team.vo.StationVo;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Description: 吊挂工位表 * @Description: 吊挂工位表
@ -78,6 +81,12 @@ public class ZyHangPoint implements Serializable {
*/ */
@Excel(name = "工位id", width = 15) @Excel(name = "工位id", width = 15)
@ApiModelProperty(value = "工位id") @ApiModelProperty(value = "工位id")
@Dict(dictTable = "station", dicCode = "id", dicText = "station_name") // @Dict(dictTable = "station", dicCode = "id", dicText = "station_name")
private String stationId; private String stationId;
@ApiModelProperty(value = "工位名称")
private String stationName;
@TableField(exist = false)
private List<StationVo> stationIdList;
} }

@ -4,6 +4,8 @@ package org.jeecg.modules.hanger.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.hanger.entity.ZyHangPoint; import org.jeecg.modules.hanger.entity.ZyHangPoint;
import java.util.List;
/** /**
* @Description: 吊挂工位表 * @Description: 吊挂工位表
* @Author: jeecg-boot * @Author: jeecg-boot
@ -13,4 +15,8 @@ import org.jeecg.modules.hanger.entity.ZyHangPoint;
public interface IZyHangPointService extends IService<ZyHangPoint> { public interface IZyHangPointService extends IService<ZyHangPoint> {
String getLastPointCode(); String getLastPointCode();
void addBatch(List<ZyHangPoint> pointList);
void syncHangRecord(ZyHangPoint zyHangPoint);
} }

@ -3,13 +3,22 @@ package org.jeecg.modules.hanger.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.hanger.entity.ZyHang;
import org.jeecg.modules.hanger.entity.ZyHangPoint; import org.jeecg.modules.hanger.entity.ZyHangPoint;
import org.jeecg.modules.hanger.mapper.ZyHangPointMapper; import org.jeecg.modules.hanger.mapper.ZyHangPointMapper;
import org.jeecg.modules.hanger.service.IZyHangPointService; import org.jeecg.modules.hanger.service.IZyHangPointService;
import org.jeecg.modules.hanger.service.IZyHangService;
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.stereotype.Service;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Optional;
/** /**
* @Description: 吊挂工位表 * @Description: 吊挂工位表
@ -20,6 +29,12 @@ import java.util.List;
@Service @Service
public class ZyHangPointServiceImpl extends ServiceImpl<ZyHangPointMapper, ZyHangPoint> implements IZyHangPointService { public class ZyHangPointServiceImpl extends ServiceImpl<ZyHangPointMapper, ZyHangPoint> implements IZyHangPointService {
@Autowired
private IStationService iStationService;
@Autowired
private IZyHangService iZyHangService;
@Override @Override
public String getLastPointCode() { public String getLastPointCode() {
List<ZyHangPoint> pointList = this.list(new LambdaQueryWrapper<ZyHangPoint>().orderByDesc(ZyHangPoint::getPoint)); List<ZyHangPoint> pointList = this.list(new LambdaQueryWrapper<ZyHangPoint>().orderByDesc(ZyHangPoint::getPoint));
@ -33,4 +48,26 @@ public class ZyHangPointServiceImpl extends ServiceImpl<ZyHangPointMapper, ZyHan
} }
return code; return code;
} }
@Override
public void addBatch(List<ZyHangPoint> pointList) {
Optional.ofNullable(pointList).orElse(new LinkedList<>()).forEach(e -> {
if (StringUtils.isNotBlank(e.getStationId())) {
Station station = iStationService.getById(e.getStationId());
if (!ObjectUtils.isEmpty(station)) {
e.setStationName(station.getStationName());
}
} else {
e.setStationName("");
}
});
this.saveOrUpdateBatch(pointList);
}
@Override
public void syncHangRecord(ZyHangPoint zyHangPoint) {
ZyHang zyHang = iZyHangService.getOne(new LambdaQueryWrapper<ZyHang>().eq(ZyHang::getCode, zyHangPoint.getCode()));
Optional.ofNullable(zyHang).orElseThrow(() -> new JeecgBootException(zyHangPoint.getCode() + "不存在"));
//TODO
}
} }

Loading…
Cancel
Save