|
|
@ -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; |
|
|
|
} |
|
|
|
} |
|
|
|