diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java index 82727202c..2c55d68c6 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/DictBizConstant.java @@ -12,6 +12,7 @@ public class DictBizConstant { public static final String DEFAULT_DEPT_ID = "default_dept_id";//默认部门ID public static final String DELIVERY_ORDER_STATUS = "delivery_order_status";//配送订单状态 + public static final String PDA_AUDIO = "pda_audio";//PDA扫码语音 } diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java index d4d3b3676..301dcc0d5 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java @@ -8,7 +8,7 @@ public interface ModuleNameConstant { /** * 如果不需要 "" */ - public static final String DEVAUTH ="-zhy"; + public static final String DEVAUTH =""; /** * 工厂对接服务名称 diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java index fac47d3c0..6197859e7 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/entity/DistributionParcelListEntity.java @@ -118,7 +118,8 @@ public class DistributionParcelListEntity extends TenantEntity { * 物料Id */ @ApiModelProperty(value = "物料ID") - private Long material; + private Long materialId; + /** * 物料名称 */ diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingAppVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingAppVO.java index 9bcb697f5..1d8122142 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingAppVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistrilbutionBillLadingAppVO.java @@ -36,6 +36,8 @@ import java.util.List; public class DistrilbutionBillLadingAppVO extends DistrilbutionBillLadingEntity { private static final long serialVersionUID = 1L; + private Long billLadingId; + private String stockArticleId; private Integer carType; diff --git a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionAppBillLadingDetailVO.java b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionAppBillLadingDetailVO.java index 75c004b47..88a17dce5 100644 --- a/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionAppBillLadingDetailVO.java +++ b/blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistrilbutionAppBillLadingDetailVO.java @@ -36,6 +36,8 @@ public class DistrilbutionAppBillLadingDetailVO implements Serializable { private String packetBarCode; private Integer scanStatus;//扫码状态 + private String scanStatusStr;//扫码状态 private Integer errorStatus;//异常状态 + private String errorStatusStr;//异常状态 } diff --git a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/vo/DistributionParcelListEntityVO.java b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/vo/DistributionParcelListEntityVO.java index e8d68664b..8561813f6 100644 --- a/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/vo/DistributionParcelListEntityVO.java +++ b/blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/vo/DistributionParcelListEntityVO.java @@ -54,7 +54,7 @@ public class DistributionParcelListEntityVO { * 物料 */ @ApiModelProperty(value = "物料") - private String material; + private String materialName; /** * 数量 */ diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java index ad65612e1..2e80ea922 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataCodeServiceImpl.java @@ -46,8 +46,9 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService { // break; // case CodeNumConstant.TRAYS: // break; -// case CodeNumConstant.PACKAGE: -// break; + case CodeNumConstant.PACKAGE: + code = generatePackageCode(type,warehouseCode); + break; // case CodeNumConstant.SHELF: // break; case CodeNumConstant.PSKH: @@ -59,6 +60,7 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService { return code; } + private String generateDeliveryCustomOrder(Integer type, String warehouseCode) { //查询租户编码 String des = CodeDesEnum.getMes(type);//摘要 @@ -102,4 +104,25 @@ public class BasicdataCodeServiceImpl implements IBasicdataCodeService { return warehouseCode + des + dateShort + CommonUtil.geFourNumber(incr); } + + + private String generatePackageCode(Integer type,String warehouseCode) { + String des = CodeDesEnum.getMes(type);//摘要 + String tenantId = AuthUtil.getTenantId();//租户号 +// String tenantId = "627683";//租户号 + + //获得年月日短字符串 + String dateShort = CommonUtil.dateToStringShort(new Date()); + + //redis的key + String key = tenantId + ":" + warehouseCode + ":" + des+":"+dateShort; + //获得序号 + Long incr = bladeRedis.incr(key); + if(1 == incr){ + //如果为1就是刚刚才建立,给他一个过期时间 + bladeRedis.expireAt(key,CommonUtil.getDayEnd()); + } + + return warehouseCode + des + dateShort + CommonUtil.geFourNumber(incr); + } } diff --git a/blade-service/logpm-distribution/pom.xml b/blade-service/logpm-distribution/pom.xml index 11a822f98..f31506a3f 100644 --- a/blade-service/logpm-distribution/pom.xml +++ b/blade-service/logpm-distribution/pom.xml @@ -67,6 +67,12 @@ blade-core-test test + + org.springblade + logpm-basicdata-api + 3.1.0.RELEASE + compile + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java index 05a9c2d14..18bae8bb8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionBillLadingAppController.java @@ -69,7 +69,8 @@ public class DistributionBillLadingAppController extends BladeController { public R orderList(@RequestBody BillLadingAppDTO billLadingAppDTO) { Integer orderStatus = billLadingAppDTO.getOrderStatus();//订单状态 Long billLadingId = billLadingAppDTO.getBillLadingId();//自提单id - DistrilbutionAppBillLadingOrderMainVO vo = distrilbutionBillLadingService.selectOrderList(billLadingId,orderStatus); + String orderSelfNumbering = billLadingAppDTO.getOrderSelfNumbering();//自提单id + DistrilbutionAppBillLadingOrderMainVO vo = distrilbutionBillLadingService.selectOrderList(billLadingId,orderStatus,orderSelfNumbering); return R.data(vo); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java index cf5778935..f62ada299 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java @@ -18,6 +18,7 @@ package com.logpm.distribution.appcontroller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.distribution.bean.Resp; import com.logpm.distribution.dto.app.StockupDTO; import com.logpm.distribution.entity.DistributionReservationEntity; import com.logpm.distribution.entity.DistributionStockEntity; @@ -29,11 +30,13 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.AllArgsConstructor; import lombok.extern.log4j.Log4j2; +import org.springblade.common.constant.DictBizConstant; import org.springblade.common.constant.RabbitConstant; import org.springblade.common.utils.CommonUtil; import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.StringUtil; +import org.springblade.system.cache.DictBizCache; import org.springframework.amqp.rabbit.core.RabbitTemplate; import org.springframework.web.bind.annotation.*; @@ -177,6 +180,34 @@ public class DistributionStockupAppController extends BladeController { } } + @ResponseBody + @PostMapping("/stockupStockListPackageCode") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "备货库存品生成包件码", notes = "传入stockupDTO") + public R stockupStockListPackageCode(@RequestBody StockupDTO stockupDTO) { + Long reservationId = stockupDTO.getReservationId();//预约单id + Long stockListId = stockupDTO.getStockListId();//库存品id + Integer packageNum = stockupDTO.getPackageNum();//包条数量 + //查询客户订单详情 + if(Objects.isNull(reservationId)){ + log.warn("##############stockupStockListPackageCode: 预约单id为空 reservationId={}",reservationId); + return R.fail("预约单id不能为空"); + } + if(Objects.isNull(stockListId)){ + log.warn("##############stockupStockListPackageCode: 库存品id为空 stockListId={}",stockListId); + return R.fail("库存品id不能为空"); + } + if(Objects.isNull(packageNum)){ + log.warn("##############stockupStockListPackageCode: 包条数量为空 packageNum={}",packageNum); + return R.fail("包条数量不能为空"); + } + + List list = distributionStockupService.createPackageCode(reservationId,stockListId,packageNum); + + return R.data(list); + } + + @ResponseBody @PostMapping("/stockupScan") @ApiOperationSupport(order = 1) @@ -225,7 +256,9 @@ public class DistributionStockupAppController extends BladeController { //将消息携带绑定键值 rabbitTemplate.convertAndSend(RabbitConstant.STOCKUP_SCAN_EXCHANGE, RabbitConstant.STOCKUP_SCAN_ROUTING, map); - return R.success("扫码成功"); + String audioValue = DictBizCache.getValue(DictBizConstant.PDA_AUDIO, "1"); + + return Resp.scanSuccess("success",audioValue); }else if(scanType == 2){ //库存品扫描 Long reservationId = stockupDTO.getReservationId(); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/bean/Resp.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/bean/Resp.java new file mode 100644 index 000000000..67c857c32 --- /dev/null +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/bean/Resp.java @@ -0,0 +1,19 @@ +package com.logpm.distribution.bean; + +import lombok.Data; +import org.springblade.core.tool.api.R; + +@Data +public class Resp extends R { + + private String audio; + + public static Resp scanSuccess(String msg,String audio){ + Resp resp = new Resp(); + resp.setCode(200); + resp.setMsg(msg); + resp.setAudio(audio); + return resp; + } + +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/BillLadingAppDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/BillLadingAppDTO.java index 3723fc4e4..565bdbbec 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/BillLadingAppDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/BillLadingAppDTO.java @@ -10,7 +10,8 @@ public class BillLadingAppDTO implements Serializable { private Integer current; private Integer size; - private String pickUpTime;//提货时间 + private String pickUpTimeStart;//提货时间开始 + private String pickUpTimeEnd;//提货时间结束 private Integer orderStatus;//订单状态 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java index a45f732c3..c5a00d343 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java @@ -8,7 +8,8 @@ import java.io.Serializable; @Data public class StockupDTO implements Serializable { - private String stockupDate;//备货日期 + private String stockupDateStart;//备货日期 + private String stockupDateEnd;//备货日期 private Integer status;//0未完成 1已完成 @@ -43,4 +44,6 @@ public class StockupDTO implements Serializable { private String packetBarCode;//包件码 private String stockupArea;//备货区 private Long stockListId;//库存品id + private Integer packageNum;//包条数量 + } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java index ac31c6947..9065d1ffa 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java @@ -77,4 +77,7 @@ public interface DistributionReservationMapper extends BaseMapper + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml index a55019e46..71cebd81c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml @@ -75,7 +75,8 @@ left join logpm_distribution_stockup_info ldsi on ldsi.reservation_id = ldr.id left join logpm_distribution_stockup lds on ldsi.stockup_id = lds.id - and DATE_FORMAT(lds.stockup_date,'%Y-%m-%d') = #{param.stockupDate} + and lds.stockup_date <= #{param.stockupDateStart} + and lds.stockup_date >= #{param.stockupDateEnd} and lds.stockup_status in (1,2,3) and lds.stockup_status = 4 and lds.is_deleted = 0 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index 9e4c3ae68..029d9c538 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -64,59 +64,58 @@