Browse Source

1.修复PC签收数据推送 在进行发车后 包件重复的问题

master
pref_mail@163.com 7 months ago
parent
commit
b0334336c1
  1. 1
      blade-ops/blade-xxljob-admin/src/main/java/com/xxl/job/admin/JobAdminApplication.java
  2. 35
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java
  3. 20
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java
  4. 1
      blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java

1
blade-ops/blade-xxljob-admin/src/main/java/com/xxl/job/admin/JobAdminApplication.java

@ -12,7 +12,6 @@ public class JobAdminApplication {
public static void main(String[] args) {
BladeApplication.run(LauncherConstant.APPLICATION_XXLJOB_ADMIN_NAME, JobAdminApplication.class, args);
}

35
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataTrayServiceImpl.java

@ -18,7 +18,6 @@ package com.logpm.basicdata.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.nacos.common.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -44,7 +43,6 @@ import com.logpm.warehouse.vo.WarehouseTraybarCode;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.CodeNumConstant;
import org.springblade.common.constant.DictBizConstant;
import org.springblade.common.utils.QRCodeUtil;
import org.springblade.common.utils.TemplateUtil;
import org.springblade.core.log.exception.ServiceException;
@ -53,15 +51,10 @@ import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sun.misc.BASE64Encoder;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@ -233,9 +226,9 @@ public class BasicdataTrayServiceImpl extends BaseServiceImpl<BasicdataTrayMappe
WarehouseTrayQRCode trayQRCode = baseMapper.getTray(id);
Map<String, Object> map = JSONObject.parseObject(JSONObject.toJSONString(trayQRCode), Map.class);
String filename = QRCodeUtil.createCodeToFile(trayQRCode.getTrayCode());
map.put("qrCode", getEmpAutograph(filename));
map.put("qrCode", QRCodeUtil.getEmpAutograph(filename));
String fileTypeName = QRCodeUtil.createCodeToFileType(trayQRCode.getTrayCode());
map.put("imgType", getEmpAutograph(fileTypeName));
map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName));
map.put("tenant","汇通物流");
data.add(map);
}
@ -243,29 +236,7 @@ public class BasicdataTrayServiceImpl extends BaseServiceImpl<BasicdataTrayMappe
return warehouseTraybarCode;
}
private String getEmpAutograph(String filePath) {
String img = null;
if (StringUtils.isNotEmpty(filePath)) {
InputStream in = null;
byte[] picdata = null;
try {
in = new FileInputStream(filePath);
picdata = new byte[in.available()];
in.read(picdata);
BASE64Encoder encoder = new BASE64Encoder();
img = encoder.encode(picdata);
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
return "data:image/png;base64," + img;
}
@Override

20
blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessAsyncServiceImpl.java

@ -16,6 +16,7 @@ import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.ListIterator;
import java.util.stream.Collectors;
@Log4j2
@ -31,8 +32,8 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
@Override
public void saveOtherDataBaseNew(String tenantId, List<BusinessPreOrderEntity> dataResult, String mallName) {
List<Long> orderIdList = dataResult.stream()
.map(BusinessPreOrderEntity::getStockArticleId)
List<String> orderCodeList = dataResult.stream()
.map(BusinessPreOrderEntity::getOrderCode)
.collect(Collectors.toList());
R<Tenant> tenantByName = sysClient.getTenantByName(mallName);
if (tenantByName.isSuccess()) {
@ -47,7 +48,7 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
LambdaQueryWrapper<BusinessPreOrderEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(BusinessPreOrderEntity::getInWarehouse, 0);
lambdaQueryWrapper.in(BusinessPreOrderEntity::getStockArticleId, orderIdList);
lambdaQueryWrapper.in(BusinessPreOrderEntity::getOrderCode, orderCodeList);
List<BusinessPreOrderEntity> list = businessPreOrderService.list(lambdaQueryWrapper);
@ -55,19 +56,24 @@ public class BusinessAsyncServiceImpl implements IBusinessAsyncService {
List<Long> temsp = new ArrayList<>();
for (BusinessPreOrderEntity distributionBusinessPreOrderEntity : list) {
for (BusinessPreOrderEntity businessPreOrderEntity : dataResult) {
businessPreOrderEntity.setTenantId(tenant.getTenantId());
for (int i = 0; i < dataResult.size(); i++) {
BusinessPreOrderEntity businessPreOrderEntity = dataResult.get(i);
businessPreOrderEntity.setTenantId(tenant.getTenantId());
if (businessPreOrderEntity.getStockArticleId().equals(distributionBusinessPreOrderEntity.getStockArticleId())) {
// 找到订单
if (businessPreOrderEntity.getOrderPackageCode().equals(distributionBusinessPreOrderEntity.getOrderPackageCode())) {
//找到包件 并标记为删除状态
if (distributionBusinessPreOrderEntity.getInWarehouse().equals(1)) {
// 需要删除集合中的数据
dataResult.remove(i);
} else {
temsp.add(distributionBusinessPreOrderEntity.getId());
}
}
}
}
}
if (!temsp.isEmpty()) {
// 更新删除状态

1
blade-service/logpm-business/src/main/java/com/logpm/business/service/impl/BusinessPreOrderServiceImpl.java

@ -590,6 +590,7 @@ public class BusinessPreOrderServiceImpl extends BaseServiceImpl<BusinessPreOrde
data.setSecond(entityByOrderPackageCode.getSecondPackName());
data.setThirdProduct(entityByOrderPackageCode.getThirdPackName());
data.setBrandName(entityByOrderPackageCode.getBrand());
data.setOrderCode(entityByOrderPackageCode.getOrderCode());
data.setConditions(1);
data.setInWarehouse(0);
data.setDriverName(driverName);

Loading…
Cancel
Save