Browse Source

1.干线-bug修复

chenglong
zhenghaoyu 1 year ago
parent
commit
8b57d48137
  1. 5
      blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDetailDTO.java
  2. 29
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java
  3. 1
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java
  4. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml
  5. 4
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.java
  6. 18
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml
  7. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java
  8. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java
  9. 2
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java
  10. 27
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java
  11. 5
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  12. 29
      blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java

5
blade-service-api/logpm-trunkline-api/src/main/java/com/logpm/trunkline/dto/AdvanceDetailDTO.java

@ -3,6 +3,9 @@ package com.logpm.trunkline.dto;
import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class AdvanceDetailDTO extends TrunklineAdvanceDetailEntity {
@ -11,4 +14,6 @@ public class AdvanceDetailDTO extends TrunklineAdvanceDetailEntity {
private Long advanceId;
private List<Long> advanceDetailIds = new ArrayList<>();
}

29
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java

@ -17,6 +17,7 @@ import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@ -74,4 +75,32 @@ public class AdvanceDetailController {
}
@ResponseBody
@PostMapping("/deleteAdvanceDetail")
@ApiOperationSupport(order = 1)
@ApiOperation(value = "暂存单分页列表", notes = "传入advanceDetailDTO")
public R deleteAdvanceDetail(@RequestBody AdvanceDetailDTO advanceDetailDTO) {
String method = "############deleteAdvanceDetail: ";
log.info(method+"请求参数{}",advanceDetailDTO);
try{
List<Long> advanceDetailIds = advanceDetailDTO.getAdvanceDetailIds();
if(0 == advanceDetailIds.size()){
log.warn(method+"请选择删除的包件");
return R.fail(405,"请选择删除的包件");
}
return advanceDetailService.deleteAdvanceDetail(advanceDetailDTO);
}catch (CustomerException e){
log.error(e.message,e);
return R.fail(e.code,e.message);
}catch (Exception e){
log.error(method+"系统异常",e);
return R.fail(500,"系统异常");
}
}
}

1
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.java

@ -36,4 +36,5 @@ public interface TrunklineAdvanceDetailMapper extends BaseMapper<TrunklineAdvanc
List<String> findOrderPackageCodesByAdvanceId(@Param("advanceId") Long advanceId);
void deleteAdvanceDetailById(@Param("advanceDetailId") Long advanceDetailId);
}

6
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceDetailMapper.xml

@ -144,4 +144,10 @@
where advance_id = #{advanceId}
</select>
<delete id="deleteAdvanceDetailById">
delete from logpm_trunkline_advance_detail
where id = #{advanceDetailId}
</delete>
</mapper>

4
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.java

@ -26,4 +26,8 @@ public interface TrunklineAdvanceMapper extends BaseMapper<TrunklineAdvanceEntit
List<CustomerInfoVO> findCustomerInfoList(@Param("advanceIds") List<Long> advanceIds);
void updateTotalNumById(@Param("id") Long id, @Param("totalNum") int totalNum);
void deletedAdvance(@Param("advanceIds") List<Long> advanceIds);
void subTotalNumByAdvanceId(@Param("advanceId") Long advanceId);
}

18
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineAdvanceMapper.xml

@ -97,4 +97,22 @@
where id = #{id}
</update>
<delete id="deletedAdvance" >
delete from logpm_trunkline_advance
<where>
<if test="advanceIds != null and advanceIds.size() != 0">
and id in
<foreach collection="advanceIds" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</delete>
<update id="subTotalNumByAdvanceId" >
update logpm_trunkline_advance
set total_num = total_num - 1
where id = #{advanceId}
</update>
</mapper>

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java

@ -9,6 +9,7 @@ import com.logpm.trunkline.vo.AdvanceDetailStockNumVO;
import com.logpm.trunkline.vo.BillladingPackageVO;
import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.tool.api.R;
import java.util.List;
import java.util.Map;
@ -45,4 +46,5 @@ public interface ITrunklineAdvanceDetailService extends BaseService<TrunklineAdv
void deleteByAdvanceId(Long advanceId);
R deleteAdvanceDetail(AdvanceDetailDTO advanceDetailDTO);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceService.java

@ -28,4 +28,6 @@ public interface ITrunklineAdvanceService extends BaseService<TrunklineAdvanceEn
TrunklineAdvanceEntity findEntityByOrderCodeAndTrainNumber(String orderCode, String trainNumber);
void updateTotalNumById(Long id, int totalNum);
void deletedAdvance(List<Long> advanceIds);
}

2
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java

@ -735,7 +735,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService {
for (Long advanceId:advanceIds){
advanceDetailService.deleteByAdvanceId(advanceId);
}
advanceService.deleteLogic(advanceIds);
advanceService.deletedAdvance(advanceIds);
}
@Override

27
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java

@ -26,6 +26,7 @@ import org.springblade.common.utils.QRCodeUtil;
import org.springblade.common.utils.TemplateUtil;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
@ -193,4 +194,30 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl<Trunkline
.eq("is_deleted",0);
baseMapper.delete(queryWrapper);
}
@Override
public R deleteAdvanceDetail(AdvanceDetailDTO advanceDetailDTO) {
List<Long> advanceDetailIds = advanceDetailDTO.getAdvanceDetailIds();
for (Long advanceDetailId : advanceDetailIds) {
TrunklineAdvanceDetailEntity advanceDetailEntity = getById(advanceDetailId);
Long advanceId = advanceDetailEntity.getAdvanceId();
baseMapper.deleteAdvanceDetailById(advanceDetailId);
//判断暂存单下还有没有包件
List<String> strings = baseMapper.findOrderPackageCodesByAdvanceId(advanceId);
if(0 == strings.size()){
//删除暂存单
List<Long> advanceIds = new ArrayList<>();
advanceIds.add(advanceId);
advanceMapper.deletedAdvance(advanceIds);
}else{
//数量减一
advanceMapper.subTotalNumByAdvanceId(advanceId);
}
}
return R.success("删除成功");
}
}

5
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -320,4 +320,9 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
baseMapper.updateTotalNumById(id,totalNum);
}
@Override
public void deletedAdvance(List<Long> advanceIds) {
baseMapper.deletedAdvance(advanceIds);
}
}

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

@ -765,21 +765,24 @@ public class TaskQuestServiceImpl extends BaseServiceImpl<TaskQuestMapper, TaskQ
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}", 1);
List<QuestDetailEntity> list = new ArrayList<>();
AtomicBoolean s = new AtomicBoolean(false);
taskSearchDTO.getQuestDetailIds().forEach(i -> {
taskSearchDTO.getQuestDetailIds().stream().forEach(i -> {
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}", i);
if(ObjectUtils.isNotNull(i)){
//查询当前包件盘点状态
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());
list.add(questDetail);
}
//查询当前包件盘点状态
// 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);
});
log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}", 1);

Loading…
Cancel
Save