Browse Source

Merge branch 'master' into fix-bug-20231211

single_db
pref_mail@163.com 1 year ago
parent
commit
fe866ac202
  1. 13
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOrderClient.java
  2. 2
      blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/entity/WarehouseMappingDataEntity.java
  3. 23
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/OrderClient.java
  4. 10
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.java
  5. 94
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml
  6. 10
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IOrderService.java
  7. 23
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/OrderServiceImpl.java
  8. 7
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java
  9. 2
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java
  10. 4
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/AsyncDataServiceImpl.java
  11. 6
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

13
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/IOrderClient.java

@ -44,10 +44,10 @@ public interface IOrderClient {
List<String> findOrderListByParam(@RequestParam String param);
@GetMapping(API_PREFIX + "/getTotalCountBy")
Integer getTotalCountBy(@RequestParam String param, @RequestParam Integer oldWarehouseId);
Integer getTotalCountBy(@RequestParam String param, @RequestParam Integer oldWarehouseId, @RequestParam String tableName);
@GetMapping(API_PREFIX + "/findOrderCodeListByPage")
List<String> findOrderCodeListByPage(@RequestParam String param, @RequestParam Integer oldWarehouseId, @RequestParam Integer pageNum, @RequestParam Integer pageSize);
List<String> findOrderCodeListByPage(@RequestParam String param, @RequestParam Integer oldWarehouseId, @RequestParam Integer pageNum, @RequestParam Integer pageSize, @RequestParam String tableName);
@GetMapping(API_PREFIX + "/getGoodsTypeByOrderCode")
Integer getGoodsTypeByOrderCode(@RequestParam String orderCode,@RequestParam Integer oldWarehouseId);
@ -57,4 +57,13 @@ public interface IOrderClient {
@GetMapping(API_PREFIX + "/findOrderCodeListByZero")
List<String> findOrderCodeListByZero(@RequestParam String param, @RequestParam Integer oldWarehouseId, @RequestParam Integer pageNum, @RequestParam Integer pageSize);
@GetMapping(API_PREFIX + "/getTotalCountByInventory")
Integer getTotalCountByInventory(@RequestParam String param, @RequestParam Integer oldWarehouseId);
@GetMapping(API_PREFIX + "/findOrderCodeListByPageWithInventoryId")
List<String> findOrderCodeListByPageWithInventoryId(@RequestParam String param, @RequestParam Integer oldWarehouseId, @RequestParam Integer pageNum, @RequestParam Integer pageSize);
@GetMapping(API_PREFIX + "/updateStatusWithTableName")
void updateStatusWithTableName(@RequestParam int isUpdate, @RequestParam String orderCode, @RequestParam String tableName);
}

2
blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/entity/WarehouseMappingDataEntity.java

@ -23,4 +23,6 @@ public class WarehouseMappingDataEntity {
private Integer inventoryId;
private String tableName;
}

23
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/OrderClient.java

@ -48,13 +48,13 @@ public class OrderClient implements IOrderClient {
}
@Override
public Integer getTotalCountBy(String param, Integer oldWarehouseId) {
return orderService.getTotalCountBy(param,oldWarehouseId);
public Integer getTotalCountBy(String param, Integer oldWarehouseId,String tableName) {
return orderService.getTotalCountBy(param,oldWarehouseId,tableName);
}
@Override
public List<String> findOrderCodeListByPage(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize) {
return orderService.findOrderCodeListByPage(param,oldWarehouseId,pageNum,pageSize);
public List<String> findOrderCodeListByPage(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize,String tableName) {
return orderService.findOrderCodeListByPage(param,oldWarehouseId,pageNum,pageSize,tableName);
}
@Override
@ -71,4 +71,19 @@ public class OrderClient implements IOrderClient {
public List<String> findOrderCodeListByZero(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize) {
return orderService.findOrderCodeListByZero(param,oldWarehouseId,pageNum,pageSize);
}
@Override
public Integer getTotalCountByInventory(String param, Integer oldWarehouseId) {
return orderService.getTotalCountByInventory(param,oldWarehouseId);
}
@Override
public List<String> findOrderCodeListByPageWithInventoryId(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize) {
return orderService.findOrderCodeListByPageWithInventoryId(param,oldWarehouseId,pageNum,pageSize);
}
@Override
public void updateStatusWithTableName(int isUpdate, String orderCode, String tableName) {
orderService.updateStatusWithTableName(isUpdate,orderCode,tableName);
}
}

10
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.java

@ -30,13 +30,19 @@ import java.util.List;
*/
public interface OrderMapper extends BaseMapper<OrderEntity> {
Integer getTotalCountBy(@Param("param") String param, @Param("oldWarehouseId") Integer oldWarehouseId);
Integer getTotalCountBy(@Param("param") String param, @Param("oldWarehouseId") Integer oldWarehouseId, @Param("tableName") String tableName);
List<String> findOrderCodeListByPage(@Param("param") String param, @Param("oldWarehouseId") Integer oldWarehouseId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
List<String> findOrderCodeListByPage(@Param("param") String param, @Param("oldWarehouseId") Integer oldWarehouseId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize, @Param("tableName") String tableName);
Integer getGoodsTypeByOrderCode(@Param("orderCode") String orderCode,@Param("oldWarehouseId") Integer oldWarehouseId);
Integer getTotalCountByZero(@Param("param") String param, @Param("oldWarehouseId") Integer oldWarehouseId);
List<String> findOrderCodeListByZero(@Param("param") String param, @Param("oldWarehouseId") Integer oldWarehouseId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
Integer getTotalCountByInventory(@Param("param") String param, @Param("oldWarehouseId") Integer oldWarehouseId);
List<String> findOrderCodeListByPageWithInventoryId(@Param("param") String param, @Param("oldWarehouseId") Integer oldWarehouseId, @Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize);
void updateStatusWithTableName(@Param("isUpdate") int isUpdate, @Param("orderCode") String orderCode, @Param("tableName") String tableName);
}

94
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/OrderMapper.xml

@ -4,29 +4,80 @@
<select id="getTotalCountBy" resultType="Integer">
select count(t.orderSelfNum)
from ${tableName} `o`
left join (SELECT
`i`.`is_opai`,
ORDER.serviceNum service_num,
i.is_opai opai,
`i`.`latest_in_time`,
`i`.`total`,
i.STATUS AS statuses,
`i`.`orderSelfNum`,
i.create_time AS invoice_time,
`i`.`status`,
`i`.`in_num`,
`i`.`delive_num`,
`i`.`out_num`,
`i`.`sorting`,
`i`.`sign_num`,
`i`.`trans_num`,
`i`.`update_time`,
`i`.`administrators_id`,
`i`.`warehouse_id`,
`i`.`create_time`,
`i`.`finish_time`,
`i`.`type`,
`order`.`id`,
`order`.`number`,
`order`.`servicenum`,
`order`.`location_id`,
`order`.`on_shelf_type`,
`order`.`source`,
`order`.`emergency`,
`order`.`selfnumber`,
`i`.`delive_total`,
`order`.`contact`,
`order`.`phone`,
`order`.`address`,
`order`.`door`,
`order`.`payment`,
`i`.`delives_num`
FROM `ht_order_count` `i`
INNER JOIN `ht_order` `order` ON `order`.`selfnumber` = `i`.`orderSelfNum`
WHERE
`i`.`status` &lt;&gt; 11
AND `i`.`delete_time` = '0'
AND `i`.`goods_type` = '1'
AND ( ( `i`.`in_num` + `i`.`delives_num` ) > 0 )
and `i`.warehouse_id = #{oldWarehouseId}
<if test="param != null and param != ''">
AND `i`.`orderSelfNum` = #{param}
</if>
ORDER BY
`i`.`update_time` DESC) t on `o`.order_code = t.orderSelfNum
</select>
<select id="getTotalCountByInventory" resultType="int">
SELECT
count(`i`.`orderSelfNum`)
FROM
`ht_order_count` `i`
FROM `ht_order_count` `i`
INNER JOIN `ht_order` `order` ON `order`.`selfnumber` = `i`.`orderSelfNum`
WHERE
`i`.`status` &lt;&gt; 11
and `i`.`history_type` = 0
AND `i`.`delete_time` = '0'
AND ( ( `i`.`in_num` + `i`.`delives_num` ) > 0 )
AND `i`.`goods_type` = '1'
AND `i`.warehouse_id = #{oldWarehouseId}
AND ( ( `i`.`in_num` + `i`.`delives_num` ) > 0 )
and `i`.warehouse_id = #{oldWarehouseId}
<if test="param != null and param != ''">
AND `i`.`orderSelfNum` = #{param}
</if>
ORDER BY
`i`.`update_time` DESC
</select>
<select id="findOrderCodeListByPage" resultType="java.lang.String">
<select id="findOrderCodeListByPageWithInventoryId" resultType="java.lang.String">
SELECT
`i`.`orderSelfNum`
FROM
@ -47,6 +98,27 @@
LIMIT #{pageNum},#{pageSize}
</select>
<select id="findOrderCodeListByPage" resultType="java.lang.String">
select t.orderSelfNum
from ${tableName} `o`
left join (SELECT
`i`.`orderSelfNum`
FROM `ht_order_count` `i`
INNER JOIN `ht_order` `order` ON `order`.`selfnumber` = `i`.`orderSelfNum`
WHERE
`i`.`status` &lt;&gt; 11
AND `i`.`delete_time` = '0'
AND `i`.`goods_type` = '1'
AND ( ( `i`.`in_num` + `i`.`delives_num` ) > 0 )
and `i`.warehouse_id = #{oldWarehouseId}
<if test="param != null and param != ''">
AND `i`.`orderSelfNum` = #{param}
</if>
ORDER BY
`i`.`id` DESC) t on `o`.order_code = t.orderSelfNum
LIMIT #{pageNum},#{pageSize}
</select>
<select id="getGoodsTypeByOrderCode" resultType="java.lang.Integer">
select goods_type
from `ht_order_count` `i`
@ -106,4 +178,10 @@
LIMIT #{pageNum},#{pageSize}
</select>
<update id="updateStatusWithTableName">
update ${tableName}
set is_update = #{isUpdate}
where order_code = #{orderCode}
</update>
</mapper>

10
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/IOrderService.java

@ -10,13 +10,19 @@ public interface IOrderService {
List<String> findOrderListByParam(String param);
Integer getTotalCountBy(String param, Integer oldWarehouseId);
Integer getTotalCountBy(String param, Integer oldWarehouseId,String tableName);
List<String> findOrderCodeListByPage(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize);
List<String> findOrderCodeListByPage(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize,String tableName);
Integer getGoodsTypeByOrderCode(String orderCode,Integer oldWarehouseId);
Integer getTotalCountByZero(String param, Integer oldWarehouseId);
List<String> findOrderCodeListByZero(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize);
Integer getTotalCountByInventory(String param, Integer oldWarehouseId);
List<String> findOrderCodeListByPageWithInventoryId(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize);
void updateStatusWithTableName(int isUpdate, String orderCode, String tableName);
}

23
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/OrderServiceImpl.java

@ -35,13 +35,13 @@ public class OrderServiceImpl implements IOrderService {
}
@Override
public Integer getTotalCountBy(String param, Integer oldWarehouseId) {
return orderMapper.getTotalCountBy(param,oldWarehouseId);
public Integer getTotalCountBy(String param, Integer oldWarehouseId,String tableName) {
return orderMapper.getTotalCountBy(param,oldWarehouseId,tableName);
}
@Override
public List<String> findOrderCodeListByPage(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize) {
return orderMapper.findOrderCodeListByPage(param,oldWarehouseId,pageNum*pageSize,pageSize);
public List<String> findOrderCodeListByPage(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize,String tableName) {
return orderMapper.findOrderCodeListByPage(param,oldWarehouseId,pageNum*pageSize,pageSize,tableName);
}
@Override
@ -58,4 +58,19 @@ public class OrderServiceImpl implements IOrderService {
public List<String> findOrderCodeListByZero(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize) {
return orderMapper.findOrderCodeListByZero(param,oldWarehouseId,pageNum*pageSize,pageSize);
}
@Override
public Integer getTotalCountByInventory(String param, Integer oldWarehouseId) {
return orderMapper.getTotalCountByInventory(param,oldWarehouseId);
}
@Override
public List<String> findOrderCodeListByPageWithInventoryId(String param, Integer oldWarehouseId, Integer pageNum, Integer pageSize) {
return orderMapper.findOrderCodeListByPageWithInventoryId(param,oldWarehouseId,pageNum,pageSize);
}
@Override
public void updateStatusWithTableName(int isUpdate, String orderCode, String tableName) {
orderMapper.updateStatusWithTableName(isUpdate,orderCode,tableName);
}
}

7
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncOrderInfoToPlatform.java

@ -78,6 +78,7 @@ public class SyncOrderInfoToPlatform {
for (WarehouseMappingDataEntity mappingDataEntity:warehouseMappingDataEntityList){
Integer oldWarehouseId = mappingDataEntity.getOldWarehouseId();//老系统仓库id
Long newWarehouseId = mappingDataEntity.getNewWarehouseId();//新系统仓库id
String tableName = mappingDataEntity.getTableName();
//查询新系统是否已有仓库信息
BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(newWarehouseId);
@ -100,7 +101,7 @@ public class SyncOrderInfoToPlatform {
currentPage = one.getCurrentPage();
}else{
//查询本次同步一共多少的个订单
Integer totalNum = orderClient.getTotalCountBy(param,oldWarehouseId);
Integer totalNum = orderClient.getTotalCountBy(param,oldWarehouseId,tableName);
if(totalNum == 0){
log.info("################syncZeroOrderInfo: 暂无需要执行的数据");
return ReturnT.SUCCESS;
@ -130,9 +131,9 @@ public class SyncOrderInfoToPlatform {
for (int j = currentPage; j < totalPage; j++) {
log.info("##################syncOrderInfo: 当前同步的第{}页的数据",j+1);
try{
List<String> orderCodeList = orderClient.findOrderCodeListByPage(param,oldWarehouseId,j,pageSize);
List<String> orderCodeList = orderClient.findOrderCodeListByPage(param,oldWarehouseId,j,pageSize,tableName);
syncOrderInfoService.handleData(orderCodeList,oldWarehouseId,newWarehouseId);
syncOrderInfoService.handleData(orderCodeList,oldWarehouseId,newWarehouseId,tableName);
log.info("################syncOrderInfo: 同步成功{}个订单",orderCodeList.size());
one.setCurrentPage(j+1);

2
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISyncOrderInfoService.java

@ -3,7 +3,7 @@ package com.logpm.patch.service;
import java.util.List;
public interface ISyncOrderInfoService {
void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId);
void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId,String tableName);
void handleDataZero(List<String> orderCodeList, Integer oldWarehouseId, Long newWarehouseId);

4
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/AsyncDataServiceImpl.java

@ -70,7 +70,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
currentPage = one.getCurrentPage();
}else{
//查询本次同步一共多少的个订单
Integer totalNum = orderClient.getTotalCountBy("",oldWarehouseId);
Integer totalNum = orderClient.getTotalCountByInventory("",oldWarehouseId);
if(totalNum == 0){
log.info("################syncOrderInfo: 暂无需要执行的数据");
throw new CustomerException(403,"暂无需要执行的数据");
@ -104,7 +104,7 @@ public class AsyncDataServiceImpl implements IAsyncDataService {
for (int j = currentPage; j < totalPage; j++) {
log.info("##################syncOrderInfo: 当前同步的第{}页的数据",j+1);
try{
List<String> orderCodeList = orderClient.findOrderCodeListByPage("",oldWarehouseId,j,pageSize);
List<String> orderCodeList = orderClient.findOrderCodeListByPageWithInventoryId("",oldWarehouseId,j,pageSize);
syncOrderInfoService.handleDataAndInventoryId(orderCodeList,oldWarehouseId,newWarehouseId,inventoryId);

6
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -84,7 +84,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
@Transactional(rollbackFor = Exception.class)
@Override
public void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId) {
public void handleData(List<String> orderCodeList,Integer oldWarehouseId,Long newWarehouseId,String tableName) {
log.info("#############handleData: 处理订单开始");
for (String orderCode:orderCodeList){
log.info("#############handleData: 当前处理orderCode={}的订单 ",orderCode);
@ -105,10 +105,14 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
saveTrayTypeInfoPackage(orderCode,oldWarehouseId,newWarehouseId);
orderClient.updateStatusWithTableName(1,orderCode,tableName);
}catch (CustomerException e){
log.error("同步订单"+orderCode+"失败: "+e.message,e);
orderClient.updateStatusWithTableName(2,orderCode,tableName);
}catch (Exception e){
log.error("同步订单"+orderCode+"失败",e);
orderClient.updateStatusWithTableName(2,orderCode,tableName);
}
// }

Loading…
Cancel
Save