新增龙兴发运看板

uat-temp-nht-202502180000-shippingkanban
jason 3 months ago
parent 54ce53f638
commit d765e02a4b

@ -1,8 +1,12 @@
package cn.estsh.i3plus.ext.mes.pcn.api.busi;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanCfgModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanViewModel;
import java.util.List;
public interface IMesShippingKanbanCfgService {
MesShippingKanbanCfgModel queryShippingKanbanCfg(String organizeCode);
void saveShippingKanbanCfg(String organizeCode, MesShippingKanbanCfgModel request);
List<MesShippingKanbanViewModel> queryShippingKanbanContext(String organizeCode);
}

@ -51,4 +51,17 @@ public class MesShippingKanbanCfgController {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
@GetMapping("/queryContext")
@ApiOperation(value = "查询发运看板内容")
public ResultBean queryShippingKanbanContext(String organizeCode) {
try {
organizeCode = !StringUtils.isEmpty(organizeCode) ? organizeCode : AuthUtil.getOrganize().getOrganizeCode();
return ResultBean.success("查询成功").setResultList(shippingKanbanCfgService.queryShippingKanbanContext(organizeCode));
} catch (ImppBusiException imppException) {
return ResultBean.fail(imppException);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
}

@ -2,6 +2,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesShippingKanbanCfgService;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanCfgModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanViewModel;
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
@ -14,8 +15,10 @@ import cn.estsh.i3plus.pojo.mes.util.MesExtEnumUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
@Service
public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgService {
@ -32,7 +35,7 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer
model.setConfig(kanbanCfg);
if (kanbanCfg != null) {
DdlPackBean detailPackBean = DdlPackBean.getDdlPackBean(organizeCode);
DdlPreparedPack.getNumberBiggerEqualPack(kanbanCfg.getId(), "configID", packBean);
DdlPreparedPack.getNumEqualPack(kanbanCfg.getId(), "configID", packBean);
List<MesShippingKanbanCfgDetail> details = shippingKanbanCfgDetailRDao.findByHqlWhere(detailPackBean);
model.setDetails(details);
}
@ -75,4 +78,87 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer
}
}
}
@Override
public List<MesShippingKanbanViewModel> queryShippingKanbanContext(String organizeCode) {
List<MesShippingKanbanViewModel> viewModels = new ArrayList<>();
Map<String, MesShippingKanbanCfgDetail> cfgDetailMap = null;
MesShippingKanbanCfgModel cfgModel = queryShippingKanbanCfg(organizeCode);
if (cfgModel != null && !CollectionUtils.isEmpty(cfgModel.getDetails())) {
cfgDetailMap = cfgModel.getDetails().stream().collect(Collectors.toMap(MesShippingKanbanCfgDetail::getDetailCode, v -> v));
}
for (MesExtEnumUtil.SHIPPING_KANBAN_DETAIL_INDEX index : MesExtEnumUtil.SHIPPING_KANBAN_DETAIL_INDEX.values()) {
MesShippingKanbanCfgDetail cfgDetail = cfgDetailMap != null ? cfgDetailMap.get(index.getValue()) : null;
if (cfgDetail == null || cfgDetail.getIsShow() == null || !cfgDetail.getIsShow() || cfgDetail.getOrderNumber() == null) {
continue;
}
MesShippingKanbanViewModel model = new MesShippingKanbanViewModel();
model.setDetailName(index.getDescription());
model.setOrderNumber(cfgDetail.getOrderNumber());
String rangDescription = "";
if (!StringUtils.isEmpty(cfgDetail.getRangValueLess())) {
rangDescription += "<" + cfgDetail.getRangValueLess();
}
if (!StringUtils.isEmpty(cfgDetail.getRangValueMore())) {
if (StringUtils.isEmpty(rangDescription)) {
rangDescription += "&";
}
rangDescription += ">=" + cfgDetail.getRangValueMore();
}
model.setRangDescription(rangDescription);
List<String> values = null;
switch (index) {
case CLIENT_STOCK_QTY:
values = getClientStockQty(cfgDetail);
break;
case WAIT_SHIPPING_QTY:
values = getWaitShippingQty(cfgDetail);
break;
case CP_WAIT_SHIPPING_QTY:
break;
case WAIT_PRODUCT_QTY:
break;
case LAST_SHIPPING_TIME:
break;
case CP_LAST_SHIPPING_TIME:
break;
case NEXT_SHIPPING_TIME:
break;
case TREE_STOP_WARNING:
break;
case SHIPPING_VIN:
break;
case CP_SHIPPING_VIN:
break;
case TODAY_ONLINE:
break;
case TODAY_SHIPPING:
break;
case TODAY_CAR:
break;
case CLIENT_JPH:
break;
case PRODUCT_JPH:
break;
}
model.setValues(values);
viewModels.add(model);
}
viewModels.sort(Comparator.comparing(MesShippingKanbanViewModel::getOrderNumber));
return viewModels;
}
private List<String> getClientStockQty(MesShippingKanbanCfgDetail cfgDetail) {
List<String> values = new ArrayList<>();
return values;
}
private List<String> getWaitShippingQty(MesShippingKanbanCfgDetail cfgDetail) {
List<String> values = new ArrayList<>();
return values;
}
}

@ -0,0 +1,23 @@
package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class MesShippingKanbanViewModel {
@ApiParam("名称")
private String detailName;
@ApiParam("排序")
private Integer orderNumber;
@ApiParam("计算值")
private List<String> values = new ArrayList<>();
@ApiParam("范围描述")
private String rangDescription;
}
Loading…
Cancel
Save