Browse Source

修改盘点数据查询

training
caoyizhong 1 year ago
parent
commit
cad96f4511
  1. 1
      blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicMaterialClient.java
  2. 15
      blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java
  3. 22
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/entity/QuestDetailEntity.java
  4. 89
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/QuestContrastVO.java
  5. 2
      blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/TaskPackagelistVO.java
  6. 2
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/controller/AftersalesWorkOrderController.java
  7. 6
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/IAftersalesWorkOrderService.java
  8. 19
      blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java
  9. 7
      blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java
  10. 13
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/api/WarehouseTaskApiController.java
  11. 53
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/controller/TaskQuestController.java
  12. 1
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/dto/QuestDetailDTO.java
  13. 8
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java
  14. 74
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml
  15. 32
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/ITaskQuestService.java
  16. 237
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

1
blade-service-api/logpm-basic-api/src/main/java/com/logpm/basic/feign/IBasicMaterialClient.java

@ -41,6 +41,7 @@ public interface IBasicMaterialClient {
String GETMATERIAL = API_PREFIX + "/getMaterial";
String GETMATERIALID = API_PREFIX + "/getMaterialId";
String ADDMATERIAL = API_PREFIX + "/addMaterial";
String GETMATERIALLIKE = API_PREFIX + "/getMaterialLike";
/**
* 获取物料基础信息列表

15
blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/feign/IBasicdataClientClient.java

@ -45,14 +45,15 @@ public interface IBasicdataClientClient {
String BASICDATACLIENTUSERENTITYLISTBYUSERID = API_PREFIX + "/BasicdataClientUserEntityListByUserId";
/**
* 获取基础客户表列表
*
* @param current 页号
* @param size 页数
* @return BladePage
*/
* 获取基础客户表列表
*
* @param current 页号
* @param size 页数
* @param customerName
* @return BladePage
*/
@GetMapping(TOP)
BladePage<BasicdataClientEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size);
BladePage<BasicdataClientEntity> top(@RequestParam("current") Integer current, @RequestParam("size") Integer size,@RequestParam("code") String customerName);
@GetMapping(API_PREFIX+"/findByName")
BasicdataClientEntity findByName(@RequestParam String customerName);

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

@ -48,6 +48,13 @@ public class QuestDetailEntity extends TenantEntity {
*/
@ApiModelProperty(value = "预留1")
private String reserve1;
/**
* 预留1
*/
@ApiModelProperty(value = "预留1")
@TableField(exist = false)
private String code;
/**
* 预留2
*/
@ -141,6 +148,21 @@ public class QuestDetailEntity extends TenantEntity {
*/
@ApiModelProperty(value = "货位")
private String positionCode;
/**
* 货位
*/
@ApiModelProperty(value = "一级品")
private String firsts;
/**
* 货位
*/
@ApiModelProperty(value = "二级品")
private String second;
/**
* 货位
*/
@ApiModelProperty(value = "三级品")
private String thirdProduct;
/**
* 托盘码
*/

89
blade-service-api/logpm-warehouse-api/src/main/java/com/logpm/warehouse/vo/QuestContrastVO.java

@ -0,0 +1,89 @@
package com.logpm.warehouse.vo;
import lombok.Data;
/**
* 对比数据实体
*/
@Data
public class QuestContrastVO {
/**
* 订单自编号
*/
private String orderCode;
/**
* 品牌名称
*/
private String brandName;
/**
* 商场 名称
*/
private String mallName;
/***
* 客户名称
*/
private String customerName;
/**
* 三级名称
*/
private String thirdProduct;
/**
* 物料名称
*/
private String materialName;
/**
* 总件数
*/
private String totalNumber;
/**
* 在库数据
*/
private String handQuantity;
/**
* 所在托盘
*/
private String pallet;
/**
* 货物信息
*/
private String goodsAllocation;
/**
* 盘点人
*/
private String updateUser;
/**
* 盘点时间
*/
private String updateTime;
/**
* 盘点数据
*/
private String questNum;
/**
* 差异数
*/
private String differenceNum;
/**
* 托盘码
*/
private String trayCode;
private String trayId;
private String positionCode;
private String allocationId;
/**
* 更新的货物信息
*/
private String groundingPositionCode;
/**
* 货物状态
*/
private String questStatusName;
}

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

@ -26,7 +26,7 @@ public class TaskPackagelistVO {
* 运单号
*/
@ApiModelProperty(value = "运单号")
private String waybillNub;
private String waybillNumber;
/**
* 库位信息

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

@ -118,7 +118,7 @@ public class AftersalesWorkOrderController extends BladeController {
@ApiOperationSupport(order = 6)
@ApiOperation(value = "新增或修改", notes = "传入aftersalesWorkOrder")
public R submit(@Valid @RequestBody AftersalesWorkOrderEntity aftersalesWorkOrder) {
return R.status(aftersalesWorkOrderService.saveOrUpdate(aftersalesWorkOrder));
return R.status(aftersalesWorkOrderService.saveOrUpdateOwn(aftersalesWorkOrder));
}
/**

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

@ -49,4 +49,10 @@ public interface IAftersalesWorkOrderService extends BaseService<AftersalesWorkO
*/
List<AftersalesWorkOrderExcel> exportAftersalesWorkOrder(Wrapper<AftersalesWorkOrderEntity> queryWrapper);
/**
* 工单添加和修改
* @param aftersalesWorkOrder
* @return
*/
boolean saveOrUpdateOwn(AftersalesWorkOrderEntity aftersalesWorkOrder);
}

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

@ -16,6 +16,7 @@
*/
package com.logpm.aftersales.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.logpm.aftersales.entity.AftersalesWorkOrderEntity;
import com.logpm.aftersales.vo.AftersalesWorkOrderVO;
import com.logpm.aftersales.excel.AftersalesWorkOrderExcel;
@ -51,4 +52,22 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl<AftersalesWo
return aftersalesWorkOrderList;
}
/**
* 添加或修改
* @param aftersalesWorkOrder
* @return
*/
@Override
public boolean saveOrUpdateOwn(AftersalesWorkOrderEntity aftersalesWorkOrder) {
if(ObjectUtils.isNull(aftersalesWorkOrder.getId())){
//新增
return baseMapper.insert(aftersalesWorkOrder) > 0 ? true : false;
}else{
//修改
return baseMapper.updateById(aftersalesWorkOrder) > 0 ? true : false;
}
}
}

7
blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/feign/BasicdataClientClient.java

@ -18,6 +18,7 @@ package com.logpm.basicdata.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.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.logpm.basicdata.entity.BasicdataClientEntity;
@ -52,11 +53,13 @@ public class BasicdataClientClient implements IBasicdataClientClient {
@Override
@GetMapping(TOP)
public BladePage<BasicdataClientEntity> top(Integer current, Integer size) {
public BladePage<BasicdataClientEntity> top(Integer current, Integer size, String customerName) {
Query query = new Query();
query.setCurrent(current);
query.setSize(size);
IPage<BasicdataClientEntity> page = basicdataClientService.page(Condition.getPage(query));
QueryWrapper<BasicdataClientEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.like(ObjectUtils.isNotNull(customerName),"client_name",customerName);
IPage<BasicdataClientEntity> page = basicdataClientService.page(Condition.getPage(query),queryWrapper);
return BladePage.of(page);
}

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

@ -128,7 +128,7 @@ public class WarehouseTaskApiController {
* @return
*/
@PostMapping("/addDataInfo")
public R addDataInfo(TaskSearchDTO taskSearchDTO){
public R addDataInfo(@RequestBody TaskSearchDTO taskSearchDTO){
//当前登录人选择的仓库
BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse();
if(Objects.isNull(myCurrentWarehouse)){
@ -140,7 +140,16 @@ public class WarehouseTaskApiController {
}
/**
* 查询商场名称
*/
@GetMapping("/getMaterialName")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "查询商场名称", notes = "code,type")
public R getMaterialName(Query query,TaskSearchDTO taskSearchDTO) {
R r = taskQuestService.getMaterialName(taskSearchDTO,Condition.getPage(query));
return r;
}

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

@ -16,7 +16,9 @@
*/
package com.logpm.warehouse.controller;
import com.logpm.warehouse.dto.QuestDetailDTO;
import com.logpm.warehouse.dto.TaskQuestDTO;
import com.logpm.warehouse.vo.QuestContrastVO;
import com.logpm.warehouse.vo.QuestDetailVO;
import com.logpm.warehouse.wrapper.TaskQuestVOWrapper;
import io.swagger.annotations.Api;
@ -108,6 +110,47 @@ public class TaskQuestController extends BladeController {
return R.data(list);
}
/**
* 查询盘点数据
* @return
*/
@GetMapping("/getDetailInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "盘点任务 查询盘点数据", notes = "传入id")
public R<IPage<QuestDetailVO>> selectDataInfo(QuestDetailDTO questDetailDTO,Query query){
IPage<QuestDetailVO> page = taskQuestService.selectTaskDataInfo(questDetailDTO,Condition.getPage(query));
return R.data(page);
}
/**
* 查询盘点对比数据
* @return
*/
@GetMapping("/getContrastInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "盘点任务 查询盘点对比数据", notes = "传入id")
public R<List<QuestContrastVO>> getContrastInfo(QuestDetailDTO questDetailDTO, Query query){
List<QuestContrastVO> page = taskQuestService.getContrastInfo(questDetailDTO,Condition.getPage(query));
return R.data(page);
}
/**
* 修改盘点数据
* @return
*/
@PutMapping("/updateDetailInfo")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "盘点任务 修改盘点数据", notes = "传入id")
public R<IPage<QuestDetailVO>> updateDataInfo(@RequestBody List<QuestDetailDTO> questDetailDTO){
Boolean b = taskQuestService.updateDataInfo(questDetailDTO);
return b ? R.success("修改成功!") : R.fail("修改失败!");
}
/**
* 盘点任务 分页
*/
@ -150,6 +193,16 @@ public class TaskQuestController extends BladeController {
return R.status(taskQuestService.updateByIdCustom(taskQuest));
}
/**
* 盘点任务 修改时间
*/
@PutMapping("/updateDate")
@ApiOperationSupport(order = 5)
@ApiOperation(value = "修改时间", notes = "传入taskQuest")
public R updateDate(@Valid @RequestBody TaskQuestDTO taskQuest) {
return R.status(taskQuestService.updateDate(taskQuest));
}
/**
* 盘点任务 新增或修改
*/

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

@ -31,6 +31,7 @@ import lombok.EqualsAndHashCode;
public class QuestDetailDTO extends QuestDetailEntity {
private static final long serialVersionUID = 1L;
private String questNum;//任务编号
private Integer stockNum;//在库数量

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

@ -151,4 +151,12 @@ public interface TaskQuestMapper extends BaseMapper<TaskQuestEntity> {
*/
Integer updetaQuestDetailChildList(@Param("questNum")String questNum,@Param("list") List<QuestDetailChildEntity> q);
IPage<QuestDetailEntity> selectTaskInfoIPage(IPage<Object> page,@Param("questNum")String questNum,@Param("param") QuestDetailEntity q);
/**
* 查询盘点对比数据
* @param questNum
* @return
*/
List<QuestContrastVO> selectContrastDataInfo(@Param("questNum")String questNum,@Param("param")QuestDetailEntity questDetail);
}

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

@ -108,6 +108,9 @@
`is_new` int(20) NULL DEFAULT NULL COMMENT '是否是新增数据',
`grounding_position_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上架后的完整库位',
`material_code` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '物料编码(库存品)',
`firsts` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '一级品',
`second` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '二级品',
`third_product` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '三级品',
`market_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商场名称(库存品)',
`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 '物料名称(库存品)',
@ -122,14 +125,15 @@
INSERT INTO ${questNum}(`id`, `tenant_id`, `create_user`, `create_time`, `update_user`, `update_time`, `create_dept`,
`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`, `incoming_batch`, `material_name`,
`waybill_number`) VALUES
`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
<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.incomingBatch}, #{item.materialName}, #{item.waybillNumber}
#{item.isNew}, #{item.groundingPositionCode}, #{item.materialCode}, #{item.marketName} , #{item.firsts} , #{item.second} ,
#{item.thirdProduct} , #{item.incomingBatch}, #{item.materialName}, #{item.waybillNumber}
)
</foreach>
@ -147,6 +151,7 @@
<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">
@ -185,6 +190,46 @@
</if>
</where>
</select>
<select id="selectTaskInfoIPage" resultType="com.logpm.warehouse.entity.QuestDetailEntity">
select *
from ${questNum}
<where>
is_deleted = 0
<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.marketNames != null">
and material_name in
<foreach collection="param.marketNames" item="a" open="(" close=")" separator=",">
#{a}
</foreach>
</if>
</where>
</select>
<select id="selectContrastDataInfo" resultType="com.logpm.warehouse.vo.QuestContrastVO" >
select DISTINCT ldpl.order_code orderCode,GROUP_CONCAT(DISTINCT ldpl.brand_name) brandName,GROUP_CONCAT(DISTINCT ldsa.mall_name) mallName
,GROUP_CONCAT(DISTINCT ldsa.customer_name) customerName, p.quest_status questStatus
,GROUP_CONCAT(DISTINCT ldpl.third_product) thirdProduct,GROUP_CONCAT(DISTINCT ldpl.material_name) materialName,ldsa.total_number totalNumber
,ldsa.hand_quantity handQuantity ,p.tray_code trayCode,p.tray_id trayId,p.position_code positionCode,
p.allocation_id allocationId,p.update_user updateUser,p.update_time updateTime,p.grounding_position_code groundingPositionCode
from ${questNum} p
LEFT JOIN logpm_distribution_parcel_list ldpl on p.order_package_id = ldpl.id
LEFT JOIN logpm_distribution_stock_article ldsa on ldsa.id = ldpl.stock_article_id
<where>
p.order_package_id is not null
<if test="param.questId != null and param.questId != ''">and p.quest_id = #{param.questId}</if>
</where>
GROUP BY ldpl.order_code,ldsa.total_number,ldsa.hand_quantity,p.tray_code,p.tray_id,p.position_code,p.allocation_id,p.update_user,
p.update_time,p.grounding_position_code ,p.quest_status
</select>
<select id="selectTaskTrayInfo" resultType="com.logpm.warehouse.entity.QuestDetailEntity">
select *
from ${questNum}
@ -210,10 +255,19 @@
<if test="item.groundingAllocationId != null"> grounding_allocation_id = #{item.groundingAllocationId},</if>
<if test="item.groundingPositionCode != null and item.groundingPositionCode != ''"> grounding_position_code = #{item.groundingPositionCode },</if>
<if test="item.questStatus != null and item.questStatus != ''"> quest_status = #{item.questStatus },</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>
<if test="item. != null and item. != null"> = #{item. }</if>
<if test="item.orderCode != null and item.orderCode != null"> order_code= #{item.orderCode },</if>
<if test="item.orderPackageCode != null and item.orderPackageCode != null"> order_package_code= #{item.orderPackageCode },</if>
<if test="item.categoryName != null and item.categoryName != null">category_name = #{item.categoryName },</if>
<if test="item.positionCode != null and item.positionCode != null">position_code = #{item.positionCode },</if>
<if test="item.trayCode != null and item.trayCode != null">tray_code = #{item.trayCode },</if>
<if test="item.trayId != null and item.trayId != null">tray_id = #{item.trayId },</if>
<if test="item.firsts != null and item.firsts != null">firsts = #{item.firsts },</if>
<if test="item.second != null and item.second != null">second = #{item.second },</if>
<if test="item.thirdProduct != null and item.thirdProduct != null">third_product = #{item.thirdProduct },</if>
<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. != null and item. != null"> = #{item. }</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>-->
@ -299,8 +353,10 @@
<where>
and lqd.quest_type =2
and lqd.is_deleted =0
and lqd.quest_id = #{param.questId}
and lqd.warehouse_id = #{param.warehouseId}
<if test="param.questId != null and param.questId != ''">and lqd.quest_id = #{param.questId} </if>
<if test="param.warehouseId != null and param.warehouseId != ''"> and lqd.warehouse_id = #{param.warehouseId}</if>
<if test="param.allocationId != null and param.allocationId != ''"> and lqd.allocation_id = #{param.allocationId}</if>
and lqd.allocation_id is not null
</where>
GROUP BY lqd.allocation_id,lqd.position_code
</select>

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

@ -18,6 +18,7 @@ package com.logpm.warehouse.service;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.logpm.warehouse.dto.QuestDetailDTO;
import com.logpm.warehouse.dto.TaskQuestDTO;
import com.logpm.warehouse.dto.TaskSearchDTO;
import com.logpm.warehouse.entity.QuestDetailEntity;
@ -199,4 +200,35 @@ public interface ITaskQuestService extends BaseService<TaskQuestEntity> {
* @return
*/
R addDataInfo(TaskSearchDTO taskSearchDTO);
/**
* 查询盘点数据
* @param questDetailDTO
* @return
*/
IPage<QuestDetailVO> selectTaskDataInfo(QuestDetailDTO questDetailDTO, IPage<Object> page);
/**
* 修改盘点数据
* @param questDetailDTO
* @return
*/
Boolean updateDataInfo(List<QuestDetailDTO> questDetailDTO);
/**
* 延迟盘点时间
* @param taskQuest
* @return
*/
boolean updateDate(TaskQuestDTO taskQuest);
List<QuestContrastVO> getContrastInfo(QuestDetailDTO questDetailDTO, IPage<Object> page);
/**
* 查询商家信息
* @param taskSearchDTO
* @param page
* @return
*/
R getMaterialName(TaskSearchDTO taskSearchDTO, IPage<Object> page);
}

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

@ -17,7 +17,6 @@
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;
@ -47,11 +46,11 @@ 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;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.BladePage;
import org.springblade.core.secure.BladeUser;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R;
@ -98,8 +97,10 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
private final IBasicdataGoodsAllocationClient basicdataGoodsAllocationClient;
private final IBasicdataGoodsShelfClient basicdataGoodsShelfClient;
private final IBasicdataGoodsAreaClient basicdataGoodsAreaClient;
private final IBasicdataClientClient basicdataClientClient;
private final IWarehouseTrayTypeService trayTypeService;
private final IWarehouseTaryAllocationService taryAllocationService;
private final IWarehouseGoodsAllocationService warehouseGoodsAllocationService;
@Override
@ -190,6 +191,9 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
detailEntity.setWaybillNumber(i.getWaybillNumber());
detailEntity.setOrderPackageId(i.getId());
detailEntity.setCategoryName(i.getFirsts());
detailEntity.setThirdProduct(i.getThirdProduct());
detailEntity.setFirsts(i.getFirsts());
detailEntity.setSecond(i.getSecond());
detailEntity.setStockId(i.getStockId()); //库存品ID
detailEntity.setQuestStatus(0);
detailEntity.setStockNum(ObjectUtils.isNotNull(i.getQuantity()) ? i.getQuantity() : 0);
@ -643,8 +647,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
case 1: //随机
break;
case 2: //库位
if(ObjectUtils.isNull(taskSearchDTO.getInfoId())){
return R.fail("参数数据不完整!!InfoId");
if(ObjectUtils.isNull(taskSearchDTO.getCode())){
return R.fail("参数数据不完整!!Code");
}
return getAllocationInfo(taskSearchDTO);
@ -679,11 +683,14 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
/*if(ObjectUtils.isNull(taskSearchDTO.getQuestDetailIds())){
return R.fail("待处理的包件为空!QuestNum");
}*/
BladeUser user = AuthUtil.getUser();
// 在库包件状态修改
if(ObjectUtils.isNotNull(taskSearchDTO.getQuestDetailIds())){
List<QuestDetailEntity> list = new ArrayList<>();
taskSearchDTO.getQuestDetailIds().forEach( i ->{
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setUpdateUser(user.getUserId());
questDetail.setUpdateTime(new Date());
questDetail.setId(Long.valueOf(i));
questDetail.setQuestStatus(1);
list.add(questDetail);
@ -703,9 +710,21 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
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);
@ -730,6 +749,15 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
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());
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());
@ -754,12 +782,119 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
return R.success("成功");
}
/**
* PC查询盘点数据
* @param questDetailDTO
* @return
*/
@Override
public IPage<QuestDetailVO> selectTaskDataInfo(QuestDetailDTO questDetailDTO,IPage<Object> page) {
QuestDetailEntity questDetail = new QuestDetailEntity();
BeanUtil.copyProperties(questDetailDTO,questDetail);
// List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(questDetailDTO.getQuestNum(), questDetail);
IPage<QuestDetailEntity> questDetailEntityIPage = baseMapper.selectTaskInfoIPage(page, questDetailDTO.getQuestNum(), questDetail);
IPage<QuestDetailVO> page1 = new Page<>();
List<QuestDetailVO> questDetailVOS = new ArrayList<>();
questDetailEntityIPage.getRecords().stream().forEach( i ->{
QuestDetailVO questDetailVO = new QuestDetailVO();
BeanUtil.copyProperties(i,questDetailVO);
questDetailVOS.add(questDetailVO);
});
page1.setRecords(questDetailVOS);
page1.setTotal(questDetailEntityIPage.getTotal());
page1.setCurrent(questDetailEntityIPage.getCurrent());
page1.setPages(questDetailEntityIPage.getPages());
page1.setSize(questDetailEntityIPage.getSize());
return page1;
}
/**
* 批量修改盘点数据
* @param questDetailDTO
* @return
*/
@Override
public Boolean updateDataInfo(List<QuestDetailDTO> questDetailDTO) {
if(ObjectUtils.isNotNull(questDetailDTO)){
questDetailDTO.stream().collect(Collectors.groupingBy(QuestDetailDTO::getQuestNum)).forEach((k,v) ->{
List<QuestDetailEntity> list = new ArrayList<>();
v.stream().forEach( i ->{
if(ObjectUtils.isNotNull(i.getQuestId())){
QuestDetailEntity questDetail = new QuestDetailEntity();
BeanUtil.copyProperties(i,questDetail);
if(ObjectUtils.isNotNull(i.getPositionCode())){
i.setGroundingPositionCode(i.getPositionCode());
i.setPositionCode(null);
}
list.add(questDetail);
}
});
if(!list.isEmpty()){
baseMapper.updatePositionCodeList(k,list);
}
});
return true;
}else{
return false;
}
}
/**
* 修改延期时间
* @param taskQuest
* @return
*/
@Override
public boolean updateDate(TaskQuestDTO taskQuest) {
TaskQuestEntity questDetail = new TaskQuestEntity();
BeanUtil.copyProperties(taskQuest,questDetail);
return baseMapper.updateById(questDetail) > 0 ? true : false;
}
/**
* 查询盘点对比数据
* @param questDetailDTO
* @param page
* @return
*/
@Override
public List<QuestContrastVO> getContrastInfo(QuestDetailDTO questDetailDTO, IPage<Object> page) {
List<QuestContrastVO> list = baseMapper.selectContrastDataInfo(questDetailDTO.getQuestNum(),questDetailDTO);
return null;
}
/**
* 查询商场数据
* @param taskSearchDTO
* @param page
* @return
*/
@Override
public R getMaterialName(TaskSearchDTO taskSearchDTO, IPage<Object> page) {
BladePage<BasicdataClientEntity> top = basicdataClientClient.top((int) page.getCurrent(), (int) page.getSize(), taskSearchDTO.getCode());
return R.data(top);
}
/**
* 查询货位上的数据
* @param taskSearchDTO
* @return
*/
public R getAllocationInfo(TaskSearchDTO taskSearchDTO){
// List<TaskDataVO> lists = new ArrayList<>();
TaskDataVO taskDataVO = new TaskDataVO();
String questNum = taskSearchDTO.getQuestNum();
Long questId = taskSearchDTO.getQuestId();
@ -768,7 +903,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setQuestId(questId);
questDetail.setWarehouseId(warehouseId);
questDetail.setAllocationId(String.valueOf(taskSearchDTO.getInfoId()));
questDetail.setAllocationId(code);
List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(questNum,questDetail);
if(ObjectUtils.isNull(questDetailEntities)){
return R.success("没有数据!!");
@ -777,18 +912,19 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
for (QuestDetailEntity questDetailEntity : questDetailEntities) {
TaskPackagelistVO packagelistVO = new TaskPackagelistVO();
BeanUtil.copyProperties(questDetailEntity, packagelistVO);
packagelistVO.setAllocation(questDetailEntity.getPositionCode());
if(taskSearchDTO.getTypeState().equals(1)){
//有
if(questDetailEntity.getQuestTarget().equals(2) || ObjectUtils.isNull( questDetailEntity.getOrderPackageId())){
continue;
}
//查询包件信息
DistributionParcelListEntity distributionParcelList = new DistributionParcelListEntity();
distributionParcelList.setId(questDetailEntity.getOrderPackageId());
List<DistributionParcelListEntity> parcelList = distributionParcelListClient.getParcelList(distributionParcelList);
if(ObjectUtils.isNull(parcelList)){ //去除没有用包件的数据
continue;
}
// DistributionParcelListEntity distributionParcelList = new DistributionParcelListEntity();
// distributionParcelList.setId(questDetailEntity.getOrderPackageId());
// List<DistributionParcelListEntity> parcelList = distributionParcelListClient.getParcelList(distributionParcelList);
// if(ObjectUtils.isNull(parcelList)){ //去除没有用包件的数据
// continue;
// }
}else{
//没有
@ -797,20 +933,38 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
}
QuestDetailChildEntity questDetailChildEntity = new QuestDetailChildEntity();
questDetailChildEntity.setQuestDetailId(questDetailEntity.getId());
questDetailChildEntity.setWarehouseId(taskSearchDTO.getWarehouseId());
List<QuestDetailChildEntity> questDetailChildEntities = baseMapper.selectQuestDetailChildInfo(questNum+"_child", questDetailChildEntity);
if(ObjectUtils.isNotNull(questDetailChildEntities)){
//有处理的数
packagelistVO.setQuestChildVOList(questDetailChildEntities);
}
list.add(packagelistVO);
}
taskDataVO.setList(list);
return R.data(list);
// lists.add(taskDataVO);
return R.data(taskDataVO);
}
@Override
public List<TaskallocationVO> selectallocationList(TaskSearchDTO taskSearchDTO) {
try {
TaskQuestEntity taskQuestEntity = baseMapper.selectById(taskSearchDTO.getQuestId());
List<TaskallocationVO> list = baseMapper.selectallocationList(taskQuestEntity.getQuestNum(),taskSearchDTO);
List<TaskallocationVO> list = baseMapper.selectallocationList(taskSearchDTO.getQuestNum(),taskSearchDTO);
if(list.isEmpty()){
//查询货物信息
WarehouseGoodsAllocationEntity byId = warehouseGoodsAllocationService.getById(taskSearchDTO.getAllocationId());
if(ObjectUtils.isNotNull(byId)){
TaskallocationVO taskallocationVO = new TaskallocationVO();
taskallocationVO.setAllocationId(taskSearchDTO.getAllocationId());
taskallocationVO.setPositionCode(byId.getGoodsAllocationName());
list.add(taskallocationVO);
}
}
return list;
}catch (Exception e){
log.debug(e.getMessage());
@ -835,16 +989,20 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
// .eq(QuestDetailEntity::getQuestType, 3)
// .eq(QuestDetailEntity::getQuestId, taskSearchDTO.getTaskId());
List<TaskContractVO> list = new ArrayList<>();
TaskQuestEntity taskQuestEntity = baseMapper.selectById(taskSearchDTO.getQuestId());
QuestDetailEntity questDetail = new QuestDetailEntity();
questDetail.setQuestId( taskSearchDTO.getQuestId());
questDetail.setQuestType(3);
if(ObjectUtils.isNotNull(taskSearchDTO.getCode())){
questDetail.setCode(taskSearchDTO.getCode());
}else{
questDetail.setQuestType(3);
}
questDetail.setWarehouseId(taskSearchDTO.getWarehouseId());
IPage<TaskContractVO> taskPageList = new Page<>();
List<QuestDetailEntity> questDetailEntityList = baseMapper.selectTaskInfo( taskQuestEntity.getQuestNum(),questDetail);
List<QuestDetailEntity> questDetailEntityList = baseMapper.selectTaskInfo( taskSearchDTO.getQuestNum(),questDetail);
if (Func.isEmpty(questDetailEntityList)){
return null;
}
Map<Integer, List<QuestDetailEntity>> questDetailMap = questDetailEntityList.stream().collect(Collectors.groupingBy(QuestDetailEntity::getQuestTarget));
/*Map<Integer, List<QuestDetailEntity>> questDetailMap = questDetailEntityList.stream().collect(Collectors.groupingBy(QuestDetailEntity::getQuestTarget));
//订制品
List<QuestDetailEntity> questDetailEntities = questDetailMap.get(1);
List<QuestDetailEntity> zeroQuestDetailEntities = questDetailMap.get(2);
@ -902,7 +1060,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
list.add(taskContractVO);
}
}
}*/
return taskPageList.setRecords(list);
}
@ -1061,7 +1219,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
* 托盘ID信息货物处理
* @return
*/
private TaskDataVO getTaskTrayInfoOwn(List<QuestDetailEntity> list1,String type,Long warehouseId){
private TaskDataVO getTaskTrayInfoOwn(TaskSearchDTO taskSearchDTO,List<QuestDetailEntity> list1,String type,Long warehouseId){
TaskDataVO taskDataVO = new TaskDataVO();
List<TaskPackagelistVO> taskPackagelistVOS = new ArrayList<>();
list1.stream().collect(Collectors.groupingBy(QuestDetailEntity::getTrayId))
@ -1081,10 +1239,10 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
continue;
}
//查询包件信息
DistributionParcelListEntity byPacketBarCode = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(p.getOrderPackageCode(),warehouseId);
if(ObjectUtils.isNull(byPacketBarCode)){ //去除没有用包件的数据
continue;
}
// DistributionParcelListEntity byPacketBarCode = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(p.getOrderPackageCode(),warehouseId);
// if(ObjectUtils.isNull(byPacketBarCode)){ //去除没有用包件的数据
// continue;
// }
packagelistVO.setQuestDetailId(p.getId());
packagelistVO.setQuantity(p.getStockNum());
packagelistVO.setState(String.valueOf(p.getQuestTarget()));
@ -1098,6 +1256,15 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
packagelistVO.setQuantity(p.getStockNum());
packagelistVO.setState(String.valueOf(p.getQuestTarget()));
}
//查询盘点过后的数据
QuestDetailChildEntity questDetailChildEntity = new QuestDetailChildEntity();
questDetailChildEntity.setQuestDetailId(p.getId());
questDetailChildEntity.setWarehouseId(taskSearchDTO.getWarehouseId());
List<QuestDetailChildEntity> questDetailChildEntities = baseMapper.selectQuestDetailChildInfo(taskSearchDTO.getQuestNum()+"_child", questDetailChildEntity);
if(ObjectUtils.isNotNull(questDetailChildEntities)){
//有处理的数
packagelistVO.setQuestChildVOList(questDetailChildEntities);
}
taskPackagelistVOS.add(packagelistVO);
// TaskQuestEntity taskQuestEntity = baseMapper.selectById(p.getQuestId());
// num.set(num.get() + p.getStockNum());
@ -1165,7 +1332,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
List<QuestDetailEntity> questDetailList = getQuestDetailList( taskSearchDTO, myCurrentWarehouse.getId(), trayByTrayCode.getId());
return R.data(getTaskTrayInfoOwn(questDetailList, String.valueOf(taskSearchDTO.getTypeState()), myCurrentWarehouse.getId()));
return R.data(getTaskTrayInfoOwn(taskSearchDTO,questDetailList, String.valueOf(taskSearchDTO.getTypeState()), myCurrentWarehouse.getId()));
}
@ -1869,6 +2036,7 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
QuestDetailEntity detailEntity = new QuestDetailEntity();
detailEntity.setQuestId(taskSearchDTO.getQuestId());
detailEntity.setWarehouseId(taskSearchDTO.getWarehouseId());
detailEntity.setCode(taskSearchDTO.getCode());
//查询订单数据
List<QuestDetailEntity> questDetailEntities = baseMapper.selectTaskInfo(questNum,detailEntity);
@ -1886,12 +2054,12 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
continue;
}
//查询包件信息
DistributionParcelListEntity distributionParcelList = new DistributionParcelListEntity();
distributionParcelList.setId(questDetailEntity.getOrderPackageId());
DistributionParcelListEntity parcelList = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(questDetailEntity.getOrderPackageCode(),taskSearchDTO.getWarehouseId());
if(ObjectUtils.isNull(parcelList)){ //去除没有用包件的数据
continue;
}
// DistributionParcelListEntity distributionParcelList = new DistributionParcelListEntity();
// distributionParcelList.setId(questDetailEntity.getOrderPackageId());
// DistributionParcelListEntity parcelList = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(questDetailEntity.getOrderPackageCode(),taskSearchDTO.getWarehouseId());
// if(ObjectUtils.isNull(parcelList)){ //去除没有用包件的数据
// continue;
// }
}else{
//没有
@ -1901,7 +2069,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}
QuestDetailChildEntity questDetailChildEntity = new QuestDetailChildEntity();
questDetailChildEntity.setQuestDetailId(questDetailEntity.getId());
List<QuestDetailChildEntity> questDetailChildEntities = baseMapper.selectQuestDetailChildInfo(questNum, questDetailChildEntity);
questDetailChildEntity.setWarehouseId(taskSearchDTO.getWarehouseId());
List<QuestDetailChildEntity> questDetailChildEntities = baseMapper.selectQuestDetailChildInfo(questNum+"_child", questDetailChildEntity);
if(ObjectUtils.isNotNull(questDetailChildEntities)){
//有处理的数
packagelistVO.setQuestChildVOList(questDetailChildEntities);

Loading…
Cancel
Save