From d6ee9fd5845828b4e8cd41bad9dd95f5bf1a8c10 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Thu, 12 Jan 2023 15:49:18 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=8E=92=E4=BD=8D=E5=9B=BE=201.12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/productplan/ZyProductPlanList.vue | 106 ++++++++++++------ .../productplan/modules/ZyProductPlanForm.vue | 10 +- .../controller/ZyProductPlanController.java | 8 ++ .../productplan/entity/ZyProductPlan.java | 1 + .../productplan/entity/vo/PaiWeiTuVo.java | 31 +++++ .../service/IZyProductPlanService.java | 4 + .../impl/ZyProductPlanServiceImpl.java | 94 +++++++++++++++- 7 files changed, 214 insertions(+), 40 deletions(-) create mode 100644 jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/PaiWeiTuVo.java diff --git a/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue b/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue index 9540c7e7..98d770aa 100644 --- a/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue +++ b/ant-design-vue-jeecg/src/views/productplan/ZyProductPlanList.vue @@ -81,19 +81,8 @@ 删除 - + + 生产计划排位图 @@ -109,6 +98,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', @@ -164,11 +155,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 +196,7 @@ export default { }, { title: '审核时间', - width:150, + width: 150, align: "center", dataIndex: 'auditTimr', // customRender: function (text) { @@ -223,6 +214,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 +226,7 @@ export default { } }, created() { - this.getSuperFieldList(); + // this.getSuperFieldList(); }, computed: { // importExcelUrl: function(){ @@ -242,23 +234,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); + // }, + } } diff --git a/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue b/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue index c442ed61..78e17b87 100644 --- a/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue +++ b/ant-design-vue-jeecg/src/views/productplan/modules/ZyProductPlanForm.vue @@ -53,7 +53,8 @@ - + @@ -110,7 +111,7 @@ export default { data() { return { groupxVal: "groupx,group_name,id", - groupxVal2: "groupx,enterprises_manager,id", + groupxVal2: "sys_user,realname,id", model: {}, labelCol: { xs: {span: 24}, @@ -157,13 +158,10 @@ export default { }, methods: { 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 + "'"; }, 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); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java index afe88aa7..14a14b18 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java @@ -12,6 +12,7 @@ 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.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -57,6 +58,13 @@ public class ZyProductPlanController extends JeecgController getPaiweitu(ZyProductPlan zyProductPlan, HttpServletRequest request) { + PaiWeiTuVo paiweitu = zyProductPlanService.paiweitu(zyProductPlan); + return Result.OK(paiweitu); + } + /** * 添加 * diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java index 9f8a5495..2e6b8de5 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java @@ -89,6 +89,7 @@ public class ZyProductPlan implements Serializable { */ @Excel(name = "组长", width = 15) @ApiModelProperty(value = "组长") + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id") private String teamLeader; /** * 生产开始时间 diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/PaiWeiTuVo.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/PaiWeiTuVo.java new file mode 100644 index 00000000..4c025db5 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/PaiWeiTuVo.java @@ -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 list; +} + diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyProductPlanService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyProductPlanService.java index c8ac6659..c918771f 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyProductPlanService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyProductPlanService.java @@ -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 { + PaiWeiTuVo paiweitu(ZyProductPlan zyProductPlan); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyProductPlanServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyProductPlanServiceImpl.java index 2d9d21e5..04709830 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyProductPlanServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyProductPlanServiceImpl.java @@ -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 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().eq(WorkOrder::getProductCode, productPlan.getProductCode())); + if (ObjectUtils.isEmpty(workOrder)) + throw new JeecgBootException(productPlan.getProductCode() + "工单信息不存在"); + + String ordersId = workOrder.getOrdersId(); + OrderGoods orderGoods = iOrderGoodsService.getOne(new LambdaQueryWrapper().eq(OrderGoods::getOrdersId, ordersId)); + if (ObjectUtils.isEmpty(orderGoods)) throw new JeecgBootException(ordersId + "订单商品信息不存在"); + + ZyOrders zyOrders = iZyOrdersService.getOne(new LambdaQueryWrapper().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 planProcessList = iZyPlanProcessService + .list(new LambdaQueryWrapper() + .eq(ZyPlanProcess::getPlanId, plan.getId())); + if (!ObjectUtils.isEmpty(planProcessList)) { + planProcessList.forEach(e -> { + if (StringUtils.isNotBlank(e.getUserIds())) { + List 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; + } } From 0324560fc1df2aaa55602a556f8cc60d0d4eace4 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Fri, 13 Jan 2023 11:38:26 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E8=AE=A1=E5=88=92=E5=B7=A5=E5=BA=8F?= =?UTF-8?q?=E4=BC=98=E5=8C=96=201.13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productplan/ZyPlanProcessDataList.vue | 107 ++++++------- .../views/productplan/ZyPlanProcessList.vue | 149 ++++++------------ .../controller/ZyPlanProcessController.java | 24 ++- .../productplan/entity/ZyPlanProcess.java | 18 ++- .../productplan/entity/vo/ProcessDataVo.java | 5 +- .../service/IZyPlanProcessService.java | 2 +- .../impl/ZyPlanProcessServiceImpl.java | 108 +++++++------ 7 files changed, 192 insertions(+), 221 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue index f0141f6d..56c45bc0 100644 --- a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue +++ b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue @@ -1,10 +1,10 @@ @@ -44,7 +55,7 @@ export default { return { toolbarConfig: { // add 新增按钮;remove 删除按钮;clearSelection 清空选择按钮 - btn: ['save'] + btn: ['save',] }, description: '生产计划工序管理页面', loading: false, @@ -65,13 +76,20 @@ 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: [], @@ -92,42 +110,31 @@ export default { 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,7 +149,8 @@ export default { planId: "", dictOptions: {}, superFieldList: [], - stationList: [], + stationId: [], + stationIdList: [], toolsList: [], machineList: [], clickTrue: true, @@ -154,23 +162,17 @@ export default { // 【整体保存】点击保存按钮时触发的事件 handleTableSave({$table, target}) { - console.log("保存开始-----") + console.log("生产计划工序保存开始-----------------") // 校验整个表格 $table.validate().then((errMap) => { // 校验通过 if (!errMap) { // 获取所有数据 let tableData = target.getTableData() - tableData.forEach(item => { - item.id = ''; - }) + // 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 @@ -219,7 +221,8 @@ export default { getAction(this.url.list, params).then((res) => { if (res.success) { this.dataSource = res.result.records || res.result; - this.stationList = this.dataSource[0].stationList; + // this.stationId = this.dataSource[0].stationId; + this.stationIdList = this.dataSource[0].stationIdList; } 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) @@ -248,15 +251,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 = [] + target.$refs.vxe.columns[6].options = this.stationIdList; }, /** 当选项被改变时,联动其他组件 */ handleValueChange(event) { diff --git a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue index fd3b237b..fc351c8c 100644 --- a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue +++ b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessList.vue @@ -63,41 +63,41 @@ - - - - {{ text }} - - + + + + + + + + - - - - {{ text }} - - + + + + + + + + - - - - {{ text }} - - + + + + + + + + - - - - {{ text }} - - + + + + + + + + @@ -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 { // }, } } - - \ No newline at end of file + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java index ec6c7b07..3a3a8d48 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyPlanProcessController.java @@ -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 queryWrapper = QueryGenerator.initQueryWrapper(zyPlanProcess, req.getParameterMap()); Page page = new Page(pageNo, pageSize); - List processDatalist = zyPlanProcessService.getProcessDatalist(zyPlanProcess); - PageList processDataVos = new PageList<>(processDatalist, processDatalist.size()); +// List processDatalist = zyPlanProcessService.getProcessDatalist(zyPlanProcess); + List processDatalist = zyPlanProcessService.getProcessDatalist(zyPlanProcess); +// PageList processDataVos = new PageList<>(processDatalist, processDatalist.size()); return Result.OK(processDatalist); } @@ -156,14 +163,17 @@ public class ZyPlanProcessController extends JeecgController addProcessBatch(@RequestBody List zyPlanProcessList) { if (!ObjectUtils.isEmpty(zyPlanProcessList)) { - zyPlanProcessService.remove(new LambdaQueryWrapper() - .eq(ZyPlanProcess::getPlanId, zyPlanProcessList.get(0).getPlanId())); - - zyPlanProcessService.saveBatch(zyPlanProcessList); +// zyPlanProcessService.remove(new LambdaQueryWrapper() +// .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("添加成功!"); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java index a9f03775..ffd14d16 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyPlanProcess.java @@ -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 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; /** * 输入产品 */ diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java index 92401616..f478e1ec 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/vo/ProcessDataVo.java @@ -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 stationList; + //工位 + private List stationId; + private String groupName; //班组成员列表 diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java index 7a20f520..bf2bdbbf 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/IZyPlanProcessService.java @@ -15,7 +15,7 @@ import java.util.List; */ public interface IZyPlanProcessService extends IService { - List getProcessDatalist(ZyPlanProcess zyPlanProcess); + List getProcessDatalist(ZyPlanProcess zyPlanProcess); List getTeamDatalist(ZyPlanProcess zyPlanProcess); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java index 17305470..c9c82979 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/service/impl/ZyPlanProcessServiceImpl.java @@ -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 getProcessDatalist(ZyPlanProcess zyPlanProcess) { + public List getProcessDatalist(ZyPlanProcess zyPlanProcess) { //生产计划id String planId = zyPlanProcess.getPlanId(); ZyProductPlan zyProductPlan = iZyProductPlanService.getById(planId); @@ -73,61 +80,62 @@ public class ZyPlanProcessServiceImpl extends ServiceImpl().eq(ZyProduct::getWorkOrderId, workOrderId)); + if (ObjectUtils.isEmpty(zyProduct)) { + throw new JeecgBootException("产品不存在!"); + } List result = new LinkedList<>(); - - SysDepart depart = iSysDepartService.getById(departId); - List stationList = iStationService.list(new LambdaQueryWrapper().eq(Station::getDepartId, departId)); - List 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 planProcessList = this.list(new LambdaQueryWrapper().eq(ZyPlanProcess::getPlanId, planId)); + //生产计划工序表没有对应工序时,说明没有制定过该产品的生产工序计划,先把该产品对应的基本工序数据插入到生产计划工序表 + if (ObjectUtils.isEmpty(planProcessList)) { + List productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper().eq(ZyProductProcess::getProductId, zyProduct.getId())); + if (!ObjectUtils.isEmpty(planProcessList)) { + List 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().eq(ZyPlanProcess::getPlanId, planId)); + } } - List planProcessList = this.list(new LambdaQueryWrapper().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 productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper().eq(ZyProductProcess::getProductId, "产品id")); - List productProcessesList = iZyProductProcessService.list(new LambdaQueryWrapper().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 stationList = iStationService.list(new LambdaQueryWrapper().eq(Station::getDepartId, departId)); + List 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 From c5894d0d10124caf113faedf3cd1a116135efdd7 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Fri, 13 Jan 2023 18:53:48 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E7=8F=AD=E7=BB=84=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=A4=84=E7=90=86=201.13?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../productplan/ZyPlanProcessDataList.vue | 33 +++++++-------- .../src/views/team/modules/GroupxModal.vue | 18 +++++++-- .../src/views/team/modules/StationModal.vue | 35 ++++++++++++---- .../team/service/impl/StationServiceImpl.java | 40 +++++++++++++++++-- 4 files changed, 94 insertions(+), 32 deletions(-) diff --git a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue index 56c45bc0..4b7441d4 100644 --- a/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue +++ b/ant-design-vue-jeecg/src/views/productplan/ZyPlanProcessDataList.vue @@ -27,12 +27,6 @@ @@ -95,16 +89,27 @@ export default { 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: [], @@ -150,7 +155,7 @@ export default { dictOptions: {}, superFieldList: [], stationId: [], - stationIdList: [], + stationList: [], toolsList: [], machineList: [], clickTrue: true, @@ -169,11 +174,7 @@ export default { if (!errMap) { // 获取所有数据 let tableData = target.getTableData() - // tableData.forEach(item => { - // item.id = ''; - // }) console.log('当前保存的数据是:', tableData) - // 【模拟保存】 this.loading = true postAction(this.url.addProcessBatch, tableData).then(res => { @@ -222,7 +223,7 @@ export default { if (res.success) { this.dataSource = res.result.records || res.result; // this.stationId = this.dataSource[0].stationId; - this.stationIdList = this.dataSource[0].stationIdList; + 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 + "')"; this.$message.warning(res.message) @@ -253,7 +254,7 @@ export default { const {type, row, column, value, target, $table} = event console.log(JSON.stringify(this.stationIdList)); // target.$refs.vxe.columns[6].dictCode = this.stationIdCode; - target.$refs.vxe.columns[6].options = this.stationIdList; + target.$refs.vxe.columns[6].options = this.stationList; }, /** 当选项被改变时,联动其他组件 */ handleValueChange(event) { diff --git a/ant-design-vue-jeecg/src/views/team/modules/GroupxModal.vue b/ant-design-vue-jeecg/src/views/team/modules/GroupxModal.vue index e0a7a31a..a18ee2b0 100644 --- a/ant-design-vue-jeecg/src/views/team/modules/GroupxModal.vue +++ b/ant-design-vue-jeecg/src/views/team/modules/GroupxModal.vue @@ -11,13 +11,22 @@ - - + + + + + + @@ -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')"; }, diff --git a/ant-design-vue-jeecg/src/views/team/modules/StationModal.vue b/ant-design-vue-jeecg/src/views/team/modules/StationModal.vue index e9c3379e..0ab73814 100644 --- a/ant-design-vue-jeecg/src/views/team/modules/StationModal.vue +++ b/ant-design-vue-jeecg/src/views/team/modules/StationModal.vue @@ -12,14 +12,19 @@ - - - - + - - - + + + + + @@ -37,7 +42,7 @@ \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java index 14a14b18..4723bc78 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/controller/ZyProductPlanController.java @@ -1,12 +1,14 @@ 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; @@ -14,10 +16,15 @@ 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; @@ -36,6 +43,11 @@ public class ZyProductPlanController extends JeecgController add(@RequestBody ZyProductPlan zyProductPlan) { + String productCode = zyProductPlan.getProductCode(); + ZyProduct zyProduct = iZyProductService.getOne(new LambdaQueryWrapper().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("添加成功!"); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java index 2e6b8de5..46fa78b4 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/productplan/entity/ZyProductPlan.java @@ -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 */ diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationServiceImpl.java index 5d03e585..555cd425 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/team/service/impl/StationServiceImpl.java @@ -53,21 +53,11 @@ public class StationServiceImpl extends ServiceImpl impl if (maxStationNum.intValue() != entity.getStationNum()) { //先把下一编号减1 Station station1 = this.getOne(new LambdaQueryWrapper().eq(Station::getStationNum, entity.getStationNum() + 1)); -// station1.setStationNum(null); this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, station1.getId()).update(); - -// Station station = new Station(); -// station.setId(id); -// station.setStationNum(null); this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, id).update(); -// station.setStationNum(entity.getStationNum() + 1); -// this.updateById(station); this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum() + 1).eq(Station::getId, id).update(); - this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum() - 1).eq(Station::getId, station1.getId()).update(); - -// station1.setStationNum(entity.getStationNum() - 1); -// this.updateById(station1); + this.lambdaUpdate().set(Station::getStationNum, entity.getStationNum()).eq(Station::getId, station1.getId()).update(); } } @@ -81,19 +71,11 @@ public class StationServiceImpl extends ServiceImpl impl if (entity.getStationNum() > 1) { //先把上一编号加1 Station station1 = this.getOne(new LambdaQueryWrapper().eq(Station::getStationNum, entity.getStationNum() - 1)); - station1.setStationNum(null); - this.updateById(station1); - - Station station = new Station(); - station.setId(id); - station.setStationNum(null); - this.updateById(station); - + this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, station1.getId()).update(); + this.lambdaUpdate().set(Station::getStationNum, null).eq(Station::getId, id).update(); - station.setStationNum(entity.getStationNum() - 1); - this.updateById(station); - station1.setStationNum(entity.getStationNum() + 1); - this.updateById(station1); + 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(); } } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/entity/ZyProduct.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/entity/ZyProduct.java index 72b95bd3..20d408fa 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/entity/ZyProduct.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/entity/ZyProduct.java @@ -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 = "工单")