批量启用/禁用工序信息

tags/yfai-mes-ext-v1.0
yxw 1 year ago
parent 0afee7b357
commit 14e99be0de

@ -1,6 +1,7 @@
package cn.estsh.i3plus.ext.mes.apiservice.controller.base.jx;
import cn.estsh.i3plus.ext.mes.api.base.jx.IJxProcessExtService;
import cn.estsh.i3plus.ext.mes.pojo.model.BatchIdModel;
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
@ -13,10 +14,7 @@ import cn.estsh.impp.framework.boot.util.ResultBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* @PROJECT_NAME: i3plus-mes-panasonic-jx
@ -34,13 +32,13 @@ public class JxProcessController extends MesBaseController {
@PutMapping(value = "/update-valid-batch")
@ApiOperation(value = "批量禁用/启用详情", notes = "批量禁用/启用详情")
public ResultBean updateProcessValid(String[] ids, int status) {
public ResultBean updateProcessValid(@RequestBody BatchIdModel model) {
try {
ConvertBean.modelSafeArrayNumber(ids, true);
ConvertBean.modelSafeArrayNumber(model.getIds(), true);
//登陆用户
SessionUser user = AuthUtil.getSessionUser();
jxProcessExtService.updateProcessValid(ids, status, user.getUserName());
jxProcessExtService.updateProcessValid(model.getIds(), model.getStatus(), user.getUserName());
return ResultBean.success("修改成功")
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) {
@ -52,13 +50,13 @@ public class JxProcessController extends MesBaseController {
@DeleteMapping(value = "/delete-batch")
@ApiOperation(value = "批量删除", notes = "批量删除")
public ResultBean deleteProcessByIds(String[] ids) {
public ResultBean deleteProcessByIds(@RequestBody BatchIdModel model) {
try {
ConvertBean.modelSafeArrayNumber(ids, true);
ConvertBean.modelSafeArrayNumber(model.getIds(), true);
//登陆用户
SessionUser user = AuthUtil.getSessionUser();
jxProcessExtService.deleteWeaklySProcessByIds(ids, user.getUserName());
jxProcessExtService.deleteWeaklySProcessByIds(model.getIds(), user.getUserName());
return ResultBean.success("修改成功")
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) {

@ -2,7 +2,6 @@ package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.base.jx;
import cn.estsh.i3plus.ext.mes.api.base.jx.IJxProcessExtService;
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtEnumUtil;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
@ -29,8 +28,8 @@ public class JxProcessExtService implements IJxProcessExtService {
int num = processRepository.updateByHqlWhere(
wheres.toString(),
new String[]{MesExtConstWords.SYSTEM_SYNC_STATUS, MesExtConstWords.IS_DELETED, MesExtConstWords.MODIFY_USER, MesExtConstWords.MODIFY_DATE_TIME},
new Object[]{MesExtEnumUtil.IF_SYNC_STATUS.NO_SYNC.getValue(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), userName, TimeTool.getNowTime(true)}
new String[]{MesExtConstWords.IS_DELETED, MesExtConstWords.MODIFY_USER, MesExtConstWords.MODIFY_DATE_TIME},
new Object[]{CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), userName, TimeTool.getNowTime(true)}
);
return num;
}
@ -42,8 +41,8 @@ public class JxProcessExtService implements IJxProcessExtService {
int num = processRepository.updateByHqlWhere(
wheres.toString(),
new String[]{MesExtConstWords.SYSTEM_SYNC_STATUS, MesExtConstWords.IS_DELETED, MesExtConstWords.MODIFY_USER, MesExtConstWords.MODIFY_DATE_TIME},
new Object[]{MesExtEnumUtil.IF_SYNC_STATUS.NO_SYNC.getValue(), CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue(), userName, TimeTool.getNowTime(true)}
new String[]{MesExtConstWords.IS_VALID, MesExtConstWords.MODIFY_USER, MesExtConstWords.MODIFY_DATE_TIME},
new Object[]{status, userName, TimeTool.getNowTime(true)}
);
return num;
}

Loading…
Cancel
Save