forked from I3-YF/i3plus-mes-pcn-yfai
新增龙兴发运看板
parent
62683d21c4
commit
54ce53f638
@ -0,0 +1,4 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.api.busi;
|
||||||
|
|
||||||
|
public interface IMesShippingKanbanCfgDetailService {
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.api.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanCfgModel;
|
||||||
|
|
||||||
|
public interface IMesShippingKanbanCfgService {
|
||||||
|
MesShippingKanbanCfgModel queryShippingKanbanCfg(String organizeCode);
|
||||||
|
void saveShippingKanbanCfg(String organizeCode, MesShippingKanbanCfgModel request);
|
||||||
|
}
|
@ -0,0 +1,54 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesShippingKanbanCfgService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.model.MesShippingKanbanCfgModel;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesLoadingList;
|
||||||
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
||||||
|
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
|
||||||
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 产线与班组的对应关系
|
||||||
|
* @Author: gsz
|
||||||
|
* @Date: 2024/5/25 18:16
|
||||||
|
* @Modify:
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesShippingKanbanCfg")
|
||||||
|
public class MesShippingKanbanCfgController {
|
||||||
|
@Autowired
|
||||||
|
private IMesShippingKanbanCfgService shippingKanbanCfgService;
|
||||||
|
|
||||||
|
@GetMapping("/query")
|
||||||
|
@ApiOperation(value = "查询发运看板配置项")
|
||||||
|
public ResultBean queryShippingKanbanCfg(String organizeCode) {
|
||||||
|
try {
|
||||||
|
organizeCode = !StringUtils.isEmpty(organizeCode) ? organizeCode : AuthUtil.getOrganize().getOrganizeCode();
|
||||||
|
return ResultBean.success("查询成功").setResultObject(shippingKanbanCfgService.queryShippingKanbanCfg(organizeCode));
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/save")
|
||||||
|
@ApiOperation(value = "保存发运看板配置项")
|
||||||
|
public ResultBean saveShippingKanbanCfg(@RequestBody MesShippingKanbanCfgModel request) {
|
||||||
|
try {
|
||||||
|
String organizeCode = !StringUtils.isEmpty(request.getOrganizeCode()) ? request.getOrganizeCode() : AuthUtil.getOrganize().getOrganizeCode();
|
||||||
|
shippingKanbanCfgService.saveShippingKanbanCfg(organizeCode, request);
|
||||||
|
return ResultBean.success("保存成功");
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,16 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 产线与班组的对应关系
|
||||||
|
* @Author: gsz
|
||||||
|
* @Date: 2024/5/25 18:16
|
||||||
|
* @Modify:
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesShippingKanbanCfgDetail")
|
||||||
|
public class MesShippingKanbanCfgDetailController {
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesShippingKanbanCfgDetailService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class MesShippingKanbanCfgDetailServiceImpl implements IMesShippingKanbanCfgDetailService {
|
||||||
|
}
|
@ -0,0 +1,78 @@
|
|||||||
|
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.util.MesPcnExtConstWords;
|
||||||
|
import cn.estsh.i3plus.platform.common.tool.TimeTool;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||||
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingKanbanCfg;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingKanbanCfgDetail;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.repository.MesShippingKanbanCfgDetailRepository;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.repository.MesShippingKanbanCfgRepository;
|
||||||
|
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 java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class MesShippingKanbanCfgServiceImpl implements IMesShippingKanbanCfgService {
|
||||||
|
@Autowired
|
||||||
|
private MesShippingKanbanCfgRepository shippingKanbanCfgRDao;
|
||||||
|
@Autowired
|
||||||
|
private MesShippingKanbanCfgDetailRepository shippingKanbanCfgDetailRDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MesShippingKanbanCfgModel queryShippingKanbanCfg(String organizeCode) {
|
||||||
|
MesShippingKanbanCfgModel model = new MesShippingKanbanCfgModel();
|
||||||
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
|
||||||
|
MesShippingKanbanCfg kanbanCfg = shippingKanbanCfgRDao.getByProperty(packBean);
|
||||||
|
model.setConfig(kanbanCfg);
|
||||||
|
if (kanbanCfg != null) {
|
||||||
|
DdlPackBean detailPackBean = DdlPackBean.getDdlPackBean(organizeCode);
|
||||||
|
DdlPreparedPack.getNumberBiggerEqualPack(kanbanCfg.getId(), "configID", packBean);
|
||||||
|
List<MesShippingKanbanCfgDetail> details = shippingKanbanCfgDetailRDao.findByHqlWhere(detailPackBean);
|
||||||
|
model.setDetails(details);
|
||||||
|
}
|
||||||
|
|
||||||
|
return model;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void saveShippingKanbanCfg(String organizeCode, MesShippingKanbanCfgModel request) {
|
||||||
|
if (request.getConfig() == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MesShippingKanbanCfg cfg = request.getConfig();
|
||||||
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(organizeCode);
|
||||||
|
MesShippingKanbanCfg oldCfg = shippingKanbanCfgRDao.getByProperty(packBean);
|
||||||
|
if (oldCfg == null) {
|
||||||
|
oldCfg = shippingKanbanCfgRDao.insert(cfg);
|
||||||
|
} else {
|
||||||
|
oldCfg.setShippingGroupCode(cfg.getShippingGroupCode());
|
||||||
|
oldCfg.setRefreshFrequency(cfg.getRefreshFrequency());
|
||||||
|
oldCfg.setKanbanName(cfg.getKanbanName());
|
||||||
|
oldCfg.setOnlinePoint(cfg.getOnlinePoint());
|
||||||
|
oldCfg.setAdjustValue(cfg.getAdjustValue());
|
||||||
|
oldCfg.setRefinedPoint(cfg.getRefinedPoint());
|
||||||
|
oldCfg.setOnWayDate(cfg.getOnWayDate());
|
||||||
|
oldCfg.setCustStartShift(cfg.getCustStartShift());
|
||||||
|
oldCfg.setInterStartShift(cfg.getInterStartShift());
|
||||||
|
oldCfg.setCustJph(cfg.getCustJph());
|
||||||
|
shippingKanbanCfgRDao.update(oldCfg);
|
||||||
|
|
||||||
|
shippingKanbanCfgDetailRDao.deleteByProperties(new String[]{"organizeCode", "configID"},
|
||||||
|
new Object[]{organizeCode, oldCfg.getId()});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CollectionUtils.isEmpty(request.getDetails())) {
|
||||||
|
for (MesShippingKanbanCfgDetail detail : request.getDetails()) {
|
||||||
|
detail.setConfigID(oldCfg.getId());
|
||||||
|
shippingKanbanCfgDetailRDao.insert(detail);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.pojo.model;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingKanbanCfg;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.shipping.MesShippingKanbanCfgDetail;
|
||||||
|
import io.swagger.annotations.ApiParam;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class MesShippingKanbanCfgModel {
|
||||||
|
@ApiParam("组织代码")
|
||||||
|
private String organizeCode;
|
||||||
|
|
||||||
|
@ApiParam("看板配置项")
|
||||||
|
private MesShippingKanbanCfg config;
|
||||||
|
|
||||||
|
@ApiParam("看板配置明细")
|
||||||
|
private List<MesShippingKanbanCfgDetail> details;
|
||||||
|
}
|
Loading…
Reference in New Issue