批量启用禁用工序信息

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

@ -0,0 +1,33 @@
package cn.estsh.i3plus.ext.mes.api.base.jx;
import io.swagger.annotations.ApiOperation;
/**
* @Description:MES_PLC
* @Reference:
* @Author: jessica.chen
* @CreateDate: 2019\11\13 13:56
* @Modify:
**/
public interface IJxProcessExtService {
/**
*
*
* @param ids id
* @param userName
*/
@ApiOperation("批量软删数据")
int deleteWeaklySProcessByIds(String[] ids, String userName);
/**
* /
*
* @param ids id
* @param status
* @param userName
* @return
*/
@ApiOperation(value = "批量禁用/启用数据有效性")
int updateProcessValid(String[] ids, int status, String userName);
}

@ -0,0 +1,71 @@
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.util.MesExtConstWords;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
import cn.estsh.impp.framework.base.controller.MesBaseController;
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.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;
/**
* @PROJECT_NAME: i3plus-mes-panasonic-jx
* @DESCRIPTION:
* @USER: xinwang.yi
* @DATE: 2023-11-13 17:18
*/
@RestController
@RequestMapping(MesExtConstWords.BASE_URL_MES_JX + "/process-flow")
@Api(tags = "嘉兴工序信息 控制层")
public class JxProcessController extends MesBaseController {
@Autowired
private IJxProcessExtService jxProcessExtService;
@PutMapping(value = "/update-valid-batch")
@ApiOperation(value = "批量禁用/启用详情", notes = "批量禁用/启用详情")
public ResultBean updateProcessValid(String[] ids, int status) {
try {
ConvertBean.modelSafeArrayNumber(ids, true);
//登陆用户
SessionUser user = AuthUtil.getSessionUser();
jxProcessExtService.updateProcessValid(ids, status, user.getUserName());
return ResultBean.success("修改成功")
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
@DeleteMapping(value = "/delete-batch")
@ApiOperation(value = "批量删除", notes = "批量删除")
public ResultBean deleteProcessByIds(String[] ids) {
try {
ConvertBean.modelSafeArrayNumber(ids, true);
//登陆用户
SessionUser user = AuthUtil.getSessionUser();
jxProcessExtService.deleteWeaklySProcessByIds(ids, user.getUserName());
return ResultBean.success("修改成功")
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
} catch (ImppBusiException busExcep) {
return ResultBean.fail(busExcep);
} catch (Exception e) {
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
}

@ -136,7 +136,7 @@ public class SxWorkCellTaktCollectPlcCfgController {
}
@DeleteMapping(value = "/delete-batch")
@ApiOperation(value = "批量禁用/启用详情", notes = "批量禁用/启用详情")
@ApiOperation(value = "批量删除", notes = "批量删除")
public ResultBean deleteWeaklySxWorkCellTaktCollectPlcCfgByIds(String[] ids) {
try {
ConvertBean.modelSafeArrayNumber(ids, true);

@ -0,0 +1,50 @@
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;
import cn.estsh.i3plus.pojo.mes.repository.MesProcessRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @PROJECT_NAME: i3plus-mes-panasonic-jx
* @DESCRIPTION:
* @USER: xinwang.yi
* @DATE: 2023-12-14 11:03
*/
@Service
public class JxProcessExtService implements IJxProcessExtService {
@Autowired
private MesProcessRepository processRepository;
@Override
public int deleteWeaklySProcessByIds(String[] ids, String userName) {
StringBuffer wheres = new StringBuffer();
HqlPack.getInPack(String.join(",", ids), MesExtConstWords.ID, wheres);
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)}
);
return num;
}
@Override
public int updateProcessValid(String[] ids, int status, String userName) {
StringBuffer wheres = new StringBuffer();
HqlPack.getInPack(String.join(",", ids), MesExtConstWords.ID, wheres);
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)}
);
return num;
}
}

@ -814,7 +814,7 @@ public class SxCategoryCompleteRateService implements ISxCategoryCompleteRateSer
if (CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValueStr().equals(data.getFlag())) tableData.partNo(keyArr[keyArr.length - 1], itemList.get(0).getPartNameRdd());
if (data.getDimension1() >= DIMENSION1.IS_DONT.code) tableData.isDont(keyArr[2]);
if (data.getDimension1() >= DIMENSION1.DONT_CLASS.code) tableData.dontClass(keyArr[3]);
if (data.getDimension1() == DIMENSION1.CENTER.code) tableData.workCenterCode(keyArr[4], centerMap.get(keyArr[4]).getWorkCenterName());
if (data.getDimension1().equals(DIMENSION1.CENTER.code)) tableData.workCenterCode(keyArr[4], centerMap.get(keyArr[4]).getWorkCenterName());
tableData.planQty(getPlanQtyAmount(itemList)).qty(getCompleteQtyAmount(itemList)).attainmentRate(getBigDecimalPercent(divThenMul100Format2RoundHalfUp(tableData.getQty(), tableData.getPlanQty())));
if (CommonEnumUtil.TRUE_OR_FALSE.FALSE.getValueStr().equals(data.getFlag())) tableData.completeRate(getBigDecimalPercent(getCompleteRate(itemList)));

@ -231,7 +231,7 @@ public class SxWorkCellTaktCollectPlcCfgExcelService implements IExcelImportExtS
sxWorkCellTaktCollectPlcCfg.setWorkCellCode(workCellCode);
}
sxWorkCellTaktCollectPlcCfg.setPlcCode(workCenterCode);
sxWorkCellTaktCollectPlcCfg.setPlcCode(plcCode);
sxWorkCellTaktCollectPlcCfg.setStatus(StringUtils.isEmpty(status) ? MesExtEnumUtil.IS_ENABLE.ENABLE.getValue() : MesExtEnumUtil.IS_ENABLE.descriptionOfValue(status));
sxWorkCellTaktCollectPlcCfg.setSystemSyncStatus(MesExtEnumUtil.IF_SYNC_STATUS.NO_SYNC.getValue());

Loading…
Cancel
Save