Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.nl.common.domain.exception.BadRequestException;
|
import org.nl.common.domain.exception.BadRequestException;
|
||||||
import org.nl.common.enums.StatusEnum;
|
import org.nl.common.enums.StatusEnum;
|
||||||
@@ -79,7 +80,9 @@ public class ToPickPlatformTask extends AbstractTask {
|
|||||||
throw new BadRequestException("当前载具存在任务:"+list.stream().map(SchBaseTask::getTask_code).collect(Collectors.joining(",")));
|
throw new BadRequestException("当前载具存在任务:"+list.stream().map(SchBaseTask::getTask_code).collect(Collectors.joining(",")));
|
||||||
}
|
}
|
||||||
StIvtStructattr struct = iStIvtStructattrService.getOne(new QueryWrapper<StIvtStructattr>().eq("vehicle_code", vehicle_code));
|
StIvtStructattr struct = iStIvtStructattrService.getOne(new QueryWrapper<StIvtStructattr>().eq("vehicle_code", vehicle_code));
|
||||||
|
if (ObjectUtils.isEmpty(struct)){
|
||||||
|
throw new BadRequestException("创建任务失败:未找到该物料对应起点仓位");
|
||||||
|
}
|
||||||
SchBaseTask task = new SchBaseTask();
|
SchBaseTask task = new SchBaseTask();
|
||||||
task.setId(IdUtil.getStringId());
|
task.setId(IdUtil.getStringId());
|
||||||
task.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
|
task.setTask_code(CodeUtil.getNewCode("TASK_CODE"));
|
||||||
|
|||||||
@@ -224,42 +224,42 @@ public class CockpitServiceImpl implements CockpitService {
|
|||||||
List<MdMeMaterialbase> materList = cockpitMapper.getMaterInfos();
|
List<MdMeMaterialbase> materList = cockpitMapper.getMaterInfos();
|
||||||
if (ObjectUtil.isNotEmpty(materList)) {
|
if (ObjectUtil.isNotEmpty(materList)) {
|
||||||
List<MdMeMaterialbase> fstockList = materList.stream().filter(r -> "FStockId".equals(r.getProduct_area())).collect(Collectors.toList());
|
List<MdMeMaterialbase> fstockList = materList.stream().filter(r -> "FStockId".equals(r.getProduct_area())).collect(Collectors.toList());
|
||||||
List<MdMeMaterialbase> fstockPalletList = materList.stream().filter(r -> "FStockPallet".equals(r.getProduct_area())).collect(Collectors.toList());
|
List<MdMeMaterialbase> fstockPalletList = materList.stream().filter(r -> "FStockPallet".equals(r.getProduct_area())).collect(Collectors.toList());
|
||||||
if (ObjectUtil.isNotEmpty(fstockList)) {
|
if (ObjectUtil.isNotEmpty(fstockList)) {
|
||||||
getMaterialAnalysis(jsonArray1, obj0, obj1, fstockList);
|
getMaterialAnalysis(jsonArray1, obj0, obj1, fstockList);
|
||||||
} else {
|
|
||||||
obj0.put("total", "0");
|
|
||||||
jsonArray1.add(obj0);
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isNotEmpty(fstockPalletList)) {
|
|
||||||
getMaterialAnalysis(jsonArray2, obj2, obj3, fstockPalletList);
|
|
||||||
} else {
|
|
||||||
obj1.put("total", "0");
|
|
||||||
jsonArray2.add(obj1);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
obj0.put("total", "0");
|
obj0.put("total", "0");
|
||||||
obj1.put("total", "0");
|
|
||||||
jsonArray1.add(obj0);
|
jsonArray1.add(obj0);
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotEmpty(fstockPalletList)) {
|
||||||
|
getMaterialAnalysis(jsonArray2, obj2, obj3, fstockPalletList);
|
||||||
|
} else {
|
||||||
|
obj1.put("total", "0");
|
||||||
jsonArray2.add(obj1);
|
jsonArray2.add(obj1);
|
||||||
}
|
}
|
||||||
jsonObject.put("lx_inventory", jsonArray1);
|
} else {
|
||||||
jsonObject.put("tp_inventory", jsonArray2);
|
obj0.put("total", "0");
|
||||||
log.info("获取实时物料库存信息耗时:{}", System.currentTimeMillis() - startTime3);
|
obj1.put("total", "0");
|
||||||
return null;
|
jsonArray1.add(obj0);
|
||||||
}, pool);
|
jsonArray2.add(obj1);
|
||||||
|
}
|
||||||
|
jsonObject.put("lx_inventory", jsonArray1);
|
||||||
|
jsonObject.put("tp_inventory", jsonArray2);
|
||||||
|
log.info("获取实时物料库存信息耗时:{}", System.currentTimeMillis() - startTime3);
|
||||||
|
return null;
|
||||||
|
}, pool);
|
||||||
task3.exceptionally((e) ->
|
task3.exceptionally((e) ->
|
||||||
{
|
{
|
||||||
log.error("获取实时物料库存信息异常:{}", e.getMessage(), e);
|
log.error("获取实时物料库存信息异常:{}", e.getMessage(), e);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
CompletableFuture<List<Map<String, Object>>> task4 = CompletableFuture.supplyAsync(() -> {
|
CompletableFuture<List<Map<String, Object>>> task4 = CompletableFuture.supplyAsync(() -> {
|
||||||
long startTime4 = System.currentTimeMillis();
|
long startTime4 = System.currentTimeMillis();
|
||||||
List<Map<String, Object>> lx_in_default = new ArrayList<>();
|
List<Map<String, Object>> lx_in_default = new ArrayList<>();
|
||||||
List<Map<String, Object>> lx_out_default = new ArrayList<>();
|
List<Map<String, Object>> lx_out_default = new ArrayList<>();
|
||||||
List<Map<String, Object>> tp_in_default = new ArrayList<>();
|
List<Map<String, Object>> tp_in_default = new ArrayList<>();
|
||||||
List<Map<String, Object>> tp_out_default = new ArrayList<>();
|
List<Map<String, Object>> tp_out_default = new ArrayList<>();
|
||||||
List<TaskInfo> result = cockpitMapper.getTaskCountsByDays();
|
List<TaskInfo> result = cockpitMapper.getTaskCountsByDays();
|
||||||
//料箱库入库
|
//料箱库入库
|
||||||
List<TaskInfo> stockList1 = result.stream()
|
List<TaskInfo> stockList1 = result.stream()
|
||||||
.filter(r -> Integer.parseInt(r.getTask_type()) <= 14 && "FStockId".equals(r.getStor_code()))
|
.filter(r -> Integer.parseInt(r.getTask_type()) <= 14 && "FStockId".equals(r.getStor_code()))
|
||||||
@@ -387,11 +387,11 @@ public class CockpitServiceImpl implements CockpitService {
|
|||||||
|
|
||||||
private static JSONObject getElapsedTime(JSONObject item, List<TaskInfo> stockList1) {
|
private static JSONObject getElapsedTime(JSONObject item, List<TaskInfo> stockList1) {
|
||||||
//计算数量
|
//计算数量
|
||||||
BigDecimal total = stockList1.stream().map(TaskInfo::getQty)
|
BigDecimal total = stockList1.stream().filter(r->StringUtils.isNotBlank(r.getUpdate_time())).map(TaskInfo::getQty)
|
||||||
.reduce(BigDecimal.ZERO, BigDecimal::add).setScale(0, RoundingMode.HALF_UP);
|
.reduce(BigDecimal.ZERO, BigDecimal::add).setScale(0, RoundingMode.HALF_UP);
|
||||||
item.put("total", total);
|
item.put("total", total);
|
||||||
//计算箱数
|
//计算箱数
|
||||||
int box = stockList1.stream()
|
int box = stockList1.stream().filter(r->StringUtils.isNotBlank(r.getUpdate_time()))
|
||||||
.mapToInt(taskInfo -> taskInfo.getVehicle_code().split(",").length)
|
.mapToInt(taskInfo -> taskInfo.getVehicle_code().split(",").length)
|
||||||
.sum();
|
.sum();
|
||||||
item.put("box", box);
|
item.put("box", box);
|
||||||
@@ -423,9 +423,10 @@ public class CockpitServiceImpl implements CockpitService {
|
|||||||
}
|
}
|
||||||
if (ObjectUtil.isNotEmpty(real_qty)) {
|
if (ObjectUtil.isNotEmpty(real_qty)) {
|
||||||
Map<String, BigDecimal> ghRealQtyMap = real_qty.stream()
|
Map<String, BigDecimal> ghRealQtyMap = real_qty.stream()
|
||||||
.collect(Collectors.toMap(
|
.filter(r -> StringUtils.isNotBlank(r.getUpdate_time()))
|
||||||
|
.collect(Collectors.groupingBy(
|
||||||
TaskInfo::getCreate_time,
|
TaskInfo::getCreate_time,
|
||||||
TaskInfo::getQty
|
Collectors.reducing(BigDecimal.ZERO, TaskInfo::getQty, BigDecimal::add)
|
||||||
));
|
));
|
||||||
real_qty_default.forEach(tbItem -> {
|
real_qty_default.forEach(tbItem -> {
|
||||||
String date = (String) tbItem.get("date");
|
String date = (String) tbItem.get("date");
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
`st_ivt_iostorinvdtl` d
|
`st_ivt_iostorinvdtl` d
|
||||||
LEFT JOIN st_ivt_iostorinv i ON d.inv_id = i.id
|
LEFT JOIN st_ivt_iostorinv i ON d.inv_id = i.id
|
||||||
WHERE
|
WHERE
|
||||||
d.`status` = '80'
|
i.`status`='80'
|
||||||
AND i.create_time >=
|
AND i.create_time >=
|
||||||
<choose>
|
<choose>
|
||||||
<when test="days == 0">
|
<when test="days == 0">
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
i.`bill_type` as task_type,
|
i.`bill_type` as task_type,
|
||||||
DATE_FORMAT(i.create_time,'%m-%d') as create_time ,
|
DATE_FORMAT(i.create_time,'%m-%d') as create_time ,
|
||||||
|
i.update_time,
|
||||||
d.stor_code,
|
d.stor_code,
|
||||||
d.qty,
|
d.qty,
|
||||||
d.vehicle_code
|
d.vehicle_code
|
||||||
@@ -45,7 +46,7 @@
|
|||||||
`st_ivt_iostorinvdtl` d
|
`st_ivt_iostorinvdtl` d
|
||||||
LEFT JOIN st_ivt_iostorinv i ON d.inv_id = i.id
|
LEFT JOIN st_ivt_iostorinv i ON d.inv_id = i.id
|
||||||
WHERE
|
WHERE
|
||||||
d.`status` = '80'
|
i.`status` = '80'
|
||||||
AND i.create_time >= CURDATE() - INTERVAL 7 DAY
|
AND i.create_time >= CURDATE() - INTERVAL 7 DAY
|
||||||
</select>
|
</select>
|
||||||
<select id="getPickingTask" resultType="org.nl.wms.pda_manage.cockpit.service.dao.TaskInfo">
|
<select id="getPickingTask" resultType="org.nl.wms.pda_manage.cockpit.service.dao.TaskInfo">
|
||||||
|
|||||||
@@ -93,6 +93,7 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
|
ORDER BY create_time DESC
|
||||||
</select>
|
</select>
|
||||||
<select id="selectChild" resultMap="dataDetail">
|
<select id="selectChild" resultMap="dataDetail">
|
||||||
select
|
select
|
||||||
|
|||||||
Reference in New Issue
Block a user