委托方导入修改以及OMS库存查询调整

This commit is contained in:
秦鸿展
2026-07-22 14:10:29 +08:00
parent 49b3722328
commit 8a78122fcb
8 changed files with 68 additions and 6 deletions
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.concurrent.CompletableFuture;
@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://10.33.0.99:8017", fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
@FeignClient(contextId = "OmsService", value = ServiceNameConstants.OMS_SERVICE,url = "http://127.0.0.1:8017", fallbackFactory = RemoteOmsFeignFallbackFactory.class, configuration = FeignAutoConfiguration.class)
public interface OmsServiceFeign {
@@ -385,10 +385,12 @@ public class UserShipperApplicationService {
shipperDO.setDataSource(2);
shipperDO.setUserAccount(userAccount);
shipperDO.setShipperEnterpriseName(companyName);
shipperDO.setEmergencyContactName(getCellStr(row.getCell(2)));
shipperDO.setEmergencyContactPhone(getCellStr(row.getCell(3)));
shipperDO.setArea(getCellStr(row.getCell(4)));
shipperDO.setDetailAddress(getCellStr(row.getCell(5)));
// 联系人 -> user表 user_name,联系电话 -> user表 user_phone
shipperDO.setUserName(getCellStr(row.getCell(2)));
shipperDO.setUserPhone(getCellStr(row.getCell(3)));
// 地址 -> user表 user_area_name,详细地址 -> user表 user_area_address
shipperDO.setUserAreaName(getCellStr(row.getCell(4)));
shipperDO.setUserAreaAddress(getCellStr(row.getCell(5)));
shipperDO.setRemark(getCellStr(row.getCell(6)));
shipperDO.setSettlementCurrency(getCellStr(row.getCell(7)));
addShipper(shipperDO);
@@ -244,6 +244,12 @@ public class UserShipperDO extends UserDO {
@ApiModelProperty("货主/供应商/客户名称")
private String userNameShipper;
@ApiModelProperty("用户名称")
private String userName;
@ApiModelProperty("用户电话")
private String userPhone;
@ApiModelProperty("联系人")
private String emergencyContactName;
@@ -29,6 +29,8 @@ public interface ReservationMaterialInventoryMapper extends BaseMapper<Reservati
public List<ReservationMaterialInventoryPO> queryListByWl(ReservationMaterialInventoryDO materialInventoryDO);
//查物料库存列表-货主
public List<ReservationMaterialInventoryPO> queryListByHz(ReservationMaterialInventoryDO materialInventoryDO);
//查物料库存列表-物料+过期日期
public List<ReservationMaterialInventoryPO> queryListByWlExpiry(ReservationMaterialInventoryDO materialInventoryDO);
public MaterialBaseInfo getByInfoId(@Param("id") Long id);
@@ -64,6 +64,8 @@ public class ReservationMaterialInventoryImpl extends ServiceImpl<ReservationMat
return materialInventoryMapper.queryListByKw(materialInventoryDO);
} else if ("wlkw".equals(queryRule)) {
return materialInventoryMapper.queryListByWlKw(materialInventoryDO);
} else if ("wlExpiry".equals(queryRule)) {
return materialInventoryMapper.queryListByWlExpiry(materialInventoryDO);
} else if ("all".equals(queryRule)) {
return materialInventoryMapper.queryList(materialInventoryDO);
} else {
@@ -253,4 +253,6 @@ public class ReservationMaterialInventoryDO extends MaterialBaseDO {
private String createTimeEnd;
private String expiryDateStr;
private String productionDateStr;
private String expiryDateStart;
private String expiryDateEnd;
}
@@ -50,7 +50,9 @@ public class ReservationMaterialInventoryApi extends BaseController {
@ApiOperation("查询物料库存列表")
@GetMapping("/list")
public TableDataInfo list(ReservationMaterialInventoryDTO materialInventoryDTO,
@RequestParam(value = "customerName", required = false) String customerName)
@RequestParam(value = "customerName", required = false) String customerName,
@RequestParam(value = "expiryDateStart", required = false) String expiryDateStart,
@RequestParam(value = "expiryDateEnd", required = false) String expiryDateEnd)
{
// 出库分配前端传的是客户名称 customerName这里通过名称查询货主ID使用精确匹配不模糊匹配
String shipperName = null; // 保存查询到的货主名称
@@ -78,6 +80,8 @@ public class ReservationMaterialInventoryApi extends BaseController {
ReservationMaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO);
materialInventoryDO.setExpiryDateStr(materialInventoryDTO.getExpiryDate());
materialInventoryDO.setProductionDateStr(materialInventoryDTO.getProductionDate());
materialInventoryDO.setExpiryDateStart(expiryDateStart);
materialInventoryDO.setExpiryDateEnd(expiryDateEnd);
startPage();
// 使用带批次属性的查询方法批次属性值从库存表中获取
List<ReservationMaterialInventoryPO> list = materialInventoryApplicationService.queryListWithBatchAttributes(materialInventoryDO);
@@ -276,6 +276,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="productionDateStr != null and productionDateStr != ''">
AND TO_CHAR(a.production_date, 'yyyy-MM-dd') = #{productionDateStr}
</if>
<if test="expiryDateStart != null and expiryDateStart != ''">
and a.expiry_date >= #{expiryDateStart}
</if>
<if test="expiryDateEnd != null and expiryDateEnd != ''">
and a.expiry_date <![CDATA[ < ]]> DATEADD(DAY, 1, #{expiryDateEnd})
</if>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO" resultMap="MaterialInventoryResult">
@@ -330,6 +336,44 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
GROUP BY a.MATERIAL_BASE_INFO_ID
</select>
<!-- 按物料+过期日期汇总 -->
<select id="queryListByWlExpiry" parameterType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO" resultMap="MaterialInventoryResult">
select
a.material_base_info_id, a.expiry_date, a.shipper_id, a.shipper_code, a.shipper_name,
a.organization_id, a.organization_name, a.top_organization_id,
MAX(a.warehouse_id) AS warehouse_id, MAX(a.warehouse_code) AS warehouse_code, MAX(a.warehouse_name) AS warehouse_name,
MAX(a.storage_section_id) AS storage_section_id, MAX(a.storage_code) AS storage_code, MAX(a.storage_name) AS storage_name,
MAX(a.storage_location_id) AS storage_location_id, MAX(a.storage_location_code) AS storage_location_code, MAX(a.storage_location_name) AS storage_location_name,
MAX(a.batch_number) AS batch_number, MAX(a.material_status_code) AS material_status_code, MAX(a.material_status_name) AS material_status_name,
MAX(a.container_id) AS container_id, MAX(a.container_code) AS container_code, MAX(a.container_type) AS container_type, MAX(a.container_type_name) AS container_type_name,
IFNULL(SUM(a.freeze_quantity), 0) AS freeze_quantity, a.is_able,
IFNULL(SUM(a.inventory_quantity), 0) AS inventory_quantity,
IFNULL(SUM(a.allocation_quantity), 0) AS allocation_quantity,
IFNULL(SUM(a.area), 0) AS area,
IFNULL(SUM(a.NET_WEIGHT), 0) AS NET_WEIGHT,
IFNULL(SUM(a.GROSS_WEIGHT), 0) AS GROSS_WEIGHT,
IFNULL(SUM(a.VOLUME), 0) AS VOLUME,
MAX(a.unit) AS unit,
MAX(a.unit_name) AS unit_name,
MAX(a.production_date) AS production_date,
MAX(a.inventory_date) AS inventory_date,
MAX(a.batch_ref_no) AS batch_ref_no, MAX(a.sheet_ref_no) AS sheet_ref_no, MAX(a.box_pallet_no) AS box_pallet_no,
MAX(a.bar_code) AS inv_bar_code,
MAX(a.in_order_number) AS in_order_number, MAX(a.lot_number) AS lot_number,
b.material_code, b.material_name,
CASE WHEN IFNULL(SUM(a.inventory_quantity), 0) = 0 THEN 1 ELSE 0 END AS sort_order
from reservation_material_inventory a
left join NGWL_TEST_WMS.material_base_info b on a.material_base_info_id = b.material_base_info_id
<where>
<include refid="selectMaterialInventoryPo1"/>
<include refid="JoinMaterialBaseInfoPoWhere"/>
</where>
GROUP BY a.MATERIAL_BASE_INFO_ID, a.EXPIRY_DATE, a.shipper_id, a.shipper_code, a.shipper_name,
a.organization_id, a.organization_name, a.top_organization_id,
b.material_code, b.material_name
order by sort_order, MAX(a.update_time) desc
</select>
<select id="queryListByHz" parameterType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO" resultMap="MaterialInventoryResult">
select
<include refid="selectMaterialInventoryPo"/>