forked from I3-YF/i3plus-mes-yfai
松下工位节拍采集记录报表
parent
9cae4b0884
commit
1a3101f282
@ -0,0 +1,28 @@
|
||||
package cn.estsh.i3plus.ext.mes.api.busi.jx;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.pojo.bean.SxWorkCellTaktCollectRecord;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
public interface ISxWorkCellTaktCollectRecordService {
|
||||
|
||||
/**
|
||||
* 条件分页查询松下工位节拍采集记录
|
||||
* @param workCellTaktCollectRecord 松下工位节拍采集记录
|
||||
* @return 包装条码明细信息
|
||||
*/
|
||||
@ApiOperation(value = "根据产品条码查询包装条码明细信息", notes = "根据产品条码查询包装条码明细信息")
|
||||
ListPager<SxWorkCellTaktCollectRecord> queryWorkCellTaktCollectRecrodLByPager(SxWorkCellTaktCollectRecord workCellTaktCollectRecord, Pager pager);
|
||||
|
||||
/**
|
||||
* 条件分页查询松下工位节拍采集记录
|
||||
* @param ids id集合
|
||||
* @param status 状态
|
||||
* @param userName 用户名
|
||||
* @return 包装条码明细信息
|
||||
*/
|
||||
@ApiOperation(value = "根据产品条码查询包装条码明细信息", notes = "根据产品条码查询包装条码明细信息")
|
||||
int updateWorkCellTaktCollectRecordValid(String[] ids, int status, String userName);
|
||||
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
package cn.estsh.i3plus.ext.mes.apiservice.controller.busi.jx;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.api.busi.jx.ISxWorkCellTaktCollectRecordService;
|
||||
import cn.estsh.i3plus.ext.mes.pojo.bean.SxWorkCellTaktCollectRecord;
|
||||
import cn.estsh.i3plus.ext.mes.pojo.util.MesExtConstWords;
|
||||
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
|
||||
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.GetMapping;
|
||||
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 + "/report")
|
||||
@Api(tags = "松下工位节拍采集报表")
|
||||
public class SxWorkCelITaktCollectRecordReportController extends MesBaseController {
|
||||
|
||||
@Autowired
|
||||
private ISxWorkCellTaktCollectRecordService workCellTaktCollectRecordService;
|
||||
|
||||
@GetMapping(value = "/work-cell-takt-collect-record/query")
|
||||
@ApiOperation(value = "按条件分页查询MES工位节拍采集记录数据")
|
||||
public ResultBean queryMesProdBindRecord(SxWorkCellTaktCollectRecord workCelITaktCollectRecord, Pager pager) {
|
||||
try {
|
||||
workCelITaktCollectRecord.setOrganizeCode(AuthUtil.getOrganize().getOrganizeCode());
|
||||
ListPager listPager = workCellTaktCollectRecordService.queryWorkCellTaktCollectRecrodLByPager(workCelITaktCollectRecord, pager);
|
||||
return ResultBean.success("操作成功").setListPager(listPager)
|
||||
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||
} catch (ImppBusiException busExcep) {
|
||||
return ResultBean.fail(busExcep);
|
||||
} catch (Exception e) {
|
||||
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||
}
|
||||
}
|
||||
|
||||
@PutMapping(value = "/work-cell-takt-collect-record/update-status-batch")
|
||||
@ApiOperation(value = "批量禁用/启用状态", notes = "批量禁用/启用状态")
|
||||
public ResultBean updateSxWorkCellTaktCollectPlcCfgStatus(String[] ids, int status) {
|
||||
try {
|
||||
ConvertBean.modelSafeArrayNumber(ids, true);
|
||||
workCellTaktCollectRecordService.updateWorkCellTaktCollectRecordValid(ids, status, AuthUtil.getSessionUser().getUserName());
|
||||
return ResultBean.success("修改成功")
|
||||
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
|
||||
} catch (ImppBusiException busExcep) {
|
||||
return ResultBean.fail(busExcep);
|
||||
} catch (Exception e) {
|
||||
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package cn.estsh.i3plus.ext.mes.apiservice.serviceimpl.busi.jx;
|
||||
|
||||
import cn.estsh.i3plus.ext.mes.api.busi.jx.ISxWorkCellTaktCollectRecordService;
|
||||
import cn.estsh.i3plus.ext.mes.pojo.bean.MesProcessTorqueManage;
|
||||
import cn.estsh.i3plus.ext.mes.pojo.bean.SxWorkCellTaktCollectRecord;
|
||||
import cn.estsh.i3plus.ext.mes.pojo.repository.SxWorkCellTaktCollectPlcCfgRepository;
|
||||
import cn.estsh.i3plus.ext.mes.pojo.repository.SxWorkCellTaktCollectRecordRepository;
|
||||
import cn.estsh.i3plus.ext.mes.pojo.sqlpack.MesExtHqlPack;
|
||||
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.bean.DdlPackBean;
|
||||
import cn.estsh.i3plus.pojo.base.bean.ListPager;
|
||||
import cn.estsh.i3plus.pojo.base.common.Pager;
|
||||
import cn.estsh.i3plus.pojo.base.common.PagerHelper;
|
||||
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @PROJECT_NAME: i3plus-mes-panasonic-jx
|
||||
* @DESCRIPTION: 松下工位节拍采集记录
|
||||
* @USER: xinwang.yi
|
||||
* @DATE: 2023-12-05 14:21
|
||||
*/
|
||||
@Service
|
||||
public class SxWorkCellTaktCollectRecordService implements ISxWorkCellTaktCollectRecordService {
|
||||
|
||||
@Autowired
|
||||
private SxWorkCellTaktCollectRecordRepository workCellTaktCollectRecordRepository;
|
||||
|
||||
@Override
|
||||
public ListPager<SxWorkCellTaktCollectRecord> queryWorkCellTaktCollectRecrodLByPager(SxWorkCellTaktCollectRecord workCellTaktCollectRecord, Pager pager) {
|
||||
if (workCellTaktCollectRecord == null) {
|
||||
pager = PagerHelper.getPager(pager, workCellTaktCollectRecordRepository.listCount());
|
||||
return new ListPager(workCellTaktCollectRecordRepository.listPager(pager), pager);
|
||||
} else {
|
||||
DdlPackBean hqlPack = MesExtHqlPack.getSxWorkCellTaktCollectRecord(workCellTaktCollectRecord);
|
||||
hqlPack.setOrderByStr(workCellTaktCollectRecord.orderBy());
|
||||
pager = PagerHelper.getPager(pager, workCellTaktCollectRecordRepository.findByHqlWhereCount(hqlPack));
|
||||
List<SxWorkCellTaktCollectRecord> byHqlWherePage = workCellTaktCollectRecordRepository.findByHqlWherePage(hqlPack, pager);
|
||||
return new ListPager(byHqlWherePage, pager);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWorkCellTaktCollectRecordValid(String[] ids, int status, String userName) {
|
||||
|
||||
StringBuffer wheres = new StringBuffer();
|
||||
HqlPack.getInPack(String.join(",", ids), MesExtConstWords.ID, wheres);
|
||||
|
||||
int num = workCellTaktCollectRecordRepository.updateByHqlWhere(
|
||||
wheres.toString(),
|
||||
new String[]{MesExtConstWords.SYSTEM_SYNC_STATUS, MesExtConstWords.IS_VALID, MesExtConstWords.MODIFY_USER, MesExtConstWords.MODIFY_DATE_TIME},
|
||||
new Object[]{MesExtEnumUtil.IF_SYNC_STATUS.NO_SYNC.getValue(), status, userName, TimeTool.getNowTime(true)}
|
||||
);
|
||||
return num;
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue