|
|
|
@ -54,17 +54,19 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer
|
|
|
|
|
private EntityManager entityManager;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public MesShippingKanbanCfgModel queryShippingKanbanCfg(String organizeCode) {
|
|
|
|
|
public MesShippingKanbanCfgModel queryShippingKanbanCfg(String organizeCode, String shippingGroupCode) {
|
|
|
|
|
MesShippingKanbanCfgModel model = new MesShippingKanbanCfgModel();
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(shippingGroupCode, "shippingGroupCode", packBean);
|
|
|
|
|
MesShippingKanbanCfg kanbanCfg = shippingKanbanCfgRDao.getByProperty(packBean);
|
|
|
|
|
if (kanbanCfg != null) {
|
|
|
|
|
DdlPackBean detailPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(kanbanCfg.getId(), "configID", packBean);
|
|
|
|
|
DdlPreparedPack.getNumEqualPack(kanbanCfg.getId(), "configID", detailPackBean);
|
|
|
|
|
List<MesShippingKanbanCfgDetail> details = shippingKanbanCfgDetailRDao.findByHqlWhere(detailPackBean);
|
|
|
|
|
model.setDetails(details);
|
|
|
|
|
} else {
|
|
|
|
|
kanbanCfg = new MesShippingKanbanCfg();
|
|
|
|
|
kanbanCfg.setShippingGroupCode(shippingGroupCode);
|
|
|
|
|
}
|
|
|
|
|
model.setConfig(kanbanCfg);
|
|
|
|
|
|
|
|
|
@ -95,13 +97,13 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer
|
|
|
|
|
|
|
|
|
|
MesShippingKanbanCfg cfg = request.getConfig();
|
|
|
|
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
|
|
|
|
|
DdlPreparedPack.getStringEqualPack(cfg.getShippingGroupCode(), "shippingGroupCode", packBean);
|
|
|
|
|
MesShippingKanbanCfg oldCfg = shippingKanbanCfgRDao.getByProperty(packBean);
|
|
|
|
|
if (oldCfg == null) {
|
|
|
|
|
cfg.setOrganizeCode(organizeCode);
|
|
|
|
|
ConvertBean.serviceModelInitialize(cfg, username);
|
|
|
|
|
oldCfg = shippingKanbanCfgRDao.insert(cfg);
|
|
|
|
|
} else {
|
|
|
|
|
oldCfg.setShippingGroupCode(cfg.getShippingGroupCode());
|
|
|
|
|
oldCfg.setRefreshFrequency(cfg.getRefreshFrequency());
|
|
|
|
|
oldCfg.setKanbanName(cfg.getKanbanName());
|
|
|
|
|
oldCfg.setOnlinePoint(cfg.getOnlinePoint());
|
|
|
|
@ -130,11 +132,11 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public MesShippingKanbanModel queryShippingKanbanContext(String organizeCode) {
|
|
|
|
|
public MesShippingKanbanModel queryShippingKanbanContext(String organizeCode, String shippingGroupCode) {
|
|
|
|
|
MesShippingKanbanModel model = new MesShippingKanbanModel();
|
|
|
|
|
|
|
|
|
|
Map<String, MesShippingKanbanCfgDetail> cfgDetailMap = null;
|
|
|
|
|
MesShippingKanbanCfgModel cfgModel = queryShippingKanbanCfg(organizeCode);
|
|
|
|
|
MesShippingKanbanCfgModel cfgModel = queryShippingKanbanCfg(organizeCode, shippingGroupCode);
|
|
|
|
|
MesShippingKanbanCfg cfg = cfgModel != null ? cfgModel.getConfig() : null;
|
|
|
|
|
if (cfg == null) {
|
|
|
|
|
return model;
|
|
|
|
@ -1086,10 +1088,17 @@ public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgSer
|
|
|
|
|
.getSingleResult();
|
|
|
|
|
|
|
|
|
|
if (vpCount == null || Objects.equals(vpCount, 0L)) {
|
|
|
|
|
values.add(cfg.getCustJph());
|
|
|
|
|
if (!StringUtils.isEmpty(cfg.getCustJph())) {
|
|
|
|
|
values.add(cfg.getCustJph());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
values.add(vpCount.toString());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (values.isEmpty()) {
|
|
|
|
|
values.add("1");
|
|
|
|
|
}
|
|
|
|
|
return values;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|