根据code查物料;
This commit is contained in:
+2
@@ -30,6 +30,8 @@ public interface ReservationStockInOrderMapper extends BaseMapper<ReservationSto
|
|||||||
|
|
||||||
public MaterialBaseInfoPO getByName(@Param("name") String name);
|
public MaterialBaseInfoPO getByName(@Param("name") String name);
|
||||||
|
|
||||||
|
public MaterialBaseInfoPO getByCode(@Param("code") String code);
|
||||||
|
|
||||||
public List<MaterialBaseInfoPO> getMaterialBaseInfoList(@Param("id") String id);
|
public List<MaterialBaseInfoPO> getMaterialBaseInfoList(@Param("id") String id);
|
||||||
|
|
||||||
public MaterialWarehouseControlPO getInfoByMaterialBaseInfoIds(@Param("id") Long id);
|
public MaterialWarehouseControlPO getInfoByMaterialBaseInfoIds(@Param("id") Long id);
|
||||||
|
|||||||
+4
-4
@@ -180,7 +180,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
|||||||
List<Map<String,Object>> shipperIds = new ArrayList<>();
|
List<Map<String,Object>> shipperIds = new ArrayList<>();
|
||||||
Set<Long> processedShipperIds = new HashSet<>();
|
Set<Long> processedShipperIds = new HashSet<>();
|
||||||
for (ProductDetail productDetail : productDetailList) {
|
for (ProductDetail productDetail : productDetailList) {
|
||||||
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByName(productDetail.getProductName());
|
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode());
|
||||||
if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) {
|
if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) {
|
||||||
Long shipperId = materialBaseInfoPO.getShipperId();
|
Long shipperId = materialBaseInfoPO.getShipperId();
|
||||||
if (processedShipperIds.add(shipperId)) {
|
if (processedShipperIds.add(shipperId)) {
|
||||||
@@ -234,7 +234,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
|||||||
for (ProductDetail productDetail : productDetailList) {
|
for (ProductDetail productDetail : productDetailList) {
|
||||||
ReservationOutMaterialDetailDO reservationOutMaterialDetailDO = new ReservationOutMaterialDetailDO();
|
ReservationOutMaterialDetailDO reservationOutMaterialDetailDO = new ReservationOutMaterialDetailDO();
|
||||||
reservationOutMaterialDetailDO.setOutOrderNumber(reservationStockOutOrderDO.getOutOrderNumber());
|
reservationOutMaterialDetailDO.setOutOrderNumber(reservationStockOutOrderDO.getOutOrderNumber());
|
||||||
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByName(productDetail.getProductName());
|
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode());
|
||||||
reservationOutMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId());
|
reservationOutMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId());
|
||||||
reservationOutMaterialDetailDO.setQuantity(new BigDecimal(productDetail.getPieceCount()).setScale(2, BigDecimal.ROUND_HALF_UP).add(new BigDecimal(productDetail.getBoxCount()).setScale(2, BigDecimal.ROUND_HALF_UP)));
|
reservationOutMaterialDetailDO.setQuantity(new BigDecimal(productDetail.getPieceCount()).setScale(2, BigDecimal.ROUND_HALF_UP).add(new BigDecimal(productDetail.getBoxCount()).setScale(2, BigDecimal.ROUND_HALF_UP)));
|
||||||
reservationOutMaterialDetailDO.setMaterialCode(materialBaseInfoPO.getMaterialCode());
|
reservationOutMaterialDetailDO.setMaterialCode(materialBaseInfoPO.getMaterialCode());
|
||||||
@@ -325,7 +325,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
|||||||
List<Map<String,Object>> shipperIds = new ArrayList<>();
|
List<Map<String,Object>> shipperIds = new ArrayList<>();
|
||||||
Set<Long> processedShipperIds = new HashSet<>();
|
Set<Long> processedShipperIds = new HashSet<>();
|
||||||
for (StockInProductDetail productDetail : productDetailList) {
|
for (StockInProductDetail productDetail : productDetailList) {
|
||||||
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByName(productDetail.getProductName());
|
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(productDetail.getProductCode());
|
||||||
if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) {
|
if (materialBaseInfoPO != null && materialBaseInfoPO.getShipperId() != null) {
|
||||||
Long shipperId = materialBaseInfoPO.getShipperId();
|
Long shipperId = materialBaseInfoPO.getShipperId();
|
||||||
if (processedShipperIds.add(shipperId)) {
|
if (processedShipperIds.add(shipperId)) {
|
||||||
@@ -374,7 +374,7 @@ public class ReservationStockInOrderImpl extends ServiceImpl<ReservationStockInO
|
|||||||
reservationInMaterialDetailDO.setCreateBy(loginUser.getUserPo().getUserId());
|
reservationInMaterialDetailDO.setCreateBy(loginUser.getUserPo().getUserId());
|
||||||
reservationInMaterialDetailDO.setCreateByName(loginUser.getUserPo().getUserName());
|
reservationInMaterialDetailDO.setCreateByName(loginUser.getUserPo().getUserName());
|
||||||
reservationInMaterialDetailDO.setCreateTime(new Date());
|
reservationInMaterialDetailDO.setCreateTime(new Date());
|
||||||
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByName(stockInProductDetail.getProductName());
|
MaterialBaseInfoPO materialBaseInfoPO = stockInOrderMapper.getByCode(stockInProductDetail.getProductCode());
|
||||||
if (materialBaseInfoPO != null) {
|
if (materialBaseInfoPO != null) {
|
||||||
reservationInMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId());
|
reservationInMaterialDetailDO.setMaterialBaseInfoId(materialBaseInfoPO.getMaterialBaseInfoId());
|
||||||
reservationInMaterialDetailDO.setMaterialName(materialBaseInfoPO.getMaterialName());
|
reservationInMaterialDetailDO.setMaterialName(materialBaseInfoPO.getMaterialName());
|
||||||
|
|||||||
+3
-3
@@ -10,7 +10,7 @@ import java.util.Date;
|
|||||||
@Data
|
@Data
|
||||||
public class StockInProductDetail {
|
public class StockInProductDetail {
|
||||||
// 产品编号(Excel第1列)
|
// 产品编号(Excel第1列)
|
||||||
private Integer productCode;
|
private String productCode;
|
||||||
// 产品名称(Excel第2列)
|
// 产品名称(Excel第2列)
|
||||||
private String productName;
|
private String productName;
|
||||||
// 箱含量(Excel第5列)
|
// 箱含量(Excel第5列)
|
||||||
@@ -23,11 +23,11 @@ public class StockInProductDetail {
|
|||||||
private Date drinkDate;
|
private Date drinkDate;
|
||||||
|
|
||||||
// Getter和Setter方法
|
// Getter和Setter方法
|
||||||
public Integer getProductCode() {
|
public String getProductCode() {
|
||||||
return productCode;
|
return productCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setProductCode(Integer productCode) {
|
public void setProductCode(String productCode) {
|
||||||
this.productCode = productCode;
|
this.productCode = productCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
@@ -465,6 +465,9 @@
|
|||||||
<select id="getByName" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO">
|
<select id="getByName" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO">
|
||||||
select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and MATERIAL_NAME = #{name}
|
select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and MATERIAL_NAME = #{name}
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getByCode" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO">
|
||||||
|
select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and MATERIAL_CODE = #{code}
|
||||||
|
</select>
|
||||||
<select id="getMaterialBaseInfoList" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO">
|
<select id="getMaterialBaseInfoList" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO">
|
||||||
select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and material_code = #{id}
|
select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where 1 = 1 and DEL_FLAG = 1 and material_code = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
Reference in New Issue
Block a user