Browse Source

feat(all): 优化代码,添加注释

pull/33/head
zhaoqiaobo 12 months ago
parent
commit
9013e1f3c5
  1. 25
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapeer.java
  2. 28
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapper.xml
  3. 7
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/MerchantService.java
  4. 8
      blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/MerchantServiceImpl.java

25
blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapeer.java

@ -16,10 +16,29 @@ import java.util.List;
public interface MerchantMapeer extends BaseMapper {
MerchantOrderDTO findMerchantOrder(@Param("contract_number") String contract_number, List<String> warehouseId);
/**
* 根据合同号和仓库ID列表查找商家订单
*
* @param contractNumber 合同编号用于查找相关的商家订单
* @param warehouseId 仓库ID列表用于筛选在指定仓库中的订单
* @return 返回一个MerchantOrderDTO对象包含符合条件的商家订单信息
*/
MerchantOrderDTO findMerchantOrder(@Param("contractNumber") String contractNumber, @Param("warehouseId") List<String> warehouseId);
/**
* 根据授权密钥查找仓库ID列表
*
* @param authKey 授权密钥用于权限验证和特定仓库的访问
* @return 返回一个字符串列表包含匹配的仓库ID如果没有找到匹配的仓库ID则返回空列表
*/
List<String> findWarehouseIdByAuthKey(@Param("authKey") String authKey);
List<MerchantPackageVO> findPackage(@Param("contract_number") String contract_number);
/**
* 根据合同编号查找包件信息
*
* @param contractNumber 合同编号用于查询特定合同下的包件信息
* @return 返回一个MerchantPackageVO类型的列表包含符合条件的包件信息
*/
List<MerchantPackageVO> findPackage(@Param("contractNumber") String contractNumber);
}

28
blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/mapper/MerchantMapper.xml

@ -9,7 +9,7 @@
t.is_zero zeroOrder,
t.total_number total
from logpm_distribution_stock_article t
where t.order_code = #{contract_number}
where t.order_code = #{contractNumber}
<if test="warehouseId != null and warehouseId.size() > 0">
and t.warehouse_id in
<foreach collection="warehouseId" item="item" separator="," open="(" close=")">
@ -25,26 +25,26 @@
and t.is_deleted = 0
</select>
<select id="findPackage" resultType="com.logpm.datasharing.vo.MerchantPackageVO">
select
lww.shipper_address sendAddress,
ldpl.waybill_number waybillNumber,
ldpl.order_package_code orderPackageCode,
ldpl.order_package_status orderPackageStatus,
t.update_time updateTime,
ifnull(driver.lname,driver.ltname) distributionName,
ifnull(driver.lphone,driver.ltphone) distributionPhone
select lww.shipper_address sendAddress,
ldpl.waybill_number waybillNumber,
ldpl.order_package_code orderPackageCode,
ldpl.order_package_status orderPackageStatus,
t.update_time updateTime,
ifnull(driver.lname, driver.ltname) distributionName,
ifnull(driver.lphone, driver.ltphone) distributionPhone
from logpm_distribution_stock_article t
left join logpm_distribution_reservation_stockarticle ldrs on ldrs.stock_article_id = t.id and ldrs.stock_article_status !=2
left join logpm_distribution_reservation ldr on ldr.id = ldrs.reservation_id and ldr.reservation_status !=40
left join logpm_distribution_reservation_stockarticle ldrs
on ldrs.stock_article_id = t.id and ldrs.stock_article_status !=2
left join logpm_distribution_reservation ldr
on ldr.id = ldrs.reservation_id and ldr.reservation_status !=40
join logpm_distribution_reservation_package ldrp
on ldrp.reservation_id = ldr.id and ldrp.packet_bar_status != 2
left join logpm_distribution_parcel_list ldpl on ldpl.id = ldrp.parce_list_id
left join logpm_warehouse_waybill lww on lww.waybill_no = ldpl.waybill_number
left join logpm_distribution_signfor lds on lds.reservation_id = ldr.id
left join logpm_distribution_delivery_list lddl on lddl.id = lds.delivery_id
left join (select lddl.id,
group_concat(ldd.driver_name) lname,
group_concat(ldd.driver_name) lname,
group_concat(lddt.driver_name) ltname,
group_concat(ldd.driver_phone) lphone,
group_concat(lddt.driver_phone) ltphone
@ -52,7 +52,7 @@
left join logpm_distribution_delivery_self ldd on ldd.delivery_id = lddl.id
left join logpm_distribution_delivery_tripartite lddt on lddt.delivery_id = lddl.id
group by lddl.id) driver on driver.id = lddl.id
where t.order_code = #{contract_number}
where t.order_code = #{contractNumber}
</select>
</mapper>

7
blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/MerchantService.java

@ -9,10 +9,11 @@ import com.logpm.datasharing.vo.MerchantOrderVO;
public interface MerchantService {
/**
* 根据合同编号查询商品信息
* 根据合同编号和授权密钥获取商户订单信息
*
* @param contract_number 合同编号用于查询特定合同下的商品信息
* @return 返回一个包含商品信息的响应对象具体商品信息封装在MerchantOrderVO中
* @param contractNumber 合同编号用于识别特定的合同
* @param authKey 授权密钥用于验证请求的合法性
* @return MerchantOrderVO 商户订单的视图对象包含订单的详细信息
*/
MerchantOrderVO goods(String contractNumber, String authKey);
}

8
blade-service/logpm-data-sharing/src/main/java/com/logpm/datasharing/service/impl/MerchantServiceImpl.java

@ -25,18 +25,19 @@ public class MerchantServiceImpl implements MerchantService {
private final MerchantMapeer merchantMapeer;
@Override
public MerchantOrderVO goods(String contract_number, String authKey) {
public MerchantOrderVO goods(String contractNumber, String authKey) {
MerchantOrderDTO dto = null;
// 根据 authKey 获取仓库信息
List<String> warehouseId = merchantMapeer.findWarehouseIdByAuthKey(authKey);
if (CollUtil.isNotEmpty(warehouseId)) {
// 根据合同编号获取合同信息
dto = merchantMapeer.findMerchantOrder(contract_number, warehouseId);
dto = merchantMapeer.findMerchantOrder(contractNumber, warehouseId);
if (ObjectUtil.isNotEmpty(dto)) {
// TODO 这里分几种情况 零担订单,包件,库存品有数据/无数据 目前只实现了包件,其他的后续处理
// 零担订单
// 定制品
// 包件/库存品
List<MerchantPackageVO> packageVO = merchantMapeer.findPackage(contract_number);
List<MerchantPackageVO> packageVO = merchantMapeer.findPackage(contractNumber);
MerchantOrderPackageVO orderPackageVO = new MerchantOrderPackageVO();
BeanUtil.copyProperties(dto, orderPackageVO);
orderPackageVO.setPackageInfor(packageVO);
@ -45,4 +46,5 @@ public class MerchantServiceImpl implements MerchantService {
}
return null;
}
}

Loading…
Cancel
Save