From d6ee9fd5845828b4e8cd41bad9dd95f5bf1a8c10 Mon Sep 17 00:00:00 2001 From: zhc077 <565291854> Date: Thu, 12 Jan 2023 15:49:18 +0800 Subject: [PATCH] =?UTF-8?q?=E7=94=9F=E4=BA=A7=E8=AE=A1=E5=88=92=E6=8E=92?= =?UTF-8?q?=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; + } }