Merge remote-tracking branch 'origin/master'

zhc4dev
赵玉瑞 2 years ago
commit 07cb6ffd10
  1. 4
      jeecg-boot/jeecg-boot-module-process/src/main/java/org/jeecg/modules/demo/pro/entity/ZyProcessMachine.java
  2. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/demo/zyorders/service/IZyOrdersService.java
  3. 1
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/product/zyproductprocess/entity/ZyProductProcess.java
  4. 18
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/controller/WorkOrderController.java
  5. 4
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/IWorkOrderService.java
  6. 129
      jeecg-boot/jeecg-boot-module-system/src/main/java/org/jeecg/modules/workorder/service/impl/WorkOrderServiceImpl.java

@ -40,9 +40,9 @@ public class ZyProcessMachine implements Serializable {
@ApiModelProperty(value = "工序") @ApiModelProperty(value = "工序")
private String processId; private String processId;
/**机器*/ /**机器*/
@Excel(name = "机器", width = 15, dictTable = "zy_devicetype", dicText = "name", dicCode = "id") @Excel(name = "设备", width = 15, dictTable = "zy_devicetype", dicText = "name", dicCode = "id")
@Dict(dictTable = "zy_device", dicText = "name", dicCode = "id") @Dict(dictTable = "zy_device", dicText = "name", dicCode = "id")
@ApiModelProperty(value = "机器") @ApiModelProperty(value = "设备")
private String machineId; private String machineId;
/**创建时间*/ /**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")

@ -1,5 +1,6 @@
package org.jeecg.modules.demo.zyorders.service; package org.jeecg.modules.demo.zyorders.service;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;

@ -63,6 +63,7 @@ public class ZyProductProcess implements Serializable {
@ApiModelProperty(value = "工序id") @ApiModelProperty(value = "工序id")
@Dict(dictTable = "zy_process",dicText = "process_name",dicCode = "id") @Dict(dictTable = "zy_process",dicText = "process_name",dicCode = "id")
private String processId; private String processId;
/**序号*/ /**序号*/
@Excel(name = "序号", width = 15) @Excel(name = "序号", width = 15)
@ApiModelProperty(value = "序号") @ApiModelProperty(value = "序号")

@ -303,15 +303,11 @@ public class WorkOrderController extends JeecgController<WorkOrder, IWorkOrderSe
return Result.error("该订单已经派单,请不要重复操作!"); return Result.error("该订单已经派单,请不要重复操作!");
} }
else {//start for 1 else {//start for 1
Result result=workOrderService.paidan(zyOrders,depId); return workOrderService.paidan(zyOrders,depId);
}//end for 1 }//end for 1
} }
//修改订单状态
zyOrders.setDeliveryStatus(3);
zyOrdersService.updateById(zyOrders);
return Result.OK("成功");
} }
/** /**
@ -330,16 +326,14 @@ public class WorkOrderController extends JeecgController<WorkOrder, IWorkOrderSe
return Result.error("未找到对应数据!"); return Result.error("未找到对应数据!");
}else{ }else{
//增加撤销操作,点击撤销删除工单和对应的产品,订单状态改为派单前的状态。 //增加撤销操作,点击撤销删除工单和对应的产品,订单状态改为派单前的状态。
// * 撤销操作,同时会撤销产品模块、产品面料、产品辅料、产品工序、以及制单数据 //撤销操作,同时会撤销产品模块、产品面料、产品辅料、产品工序、以及制单数据
return workOrderService.cancellationWorkOrder(woModel);
//修改订单状态 //修改订单状态
ZyOrders zyOrders = zyOrdersService.getById(woModel.getOrdersId()); // ZyOrders zyOrders = zyOrdersService.getById(woModel.getOrdersId());
zyOrders.setDeliveryStatus(2); // zyOrders.setDeliveryStatus(2);
zyOrdersService.updateById(zyOrders); // zyOrdersService.updateById(zyOrders);
} }
return Result.OK("成功");
} }

@ -21,5 +21,7 @@ public interface IWorkOrderService extends IService<WorkOrder> {
IPage<WorkOrder> selectPage(Page<WorkOrder> page, WorkOrderVo workOrder); IPage<WorkOrder> selectPage(Page<WorkOrder> page, WorkOrderVo workOrder);
//派单 //派单
Result paidan(ZyOrders zyOrders,String depId); Result<?> paidan(ZyOrders zyOrders,String depId);
Result<?> cancellationWorkOrder(WorkOrder woModel);
} }

@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.common.api.vo.Result; import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.demo.base.entity.ZyProcess;
import org.jeecg.modules.demo.base.mapper.ZyProcessMapper;
import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure; import org.jeecg.modules.demo.customermeasure.entity.CustomerMeasure;
import org.jeecg.modules.demo.customermeasure.mapper.CustomerMeasureMapper; import org.jeecg.modules.demo.customermeasure.mapper.CustomerMeasureMapper;
import org.jeecg.modules.demo.ordergoods.entity.OrderGoods; import org.jeecg.modules.demo.ordergoods.entity.OrderGoods;
@ -15,16 +17,26 @@ import org.jeecg.modules.demo.ordergoodsfabric.entity.OrderGoodsFabric;
import org.jeecg.modules.demo.ordergoodsfabric.mapper.OrderGoodsFabricMapper; import org.jeecg.modules.demo.ordergoodsfabric.mapper.OrderGoodsFabricMapper;
import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule; import org.jeecg.modules.demo.ordergoodsmodule.entity.OrderGoodsModule;
import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper; import org.jeecg.modules.demo.ordergoodsmodule.mapper.OrderGoodsModuleMapper;
import org.jeecg.modules.demo.pro.entity.ZyProcessMachine;
import org.jeecg.modules.demo.pro.mapper.ZyProcessMachineMapper;
import org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular; import org.jeecg.modules.demo.zyStyleModular.entity.ZyStyleModular;
import org.jeecg.modules.demo.zyStyleModular.mapper.ZyStyleModularMapper; import org.jeecg.modules.demo.zyStyleModular.mapper.ZyStyleModularMapper;
import org.jeecg.modules.demo.zyorders.entity.ZyOrders; import org.jeecg.modules.demo.zyorders.entity.ZyOrders;
import org.jeecg.modules.demo.zyorders.mapper.ZyOrdersMapper;
import org.jeecg.modules.operationtool.entity.ZyOperationtool;
import org.jeecg.modules.operationtool.mapper.ZyOperationtoolMapper;
import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories; import org.jeecg.modules.product.pdaccessories.entity.ProductAccessories;
import org.jeecg.modules.product.pdaccessories.mapper.ProductAccessoriesMapper; import org.jeecg.modules.product.pdaccessories.mapper.ProductAccessoriesMapper;
import org.jeecg.modules.product.pdfabric.entity.ProductFabric; import org.jeecg.modules.product.pdfabric.entity.ProductFabric;
import org.jeecg.modules.product.pdfabric.mapper.ProductFabricMapper; import org.jeecg.modules.product.pdfabric.mapper.ProductFabricMapper;
import org.jeecg.modules.product.pdmachine.entity.ProductMachine;
import org.jeecg.modules.product.pdmachine.mapper.ProductMachineMapper;
import org.jeecg.modules.product.pdoperationtool.entity.ProductOperationtool;
import org.jeecg.modules.product.pdoperationtool.mapper.ProductOperationtoolMapper;
import org.jeecg.modules.product.productModule.entity.ProductModule; import org.jeecg.modules.product.productModule.entity.ProductModule;
import org.jeecg.modules.product.productModule.mapper.ProductModuleMapper; import org.jeecg.modules.product.productModule.mapper.ProductModuleMapper;
import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess; import org.jeecg.modules.product.zyproductprocess.entity.ZyProductProcess;
import org.jeecg.modules.product.zyproductprocess.mapper.ZyProductProcessMapper;
import org.jeecg.modules.workorder.entity.WorkOrder; import org.jeecg.modules.workorder.entity.WorkOrder;
import org.jeecg.modules.workorder.entity.WorkOrderVo; import org.jeecg.modules.workorder.entity.WorkOrderVo;
import org.jeecg.modules.workorder.mapper.WorkOrderMapper; import org.jeecg.modules.workorder.mapper.WorkOrderMapper;
@ -54,6 +66,10 @@ import java.util.List;
@Service @Service
public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder> implements IWorkOrderService { public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder> implements IWorkOrderService {
//订单
@Autowired
private ZyOrdersMapper zyOrdersMapper;
//订单商品 //订单商品
@Autowired @Autowired
private OrderGoodsMapper orderGoodsMapper; private OrderGoodsMapper orderGoodsMapper;
@ -78,10 +94,35 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
@Autowired @Autowired
private ZyProductMapper productMapper; private ZyProductMapper productMapper;
//工序 //服装工序
@Autowired @Autowired
private ZyStyleModularMapper styleModularMapper; private ZyStyleModularMapper styleModularMapper;
//基本工序
@Autowired
private ZyProcessMapper processMapper;
//产品工序
@Autowired
private ZyProductProcessMapper productProcessMapper;
//工序工具
@Autowired
private ZyOperationtoolMapper zyOperationtoolMapper;
//产品工具
@Autowired
private ProductOperationtoolMapper productOperationtoolMapper;
//工序设备
@Autowired
private ZyProcessMachineMapper zyProcessMachine;
//产品设备
@Autowired
private ProductMachineMapper productMachineMapper;
//订单商品模块表 //订单商品模块表
@Autowired @Autowired
private OrderGoodsModuleMapper orderGoodsModuleMapper; private OrderGoodsModuleMapper orderGoodsModuleMapper;
@ -122,7 +163,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
* @return * @return
*/ */
@Override @Override
public Result paidan(ZyOrders zyOrders,String depId) { public Result<?> paidan(ZyOrders zyOrders,String depId) {
//订单ID //订单ID
String orderId=zyOrders.getId(); String orderId=zyOrders.getId();
//商品订单是否存在 //商品订单是否存在
@ -213,34 +254,60 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
//产品模块、产品面料、产品辅料、产品工序、 //产品模块、产品面料、产品辅料、产品工序、
//#region 产品工序-添加(服装款式类型中读取) //#region 产品工序-添加(服装款式类型中读取)
//根据服务款式表id 得到工序数据 //根据服务款式表id 得到服装工序,然后在得到基本工序
QueryWrapper<ZyStyleModular> styleModularLWrapper=new QueryWrapper<ZyStyleModular>(); QueryWrapper<ZyStyleModular> styleModularLWrapper=new QueryWrapper<ZyStyleModular>();
styleModularLWrapper.eq("type_id",ogModel.getStyleId()); styleModularLWrapper.eq("type_id",ogModel.getStyleId());
List<ZyStyleModular> zyStyleModularList=styleModularMapper.selectList(styleModularLWrapper); List<ZyStyleModular> zyStyleModularList=styleModularMapper.selectList(styleModularLWrapper);
//将工序保存到产品工序中
List<ZyProductProcess> productProcessList=new ArrayList<>(); //将工序保存到产品工序中
//List<ZyProductProcess> productProcessList=new ArrayList<>();
for(ZyStyleModular item:zyStyleModularList) for(ZyStyleModular item:zyStyleModularList)
{ {
ZyProductProcess zpp=new ZyProductProcess(); ZyProductProcess zpp=new ZyProductProcess();
//zpp.setProductId()//产品id zpp.setProductId(productModel.getId());//产品id
zpp.setProcessId(item.getProcessId());//工序id
// /***/ zpp.setNumber(item.getSerialnumber());//序号
// @Excel(name = "产品id", width = 15) productProcessMapper.insert(zpp);//保存
// @ApiModelProperty(value = "产品id")
// @Dict(dictTable = "zy_product",dicText = "product_code",dicCode = "id") //ZyProcess =processMapper.selectById(item.getProcessId());
// private String productId;
// /**工序id*/ //region 获取工序工具
// @Excel(name = "工序id", width = 15) QueryWrapper<ZyOperationtool> operationtoolWrapper=new QueryWrapper<ZyOperationtool>();
// @ApiModelProperty(value = "工序id") //根据工序ID
// @Dict(dictTable = "zy_process",dicText = "process_name",dicCode = "id") operationtoolWrapper.eq("operationid",item.getProcessId());
// private String processId; List<ZyOperationtool> operationtoolList=zyOperationtoolMapper.selectList(operationtoolWrapper);
// /**序号*/ int sort=1;
// @Excel(name = "序号", width = 15) for(ZyOperationtool itemTool:operationtoolList)
// @ApiModelProperty(value = "序号") {
// private Integer number; ProductOperationtool poModel=new ProductOperationtool();
productProcessList.add(zpp); poModel.setProductId(productModel.getId());//产品id
poModel.setOperationtoolId(itemTool.getToolid());//工具id
poModel.setSort(sort++);//序号
productOperationtoolMapper.insert(poModel);
}
//endregion
//region 获取工序设备
QueryWrapper<ZyProcessMachine> processMachineWrapper=new QueryWrapper<ZyProcessMachine>();
//根据工序ID
processMachineWrapper.eq("process_id",item.getProcessId());
List<ZyProcessMachine> processMachineList=zyProcessMachine.selectList(processMachineWrapper);
//遍历设备
sort=1;
for(ZyProcessMachine itemMachine:processMachineList)
{
ProductMachine pmModel=new ProductMachine();
pmModel.setProductId(productModel.getId());//产品id
pmModel.setMachineId(itemMachine.getMachineId());//设备
pmModel.setSort(sort++);//序号
productMachineMapper.insert(pmModel);
}
//endregion
//productProcessList.add(zpp);
} }
//zyProductProcessService.save() //zyProductProcessService.save()
//#endregion //#endregion
@ -306,6 +373,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
{ {
ProductAccessories paModel=new ProductAccessories(); ProductAccessories paModel=new ProductAccessories();
paModel.setProductId(productModel.getId());//产品id paModel.setProductId(productModel.getId());//产品id
paModel.setAccessoriesId(item.getAccessoriesId());//辅料id
productAccessoriesMapper.insert(paModel); productAccessoriesMapper.insert(paModel);
// productAccessoriesList.add(paModel); // productAccessoriesList.add(paModel);
@ -324,6 +392,21 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
{ {
return Result.error("订单商品数据未找到!"); return Result.error("订单商品数据未找到!");
} }
//修改订单状态
zyOrders.setDeliveryStatus(3);
zyOrdersMapper.updateById(zyOrders);
return Result.OK("成功");
}
/**
* 撤销工单
* @param woModel
* @return
*/
@Override
public Result<?> cancellationWorkOrder(WorkOrder woModel) {
//ZyProduct
return null; return null;
} }

Loading…
Cancel
Save