Browse Source

增加市配的打印内容

未完成 备货区和货区的查询
training
pref_mail@163.com 1 year ago
parent
commit
449dd686b7
  1. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java
  2. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  3. 71
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  4. 57
      blade-service/logpm-distribution/src/test/com/logpm/distribution/MyTest.java
  5. 15
      blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java

3
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionReservationEntity.java

@ -170,6 +170,9 @@ public class DistributionReservationEntity extends TenantEntity {
@ApiModelProperty(value = "商场名称")
private String mallName;
@ApiModelProperty(value = "商场电话")
private String mailPhone;
/**
* 门店名称
*/

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml

@ -20,7 +20,7 @@
<result column="stock_article_id" property="stockArticleId"/>
<result column="consignee" property="consignee"/>
<result column="delivery_address" property="deliveryAddress"/>
<result column="reservation_data" property="reservationDate"/>
<result column="reservation_date" property="reservationDate"/>
<result column="serve_type" property="serveType"/>
<result column="delivery_type" property="deliveryType"/>
<result column="delivery_way" property="deliveryWay"/>

71
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java

@ -3215,24 +3215,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
handleShangPeiData(1111L, split,"111");
}
private List<PrintPreviewVO> handleShangPeiData(Long templateId, String[] idArray,String html) throws Exception {
List<PrintPreviewVO> result = new ArrayList<>();
for (String id : idArray) {
//查询对应配送单
DistributionDeliveryListEntity deliveryListEntity = baseMapper.selectById(id);//配送单
if(Objects.isNull(deliveryListEntity)){
log.warn("#########handleShangPeiData: 配送单信息不存在 deliveryListEntityId={}",id);
throw new CustomerException(403,"配送单信息不存在");
}
Long deliveryListEntityId = deliveryListEntity.getId();
String taskTime = deliveryListEntity.getTaskTime();//配送时间
String kind = deliveryListEntity.getKind();
String dirverName = "";
String dirverPhone = "";
String carNumber = "";
if("1".equals(kind)){
public Map<String, String> getDriverCar(String kind, Long deliveryListEntityId) {
Map<String, String> map = new HashMap<>();
String dirverName = null;
String dirverPhone = null;
String carNumber = null;
if ("1".equals(kind)) {
QueryWrapper<DistributionDeliverySelfEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("delivery_id",deliveryListEntityId);
DistributionDeliverySelfEntity deliverySelfEntity = distributionDeliverySelfService.getOne(queryWrapper);
@ -3247,6 +3235,31 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
dirverPhone = deliveryTripartiteEntity.getDriverPhone();
carNumber = deliveryTripartiteEntity.getVehicleNum();
}
map.put("dirverName", dirverName);
map.put("dirverPhone", dirverPhone);
map.put("carNumber", carNumber);
return map;
}
private List<PrintPreviewVO> handleShangPeiData(Long templateId, String[] idArray, String html) throws Exception {
List<PrintPreviewVO> result = new ArrayList<>();
for (String id : idArray) {
//查询对应配送单
DistributionDeliveryListEntity deliveryListEntity = baseMapper.selectById(id);//配送单
if (Objects.isNull(deliveryListEntity)) {
log.warn("#########handleShangPeiData: 配送单信息不存在 deliveryListEntityId={}", id);
throw new CustomerException(403, "配送单信息不存在");
}
Long deliveryListEntityId = deliveryListEntity.getId();
String taskTime = deliveryListEntity.getTaskTime();//配送时间
String kind = deliveryListEntity.getKind();
Map<String, String> driverCar = getDriverCar(kind, deliveryListEntityId);
String dirverName = driverCar.get("dirverName");
String dirverPhone = driverCar.get("dirverPhone");
String carNumber = driverCar.get("carNumber");
List<DistributionReservationEntity> distributionReservationEntityList = distributionReservationMapper.findByDeliveryId(deliveryListEntityId);
//循环查询出来的预约单
@ -3364,6 +3377,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
/**
* 得到填充内容
*
* @param template
* @param idArray
* @param html
@ -3413,11 +3427,28 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
List<Map<String, Object>> spaclOrderList = buildSpaclOrders(distributionReservationEntity, 1);
map.put("定制品集合", spaclOrderList);
map.put("定制品合计", spaclOrderList.stream().mapToInt(map1 -> Integer.parseInt(map1.get("数量").toString())).sum());
map.put("备注", distributionReservationEntity.getRemarks());
map.put("送货司机", byId.getVehicleName() + "/" + byId.getDriverName());
map.put("承运商", byId.getDistributionCompany());
map.put("配送仓库", byId.getWarehouseName());
// TODO 查询配送单的时间
map.put("出库时间", byId.getTaskTime());
data.add(map);
String popHtml =TemplateUtil.popTemplate("市配配送单",map,html);
Map<String, String> driverCar = getDriverCar(byId.getKind(), byId.getId());
String dirverName = driverCar.get("dirverName");
String dirverPhone = driverCar.get("dirverPhone");
String carNumber = driverCar.get("carNumber");
map.put("送货司机", dirverName + "/" + dirverPhone);
map.put("车牌号", carNumber);
String popHtml = TemplateUtil.popTemplate("市配配送单", map, html);
PrintPreviewVO printPreviewVO = new PrintPreviewVO();
printPreviewVO.setTemplateId(template.getId());
printPreviewVO.setTemplateHtml(popHtml);

57
blade-service/logpm-distribution/src/test/com/logpm/distribution/MyTest.java

@ -1,57 +0,0 @@
package com.logpm.distribution;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.distribution.dto.app.StockupDTO;
import com.logpm.distribution.entity.DistributionBillLadingScanEntity;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.OrderPackgeCodeDataVO;
import org.checkerframework.checker.units.qual.A;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springblade.core.test.BladeBootTest;
import org.springblade.core.test.BladeSpringExtension;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static org.springblade.common.constant.ModuleNameConstant.APPLICATION_DISTRIBUTION_NAME;
@ExtendWith(BladeSpringExtension.class)
@BladeBootTest(appName = APPLICATION_DISTRIBUTION_NAME, enableLoader = true)
public class MyTest {
@Autowired
private IDistributionStockupService distributionStockupService;
@Autowired
private IDistributionReservationService distributionReservationService;
@Autowired
private IDistributionParcelListService distributionParcelListService;
@Autowired
private IDistributionStockListService distributionStockListService;
@Autowired
private IDistributionStockArticleService distributionStockArticleService;
@Test
public void te(){
// Map<String, Object> params = new HashMap<>();
// params.put("ids","1686560469635727362");
// try {
// OrderPackgeCodeDataVO orderPackgeCodeDataVO =distributionStockArticleService.showOrderPackgeCode(params);
// System.out.println(orderPackgeCodeDataVO);
// } catch (Exception e) {
// e.printStackTrace();
// }
List<PrintPreviewVO> printPreviewVOS = distributionDeliveryListService.printBatch(ids,type);
}
}

15
blade-service/logpm-distribution/src/test/java/com/logpm/distribution/TestService.java

@ -1,14 +1,17 @@
package com.logpm.distribution;
import com.logpm.distribution.service.IDistributionDeliveryListService;
import com.logpm.distribution.vo.print.PrintPreviewVO;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springblade.core.test.BladeBootTest;
import org.springblade.core.test.BladeSpringExtension;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
@ExtendWith(BladeSpringExtension.class)
@BladeBootTest(appName = "logpm-distribution", enableLoader = true)
@BladeBootTest(appName = "logpm-distribution-pref", enableLoader = true)
public class TestService {
@Autowired
@ -26,5 +29,15 @@ public class TestService {
}
@Test
public void test3() throws Exception {
List<PrintPreviewVO> ls = distributionDeliveryListService.printBatch("1704390271891935233",2);
System.out.println(ls);
}
}

Loading…
Cancel
Save