|
|
@ -2,9 +2,7 @@ package cn.estsh.i3plus.ext.mes.pcn.apiservice.controller.base;
|
|
|
|
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesContainerSnStationService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.api.base.IMesContainerSnStationService;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
|
|
|
import cn.estsh.i3plus.ext.mes.pcn.pojo.constant.MesCommonConstant;
|
|
|
|
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.common.Pager;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
|
|
|
|
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesContainerSnStation;
|
|
|
|
import cn.estsh.i3plus.pojo.mes.bean.MesContainerSnStation;
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
@ -64,53 +62,13 @@ public class MesContainerSnStationController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/update")
|
|
|
|
@DeleteMapping(value = "/delete-weakly")
|
|
|
|
@ApiOperation(value = "编辑")
|
|
|
|
|
|
|
|
public ResultBean doUpdate(@RequestBody MesContainerSnStation mesContainerSnStation) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
String userName = AuthUtil.getSessionUser().getUserName();
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(mesContainerSnStation.getOrganizeCode(), "工厂代码为空");
|
|
|
|
|
|
|
|
mesContainerSnStationService.doUpdate(mesContainerSnStation, userName);
|
|
|
|
|
|
|
|
return ResultBean.success("编辑成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
|
|
|
} catch (ImppBusiException imppException) {
|
|
|
|
|
|
|
|
return ResultBean.fail(imppException);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PutMapping("/update-isValid-by-id")
|
|
|
|
|
|
|
|
@ApiOperation(value = "批量根据id启用或禁用")
|
|
|
|
|
|
|
|
public ResultBean doUpdateIsValid(Long[] idList, Integer isValid, String organizeCode) {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(organizeCode, "工厂代码为空");
|
|
|
|
|
|
|
|
ValidatorBean.checkNotNull(idList, "请选择需要删除的信息");
|
|
|
|
|
|
|
|
List<Long> ids = Arrays.asList(idList);
|
|
|
|
|
|
|
|
if (isValid != CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue() &&
|
|
|
|
|
|
|
|
isValid != CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValue()) {
|
|
|
|
|
|
|
|
throw ImppExceptionBuilder.newInstance()
|
|
|
|
|
|
|
|
.setSystemID(CommonEnumUtil.SOFT_TYPE.MES_PCN.getCode())
|
|
|
|
|
|
|
|
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION.getCode())
|
|
|
|
|
|
|
|
.setErrorDetail("状态值不符合要求,不允许操作").
|
|
|
|
|
|
|
|
build();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
String userName = AuthUtil.getSessionUser().getUserName();
|
|
|
|
|
|
|
|
mesContainerSnStationService.doUpdateIsValid(ids, isValid, organizeCode, userName);
|
|
|
|
|
|
|
|
return ResultBean.success("批量根据id启用或禁用成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
|
|
|
|
|
|
|
} catch (ImppBusiException imppException) {
|
|
|
|
|
|
|
|
return ResultBean.fail(imppException);
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
|
|
|
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PutMapping(value = "/delete-weakly")
|
|
|
|
|
|
|
|
@ApiOperation(value = "批量软删除信息")
|
|
|
|
@ApiOperation(value = "批量软删除信息")
|
|
|
|
public ResultBean batchDeleteWeaklyByIds(@RequestBody Long[] idList, String organizeCode) {
|
|
|
|
public ResultBean batchDeleteWeaklyByIds(@RequestBody Long[] idList) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
ValidatorBean.checkNotNull(idList, "请选择需要删除的信息");
|
|
|
|
ValidatorBean.checkNotNull(idList, "请选择需要删除的信息");
|
|
|
|
ValidatorBean.checkNotNull(organizeCode, "工厂代码为空");
|
|
|
|
|
|
|
|
List<Long> ids = Arrays.asList(idList);
|
|
|
|
List<Long> ids = Arrays.asList(idList);
|
|
|
|
|
|
|
|
String organizeCode = AuthUtil.getOrganize().getOrganizeCode();
|
|
|
|
String userName = AuthUtil.getSessionUser().getUserName();
|
|
|
|
String userName = AuthUtil.getSessionUser().getUserName();
|
|
|
|
mesContainerSnStationService.deleteWeaklyByIds(ids, organizeCode, userName);
|
|
|
|
mesContainerSnStationService.deleteWeaklyByIds(ids, organizeCode, userName);
|
|
|
|
return ResultBean.success("批量删除信息成功")
|
|
|
|
return ResultBean.success("批量删除信息成功")
|
|
|
|