diff --git a/ant-design-vue-jeecg/src/views/zyWorkProduct/ZyProductList.vue b/ant-design-vue-jeecg/src/views/zyWorkProduct/ZyProductList.vue index 2c5bdcc2..1c853513 100644 --- a/ant-design-vue-jeecg/src/views/zyWorkProduct/ZyProductList.vue +++ b/ant-design-vue-jeecg/src/views/zyWorkProduct/ZyProductList.vue @@ -4,6 +4,56 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 查询 + 重置 + + + + + +
@@ -68,22 +118,27 @@ - 详情 + 工序 + + + 模块 + + + 面料 + + + 辅料 + + + 设备 + + + 工具 + + + 详情 + - - - - - - - - - - - - - - @@ -127,62 +182,78 @@ dataIndex: 'productCode' }, { - title:'工单', + title:'产品名称', align:"center", - dataIndex: 'workOrderId' + dataIndex: 'productName' }, { - title:'生产时间', + title:'工单编号', align:"center", - dataIndex: 'produceTime' + dataIndex: 'workCode' }, { - title:'合计(手工TMU)', + title:'客户姓名', align:"center", - dataIndex: 'totalManualTmu' + dataIndex: 'realname' }, { - title:'合计(设备TMU)', + title:'产品图片', align:"center", - dataIndex: 'totalMachineTmu' + dataIndex: 'productPicture', + scopedSlots: {customRender: 'imgSlot'} }, { - title:'合计(手工秒)', + title:'结构图', align:"center", - dataIndex: 'totalMaunal' + dataIndex: 'structureDiagram', + scopedSlots: {customRender: 'imgSlot'} }, { - title:'合计(设备秒)', + title:'排料图', align:"center", - dataIndex: 'totalMachine' + dataIndex: 'layoutDiagram', + scopedSlots: {customRender: 'imgSlot'} }, { - title:'企业', + title:'款式', align:"center", - dataIndex: 'enterprisesId' + dataIndex: 'typeName' }, { - title:'用户', + title:'型号', align:"center", - dataIndex: 'userId' + dataIndex: 'modelNumber' }, + { - title:'结构图', + title:'合计(手工TMU)', align:"center", - dataIndex: 'structureDiagram', - scopedSlots: {customRender: 'imgSlot'} + dataIndex: 'totalManualTmu' }, { - title:'排料图', + title:'合计(设备TMU)', align:"center", - dataIndex: 'layoutDiagram', - scopedSlots: {customRender: 'imgSlot'} + dataIndex: 'totalMachineTmu' }, { - title:'产品图片', + title:'合计(手工秒)', align:"center", - dataIndex: 'productPicture', - scopedSlots: {customRender: 'imgSlot'} + dataIndex: 'totalMaunal' + }, + { + title:'合计(设备秒)', + align:"center", + dataIndex: 'totalMachine' + }, + { + title:'生产时间', + align:"center", + dataIndex: 'produceTime' + }, + { + title:'生产企业', + align:"center", + dataIndex: 'departName' }, { title:'身高', @@ -281,6 +352,79 @@ methods: { initDictConfig(){ }, + + //操作:工序、模块、面料、辅料、设备、工具,提供入口,具体功能由相关功能负责人完成 + //跳转-模块 + jumpProcesses(record) + { + this.$router.push({ + path: '/src/views/product/productProcess/ZyProductProcessList', + // query: { // 路由携带参数 + // 'pid': record.id, + // 'tname': record.name, + // } + }); + }, + //跳转-模块 + jumpModules(record) + { + this.$router.push({ + path: '/src/views/product/productModule/ProductModuleList', + // query: { // 路由携带参数 + // 'pid': record.id, + // 'tname': record.name, + // } + }); + }, + //跳转-面料 + jumpFabrics(record) + { + this.$router.push({ + path: '/src/views/product/pdfabric/ProductFabricList', + // query: { // 路由携带参数 + // 'pid': record.id, + // 'tname': record.name, + // } + }); + }, + //跳转-辅料 + jumpAccessories(record) + { + this.$router.push({ + path: '/src/views/duct/pdaccessories/ProductAccessoriesList', + // query: { // 路由携带参数 + // 'pid': record.id, + // 'tname': record.name, + // } + }); + }, + //跳转-设备 + jumpEquipment(record) + { + this.$router.push({ + path: '/src/views/product/pdmachine/ProductMachineList', + // query: { // 路由携带参数 + // 'pid': record.id, + // 'tname': record.name, + // } + }); + }, + //跳转-工具 + jumpTools(record) + { + this.$router.push({ + path: '/src/views/product/pdoperationtool/ProductOperationtoolList', + // query: { // 路由携带参数 + // 'pid': record.id, + // 'tname': record.name, + // } + }); + }, + onproducetimeChange: function (value, dateString) { + console.log(dateString[0],dateString[1]); + this.queryParam.produceTimeBegin=dateString[0]; + this.queryParam.produceTimeEnd=dateString[1]; + }, getSuperFieldList(){ let fieldList=[]; fieldList.push({type:'string',value:'productCode',text:'产品编号',dictCode:''}) diff --git a/ant-design-vue-jeecg/src/views/zyWorkorderManagement/ZyWorkOrderList.vue b/ant-design-vue-jeecg/src/views/zyWorkorderManagement/ZyWorkOrderList.vue index 25894e69..da8c5137 100644 --- a/ant-design-vue-jeecg/src/views/zyWorkorderManagement/ZyWorkOrderList.vue +++ b/ant-design-vue-jeecg/src/views/zyWorkorderManagement/ZyWorkOrderList.vue @@ -94,6 +94,14 @@ 产品管理 + 制单 + + + + 撤销工单 + + + 详情 @@ -113,7 +121,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin' import WorkOrderModal from '@/views/workorder/modules/WorkOrderModal' import ZyProductModal from '@/views/zyWorkProduct/modules/ZyProductModal' - + import {getAction } from '@/api/manage' export default { name: 'ZyWorkOrderList', mixins:[JeecgListMixin, mixinDevice], @@ -197,7 +205,7 @@ deleteBatch: "/workOrder/workOrder/deleteBatch", exportXlsUrl: "/workOrder/workOrder/exportXls", importExcelUrl: "workOrder/workOrder/importExcel", - + cancellationWorkOrderUrl:"workOrder/workOrder/cancellationWorkOrder", }, dictOptions:{}, } @@ -212,6 +220,29 @@ methods: { initDictConfig(){ }, + //跳转-制单 + jumpMaking(record) + { + this.$router.push({ + path: '/src/views/maker/ZyMakerList', + // query: { // 路由携带参数 + // 'pid': record.id, + // 'tname': record.name, + // } + }); + }, + //撤销派单 + cancellationWorkOrder(workId) { + // 新增/修改 成功时,重载列表 + getAction(this.url.cancellationWorkOrderUrl,{'id':workId}).then((res) => { + if (res.success) { + this.$message.success("撤销成功!"); + this.loadData(); + }else{ + this.$message.error(res.message); + } + }) + }, handleProductDetail(record){ this.$refs.productForm.edit(record); this.$refs.productForm.title="产品管理"; diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/ordergoods/entity/OrderGoods.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/ordergoods/entity/OrderGoods.java index 2a609fcc..e3bcb95c 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/ordergoods/entity/OrderGoods.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/ordergoods/entity/OrderGoods.java @@ -102,16 +102,18 @@ public class OrderGoods implements Serializable { @Excel(name = "商品视频", width = 15) @ApiModelProperty(value = "商品视频") private java.lang.String goodsVideo; + /**服装款式*/ + @Excel(name = "服装款式", width = 15) + @Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") + @ApiModelProperty(value = "服装款式id") + private java.lang.String styleId; + /**服装类型id*/ @Excel(name = "服装类型id", width = 15) @Dict(dictTable = "zy_cloths_type ", dicText = "type_name", dicCode = "id") @ApiModelProperty(value = "服装类型id") private java.lang.String clothsTypeId; - /**款式id*/ - @Excel(name = "款式id", width = 15) - @Dict(dictTable = "zy_cloths_style", dicText = "style_names", dicCode = "id") - @ApiModelProperty(value = "款式id") - private java.lang.String styleId; + /**型号id*/ @Excel(name = "型号id", width = 15) @Dict(dictTable = "zy_style_model", dicText = "model_number", dicCode = "id") diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/productModule/entity/ProductModule.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/productModule/entity/ProductModule.java index 382f035d..9b01717d 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/productModule/entity/ProductModule.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/productModule/entity/ProductModule.java @@ -10,6 +10,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import org.jeecg.common.aspect.annotation.Dict; import org.jeecgframework.poi.excel.annotation.Excel; import org.springframework.format.annotation.DateTimeFormat; @@ -63,6 +64,7 @@ public class ProductModule implements Serializable { private String styleModuleId; /**模块id*/ @Excel(name = "模块id", width = 15) + @Dict(dictTable = "zy_cloths_modular ", dicText = "modular_name", dicCode = "id") @ApiModelProperty(value = "模块id") private String moduleId; /**部位*/ diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java index 08f6507a..c9db1de8 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java @@ -1,5 +1,6 @@ package org.jeecg.modules.workorder.controller; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -21,8 +22,24 @@ import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; import org.jeecg.modules.demo.customermeasure.service.ICustomerMeasureService; import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; import org.jeecg.modules.demo.ordergoods.service.IOrderGoodsService; +import org.jeecg.modules.demo.ordergoodsaccessories.entity.OrderGoodsAccessories; +import org.jeecg.modules.demo.ordergoodsaccessories.service.IOrderGoodsAccessoriesService; +import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric; +import org.jeecg.modules.demo.ordergoodsfabric.service.IOrderGoodsFabricService; +import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; +import org.jeecg.modules.demo.ordergoodsmodule.service.IOrderGoodsModuleService; +import org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular; +import org.jeecg.modules.demo.zyStyleModular.service.IZyStyleModularService; import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.demo.zyorders.service.IZyOrdersService; +import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories; +import org.jeecg.modules.product.pdaccessories.service.IProductAccessoriesService; +import org.jeecg.modules.product.pdfabric.entity.ProductFabric; +import org.jeecg.modules.product.pdfabric.service.IProductFabricService; +import org.jeecg.modules.product.productModule.entity.ProductModule; +import org.jeecg.modules.product.productModule.service.IProductModuleService; +import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess; +import org.jeecg.modules.product.zyproductprocess.service.IZyProductProcessService; import org.jeecg.modules.system.entity.SysDepart; import org.jeecg.modules.system.service.ISysDepartService; import org.jeecg.modules.workorder.entity.WorkOrder; @@ -65,38 +82,15 @@ import org.jeecg.common.aspect.annotation.AutoLog; public class WorkOrderController extends JeecgController { @Autowired private IWorkOrderService workOrderService; - //订单 @Autowired private IZyOrdersService zyOrdersService; - //订单商品 - @Autowired - private IOrderGoodsService orderGoodsService; - - //工单产品 - @Autowired - private IZyProductService zyProductService; - - //款式 - @Autowired - private IZyClothsStyleService zyClothsStyleService; - - //型号 - @Autowired - private IZyStyleModelService zyStyleModelService; - - //顾客测体 - @Autowired - private ICustomerMeasureService customerMeasureService; - - //成衣样板 - @Autowired - private IZyClothSampleService zyClothSampleService; - //部门 @Autowired private ISysDepartService sysDepartService; + + /** * 分页列表查询 * @@ -309,100 +303,8 @@ public class WorkOrderController extends JeecgController ogWrapper=new QueryWrapper(); - ogWrapper.eq("orders_id",orderId); - List ogList=orderGoodsService.list(ogWrapper); - if(ogList.size()>0) - {//start if 02 - // 保存工单 - OrderGoods ogModel=ogList.get(0); - - //服装款式 - //QueryWrapper csWrapper=new QueryWrapper(); - ZyClothsStyle csModel=zyClothsStyleService.getById(ogModel.getStyleId()); - //服装型号 - //QueryWrapper sm=new QueryWrapper(); - ZyStyleModel smModel=zyStyleModelService.getById(ogModel.getModelId()); - if(csModel==null ||smModel==null) - { - return Result.error("该订单服装型号或服装款式不存在,请检查后在操作!"); - } - //得到结构图和排排料图 - QueryWrapper csWrapper=new QueryWrapper(); - csWrapper.eq("style_id",ogModel.getStyleId()); - csWrapper.eq("stylemodel_id",ogModel.getModelId()); - List csList=zyClothSampleService.list(csWrapper); - if(csList.size()<=0) - { - return Result.error("商品成衣样板不存在,请检查后在操作!"); - } - ZyClothSample cSampleModel=csList.get(0); - - int goodNum=ogModel.getGoodsNum(); - WorkOrder workOrder=new WorkOrder(); - workOrder.setProductCode(CreateWorkCode(csModel.getNums(),smModel.getModelNumber()));//工单编号 - workOrder.setOrdersId(orderId);//订单id - workOrder.setOrderGoodsId(ogModel.getId());// 订单商品 - workOrder.setGoodsNum(goodNum);//商品数量 - workOrder.setOrderTime(zyOrders.getOrderTime());//下单时间 - workOrder.setDeliveryTime(zyOrders.getDeliveryTime());//交货期 - workOrder.setWorkOrderStatus(0);//工单状态 - workOrder.setEnterprisesId(depId);//企业id - workOrderService.save(workOrder); - - //保存产品 - if(ogModel.getGoodsNum()>0) - { - //量体数据 - CustomerMeasure mesureModel=customerMeasureService.getById(ogModel.getMeasureId()); - if(mesureModel==null) { - return Result.error("未找到对客户量体数据!"); - } - - - for(int i=0;i cancellationWorkOrder(@RequestParam(name="id",required=true) String id,HttpServletRequest req) { + WorkOrder woModel=workOrderService.getById(id); + if(woModel==null) { + return Result.error("未找到对应数据!"); + }else{ +// 增加撤销操作,点击撤销删除工单和对应的产品,订单状态改为派单前的状态。 +// * 撤销操作,同时会撤销产品模块、产品面料、产品辅料、产品工序、以及制单数据 - /** - * - * @param workCode 工单编号 - * @return - */ - private String CreateProductCode(String workCode) - {//编号规则:工单编号(22)+顺序号(8) - String mrstr = "00000000"; - int listsize = zyProductService.count(); - int strsize = listsize+1; - String str = strsize+""; - int strlength = str.length(); - String substr = mrstr.substring(0,mrstr.length()-strlength); - String produceCode = workCode+substr+str; - return produceCode; + //修改订单状态 + ZyOrders zyOrders = zyOrdersService.getById(woModel.getOrdersId()); + zyOrders.setDeliveryStatus(2); + zyOrdersService.updateById(zyOrders); + } + + + return Result.OK("成功"); } + + + + } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/IWorkOrderService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/IWorkOrderService.java index 122bd861..5f9d638b 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/IWorkOrderService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/IWorkOrderService.java @@ -4,6 +4,8 @@ package org.jeecg.modules.workorder.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.workorder.entity.WorkOrder; import org.jeecg.modules.workorder.entity.WorkOrderVo; @@ -17,4 +19,7 @@ public interface IWorkOrderService extends IService { //自定义分页查询 IPage selectPage(Page page, WorkOrderVo workOrder); + + //派单 + Result paidan(ZyOrders zyOrders,String depId); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java index fed4c568..ae97e4b7 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java @@ -1,16 +1,50 @@ package org.jeecg.modules.workorder.service.impl; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import org.jeecg.common.api.vo.Result; +import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; +import org.jeecg.modules.demo.customermeasure.mapper.CustomerMeasureMapper; +import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; +import org.jeecg.modules.demo.ordergoods.mapper.OrderGoodsMapper; +import org.jeecg.modules.demo.ordergoodsaccessories.entity.OrderGoodsAccessories; +import org.jeecg.modules.demo.ordergoodsaccessories.mapper.OrderGoodsAccessoriesMapper; +import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric; +import org.jeecg.modules.demo.ordergoodsfabric.mapper.OrderGoodsFabricMapper; +import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; +import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper; +import org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular; +import org.jeecg.modules.demo.zyStyleModular.mapper.ZyStyleModularMapper; +import org.jeecg.modules.demo.zyorders.entity.ZyOrders; +import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories; +import org.jeecg.modules.product.pdaccessories.mapper.ProductAccessoriesMapper; +import org.jeecg.modules.product.pdfabric.entity.ProductFabric; +import org.jeecg.modules.product.pdfabric.mapper.ProductFabricMapper; +import org.jeecg.modules.product.productModule.entity.ProductModule; +import org.jeecg.modules.product.productModule.mapper.ProductModuleMapper; +import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess; import org.jeecg.modules.workorder.entity.WorkOrder; import org.jeecg.modules.workorder.entity.WorkOrderVo; import org.jeecg.modules.workorder.mapper.WorkOrderMapper; import org.jeecg.modules.workorder.service.IWorkOrderService; +import org.jeecg.modules.workproduct.entity.ZyProduct; +import org.jeecg.modules.workproduct.mapper.ZyProductMapper; +import org.jeecg.modules.zyclothsample.entity.ZyClothSample; +import org.jeecg.modules.zyclothsample.mapper.ZyClothSampleMapper; +import org.jeecg.modules.zyclothsstyle.entity.ZyClothsStyle; +import org.jeecg.modules.zyclothsstyle.mapper.ZyClothsStyleMapper; +import org.jeecg.modules.zystylemodel.entity.ZyStyleModel; +import org.jeecg.modules.zystylemodel.mapper.ZyStyleModelMapper; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import java.util.ArrayList; +import java.util.List; + /** * @Description: 工单订单完工 * @Author: jeecg-boot @@ -20,6 +54,57 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class WorkOrderServiceImpl extends ServiceImpl implements IWorkOrderService { + //订单商品 + @Autowired + private OrderGoodsMapper orderGoodsMapper; + + //服装款式表 + @Autowired + private ZyClothsStyleMapper clothsStyleMapper; + + //服装型号 + @Autowired + private ZyStyleModelMapper styleModelMapper; + + //成衣样板 + @Autowired + private ZyClothSampleMapper clothSampleMapper; + + //顾客测体 + @Autowired + private CustomerMeasureMapper customerMeasureMapper; + + //工单产品 + @Autowired + private ZyProductMapper productMapper; + + //工序 + @Autowired + private ZyStyleModularMapper styleModularMapper; + + //订单商品模块表 + @Autowired + private OrderGoodsModuleMapper orderGoodsModuleMapper; + //产品模块 + @Autowired + private ProductModuleMapper productModuleMapper; + + //订单商品面料表 + @Autowired + private OrderGoodsFabricMapper orderGoodsFabricMapper; + //产品面料表 + @Autowired + private ProductFabricMapper productFabricMapper; + + //订单商品辅料表 + @Autowired + private OrderGoodsAccessoriesMapper orderGoodsAccessoriesMapper; + //产品辅料表 + @Autowired + private ProductAccessoriesMapper productAccessoriesMapper; + + + /** * 自定义分页查询 * @param page @@ -30,4 +115,256 @@ public class WorkOrderServiceImpl extends ServiceImpl selectPage(Page page, WorkOrderVo workOrder) { return baseMapper.selectListPage(page,workOrder); } + + /** + * 派单 + * @param zyOrders + * @return + */ + @Override + public Result paidan(ZyOrders zyOrders,String depId) { + //订单ID + String orderId=zyOrders.getId(); + //商品订单是否存在 + QueryWrapper ogWrapper=new QueryWrapper(); + ogWrapper.eq("orders_id",orderId); + List ogList=orderGoodsMapper.selectList(ogWrapper); + if(ogList.size()>0) + {//start if 02 + // 保存工单 + OrderGoods ogModel=ogList.get(0); + + //服装款式 + //QueryWrapper csWrapper=new QueryWrapper(); + ZyClothsStyle csModel=clothsStyleMapper.selectById(ogModel.getStyleId()); + + + //服装型号 + //QueryWrapper sm=new QueryWrapper(); + ZyStyleModel smModel=styleModelMapper.selectById(ogModel.getModelId()); + if(csModel==null ||smModel==null) + { + return Result.error("该订单服装型号或服装款式不存在,请检查后在操作!"); + } + //得到结构图和排排料图 + QueryWrapper csWrapper=new QueryWrapper(); + csWrapper.eq("style_id",ogModel.getStyleId()); + csWrapper.eq("stylemodel_id",ogModel.getModelId()); + //成衣样板 + List csList=clothSampleMapper.selectList(csWrapper); + if(csList.size()<=0) + { + return Result.error("商品成衣样板不存在,请检查后在操作!"); + } + ZyClothSample cSampleModel=csList.get(0); + + int goodNum=ogModel.getGoodsNum(); + WorkOrder workOrder=new WorkOrder(); + workOrder.setProductCode(CreateWorkCode(csModel.getNums(),smModel.getModelNumber()));//工单编号 + workOrder.setOrdersId(orderId);//订单id + workOrder.setOrderGoodsId(ogModel.getId());// 订单商品 + workOrder.setGoodsNum(goodNum);//商品数量 + workOrder.setOrderTime(zyOrders.getOrderTime());//下单时间 + workOrder.setDeliveryTime(zyOrders.getDeliveryTime());//交货期 + workOrder.setWorkOrderStatus(0);//工单状态 + workOrder.setEnterprisesId(depId);//企业id + baseMapper.insert(workOrder); + //保存产品 + if(ogModel.getGoodsNum()>0) + { + //量体数据 + CustomerMeasure mesureModel=customerMeasureMapper.selectById(ogModel.getMeasureId()); + if(mesureModel==null) { + return Result.error("未找到对客户量体数据!"); + } + + + for(int i=0;i styleModularLWrapper=new QueryWrapper(); + styleModularLWrapper.eq("type_id",ogModel.getStyleId()); + List zyStyleModularList=styleModularMapper.selectList(styleModularLWrapper); + //将工序保存到产品工序中 + + + List productProcessList=new ArrayList<>(); + for(ZyStyleModular item:zyStyleModularList) + { + ZyProductProcess zpp=new ZyProductProcess(); + //zpp.setProductId()//产品id + +// /***/ +// @Excel(name = "产品id", width = 15) +// @ApiModelProperty(value = "产品id") +// @Dict(dictTable = "zy_product",dicText = "product_code",dicCode = "id") +// private String productId; +// /**工序id*/ +// @Excel(name = "工序id", width = 15) +// @ApiModelProperty(value = "工序id") +// @Dict(dictTable = "zy_process",dicText = "process_name",dicCode = "id") +// private String processId; +// /**序号*/ +// @Excel(name = "序号", width = 15) +// @ApiModelProperty(value = "序号") +// private Integer number; + productProcessList.add(zpp); + } + //zyProductProcessService.save() + //#endregion + + //#region 工具-添加(服装款式类型中读取) + + //#endregion + + //#region 设备-添加(服装款式类型中读取) + + //#endregion + + //#region 产品模块-添加(从订单中读取) + //订单商品模块表-根据订单商品id + QueryWrapper productModuleWrapper=new QueryWrapper(); + productModuleWrapper.eq("order_goods_id",ogModel.getId()); + List orderGoodsModuleList=orderGoodsModuleMapper.selectList(productModuleWrapper); + //循环保存 + List ProductModuleList=new ArrayList<>(); + for(OrderGoodsModule item:orderGoodsModuleList) + { + ProductModule pmModel=new ProductModule(); + pmModel.setProductId(productModel.getId());//产品id + pmModel.setStyleModuleId(item.getStyleModuleId());//款式模块id + pmModel.setModuleId(item.getModuleId());//模块id + //保存 + productModuleMapper.insert(pmModel); + //ProductModuleList.add(pmModel); + } + + //productModuleMapper.saveBatch(ProductModuleList); + //#endregion + + //#region 产品面料-添加(从订单中读取) + + //订单商品面料表-根据订单商品id + QueryWrapper ogFabricWrapper=new QueryWrapper(); + ogFabricWrapper.eq("order_goods_id",ogModel.getId()); + List orderGoodsFabricList=orderGoodsFabricMapper.selectList(ogFabricWrapper); + //循环保存 + List productFabricList=new ArrayList<>(); + for(OrderGoodsFabric item:orderGoodsFabricList) + { + ProductFabric ptModel=new ProductFabric(); + ptModel.setProductId(productModel.getId());//产品id + ptModel.setFabricId(item.getFabricId());//面料id + // productFabricList.add(ptModel); + //保存 + productFabricMapper.insert(ptModel); + } + //保存 + // productFabricMapper.saveBatch(productFabricList); + //#endregion + + //#region 产品辅料-添加(从订单中读取) + //订单商品辅料表-根据订单商品id + QueryWrapper ogAccessoriesWrapper=new QueryWrapper(); + ogAccessoriesWrapper.eq("order_goods_id",ogModel.getId()); + List orderGoodsAccessoriesList=orderGoodsAccessoriesMapper.selectList(ogAccessoriesWrapper); + //循环保存 + List productAccessoriesList=new ArrayList<>(); + for(OrderGoodsAccessories item:orderGoodsAccessoriesList) + { + ProductAccessories paModel=new ProductAccessories(); + paModel.setProductId(productModel.getId());//产品id + + productAccessoriesMapper.insert(paModel); + // productAccessoriesList.add(paModel); + } + //保存 + // productAccessoriesMapper.saveBatch(productAccessoriesList); + //#endregion + } + }else + { + return Result.error("订单商品数量小于0!"); + + } + + }else//end if 02 + { + return Result.error("订单商品数据未找到!"); + } + + return null; + } + + + //生成工单编号 + + /** + * + * @param styleCode 款式编号 + * @param modelCode 型号编号 + * @return + */ + private String CreateWorkCode(String styleCode,String modelCode) + {//编号规则:款式编号(10)+型号(4)+顺序号(8) + String mrstr = "00000000"; + QueryWrapper query = new QueryWrapper(); + int listsize = baseMapper.selectList(query).size(); + int strsize = listsize+1; + String str = strsize+""; + int strlength = str.length(); + String substr = mrstr.substring(0,mrstr.length()-strlength); + String workCode = styleCode+modelCode+substr+str; + return workCode; + } + + /** + * + * @param workCode 工单编号 + * @return + */ + private String CreateProductCode(String workCode) + {//编号规则:工单编号(22)+顺序号(8) + String mrstr = "00000000"; + QueryWrapper query = new QueryWrapper(); + int listsize = productMapper.selectList(query).size(); + int strsize = listsize+1; + String str = strsize+""; + int strlength = str.length(); + String substr = mrstr.substring(0,mrstr.length()-strlength); + String produceCode = workCode+substr+str; + return produceCode; + } } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/controller/ZyProductController.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/controller/ZyProductController.java index 5b0e085a..db52e18d 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/controller/ZyProductController.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/controller/ZyProductController.java @@ -19,6 +19,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; import org.jeecg.modules.workproduct.entity.ZyProduct; +import org.jeecg.modules.workproduct.entity.ZyProductVo; import org.jeecg.modules.workproduct.service.IZyProductService; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.def.NormalExcelConstants; @@ -62,13 +63,13 @@ public class ZyProductController extends JeecgController queryPageList(ZyProduct zyProduct, + public Result queryPageList(ZyProductVo zyProduct, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, HttpServletRequest req) { - QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyProduct, req.getParameterMap()); + //QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(zyProduct, req.getParameterMap()); Page page = new Page(pageNo, pageSize); - IPage pageList = zyProductService.page(page, queryWrapper); + IPage pageList = zyProductService.selectListPage(page, zyProduct); return Result.OK(pageList); } 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 e826ec6b..7a3a7251 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 @@ -64,6 +64,7 @@ public class ZyProduct implements Serializable { private String productName; /**工单*/ @Excel(name = "工单", width = 15) + @Dict(dictTable = "work_order", dicText = "product_code", dicCode = "id") @ApiModelProperty(value = "工单") private String workOrderId; /**生产时间*/ @@ -88,10 +89,12 @@ public class ZyProduct implements Serializable { private Integer totalMachine; /**企业*/ @Excel(name = "企业", width = 15) + @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") @ApiModelProperty(value = "企业") private String enterprisesId; /**用户*/ @Excel(name = "用户", width = 15) + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") @ApiModelProperty(value = "用户") private String userId; /**结构图*/ diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/entity/ZyProductVo.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/entity/ZyProductVo.java new file mode 100644 index 00000000..fc447a3c --- /dev/null +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/entity/ZyProductVo.java @@ -0,0 +1,183 @@ +package org.jeecg.modules.workproduct.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.jeecg.common.aspect.annotation.Dict; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.springframework.format.annotation.DateTimeFormat; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Description: 产品表 + * @Author: jeecg-boot + * @Date: 2023-01-07 + * @Version: V1.0 + */ +@Data +@TableName("zy_product") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="zy_product对象", description="产品表") +public class ZyProductVo implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private String sysOrgCode; + /**产品编号*/ + @Excel(name = "产品编号", width = 15) + @ApiModelProperty(value = "产品编号") + private String productCode; + + @Excel(name = "产品名称", width = 50) + @ApiModelProperty(value = "产品名称") + private String productName; + + /**工单编号*/ + @Excel(name = "工单", width = 15) + @ApiModelProperty(value = "工单") + private String workCode; + + /**生产时间*/ + @Excel(name = "生产时间", width = 15) + @ApiModelProperty(value = "生产时间") + private Integer produceTime; + /**合计(手工TMU)*/ + @Excel(name = "合计(手工TMU)", width = 15) + @ApiModelProperty(value = "合计(手工TMU)") + private Double totalManualTmu; + /**合计(设备TMU)*/ + @Excel(name = "合计(设备TMU)", width = 15) + @ApiModelProperty(value = "合计(设备TMU)") + private Double totalMachineTmu; + /**合计(手工秒)*/ + @Excel(name = "合计(手工秒)", width = 15) + @ApiModelProperty(value = "合计(手工秒)") + private Integer totalMaunal; + /**合计(设备秒)*/ + @Excel(name = "合计(设备秒)", width = 15) + @ApiModelProperty(value = "合计(设备秒)") + private Integer totalMachine; + /**企业*/ + @Excel(name = "企业", width = 15) + @Dict(dictTable = "sys_depart", dicText = "depart_name", dicCode = "id") + @ApiModelProperty(value = "企业") + private String enterprisesId; + /**用户*/ + @Excel(name = "用户", width = 15) + @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username") + @ApiModelProperty(value = "用户") + private String userId; + /**结构图*/ + @Excel(name = "结构图", width = 15) + @ApiModelProperty(value = "结构图") + private String structureDiagram; + /**排料图*/ + @Excel(name = "排料图", width = 15) + @ApiModelProperty(value = "排料图") + private String layoutDiagram; + /**产品图片*/ + @Excel(name = "产品图片", width = 15) + @ApiModelProperty(value = "产品图片") + private String productPicture; + /**身高*/ + @Excel(name = "身高", width = 15) + @ApiModelProperty(value = "身高") + private Double height; + /**体重*/ + @Excel(name = "体重", width = 15) + @ApiModelProperty(value = "体重") + private Double weight; + /**下摆*/ + @Excel(name = "下摆", width = 15) + @ApiModelProperty(value = "下摆") + private Double hem; + /**袖口*/ + @Excel(name = "袖口", width = 15) + @ApiModelProperty(value = "袖口") + private Double cuff; + /**袖长*/ + @Excel(name = "袖长", width = 15) + @ApiModelProperty(value = "袖长") + private Double sleeveLength; + /**胸围*/ + @Excel(name = "胸围", width = 15) + @ApiModelProperty(value = "胸围") + private Double bust; + /**腰围*/ + @Excel(name = "腰围", width = 15) + @ApiModelProperty(value = "腰围") + private Double theWaist; + /**肩宽*/ + @Excel(name = "肩宽", width = 15) + @ApiModelProperty(value = "肩宽") + private Double shoulderwidth; + /**前身长*/ + @Excel(name = "前身长", width = 15) + @ApiModelProperty(value = "前身长") + private Double forebodylength; + /**领围*/ + @Excel(name = "领围", width = 15) + @ApiModelProperty(value = "领围") + private Double neck; + /**臀围*/ + @Excel(name = "臀围", width = 15) + @ApiModelProperty(value = "臀围") + private Double hipline; + /**衣长*/ + @Excel(name = "衣长", width = 15) + @ApiModelProperty(value = "衣长") + private Double length; + /**胸距*/ + @Excel(name = "胸距", width = 15) + @ApiModelProperty(value = "胸距") + private Double sternalDistance; + + + @ApiModelProperty(value = "客户姓名") + private String realname; + + @ApiModelProperty(value = "企业名称") + private String departName; + + @ApiModelProperty(value = "款式") + private String typeName; + + @ApiModelProperty(value = "型号") + private String modelNumber; + + @ApiModelProperty(value = "生产时间-开始") + private Integer produceTimeBegin; + + @ApiModelProperty(value = "生产时间") + private Integer produceTimeEnd; +} diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/mapper/ZyProductMapper.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/mapper/ZyProductMapper.java index 0a166b9a..adae27cb 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/mapper/ZyProductMapper.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/mapper/ZyProductMapper.java @@ -2,9 +2,12 @@ package org.jeecg.modules.workproduct.mapper; import java.util.List; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Param; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import org.jeecg.modules.workproduct.entity.ZyProduct; +import org.jeecg.modules.workproduct.entity.ZyProductVo; /** * @Description: 产品表 @@ -14,4 +17,6 @@ import org.jeecg.modules.workproduct.entity.ZyProduct; */ public interface ZyProductMapper extends BaseMapper { + //自定义分页查询 + IPage selectListPage(Page page, @Param("model")ZyProductVo model); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/mapper/xml/ZyProductMapper.xml b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/mapper/xml/ZyProductMapper.xml index a4727bae..627cc10e 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/mapper/xml/ZyProductMapper.xml +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/mapper/xml/ZyProductMapper.xml @@ -2,4 +2,57 @@ + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/service/IZyProductService.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/service/IZyProductService.java index ef03e365..83a2304d 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/service/IZyProductService.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/service/IZyProductService.java @@ -1,7 +1,10 @@ package org.jeecg.modules.workproduct.service; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.modules.workproduct.entity.ZyProduct; +import org.jeecg.modules.workproduct.entity.ZyProductVo; /** * @Description: 产品表 @@ -11,4 +14,11 @@ import org.jeecg.modules.workproduct.entity.ZyProduct; */ public interface IZyProductService extends IService { + /** + * 自定义分页查询 + * @param page + * @param zyProduct + * @return + */ + IPage selectListPage(Page page, ZyProductVo zyProduct); } diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/service/impl/ZyProductServiceImpl.java b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/service/impl/ZyProductServiceImpl.java index 058309c7..6876a2da 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/service/impl/ZyProductServiceImpl.java +++ b/jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workproduct/service/impl/ZyProductServiceImpl.java @@ -1,6 +1,9 @@ package org.jeecg.modules.workproduct.service.impl; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.jeecg.modules.workproduct.entity.ZyProduct; +import org.jeecg.modules.workproduct.entity.ZyProductVo; import org.jeecg.modules.workproduct.mapper.ZyProductMapper; import org.jeecg.modules.workproduct.service.IZyProductService; import org.springframework.stereotype.Service; @@ -16,4 +19,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @Service public class ZyProductServiceImpl extends ServiceImpl implements IZyProductService { + //自定义分页查询 + @Override + public IPage selectListPage(Page page, ZyProductVo zyProduct) { + return baseMapper.selectListPage(page,zyProduct); + } }