|
|
@ -8,6 +8,7 @@ import cn.hutool.core.util.StrUtil; |
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
@ -27,6 +28,8 @@ import org.nl.wms.basedata_manage.service.dao.MdPbStoragevehicleext; |
|
|
|
import org.nl.wms.basedata_manage.service.dao.Structattr; |
|
|
|
import org.nl.wms.basedata_manage.service.dao.mapper.MdPbStoragevehicleextMapper; |
|
|
|
import org.nl.wms.basedata_manage.service.dto.MdPbStoragevehicleextDto; |
|
|
|
import org.nl.wms.sch_manage.enums.TaskStatus; |
|
|
|
import org.nl.wms.sch_manage.service.ISchBaseTaskService; |
|
|
|
import org.nl.wms.sch_manage.service.dao.SchBasePoint; |
|
|
|
import org.nl.wms.sch_manage.service.dao.SchBaseTask; |
|
|
|
import org.nl.wms.sch_manage.service.dao.mapper.SchBasePointMapper; |
|
|
@ -52,6 +55,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.util.*; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
/** |
|
|
|
* @author dsh |
|
|
@ -78,6 +82,12 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i |
|
|
|
@Resource |
|
|
|
private MdPbStoragevehicleextMapper mdPbStoragevehicleextMapper; |
|
|
|
|
|
|
|
/** |
|
|
|
* 任务服务 |
|
|
|
*/ |
|
|
|
@Resource |
|
|
|
private ISchBaseTaskService iSchBaseTaskService; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private IBsrealStorattrService iBsrealStorattrService; |
|
|
|
|
|
|
@ -1058,6 +1068,19 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i |
|
|
|
.eq(IOStorInvDis::getIostorinv_id,whereJson.get("iostorinv_id")) |
|
|
|
); |
|
|
|
|
|
|
|
// 判断此单据下的所有任务有没有完成的
|
|
|
|
boolean is_finish = iSchBaseTaskService.list( |
|
|
|
new QueryWrapper<SchBaseTask>().lambda() |
|
|
|
.in(SchBaseTask::getTask_id, storInvDisList.stream() |
|
|
|
.map(IOStorInvDis::getTask_id) |
|
|
|
.collect(Collectors.toList()) |
|
|
|
) |
|
|
|
).stream() |
|
|
|
.allMatch(row -> row.getTask_status().equals(TaskStatus.FINISHED.getCode())); |
|
|
|
if (!is_finish) { |
|
|
|
throw new BadRequestException("当前有未完成的任务不能强制确认!"); |
|
|
|
} |
|
|
|
|
|
|
|
//需要更新的出入库单明细
|
|
|
|
Set<String> dtlSet = new HashSet<>(); |
|
|
|
|
|
|
@ -1162,7 +1185,6 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i |
|
|
|
// 完成当前分配明细
|
|
|
|
ioStorInvDisMapper.update(ioStorInvDis,new LambdaUpdateWrapper<>(IOStorInvDis.class) |
|
|
|
.set(IOStorInvDis::getWork_status,IOSEnum.INBILL_DIS_STATUS.code("完成")) |
|
|
|
.set(IOStorInvDis::getReal_qty,ioStorInvDis.getPlan_qty()) |
|
|
|
.eq(IOStorInvDis::getIostorinvdis_id,ioStorInvDis.getIostorinvdis_id()) |
|
|
|
); |
|
|
|
|
|
|
@ -1217,7 +1239,6 @@ public class OutBillServiceImpl extends ServiceImpl<IOStorInvMapper,IOStorInv> i |
|
|
|
// 如果分配明细全部完成则更新明细表状态
|
|
|
|
if (countDis == 0){ |
|
|
|
// 更新明细表状态
|
|
|
|
ioStorInvDtl.setReal_qty(ioStorInvDis.getPlan_qty()); |
|
|
|
ioStorInvDtl.setBill_status(IOSEnum.BILL_STATUS.code("完成")); |
|
|
|
ioStorInvDtlMapper.updateById(ioStorInvDtl); |
|
|
|
|
|
|
|