Browse Source

1.新增零担运单标签打印信息查询

dev
zhenghaoyu 1 month ago
parent
commit
9efab16a98
  1. 1
      blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java
  2. 27
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java
  3. 3
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java
  4. 63
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

1
blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java

@ -24,6 +24,7 @@ public enum PrintTemplateStatusConstant {
daiqueren_14("订单模版","15"),
wallbill_1("运单打印模板","16"),
stock_import_1("库存品入库模块","17"),
zero_label_18("零担标签模版","18"),
daiqueren_1("配送任务打印模板-市配","1");
/**

27
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/OpenOrderController.java

@ -1966,4 +1966,31 @@ public class OpenOrderController {
}
@ResponseBody
@PostMapping("/findZeroWaybillLabelInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询零担运单标签信息", notes = "传入openOrderDTO")
public R findZeroWaybillLabelInfo(@RequestBody OpenOrderDTO openOrderDTO) {
String method = "############findZeroWaybillLabelInfo: ";
log.info(method + "请求参数{}", openOrderDTO);
String waybillNo = openOrderDTO.getWaybillNo();
try {
if (StringUtil.isBlank(waybillNo)) {
log.warn(method + "运单号不能为空 waybillNo={}", waybillNo);
return R.fail(405, "运单号不能为空");
}
return openOrderService.findZeroWaybillLabelInfo(openOrderDTO);
} catch (CustomerException e) {
log.error(e.message, e);
return R.fail(e.code, e.message);
} catch (Exception e) {
log.error(method + "系统异常", e);
return R.fail(500, "系统异常");
}
}
}

3
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IOpenOrderService.java

@ -113,5 +113,8 @@ public interface IOpenOrderService {
void patchCheckWaybill(String waybillNo);
R findZeroWaybillLabelInfo(OpenOrderDTO openOrderDTO) throws Exception;
// R findWaybillInfo(String waybillNo);
}

63
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -12,7 +12,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.logpm.basic.entity.BasicMaterialEntity;
import com.logpm.basic.entity.BasicPrintTemplateEntity;
import com.logpm.basic.feign.IBasicMaterialClient;
import com.logpm.basic.feign.IBasicPrintTemplateClient;
import com.logpm.basicdata.entity.*;
import com.logpm.basicdata.feign.*;
import com.logpm.basicdata.vo.BasicdataClientVO;
@ -54,6 +56,7 @@ import org.springblade.common.constant.IncomingTypeEnum;
import org.springblade.common.constant.WorkNodeEnums;
import org.springblade.common.constant.broadcast.FanoutConstants;
import org.springblade.common.constant.order.*;
import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant;
import org.springblade.common.enums.BizOperationEnums;
import org.springblade.common.enums.PackageTypeEnums;
import org.springblade.common.exception.CustomerException;
@ -61,6 +64,8 @@ import org.springblade.common.model.FanoutMsg;
import org.springblade.common.model.NodeFanoutMsg;
import org.springblade.common.model.PackageData;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.QRCodeUtil;
import org.springblade.common.utils.TemplateUtil;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
@ -128,6 +133,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
private final IWarehouseWaybillAbolishClient waybillAbolishClient;
private final IWarehouseWaybillDetailAbolishClient waybillDetailAbolishClient;
private final IPackageTrackLogAsyncService packageTrackLogAsyncService;
private final IBasicPrintTemplateClient basicPrintTemplateClient;
@Override
@ -228,6 +234,63 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
}
@Override
public R findZeroWaybillLabelInfo(OpenOrderDTO openOrderDTO) throws Exception {
String waybillNo = openOrderDTO.getWaybillNo();
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillNo(waybillNo);
if(Objects.isNull(waybillEntity)){
log.warn("################findZeroWaybillLabelInfo: 运单信息不存在 waybillNo={}",waybillNo);
return R.fail(405,"运单信息不存在");
}
List<WarehouseWayBillDetail> wayBillDetailList = warehouseWaybillDetailClient.findListByWaybillNo(waybillNo);
BasicPrintTemplateEntity template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.zero_label_18 .getValue());
if (org.springblade.core.tool.utils.ObjectUtil.isEmpty(template)) {
log.warn("################findZeroWaybillLabelInfo: 未找到模版 waybillNo={}",waybillNo);
return R.fail(405,"未找到模版");
}
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());
Map<String,Object> map = new HashMap<>();
map.put("waybillNo",waybillNo);
map.put("orderNo",waybillEntity.getOrderNo());
map.put("departureWarehouseName",waybillEntity.getDepartureWarehouseName());
map.put("destinationWarehouseName",waybillEntity.getDestinationWarehouseName());
map.put("destination",waybillEntity.getDestination());
map.put("departure",waybillEntity.getDeparture());
map.put("totalCount",waybillEntity.getTotalCount());
map.put("totalWeight",waybillEntity.getTotalWeight());
map.put("total_volume",waybillEntity.getTotalVolume());
map.put("shipper",waybillEntity.getShipper());
map.put("shipperName",waybillEntity.getShipperName());
map.put("shipperMobile",waybillEntity.getShipperName());
map.put("shipperAddress",waybillEntity.getShipperAddress());
map.put("consignee",waybillEntity.getConsignee());
map.put("consigneeName",waybillEntity.getConsigneeName());
map.put("consigneeMobile",waybillEntity.getConsigneeMobile());
map.put("consigneeAddress",waybillEntity.getConsigneeAddress());
String fileTypeName = QRCodeUtil.createCodeToFile(waybillNo);
String image = QRCodeUtil.getEmpAutograph(fileTypeName);
map.put("waybillNoCode",image);
map.put("delivery_way",DictBizCache.getValue(DictBizConstant.OPEN_ORDER_DELIVERY_WAY,waybillEntity.getDeliveryWay()));
map.put("waybillNoCode",image);
List<Map<String,Object>> detailList = new ArrayList<>();
wayBillDetailList.forEach(item->{
Map<String,Object> m = new HashMap<>();
m.put("productName",item.getProductName());
m.put("num",item.getNum());
detailList.add(m);
});
map.put("detailList",detailList);
map.put("template",html);
return R.data(map);
}
@Override
public List<TrunklineAdvanceDetailVO> findAdvanceDetailList(Long advanceId) {
return advanceDetailService.findList(advanceId);

Loading…
Cancel
Save