Browse Source

1.拆单-新增备注存入

2.订单-订单码生成打印
pull/5/head
zhenghaoyu 10 months ago
parent
commit
e870a8d88d
  1. 1
      blade-biz-common/src/main/java/org/springblade/common/constant/printTemplate/PrintTemplateStatusConstant.java
  2. 3
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionStockArticleEntity.java
  3. 23
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/OrderCodeDataVO.java
  4. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java
  5. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.java
  6. 19
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml
  7. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java
  8. 61
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java
  9. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

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

@ -21,6 +21,7 @@ public enum PrintTemplateStatusConstant {
daiqueren_11("库存品包件模板","11"),
daiqueren_12("配送任务打印模板-商配","12"),
peisongtask_ziti("配送任务打印模板-自提","13"),
daiqueren_14("订单模版","15"),
daiqueren_1("配送任务打印模板-市配","1");
/**
* 状态

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

@ -450,6 +450,9 @@ public class DistributionStockArticleEntity extends TenantEntity {
@ApiModelProperty(value = "配载件数")
private Integer carsLoadNum;
@ApiModelProperty(value = "备注")
private String remark;
/**
/* * 未入库数量
*//*

23
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/OrderCodeDataVO.java

@ -0,0 +1,23 @@
package com.logpm.distribution.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Map;
/**
* 返回订单码页面 内容
*/
@Data
public class OrderCodeDataVO {
@ApiModelProperty(value = "模板ID")
private Long templateId;
@ApiModelProperty(value = "模板内容")
private String templateHtml;
@ApiModelProperty(value = "模板填充内容")
private List<Map<String,Object>> dataList;
}

19
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockArticleController.java

@ -26,10 +26,7 @@ import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.excel.DistributionStockArticleExcel;
import com.logpm.distribution.excel.DistributionStockArticleImporter;
import com.logpm.distribution.service.IDistributionStockArticleService;
import com.logpm.distribution.vo.DistributionParcelListVO;
import com.logpm.distribution.vo.DistributionParcelNumberVO;
import com.logpm.distribution.vo.DistributionStockArticleVO;
import com.logpm.distribution.vo.OrderPackgeCodeDataVO;
import com.logpm.distribution.vo.*;
import com.logpm.distribution.wrapper.DistributionStockArticleWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -485,6 +482,20 @@ public class DistributionStockArticleController extends BladeController {
@GetMapping("/showOrderCode")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "展示订单码")
public R showOrderCode(@ApiIgnore @RequestParam Map<String,Object> params){
OrderCodeDataVO orderCodeDataVO= null;
try {
orderCodeDataVO = distributionStockArticleService.showOrderCode(params);
} catch (Exception e) {
return R.fail(e.getMessage());
}
return R.data(orderCodeDataVO);
}
}

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

@ -181,4 +181,6 @@ public interface DistributionStockArticleMapper extends BaseMapper<DistributionS
List<DistributionStockArticleEntity> findListByOrderCodeLike(@Param("orderCode") String orderCode);
void submitHandleNumAndTotalNumberByOrderId(@Param("subNum") Integer subNum, @Param("articleId") Long articleId);
JSONObject findShowOrderCodeData(@Param("orderId") Long orderId);
}

19
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml

@ -522,6 +522,9 @@
<if test=" param.customerName != null and param.customerName != '' ">and ldsa.customer_name like
concat('%',#{param.customerName},'%')
</if>
<if test="param.isZero != null and param.isZero != '' ">
and ldsa.is_zero = #{param.isZero}
</if>
<if test=" param.customerTelephone != null and param.customerTelephone != '' ">and
ldsa.customer_telephone like concat('%',#{param.customerTelephone},'%')
</if>
@ -1081,4 +1084,20 @@
where id = #{articleId}
</update>
<select id="findShowOrderCodeData" resultType="com.alibaba.fastjson.JSONObject">
select ldsa.order_code orderCode,
ldsa.consignee_unit consigneeUnit,
ldsa.consignee_person consigneePerson,
ldsa.consignee_mobile consigneeMobile,
ldsa.waybill_number waybillNo,
ldsa.total_number totalNumber,
ldsa.description_goods descriptionGoods,
ldsa.customer_name customerName,
ldsa.customer_telephone customerTelephone,
ldsa.customer_address customerAddress,
IFNULL(ldsa.remark,'') remark
from logpm_distribution_stock_article ldsa
where ldsa.id = #{orderId}
</select>
</mapper>

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockArticleService.java

@ -240,4 +240,5 @@ public interface IDistributionStockArticleService extends BaseService<Distributi
*/
Boolean maintenanceOrderInfoByWarehouseId(String warehouseId);
OrderCodeDataVO showOrderCode(Map<String, Object> params) throws Exception;
}

61
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockArticleServiceImpl.java

@ -19,7 +19,6 @@ package com.logpm.distribution.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
@ -88,7 +87,6 @@ import java.io.IOException;
import java.util.*;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -1828,6 +1826,65 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl<Distrib
return true;
}
@Override
public OrderCodeDataVO showOrderCode(Map<String, Object> params) throws Exception {
OrderCodeDataVO orderCodeDataVO = new OrderCodeDataVO();
List<Map<String,Object>> data = new ArrayList<>();
BasicPrintTemplateEntity template = basicPrintTemplateClient.getPrintTemplate(PrintTemplateStatusConstant.daiqueren_14.getValue());
if (ObjectUtil.isEmpty(template)) {
throw new ServiceException("模板内容未找到");
}
String html = TemplateUtil.getTemplateByUrl(template.getTemplateUrl());
orderCodeDataVO.setTemplateHtml(html);
orderCodeDataVO.setTemplateId(template.getId());
String ids = (String) params.get("ids");
String[] idArray = ids.split(",");
if (ObjectUtils.isNull(idArray)) {
throw new ServiceException("参数错误");
}
for (String orderId : idArray) {
JSONObject jsonObject = baseMapper.findShowOrderCodeData(Long.parseLong(orderId));
String orderCode = jsonObject.getString("orderCode");
String waybillNo = jsonObject.getString("waybillNo");
String descriptionGoods = jsonObject.getString("descriptionGoods");
Integer totalNumber = jsonObject.getInteger("totalNumber");
Map<String, Object> map = jsonObject.getInnerMap();
map.put("id", orderId);
String filename = QRCodeUtil.createCodeToFile(orderCode);
map.put("orderCodeImage", QRCodeUtil.getEmpAutograph(filename));
// 订单号 生成二维码
String fileTypeName = QRCodeUtil.createCodeToFile(orderCode);
map.put("imgType", QRCodeUtil.getEmpAutograph(fileTypeName));
if(orderCode.equals(waybillNo)){
map.put("product",descriptionGoods+"("+totalNumber+")");
}else{
QueryWrapper<DistributionParcelListEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("stock_article_id",Long.parseLong(orderId));
List<DistributionParcelListEntity> list = distributionParcelListService.list(queryWrapper);
StringBuilder product = new StringBuilder();
for (DistributionParcelListEntity parcelListEntity : list) {
String firsts = parcelListEntity.getFirsts();
Integer quantity = parcelListEntity.getQuantity();
if(StringUtils.isBlank(product)){
product.append(firsts).append("(").append(quantity).append(")");
}else{
product.append(",").append(firsts).append("(").append(quantity).append(")");
}
}
map.put("product",product.toString());
}
data.add(map);
}
orderCodeDataVO.setDataList(data);
return orderCodeDataVO;
}
@Override
public DistributionStockArticleEntity findZeroByOrderCodeAndWarehouseId(String orderCode, Long warehouseId) {

1
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java

@ -430,6 +430,7 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl<WarehouseWaybil
entity.setCustomerName(splitOrderDTO.getCustomerPerson());
entity.setCustomerTelephone(splitOrderDTO.getCustomerMobile());
entity.setCustomerAddress(splitOrderDTO.getCustomerAddress());
entity.setRemark(splitOrderDTO.getRemark());
List<ProductDTO> products = splitOrderDTO.getProducts();
StringBuffer stringBuffer = new StringBuffer();
Integer allNum = 0;

Loading…
Cancel
Save