Merge branch 'feature/qrcode_feeding'
This commit is contained in:
@@ -14,6 +14,7 @@ import org.nl.wms.ext_manage.mes.mq.producer.WorkReportProducer;
|
||||
import org.nl.wms.ext_manage.mes.service.dto.WorkReportParam;
|
||||
import org.nl.wms.ext_manage.service.MesToWmsService;
|
||||
import org.nl.wms.ext_manage.service.WmsToZDWmdService;
|
||||
import org.nl.wms.ext_manage.service.dto.FeedingRecordPushDto;
|
||||
import org.nl.wms.ext_manage.service.dto.MesTaskParams;
|
||||
import org.nl.wms.ext_manage.service.dto.ZDInventory;
|
||||
import org.nl.wms.pm_manage.demand.service.IPmDemandService;
|
||||
@@ -24,6 +25,7 @@ import org.nl.wms.pm_manage.pmreturn.service.dto.PmReturnParam;
|
||||
import org.nl.wms.warehouse_manage.inventory.IStInventoryService;
|
||||
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryDto;
|
||||
import org.nl.wms.warehouse_manage.inventory.dto.StInventoryQuery;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.service.IFeedingRecordService;
|
||||
import org.nl.wms.welding_manage.service.work_order.IWorkOrderService;
|
||||
import org.nl.wms.welding_manage.service.work_order.dto.WorkOrderDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -34,7 +36,6 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -66,8 +67,9 @@ public class MesToWmsController {
|
||||
@Autowired
|
||||
private WmsToZDWmdService wmsToZDWmdService;
|
||||
|
||||
@Resource
|
||||
private IPmDemandService pmDemandService;
|
||||
@Autowired
|
||||
private IFeedingRecordService feedingRecordService;
|
||||
|
||||
|
||||
@PostMapping("api/mes/lineLackMat")
|
||||
@SaIgnore
|
||||
@@ -190,4 +192,11 @@ public class MesToWmsController {
|
||||
));
|
||||
return ResponseData.build(result);
|
||||
}
|
||||
@PostMapping("api/mes/pushFeedingBill")
|
||||
@SaIgnore
|
||||
@Log("MES推送扣料清单")
|
||||
public ResponseEntity<Object> pushFeedingBill(@RequestBody FeedingRecordPushDto param) {
|
||||
feedingRecordService.pushFeedingBill(param);
|
||||
return ResponseData.build();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,349 @@
|
||||
package org.nl.wms.ext_manage.service.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class FeedingRecordPushDto {
|
||||
@JsonProperty("OrderStatus")
|
||||
private String orderStatus;
|
||||
|
||||
@JsonProperty("OrgCode")
|
||||
private String orgCode;
|
||||
|
||||
@JsonProperty("OrderCode")
|
||||
private String orderCode;
|
||||
|
||||
@JsonProperty("OrderId")
|
||||
private String orderId;
|
||||
|
||||
@JsonProperty("BizDeptCode")
|
||||
private String bizDeptCode;
|
||||
|
||||
@JsonProperty("OrderType")
|
||||
private String orderType;
|
||||
|
||||
@JsonProperty("Remark")
|
||||
private String remark;
|
||||
|
||||
@JsonProperty("CreatedBy")
|
||||
private String createdBy;
|
||||
|
||||
@JsonProperty("ModifiedOn")
|
||||
private String modifiedOn;
|
||||
|
||||
@JsonProperty("CheckedBy")
|
||||
private String checkedBy;
|
||||
|
||||
@JsonProperty("BomCode")
|
||||
private String bomCode;
|
||||
|
||||
@JsonProperty("OrderQty")
|
||||
private BigDecimal orderQty;
|
||||
|
||||
@JsonProperty("PlanStartedOn")
|
||||
private String planStartedOn;
|
||||
|
||||
@JsonProperty("PlanFinishedOn")
|
||||
private String planFinishedOn;
|
||||
|
||||
@JsonProperty("DefaultWarehouseCode")
|
||||
private String defaultWarehouseCode;
|
||||
|
||||
@JsonProperty("DefaultWarehouseName")
|
||||
private String defaultWarehouseName;
|
||||
|
||||
@JsonProperty("TrackNo")
|
||||
private String trackNo;
|
||||
|
||||
@JsonProperty("Unit")
|
||||
private String unit;
|
||||
|
||||
@JsonProperty("BizDate")
|
||||
private String bizDate;
|
||||
|
||||
@JsonProperty("ProductCode")
|
||||
private String productCode;
|
||||
|
||||
@JsonProperty("ProductName")
|
||||
private String productName;
|
||||
|
||||
@JsonProperty("ProductSpec")
|
||||
private String productSpec;
|
||||
|
||||
@JsonProperty("ColorCode")
|
||||
private String colorCode;
|
||||
|
||||
@JsonProperty("SnDetail")
|
||||
private String snDetail;
|
||||
|
||||
@JsonProperty("ProcessPlan")
|
||||
private String processPlan;
|
||||
|
||||
@JsonProperty("StepCode")
|
||||
private String stepCode;
|
||||
|
||||
@JsonProperty("LotNumber")
|
||||
private String lotNumber;
|
||||
|
||||
@JsonProperty("ProductionStatus")
|
||||
private String productionStatus;
|
||||
|
||||
@JsonProperty("WorkArea")
|
||||
private String workArea;
|
||||
|
||||
@JsonProperty("WorkAreaType")
|
||||
private String workAreaType;
|
||||
|
||||
@JsonProperty("TeamName")
|
||||
private String teamName;
|
||||
|
||||
@JsonProperty("ModifiedBy")
|
||||
private String modifiedBy;
|
||||
|
||||
@JsonProperty("ModifiedTime")
|
||||
private String modifiedTime;
|
||||
|
||||
@JsonProperty("CreatedOn")
|
||||
private String createdOn;
|
||||
|
||||
@JsonProperty("FinishedQty")
|
||||
private BigDecimal finishedQty;
|
||||
|
||||
@JsonProperty("SeqNo")
|
||||
private Integer seqNo;
|
||||
|
||||
@JsonProperty("Attr01")
|
||||
private String attr01;
|
||||
|
||||
@JsonProperty("Attr02")
|
||||
private String attr02;
|
||||
|
||||
@JsonProperty("Attr03")
|
||||
private String attr03;
|
||||
|
||||
@JsonProperty("Attr04")
|
||||
private String attr04;
|
||||
|
||||
@JsonProperty("Attr05")
|
||||
private String attr05;
|
||||
|
||||
@JsonProperty("Attr06")
|
||||
private String attr06;
|
||||
|
||||
@JsonProperty("SerNo")
|
||||
private Integer serNo;
|
||||
|
||||
@JsonProperty("ActualStartedOn")
|
||||
private String actualStartedOn;
|
||||
|
||||
@JsonProperty("ActualFinishedOn")
|
||||
private String actualFinishedOn;
|
||||
|
||||
@JsonProperty("SrcOrderCode")
|
||||
private String srcOrderCode;
|
||||
|
||||
@JsonProperty("FinishedRate")
|
||||
private String finishedRate;
|
||||
|
||||
@JsonProperty("BizDeptName")
|
||||
private String bizDeptName;
|
||||
|
||||
@JsonProperty("ProductType")
|
||||
private String productType;
|
||||
|
||||
@JsonProperty("LayoutCode")
|
||||
private String layoutCode;
|
||||
|
||||
@JsonProperty("Factory")
|
||||
private String factory;
|
||||
|
||||
@JsonProperty("Workshop")
|
||||
private String workshop;
|
||||
|
||||
@JsonProperty("Id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty("WorkOrderBomList")
|
||||
private List<Object> workOrderBomList;
|
||||
|
||||
@JsonProperty("WorkOrderSnList")
|
||||
private List<Object> workOrderSnList;
|
||||
|
||||
@JsonProperty("bom")
|
||||
private List<FeedingRecordPushBomDto> bom;
|
||||
|
||||
@Data
|
||||
public static class FeedingRecordPushBomDto {
|
||||
@JsonProperty("ItemId")
|
||||
private String itemId;
|
||||
|
||||
@JsonProperty("ItemNo")
|
||||
private Integer itemNo;
|
||||
|
||||
@JsonProperty("MaterialCode")
|
||||
private String materialCode;
|
||||
|
||||
@JsonProperty("MaterialName")
|
||||
private String materialName;
|
||||
|
||||
@JsonProperty("Spec")
|
||||
private String spec;
|
||||
|
||||
@JsonProperty("Unit")
|
||||
private String unit;
|
||||
|
||||
@JsonProperty("BaseUnit")
|
||||
private String baseUnit;
|
||||
|
||||
@JsonProperty("BomQty")
|
||||
private BigDecimal bomQty;
|
||||
|
||||
@JsonProperty("WorkCenter")
|
||||
private String workCenter;
|
||||
|
||||
@JsonProperty("LoadPort")
|
||||
private String loadPort;
|
||||
|
||||
@JsonProperty("DeptCode")
|
||||
private String deptCode;
|
||||
|
||||
@JsonProperty("SupOrgCode")
|
||||
private String supOrgCode;
|
||||
|
||||
@JsonProperty("WarehouseCode")
|
||||
private String warehouseCode;
|
||||
|
||||
@JsonProperty("WarehouseName")
|
||||
private String warehouseName;
|
||||
|
||||
@JsonProperty("StockerCode")
|
||||
private String stockerCode;
|
||||
|
||||
@JsonProperty("StockerName")
|
||||
private String stockerName;
|
||||
|
||||
@JsonProperty("WorkOrderCode")
|
||||
private String workOrderCode;
|
||||
|
||||
@JsonProperty("LinePod")
|
||||
private String linePod;
|
||||
|
||||
@JsonProperty("BomProp1")
|
||||
private String bomProp1;
|
||||
|
||||
@JsonProperty("BomProp2")
|
||||
private String bomProp2;
|
||||
|
||||
@JsonProperty("BomProp3")
|
||||
private String bomProp3;
|
||||
|
||||
@JsonProperty("Attr01")
|
||||
private String attr01;
|
||||
|
||||
@JsonProperty("Attr02")
|
||||
private String attr02;
|
||||
|
||||
@JsonProperty("Attr03")
|
||||
private String attr03;
|
||||
|
||||
@JsonProperty("Attr04")
|
||||
private String attr04;
|
||||
|
||||
@JsonProperty("Attr05")
|
||||
private String attr05;
|
||||
|
||||
@JsonProperty("Attr06")
|
||||
private String attr06;
|
||||
|
||||
@JsonProperty("TrackNo")
|
||||
private String trackNo;
|
||||
|
||||
@JsonProperty("WmsQty")
|
||||
private BigDecimal wmsQty;
|
||||
|
||||
@JsonProperty("Eas5Qty")
|
||||
private BigDecimal eas5Qty;
|
||||
|
||||
@JsonProperty("Eas4Qty")
|
||||
private BigDecimal eas4Qty;
|
||||
|
||||
@JsonProperty("Matkl")
|
||||
private String matkl;
|
||||
|
||||
@JsonProperty("Bwart")
|
||||
private String bwart;
|
||||
|
||||
@JsonProperty("Rgekz")
|
||||
private String rgekz;
|
||||
|
||||
@JsonProperty("Ablad")
|
||||
private String ablad;
|
||||
|
||||
@JsonProperty("Enmng")
|
||||
private BigDecimal enmng;
|
||||
|
||||
@JsonProperty("Sobkz")
|
||||
private String sobkz;
|
||||
|
||||
@JsonProperty("Sanka")
|
||||
private String sanka;
|
||||
|
||||
@JsonProperty("Dumps")
|
||||
private String dumps;
|
||||
|
||||
@JsonProperty("Potx1")
|
||||
private String potx1;
|
||||
|
||||
@JsonProperty("Potx2")
|
||||
private String potx2;
|
||||
|
||||
@JsonProperty("Posnr")
|
||||
private String posnr;
|
||||
|
||||
@JsonProperty("Rsnum")
|
||||
private String rsnum;
|
||||
|
||||
@JsonProperty("Rspos")
|
||||
private String rspos;
|
||||
|
||||
@JsonProperty("Bdter")
|
||||
private String bdter;
|
||||
|
||||
@JsonProperty("Schgt")
|
||||
private String schgt;
|
||||
|
||||
@JsonProperty("Alpgr")
|
||||
private String alpgr;
|
||||
|
||||
@JsonProperty("Alprf")
|
||||
private String alprf;
|
||||
|
||||
@JsonProperty("Alpst")
|
||||
private String alpst;
|
||||
|
||||
@JsonProperty("Ausch")
|
||||
private BigDecimal ausch;
|
||||
|
||||
@JsonProperty("Xloek")
|
||||
private String xloek;
|
||||
|
||||
@JsonProperty("Backup1")
|
||||
private String backup1;
|
||||
|
||||
@JsonProperty("Backup2")
|
||||
private String backup2;
|
||||
|
||||
@JsonProperty("Backup3")
|
||||
private String backup3;
|
||||
|
||||
@JsonProperty("Backup4")
|
||||
private String backup4;
|
||||
|
||||
@JsonProperty("Id")
|
||||
private String id;
|
||||
}
|
||||
}
|
||||
@@ -59,7 +59,9 @@ import org.nl.wms.warehouse_manage.inventory.core.param.impl.OutFinishParam;
|
||||
import org.nl.wms.warehouse_manage.service.IMdPbGroupplateService;
|
||||
import org.nl.wms.warehouse_manage.service.dao.GroupPlate;
|
||||
import org.nl.wms.warehouse_manage.service.dao.mapper.MdPbGroupplateMapper;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao.FeedingRecordBom;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao.ReceiveOutReturn;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.mapper.FeedingRecordBomMapper;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.service.IReceiveOutReturnService;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.service.enums.StockReturnStatusEnum;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -101,6 +103,9 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
|
||||
@Resource
|
||||
private IReceiveOutReturnService receiveOutReturnService;
|
||||
|
||||
@Autowired
|
||||
private FeedingRecordBomMapper feedingRecordBomMapper;
|
||||
/**
|
||||
* 库区服务
|
||||
*/
|
||||
@@ -170,6 +175,7 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
private IPmDemandService pmDemandService;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Mock
|
||||
public List<OutBoundDis> selectSectOutDis(String sectCode) {
|
||||
@@ -405,6 +411,8 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
throw new BadRequestException("当前虚拟仓库未绑定"+param.getStorageVehicleCode());
|
||||
}
|
||||
final List<ReceiveOutRequest.Entrys> entrys = new ArrayList<>();
|
||||
List<FeedingRecordBom> feedingRecordBoms = feedingRecordBomMapper.selectList(new LambdaQueryWrapper<FeedingRecordBom>()
|
||||
.eq(FeedingRecordBom::getWorkOrderCode, param.getWorkOrder()));
|
||||
|
||||
for (WorkOrderBomItem bomItem : workOrderBomItems) {
|
||||
final String materialCode = bomItem.getMaterialCode();
|
||||
@@ -412,8 +420,10 @@ public class PdaIosOutServiceImpl implements PdaIosOutService {
|
||||
if (bomQty == null || bomQty.intValue() == 0){
|
||||
continue;
|
||||
}
|
||||
boolean hasBom = feedingRecordBoms.stream().anyMatch(i -> Objects.equals(i.getMaterialCode(), bomItem.getMaterialCode()));
|
||||
final BigDecimal qty = bomQty.multiply(param.getReportedQty()).setScale(0, RoundingMode.HALF_UP);
|
||||
ReceiveOutRequest.Entrys entry = new ReceiveOutRequest.Entrys();
|
||||
if (hasBom) entry.setStatus(StockReturnStatusEnum.IGNORE.getCode());
|
||||
entry.setSeq(Integer.valueOf(bomItem.getItemNo()));
|
||||
entry.setMaterialno(materialCode);
|
||||
entry.setUnitno(bomItem.getUnit());
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
package org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@TableName("pm_feeding_record")
|
||||
public class FeedingRecord {
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
private String orderId;
|
||||
|
||||
private String orderCode;
|
||||
|
||||
private String orderStatus;
|
||||
|
||||
private String orgCode;
|
||||
|
||||
private String bizDeptCode;
|
||||
|
||||
private String bizDeptName;
|
||||
|
||||
private String orderType;
|
||||
|
||||
private String remark;
|
||||
|
||||
private String createdBy;
|
||||
|
||||
private String modifiedBy;
|
||||
|
||||
private String checkedBy;
|
||||
|
||||
private String createdOn;
|
||||
|
||||
private String modifiedOn;
|
||||
|
||||
private String modifiedTime;
|
||||
|
||||
private String bomCode;
|
||||
|
||||
private BigDecimal orderQty;
|
||||
|
||||
private BigDecimal finishedQty;
|
||||
|
||||
private String finishedRate;
|
||||
|
||||
private String planStartedOn;
|
||||
|
||||
private String planFinishedOn;
|
||||
|
||||
private String actualStartedOn;
|
||||
|
||||
private String actualFinishedOn;
|
||||
|
||||
private String defaultWarehouseCode;
|
||||
|
||||
private String defaultWarehouseName;
|
||||
|
||||
private String trackNo;
|
||||
|
||||
private String unit;
|
||||
|
||||
private String bizDate;
|
||||
|
||||
private String productCode;
|
||||
|
||||
private String productName;
|
||||
|
||||
private String productSpec;
|
||||
|
||||
private String colorCode;
|
||||
|
||||
private String snDetail;
|
||||
|
||||
private String processPlan;
|
||||
|
||||
private String stepCode;
|
||||
|
||||
private String lotNumber;
|
||||
|
||||
private String productionStatus;
|
||||
|
||||
private String workArea;
|
||||
|
||||
private String workAreaType;
|
||||
|
||||
private String teamName;
|
||||
|
||||
private Integer seqNo;
|
||||
|
||||
private String attr01;
|
||||
private String attr02;
|
||||
private String attr03;
|
||||
private String attr04;
|
||||
private String attr05;
|
||||
private String attr06;
|
||||
|
||||
private Integer serNo;
|
||||
|
||||
private String srcOrderCode;
|
||||
|
||||
private String factory;
|
||||
|
||||
private String workshop;
|
||||
|
||||
private String productType;
|
||||
|
||||
private String layoutCode;
|
||||
|
||||
private String externalId;
|
||||
|
||||
private String createTime;
|
||||
|
||||
private String updateTime;
|
||||
}
|
||||
@@ -0,0 +1,125 @@
|
||||
package org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@TableName("pm_feeding_record_bom")
|
||||
public class FeedingRecordBom {
|
||||
@TableId
|
||||
private String id;
|
||||
|
||||
private String itemId;
|
||||
|
||||
private Integer itemNo;
|
||||
|
||||
private String materialCode;
|
||||
|
||||
private String materialName;
|
||||
|
||||
private String spec;
|
||||
|
||||
private String unit;
|
||||
|
||||
private String baseUnit;
|
||||
|
||||
private BigDecimal bomQty;
|
||||
|
||||
private String workCenter;
|
||||
|
||||
private String loadPort;
|
||||
|
||||
private String deptCode;
|
||||
|
||||
private String supOrgCode;
|
||||
|
||||
private String warehouseCode;
|
||||
|
||||
private String warehouseName;
|
||||
|
||||
private String stockerCode;
|
||||
|
||||
private String stockerName;
|
||||
|
||||
private String workOrderCode;
|
||||
|
||||
private String linePod;
|
||||
|
||||
private String bomProp1;
|
||||
|
||||
private String bomProp2;
|
||||
|
||||
private String bomProp3;
|
||||
|
||||
private String attr01;
|
||||
private String attr02;
|
||||
private String attr03;
|
||||
private String attr04;
|
||||
private String attr05;
|
||||
private String attr06;
|
||||
|
||||
private String trackNo;
|
||||
|
||||
private BigDecimal wmsQty;
|
||||
|
||||
private BigDecimal eas5Qty;
|
||||
|
||||
private BigDecimal eas4Qty;
|
||||
|
||||
private String matkl;
|
||||
|
||||
private String bwart;
|
||||
|
||||
private String rgekz;
|
||||
|
||||
private String ablad;
|
||||
|
||||
private BigDecimal enmng;
|
||||
|
||||
private String sobkz;
|
||||
|
||||
private String sanka;
|
||||
|
||||
private String dumps;
|
||||
|
||||
private String potx1;
|
||||
|
||||
private String potx2;
|
||||
|
||||
private String posnr;
|
||||
|
||||
private String rsnum;
|
||||
|
||||
private String rspos;
|
||||
|
||||
private String bdter;
|
||||
|
||||
private String schgt;
|
||||
|
||||
private String alpgr;
|
||||
|
||||
private String alprf;
|
||||
|
||||
private String alpst;
|
||||
|
||||
private BigDecimal ausch;
|
||||
|
||||
private String xloek;
|
||||
|
||||
private String backup1;
|
||||
|
||||
private String backup2;
|
||||
|
||||
private String backup3;
|
||||
|
||||
private String backup4;
|
||||
|
||||
private String externalId;
|
||||
|
||||
private String createTime;
|
||||
|
||||
private String updateTime;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao.FeedingRecordBom;
|
||||
|
||||
public interface FeedingRecordBomMapper extends BaseMapper<FeedingRecordBom> {
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao.FeedingRecord;
|
||||
|
||||
public interface FeedingRecordMapper extends BaseMapper<FeedingRecord> {
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.ext_manage.service.dto.FeedingRecordPushDto;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao.FeedingRecord;
|
||||
|
||||
public interface IFeedingRecordService extends IService<FeedingRecord> {
|
||||
void pushFeedingBill(FeedingRecordPushDto param);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.ext_manage.service.dto.FeedingRecordPushDto;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao.FeedingRecord;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao.FeedingRecordBom;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.mapper.FeedingRecordBomMapper;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.mapper.FeedingRecordMapper;
|
||||
import org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.service.IFeedingRecordService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class FeedingRecordServiceImpl extends ServiceImpl<FeedingRecordMapper, FeedingRecord> implements IFeedingRecordService {
|
||||
|
||||
@Autowired
|
||||
private FeedingRecordBomMapper feedingRecordBomMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void pushFeedingBill(FeedingRecordPushDto param) {
|
||||
log.info("-----收到投料记录推送:{}", JSON.toJSONString(param));
|
||||
FeedingRecord feedingRecord = new FeedingRecord();
|
||||
BeanUtils.copyProperties(param,feedingRecord);
|
||||
this.saveOrUpdate(feedingRecord);
|
||||
// ArrayList<FeedingRecordBom> feedingRecordBoms = new ArrayList<>();
|
||||
List<FeedingRecordPushDto.FeedingRecordPushBomDto> bom = param.getBom();
|
||||
for (FeedingRecordPushDto.FeedingRecordPushBomDto bomDto : bom) {
|
||||
FeedingRecordBom feedingRecordBom = new FeedingRecordBom();
|
||||
BeanUtils.copyProperties(bomDto,feedingRecordBom);
|
||||
// feedingRecordBoms.add(feedingRecordBom);
|
||||
feedingRecordBomMapper.insert(feedingRecordBom);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user