Browse Source

修改盘点托盘查询

training
caoyizhong 1 year ago
parent
commit
a53b1c5789
  1. 5
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailChildEntity.java
  2. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFreightController.java
  3. 6
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataFreightDTO.java
  4. 4
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataFreightService.java
  5. 18
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataFreightServiceImpl.java
  6. 13
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java
  7. 14
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionReservationPackageExcel.java
  8. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  9. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationPackageMapper.xml
  10. 1
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml
  11. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java
  12. 3
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml
  13. 10
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java
  14. 147
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

5
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailChildEntity.java

@ -35,6 +35,11 @@ import org.springblade.core.tenant.mp.TenantEntity;
@EqualsAndHashCode(callSuper = true)
public class QuestDetailChildEntity extends TenantEntity {
/**
* id
*/
@ApiModelProperty(value = "id")
private Long id;
/**
* 预留1
*/

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataFreightController.java

@ -19,6 +19,7 @@ package com.logpm.basicdata.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.basicdata.dto.BasicdataFreightDTO;
import com.logpm.basicdata.entity.BasicdataFreightEntity;
import com.logpm.basicdata.excel.BasicdataFreightExcel;
import com.logpm.basicdata.service.IBasicdataFreightService;
@ -116,7 +117,7 @@ public class BasicdataFreightController extends BladeController {
@PostMapping("/submit")
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入basicdataFreight")
public R submit(@Valid @RequestBody BasicdataFreightEntity basicdataFreight) {
public R submit(@Valid @RequestBody BasicdataFreightDTO basicdataFreight) {
return R.status(basicdataFreightService.ownSaveOrUpdate(basicdataFreight));
}

6
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/dto/BasicdataFreightDTO.java

@ -30,5 +30,11 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = true)
public class BasicdataFreightDTO extends BasicdataFreightEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String clientIds;
}

4
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/IBasicdataFreightService.java

@ -18,6 +18,7 @@ package com.logpm.basicdata.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.basicdata.dto.BasicdataFreightDTO;
import com.logpm.basicdata.entity.BasicdataFreightEntity;
import com.logpm.basicdata.excel.BasicdataFreightExcel;
import com.logpm.basicdata.vo.BasicdataFreightVO;
@ -55,5 +56,6 @@ public interface IBasicdataFreightService extends BaseService<BasicdataFreightEn
* @param basicdataFreight
* @return
*/
Boolean ownSaveOrUpdate(BasicdataFreightEntity basicdataFreight);
Boolean ownSaveOrUpdate(BasicdataFreightDTO basicdataFreight);
}

18
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataFreightServiceImpl.java

@ -18,6 +18,8 @@ package com.logpm.basicdata.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.dto.BasicdataFreightDTO;
import com.logpm.basicdata.entity.BasicdataFreightEntity;
import com.logpm.basicdata.excel.BasicdataFreightExcel;
import com.logpm.basicdata.mapper.BasicdataFreightMapper;
@ -57,15 +59,27 @@ public class BasicdataFreightServiceImpl extends BaseServiceImpl<BasicdataFreigh
}
/**
* 添加
* 添加和修改
* @param basicdataFreight
* @return
*/
@Override
public Boolean ownSaveOrUpdate(BasicdataFreightEntity basicdataFreight) {
public Boolean ownSaveOrUpdate(BasicdataFreightDTO basicdataFreight) {
log.info("接收的数据{}",basicdataFreight);
if(ObjectUtils.isNotNull(basicdataFreight.getId())){
//修改
}else{
//新增
if(basicdataFreight.getClientIds().contains(",")){
//多用户
}else{
}
}
return null;
}

13
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/service/impl/BasicdataStoreBrandServiceImpl.java

@ -105,16 +105,19 @@ public class BasicdataStoreBrandServiceImpl extends BaseServiceImpl<BasicdataSto
//查询客户相关的品牌
l.forEach(i ->{
QueryWrapper<BasicdataStoreBrandEntity> queryWrapper = new QueryWrapper<>();
if(type.equals("1")){
//客户
queryWrapper.apply(ObjectUtils.isNotNull(o1),"lbb.brand_name like concat('%',{0},'%') ",o1);
queryWrapper.apply("lbsb.client_id ={0} ",i);
//客户
queryWrapper.apply(ObjectUtils.isNotNull(o1),"lbb.brand_name like concat('%',{0},'%') ",o1);
queryWrapper.apply("lbsb.client_id ={0} ",i);
/*if(ObjectUtils.isNotNull(type)){
if(type.equals("1")){
}
}else{
//门店
//客户
queryWrapper.apply(ObjectUtils.isNotNull(o1),"lbb.brand_name like concat('%',{0},'%') ",o1);
queryWrapper.apply("lbsb.shop_id ={0} ", i);
}
}*/
List<BasicdataStoreBrandVO> basicdataStoreBrandVOS = baseMapper.listNameBrand(queryWrapper ); // 查询相关品牌信息
voList.addAll(basicdataStoreBrandVOS);
/* List<BasicdataStoreBrandEntity> basicdataStoreBrandEntities = baseMapper.selectList(Wrappers.<BasicdataStoreBrandEntity>query().lambda()

14
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/excel/DistributionReservationPackageExcel.java

@ -138,31 +138,31 @@ public class DistributionReservationPackageExcel implements Serializable {
*/
@ColumnWidth(20)
@ExcelProperty("一级品")
private Long firsts;
private String firsts;
/**
* 订单编号
*/
@ColumnWidth(20)
@ExcelProperty("二级品")
private Long second;
private String second;
/**
* 订单编号
*/
@ColumnWidth(20)
@ExcelProperty("三级品")
private Long thirdProduct;
private String thirdProduct;
/**
* 订单编号
*/
@ColumnWidth(20)
@ExcelProperty("物料名称")
private Long materialName;
private String materialName;
/**
* 订单编号
*/
@ColumnWidth(20)
@ExcelProperty("数量")
private Long quantity;
private Integer quantity;
// /**
// * 订单编号
// */
@ -174,12 +174,12 @@ public class DistributionReservationPackageExcel implements Serializable {
*/
@ColumnWidth(20)
@ExcelProperty("货位数量")
private Long positionCode;
private Integer positionCode;
/**
* 订单编号
*/
@ColumnWidth(20)
@ExcelProperty("所在托盘")
private Long trayCode;
private String trayCode;
}

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

@ -62,6 +62,7 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
.eq(ObjectUtils.isNotNull(parcelListEntity.getId()),DistributionParcelListEntity::getId,parcelListEntity.getId())
.eq(ObjectUtils.isNotNull(parcelListEntity.getWarehouseId()),DistributionParcelListEntity::getWarehouseId,parcelListEntity.getWarehouseId())
.eq(ObjectUtils.isNotNull(parcelListEntity.getStockArticleId()),DistributionParcelListEntity::getStockArticleId,parcelListEntity.getStockArticleId())
.notIn(ObjectUtils.isNotNull(parcelListEntity.getOrderPackageStatus()),DistributionParcelListEntity::getOrderPackageStatus,parcelListEntity.getOrderPackageStatus().split(","))
);
}

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

@ -58,7 +58,7 @@
LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id and lwug.warehouse_id = #{param.warehouseId}
<where>
ldrp.packet_bar_status in (1,3)
<if test="param.reservationId != null and param.reservationId != ''"> and ldrs.reservation_id = #{param.reservationId } </if>
<if test="param.reservationId != null and param.reservationId != ''"> and ldrp.reservation_id = #{param.reservationId } </if>
<if test="param.waybillNumber != null and param.waybillNumber != ''"> and ldpl.waybill_number like concat('%',#{param.waybillNumber },'%') </if>
<if test="param.serviceNumber != null and param.serviceNumber != ''"> and ldpl.service_number like concat('%', #{param.serviceNumber },'%') </if>
<if test="param.orderCode != null and param.orderCode != ''"> and ldpl.order_code like concat('%', #{param.orderCode },'%') </if>

1
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationStocklistMapper.xml

@ -49,6 +49,7 @@
LEFT JOIN logpm_distribution_stockup_info ldsi on ldsi.reservation_id = ldrs.reservation_id
LEFT JOIN logpm_distribution_stockup lds on lds.id = ldsi.stockup_id
<where>
ldrs.reservation_id =#{param.reservationId}
<if test="param.incomingBatch != null and param.incomingBatch !=''"> and ldsl.incoming_batch like concat('%', #{param.incomingBatch },'%')</if>
<if test="param.sku != null and param.sku !=''"> and ldsl.sku like concat('%', #{param.sku },'%')</if>
<if test="param.marketName != null and param.marketName !=''"> and ldsl.market_name like concat('%', #{param.marketName },'%')</if>

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java

@ -113,7 +113,7 @@ public class WarehouseTaskApiController {
return R.fail(403,"仓库信息为空");
}
taskSearchDTO.setWarehouseId(myCurrentWarehouse.getId());
R r= taskQuestService.queryContract(Condition.getPage(query), taskSearchDTO);
R r= taskQuestService.queryContractGai(Condition.getPage(query), taskSearchDTO);
return r;
}

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

@ -146,6 +146,7 @@
<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.ordePackageCode != null and param.ordePackageCode != ''">and orde_package_code =#{param.ordePackageCode } </if>
</where>
</select>
<select id="selectOneTaskInfo" resultType="com.logpm.warehouse.entity.QuestDetailEntity">
@ -221,7 +222,7 @@
</update>
<update id="updetaQuestDetailChildList">
<foreach collection="list" item="item" index="index">
<foreach collection="list" item="item" index="index" separator=";">
update ${questNum}
<set>
<if test="item.cargoName != null and item.cargoName != ''" > cargo_name = #{item.cargoName }, </if>

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

@ -85,6 +85,16 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
*/
R queryContract(IPage<Object> page,TaskSearchDTO taskSearchDTO);
/**
* 合同号扫描改
*
* @param page
* @param taskSearchDTO
* @return
*/
R queryContractGai(IPage<Object> page,TaskSearchDTO taskSearchDTO);
/**
* 盘点定制平数据
*

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

@ -17,6 +17,7 @@
package com.logpm.warehouse.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.Query;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
@ -46,6 +47,7 @@ import com.logpm.warehouse.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.common.constant.common.IsOrNoConstant;
import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant;
import org.springblade.common.exception.CustomerException;
import org.springblade.common.utils.CommonUtil;
import org.springblade.core.log.exception.ServiceException;
@ -205,6 +207,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
detailEntityList.add(detailEntity);
});
log.debug("包件数据=={}",detailEntityList.size());
//查询零担数据
DistributionStockArticleEntity stockArticle = new DistributionStockArticleEntity();
stockArticle.setWarehouseId(stockArticleEntity.getWarehouseId());
@ -214,7 +217,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
if(!stockArticleInfo.isEmpty()){
detailEntityList.addAll(handleIsZeroList(stockArticleInfo,taskQuest));
}
log.debug("零担 和 包件数据=={}",detailEntityList.size());
//查询库存平数据
DistributionStockListEntity stockListEntity = new DistributionStockListEntity();
stockListEntity.setWarehouseId(stockArticleEntity.getWarehouseId());
@ -252,18 +255,39 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
// detailEntityList.add(detailListEntity);
// });
}
log.debug("全部包件数据=={}",detailEntityList.size());
if(!detailEntityList.isEmpty()){
int batchSize = 1000; // 设置批处理的大小
int totalSize = detailEntityList.size(); // 获取总数据量
int batchSize = 1000; // 设置批处理的大小
int xh = (int) Math.ceil((double) totalSize / batchSize);
for (int i = 0; i < totalSize; i += batchSize) {
int endIndex = Math.min(i + batchSize, totalSize);
List<QuestDetailEntity> subList = detailEntityList.subList(i, endIndex);
for (int i = 0; i < xh; i++) {
int startIndex = i * batchSize;
int endIndex = Math.min(startIndex + batchSize, totalSize);
List<QuestDetailEntity> subList = detailEntityList.subList(startIndex, endIndex);
baseMapper.insertQuestDetail(questNum, subList);
}
// int totalSize = detailEntityList.size(); // 获取总数据量
// int batchSize = 1000; // 设置批处理的大小
// int xh = (int) Math.ceil( totalSize / batchSize);
// for (int i = 0; i < xh; i ++) {
// List<QuestDetailEntity> subList = new ArrayList<>();
// if(i == 0){
// subList = detailEntityList.subList(i, batchSize);
// baseMapper.insertQuestDetail(questNum, subList);
//
// }else{
// subList = detailEntityList.subList(batchSize, batchSize+1000);
// baseMapper.insertQuestDetail(questNum, subList);
// batchSize = batchSize+1000;
// }
// }
// int q = totalSize - (xh * batchSize);
// if(q > 0){
// baseMapper.insertQuestDetail(questNum,detailEntityList.subList(xh * batchSize, q));
// }
log.info("数量七千万===》》》"+xh);
}
}
@ -844,7 +868,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetailChildEntity.setWarehouseId(warehouseId);
List<QuestDetailChildEntity> list = getQuestDetailInfo(taskQuestEntity.getQuestNum()+"_child",questDetailChildEntity);
if(!list.isEmpty()){
int sum = list.stream().mapToInt(QuestDetailChildEntity::getQuestNum).sum();
int sum = list.stream().filter(i ->i.getCargoName().equals("10")).mapToInt(QuestDetailChildEntity::getQuestNum).sum();
unTotal.set(unTotal.get() + sum);
}else{
throw new ServiceException("未找到对应的处理数据!!");
@ -910,7 +934,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setWarehouseId(warehouseId);
questDetail.setQuestId(taskSearchDTO.getTaskId());
questDetail.setQuestType(4);
// questDetail.setQuestType(4);
if(ObjectUtils.isNotNull(trayId)){
questDetail.setTrayId(String.valueOf(trayId));
}
@ -1355,14 +1379,15 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
childList.add(addQuestDetailChild(noRepairNum,"40",questDetaiId,warehouseId,taskQuestEntity.getQuestNum()));
childList.add(addQuestDetailChild(deliveNum,"50",questDetaiId,warehouseId,taskQuestEntity.getQuestNum()));
childList.add(addQuestDetailChild(noReceivedNum,"60",questDetaiId,warehouseId,taskQuestEntity.getQuestNum()));
if(!childList.isEmpty()){
if(!childList.isEmpty()){
boolean b = childList.stream().anyMatch(i -> ObjectUtils.isNull(i.getId()));
if(b){
//添加
baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum()+"_child",childList);
}else{
//修改
baseMapper.updetaQuestDetailChildList(taskQuestEntity.getQuestNum()+"_child",childList);
List<QuestDetailChildEntity> collect = childList.stream().filter(i -> ObjectUtils.isNotNull(i.getQuestNum()) && i.getQuestNum() > 0).collect(Collectors.toList());
baseMapper.updetaQuestDetailChildList(taskQuestEntity.getQuestNum()+"_child",collect);
}
}
// questDetailChildService.saveOrUpdateBatch(childList);
@ -1640,12 +1665,12 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
QuestDetailEntity detailEntity = new QuestDetailEntity();
detailEntity.setQuestId(taskSearchDTO.getTaskId());
detailEntity.setWarehouseId(taskSearchDTO.getWarehouseId());
detailEntity.setQuestType(3);
// LambdaQueryWrapper<QuestDetailEntity> queryWrapper = Wrappers.<QuestDetailEntity>query().lambda()
// .eq(QuestDetailEntity::getQuestId, taskSearchDTO.getTaskId())
// .eq(QuestDetailEntity::getWarehouseId, taskSearchDTO.getWarehouseId())
// .eq(QuestDetailEntity::getQuestType, 3);
//是否库存品 0 否 1是
if (Func.equals(isInventory,1)){
detailEntity.setIncomingBatch(taskSearchDTO.getOrderCode());
}else {
@ -1654,14 +1679,14 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
IPage<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(page,taskSearchDTO.getQuestNum(),detailEntity);
List<Integer> type = questDetailEntities.getRecords().stream().filter(f -> Func.isNotEmpty(f.getQuestTarget())).map(QuestDetailEntity::getQuestTarget).distinct().collect(Collectors.toList());
if (Func.isEmpty(type)){
return null;
return Resp.scanFail("无数据信息!","无数据信息!");
}
if (type.size() != 1){
log.error("###################orderId查询类型异常:{}",taskSearchDTO.getOrderId());
return null;
}
TaskContractVO contractVO = new TaskContractVO();
AtomicInteger total = new AtomicInteger();
AtomicInteger total = new AtomicInteger(); //总数
AtomicInteger operationNum = new AtomicInteger();
ArrayList<TaskPackagelistVO> taskPackagelistVOS = new ArrayList<>();
List<String> orderCode = questDetailEntities.getRecords().stream().map(QuestDetailEntity::getOrderCode).distinct().collect(Collectors.toList());
@ -1903,17 +1928,22 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
questDetailChildEntity = new QuestDetailChildEntity();
questDetailChildEntity.setTenantId(user.getTenantId());
questDetailChildEntity.setCreateUser(user.getUserId());
// questDetailChildEntity.setCreateDept(user.getDeptId());
questDetailChildEntity.setCreateDept(Long.valueOf(user.getDeptId()));
questDetailChildEntity.setCreateTime(new Date());
questDetailChildEntity.setIsDeleted(0);
questDetailChildEntity.setStatus(1);
questDetailChildEntity.setQuestDetailId(questDetaiId);
questDetailChildEntity.setCargoName(cargoName);
questDetailChildEntity.setQuestNum(num);
questDetailChildEntity.setWarehouseId(warehouseId);
return questDetailChildEntity;
}else{
questDetailChildEntity.setQuestNum(num);
QuestDetailChildEntity detailChildEntity = new QuestDetailChildEntity();
detailChildEntity.setQuestNum(num);
detailChildEntity.setId(questDetailChildEntity.getId());
return detailChildEntity;
}
return questDetailChildEntity;
}
@ -2229,6 +2259,87 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
return R.data(taskContractVOS);
}
/**
* 合同扫描
* @param page
* @param taskSearchDTO
* @return
*/
@Override
@Transactional
public R queryContractGai(IPage<Object> page, TaskSearchDTO taskSearchDTO) {
// String goodsType = taskSearchDTO.getGoodsType();
Integer type = taskSearchDTO.getType();
String questNum = taskSearchDTO.getQuestNum();
Long taskQuestId = taskSearchDTO.getTaskId();
if (Func.isEmpty(type)){
log.error("####################前端参数type传递有误:{}",type);
return Resp.scanFail("操作失败", "服务器正忙...");
}
if (Func.isEmpty(questNum)){
log.error("####################前端参数questNum传递有误:{}",questNum);
return Resp.scanFail("操作失败", "服务器正忙...");
}
String incomingBatch = taskSearchDTO.getIncomingBatch(); //输入的码
String code = taskSearchDTO.getCode(); //扫描的码
QuestDetailEntity questDetail = new QuestDetailEntity();
if(type == 1){
if(ObjectUtils.isNull(code)){
log.error("####################订单合同号为空");
return Resp.scanFail("操作失败", "请填写正确合同号");
}
questDetail.setOrdePackageCode(code);
}else{
if(ObjectUtils.isNull(incomingBatch)){
log.error("####################订单合同号为空");
return Resp.scanFail("操作失败", "请输入正确合同号");
}
questDetail.setOrderCode(incomingBatch);
}
//检验是否完结
verifyTask(taskQuestId, taskSearchDTO.getWarehouseId());
TaskQuestEntity taskQuestEntity = baseMapper.selectById(taskQuestId);
taskSearchDTO.setQuestNum(taskQuestEntity.getQuestNum());
List<TaskContractVO> taskContractVOS = new ArrayList<>();
//查询盘点数据
questDetail.setQuestId(taskQuestId);
questDetail.setWarehouseId(taskSearchDTO.getWarehouseId());
IPage<QuestDetailEntity> questDetailEntityList;
questDetailEntityList = baseMapper.selectTaskInfo(page,taskSearchDTO.getQuestNum(),questDetail);
if(ObjectUtils.isNull(questDetailEntityList.getRecords())){
if(type == 2){
questDetail.setOrderCode(null);
questDetail.setOrdePackageCode(incomingBatch);
questDetailEntityList = baseMapper.selectTaskInfo(page,taskSearchDTO.getQuestNum(),questDetail);
if(ObjectUtils.isNull(questDetailEntityList.getRecords())){
return Resp.scanSuccess("无盘点数据!","无盘点数据!");
}
}else{
return Resp.scanSuccess("无盘点数据!","无盘点数据!");
}
}
questDetailEntityList.getRecords().stream().collect(Collectors.groupingBy(QuestDetailEntity::getOrderId))
.forEach((k,v)->{
TaskContractVO taskContractVO = new TaskContractVO();
taskContractVO.setOrderId(k);
taskContractVO.setOrderCode(v.get(0).getOrderCode());
DistributionStockArticleEntity entityByStockArticle = distributionStockArticleClient.findEntityByStockArticleId(k);
taskContractVO.setTotal(entityByStockArticle.getTotalNumber());
taskContractVO.setZktotal(entityByStockArticle.getHandQuantity());
int size = v.stream().map(i -> i.getQuestStatus().equals("1")).collect(Collectors.toList()).size();
taskContractVO.setUnTotal(size);
boolean b = v.stream().anyMatch(ii -> ii.getQuestTarget().equals(1));
taskContractVO.setIsZero(b ? 0 : 1);
taskContractVO.setIsInventory(b ? 0 : 1);
taskContractVOS.add(taskContractVO);
});
return R.data(taskContractVOS);
}
private String getQuestNum(String warehouseCode) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMddHHmmss");

Loading…
Cancel
Save