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. 20
      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 = "工序")
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")
@ApiModelProperty(value = "机器")
@ApiModelProperty(value = "设备")
private String machineId;
/**创建时间*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")

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

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

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

@ -21,5 +21,7 @@ public interface IWorkOrderService extends IService<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.extension.plugins.pagination.Page;
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.mapper.CustomerMeasureMapper;
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.ordergoodsmodule.entity.OrderGoodsModule;
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.mapper.ZyStyleModularMapper;
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.mapper.ProductAccessoriesMapper;
import org.jeecg.modules.product.pdfabric.entity.ProductFabric;
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.mapper.ProductModuleMapper;
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.WorkOrderVo;
import org.jeecg.modules.workorder.mapper.WorkOrderMapper;
@ -54,6 +66,10 @@ import java.util.List;
@Service
public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder> implements IWorkOrderService {
//订单
@Autowired
private ZyOrdersMapper zyOrdersMapper;
//订单商品
@Autowired
private OrderGoodsMapper orderGoodsMapper;
@ -78,10 +94,35 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
@Autowired
private ZyProductMapper productMapper;
//工序
//服装工序
@Autowired
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
private OrderGoodsModuleMapper orderGoodsModuleMapper;
@ -122,7 +163,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
* @return
*/
@Override
public Result paidan(ZyOrders zyOrders,String depId) {
public Result<?> paidan(ZyOrders zyOrders,String depId) {
//订单ID
String orderId=zyOrders.getId();
//商品订单是否存在
@ -213,34 +254,60 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
//产品模块、产品面料、产品辅料、产品工序、
//#region 产品工序-添加(服装款式类型中读取)
//根据服务款式表id 得到工序数据
//根据服务款式表id 得到服装工序,然后在得到基本工序
QueryWrapper<ZyStyleModular> styleModularLWrapper=new QueryWrapper<ZyStyleModular>();
styleModularLWrapper.eq("type_id",ogModel.getStyleId());
List<ZyStyleModular> zyStyleModularList=styleModularMapper.selectList(styleModularLWrapper);
//将工序保存到产品工序中
List<ZyProductProcess> productProcessList=new ArrayList<>();
//将工序保存到产品工序中
//List<ZyProductProcess> 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);
zpp.setProductId(productModel.getId());//产品id
zpp.setProcessId(item.getProcessId());//工序id
zpp.setNumber(item.getSerialnumber());//序号
productProcessMapper.insert(zpp);//保存
//ZyProcess =processMapper.selectById(item.getProcessId());
//region 获取工序工具
QueryWrapper<ZyOperationtool> operationtoolWrapper=new QueryWrapper<ZyOperationtool>();
//根据工序ID
operationtoolWrapper.eq("operationid",item.getProcessId());
List<ZyOperationtool> operationtoolList=zyOperationtoolMapper.selectList(operationtoolWrapper);
int sort=1;
for(ZyOperationtool itemTool:operationtoolList)
{
ProductOperationtool poModel=new ProductOperationtool();
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()
//#endregion
@ -306,6 +373,7 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
{
ProductAccessories paModel=new ProductAccessories();
paModel.setProductId(productModel.getId());//产品id
paModel.setAccessoriesId(item.getAccessoriesId());//辅料id
productAccessoriesMapper.insert(paModel);
// productAccessoriesList.add(paModel);
@ -324,6 +392,21 @@ public class WorkOrderServiceImpl extends ServiceImpl<WorkOrderMapper, WorkOrder
{
return Result.error("订单商品数据未找到!");
}
//修改订单状态
zyOrders.setDeliveryStatus(3);
zyOrdersMapper.updateById(zyOrders);
return Result.OK("成功");
}
/**
* 撤销工单
* @param woModel
* @return
*/
@Override
public Result<?> cancellationWorkOrder(WorkOrder woModel) {
//ZyProduct
return null;
}

Loading…
Cancel
Save