班次查询有效期内的班次

tags/yfai-mes-ext-v1.0
jun 12 months ago
parent f1f7e0cd29
commit 68a2f24362

@ -2,6 +2,8 @@ package cn.estsh.i3plus.ext.mes.api.base;
import cn.estsh.i3plus.pojo.mes.bean.MesShift;
import java.util.List;
/**
* @Description:
* @CreateDate 2024/04/16
@ -9,5 +11,5 @@ import cn.estsh.i3plus.pojo.mes.bean.MesShift;
*/
public interface IMesShiftService extends IBaseMesService<MesShift> {
List<MesShift> findMesShift(MesShift mesShift);
}

@ -1,12 +1,40 @@
package cn.estsh.i3plus.ext.mes.apiservice.controller.base;
import cn.estsh.i3plus.ext.mes.api.base.IMesShiftService;
import cn.estsh.i3plus.ext.mes.apiservice.config.AuthUtilExt;
import cn.estsh.i3plus.ext.mes.pojo.constant.MesCommonConstant;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.mes.bean.MesShift;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.util.ResultBean;
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;
@RestController
@RequestMapping(MesCommonConstant.MES_YANFEN + "/mesShift")
public class MesShiftController extends BaseMesController<MesShift> {
@Autowired
private IMesShiftService mesShiftService;
@GetMapping(value = "/find")
@ApiOperation(value = "查询班次信息", notes = "查询班次信息")
public ResultBean findMesShift(MesShift mesShift) {
try {
mesShift.setOrganizeCode(AuthUtilExt.getOrganizeCode());
List<MesShift> mesShiftList = mesShiftService.findMesShift(mesShift);
return ResultBean.success("操作成功")
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode())
.setResultList(mesShiftList);
} catch (ImppBusiException e) {
return ResultBean.fail(e);
}
}
}

@ -2,6 +2,7 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base;
import cn.estsh.i3plus.ext.mes.api.base.IMesShiftService;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.DdlPreparedPack;
@ -11,6 +12,8 @@ import cn.estsh.impp.framework.boot.util.ValidatorBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
@Slf4j
public class MesShiftService extends BaseMesService<MesShift> implements IMesShiftService {
@ -77,4 +80,16 @@ public class MesShiftService extends BaseMesService<MesShift> implements IMesShi
}
}
@Override
public List<MesShift> findMesShift(MesShift mesShift) {
DdlPackBean packBean = DdlPackBean.getDdlPackBean(mesShift.getOrganizeCode());
String nowDate = TimeTool.getNowTime(true);
DdlPreparedPack.getNumEqualPack(mesShift.getIsValid(), "isValid", packBean);
DdlPreparedPack.getStringEqualPack(mesShift.getShiftCode(), "shiftCode", packBean);
DdlPreparedPack.getStringEqualPack(mesShift.getWorkCenterCode(), "workCenterCode", packBean);
DdlPreparedPack.getStringLikerPack(mesShift.getShiftName(), "shiftName", packBean);
DdlPreparedPack.getStringSmallerPack(nowDate,"beginDate",packBean);
DdlPreparedPack.getStringBiggerPack(nowDate,"endDate",packBean);
return baseRDao.findByHqlWhere(packBean);
}
}

Loading…
Cancel
Save