Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev-warehouse
caoyizhong 2 years ago
parent
commit
4e1e73bf6c
  1. 5
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataStoreBusinessClient.java
  2. 3
      blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtPackageInfo.java
  3. 4
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/INewDistributionContactClient.java
  4. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/BasicDataApplication.java
  5. 7
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java
  6. 104
      blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java
  7. 5
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  8. 4
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/NewDistributionContactClient.java
  9. 1
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml
  10. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/INewDistributionContactService.java
  11. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/NewDistributionContactServiceImpl.java

5
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataStoreBusinessClient.java

@ -16,8 +16,9 @@
*/
package com.logpm.basicdata.feign;
import org.springblade.core.mp.support.BladePage;
import com.logpm.basicdata.entity.BasicdataStoreBusinessEntity;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.mp.support.BladePage;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -29,7 +30,7 @@ import org.springframework.web.bind.annotation.RequestParam;
* @since 2023-06-19
*/
@FeignClient(
value = "blade-basicdataStoreBusiness"
value = ModuleNameConstant.APPLICATION_BASICDATA_NAME
)
public interface IBasicdataStoreBusinessClient {

3
blade-service-api/logpm-factory-api/src/main/java/com/logpm/factory/snm/entity/MtPackageInfo.java

@ -54,4 +54,7 @@ public class MtPackageInfo extends BaseEntity {
@ApiModelProperty(value = "订单id")
private Long orderId;
@ApiModelProperty(value = "订单自编码")
private String orderCode;
}

4
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/feign/INewDistributionContactClient.java

@ -35,6 +35,6 @@ public interface INewDistributionContactClient {
String API_PREFIX = "/client";
String TOP = API_PREFIX + "/top";
@GetMapping(API_PREFIX + "/fingById")
NewDistributionContactEntity fingById(@RequestParam Integer NewDistributionContactId);
@GetMapping(API_PREFIX + "/fingByNewDistributionContactId")
NewDistributionContactEntity fingByNewDistributionContactId(@RequestParam Integer NewDistributionContactId);
}

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/BasicDataApplication.java

@ -1,7 +1,6 @@
package com.logpm.basicdata;
import org.springblade.common.constant.LauncherConstant;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.cloud.client.BladeCloudApplication;
import org.springblade.core.launch.BladeApplication;
@ -15,7 +14,7 @@ import org.springblade.core.launch.BladeApplication;
public class BasicDataApplication {
public static void main(String[] args) {
BladeApplication.run(ModuleNameConstant.APPLICATION_BASICDATA_NAME.concat("-lmy"), BasicDataApplication.class, args);
BladeApplication.run(ModuleNameConstant.APPLICATION_BASICDATA_NAME, BasicDataApplication.class, args);
}

7
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/controller/MtFactoryDataController.java

@ -77,11 +77,14 @@ public class MtFactoryDataController extends BladeController {
R r = mtFactoryDataService.dealWithData(mtFactoryDataDTO);
int code = r.getCode();
Map<String,Long> map = (Map<String, Long>) r.getData();
Long mainId = map.get("mainId");
if(code == 200){
orderStatusLog.setStatus(0);
//开启异步线程处理数据
Map<String,Long> map = (Map<String, Long>) r.getData();
asyncDataService.handlerMtDataToHt(map.get("mainId"));
if(mainId != 0){
asyncDataService.handlerMtDataToHt(map.get("mainId"));
}
}else{
orderStatusLog.setStatus(2);
}

104
blade-service/logpm-factory/src/main/java/com/logpm/factory/mt/service/impl/MtFactoryDataServiceImpl.java

@ -68,59 +68,65 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
log.warn("#############dealWithData: 数据已存在 invoiceOrderCode={}",invoiceOrderCode);
return R.fail(405,"发货单已存在");
}
mtFactoryOrderMain = new MtFactoryOrderMain();
BeanUtil.copyProperties(mtFactoryDataDTO,mtFactoryOrderMain);
boolean saveMain = mtFactoryOrderMainService.save(mtFactoryOrderMain);
if(saveMain){
mainId = mtFactoryOrderMain.getId();//发货单id
List<MtFactoryOrderDTO> orderList = mtFactoryDataDTO.getOrderList();//所有订单数据
for(MtFactoryOrderDTO mtFactoryOrderDTO:orderList){
String orderCode = mtFactoryOrderDTO.getOrderCode();
MtFactoryOrder mtFactoryOrder = new MtFactoryOrder();
BeanUtil.copyProperties(mtFactoryOrderDTO,mtFactoryOrder);
mtFactoryOrder.setMainId(mainId);
boolean saveOrder = mtFactoryOrderService.save(mtFactoryOrder);
if(saveOrder){
//根据订单自编码去查是否有已存在的包件,有就舍去
Long orderId = mtFactoryOrder.getId();
QueryWrapper<MtPackageInfo> qw = new QueryWrapper<>();
qw.eq("order_id",orderId);
List<MtPackageInfo> existPackages = mtPackageInfoService.list(qw);
List<MtPackageInfoDTO> packageInfos = mtFactoryOrderDTO.getPackageInfos();
for(MtPackageInfo mtPackageInfo:existPackages){
String packageCode = mtPackageInfo.getPackageCode();
for (MtPackageInfoDTO mtPackageInfoDTO:packageInfos){
String pc = mtPackageInfoDTO.getPackageCode();
if(packageCode.equals(pc)){
packageInfos.remove(mtPackageInfoDTO);
break;
}
}
}
List<MtPackageInfo> list = new ArrayList<>();
for(MtPackageInfoDTO mtPackageInfoDTO:packageInfos){
MtPackageInfo mtPackageInfo = new MtPackageInfo();
BeanUtil.copyProperties(mtPackageInfoDTO,mtPackageInfo);
mtPackageInfo.setOrderId(orderId);
list.add(mtPackageInfo);
}
//保存包件信息
boolean b = mtPackageInfoService.saveBatch(list);
if(b){
log.info("#############dealWithData: 保存数据成功");
}else{
log.warn("#############dealWithData: 保存数据失败 orderCode={}",orderCode);
throw new CustomerException(405,"保存数据失败");
//先取出所有发车单下面的订单
List<MtFactoryOrderDTO> orderList = mtFactoryDataDTO.getOrderList();//所有订单数据
for(MtFactoryOrderDTO mtFactoryOrderDTO:orderList){
String orderCode = mtFactoryOrderDTO.getOrderCode();//订单自编码
//先取出订单下面的包件进行判断是否存在
List<MtPackageInfoDTO> packageInfos = mtFactoryOrderDTO.getPackageInfos();
//查询出该订单自编码下面的目前存在的所有包件
QueryWrapper<MtPackageInfo> qw = new QueryWrapper<>();
qw.eq("order_code",orderCode);
List<MtPackageInfo> existPackages = mtPackageInfoService.list(qw);
for(MtPackageInfo mtPackageInfo:existPackages){
String packageCode = mtPackageInfo.getPackageCode();
for (MtPackageInfoDTO mtPackageInfoDTO:packageInfos){
String pc = mtPackageInfoDTO.getPackageCode();
if(packageCode.equals(pc)){
packageInfos.remove(mtPackageInfoDTO);
break;
}
}
}
//判断是否有新的包件
if(packageInfos.size() == 0){
//如果没有新增包件就直接下一条数据
continue;
}
//如果有新增包件就去存入订单发车单,和订单信息
if(Objects.isNull(mtFactoryOrderMain)){
mtFactoryOrderMain = new MtFactoryOrderMain();
BeanUtil.copyProperties(mtFactoryDataDTO,mtFactoryOrderMain);
boolean saveMain = mtFactoryOrderMainService.save(mtFactoryOrderMain);
if(saveMain){
mainId = mtFactoryOrderMain.getId();
}else{
log.warn("#############dealWithData: 保存订单失败 orderCode={}",orderCode);
throw new CustomerException(405,"保存订单失败");
log.warn("##################dealWithData: 保存头信息失败invoiceOrderCode={} ",invoiceOrderCode);
throw new CustomerException(405,"保存数据失败");
}
}
}else{
log.warn("#############dealWithData: 保存发货单失败 invoiceOrderCode={}",invoiceOrderCode);
throw new CustomerException(405,"保存发货单失败");
//保存订单信息
MtFactoryOrder mtFactoryOrder = new MtFactoryOrder();
BeanUtil.copyProperties(mtFactoryOrderDTO,mtFactoryOrder);
mtFactoryOrder.setMainId(mainId);
boolean saveOrder = mtFactoryOrderService.save(mtFactoryOrder);
Long orderId = mtFactoryOrder.getId();
if(saveOrder){
List<MtPackageInfo> list = new ArrayList<>();
for(MtPackageInfoDTO mtPackageInfoDTO:packageInfos){
MtPackageInfo mtPackageInfo = new MtPackageInfo();
BeanUtil.copyProperties(mtPackageInfoDTO,mtPackageInfo);
mtPackageInfo.setOrderId(orderId);
mtPackageInfo.setOrderCode(orderCode);
list.add(mtPackageInfo);
}
//保存包件信息
boolean b = mtPackageInfoService.saveBatch(list);
}else{
log.warn("##################dealWithData: 保存订单信息失败orderCode={} ",orderCode);
throw new CustomerException(405,"保存数据失败");
}
}
Map<String,Long> map = new HashMap<>();
map.put("mainId",mainId);
@ -312,7 +318,7 @@ public class MtFactoryDataServiceImpl implements IMtFactoryDataService {
List<ReceiveBodyDTO> receiveBodyList = receiveInfoDTO.getReceiveBodyList();
List<ReceivePhotoDTO> receivePhotoList = receiveInfoDTO.getReceivePhotoList();
//查询签收人
NewDistributionContactEntity newDistributionContactEntity = newDistributionContactClient.fingById(newDistributionContactId);
NewDistributionContactEntity newDistributionContactEntity = newDistributionContactClient.fingByNewDistributionContactId(newDistributionContactId);
String receiver = null;
if (!Objects.isNull(newDistributionContactEntity)){
receiver = newDistributionContactEntity.getContact();

5
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -436,6 +436,11 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
}
}
factoryOrderDTO.setORDER_ATTRIBUTES(order_attributes);
if(order_attributes.size() == 0){
logger.info("###########saveData: 没有新增包件,不保存信息");
return null;
}
}
PanFactoryOrder factoryOrder = new PanFactoryOrder();

4
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/NewDistributionContactClient.java

@ -14,7 +14,7 @@ public class NewDistributionContactClient implements INewDistributionContactClie
private final INewDistributionContactService newDistributionContactService;
@Override
public NewDistributionContactEntity fingById(Integer NewDistributionContactId) {
return newDistributionContactService.fingById(NewDistributionContactId);
public NewDistributionContactEntity fingByNewDistributionContactId(Integer NewDistributionContactId) {
return newDistributionContactService.fingByNewDistributionContactId(NewDistributionContactId);
}
}

1
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/AdvanceMapper.xml

@ -20,6 +20,7 @@
delete_administrators_id = 0
and orderSelfNum = #{orderSelfNum}
</where>
limit 1
</select>
<insert id="addAll" useGeneratedKeys="true" keyProperty="id">

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/INewDistributionContactService.java

@ -4,5 +4,5 @@ import com.logpm.oldproject.entity.NewDistributionContactEntity;
public interface INewDistributionContactService {
NewDistributionContactEntity fingById(Integer newDistributionContactId);
NewDistributionContactEntity fingByNewDistributionContactId(Integer newDistributionContactId);
}

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/service/impl/NewDistributionContactServiceImpl.java

@ -13,7 +13,7 @@ public class NewDistributionContactServiceImpl implements INewDistributionContac
private final NewDistributionContactMapper newDistributionContactMapper;
@Override
public NewDistributionContactEntity fingById(Integer newDistributionContactId) {
public NewDistributionContactEntity fingByNewDistributionContactId(Integer newDistributionContactId) {
return newDistributionContactMapper.selectById(newDistributionContactId);
}
}

Loading…
Cancel
Save