forked from I3-YF/i3plus-mes-pcn-yfai
查询枚举明细接口
parent
49e52fcfd9
commit
1e37552112
@ -0,0 +1,18 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.api.busi;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesEnumDetail;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 枚举明细配置
|
||||||
|
* @Reference :
|
||||||
|
* @Author : junsheng.li
|
||||||
|
* @CreateDate 2024/6/9 19:18
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
public interface IMesEnumDetailService{
|
||||||
|
|
||||||
|
List<MesEnumDetail> findMesEnumDetail(MesEnumDetail mesEnumDetail);
|
||||||
|
}
|
@ -0,0 +1,47 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEnumDetailService;
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesEnumDetail;
|
||||||
|
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 cn.estsh.impp.framework.boot.util.ValidatorBean;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 枚举明细配置
|
||||||
|
* @Reference :
|
||||||
|
* @Author : junsheng.li
|
||||||
|
* @CreateDate 2024/6/9 19:27
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesEnumDetail")
|
||||||
|
public class MesEnumDetailController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IMesEnumDetailService mesEnumDetailService;
|
||||||
|
|
||||||
|
@GetMapping("/find")
|
||||||
|
@ApiOperation(value = "查询包装明细")
|
||||||
|
public ResultBean findMesEnumDetail(MesEnumDetail mesEnumDetail) {
|
||||||
|
try {
|
||||||
|
ValidatorBean.checkNotNull(mesEnumDetail.getEnumCode(), "枚举代码不能为空");
|
||||||
|
mesEnumDetail.setOrganizeCode(AuthUtil.getOrganizeCode());
|
||||||
|
List<MesEnumDetail> mesEnumDetailList = mesEnumDetailService.findMesEnumDetail(mesEnumDetail);
|
||||||
|
return ResultBean.success("查询成功").setResultList(mesEnumDetailList);
|
||||||
|
} catch (ImppBusiException imppException) {
|
||||||
|
return ResultBean.fail(imppException);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,38 @@
|
|||||||
|
package cn.estsh.i3plus.ext.mes.pcn.apiservice.serviceimpl.busi;
|
||||||
|
|
||||||
|
import cn.estsh.i3plus.ext.mes.pcn.api.busi.IMesEnumDetailService;
|
||||||
|
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
|
||||||
|
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.bean.MesEnumDetail;
|
||||||
|
import cn.estsh.i3plus.pojo.mes.repository.MesEnumDetailRepository;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description : 枚举明细配置
|
||||||
|
* @Reference :
|
||||||
|
* @Author : junsheng.li
|
||||||
|
* @CreateDate 2024/6/9 19:20
|
||||||
|
* @Modify:
|
||||||
|
**/
|
||||||
|
@Service
|
||||||
|
@Slf4j
|
||||||
|
public class MesEnumDetailServiceImpl implements IMesEnumDetailService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MesEnumDetailRepository mesEnumDetailRDao;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<MesEnumDetail> findMesEnumDetail(MesEnumDetail mesEnumDetail) {
|
||||||
|
DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesEnumDetail.getOrganizeCode());
|
||||||
|
DdlPreparedPack.getStringEqualPack(mesEnumDetail.getEnumCode(), "enumCode", packBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(mesEnumDetail.getDetailCode(), "detailCode", packBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(mesEnumDetail.getDetailName(), "detailName", packBean);
|
||||||
|
DdlPreparedPack.getStringEqualPack(mesEnumDetail.getDetailValue(), "detailValue", packBean);
|
||||||
|
return mesEnumDetailRDao.findByHqlWhere(packBean);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue