|
|
|
@ -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.MesShippingKanbanModel;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanViewModel;
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.util.MesPcnExtConstWords;
|
|
|
|
|
import cn.estsh.i3plus.mes.pcn.util.DateUtil;
|
|
|
|
@ -129,14 +130,35 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<MesShippingKanbanViewModel> queryShippingKanbanContext(String organizeCode) {
|
|
|
|
|
List<MesShippingKanbanViewModel> viewModels = new ArrayList<>();
|
|
|
|
|
public MesShippingKanbanModel queryShippingKanbanContext(String organizeCode) {
|
|
|
|
|
MesShippingKanbanModel model = new MesShippingKanbanModel();
|
|
|
|
|
|
|
|
|
|
Map<String, MesShippingKanbanCfgDetail> cfgDetailMap = null;
|
|
|
|
|
MesShippingKanbanCfgModel cfgModel = queryShippingKanbanCfg(organizeCode);
|
|
|
|
|
MesShippingKanbanCfg cfg = cfgModel != null ? cfgModel.getConfig() : null;
|
|
|
|
|
if (cfg == null) {
|
|
|
|
|
return viewModels;
|
|
|
|
|
return model;
|
|
|
|
|
}
|
|
|
|
|
StringBuilder kabanTitle = new StringBuilder();
|
|
|
|
|
if (!StringUtils.isEmpty(cfg.getShippingGroupCode())) {
|
|
|
|
|
for (String groupCode : cfg.getShippingGroupCode().split(",")) {
|
|
|
|
|
DdlPackBean groupPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(groupCode, "shippingGroupCode", groupPackBean);
|
|
|
|
|
MesPartShippingGroup shippingGroup = partShippingGroupRDao.getByProperty(groupPackBean);
|
|
|
|
|
if (shippingGroup != null) {
|
|
|
|
|
if (kabanTitle.length() > 0) {
|
|
|
|
|
kabanTitle.append(" ");
|
|
|
|
|
}
|
|
|
|
|
kabanTitle.append(shippingGroup.getShippingGroupName());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (kabanTitle.length() > 0) {
|
|
|
|
|
kabanTitle.append("|");
|
|
|
|
|
}
|
|
|
|
|
kabanTitle.append("发运看板");
|
|
|
|
|
model.setKanbanTitle(kabanTitle.toString());
|
|
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(cfgModel.getDetails())) {
|
|
|
|
|
cfgDetailMap = cfgModel.getDetails().stream().collect(Collectors.toMap(MesShippingKanbanCfgDetail::getDetailCode, v -> v));
|
|
|
|
|
}
|
|
|
|
@ -147,9 +169,9 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
MesShippingKanbanViewModel model = new MesShippingKanbanViewModel();
|
|
|
|
|
model.setDetailName(index.getDescription());
|
|
|
|
|
model.setOrderNumber(cfgDetail.getOrderNumber());
|
|
|
|
|
MesShippingKanbanViewModel viewModel = new MesShippingKanbanViewModel();
|
|
|
|
|
viewModel.setDetailName(index.getDescription());
|
|
|
|
|
viewModel.setOrderNumber(cfgDetail.getOrderNumber());
|
|
|
|
|
String rangDescription = "";
|
|
|
|
|
if (!StringUtils.isEmpty(cfgDetail.getRangValueLess())) {
|
|
|
|
|
rangDescription += "<" + cfgDetail.getRangValueLess();
|
|
|
|
@ -160,7 +182,7 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer
|
|
|
|
|
}
|
|
|
|
|
rangDescription += ">=" + cfgDetail.getRangValueMore();
|
|
|
|
|
}
|
|
|
|
|
model.setRangDescription(rangDescription);
|
|
|
|
|
viewModel.setRangDescription(rangDescription);
|
|
|
|
|
List<String> values = null;
|
|
|
|
|
switch (index) {
|
|
|
|
|
case CLIENT_STOCK_QTY:
|
|
|
|
@ -212,12 +234,12 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer
|
|
|
|
|
if (values == null) {
|
|
|
|
|
values = new ArrayList<>();
|
|
|
|
|
}
|
|
|
|
|
model.setValues(values);
|
|
|
|
|
model.setColor(getColor(cfgDetail, values));
|
|
|
|
|
viewModels.add(model);
|
|
|
|
|
viewModel.setValues(values);
|
|
|
|
|
viewModel.setColor(getColor(cfgDetail, values));
|
|
|
|
|
model.getDetails().add(viewModel);
|
|
|
|
|
}
|
|
|
|
|
viewModels.sort(Comparator.comparing(MesShippingKanbanViewModel::getOrderNumber));
|
|
|
|
|
return viewModels;
|
|
|
|
|
model.getDetails().sort(Comparator.comparing(MesShippingKanbanViewModel::getOrderNumber));
|
|
|
|
|
return model;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private String getColor(MesShippingKanbanCfgDetail cfgDetail, List<String> values) {
|
|
|
|
|