Browse Source

修复托盘盘点数据无法进行批量提交的问题

training
pref_mail@163.com 1 year ago
parent
commit
aa6a3d4624
  1. 8
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.java
  2. 24
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml
  3. 30
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

8
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

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

@ -161,6 +161,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}

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

@ -707,12 +707,28 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
}*/
BladeUser user = AuthUtil.getUser();
QuestDetailEntity questDetailer = new QuestDetailEntity();
List<QuestDetailEntity> questDetailList = baseMapper.selectTaskInfo(questNum, questDetailer);
List<Long> ids = null;
if(ObjectUtils.isNotNull(taskSearchDTO.getQuestDetailIds())){
for (String questDetailId : taskSearchDTO.getQuestDetailIds()) {
if(ObjectUtils.isNull(ids)){
ids = new ArrayList<>();
}
ids.add(Long.parseLong(questDetailId));
}
}
List<QuestDetailEntity> questDetailList = baseMapper.selectTaskInfoForIds(questNum, questDetailer,ids);
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> questDetailList {}",questDetailList);
// 在库包件状态修改
if(ObjectUtils.isNotNull(taskSearchDTO.getQuestDetailIds()) && ObjectUtils.isNotNull(taskSearchDTO.getQuestDetailIds().get(0)) ){
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){
@ -727,16 +743,24 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
// questDetail.setQuestStatus(1);
list.add(questDetail);
});
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<>();
//处理的包件
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",4);
taskSearchDTO.getQuestDetailList().forEach(i ->{
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",45);
Long taskID;
if(ObjectUtils.isNotNull(i.getId())){
taskID = i.getId();
@ -825,10 +849,14 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
detailEntityList.add(questDetail);
}
});
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",5);
//修改货位
if(!detailEntityList.isEmpty()){
baseMapper.updatePositionCodeList(questNum,detailEntityList);
}
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}",6);
}
return R.success("成功");
}

Loading…
Cancel
Save