Browse Source

Merge branch 'dev' into pre-production

newStockUp
pref_mail@163.com 1 year ago
parent
commit
d535200809
  1. 3
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/WarehouseAllocationInfoVO.java
  2. 4
      blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java
  3. 4
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailEntity.java
  4. 13
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java
  5. 3
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml
  6. 20
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionParcelListClient.java
  7. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java
  8. 19
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java
  9. 8
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/TaskSearchDTO.java
  10. 4
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml
  11. 2
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml
  12. 8
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java
  13. 136
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

3
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/vo/WarehouseAllocationInfoVO.java

@ -24,6 +24,9 @@ public class WarehouseAllocationInfoVO {
@ApiModelProperty(value = "区域名称")
private String areaName;
@ApiModelProperty(value = "区域名称")
private String allocationId;
}

4
blade-service-api/logpm-distribution-api/src/main/java/com/logpm/distribution/feign/IDistributionParcelListClient.java

@ -40,6 +40,10 @@ public interface IDistributionParcelListClient {
String API_PREFIX = "/client";
String TOP = API_PREFIX + "/top1";
String TOPPARCELLIST = API_PREFIX + "/getParcelList";
@GetMapping(TOPPARCELLIST)
List<DistributionParcelListEntity> getParcelList(DistributionParcelListEntity parcelListEntity);
/**
* 获取在库订单包件清单列表

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

@ -136,7 +136,7 @@ public class QuestDetailEntity extends TenantEntity {
* 上架后的库位ID
*/
@ApiModelProperty(value = "上架后的库位ID")
private String groundingAllocationId;
private Long groundingAllocationId;
/**
* 托盘id
*/
@ -153,6 +153,6 @@ public class QuestDetailEntity extends TenantEntity {
* 是否是新增数据
*/
@ApiModelProperty(value = "是否是新增数据")
private String isNew;
private Integer isNew;
}

13
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/controller/BasicdataDriverArteryController.java

@ -36,11 +36,15 @@ import org.springblade.core.excel.util.ExcelUtil;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.DateUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.entity.User;
import org.springblade.system.feign.IUserClient;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.handler.UserRoleAuthorizationInterceptor;
import springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletResponse;
@ -65,6 +69,8 @@ public class BasicdataDriverArteryController extends BladeController {
private final IBasicdataVehicleService basicdataVehicleService;
private final IUserClient userClient;
/**
* 司机信息表 详情
*/
@ -122,6 +128,13 @@ public class BasicdataDriverArteryController extends BladeController {
if(list.size() > 0){
return R.fail("绑定的用户已存在!不要重复绑定!!!");
}
String phone = basicdataDriverArtery.getPhone();
R<User> userR = userClient.userInfoByPhone(AuthUtil.getUser().getTenantId(), phone);
if (Func.isNotEmpty(userR.getData())){
User user = userR.getData();
basicdataDriverArtery.setUserId(user.getId());
}
boolean save = basicdataDriverArteryService.save(basicdataDriverArtery);
//加入关联表
if (null !=basicdataDriverArtery.getBindVehicles()&& save){

3
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/mapper/BasicdataGoodsAllocationMapper.xml

@ -139,7 +139,8 @@
lwga.qr_code as allocationCode,
CONCAT(lwgs.goods_shelf_name,'-',lwga.goods_allocation_name) as allocationName,
lww.`name` as warehouseName,
lwga1.headline as areaName
lwga1.headline as areaName,
lwga.id as allocationId
from logpm_warehouse_goods_allocation lwga
LEFT JOIN logpm_warehouse_goods_area lwga1 ON lwga1.id=lwga.goods_area_id
LEFT JOIN logpm_warehouse_goods_shelf lwgs ON lwgs.id = lwga.goods_shelf_id

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

@ -18,6 +18,8 @@ package com.logpm.distribution.feign;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.service.IDistributionParcelListService;
import lombok.AllArgsConstructor;
@ -44,7 +46,23 @@ public class DistributionParcelListClient implements IDistributionParcelListClie
private final IDistributionParcelListService distributionParcelListService;
@Override
/**
* 查询包件信息
*
* @param parcelListEntity
* @return
*/
@Override
@GetMapping(TOPPARCELLIST)
public List<DistributionParcelListEntity> getParcelList(DistributionParcelListEntity parcelListEntity) {
return distributionParcelListService.list(Wrappers.<DistributionParcelListEntity>query().lambda()
.eq(ObjectUtils.isNotNull(parcelListEntity.getOrderPackageCode()),DistributionParcelListEntity::getOrderPackageCode,parcelListEntity.getOrderPackageCode())
.eq(ObjectUtils.isNotNull(parcelListEntity.getId()),DistributionParcelListEntity::getId,parcelListEntity.getId())
.eq(ObjectUtils.isNotNull(parcelListEntity.getWarehouseId()),DistributionParcelListEntity::getWarehouseId,parcelListEntity.getWarehouseId())
);
}
@Override
@GetMapping(TOP)
public BladePage<DistributionParcelListEntity> top(Integer current, Integer size) {
Query query = new Query();

2
blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java

@ -265,6 +265,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
.eq(DistributionStockListEntity::getStoreId,storeId)//门店
.eq(DistributionStockListEntity::getMaterialId,materialId)//货物
.eq(DistributionStockListEntity::getIncomingBatch,incomingBatch)//货物
.eq(ObjectUtils.isNotNull(distributionStockListEntity.getWarehouseId()),DistributionStockListEntity::getWarehouseId,distributionStockListEntity.getWarehouseId())
);
}else if(Func.isNotEmpty(clientId)){
//客户商场
@ -272,6 +273,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl<Distributi
.eq(DistributionStockListEntity::getMarketId,clientId)//商场
.eq(DistributionStockListEntity::getMaterialId,materialId)//货物
.eq(DistributionStockListEntity::getIncomingBatch,incomingBatch)//货物
.eq(ObjectUtils.isNotNull(distributionStockListEntity.getWarehouseId()),DistributionStockListEntity::getWarehouseId,distributionStockListEntity.getWarehouseId())
);
}
if(list.size() > 0){

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

@ -1,6 +1,7 @@
package com.logpm.warehouse.api;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.logpm.warehouse.dto.TaskSearchDTO;
import com.logpm.warehouse.service.ITaskQuestService;
@ -16,6 +17,7 @@ import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Optional;
@Log4j2
@ -66,9 +68,20 @@ public class WarehouseTaskApiController {
@GetMapping("/trayList")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "托盘列表", notes = "code,type")
public R<IPage<TaskTrayVO>> trayList(TaskSearchDTO taskSearchDTO, Query query) {
IPage<TaskTrayVO> pages = taskQuestService.selecttrayList(Condition.getPage(query), taskSearchDTO);
return R.data(pages);
public R trayList(TaskSearchDTO taskSearchDTO, Query query) {
Optional<TaskSearchDTO> taskSearchDTO1 = Optional.ofNullable(taskSearchDTO);
if(taskSearchDTO1.isPresent()){
if(ObjectUtils.isNull(taskSearchDTO.getTaskId())){
return R.fail("盘点任务id不能为空");
}
if(ObjectUtils.isNull(taskSearchDTO.getTrayCode())){
return R.fail("托盘编码不能为空");
}
R r= taskQuestService.selecttrayList(Condition.getPage(query), taskSearchDTO);
return r;
}else{
return R.fail("参数未传递!");
}
}
/**

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

@ -34,11 +34,17 @@ public class TaskSearchDTO {
* 搜索code
*/
@ApiModelProperty(value = "搜索code")
private String code;
private String trayCode;
/**
* type
*/
@ApiModelProperty(value = "type(1-手动输入,2-扫描)")
private String type;
/**
* 盘点任务Id
*/
@ApiModelProperty(value = "盘点任务Id")
private Long taskId;
}

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

@ -115,8 +115,8 @@
FROM
logpm_quest_detail lqd
<where>
lqd.quest_type = 4
AND lqd.is_deleted =0 and (lqd.quest_status = 0 or lqd.quest_status = 1)
lqd.quest_type = 4 AND lqd.is_deleted =0 and (lqd.quest_status = 0 or lqd.quest_status = 1)
<if test="param.taskId != null and param.taskId != ''"> and lqd.taskId = #{param.taskId} </if>
<if test="collect != null and @org.apache.commons.collections4.CollectionUtils@isNotEmpty(collect)">
and lqd.warehouse_id in
<foreach collection="collect" item="item" open="(" close=")" separator=",">

2
blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseTrayGoodsMapper.xml

@ -293,7 +293,7 @@
and lwta.id is null
</select>
<select id="SumByTrayId" resultType="java.lang.Integer">
SELECT sum(lwtg.num) FROM logpm_warehouse_tray_goods lwtg where lwtg.is_deleted =0 and lwtg.tray_id =#{id} GROUP BY lwtg.tray_id
SELECT sum(lwtg.num) FROM logpm_warehouse_tray_goods lwtg where lwtg.is_deleted =0 and lwtg.tray_id = #{id} GROUP BY lwtg.tray_id
</select>
</mapper>

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

@ -67,7 +67,13 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
IPage<TaskContractVO> selectcontractList(IPage<TaskContractVO> page, TaskSearchDTO taskSearchDTO);
IPage<TaskTrayVO> selecttrayList(IPage<TaskTrayVO> page, TaskSearchDTO taskSearchDTO);
/**
* 托盘数据
* @param page
* @param taskSearchDTO
* @return
*/
R selecttrayList(IPage<TaskTrayVO> page, TaskSearchDTO taskSearchDTO);
IPage<TaskStripApiVO> selectallocationDetailByStrip(IPage<TaskStripApiVO> page, TaskSearchDTO taskSearchDTO);
}

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

@ -17,20 +17,29 @@
package com.logpm.warehouse.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataTrayEntity;
import com.logpm.basicdata.entity.BasicdataWarehouseEntity;
import com.logpm.basicdata.feign.IBasicdataTrayClient;
import com.logpm.basicdata.feign.IBasicdataWarehouseClient;
import com.logpm.basicdata.vo.BasicdataClientVO;
import com.logpm.distribution.entity.DistributionParcelListEntity;
import com.logpm.distribution.entity.DistributionStockArticleEntity;
import com.logpm.distribution.entity.DistributionStockListEntity;
import com.logpm.distribution.feign.IDistributionParcelListClient;
import com.logpm.distribution.feign.IDistributionStockArticleClient;
import com.logpm.distribution.feign.IDistributionStockClient;
import com.logpm.distribution.feign.IDistributionStockListClient;
import com.logpm.distribution.vo.DistributionStockListVO;
import com.logpm.oldproject.feign.IWarehouseClient;
import com.logpm.warehouse.bean.Resp;
import com.logpm.warehouse.dto.TaskQuestDTO;
import com.logpm.warehouse.dto.TaskSearchDTO;
import com.logpm.warehouse.entity.TaskQuestChildEntity;
import com.logpm.warehouse.entity.TaskQuestEntity;
import com.logpm.warehouse.entity.WarehouseUpdownGoodsEntity;
import com.logpm.warehouse.entity.*;
import com.logpm.warehouse.mapper.QuestDetailMapper;
import com.logpm.warehouse.mapper.WarehouseTrayGoodsMapper;
import com.logpm.warehouse.mapper.WarehouseUpdownGoodsMapper;
import com.logpm.warehouse.service.IQuestDetailService;
import com.logpm.warehouse.service.ITaskQuestChildService;
import com.logpm.warehouse.vo.*;
import com.logpm.warehouse.excel.TaskQuestExcel;
@ -38,18 +47,17 @@ import com.logpm.warehouse.mapper.TaskQuestMapper;
import com.logpm.warehouse.service.ITaskQuestService;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.w3c.dom.css.Rect;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -67,9 +75,13 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
private final ITaskQuestChildService taskQuestChildService;
private final IQuestDetailService questDetailService;
private final WarehouseUpdownGoodsMapper warehouseUpdownGoodsMapper;
private final WarehouseTrayGoodsMapper warehouseTrayGoodsMapper;
private final IBasicdataTrayClient basicdataTrayClient;
private final IDistributionStockListClient distributionStockListClient;
private final IDistributionStockArticleClient distributionStockArticleClient;
@ -234,20 +246,118 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
@Override
public IPage<TaskTrayVO> selecttrayList(IPage<TaskTrayVO> page, TaskSearchDTO taskSearchDTO) {
List<Long> collect = this.getmyWarehouseList();
public R selecttrayList(IPage<TaskTrayVO> page, TaskSearchDTO taskSearchDTO) {
//查询托盘编码
BasicdataTrayEntity trayByTrayCode = basicdataTrayClient.getTrayByTrayCode(taskSearchDTO.getTrayCode());
Optional<BasicdataTrayEntity> trayByTrayCode1 = Optional.ofNullable(trayByTrayCode);
if(!trayByTrayCode1.isPresent()){
Resp.scanFail("托盘码不存在!","托盘码不存在!");
}
List<Long> collect =this.getmyWarehouseList();
baseMapper.setSqlMode();
List<TaskTrayVO> list = baseMapper.selecttrayList(page, taskSearchDTO, collect);
if (!list.isEmpty()) {
List<TaskTrayVO> list = baseMapper.selecttrayList(page,taskSearchDTO,collect);// 查询有没有当次盘点任务的托盘数据
if (!list.isEmpty()){ //有盘点数据
for (TaskTrayVO taskTrayVO : list) {
//查询托盘
//查询托盘上面的数量
Integer i = warehouseTrayGoodsMapper.SumByTrayId(taskTrayVO.getTrayId());
taskTrayVO.setTotal(i);
}
}else{
//添加扫描的托盘信息
//添加托盘上面的数据
}
return page.setRecords(list);
page.setRecords(list);
return R.data(page);
}
/**
* 根据托盘ID查询托盘货位并添加
* @param taskId 盘点ID
* @param warehouseId 仓库ID
* @param trayId 托盘ID
* @return
*/
private int getTaskInventory(Long taskId,Long warehouseId,Long trayId){
List<WarehouseTrayGoodsEntity> warehouseTrayGoodsEntities = warehouseTrayGoodsMapper.selectList(Wrappers.<WarehouseTrayGoodsEntity>query().lambda()
.eq(WarehouseTrayGoodsEntity::getTrayId, trayId)
.eq(WarehouseTrayGoodsEntity::getWarehouseId, warehouseId)
);
if(!warehouseTrayGoodsEntities.isEmpty()){
List<QuestDetailEntity> questDetailList = new ArrayList<>();
warehouseTrayGoodsEntities.forEach( i -> {
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setQuestId(taskId);
switch (i.getAssociationType()){
case "1": //1.订单号
questDetail.setOrderId(i.getAssociationId());
questDetail.setQuestTarget(2);//零担
questDetail.setCategoryName(i.getGoodsName());
break;
case "2": //2运单号
break;
case "3": //3包件码
//查询订单ID
questDetail.setQuestTarget(1);//
questDetail.setOrdePackageCode(i.getAssociationValue());//包条码
questDetail.setOrderPackageId(i.getAssociationId());//包件ID
DistributionParcelListEntity parcelList = new DistributionParcelListEntity();
parcelList.setId(i.getAssociationId());
parcelList.setOrderPackageCode(i.getAssociationValue());
List<DistributionParcelListEntity> parcelList1 = distributionParcelListClient.getParcelList(parcelList);
if(!parcelList1.isEmpty()){
questDetail.setOrderId(parcelList1.get(0).getStockArticleId());
}
break;
case "4": //4库存品
questDetail.setQuestTarget(3);//
DistributionStockListEntity stockListEntity = new DistributionStockListEntity();
stockListEntity.setIncomingBatch(i.getIncomingBatch());
stockListEntity.setWarehouseId(warehouseId);
stockListEntity.setMarketId(i.getMarketId());
stockListEntity.setMaterialId(i.getAssociationId());
DistributionStockListVO queryData = distributionStockListClient.getQueryData(stockListEntity);
Optional<DistributionStockListVO> queryData1 = Optional.ofNullable(queryData);
if(queryData1.isPresent()){
questDetail.setStockId(queryData.getId());
}
break;
}
questDetail.setQuestType(4);//托盘
// questDetail.setOrdePackageCode(4);//托盘
// questDetail.setQuestType(4);//托盘
// questDetail.setQuestType(4);//托盘
questDetailList.add(questDetail);
});
//添加
if(!questDetailList.isEmpty()){
questDetailService.saveBatch(questDetailList);
}
}else{
log.debug("托盘没有货位");
return 0;
}
return 1;
}
@Override
public IPage<TaskStripApiVO> selectallocationDetailByStrip(IPage<TaskStripApiVO> page, TaskSearchDTO taskSearchDTO) {
//查询货位上的所有包条

Loading…
Cancel
Save