Browse Source

Merge branch 'pre-production' of http://47.108.105.48:3000/java_project/logisticsplatform-service into pre-production

newStockUp
pref_mail@163.com 1 year ago
parent
commit
98dbff7b04
  1. 4
      blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java
  2. 6
      blade-biz-common/src/main/java/org/springblade/common/constant/RedisKeyConstant.java
  3. 20
      blade-biz-common/src/main/java/org/springblade/common/utils/FileUtil.java
  4. 4
      blade-biz-common/src/main/java/org/springblade/common/utils/QRCodeUtil.java
  5. 17
      blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesExchangeEntity.java
  6. 2
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java
  7. 5
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockListVO.java
  8. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockArticleVO.java
  9. 2
      blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/LocationEntity.java
  10. 33
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailEntity.java
  11. 11
      blade-service/logpm-aftersales/pom.xml
  12. 12
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/AftersalesApplication.java
  13. 38
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/config/WebSocketConfig.java
  14. 21
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  15. 78
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/launcher/OpcSessionHandler.java
  16. 20
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/resp/NoticeWebsocketResp.java
  17. 10
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java
  18. 105
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/WebSocketServer.java
  19. 12
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesExchangeServiceImpl.java
  20. 13
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  21. 443
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java
  22. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java
  23. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java
  24. 4
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  25. 10
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java
  26. 115
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml
  27. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml
  28. 7
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java
  29. 5
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml
  30. 8
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java
  31. 3
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java
  32. 53
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java
  33. 25
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java
  34. 57
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java
  35. 37
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java
  36. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionDisStockListWrapper.java
  37. 34
      blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java
  38. 62
      blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java
  39. 2
      blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/LocationMapper.xml
  40. 7
      blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncWarehouseData.java
  41. 10
      blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java
  42. 23
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java
  43. 5
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/QuestDetailDTO.java
  44. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java
  45. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java
  46. 45
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml
  47. 6
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java
  48. 285
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java
  49. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsLogServiceImpl.java
  50. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java
  51. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsLogServiceImpl.java
  52. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java
  53. 19
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

4
blade-biz-common/src/main/java/org/springblade/common/constant/ModuleNameConstant.java

@ -46,6 +46,10 @@ public interface ModuleNameConstant {
* 仓库服务名称
*/
String APPLICATION_WAREHOUSE_NAME = "logpm-warehouse"+DEVAUTH;
/**
* 仓库服务名称
*/
String APPLICATION_WEBSTOCKET_NAME = "logpm-webstocket"+DEVAUTH;
/**
* 配送签收服务名称

6
blade-biz-common/src/main/java/org/springblade/common/constant/RedisKeyConstant.java

@ -3,4 +3,10 @@ package org.springblade.common.constant;
public class RedisKeyConstant {
/**
* 欧派入库扫描缓存key
*/
public static final String cache_oupai_key ="cache:oupai-key:";
}

20
blade-biz-common/src/main/java/org/springblade/common/utils/FileUtil.java

@ -30,8 +30,7 @@ public class FileUtil extends TimerTask {
}
public static File checkZipFile(String reservationCode) {
String savePath = "D:/Test" +"/"+ reservationCode;
String savePath = CommonConstant.SYSTEMFILEPATH+"reservationZip/"+ reservationCode;
return new File(savePath+".zip");
}
@ -57,31 +56,30 @@ public class FileUtil extends TimerTask {
*/
public static void handleSignPictureZip(List<String> urls, String type, String code, String consignee) {
//将图片下载至本地中
// String imgPath = CommonConstant.SYSTEMFILEPATH;
String savePath = "D:/Test" +"/"+ code;
String imgPath = savePath;
String savePath = CommonConstant.SYSTEMFILEPATH+"reservationZip/";
String imgPath = savePath+code+"/";
// 打开连接
//设置请求超时为20s
switch (type) {
case "photo_1":
//上门
imgPath += "\\door";
imgPath += "/door";
break;
case "photo_2":
imgPath += "\\stacking";
imgPath += "/stacking";
//堆码
break;
case "photo_3":
imgPath +="\\friability";
imgPath +="/friability";
//易碎
break;
case "photo_4":
imgPath +="\\home-delivery";
imgPath +="/home-delivery";
//家配
break;
case "photo_5":
imgPath +="\\signing";
imgPath +="/signing";
//签收
break;
}
@ -170,7 +168,7 @@ public class FileUtil extends TimerTask {
}
//jdk 1.7 新特性自动关闭
InputStream in = con.getInputStream();
OutputStream out = new FileOutputStream(sf.getPath() + "\\" + str);
OutputStream out = new FileOutputStream(sf.getPath() + "/" + str);
//创建缓冲区
byte[] buff = new byte[1024];
int n;

4
blade-biz-common/src/main/java/org/springblade/common/utils/QRCodeUtil.java

@ -80,7 +80,7 @@ public class QRCodeUtil {
public static String createCodeToFile(String content) {
try {
String imgPath = CommonConstant.SYSTEMFILEPATH;
String imgPath = CommonConstant.SYSTEMFILEPATH+"qrCodeImg/";
File codeImgFileSaveDir = new File(imgPath);
//1. 使用UUID重新生成文件名,防止文件名称重复造成文件覆盖
String fileName = UUID.randomUUID() + "." +FileFormat;
@ -108,7 +108,7 @@ public class QRCodeUtil {
public static String createCodeToFileType(String content) {
try {
//getResource("/")等同于到resource文件夹下
String imgPath = CommonConstant.SYSTEMFILEPATH;
String imgPath = CommonConstant.SYSTEMFILEPATH+"qrCodeImg/";
File codeImgFileSaveDir = new File(imgPath);
//1. 使用UUID重新生成文件名,防止文件名称重复造成文件覆盖
String fileName = UUID.randomUUID() + "." +FileFormat;

17
blade-service-api/logpm-aftersales-api/src/main/java/com/logpm/aftersales/entity/AftersalesExchangeEntity.java

@ -92,4 +92,21 @@ public class AftersalesExchangeEntity extends TenantEntity {
@ApiModelProperty(value = "仓库ID")
private String warehouseId;
@Override
public String toString() {
return "AftersalesExchangeEntity{" +
"reserve1='" + reserve1 + '\'' +
", reserve2='" + reserve2 + '\'' +
", reserve3='" + reserve3 + '\'' +
", reserve4='" + reserve4 + '\'' +
", reserve5='" + reserve5 + '\'' +
", workOrderId='" + workOrderId + '\'' +
", businessName='" + businessName + '\'' +
", businessId='" + businessId + '\'' +
", content='" + content + '\'' +
", annex='" + annex + '\'' +
", warehouseId='" + warehouseId + '\'' +
'}';
}
}

2
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataClientEntity.java

@ -188,4 +188,6 @@ public class BasicdataClientEntity extends TenantEntity {
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date contractEntTime;
@ApiModelProperty(value = "默认付款方式 1现付 2到付 3月结 4回付 5内部结算 ")
private String defaultPaymentMethods;
}

5
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/DistributionStockListVO.java

@ -117,6 +117,11 @@ public class DistributionStockListVO extends DistributionStockListEntity {
*/
@ApiModelProperty(value = "货位信息")
private String positionCode;
/**
* 品牌名称
*/
@ApiModelProperty(value = "品牌名称")
private String brandName;
/**
* 类型
*/

4
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/vo/app/DistributionAppStockArticleVO.java

@ -39,7 +39,7 @@ public class DistributionAppStockArticleVO extends DistributionStockArticleEntit
* 扫描数
*/
@ApiModelProperty(value = "扫描数")
private Integer loadingNub;
private Integer loadingNub=0;
/**
* 订单ID
@ -50,7 +50,7 @@ public class DistributionAppStockArticleVO extends DistributionStockArticleEntit
* 签收数
*/
@ApiModelProperty(value = "签收(订单)")
private Integer signforNub;
private Integer signforNub=0;
/**
* 是否存在异常包间

2
blade-service-api/logpm-old-project-api/src/main/java/com/logpm/oldproject/entity/LocationEntity.java

@ -1,6 +1,7 @@
package com.logpm.oldproject.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
@ -53,6 +54,7 @@ public class LocationEntity {
private Integer floor ;
/** 当前列 */
@ApiModelProperty(name = "当前列",notes = "")
@TableField(value = "`row`")
private Integer row ;
}

33
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailEntity.java

@ -24,6 +24,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springblade.core.tenant.mp.TenantEntity;
import java.util.Date;
import java.util.List;
/**
@ -115,6 +116,18 @@ public class QuestDetailEntity extends TenantEntity {
*/
@ApiModelProperty(value = "品类名称;对应零担")
private String categoryName;
/**
* 发站仓名称
*/
@ApiModelProperty(value = "发站仓名称")
private String sendWarehouseName;
/**
* 品牌名称
*/
@ApiModelProperty(value = "品牌名称")
private String brandName;
/**
* 库存品ID;对应库存品
*/
@ -172,8 +185,7 @@ public class QuestDetailEntity extends TenantEntity {
/**
* 托盘名称
*/
@ApiModelProperty(value = "托盘码")
@TableField(exist = false)
@ApiModelProperty(value = "托盘名称")
private String trayName;
/**
@ -227,6 +239,23 @@ public class QuestDetailEntity extends TenantEntity {
*/
@ApiModelProperty(value = "批次号")
private String incomingBatch;
/**
* 盘点人
*/
@ApiModelProperty(value = "盘点人")
private Long inventoryUser;
/**
* 盘点时间
*/
@ApiModelProperty(value = "盘点时间")
private Date inventoryTime;
@ApiModelProperty(value = "盘点开始时间")
@TableField(exist = false)
private String startTime;// 开始时间
@ApiModelProperty(value = "盘点结束时间")
@TableField(exist = false)
private String endTime;// 结束时间
}

11
blade-service/logpm-aftersales/pom.xml

@ -16,6 +16,17 @@
<packaging>jar</packaging>
<dependencies>
<!--websocket-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
<exclusions>
<exclusion>
<artifactId>spring-boot-starter-tomcat</artifactId>
<groupId>org.springframework.boot</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springblade</groupId>
<artifactId>blade-core-boot</artifactId>

12
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/AftersalesApplication.java

@ -19,6 +19,9 @@ package com.logpm.aftersales;
import org.springblade.common.constant.ModuleNameConstant;
import org.springblade.core.cloud.client.BladeCloudApplication;
import org.springblade.core.launch.BladeApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
/**
* Demo启动器
@ -26,11 +29,20 @@ import org.springblade.core.launch.BladeApplication;
* @author Chill
*/
@BladeCloudApplication
//@EnableWebSocket
public class AftersalesApplication {
public static void main(String[] args) {
BladeApplication.run(ModuleNameConstant.APPLICATION_AFTERSALES_NAME, AftersalesApplication.class, args);
}
/**
* 如果直接使用springboot的内置容器而不是使用独立的servlet容器就要注入ServerEndpointExporter外部容器则不需要
*/
/* @Bean
public ServerEndpointExporter serverEndpointExporter() {
return new ServerEndpointExporter();
}*/
}

38
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/config/WebSocketConfig.java

@ -0,0 +1,38 @@
package com.logpm.aftersales.config;
import com.logpm.aftersales.launcher.OpcSessionHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;
import javax.annotation.Resource;
/**
* 开启WebSocket支持
* @author 12702
*/
@Slf4j
@Configuration
@EnableWebSocket
@ConditionalOnProperty(name = "system.websocket.isOpen",havingValue = "true")
//@ConditionalOnProperty(name = "spring.profiles.active",havingValue = "dev")
public class WebSocketConfig implements WebSocketConfigurer {
@Resource
private OpcSessionHandler opcSessionHandler;
// @Bean
// public ServerEndpointExporter serverEndpointExporter() {
// return new ServerEndpointExporter();
// }
@Override
public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
registry.addHandler(opcSessionHandler, "/ws/automate").setAllowedOrigins("*");
}
}

21
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java

@ -46,6 +46,8 @@ import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.tool.constant.BladeConstant;
import springfox.documentation.annotations.ApiIgnore;
import java.util.Calendar;
import java.util.Map;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
@ -91,6 +93,21 @@ public class AftersalesWorkOrderController extends BladeController {
return R.data(AftersalesWorkOrderWrapper.build().pageVO(pages));
}
/**
* 客服异常工单 查询异常完整数据集合
*/
@GetMapping("/listOwn")
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入aftersalesWorkOrder")
public R<IPage<AftersalesWorkOrderVO>> getListOwn(@ApiIgnore @RequestParam Map<String, Object> aftersalesWorkOrder, Query query) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(ObjectUtils.isNotNull(myCurrentWarehouse)){
aftersalesWorkOrder.put("warehouseId", myCurrentWarehouse.getId());
}
IPage<AftersalesWorkOrderEntity> pages = aftersalesWorkOrderService.pageListOwn(aftersalesWorkOrder, Condition.getPage(query));
return R.data(AftersalesWorkOrderWrapper.build().pageVO(pages));
}
/**
* 客服异常工单 自定义分页
*/
@ -114,11 +131,11 @@ public class AftersalesWorkOrderController extends BladeController {
/**
* 客服异常工单 完结处理熟练
* 客服异常工单 完结处理
*/
@PostMapping("/addCompletionEnd")
@ApiOperationSupport(order = 4)
@ApiOperation(value = "新增", notes = "传入aftersalesWorkOrder")
@ApiOperation(value = "完结处理", notes = "传入aftersalesWorkOrder")
public R addCompletionEnd(@Valid @RequestBody List<AftersalesWorkOrderDTO> aftersalesWorkOrder) {
return R.status(aftersalesWorkOrderService.addCompletionEnd(aftersalesWorkOrder));

78
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/launcher/OpcSessionHandler.java

@ -0,0 +1,78 @@
package com.logpm.aftersales.launcher;
import lombok.extern.slf4j.Slf4j;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Component;
import org.springframework.web.socket.*;
import java.io.IOException;
import java.util.concurrent.CopyOnWriteArraySet;
/**
* @author tarzan
*/
@Component
@Slf4j
public class OpcSessionHandler implements WebSocketHandler {
private static final CopyOnWriteArraySet<WebSocketSession> SESSIONS=new CopyOnWriteArraySet<>();
private final static String ALERT="alert";
private final static String CONTROL="control";
@Override
public void afterConnectionEstablished(@NonNull WebSocketSession session) throws Exception {
SESSIONS.add(session);
log.info(session.getId()+" OpcSessionHandler当前在线人数:"+SESSIONS.size());
}
@Override
public void handleMessage(WebSocketSession session, WebSocketMessage<?> message) throws Exception {
String msg = message.getPayload().toString();
log.info("接收消息"+session.getId()+":"+msg);
}
@Override
public void handleTransportError(WebSocketSession session,@NonNull Throwable exception) throws Exception {
log.error("OpcSessionHandler连接出错"+session.getId());
SESSIONS.remove(session);
if (!session.isOpen()) {
session.close();
}
}
@Override
public void afterConnectionClosed(WebSocketSession session, @NonNull CloseStatus closeStatus) throws Exception {
log.info("OpcSessionHandler关闭连接"+session.getId());
SESSIONS.remove(session);
}
@Override
public boolean supportsPartialMessages() {
return false;
}
public void sendMessageToUser(WebSocketSession session, String contents) {
if (session != null && session.isOpen()) {
TextMessage message = new TextMessage(contents);
try {
session.sendMessage(message);
} catch (IOException e) {
log.error(e.getMessage());
}
}
}
public void sendMessageToAllUsers(String contents) {
SESSIONS.forEach(session->sendMessageToUser(session, contents));
}
}

20
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/resp/NoticeWebsocketResp.java

@ -0,0 +1,20 @@
package com.logpm.aftersales.resp;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author 12702
*/
@Data
@ApiModel("ws通知返回对象")
public class NoticeWebsocketResp<T> {
@ApiModelProperty(value = "通知类型")
private String noticeType;
@ApiModelProperty(value = "通知内容")
private T noticeInfo;
}

10
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java

@ -24,6 +24,7 @@ import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseService;
import java.util.List;
import java.util.Map;
/**
* 客服异常工单 服务类
@ -71,4 +72,13 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
* @return
*/
boolean addCompletionEnd(List<AftersalesWorkOrderDTO> aftersalesWorkOrder);
/**
* 查询异常完整数据集合
*
* @param aftersalesWorkOrder
* @param page
* @return
*/
IPage<AftersalesWorkOrderEntity> pageListOwn(Map<String, Object> aftersalesWorkOrder, IPage<Object> page);
}

105
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/WebSocketServer.java

@ -0,0 +1,105 @@
package com.logpm.aftersales.service;
import com.alibaba.fastjson.JSONObject;
import com.logpm.aftersales.config.WebSocketConfig;
import lombok.EqualsAndHashCode;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.stereotype.Component;
import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;
import java.util.List;
import java.util.concurrent.CopyOnWriteArraySet;
/**
* @author tarzan
*/
@ConditionalOnClass(value = WebSocketConfig.class)
@ServerEndpoint("/ws/automate")
@Slf4j
@EqualsAndHashCode
public class WebSocketServer {
/** 虽然@Component默认是单例模式的,但springboot还是会为每个websocket连接初始化一个bean,所以可以用一个静态set保存起来。 */
private static final CopyOnWriteArraySet<WebSocketServer> WEBSOCKET_CLIENTS =new CopyOnWriteArraySet<>();
/** 当前session */
private Session session;
/** 当前session订阅的话题 */
private List<String> topics;
public WebSocketServer() {
}
@OnOpen
public void onOpen(Session session) {
this.session = session;
WEBSOCKET_CLIENTS.add(this);
log.info("WebSocketServer有新客户端连接加入:{},当前在线人数为:{}", session.getId(),WEBSOCKET_CLIENTS.size());
}
@OnClose
public void onClose() {
WEBSOCKET_CLIENTS.remove(this);
log.info("有一连接关闭:{},当前在线人数为:{}", this.session.getId(), WEBSOCKET_CLIENTS.size());
}
@OnMessage
public void onMessage(String message, Session session) {
this.topics= Func.toStrList(message);
log.info("服务端收到客户端[{}]的消息:{}", session.getId(), message);
}
@OnError
public void onError(Session session, Throwable error) {
log.error("发生错误:"+error.getMessage());
WEBSOCKET_CLIENTS.remove(this);
log.info("有一连接异常:{},当前在线人数为:{}", session.getId(), WEBSOCKET_CLIENTS.size());
}
public <T> void sendData(T data, String topicName) {
JSONObject result=new JSONObject();
result.put("topic",topicName);
result.put("data",data);
//显示值为null的字段
// String jsonString = JSON.toJSONString(result, SerializerFeature.WriteMapNullValue);
sendMessage(result.toString(),topicName);
}
/**
* 发送消息广播
*
* @param message 消息文本
* @author tarzan
* @date 2022年12月08日 09:24:34
*/
public void sendMessage(String message,String topic){
try {
WEBSOCKET_CLIENTS.forEach(client ->{
if (client.session.isOpen()&&CollectionUtil.isNotEmpty(client.topics)&&client.topics.contains(topic)) {
client.session.getAsyncRemote().sendText(message);
}
});
} catch (Exception e) {
log.error(e.getMessage());
}
}
public static void sendMessageToAllUsers(String message){
try {
WEBSOCKET_CLIENTS.forEach(client -> {
if (client.session.isOpen()) {
client.session.getAsyncRemote().sendText(message);
}
});
} catch (Exception e) {
log.error(e.getMessage());
}
}
}

12
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesExchangeServiceImpl.java

@ -19,14 +19,16 @@ package com.logpm.aftersales.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.logpm.aftersales.entity.AftersalesExchangeEntity;
import com.logpm.aftersales.service.WebSocketServer;
import com.logpm.aftersales.vo.AftersalesExchangeVO;
import com.logpm.aftersales.excel.AftersalesExchangeExcel;
import com.logpm.aftersales.mapper.AftersalesExchangeMapper;
import com.logpm.aftersales.service.IAftersalesExchangeService;
import lombok.AllArgsConstructor;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.utils.AesUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@ -43,8 +45,11 @@ import java.util.Map;
* @since 2023-11-17
*/
@Service
@AllArgsConstructor
public class AftersalesExchangeServiceImpl extends BaseServiceImpl<AftersalesExchangeMapper, AftersalesExchangeEntity> implements IAftersalesExchangeService {
private static int count=0;
@Override
public IPage<AftersalesExchangeVO> selectAftersalesExchangePage(IPage<AftersalesExchangeVO> page, AftersalesExchangeVO aftersalesExchange) {
return page.setRecords(baseMapper.selectAftersalesExchangePage(page, aftersalesExchange));
@ -69,6 +74,7 @@ public class AftersalesExchangeServiceImpl extends BaseServiceImpl<AftersalesExc
public boolean ownSaveOrUpdate(AftersalesExchangeEntity aftersalesExchange) {
BladeUser user = AuthUtil.getUser();
if(ObjectUtil.isNull(aftersalesExchange.getId())){
//添加回复处理交流数据
aftersalesExchange.setCreateTime(new Date());
@ -77,7 +83,9 @@ public class AftersalesExchangeServiceImpl extends BaseServiceImpl<AftersalesExc
aftersalesExchange.setStatus(1);
aftersalesExchange.setIsDeleted(0);
baseMapper.insert(aftersalesExchange);
// webSocketServer.onMessage("111");
//添加新增的消息
// WebSocketServer.sendMessageToAllUsers(aftersalesExchange.toString());
}else{
//修改

13
blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java

@ -46,6 +46,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* 客服异常工单 服务实现类
@ -243,4 +244,16 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
return true;
}
/**
* 查询异常完整数据集合
*
* @param aftersalesWorkOrder
* @param page
* @return
*/
@Override
public IPage<AftersalesWorkOrderEntity> pageListOwn(Map<String, Object> aftersalesWorkOrder, IPage<Object> page) {
return null;
}
}

443
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionStockupAppController.java

@ -41,6 +41,7 @@ import com.logpm.distribution.mapper.DistributionReservationMapper;
import com.logpm.distribution.mapper.DistributionReservationStocklistMapper;
import com.logpm.distribution.service.*;
import com.logpm.distribution.vo.*;
import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.feign.*;
import io.swagger.annotations.Api;
@ -675,44 +676,114 @@ public class DistributionStockupAppController extends BladeController {
if (!distributionParcelListEntity.getMaterialCode().equals(cargoNumber)){
//不属于该物料库存品包件
return Resp.scanFail(60006,"无效的库存品包件!!!","无效的库存品包件!!!","");
}
//该包件不在此库位
WarehouseUpdownGoodsEntity warehouseUpdownGoodsEntity = new WarehouseUpdownGoodsEntity();
warehouseUpdownGoodsEntity.setAssociationValue(stockupDTO.getPacketBarCode());
warehouseUpdownGoodsEntity.setAssociationType("3");
warehouseUpdownGoodsEntity.setAllocationId(stockupDTO.getAllocationId());
warehouseUpdownGoodsEntity.setWarehouseId(myCurrentWarehouse.getId());
WarehouseUpdownGoodsEntity locationInformation = warehouseUpdownGoodsClient.getLocationInformation(warehouseUpdownGoodsEntity);
if (Func.isEmpty(locationInformation)){
return Resp.scanFail(60007,"库位无此包件!!!","库位无此包件!!!","");
}
//判断是否可以继续备货
//判断扫描的包件是否可以继续进行该预约的库存品备货
int isStockUp = judgmentIsStockUp(stockupDTO.getReservationId(),stockupDTO.getStockListId(),distributionParcelListEntity,myCurrentWarehouse.getId(),stockupDTO.getCargoNumber());
DistributionStockListEntity distributionStockListEntities = distributionStockupService.selectStockListInfoByCargoNumberList(stockupDTO.getReservationId(), stockupDTO.getCargoNumber(), stockupDTO.getAllocationId(), stockupDTO.getPacketBarCode());
if (ObjectUtils.isNull(distributionStockListEntities)) {
return R.data(60003, "", "该包件还未上架!");
switch (isStockUp){
case 1:
return Resp.scanFail(60008,"包件不属于此计划!!!","包件不属于此计划!!!","");
case 2:
return R.data(60002, distributionStockListEntities.getId(), "当前包件批次号与入库批次号不符,是否确认修改计划批次");
// case 3:
// //查询其他所用的页面信息
// DistributionStockupStockListVO distributionStockupStockListVO = distributionReservationService.selectStockupStockListByStockListId(reservationId,distributionStockListEntities.getId());
// return R.data(200, distributionStockupStockListVO, "扫描成功!");
case 3:
return R.data(200, distributionStockListEntities.getId(), "扫描成功!");
}
//判断是否可以继续备货
// if (ObjectUtils.isNull(distributionStockListEntities)) {
// return R.data(60003, "", "该包件还未上架!");
// }
// 通过当前预约单和货物定位当前计划的库存品批次
List<DistributionStockListEntity> planDistributionStockListEntities = getPlanDistributionStockListEntities(stockupDTO);
// List<DistributionStockListEntity> planDistributionStockListEntities = getPlanDistributionStockListEntities(stockupDTO);
//是否更新计划
boolean isUpdate = false;
Long updateStockListId = null;
// //是否更新计划
// boolean isUpdate = false;
// Long updateStockListId = null;
// 验证当前货位的货位和计划批次是否相同
// 验证当前扫描的库存品包件是否属于该计划的库存品批次
// List<DistributionReservationStocklistEntity> distributionReservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(stockupDTO.getReservationId());
// distributionReservationStocklistEntities.stream().map(DistributionReservationStocklistEntity::getStocklistId).filter(drs->)
// for (DistributionStockListEntity planDistributionStockListEntity : planDistributionStockListEntities) {
// if (planDistributionStockListEntity.getSourceType().equals("2")) {
// if (planDistributionStockListEntity.getOrderCode().equals(distributionStockListEntities.getIncomingBatch())) {
// isUpdate = true;
// updateStockListId = distributionStockListEntities.getId();
// break;
// }
// }
// }
// if (isUpdate) {
// return R.data(60002, updateStockListId, "当前包件批次号与入库批次号不符,是否确认修改计划批次");
// }
for (DistributionStockListEntity planDistributionStockListEntity : planDistributionStockListEntities) {
if (planDistributionStockListEntity.getSourceType().equals("2")) {
if (planDistributionStockListEntity.getOrderCode().equals(distributionStockListEntities.getIncomingBatch())) {
isUpdate = true;
updateStockListId = distributionStockListEntities.getId();
break;
}
}
}
return R.data(200, "", "扫描成功!");
}
private int judgmentIsStockUp(Long reservationId,Long stockListId, DistributionParcelListEntity distributionParcelListEntity, Long warehouseId,String cargoNumber) {
List<DistributionReservationStocklistEntity> distributionReservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(reservationId);
if (Func.isNotEmpty(distributionReservationStocklistEntities)){
//查询库存品信息
List<Long> stockListIds = distributionReservationStocklistEntities.stream().map(DistributionReservationStocklistEntity::getStocklistId).collect(Collectors.toList());
List<DistributionStockListEntity> stockListEntityList = distributionStockListService.list(Wrappers.<DistributionStockListEntity>query().lambda()
.in(DistributionStockListEntity::getId, stockListIds)
.eq(DistributionStockListEntity::getWarehouseId, warehouseId)
.eq(DistributionStockListEntity::getCargoNumber, cargoNumber)
);
//判断该库存品包件是否属于计划库存品的物料
//首先判断包件的物料和此计划中的物料是否一致
// if (!stockListEntityList.getCargoNumber().equals(distributionParcelListEntity.getMaterialCode())){
// return 1;
// }
// //查看是否和当前页的计划批次一致
// if (!stockListEntityList.getIncomingBatch().equals(distributionParcelListEntity.getOrderCode())){
// //查看计划下是否存在该包件对应批次的计划
// List<DistributionReservationStocklistEntity> reservationStocklistEntityList = distributionReservationMapper.selectStockListByReservationIdAndCargoNumber(reservationId, cargoNumber, stockListId);
// if (Func.isNotEmpty(reservationStocklistEntityList)){
// List<Long> stockListIds = reservationStocklistEntityList.stream().map(DistributionReservationStocklistEntity::getStocklistId).collect(Collectors.toList());
// List<DistributionStockListEntity> distributionStockListEntities = distributionStockListService.listByIds(stockListIds);
// boolean isHave = distributionStockListEntities.stream().map(DistributionStockListEntity::getIncomingBatch).allMatch(s -> s.contains(distributionParcelListEntity.getOrderCode()));
// if (isHave){
// return 3;
// }
// }else {
// return 2;
// }
// }
boolean isHave = stockListEntityList.stream().map(DistributionStockListEntity::getCargoNumber).anyMatch(s -> s.contains(distributionParcelListEntity.getMaterialCode()));
if (!isHave){
//判断包件是否属于计划物料信息
return 1;
}
if (isUpdate) {
return R.data(60002, updateStockListId, "当前包件批次号与入库批次号不符,是否确认修改计划批次");
//判断该库存品包件是否属于计划的批次
boolean isHaveIncomingBatch = stockListEntityList.stream().map(DistributionStockListEntity::getIncomingBatch).anyMatch(s -> s.contains( distributionParcelListEntity.getOrderCode()));
if (!isHaveIncomingBatch){
return 2;
}
}
return R.data(200, "", "扫描成功!");
return 3;
}
/**
@ -737,104 +808,254 @@ public class DistributionStockupAppController extends BladeController {
//todo 这里代码没有写完 等TJJ 和CYZ 空了来写
@ResponseBody
@PostMapping("/updateStockup")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "修改批次", notes = "传入stockupDTO")
// 修改预约备货信息 需要传入修改的包条
public R updateStockup(@RequestBody StockupDTO stockupDTO) {
// 增加实际扫描的包件对应的库存品信息 增加在预约库存品中间表上
DistributionReservationStocklistEntity reservationStocklistEntity = new DistributionReservationStocklistEntity();
reservationStocklistEntity.setReservationId(stockupDTO.getReservationId());
reservationStocklistEntity.setReservationNum(1);
reservationStocklistEntity.setLoadingStatus("10");
reservationStocklistEntity.setSigningStatus("10");
reservationStocklistEntity.setStockListStatus("3");
DistributionStockListEntity stockListEntity = distributionStockListService.getById(stockupDTO.getStockListId());
if(ObjectUtils.isNotNull(stockListEntity)){
reservationStocklistEntity.setStocklistId(stockListEntity.getId());
reservationStocklistEntity.setUnit(stockListEntity.getCargoUnit());
reservationStocklistEntity.setRealityNum(0);
}
distributionReservationStocklistService.save(reservationStocklistEntity);
//扣减对应的库存品信息
DistributionStockListEntity newStockListEntity = distributionStockListService.getById(stockListEntity.getId());
newStockListEntity.setQuantityStock(newStockListEntity.getQuantityStock() - reservationStocklistEntity.getReservationNum());
distributionStockListService.updateById(newStockListEntity);
//查询该预约该物料的库存品信息
List<DistributionReservationStocklistEntity> reservationStocklistEntities = distributionReservationMapper.selectInventoryListByIdAndMateriel(reservationStocklistEntity.getId(),stockListEntity.getMarketCode());
//可能会出现同一物料不同批次的库存品
//根据情况进行计划的数量扣减
Map<Long, List<DistributionReservationStocklistEntity>> stockListMap;
if (Func.isNotEmpty(reservationStocklistEntities)){
//查询是否进行备货
stockListMap = reservationStocklistEntities.stream().collect(Collectors.groupingBy(DistributionReservationStocklistEntity::getStocklistId));
//过滤已经完成备货的预约库存品批次
stockListMap.forEach((k,v)->{
//查询该预约的库存品包件是否完成备货
v.forEach(o->{
//查询包件是否完成备货
List<DistributionReservationStocklistEntity> distributionReservationStocklistEntities = distributionReservationMapper.selectStockListByReservationId(stockupDTO.getReservationId());
//当前预约是否存在该批次库存品计划
// if (stockupDTO.getStockListId().equals(stockupDTO.getNewStockListId())){
// if (Func.isNotEmpty(distributionReservationStocklistEntities)){
// boolean isAdd = distributionReservationStocklistEntities.stream().map(DistributionReservationStocklistEntity::getStocklistId).anyMatch(s -> s.equals(stockupDTO.getStockListId()));
// //扣减对应的库存品信息
//// DistributionStockListEntity newStockListEntity = distributionStockListService.getById(stockupDTO.getStockListId());
// if (!isAdd){
// ///先进行对应的扣减
// //查询该预约该物料的库存品信息
// List<DistributionReservationStocklistEntity> reservationStocklistEntities = distributionReservationMapper.selectInventoryListByIdAndMateriel(stockupDTO.getReservationId(),stockupDTO.getCargoNumber());
// //可能会出现同一物料不同批次的库存品
// List<DistributionReservationStocklistEntity> reservationStockList = reservationStocklistEntities.stream().filter(drs -> drs.getReservationNum() > 0 && drs.getRealityNum() < drs.getReservationNum()).collect(Collectors.toList());
// if (Func.isNotEmpty(reservationStockList)){
// DistributionReservationStocklistEntity oldReservationStocklistEntity = reservationStockList.get(0);
// //扣减计划数量
// oldReservationStocklistEntity.setReservationNum(oldReservationStocklistEntity.getReservationNum() - 1);
// distributionReservationStocklistService.updateById(oldReservationStocklistEntity);
//
// //维护对应的库存品包件
// List<DisStockListDetailEntity> stockListDetailEntities = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
// .eq(DisStockListDetailEntity::getReservationId, oldReservationStocklistEntity.getReservationId())
// .eq(DisStockListDetailEntity::getStockListId, oldReservationStocklistEntity.getStocklistId())
// .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
// );
//
// DistributionStockListEntity oldStockListEntity = distributionStockListService.getById(oldReservationStocklistEntity.getStocklistId());
// oldStockListEntity.setQuantityOccupied(oldStockListEntity.getQuantityOccupied() - 1);
// distributionStockListService.updateById(oldStockListEntity);
//
// //对指定库存品包件进行库存品ID修改
// DisStockListDetailEntity disStockListDetailEntity = stockListDetailEntities.stream().filter(sd -> Func.isEmpty(sd.getStockPackageCode())).collect(Collectors.toList()).get(0);
// if (Func.isNotEmpty(disStockListDetailEntity)){
// disStockListDetailEntity.setStockListId(stockupDTO.getStockListId());
// disStockListDetailService.updateById(disStockListDetailEntity);
// }
// //维护对应库存品的冻结数量
// DistributionStockListEntity newStockListEntity = distributionStockListService.getById(stockupDTO.getStockListId());
// newStockListEntity.setQuantityOccupied(oldStockListEntity.getQuantityOccupied() + 1);
// distributionStockListService.updateById(newStockListEntity);
// }
//
// // 增加实际扫描的包件对应的库存品信息 增加在预约库存品中间表上
// DistributionReservationStocklistEntity reservationStocklistEntity = new DistributionReservationStocklistEntity();
// reservationStocklistEntity.setReservationId(stockupDTO.getReservationId());
// reservationStocklistEntity.setReservationNum(1);
// reservationStocklistEntity.setLoadingStatus("10");
// reservationStocklistEntity.setSigningStatus("10");
// reservationStocklistEntity.setStockListStatus("3");
// DistributionStockListEntity stockListEntity = distributionStockListService.getById(stockupDTO.getStockListId());
// if(ObjectUtils.isNotNull(stockListEntity)){
// reservationStocklistEntity.setStocklistId(stockListEntity.getId());
// reservationStocklistEntity.setUnit(stockListEntity.getCargoUnit());
// reservationStocklistEntity.setRealityNum(0);
// }
// distributionReservationStocklistService.save(reservationStocklistEntity);
//
// }else {
// //扣减该物料的计划库存品
// List<DistributionReservationStocklistEntity> reservationStocklistEntityList = distributionReservationMapper.selectStockListByReservationIdAndCargoNumber(stockupDTO.getReservationId(), stockupDTO.getCargoNumber(), stockupDTO.getStockListId());
// List<DistributionReservationStocklistEntity> oldReservationStockList = reservationStocklistEntityList.stream().filter(rs -> rs.getReservationNum() > 0 && rs.getRealityNum() < rs.getReservationNum()).collect(Collectors.toList());
// if (Func.isNotEmpty(oldReservationStockList)){
// //对老的计划数量进行减少
// DistributionReservationStocklistEntity reservationStocklistEntity = oldReservationStockList.get(0);
// reservationStocklistEntity.setReservationNum(reservationStocklistEntity.getReservationNum() - 1);
// distributionReservationStocklistService.updateById(reservationStocklistEntity);
//
//
// //维护对应库存品的冻结数量
// DistributionStockListEntity oldStockListEntity = distributionStockListService.getById(reservationStocklistEntity.getStocklistId());
// oldStockListEntity.setQuantityOccupied(oldStockListEntity.getQuantityOccupied() - 1);
// distributionStockListService.updateById(oldStockListEntity);
//
// //维护对应的库存品包件
// List<DisStockListDetailEntity> stockListDetailEntities = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
// .eq(DisStockListDetailEntity::getReservationId, reservationStocklistEntity.getReservationId())
// .eq(DisStockListDetailEntity::getStockListId, reservationStocklistEntity.getStocklistId())
// .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
// );
//
// //对指定库存品包件进行库存品ID修改
// DisStockListDetailEntity disStockListDetailEntity = stockListDetailEntities.stream().filter(sd -> Func.isEmpty(sd.getStockPackageCode())).collect(Collectors.toList()).get(0);
// if (Func.isNotEmpty(disStockListDetailEntity)){
// disStockListDetailEntity.setStockListId(stockupDTO.getStockListId());
// disStockListDetailService.updateById(disStockListDetailEntity);
// distributionReservationStocklistService.updateById(reservationStocklistEntity);
// }
//
// //新的数量进行增加
// DistributionReservationStocklistEntity stocklistEntity = distributionReservationStocklistService.getOne(Wrappers.<DistributionReservationStocklistEntity>query().lambda()
// .eq(DistributionReservationStocklistEntity::getReservationId, stockupDTO.getReservationId())
// .eq(DistributionReservationStocklistEntity::getStocklistId, stockupDTO.getStockListId())
// .ne(DistributionReservationStocklistEntity::getStockListStatus, ReservationOrderStatusConstant.quxiao.getValue())
// );
//
// stocklistEntity
// .setReservationNum(stocklistEntity.getReservationNum() + 1);
// distributionReservationStocklistService.updateById(stocklistEntity);
//
// //维护对应库存品的冻结数量
// DistributionStockListEntity newStockListEntity = distributionStockListService.getById(stockupDTO.getStockListId());
// newStockListEntity.setQuantityOccupied(oldStockListEntity.getQuantityOccupied() + 1);
// distributionStockListService.updateById(newStockListEntity);
//
//
//
//
// }
//
//
//// List<DistributionReservationStocklistEntity> reservationStocklistEntities = stockListMap.get(stockupDTO.getStockListId());
//// DistributionReservationStocklistEntity reservationStocklistEntity = reservationStocklistEntities.get(0);
//// reservationStocklistEntity.setReservationNum(reservationStocklistEntity.getReservationNum() + 1);
//// distributionReservationStocklistService.updateById(reservationStocklistEntity);
//// if (newStockListEntity.getQuantityOccupied() +1 +newStockListEntity.getQuantityOccupied() <= newStockListEntity.getQuantityStock()){
//// newStockListEntity.setQuantityOccupied(newStockListEntity.getQuantityStock() + 1);
//// }
//// //修改对应库存品的冻结数量
//// //查询出原来计划的库存品进行扣减
//// List<DistributionReservationStocklistEntity> distributionReservationStocklistEntityList = distributionReservationMapper.selectStockListByReservationIdAndCargoNumber(stockupDTO.getReservationId(),stockupDTO.getCargoNumber(),stockupDTO.getStockListId());
//// //过滤备货未完成的计划进行数量扣减
//// DistributionReservationStocklistEntity reservationStocklist = distributionReservationStocklistEntityList.stream().filter(drs -> drs.getReservationNum() > 0 && drs.getRealityNum() < drs.getReservationNum()).collect(Collectors.toList()).get(0);
//// reservationStocklist.setReservationNum(reservationStocklist.getReservationNum() - 1);
//// distributionReservationStocklistService.updateById(reservationStocklist);
////
//// //维护库存品对应数量
//// DistributionStockListEntity stockListEntity = distributionStockListService.getById(reservationStocklist.getStocklistId());
//// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() + 1);
//// distributionStockListService.updateById(stockListEntity);
//// //存在 进行新增计划
// }
// //这里扣减原来的需要排除备货完成的
// }
// }
if (Func.isNotEmpty(distributionReservationStocklistEntities)){
boolean isAdd = distributionReservationStocklistEntities.stream().map(DistributionReservationStocklistEntity::getStocklistId).anyMatch(s -> s.equals(stockupDTO.getStockListId()));
//扣减对应的库存品信息
// DistributionStockListEntity newStockListEntity = distributionStockListService.getById(stockupDTO.getStockListId());
if (!isAdd){
///先进行对应的扣减
//查询该预约该物料的库存品信息
List<DistributionReservationStocklistEntity> reservationStocklistEntities = distributionReservationMapper.selectInventoryListByIdAndMateriel(stockupDTO.getReservationId(),stockupDTO.getCargoNumber());
//可能会出现同一物料不同批次的库存品
List<DistributionReservationStocklistEntity> reservationStockList = reservationStocklistEntities.stream().filter(drs -> drs.getReservationNum() > 0 && drs.getRealityNum() < drs.getReservationNum()).collect(Collectors.toList());
if (Func.isNotEmpty(reservationStockList)){
DistributionReservationStocklistEntity oldReservationStocklistEntity = reservationStockList.get(0);
//扣减计划数量
oldReservationStocklistEntity.setReservationNum(oldReservationStocklistEntity.getReservationNum() - 1);
distributionReservationStocklistService.updateById(oldReservationStocklistEntity);
//维护对应的库存品包件
List<DisStockListDetailEntity> stockListDetailEntities = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, o.getReservationId())
.eq(DisStockListDetailEntity::getStockListId, o.getStocklistId())
.eq(DisStockListDetailEntity::getReservationId, oldReservationStocklistEntity.getReservationId())
.eq(DisStockListDetailEntity::getStockListId, oldReservationStocklistEntity.getStocklistId())
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
boolean stockFlag = stockListDetailEntities.stream().allMatch(s -> Func.isNotEmpty(s.getStockPackageCode()));
if (stockFlag){
stockListMap.remove(k);
DistributionStockListEntity oldStockListEntity = distributionStockListService.getById(oldReservationStocklistEntity.getStocklistId());
oldStockListEntity.setQuantityOccupied(oldStockListEntity.getQuantityOccupied() - 1);
distributionStockListService.updateById(oldStockListEntity);
//对指定库存品包件进行库存品ID修改
DisStockListDetailEntity disStockListDetailEntity = stockListDetailEntities.stream().filter(sd -> Func.isEmpty(sd.getStockPackageCode())).collect(Collectors.toList()).get(0);
if (Func.isNotEmpty(disStockListDetailEntity)){
disStockListDetailEntity.setStockListId(stockupDTO.getStockListId());
disStockListDetailService.updateById(disStockListDetailEntity);
}
});
});
} else {
stockListMap = null;
}
//stockListMap此时剩下的都是满足进行修改的库存品,这里就需要去进行指定删除哪一个库存品,这里默认添加数量为一需要指定一个进行扣减,
if (Func.isNotEmpty(stockListMap)){
List<DistributionReservationStocklistEntity> distributionReservationStocklistEntities = stockListMap.get(0);
DistributionReservationStocklistEntity reservationStocklist = distributionReservationStocklistEntities.get(0);
reservationStocklist.setReservationNum(reservationStocklist.getReservationNum() - reservationStocklistEntity.getReservationNum());
if (reservationStocklist.getReservationNum() == 0){
reservationStocklist.setStockListStatus(ReservationOrderStatusConstant.quxiao.getValue());
}
//查询包件是否完成备货
List<DisStockListDetailEntity> stockListDetailEntities = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getReservationId, reservationStocklist.getReservationId())
.eq(DisStockListDetailEntity::getStockListId, reservationStocklist.getStocklistId())
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
//对指定库存品包件进行库存品ID修改
DisStockListDetailEntity disStockListDetailEntity = stockListDetailEntities.stream().filter(sd -> Func.isEmpty(sd.getStockPackageCode())).collect(Collectors.toList()).get(0);
if (Func.isNotEmpty(disStockListDetailEntity)){
disStockListDetailEntity.setStockListId(stockListEntity.getId());
disStockListDetailService.updateById(disStockListDetailEntity);
distributionReservationStocklistService.updateById(reservationStocklist);
//维护对应库存品的冻结数量
DistributionStockListEntity oldStockListEntity = distributionStockListService.getById(reservationStocklist.getStocklistId());
oldStockListEntity.setQuantityStock(oldStockListEntity.getQuantityStock() + reservationStocklistEntity.getReservationNum());
distributionStockListService.updateById(oldStockListEntity);
//维护对应库存品的冻结数量
DistributionStockListEntity newStockListEntity = distributionStockListService.getById(stockupDTO.getStockListId());
newStockListEntity.setQuantityOccupied(newStockListEntity.getQuantityOccupied() + 1);
distributionStockListService.updateById(newStockListEntity);
}
// 增加实际扫描的包件对应的库存品信息 增加在预约库存品中间表上
DistributionReservationStocklistEntity reservationStocklistEntity = new DistributionReservationStocklistEntity();
reservationStocklistEntity.setReservationId(stockupDTO.getReservationId());
reservationStocklistEntity.setReservationNum(1);
reservationStocklistEntity.setLoadingStatus("10");
reservationStocklistEntity.setSigningStatus("10");
reservationStocklistEntity.setStockListStatus("3");
DistributionStockListEntity stockListEntity = distributionStockListService.getById(stockupDTO.getStockListId());
if(ObjectUtils.isNotNull(stockListEntity)){
reservationStocklistEntity.setStocklistId(stockListEntity.getId());
reservationStocklistEntity.setUnit(stockListEntity.getCargoUnit());
reservationStocklistEntity.setRealityNum(0);
}
distributionReservationStocklistService.save(reservationStocklistEntity);
}
// else {
// //扣减该物料的计划库存品
// List<DistributionReservationStocklistEntity> reservationStocklistEntityList = distributionReservationMapper.selectStockListByReservationIdAndCargoNumber(stockupDTO.getReservationId(), stockupDTO.getCargoNumber(), stockupDTO.getStockListId());
// List<DistributionReservationStocklistEntity> oldReservationStockList = reservationStocklistEntityList.stream().filter(rs -> rs.getReservationNum() > 0 && rs.getRealityNum() < rs.getReservationNum()).collect(Collectors.toList());
// if (Func.isNotEmpty(oldReservationStockList)){
// //对老的计划数量进行减少
// DistributionReservationStocklistEntity reservationStocklistEntity = oldReservationStockList.get(0);
// reservationStocklistEntity.setReservationNum(reservationStocklistEntity.getReservationNum() - 1);
// distributionReservationStocklistService.updateById(reservationStocklistEntity);
//
//
// //维护对应库存品的冻结数量
// DistributionStockListEntity oldStockListEntity = distributionStockListService.getById(reservationStocklistEntity.getStocklistId());
// oldStockListEntity.setQuantityOccupied(oldStockListEntity.getQuantityOccupied() - 1);
// distributionStockListService.updateById(oldStockListEntity);
//
// //维护对应的库存品包件
// List<DisStockListDetailEntity> stockListDetailEntities = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
// .eq(DisStockListDetailEntity::getReservationId, reservationStocklistEntity.getReservationId())
// .eq(DisStockListDetailEntity::getStockListId, reservationStocklistEntity.getStocklistId())
// .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
// );
//
// //对指定库存品包件进行库存品ID修改
// DisStockListDetailEntity disStockListDetailEntity = stockListDetailEntities.stream().filter(sd -> Func.isEmpty(sd.getStockPackageCode())).collect(Collectors.toList()).get(0);
// if (Func.isNotEmpty(disStockListDetailEntity)){
// disStockListDetailEntity.setStockListId(stockupDTO.getStockListId());
// disStockListDetailService.updateById(disStockListDetailEntity);
// distributionReservationStocklistService.updateById(reservationStocklistEntity);
// }
//
// //新的数量进行增加
// DistributionReservationStocklistEntity stocklistEntity = distributionReservationStocklistService.getOne(Wrappers.<DistributionReservationStocklistEntity>query().lambda()
// .eq(DistributionReservationStocklistEntity::getReservationId, stockupDTO.getReservationId())
// .eq(DistributionReservationStocklistEntity::getStocklistId, stockupDTO.getStockListId())
// .ne(DistributionReservationStocklistEntity::getStockListStatus, ReservationOrderStatusConstant.quxiao.getValue())
// );
//
// stocklistEntity
// .setReservationNum(stocklistEntity.getReservationNum() + 1);
// distributionReservationStocklistService.updateById(stocklistEntity);
//
// //维护对应库存品的冻结数量
// DistributionStockListEntity newStockListEntity = distributionStockListService.getById(stockupDTO.getStockListId());
// newStockListEntity.setQuantityOccupied(oldStockListEntity.getQuantityOccupied() + 1);
// distributionStockListService.updateById(newStockListEntity);
// }
// }
}
// 默认 计划数量和实际数量为0
return R.fail("操作成功");
//查询出原来的库存品信息
// DistributionReservationStocklistEntity reservationStocklist = distributionReservationStocklistService.getOne(Wrappers.<DistributionReservationStocklistEntity>query().lambda()
// .eq(DistributionReservationStocklistEntity::getReservationId, stockupDTO.getReservationId())
// .eq(DistributionReservationStocklistEntity::getStocklistId, stockupDTO.getStockListId())
// .ne(DistributionReservationStocklistEntity::getStockListStatus, ReservationOrderStatusConstant.quxiao.getValue())
// );
// 再次执行扫描 读取这预约计划下面正常的库存品信息 扣减数量 对新增的预约库存品信息进行增加预约数量和实际数量
// 修改logpm_dis_stock_list_detail 这张表上的库存品ID和包件ID
return R.success("操作成功");
}

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionStockupController.java

@ -18,6 +18,7 @@ package com.logpm.distribution.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.distribution.entity.DistributionStockupEntity;
import com.logpm.distribution.excel.DistributionCityExcel;
@ -203,13 +204,8 @@ public class DistributionStockupController extends BladeController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "查询备货人员信息", notes = "传入distributionStockup")
public R<List<User>> listUser() {
//获取当前登录用户
BladeUser user = AuthUtil.getUser();
//查询备货岗位
List<User> cc = distributionStockupService.getRoleList(user.getDeptId(), user.getTenantId());
List<User> cc = distributionStockupService.getRoleList();
// List<User> cc = distributionStockupService.getRoleList(user.getDeptId(), user.getTenantId(), "叉车");
return R.data(cc);
}

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/app/StockupDTO.java

@ -62,6 +62,7 @@ public class StockupDTO implements Serializable {
private Long stockupId;//备货任务区Id
private String type;//类型 1 扫码 2 选择
private Long stockListId;//库存品id
private Long newStockListId;//库存品id
private Integer packageNum;//包条数量
private String isZero;//零担标识 0否 1是

4
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml

@ -36,7 +36,7 @@
<select id="getParcelListInfo" resultType="com.logpm.distribution.entity.DistributionParcelListEntity">
select ldsa.mall_name mallName,ldpl.order_code orderCode,ldpl.id,ldpl.conditions,ldpl.order_package_code orderPackageCode,ldsa.id stockArticleId,
ldsa.mall_id mallId,ldsa.genre ,ldsa.is_zero isZero,
ldsa.mall_id mallId,ldsa.genre ,ldsa.is_zero isZero,ldpl.send_warehouse_name sendWarehouseName,ldpl.second,ldpl.third_product thirdProduct,
ldpl.waybill_number waybillNumber,ldpl.firsts,ldpl.quantity,ldpl.warehouse_id warehouseId,ldpl.material_name materialName,ldpl.material_code materialCode,
CASE WHEN ldpl.conditions = 1 THEN
(select GROUP_CONCAT(tray_id)
@ -94,7 +94,7 @@
(select GROUP_CONCAT(DISTINCT id)
from logpm_distribution_stock_list
where material_id = ldpl.material_id and incoming_batch = ldpl.order_code and market_id = ldsa.mall_id)
END stockId
END stockId ,ldsa.brand brandName
from logpm_distribution_stock_article ldsa
LEFT JOIN logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id

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

@ -323,4 +323,14 @@ public interface DistributionReservationMapper extends BaseMapper<DistributionRe
* @return
*/
List<DistributionReservationStocklistEntity> selectInventoryListByIdAndMateriel(@Param("reservationId") Long id,@Param("cargoNumber") String marketCode);
List<DistributionReservationStocklistEntity> selectStockListByReservationIdAndCargoNumber(@Param("reservationId") Long reservationId,@Param("cargoNumber") String cargoNumber,@Param("oldStockId") Long stockListId);
/**
* 查询预约计划下指定批次的库存品信息
* @param reservationId
* @param id
* @return
*/
DistributionStockupStockListVO selectStockupStockListByStockListId(@Param("reservationId") Long reservationId,@Param("stockListId") Long id);
}

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

@ -298,8 +298,7 @@
</select>
<select id="selectStockupStockListNew" resultType="com.logpm.distribution.vo.DistributionStockupStockListVO">
SELECT
<!-- ldslNew.id AS stockListId,-->
SELECT DISTINCT
ldslNew.sku AS sku,
ldslNew.cargo_number AS cargoNumber,
ldslNew.description_goods AS materialName,
@ -307,10 +306,8 @@
ldslNew.cargo_unit AS cargoUnit,
ldslNew.tray_name AS trayName,
ldslNew.unpack AS unpack,
ldslNew.source_type AS sourceType,
count(ldss.id) AS realNum,
<!-- t.deliveryDetailsId AS deliveryDetailsId,-->
t.reservation_num as planNum,
(SELECT count(*) FROM logpm_distribution_stock AS lds WHERE lds.stock_list_id =#{reservationId} AND lds.is_deleted = 0) AS realNum,
t.reservationNum as planNum,
(
select GROUP_CONCAT( DISTINCT (allocation_id)) from logpm_warehouse_updown_goods where association_value =ldslNew.cargo_number or association_value in (
SELECT order_package_code from logpm_distribution_parcel_list where conditions=2 and material_code=ldslNew.cargo_number)
@ -322,7 +319,7 @@
ldsl.description_goods,
ldsl.id,
ldrs.id as deliveryDetailsId,
ldrs.reservation_num
SUM(ldrs.reservation_num) AS reservationNum
FROM
logpm_distribution_reservation_stocklist ldrs
LEFT JOIN logpm_distribution_stock_list ldsl ON ldrs.stocklist_id = ldsl.id
@ -332,6 +329,42 @@
LEFT JOIN logpm_distribution_stock_list ldslNew ON t.cargo_number = ldslNew.cargo_number
LEFT JOIN logpm_distribution_stock ldss ON ldss.stock_list_id = t.id where ldslNew.is_deleted = 0
<!-- SELECT-->
<!-- ldsl.sku AS sku,-->
<!-- ldsl.cargo_number AS cargoNumber,-->
<!-- ldsl.description_goods AS materialName,-->
<!-- ldsl.cargo_norms AS cargoNorms,-->
<!-- ldsl.cargo_unit AS cargoUnit,-->
<!-- ldsl.tray_name AS trayName,-->
<!-- ldsl.unpack AS unpack,-->
<!-- ldsl.source_type AS sourceType,-->
<!-- ldrs.stocklist_id AS stockListId,-->
<!-- ldrs.reservation_num AS planNum,-->
<!-- (SELECT COUNT(ldss.id) FROM logpm_distribution_stock AS ldss WHERE ldss.stock_list_id = ldsl.id ) AS realNum,-->
<!-- CASE-->
<!-- ldsl.source_type-->
<!-- WHEN 1 THEN-->
<!-- (-->
<!-- SELECT-->
<!-- group_concat( DISTINCT lwug.allocation_id ) AS allocations-->
<!-- FROM-->
<!-- logpm_distribution_stock_list ldslnew-->
<!-- LEFT JOIN logpm_distribution_parcel_list ldpl ON ldpl.order_code = ldslnew.incoming_batch-->
<!-- AND ldpl.material_id = ldslnew.material_id-->
<!-- AND ldpl.conditions = '2'-->
<!-- LEFT JOIN logpm_warehouse_updown_goods lwug ON lwug.association_value = ldpl.order_package_code-->
<!-- WHERE-->
<!-- ldslnew.id = ldsl.id AND lwug.association_type = '3'-->
<!-- )-->
<!-- WHEN 2 THEN-->
<!-- ( SELECT group_concat( DISTINCT lwug.allocation_id ) AS allocations FROM logpm_warehouse_updown_goods lwug WHERE lwug.association_id = ldsl.material_id AND lwug.association_type = '4')-->
<!-- END allocations-->
<!-- FROM-->
<!-- logpm_distribution_reservation_stocklist ldrs-->
<!-- LEFT JOIN logpm_distribution_stock_list ldsl ON ldrs.stocklist_id = ldsl.id-->
<!-- LEFT JOIN logpm_distribution_stock ldss ON ldss.stock_list_id = ldsl.id-->
<!-- WHERE-->
<!-- ldrs.reservation_id =#{reservationId}-->
</select>
<select id="selectOrderNumByReservationId" resultType="Integer">
@ -429,12 +462,12 @@
</select>
<select id="getReservationNumByReservationIdAndStockListId" resultType="Integer">
select ldrs.reservation_num
select sum(ldrs.reservation_num)
from logpm_distribution_reservation ldr
left join logpm_distribution_reservation_stocklist ldrs on ldrs.reservation_id = ldr.id and ldrs.is_deleted = 0
where ldr.id = #{reservationId}
and ldr.is_deleted = 0
and ldrs.stocklist_id = #{stockListId}
<!-- 取消对库存品的限制 and ldrs.stocklist_id = #{stockListId}-->
</select>
<select id="getDeliverReservationInfo" resultType="com.logpm.distribution.dto.DistributionReservationDTO">
SELECT
@ -1292,10 +1325,7 @@
<select id="selectInventoryListByIdAndMateriel"
resultType="com.logpm.distribution.entity.DistributionReservationStocklistEntity">
SELECT
ldrs.*REPEAT
statement_list
UNTIL search_condition END REPEAT;
ldrs.*
FROM
logpm_distribution_reservation AS ldr
LEFT JOIN logpm_distribution_reservation_stocklist AS ldrs ON ldr.id = ldrs.reservation_id
@ -1303,5 +1333,64 @@
WHERE
ldr.id = #{reservationId} AND ldsl.cargo_number = #{cargoNumber}
</select>
<select id="selectStockListByReservationIdAndCargoNumber"
resultType="com.logpm.distribution.entity.DistributionReservationStocklistEntity">
SELECT
ldrs.*
FROM
logpm_distribution_reservation AS ldr
LEFT JOIN logpm_distribution_reservation_stocklist AS ldrs ON ldr.id = ldrs.reservation_id
LEFT JOIN logpm_distribution_stock_list AS ldsl ON ldrs.stocklist_id = ldsl.id
WHERE
ldr.id = #{reservationId} AND ldsl.cargo_number = #{cargoNumber} and ldrs.stocklist_id != #{oldStockId}
</select>
<select id="selectStockupStockListByStockListId"
resultType="com.logpm.distribution.vo.DistributionStockupStockListVO">
SELECT
ldsl.sku AS sku,
ldsl.cargo_number AS cargoNumber,
ldsl.description_goods AS materialName,
ldsl.cargo_norms AS cargoNorms,
ldsl.cargo_unit AS cargoUnit,
ldsl.tray_name AS trayName,
ldsl.unpack AS unpack,
ldsl.source_type AS sourceType,
ldrs.stocklist_id AS stockListId,
ldrs.reservation_num AS planNum,
-- count(ldss.id ) AS realNum,
(SELECT COUNT(ldss.id) FROM logpm_distribution_stock AS ldss WHERE ldss.stock_list_id = ldsl.id ) AS realNum,
CASE
ldsl.source_type
WHEN 1 THEN
(
SELECT
group_concat( DISTINCT lwug.allocation_id ) AS allocations
FROM
logpm_distribution_stock_list ldslnew
LEFT JOIN logpm_distribution_parcel_list ldpl ON ldpl.order_code = ldslnew.incoming_batch
AND ldpl.material_id = ldslnew.material_id
AND ldpl.conditions = '2'
LEFT JOIN logpm_warehouse_updown_goods lwug ON lwug.association_value = ldpl.order_package_code
WHERE
ldslnew.id = ldsl.id
AND lwug.association_type = '3'
)
WHEN 2 THEN
(
SELECT
group_concat( DISTINCT lwug.allocation_id ) AS allocations
FROM
logpm_warehouse_updown_goods lwug
WHERE
lwug.association_id = ldsl.material_id
AND lwug.association_type = '4'
)
END AS allocations
FROM
logpm_distribution_reservation_stocklist ldrs
LEFT JOIN logpm_distribution_stock_list ldsl ON ldrs.stocklist_id = ldsl.id
WHERE
ldrs.reservation_id = #{reservationId} and ldrs.stocklist_id = #{stockListId}
</select>
</mapper>

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

@ -831,7 +831,7 @@
ldsl.cargo_number cargoNumber,
ldsl.description_goods descriptionGoods,
ldl.signfor_state signforState,
ldl.order_package_code coding,
ldl.order_package_code orderPackageCode,
lbm.specification specification,
lbm.logpm_unit logpmUnit
FROM

7
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.java

@ -111,4 +111,11 @@ public interface DistributionStockListMapper extends BaseMapper<DistributionStoc
List<DistributionStockListVO> getStockListInfo(@Param("par")DistributionStockListEntity distributionStockListEntity);
DistributionStockListEntity selectStockInforByOrderPackageCode(@Param("orderPackageCode") String orderPackageCode);
/**
* 扣减库存品对应的在库数量
* @param inventoryId
* @param loadedNub
*/
int deductionQuantityStock(@Param("stockListId") Long inventoryId,@Param("decreaseNum") Integer loadedNub);
}

5
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockListMapper.xml

@ -96,7 +96,7 @@
<select id="getStockListInfo" resultType="com.logpm.distribution.vo.DistributionStockListVO">
select ldsl.market_name marketName,ldsl.incoming_batch incomingBatch,ldsl.quantity_stock quantityStock,ldsl.warehouse_id warehouseId,
ldsl.description_goods descriptionGoods,ldsl.cargo_number cargoNumber,ldsl.market_id marketId,ldsl.material_id materialId,
ldsl.id id
ldsl.id id,ldsl.brand_name brandName
from logpm_distribution_stock_list ldsl
<where>
ldsl.warehouse_id = #{par.warehouseId} and ldsl.quantity_stock > 0 and ldsl.source_type = 2
@ -290,6 +290,9 @@
outbound_quantity = outbound_quantity + #{num}
where id = #{stockListId}
</update>
<update id="deductionQuantityStock">
UPDATE logpm_distribution_stock_list SET quantity_stock = (quantity_stock - #{decreaseNum}) , quantity_occupied = (quantity_occupied - #{decreaseNum}) , outbound_quantity = (outbound_quantity + #{decreaseNum}) WHERE id = #{stockListId}
</update>
<select id="getAllStockMall" resultType="com.logpm.distribution.vo.app.StockMallVO">
select ldsl.market_id marketId,

8
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java

@ -240,4 +240,12 @@ public interface IDistributionReservationService extends BaseService<Distributio
* @return
*/
List<DistributionReservationEntity> getRetentionReservationList(String reservationIds);
/**
* 查询预约计划下指定批次库存品信息
* @param reservationId
* @param id
* @return
*/
DistributionStockupStockListVO selectStockupStockListByStockListId(Long reservationId, Long id);
}

3
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java

@ -216,9 +216,10 @@ public interface IDistributionStockupService extends BaseService<DistributionSto
List<DistributionStockupTrayVO> getLocationMarketSelectionOrder(StockupDTO stockupDTO);
/**
* 查询备货人员
* @return
*/
List<User> getRoleList(String deptId, String tenantId);
List<User> getRoleList();
/**
* 修改备货任务的备货区

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

@ -486,6 +486,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
@Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
// synchronized
public R loadingscan(DistrilbutionloadingscanDTO distrilbutionloadingscanDTO) {
//查询该包件是否能够从库存品包件表中查到
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Objects.isNull(myCurrentWarehouse)) {
throw new CustomerException(403, "仓库信息不能为空");
@ -495,6 +497,19 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
// 属于该配送任务需要进行是否属于该客户进行判断
// 如果属于该客户则进行装车扫描
//
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(list)){
//满足条件此码必定为库存品
//判断该库存品是否属于当前客户
List<DisStockListDetailEntity> collect = list.stream().filter(l -> l.getReservationId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
if (Func.isNotEmpty(collect)){
return Resp.scanFail("请在库存品页面扫描此码", "请在库存品页面扫描此码");
}
return Resp.scanFail("此码不是订制品", "此码不是订制品");
}
//获取当前用户司机
DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distrilbutionloadingscanDTO.getDeliveryId());
//异步确认包条扫描信息
@ -559,20 +574,21 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadscanEntity.setScanUser(user.getNickName());
loadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId());
loadscanEntity.setIsAbnormalLoading(1);
loadscanEntity.setLoadedNub(parcelListEntity.getQuantity());
distributionLoadscanService.save(loadscanEntity);
//出库
warehouseUpdownTypeClient.downPackage(distrilbutionloadingscanDTO.getBarcode(), myCurrentWarehouse.getId());
// warehouseUpdownTypeClient.downPackageOrDelTray(parcelListEntity.getOrderPackageCode(),myCurrentWarehouse.getId());
//订单扣减在库数量
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity() - parcelListEntity.getQuantity());
distributionStockArticleService.updateById(stockArticleEntity);
// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId());
// stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity() - parcelListEntity.getQuantity());
// distributionStockArticleService.updateById(stockArticleEntity);
//查询本车次是否第一次扫码,没有则更新上车时间
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId());
//更新签收表的装车数量
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub());
//扣减订单的在库数量
Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
distributionLoadscanService.save(loadscanEntity);
//这里还需要一个维护状态的方法
//异步维护状态
// str.append("包件装车");
@ -594,7 +610,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
return R.fail(5000, "异常装车");
// return Resp.scanFail("装车失败","程序出错,请联系彪桑");
} else {
return Resp.scanFail("装车失败", "窜货");
if (parcelListEntity.getConditions() == 2){
return Resp.scanFail("此包件不是订制品", "此包件不是订制品");
}else {
return Resp.scanFail("装车失败", "窜货");
}
}
} else {
shangpeiFlag = reservationEntityList.stream().allMatch(r -> r.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue()));
@ -906,7 +927,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
loadingNum.getAndAdd(inventoryLoadingNum);
}
StringBuilder str = new StringBuilder();
str.append("装车").append(loadingNum.get() + "件");
str.append("装车").append(loadingNum.get() + "件");
if (abnormalLoadingNum.get() > 0) {
str.append("异常").append(abnormalLoadingNum.get() + "件");
}
@ -2093,15 +2114,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
//异步处理状态信息
distributionAsyncService.changeMarketDeliveryListStatus(distributionLoadscaninvnEntity.getOrderPackageCode(), distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId());
//处理出库问题
DistributionStockListEntity distributionStockListEntity = distributionStockListMapper.selectOne(Wrappers.<DistributionStockListEntity>query().lambda().eq(DistributionStockListEntity::getId, distributionLoadscaninvnEntity.getInventoryId()));
BigDecimal quantityStock = new BigDecimal(distributionStockListEntity.getQuantityStock());
BigDecimal loadedNub = new BigDecimal(distributionLoadscaninvnEntity.getLoadedNub());
int stockListQuantityStock = quantityStock.subtract(loadedNub).intValue();
int stockListOutboundQuantity = quantityStock.add(loadedNub).intValue();
distributionStockListEntity.setQuantityStock(stockListQuantityStock);
distributionStockListEntity.setQuantityOccupied(stockListOutboundQuantity);
distributionStockListEntity.setOutboundQuantity(stockListOutboundQuantity);
distributionStockListMapper.updateById(distributionStockListEntity);
//扣减出库数量
distributionStockListMapper.deductionQuantityStock(distributionLoadscaninvnEntity.getInventoryId(),distributionLoadscaninvnEntity.getLoadedNub());
// DistributionStockListEntity distributionStockListEntity = distributionStockListMapper.selectOne(Wrappers.<DistributionStockListEntity>query().lambda().eq(DistributionStockListEntity::getId, distributionLoadscaninvnEntity.getInventoryId()));
// BigDecimal quantityStock = new BigDecimal(distributionStockListEntity.getQuantityStock());
// BigDecimal loadedNub = new BigDecimal(distributionLoadscaninvnEntity.getLoadedNub());
// int stockListQuantityStock = quantityStock.subtract(loadedNub).intValue();
// int stockListOutboundQuantity = quantityStock.add(loadedNub).intValue();
// distributionStockListEntity.setQuantityStock(stockListQuantityStock);
// distributionStockListEntity.setQuantityOccupied(stockListOutboundQuantity);
// distributionStockListEntity.setOutboundQuantity(stockListOutboundQuantity);
// distributionStockListMapper.updateById(distributionStockListEntity);
} else {
return Resp.scanFail("窜货", "窜货");
}

25
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionReservationServiceImpl.java

@ -36,7 +36,9 @@ import com.logpm.distribution.vo.*;
import com.logpm.distribution.wrapper.*;
import com.logpm.oldproject.entity.WayBillEntity;
import com.logpm.oldproject.feign.IWayBillClient;
import com.logpm.warehouse.entity.WarehouseGoodsAllocationEntity;
import com.logpm.warehouse.entity.WarehouseWaybillEntity;
import com.logpm.warehouse.feign.IWarehouseGoodsAllocationClient;
import com.logpm.warehouse.feign.IWarehouseWaybillClient;
import lombok.extern.slf4j.Slf4j;
import org.springblade.common.constant.DictBizConstant;
@ -188,6 +190,9 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
@Autowired
private IDistributionParcelNumberService distributionParcelNumberService;
@Autowired
private IWarehouseGoodsAllocationClient warehouseGoodsAllocationClient;
// @Autowired
// private IWarehouseWaybillClient warehouseWaybillClient;
@ -3233,4 +3238,24 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl<Distribu
List<DistributionReservationEntity> retentionReservationList = baseMapper.getRetentionReservationList(ids);
return retentionReservationList;
}
@Override
public DistributionStockupStockListVO selectStockupStockListByStockListId(Long reservationId, Long id) {
DistributionStockupStockListVO distributionStockupStockListVO = baseMapper.selectStockupStockListByStockListId(reservationId, id);
if (Func.isBlank(distributionStockupStockListVO.getAllocations())){
String[] ids = distributionStockupStockListVO.getAllocations().split(",");
List<WarehouseGoodsAllocationEntity> allocationInforByIds = warehouseGoodsAllocationClient.getAllocationInforByIds(ids);
for (WarehouseGoodsAllocationEntity allocationInforById : allocationInforByIds) {
if (distributionStockupStockListVO.getAllocationList() == null) {
distributionStockupStockListVO.setAllocationList(new ArrayList<>());
}
Map<String, Object> map = new HashMap<>();
map.put("id", allocationInforById.getId());
map.put("name", allocationInforById.getQrCode());
distributionStockupStockListVO.getAllocationList().add(map);
}
}
return distributionStockupStockListVO;
}
}

57
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java

@ -122,6 +122,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
private final DistributionReservationMapper distributionReservationMapper;
private final IDisStockListDetailService disStockListDetailService;
private final IDistributionStockListService distributionStockListService;
private final DistributionStockListMapper distributionStockListMapper;
private final DistributionAddvalueMapper distributionAddvalueMapper;
private final IDistributionAddvalueService distributionAddvalueService;
private final IDistributionAddvaluePackageService distributionAddvaluePackageService;
@ -295,6 +296,21 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
if (Objects.isNull(myCurrentWarehouse)) {
throw new CustomerException(403, "仓库信息不能为空");
}
List<DisStockListDetailEntity> list = disStockListDetailService.list(Wrappers.<DisStockListDetailEntity>query().lambda()
.eq(DisStockListDetailEntity::getStockPackageCode, distrilbutionloadingscanDTO.getBarcode())
.ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue())
);
if (Func.isNotEmpty(list)){
//满足条件此码必定为库存品
//判断该库存品是否属于当前客户
List<DisStockListDetailEntity> collect = list.stream().filter(l -> l.getReservationId().equals(distrilbutionloadingscanDTO.getReservationId())).collect(Collectors.toList());
if (Func.isNotEmpty(collect)){
return Resp.scanFail("请在库存品页面扫描此码", "请在库存品页面扫描此码");
}
return Resp.scanFail("此码不是订制品", "此码不是订制品");
}
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
//查询该客户是否存在该包件信息
List<DistributionParcelListEntity> collect = parcelListEntityList.stream().filter(p -> p.getOrderPackageCode().equals(distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList());
@ -389,7 +405,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
//更新签收人
Integer m = distributionSignforMapper.updateSignUser(distributionLoadscanEntity.getDeliveryId(), distributionLoadscanEntity.getReservationId(),AuthUtil.getUser());
//扣减订单的在库数量
Integer k = distributionStockArticleMapper.deductionHandQuantity(loadscanEntity.getOrderId(), loadscanEntity.getLoadedNub());
Integer k = distributionStockArticleMapper.deductionHandQuantity(distributionLoadscanEntity.getOrderId(), distributionLoadscanEntity.getLoadedNub());
warehouseUpdownTypeClient.downPackageOrDelTray(collect.get(0).getOrderPackageCode(), myCurrentWarehouse.getId());
distributionAsyncService.checkSignStatus(distributionLoadscanEntity.getPackageId(),distributionLoadscanEntity.getReservationId(),distributionLoadscanEntity.getDeliveryId());
}
@ -397,6 +413,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
} else if (Func.isEmpty(collect)) {
//这里就需要对该包件信息是否属于该配送计划进行判定。如果属于该配送计划则是串货。不是那么则需要提示是否异常签收或者返回的操作
//查询配送计划中是否存在该包件
DistributionParcelListEntity one = distributionParcelListService.getOne(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())
.eq(DistributionParcelListEntity::getWarehouseId, myCurrentWarehouse.getId())
);
if (Func.isNotEmpty(one) && one.getConditions() == 2){
log.error("#####################此包件不是定制品", one.getConditions());
return Resp.scanFail("此包件不是定制品", "此包件不是定制品");
}
List<DistributionParcelListEntity> parcelListEntities = distributionDeliveryListMapper.selectPackageListByDeliveryListId(distrilbutionloadingscanDTO.getDeliveryId());
//该货物是否属于该计划
List<DistributionParcelListEntity> distributionParcelListEntities = parcelListEntities.stream().filter(p -> p.getOrderPackageCode().equals(distrilbutionloadingscanDTO.getBarcode())).collect(Collectors.toList());
@ -942,6 +966,18 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 1、查询配送任务是否存在库存品 ---- > 没有 此码无效
// 2、查询该客户是否存在满足的库存品 --- 没有 查看是否存在计划 窜货
// 3、是否异常签收
//判断扫码是否是包件
List<DistributionParcelListEntity> parcelListEntities = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
if (Func.isNotEmpty(parcelListEntities)){
boolean isHave = parcelListEntities.stream().map(DistributionParcelListEntity::getOrderPackageCode).anyMatch(c -> c.contains(distrilbutionloadingscanDTO.getBarcode()));
if (Func.isNotEmpty(isHave)){
return Resp.scanFail("请在订制品页面扫描此码", "请在订制品页面扫描此码");
}else {
return Resp.scanFail("扫描错误", "未知二维码");
}
}
List<DisStockListDetailEntity> detailEntities = distributionReservationMapper.selectInventoryListByReservation(distrilbutionloadingscanDTO.getReservationId());
if (Func.isEmpty(detailEntities)) {
return Resp.scanFail("此码无效", "此码无效");
@ -965,6 +1001,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
// 库存品进行装车,这里需要对库存品扫描数据进行签收的状态标记
loadscaninvnEntity.setSigningUserId(user.getUserId());
loadscaninvnEntity.setSigningUser(user.getUserName());
loadscaninvnEntity.setReceivedQuantity(inventory.get(0).getNum());
loadscaninvnEntity.setSignforState(LoadScanSigningStatusConstant.yiqianshou.getValue());
loadscaninvnEntity.setSigningTime(simpleDateFormat.format(new Date()));
loadscaninvnEntity.setOneQclick(1);
@ -1028,14 +1065,15 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
Integer j = distributionSignforMapper.updateSignforNum(distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId(), distributionLoadscaninvnEntity.getPackageNub());
//更新签收人
Integer i = distributionSignforMapper.updateSignUser(distributionLoadscaninvnEntity.getDeliveryId(), distributionLoadscaninvnEntity.getReservationId(), AuthUtil.getUser());
//扣减库存
DistributionStockListEntity stockListEntity = distributionStockListService.getById(inventory.get(0).getStockListId());
stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - distributionLoadscaninvnEntity.getPackageNub());
stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - distributionLoadscaninvnEntity.getPackageNub());
stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + distributionLoadscaninvnEntity.getPackageNub());
distributionStockListService.updateById(stockListEntity);
distributionAsyncService.checkSignStatus(null, distributionLoadscaninvnEntity.getReservationId(),distributionLoadscaninvnEntity.getDeliveryId());
distributionStockListMapper.deductionQuantityStock(distributionLoadscaninvnEntity.getInventoryId(),distributionLoadscaninvnEntity.getLoadedNub());
// //扣减库存
// DistributionStockListEntity stockListEntity = distributionStockListService.getById(inventory.get(0).getStockListId());
// stockListEntity.setQuantityOccupied(stockListEntity.getQuantityOccupied() - distributionLoadscaninvnEntity.getPackageNub());
// stockListEntity.setQuantityStock(stockListEntity.getQuantityStock() - distributionLoadscaninvnEntity.getPackageNub());
// stockListEntity.setOutboundQuantity(stockListEntity.getOutboundQuantity() + distributionLoadscaninvnEntity.getPackageNub());
// distributionStockListService.updateById(stockListEntity);
// distributionAsyncService.checkSignStatus(null, distributionLoadscaninvnEntity.getReservationId(),distributionLoadscaninvnEntity.getDeliveryId());
}
} else if (inventory.size() == 0) {
@ -1060,7 +1098,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl<Distribution
return Resp.scanFail("操作失败", "操作失败");
}
distributionAsyncService.checkDeliverySignStatus(distrilbutionloadingscanDTO.getBarcode(), distrilbutionloadingscanDTO.getDeliveryId());
return Resp.scanSuccess("签收成功", "签收成功");
String str = checkSignNum(distrilbutionloadingscanDTO);
return Resp.scanSuccess("签收成功", str);
// List<DistributionLoadscaninvnEntity> distributionLoadscaninvnEntities = distributionLoadscaninvnMapper.selectList(new QueryWrapper<DistributionLoadscaninvnEntity>().lambda()

37
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java

@ -1693,7 +1693,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
throw new CustomerException(405, "包条数量与预约数量不正确");
}
} else {
//通过预约单id和订单
//通过预约单id和库存品ID 查询预约数量
Integer num = distributionReservationService.getReservationNumByReservationIdAndStockListId(reservationId, stockListId);
if (packageNum.compareTo(num) > 0) {
log.warn("###################createPackageCode: 包条数量与预约数量不正确");
@ -2220,6 +2220,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DisStockOrdercodeRecoEntity ordercodeRecoEntity = new DisStockOrdercodeRecoEntity();
DisStockOrdercodeRecoEntity one = disStockOrdercodeRecoService.getOne(Wrappers.<DisStockOrdercodeRecoEntity>query().lambda()
.eq(DisStockOrdercodeRecoEntity::getCode, stockupDTO.getPacketBarCode())
.eq(DisStockOrdercodeRecoEntity::getIsDeleted, 0)
);
if (ObjectUtils.isNotNull(one) && one.getCodeStatus().equals("1")) {
return 8;
@ -2317,20 +2318,26 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
* @return
*/
@Override
public List<User> getRoleList(String deptId, String tenantId) {
public List<User> getRoleList() {
//获取当前登录用户
BladeUser user = AuthUtil.getUser();
String tenantId = user.getTenantId();
// String deptId = user.getDeptId();
//查询备货岗位
List<DictBiz> warehouseType = DictBizCache.getList("stock_personnel");
if (warehouseType.isEmpty()) {
throw new ServiceException("注意,注意!拣货人员字典未配置!请配置!");
} else {
List<String> stringList = new ArrayList<>();
warehouseType.stream().forEach(i -> {
//查询这个角色ID
R<String> roleId = sysClient.getRoleIds(tenantId, i.getDictValue());
if (ObjectUtils.isNotNull(roleId.getData())) {
stringList.add(roleId.getData());
}
});
String roleIds = stringList.stream().collect(Collectors.joining(","));
R<List<User>> listR = userSearchClient.listByRole(roleIds);
R<List<User>> listR = userSearchClient.listByRole(roleIds); //查询角色下的所有人员数据
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
//有没有选择仓库信息
if (ObjectUtils.isNotNull(myCurrentWarehouse)) {
@ -2926,6 +2933,10 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
*/
@Override
public R handlingPackages(StockupDTO stockupDTO) {
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if (Func.isEmpty(myCurrentWarehouse)){
return R.data(403,"未授权!!!");
}
//查询包件是不是属于该货位
WarehouseUpdownGoodsEntity warehouseUpdownGoods = new WarehouseUpdownGoodsEntity();
warehouseUpdownGoods.setAllocationId(stockupDTO.getAllocationId());
@ -2944,7 +2955,8 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
DistributionStockListEntity distributionStockListEntity = distributionStockListMapper.selectOne(Wrappers.<DistributionStockListEntity>query().lambda()
.eq(DistributionStockListEntity::getIncomingBatch, byId.getOrderCode())
.eq(DistributionStockListEntity::getWarehouseId,stockupDTO.getWarehouseId())
.eq(DistributionStockListEntity::getWarehouseId,myCurrentWarehouse.getId())
.eq(DistributionStockListEntity::getCargoNumber,stockupDTO.getCargoNumber())
);
if(ObjectUtils.isNull(distributionStockListEntity)){
return R.fail("该包件不是库存品!");
@ -2959,13 +2971,13 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
}
Optional<DistributionReservationStocklistEntity> first = list.stream().filter(i -> i.getStocklistId().equals(distributionStockListEntity.getId())).findFirst();
if(first.isPresent()){
if(!first.isPresent()){
//没有一样的库存品数据
return R.fail("没有一样的库存品数据");
}
//判断数量是否可以直接备货
DistributionReservationStocklistEntity reservationStocklistEntity1 = first.get();
if(reservationStocklistEntity1.getRealityNum() > reservationStocklistEntity1.getReservationNum()){
if(reservationStocklistEntity1.getRealityNum() < reservationStocklistEntity1.getReservationNum()){
return R.success("可以直接备货!");
}
List<DistributionReservationStocklistEntity> keYi = new ArrayList<>(); //可以操作的库存品
@ -2974,7 +2986,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
DistributionStockListEntity distributionStockListEntity1 = distributionStockListMapper.selectById(i.getStocklistId());
if(distributionStockListEntity1.getDescriptionGoods().equals(distributionStockListEntity.getDescriptionGoods())
&& distributionStockListEntity1.getCargoNumber().equals(distributionStockListEntity.getCargoNumber())
&& i.getRealityNum() > i.getReservationNum() ){
&& i.getRealityNum() < i.getReservationNum() ){
keYi.add(i);
}
});
@ -2990,7 +3002,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
);
//修改可以修改的库存平
Optional<DistributionReservationStocklistEntity> collect2 = keYi.stream().filter(i -> i.getStocklistId().equals(distributionStockListEntities.get(0).getId())).findFirst();
if(!collect2.isPresent()){
if(collect2.isPresent()){
DistributionReservationStocklistEntity distributionReservationStocklistEntity = collect2.get();
Integer reservationNum = distributionReservationStocklistEntity.getReservationNum() - 1;
@ -3033,9 +3045,16 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl<Distribution
//回复冻结数量
DistributionStockListEntity distributionStockList = new DistributionStockListEntity();
distributionStockList.setId(distributionReservationStocklistEntity.getStocklistId());
distributionStockList.setQuantityStock(distributionStockListEntity.getQuantityStock() + 1);
distributionStockList.setQuantityOccupied(distributionStockListEntity.getQuantityOccupied() -1);
distributionStockListMapper.updateById(distributionStockList);
//扣减新添加库存品数
DistributionStockListEntity newDistributionStockList = new DistributionStockListEntity();
newDistributionStockList.setId(reservationStocklistEntity1.getStocklistId());
newDistributionStockList.setQuantityOccupied(distributionStockListEntity.getQuantityOccupied() + 1);
distributionStockListMapper.updateById(newDistributionStockList);
}
return R.success("成功!!");
}

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionDisStockListWrapper.java

@ -26,7 +26,7 @@ public class DistributionDisStockListWrapper extends BaseEntityWrapper<DisStockL
public DisStockListDetailVO entityVO(DisStockListDetailEntity entity) {
DisStockListDetailVO disStockListDetailVO = Objects.requireNonNull(BeanUtil.copy(entity, DisStockListDetailVO.class));
disStockListDetailVO.setLoadingStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_LOADING_STATUS, entity.getStockLockingStatus()));
disStockListDetailVO.setSigningStatusName(DictBizCache.getValue(DictBizConstant.ORDER_PACKAGE_STOCKUP_STATUS, entity.getStockLockingStatus()));
// disStockListDetailVO.setSigningStatusName(DictBizCache.getValue(DictBizConstant.OPS, entity.getStockSignfoStatus()));
return disStockListDetailVO;
}
}

34
blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/service/impl/OuPaiFactoryServiceImpl.java

@ -24,10 +24,12 @@ import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.io.IOUtils;
import org.jetbrains.annotations.NotNull;
import org.springblade.common.constant.RabbitConstant;
import org.springblade.common.constant.RedisKeyConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.common.utils.FileLogsUtil;
import org.springblade.core.oss.model.BladeFile;
import org.springblade.core.redis.cache.BladeRedis;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.StringUtil;
import org.springblade.resource.feign.IOssClient;
@ -85,6 +87,9 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
@Autowired
private IOpPackagePushLogService opPackagePushLogService;
@Autowired
private BladeRedis bladeRedis;
@Override
public String saveOuPaiFactoryOrderDTOByCarCarNumber(String code) {
@ -288,11 +293,20 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
public Boolean checkReceivingOrder(String code) {
Boolean isUpdate = false;
String o = bladeRedis.get(RedisKeyConstant.cache_oupai_key + code);
if(code.equals(o)){
return true;
}
LambdaQueryWrapper<ReceivingOrderEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ReceivingOrderEntity::getCode, code);
List<ReceivingOrderEntity> receivingOrderEntities = receivingOrderMapper.selectList(lambdaQueryWrapper);
if (ObjectUtils.isNotNull(receivingOrderEntities)) {
isUpdate = true;
// 加入缓存
bladeRedis.setEx(RedisKeyConstant.cache_oupai_key+code,code,60*60*60L);
}
return isUpdate;
}
@ -631,6 +645,17 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
//新发车单数据
ReceivingOrderEntity receivingOrderEntity = new ReceivingOrderEntity();
receivingOrderEntity.setCode(code);
LambdaQueryWrapper<ReceivingOrderEntity> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ReceivingOrderEntity::getCode,code);
List<ReceivingOrderEntity> receivingOrderEntities = receivingOrderMapper.selectList(lambdaQueryWrapper);
if(ObjectUtils.isNotNull(receivingOrderEntities)){
log.info(">>>>>>>>>>>>>>>>>>>>>>> 收货单已存在 {} ",code);
return ;
}
String type = valueObject.getString("Type");
if ("中转".equals(type)) {
receivingOrderEntity.setType(1);
@ -796,6 +821,12 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
factoryOrderEntity.setReceiptStatus(0);
factoryOrderEntity.setPushStatus(0);
factoryOrderEntity.setTurnStatus(0);
//
boolean save = factoryOrderService.save(factoryOrderEntity);
if (!save) {
log.warn("############handleData: 保存订单失败 selfCode={}", selfCode);
@ -807,7 +838,10 @@ public class OuPaiFactoryServiceImpl implements IOuPaiFactoryService {
String packageCode = packageEntity.getString("Code");
QueryWrapper<FactoryPackageEntity> packageEntityQueryWrapper = new QueryWrapper<>();
packageEntityQueryWrapper.eq("code", packageCode);
FactoryPackageEntity factoryPackageEntity = factoryPackageService.getOne(packageEntityQueryWrapper);
if (Objects.isNull(factoryPackageEntity)) {
factoryPackageEntity = new FactoryPackageEntity();
factoryPackageEntity.setOrderId(orderId);

62
blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java

@ -518,6 +518,10 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
logger.warn("#################handleDataToPlatform: 保存订单信息失败 orderSelfNum={}", orderSelfNum);
throw new CustomerException(405, "保存订单信息失败");
}
}else{
distributionStockArticleEntity.setTotalNumber(total);
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
}
//保存包件信息
@ -532,27 +536,27 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
// logger.error("################handleDataToPlatform: unitNo={} 打托失败",unitNo);
// }
String waybillNumber = distributionStockArticleEntity.getWaybillNumber();
if(!waybillNumber.contains(waybillNoNum)){
waybillNumber = waybillNumber+","+waybillNoNum;
}
distributionStockArticleEntity.setWaybillNumber(waybillNumber);
// 修改入库状态
distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity() +1);
String orderStatus = checkDistributionStockArticleOrderStatus(distributionStockArticleEntity);
distributionStockArticleEntity.setOrderStatus(orderStatus);
// 修改收货
if(distributionStockArticleEntity.getOrderStatus().equals(OrderStatusConstant.ruku.getValue())){
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
// 更新齐套状态
// todo 这里需要多仓齐套的查询条件
distributionStockArticleEntity.setCompleteSet(1);
}
// 修改最新的入库时间
distributionStockArticleEntity.setWarehouseEntryTimeEnd(new Date());
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
// String waybillNumber = distributionStockArticleEntity.getWaybillNumber();
// if(!waybillNumber.contains(waybillNoNum)){
// waybillNumber = waybillNumber+","+waybillNoNum;
// }
// distributionStockArticleEntity.setWaybillNumber(waybillNumber);
//
// // 修改入库状态
// distributionStockArticleEntity.setHandQuantity(distributionStockArticleEntity.getHandQuantity() +1);
// String orderStatus = checkDistributionStockArticleOrderStatus(distributionStockArticleEntity);
// distributionStockArticleEntity.setOrderStatus(orderStatus);
//
// // 修改收货
// if(distributionStockArticleEntity.getOrderStatus().equals(OrderStatusConstant.ruku.getValue())){
// distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
// // 更新齐套状态
// // todo 这里需要多仓齐套的查询条件
// distributionStockArticleEntity.setCompleteSet(1);
// }
// // 修改最新的入库时间
// distributionStockArticleEntity.setWarehouseEntryTimeEnd(new Date());
// distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
// 包件保存成功去修改订单的数量
// distributionStockArticleClient.addHandQuantity(id, 1);
@ -732,6 +736,22 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService {
if (!b) {
logger.warn("#################handleDataToPlatform: 保存包件信息失败 orderCode={}", entity.getOrderCode());
throw new CustomerException(405, "保存包件信息失败");
}else{
logger.info("################handleDataToPlatform: 保存包件成功 OrderPackageCode={}",vo.getPacketBarCode());
Integer handQuantity = distributionStockArticleEntity.getHandQuantity();
Integer totalNumber = distributionStockArticleEntity.getTotalNumber();
if(handQuantity+1 >= totalNumber){
distributionStockArticleEntity.setCompleteSet(1);
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.yishouhuo.getValue());
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue());
}else{
distributionStockArticleEntity.setCompleteSet(0);
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.bufenshouhuo.getValue());
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
}
distributionStockArticleEntity.setHandQuantity(handQuantity + 1);
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
}
}
}

2
blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/mapper/LocationMapper.xml

@ -5,7 +5,7 @@
<select id="getStoreyAndRowByShelfId" resultType="java.util.Map">
select max(l.floor) storey,
max(l.`row`) row
max(l.`row`) `row`
from ht_location l
where l.shelf_id = #{shelfId}
and l.delete_time = 0

7
blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncWarehouseData.java

@ -109,8 +109,11 @@ public class SyncWarehouseData {
goodsShelfEntity.setWarehouseCode(warehouseEntity.getWarehouseCode());
goodsShelfEntity.setGoodsShelfStatus(2);
goodsShelfEntity.setEnableStatus(shelfIsEmptyMap.get(shelfEntity.getStatus()));
goodsShelfEntity.setStoreyNum(storeyAndRow.get("storey"));
goodsShelfEntity.setRowNum(storeyAndRow.get("row"));
if(!Objects.isNull(storeyAndRow)){
goodsShelfEntity.setStoreyNum(storeyAndRow.get("storey"));
goodsShelfEntity.setRowNum(storeyAndRow.get("row"));
}
goodsShelfEntity.setRemarks("");
goodsShelfEntity.setOldId(oldShelfId);
Long newShelfId = basicdataGoodsShelfClient.addShelf(goodsShelfEntity);

10
blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SyncOrderInfoServiceImpl.java

@ -1334,6 +1334,8 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
}
}else{
id = distributionStockArticleEntity.getId();
distributionStockArticleEntity.setTotalNumber(total);
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
}
//保存包件信息
@ -1373,6 +1375,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
DistributionParcelListEntity entity = new DistributionParcelListEntity();
BeanUtil.copyProperties(vo, entity);
entity.setQuantity(1);
entity.setOrderPackageCode(vo.getPacketBarCode());
entity.setConditions(1);
entity.setWarehouse(distributionStockArticleEntity.getWarehouse());
@ -1386,9 +1389,9 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
// if(3==carsType||4 == carsType){
// entity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue());
// }
if(2 == signState){
entity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
}
// if(2 == signState){
// entity.setOrderPackageStatus(OrderPackageStatusConstant.yiqianshou.getValue());
// }
entity.setOrderPackageFreezeStatus(OrderPackageFreezeStatusConstant.weidongjie.getValue());
entity.setOrderPackageReservationStatus(OrderPackageReservationStatusConstant.daiyuyue.getValue());
entity.setOrderPackageGroundingStatus(OrderPackageGroundingStatusConstant.daishangjia.getValue());
@ -1445,6 +1448,7 @@ public class SyncOrderInfoServiceImpl implements ISyncOrderInfoService {
distributionStockArticleEntity.setOrderReceiveStatus(OrderReceiveStatusConstant.bufenshouhuo.getValue());
distributionStockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue());
}
distributionStockArticleEntity.setHandQuantity(handQuantity + 1);
distributionStockArticleClient.saveOrUpdate(distributionStockArticleEntity);
}

23
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java

@ -31,6 +31,7 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import lombok.AllArgsConstructor;
import javax.validation.Valid;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
@ -63,6 +64,7 @@ import javax.servlet.http.HttpServletResponse;
@AllArgsConstructor
@RequestMapping("blade-taskQuest/taskQuest")
@Api(value = "盘点任务", tags = "盘点任务接口")
@Slf4j
public class TaskQuestController extends BladeController {
private final ITaskQuestService taskQuestService;
@ -79,6 +81,19 @@ public class TaskQuestController extends BladeController {
}
/**
* 盘点任务 到时间結束盘点任务
*/
@GetMapping("/finishTask")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "详情", notes = "传入taskQuest")
public void finishTask() {
log.info("查询盘点任务!!");
taskQuestService.getFinishTask();
}
/**
* 盘点任务 任务下的包条
@ -136,7 +151,7 @@ public class TaskQuestController extends BladeController {
/**
* 查询盘点明细数据
* 盘点任务 查询盘点明细数据
* @return
*/
@GetMapping("/getDetailInfo")
@ -148,7 +163,7 @@ public class TaskQuestController extends BladeController {
}
/**
* 查询盘点对比数据
*盘点任务 查询盘点对比数据
* @return
*/
@GetMapping("/getContrastInfo")
@ -161,7 +176,7 @@ public class TaskQuestController extends BladeController {
/**
* 查询盘点对比数据
* 导出数据 查询盘点对比数据
* @return
*/
@GetMapping("/export-getContrastInfo")
@ -250,7 +265,7 @@ public class TaskQuestController extends BladeController {
}
/**
* 盘点任务 修改
* 盘点任务 实体 修改
*/
@PostMapping("/updateInfo")
@ApiOperationSupport(order = 5)

5
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/QuestDetailDTO.java

@ -49,6 +49,11 @@ public class QuestDetailDTO extends QuestDetailEntity {
private String cargoName;//盘点的包件状态名称
private String startTime;// 开始时间
private String endTime;// 结束时间
}

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java

@ -122,7 +122,7 @@ public class TaskSearchDTO {
/**
* 在库盘点包件
*/
private List<String> questDetailIds;
private List<Long> questDetailIds;
/**
* 当前仓库id

10
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java

@ -104,6 +104,14 @@ public interface TaskQuestMapper extends BaseMapper<TaskQuestEntity> {
* @return
*/
List<QuestDetailEntity> selectTaskInfo(@Param("questNum")String questNum,@Param("param") QuestDetailEntity questDetail);
/**
*查询盘点数据list
* @param questNum
* @param questDetail
* @return
*/
List<QuestDetailEntity> selectTaskInfoForIds(@Param("questNum")String questNum,@Param("param") QuestDetailEntity questDetail,@Param("ids")List<Long> ids);
/**
*根据ID查询盘点数据
* @param questNum
@ -160,5 +168,5 @@ public interface TaskQuestMapper extends BaseMapper<TaskQuestEntity> {
*/
List<QuestContrastVO> selectContrastDataInfo(@Param("questNum")String questNum,@Param("param")QuestDetailEntity questDetail);
Integer deleteQuestChild(@Param("questNum")String questNum, @Param("questDetailId")String i);
Integer deleteQuestChild(@Param("questNum")String questNum, @Param("questDetailId")Long i);
}

45
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml

@ -118,6 +118,11 @@
`incoming_batch` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批次号(库存品)',
`material_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '物料名称(库存品)',
`waybill_number` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '运单号',
`send_warehouse_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发站仓名称',
`tray_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '托盘名称',
`brand_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '品牌名称',
`inventory_time` datetime(0) NULL DEFAULT NULL COMMENT '盘点时间',
`inventory_user` bigint(20) NULL DEFAULT NULL COMMENT '盘点人',
PRIMARY KEY (`id`) USING BTREE,
INDEX `quest_id_index`(`quest_id`,`tenant_id`) USING BTREE COMMENT '任务id',
INDEX `order_id_index`(`order_id`) USING BTREE COMMENT '订单id',
@ -133,14 +138,14 @@
`is_deleted`, `status`, `reserve1`, `reserve2`, `reserve3`, `reserve4`, `reserve5`, `order_code`, `quest_id`, `order_id`, `quest_type`, `quest_target`,
`order_package_code`, `order_package_id`, `category_name`, `stock_id`, `quest_status`, `stock_num`, `warehouse_id`, `position_code`, `tray_code`, `tray_id`,
`allocation_id`, `grounding_allocation_id`, `is_new`, `grounding_position_code`, `material_code`, `market_name`, `firsts`, `second`,
`third_product`, `incoming_batch`, `material_name`, `waybill_number`) VALUES
`third_product`, `incoming_batch`, `material_name`, `waybill_number`,`send_warehouse_name`,`tray_name`,`brand_name`) VALUES
<foreach collection="list" item="item" separator=",">
(#{item.id}, #{item.tenantId}, #{item.createUser}, #{item.createTime}, #{item.updateUser}, #{item.updateTime}, #{item.createDept}, #{item.isDeleted}
, #{item.status}, #{item.reserve1}, #{item.reserve2}, #{item.reserve3}, #{item.reserve4}, #{item.reserve5}, #{item.orderCode}, #{item.questId}, #{item.orderId}
, #{item.questType}, #{item.questTarget}, #{item.orderPackageCode}, #{item.orderPackageId}, #{item.categoryName}, #{item.stockId}, #{item.questStatus},
#{item.stockNum}, #{item.warehouseId} , #{item.positionCode}, #{item.trayCode}, #{item.trayId}, #{item.allocationId}, #{item.groundingAllocationId},
#{item.isNew}, #{item.groundingPositionCode}, #{item.materialCode}, #{item.marketName} , #{item.firsts} , #{item.second} ,
#{item.thirdProduct} , #{item.incomingBatch}, #{item.materialName}, #{item.waybillNumber}
#{item.thirdProduct} , #{item.incomingBatch}, #{item.materialName}, #{item.waybillNumber}, #{item.sendWarehouseName},#{item.trayName},#{item.brandName}
)
</foreach>
@ -161,6 +166,30 @@
<if test="param.code != null and param.code!= '' ">and CONCAT(order_package_code, order_code) like concat('%',#{param.code},'%')</if>
</where>
</select>
<select id="selectTaskInfoForIds" resultType="com.logpm.warehouse.entity.QuestDetailEntity">
select *
from ${questNum}
<where>
is_deleted = 0
<if test="ids !=null">
and id in
<foreach collection="ids" item="a" open="(" close=")" separator=",">
#{a}
</foreach>
</if>
<if test="param.questId != null and param.questId != ''">and quest_id =#{param.questId } </if>
<if test="param.questType != null and param.questType != ''">and quest_type =#{param.questType } </if>
<if test="param.questTarget != null and param.questTarget != ''">and quest_target =#{param.questTarget } </if>
<if test="param.warehouseId != null and param.warehouseId != ''">and warehouse_id =#{param.warehouseId } </if>
<if test="param.allocationId != null and param.allocationId != ''">and allocation_id =#{param.allocationId } </if>
<if test="param.trayId != null and param.trayId != ''">and tray_id =#{param.trayId } </if>
<if test="param.orderCode != null and param.orderCode != ''">and order_code =#{param.orderCode } </if>
<if test="param.orderPackageCode != null and param.orderPackageCode != ''">and order_package_code =#{param.orderPackageCode } </if>
<if test="param.code != null and param.code!= '' ">and CONCAT(order_package_code, order_code) like concat('%',#{param.code},'%')</if>
</where>
</select>
<select id="selectOneTaskInfo" resultType="com.logpm.warehouse.entity.QuestDetailEntity">
select *
from ${questNum}
@ -210,12 +239,18 @@
<if test="param.warehouseId != null and param.warehouseId != ''">and warehouse_id =#{param.warehouseId } </if>
<if test="param.allocationId != null and param.allocationId != ''">and allocation_id =#{param.allocationId } </if>
<if test="param.trayId != null and param.trayId != ''">and tray_id =#{param.trayId } </if>
<if test="param.orderCode != null and param.orderCode != ''">and order_code like concat('%'#{param.orderCode },'%') </if>
<if test="param.categoryName != null and param.categoryName != ''">and category_name like concat('%'#{param.categoryName },'%') </if>
<if test="param.orderCode != null and param.orderCode != ''">and order_code like concat('%',#{param.orderCode },'%') </if>
<if test="param.categoryName != null and param.categoryName != ''">and category_name like concat('%',#{param.categoryName },'%') </if>
<if test="param.materialCode != null and param.materialCode != ''">and material_code like concat('%',#{param.materialCode },'%') </if>
<if test="param.trayCode != null and param.trayCode != ''">and tray_code like concat('%',#{param.trayCode },'%') </if>
<if test="param.trayName != null and param.trayName != ''">and tray_name like concat('%',#{param.trayName },'%') </if>
<if test="param.brandName != null and param.brandName != ''">and brand_name like concat('%',#{param.brandName },'%') </if>
<if test="param.marketName != null and param.marketName != ''">and market_name like concat('%',#{param.marketName},'%') </if>
<if test="param.materialName != null and param.materialName != ''">and material_name like concat('%',#{param.materialName},'%') </if>
<if test="param.positionCode != null and param.positionCode != ''">and position_code like concat('%',#{param.positionCode},'%') </if>
<if test="param.orderPackageCode != null and param.orderPackageCode != ''">and order_package_code =#{param.orderPackageCode } </if>
<if test="param.inventoryUser != null and param.inventoryUser != ''">and inventory_user like concat('%',#{param.inventoryUser },'%') </if>
<if test="param.startTime != null and param.startTime != ''"> and inventory_time BETWEEN #{param.startTime } and #{param.endTime}</if>
<if test="param.marketNames != null">
and material_name in
<foreach collection="param.marketNames" item="a" open="(" close=")" separator=",">
@ -280,6 +315,8 @@
<if test="item.allocationId != null and item.allocationId != null">allocation_id = #{item.allocationId },</if>
<if test="item.updateUser != null and item.updateUser != null">update_user = #{item.updateUser },</if>
<if test="item.updateTime != null and item.updateTime != null">update_time = #{item.updateTime },</if>
<if test="item.inventoryUser != null and item.inventoryUser != null">inventory_user = #{item.inventoryUser },</if>
<if test="item.inventoryTime != null ">inventory_time = #{item.inventoryTime }, </if>
<!-- <if test="item. != null and item. != null"> = #{item. }</if>
<if test="item. != null and item. != null"> = #{item. }</if>
<if test="item. != null and item. != null"> = #{item. }</if>

6
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java

@ -269,4 +269,10 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
* @return
*/
List<QuestContrastExcel> exportGetContrastInfo(QuestDetailDTO questDetailDTO);
/**
* 查询盘点任务是否结束
* @param id
*/
void getFinishTask();
}

285
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

@ -63,6 +63,7 @@ import org.springblade.system.feign.IUserSearchClient;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
@ -177,6 +178,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
BladeUser user = AuthUtil.getUser();
if(!parcelListInfo.isEmpty()){
List<QuestDetailEntity> detailEntityList = new ArrayList<>();
//查询查询托盘名称
List<BasicdataTrayEntity> trayEntityList = basicdataTrayClient.getTrayEntityList();
parcelListInfo.forEach( i ->{
QuestDetailEntity detailEntity = new QuestDetailEntity();
@ -190,8 +193,20 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
detailEntity.setQuestId(taskQuest);
detailEntity.setOrderCode(i.getOrderCode());
detailEntity.setOrderId(i.getStockArticleId());
detailEntity.setSendWarehouseName(i.getSendWarehouseName());
detailEntity.setBrandName(i.getBrandName());
// detailEntity.setQuestType();
//盘点对象;1.定制品 2零担 3 库存品
//查询托盘名称
if(ObjectUtils.isNotNull(i.getTrayId())){
// boolean b = trayEntityList.stream().anyMatch(a -> i.getTrayId().equals(String.valueOf(a.getId()) ));
// log.info("托盘是否有值>>>>>>>>>>{}",b);
Optional<BasicdataTrayEntity> first = trayEntityList.stream().filter(t -> i.getTrayId().equals(String.valueOf(t.getId()))).findFirst();
if(first.isPresent()){
BasicdataTrayEntity basicdataTrayEntity = first.get();
detailEntity.setTrayName(basicdataTrayEntity.getPalletName());
}
}
if(ObjectUtils.isNotNull(i.getConditions()) && i.getConditions().equals(1) ){
detailEntity.setQuestTarget(i.getConditions());
}else if(ObjectUtils.isNotNull(i.getConditions()) && i.getConditions().equals(2)){
@ -356,6 +371,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
detailEntity.setIncomingBatch(i.getOrderCode());
detailEntity.setWarehouseId(i.getWarehouseId());
detailEntity.setIsNew(0);
detailEntity.setBrandName(i.getBrand());
//查询货位
QueryWrapper<WarehouseUpdownGoodsEntity> qw = new QueryWrapper<>();
qw.eq("warehouse_id",i.getWarehouseId());
@ -436,6 +452,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
detailEntity.setIncomingBatch(i.getOrderCode());
detailEntity.setWarehouseId(i.getWarehouseId());
detailEntity.setIsNew(0);
detailEntity.setBrandName(i.getBrandName());
//查询货位
QueryWrapper<WarehouseUpdownGoodsEntity> qw = new QueryWrapper<>();
qw.eq("warehouse_id",i.getWarehouseId());
@ -706,129 +723,163 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
return R.fail("待处理的包件为空!QuestNum");
}*/
BladeUser user = AuthUtil.getUser();
QuestDetailEntity questDetailer = new QuestDetailEntity();
List<QuestDetailEntity> questDetailList = baseMapper.selectTaskInfo(questNum, questDetailer);
// 在库包件状态修改
if(ObjectUtils.isNotNull(taskSearchDTO.getQuestDetailIds()) && ObjectUtils.isNotNull(taskSearchDTO.getQuestDetailIds().get(0)) ){
QuestDetailEntity quest = new QuestDetailEntity();
List<QuestDetailEntity> questDetailList = baseMapper.selectTaskInfoForIds(questNum, quest,taskSearchDTO.getQuestDetailIds());
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",1);
List<QuestDetailEntity> list = new ArrayList<>();
AtomicBoolean s = new AtomicBoolean(false);
taskSearchDTO.getQuestDetailIds().stream().forEach( i ->{
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",i);
//查询当前包件盘点状态
boolean b = questDetailList.stream().anyMatch(q -> q.getId().equals(i) && q.getQuestStatus().equals(1));
if(b){
s.set(true);
}
// boolean b = questDetailList.stream().anyMatch(q -> q.getId().equals(i) && q.getQuestStatus().equals(1));
// if(b){
// s.set(true);
// }
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setId(Long.valueOf(i));
questDetail.setQuestStatus(1);
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
questDetail.setInventoryUser(user.getUserId());
questDetail.setInventoryTime(new Date());
// questDetail.setId(Long.valueOf(i));
// questDetail.setQuestStatus(1);
list.add(questDetail);
});
if(s.get()){
return Resp.scanFail("包含已盘点的数据!请勿重复提交!","包含已盘点的数据!请勿重复提交!");
}
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",1);
// if(s.get()){
// return Resp.scanFail("包含已盘点的数据!请勿重复提交!","包含已盘点的数据!请勿重复提交!");
// }
baseMapper.updatePositionCodeList(questNum,list);
}
//处理盘点的包件
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",2);
if(ObjectUtils.isNotNull(taskSearchDTO.getQuestDetailList())){
List<QuestDetailEntity> detailEntityList = new ArrayList<>();
//处理的包件
taskSearchDTO.getQuestDetailList().forEach(i ->{
Long taskID;
if(ObjectUtils.isNotNull(i.getId())){
taskID = i.getId();
}else{
taskID = getTaskID();
}
if(i.getIsNew().equals(1)){
//新增数据
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",4);
for (QuestDetailDTO i : taskSearchDTO.getQuestDetailList()) {
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",45);
Long taskID;
if(ObjectUtils.isNotNull(i.getId())){
taskID = i.getId();
}else{
taskID = getTaskID();
}
if(i.getIsNew().equals(1)){
//新增数据
QuestDetailEntity questDetail = new QuestDetailEntity();
BeanUtil.copyProperties(i,questDetail);
questDetail.setTenantId(user.getTenantId());
questDetail.setCreateDept(Long.valueOf(user.getDeptId()));
questDetail.setCreateTime(new Date());
questDetail.setIsDeleted(0);
questDetail.setStatus(1);
questDetail.setCreateUser(user.getUserId());
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
questDetail.setId(taskID);
questDetail.setWarehouseId(warehouseId);
questDetail.setQuestStatus(1);
List<QuestDetailEntity> entityList = new ArrayList<>();
entityList.add(questDetail);
baseMapper.insertQuestDetail( questNum,entityList);
}
Integer stockNum = i.getStockNum();
Integer lossNum = i.getLossNum();
Integer deliveNum = i.getDeliveNum();
Integer wornNum = i.getWornNum();
Integer noReceivedNum = i.getNoReceivedNum();
Integer noRepairNum = i.getNoRepairNum();
if(stockNum > 0 || lossNum > 0 || deliveNum > 0 || wornNum > 0 || noReceivedNum > 0 || noRepairNum > 0){
//查询盘点包件信息
if(ObjectUtils.isNotNull(i.getOrderPackageCode())){
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setOrderPackageCode(i.getOrderPackageCode());
QuestDetailEntity questDetail1 = baseMapper.selectOneTaskInfo(taskSearchDTO.getQuestNum(), questDetail);
if(ObjectUtils.isNotNull(questDetail1)){
i.setId(questDetail1.getId());
}
BeanUtil.copyProperties(i,questDetail);
questDetail.setTenantId(user.getTenantId());
questDetail.setCreateDept(Long.valueOf(user.getDeptId()));
questDetail.setCreateTime(new Date());
questDetail.setIsDeleted(0);
questDetail.setStatus(1);
questDetail.setCreateUser(user.getUserId());
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
questDetail.setId(taskID);
questDetail.setWarehouseId(warehouseId);
questDetail.setQuestStatus(1);
List<QuestDetailEntity> entityList = new ArrayList<>();
entityList.add(questDetail);
baseMapper.insertQuestDetail( questNum,entityList);
}
//添加
List<QuestDetailChildEntity> childList = new ArrayList<>();
childList.add(addQuestDetailChild(stockNum,"10",i.getId(),warehouseId,questNum));
childList.add(addQuestDetailChild(wornNum,"20",i.getId(),warehouseId,questNum));
childList.add(addQuestDetailChild(lossNum,"30",i.getId(),warehouseId,questNum));
childList.add(addQuestDetailChild(noRepairNum,"40",i.getId(),warehouseId,questNum));
childList.add(addQuestDetailChild(deliveNum,"50",i.getId(),warehouseId,questNum));
childList.add(addQuestDetailChild(noReceivedNum,"60",i.getId(),warehouseId,questNum));
if(!childList.isEmpty()){
boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId()));
if(b){
//添加
baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum()+"_child",childList);
//修改盘点数据
List<QuestDetailEntity> list = new ArrayList<>();
Integer stockNum = i.getStockNum();
Integer lossNum = i.getLossNum();
Integer deliveNum = i.getDeliveNum();
Integer wornNum = i.getWornNum();
Integer noReceivedNum = i.getNoReceivedNum();
Integer noRepairNum = i.getNoRepairNum();
if(stockNum > 0 || lossNum > 0 || deliveNum > 0 || wornNum > 0 || noReceivedNum > 0 || noRepairNum > 0){
//查询盘点包件信息
if(ObjectUtils.isNotNull(i.getOrderPackageCode())){
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setId(i.getId());
questDetail.setQuestStatus(1); //已盘
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
if(ObjectUtils.isNotNull(i.getTrayId())){
questDetail.setTrayId(i.getTrayId());
questDetail.setTrayCode(i.getTrayCode());
questDetail.setOrderPackageCode(i.getOrderPackageCode());
QuestDetailEntity questDetail1 = baseMapper.selectOneTaskInfo(taskSearchDTO.getQuestNum(), questDetail);
if(ObjectUtils.isNotNull(questDetail1)){
i.setId(questDetail1.getId());
}
}
//添加
List<QuestDetailChildEntity> childList = new ArrayList<>();
childList.add(addQuestDetailChild(stockNum,"10",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(wornNum,"20",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(lossNum,"30",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(noRepairNum,"40",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(deliveNum,"50",taskID,warehouseId,questNum));
childList.add(addQuestDetailChild(noReceivedNum,"60",taskID,warehouseId,questNum));
if(!childList.isEmpty()){
boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId()));
if(b){
//添加
baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum()+"_child",childList);
//修改盘点数据
List<QuestDetailEntity> list = new ArrayList<>();
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setId(i.getId());
questDetail.setQuestStatus(1); //已盘
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
if(ObjectUtils.isNotNull(i.getTrayId())){
questDetail.setTrayId(i.getTrayId());
questDetail.setTrayCode(i.getTrayCode());
}
list.add(questDetail);
baseMapper.updatePositionCodeList(taskSearchDTO.getQuestNum(),list);
}else{
//修改
List<QuestDetailChildEntity> collect = childList.stream().filter( ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(questNum+"_child",collect);
}
list.add(questDetail);
baseMapper.updatePositionCodeList(taskSearchDTO.getQuestNum(),list);
}else{
//修改
List<QuestDetailChildEntity> collect = childList.stream().filter( ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(questNum+"_child",collect);
}
}
}
//是否修改库位
QuestDetailEntity questDetail = new QuestDetailEntity();
if(ObjectUtils.isNotNull(i.getGroundingAllocationId())){
questDetail.setId(i.getId());
//是否修改库位
QuestDetailEntity questDetail = new QuestDetailEntity();
if(ObjectUtils.isNotNull(i.getGroundingAllocationId())){
//查询当前待更新货位是否包含已更新货位数据
QuestDetailEntity questDetail1 = new QuestDetailEntity();
questDetail1.setGroundingAllocationId(i.getGroundingAllocationId());
List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(taskSearchDTO.getQuestNum(), questDetail1);
if(!questDetailEntities.isEmpty()){
boolean b = questDetailEntities.stream().anyMatch(q -> ObjectUtils.isNotNull(q.getTrayId()));
if(b){
return Resp.scanFail("更新的货位,已有数据,无法上架更新!","更新的货位,已有数据,无法上架更新!");
}
}
questDetail.setId(i.getId());
// questDetail.setGroundingAllocationId(Long.valueOf(i.getAllocationId()));
questDetail.setGroundingAllocationId(i.getGroundingAllocationId());
questDetail.setGroundingPositionCode(i.getGroundingPositionCode());
detailEntityList.add(questDetail);
}
});
questDetail.setGroundingAllocationId(i.getGroundingAllocationId());
questDetail.setGroundingPositionCode(i.getGroundingPositionCode());
detailEntityList.add(questDetail);
}
}
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",5);
//修改货位
if(!detailEntityList.isEmpty()){
baseMapper.updatePositionCodeList(questNum,detailEntityList);
}
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",6);
}
return R.success("成功");
}
@ -850,7 +901,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
QuestDetailVO questDetailVO = new QuestDetailVO();
BeanUtil.copyProperties(i,questDetailVO);
//查询包件信息
if(ObjectUtils.isNotNull(i.getOrderPackageId()) ){
/*if(ObjectUtils.isNotNull(i.getOrderPackageId()) ){
DistributionParcelListEntity parcelListId = distributionParcelListClient.getParcelListId(String.valueOf(i.getOrderPackageId()));
if(ObjectUtils.isNotNull(parcelListId)){
@ -861,7 +912,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetailVO.setMaterialCode(parcelListId.getMaterialCode());
questDetailVO.setBrandName(parcelListId.getBrandName());
}
}else if(i.getQuestTarget().equals(2)){
}else*/
/* if(i.getQuestTarget().equals(2)){
//零担
DistributionStockArticleEntity stockArticleEntity = new DistributionStockArticleEntity();
stockArticleEntity.setWarehouseId(i.getWarehouseId());
@ -884,17 +936,26 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetailVO.setMaterialCode(stockListById.getCargoNumber () );
questDetailVO.setBrandName(stockListById.getBrandName());
}
}
if(ObjectUtils.isNotNull(i.getTrayId())){
}*/
/*if(ObjectUtils.isNotNull(i.getTrayId())){
//查询托盘名称
List<BasicdataTrayEntity> trayEntityList = basicdataTrayClient.getTrayEntityList(i.getTrayId());
if(ObjectUtils.isNotNull(trayEntityList)){
questDetailVO.setTrayName(trayEntityList.get(0).getPalletName());
}
}
}*/
if(!i.getQuestStatus().equals(0)){
R<List<User>> listR = userSearchClient.listByUser(String.valueOf(i.getUpdateUser()));
questDetailVO.setInventoryPerson(listR.getData().get(0).getName());
if(ObjectUtils.isNotNull(listR.getData())){
List<User> data = listR.getData();
if(ObjectUtils.isNotNull(data)){
User user = data.get(0);
if(user!=null){
questDetailVO.setInventoryPerson(user.getName());
}
}
}
questDetailVO.setInventoryDate(i.getUpdateTime());
}
@ -1312,6 +1373,35 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
/**
* 查询盘点数据到时间就结束
*
*/
@Override
public void getFinishTask() {
QueryWrapper<TaskQuestEntity> queryWrapper = new QueryWrapper<>();
List<TaskQuestEntity> taskQuestEntities = baseMapper.selectList(queryWrapper);
taskQuestEntities.forEach( i ->{
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
long l = format.parse(i.getEndTime()).getTime() / 1000;
long l1 = new Date().getTime() / 1000;
if(l < l1){
//结束当前任务
TaskQuestEntity taskQuestEntity = new TaskQuestEntity();
taskQuestEntity.setId(i.getId());
taskQuestEntity.setQuestStatus(String.valueOf(3));
baseMapper.updateById(taskQuestEntity);
}
} catch (ParseException e) {
throw new RuntimeException(e);
}
});
}
/**
* 查询货位上的数据
* @param taskSearchDTO
@ -2705,11 +2795,6 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
private QuestDetailChildEntity addQuestDetailChild(Integer num,String cargoName,Long questDetaiId,Long warehouseId,String qu){
if(Objects.isNull(questDetaiId)){
log.warn("###########addQuestDetailChild: 明细id不存在 questDetaiId={}",questDetaiId);
throw new CustomerException(403,"明细id不存在");
}
if(Objects.isNull(num)){
log.warn("###########addQuestDetailChild: 数量不正确 num={}",num);
throw new CustomerException(403,"数量不正确");

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsLogServiceImpl.java

@ -35,7 +35,7 @@ public class WarehouseTrayGoodsLogServiceImpl extends BaseServiceImpl<WarehouseT
trayGoodsLogEntity.setBindingType(bindingType);
trayGoodsLogEntity.setRemark(remark);
trayGoodsLogEntity.setPalletizingType(palletizingType);
trayGoodsLogEntity.setNum(parcelListEntity.getQuantity());
trayGoodsLogEntity.setNum(1);
trayGoodsLogEntity.setWarehouseId(trayTypeEntity.getWarehouseId());
trayGoodsLogEntity.setTenantId(TenantNum.HUITONGCODE);
save(trayGoodsLogEntity);

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseTrayGoodsServiceImpl.java

@ -57,7 +57,7 @@ public class WarehouseTrayGoodsServiceImpl extends BaseServiceImpl<WarehouseTray
trayGoodsEntity.setAssociationValue(parcelListEntity.getOrderPackageCode());
trayGoodsEntity.setAssociationType("3");
trayGoodsEntity.setGoodsName(parcelListEntity.getMaterialName());
trayGoodsEntity.setNum(parcelListEntity.getQuantity());
trayGoodsEntity.setNum(1);
trayGoodsEntity.setIsFleeing(isException);
trayGoodsEntity.setWarehouseId(trayTypeEntity.getWarehouseId());
save(trayGoodsEntity);

4
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsLogServiceImpl.java

@ -16,7 +16,6 @@
*/
package com.logpm.warehouse.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
@ -27,7 +26,6 @@ import com.logpm.warehouse.entity.WarehouseUpdownTypeEntity;
import com.logpm.warehouse.excel.WarehouseCustomizedExcel;
import com.logpm.warehouse.excel.WarehouseStockedExcel;
import com.logpm.warehouse.excel.WarehouseTemporaryExcel;
import com.logpm.warehouse.excel.WarehouseUpdownGoodsLogExcel;
import com.logpm.warehouse.mapper.WarehouseUpdownGoodsLogMapper;
import com.logpm.warehouse.service.IWarehouseUpdownGoodsLogService;
import com.logpm.warehouse.vo.WarehouseUpdownGoodsLogVO;
@ -94,7 +92,7 @@ public class WarehouseUpdownGoodsLogServiceImpl extends BaseServiceImpl<Warehous
warehouseUpdownGoodsLogEntity.setAssociationId(parcelListEntity.getId());
warehouseUpdownGoodsLogEntity.setAssociationValue(parcelListEntity.getOrderPackageCode());
warehouseUpdownGoodsLogEntity.setAssociationType("3");
warehouseUpdownGoodsLogEntity.setNum(parcelListEntity.getQuantity());
warehouseUpdownGoodsLogEntity.setNum(1);
warehouseUpdownGoodsLogEntity.setRemark(remark);
warehouseUpdownGoodsLogEntity.setWarehouseId(updownTypeEntity.getWarehouseId());
save(warehouseUpdownGoodsLogEntity);

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseUpdownGoodsServiceImpl.java

@ -114,7 +114,7 @@ public class WarehouseUpdownGoodsServiceImpl extends BaseServiceImpl<WarehouseUp
updownGoodsEntity.setAssociationId(parcelListEntity.getId());
updownGoodsEntity.setAssociationValue(parcelListEntity.getOrderPackageCode());
updownGoodsEntity.setAssociationType("3");//包件
updownGoodsEntity.setNum(parcelListEntity.getQuantity());
updownGoodsEntity.setNum(1);
updownGoodsEntity.setWarehouseId(updownTypeEntity.getWarehouseId());
save(updownGoodsEntity);
//存入包件货物上架记录

19
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWarehousingEntryServiceImpl.java

@ -110,7 +110,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
if(ObjectUtils.isNull(warehouseWarehousingEntryDTO.getType())){
throw new ServiceException("入库类型不能为空!!");
}
if(warehouseWarehousingEntryDTO.getType().equals("2")){
if("2".equals(warehouseWarehousingEntryDTO.getType())){
//直接入库
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingEntryDTO.getList();
WarehouseWarehousingEntryEntity warehouseWarehousingEntry = new WarehouseWarehousingEntryEntity();
@ -119,7 +119,9 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
if(ObjectUtils.isNull( warehouseWarehousingEntry.getReceiptBatch() )){
long time = new Date().getTime();
BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse();
warehouseWarehousingEntry.setReceiptBatch("RK"+myCurrentWarehouse.getWarehouseCode()+time);
String s = "RK" + myCurrentWarehouse.getWarehouseCode() + time;
warehouseWarehousingEntry.setReceiptBatch(s);
warehouseWarehousingEntryDTO.setReceiptBatch(s);
}
WarehouseWarehousingEntryEntity entryEntity = new WarehouseWarehousingEntryEntity();
entryEntity.setId(warehouseWarehousingEntryDTO.getId());
@ -146,7 +148,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
// iterator.remove();
// }
// }
if(list.size() > 0){
if(!list.isEmpty()){
list.forEach(i ->{
i.setWarehousingEntryId(warehouseWarehousingEntry.getId());
i.setConditions("3");
@ -155,7 +157,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
warehouseWarehousingDetailService.saveBatch(list);
}
return true;
}else if(warehouseWarehousingEntryDTO.getType().equals("1")){
}else if("1".equals(warehouseWarehousingEntryDTO.getType())){
//预计入库
List<WarehouseWarehousingDetailEntity> list = warehouseWarehousingEntryDTO.getList();
WarehouseWarehousingEntryEntity warehouseWarehousingEntry = new WarehouseWarehousingEntryEntity();
@ -176,7 +178,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
.eq(WarehouseWarehousingDetailEntity::getWarehousingEntryId, warehouseWarehousingEntry.getId())
.apply("conditions in (1,2) ")
);//查询不是确定的数据
if(list1.size() > 0){
if(!list1.isEmpty()){
AtomicReference<Integer> num = new AtomicReference<>(0);
list1.forEach( i ->{
boolean b = list.stream().anyMatch(w -> w.getMaterialId().equals(i.getMaterialId()));
@ -209,7 +211,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
}
}else{
if(i.getConditions().equals("1")){
if("1".equals(i.getConditions())){
//删除
detailEntityList.add(i.getId());
}
@ -222,7 +224,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
entryEntity.setConditions("3");
}
baseMapper.updateById(entryEntity);
if(detailEntityList.size() > 0){
if(!detailEntityList.isEmpty()){
//删除多余的
warehouseWarehousingDetailService.deleteLogic(detailEntityList);
}
@ -249,7 +251,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
iterator.remove();
}
}
if(list.size() > 0){
if(!list.isEmpty()){
list.forEach(i ->{
i.setWarehousingEntryId(warehouseWarehousingEntry.getId());
i.setConditions("1");
@ -279,6 +281,7 @@ public class WarehouseWarehousingEntryServiceImpl extends BaseServiceImpl<Wareho
if(num < 1){
return true;
}else{
//查询库存品信息
DistributionStockListEntity stockListEntity = new DistributionStockListEntity();
stockListEntity.setStoreId(warehousingEntryDTO.getStoreId());
stockListEntity.setMarketId(warehousingEntryDTO.getClientId());

Loading…
Cancel
Save