fix:我分发的/我执行的报工查询修改
This commit is contained in:
@@ -189,89 +189,89 @@ public class SimulationWorkServiceImpl extends ServiceImpl<SimulationWorkMapper,
|
||||
// 启动报告 调用EP创建任务接口
|
||||
// 批次
|
||||
|
||||
SimulationWork simulationWork = this.getById(workId);
|
||||
|
||||
// 查询此条报工对应的task
|
||||
SpdmTaskListReq taskListReq = new SpdmTaskListReq();
|
||||
taskListReq.setTaskId(simulationWork.getTaskId());
|
||||
taskListReq.setType(TaskQryTypeEnum.ALL.getCode());
|
||||
taskListReq.setIdMap(req.getIdMap());
|
||||
taskListReq.setCurrent(1);
|
||||
taskListReq.setSize(10);
|
||||
SdmResponse response = taskService.list(taskListReq);
|
||||
if (response.isSuccess()) {
|
||||
JSONObject dataObj = (JSONObject) response.getData();
|
||||
List<SpdmNewTaskVo> taskVoList = (List<SpdmNewTaskVo>) dataObj.get("data");
|
||||
if (CollectionUtils.isNotEmpty(taskVoList)) {
|
||||
SpdmNewTaskVo taskVo = taskVoList.get(0);
|
||||
// 构造EP创建任务参数
|
||||
// 项目号
|
||||
|
||||
// 机台号
|
||||
|
||||
// 工位号
|
||||
|
||||
String projectCode = getNodeCodeByType(taskVo, req.getIdMap(), "project");
|
||||
String machineCode = getNodeCodeByType(taskVo, req.getIdMap(), "machine");
|
||||
String workspaceCode = getNodeCodeByType(taskVo, req.getIdMap(), "workspace");
|
||||
|
||||
// 工序 任务名称-学科
|
||||
// taskVo.getTaskName() + "-" + taskVo.getDiscipline();
|
||||
|
||||
// 任务详情 报工名称-应完成阶段
|
||||
Map<String, String> taskProgressMap = taskProgressService.getNameByValueMap();
|
||||
// simulationWork.getWorkName() + "-" + taskProgressMap.get(simulationWork.getShouldProgress());
|
||||
|
||||
// 创建时间
|
||||
|
||||
// 计划开始时间
|
||||
simulationWork.getPlanBeginTime();
|
||||
if (ObjectUtils.isEmpty(simulationWork.getPlanBeginTime())) {
|
||||
return SdmResponse.failed("计划开始时间不能为空");
|
||||
}
|
||||
|
||||
// 计划完成时间
|
||||
simulationWork.getPlanFinishTime();
|
||||
if (ObjectUtils.isEmpty(simulationWork.getPlanFinishTime())) {
|
||||
return SdmResponse.failed("计划完成时间不能为空");
|
||||
}
|
||||
|
||||
// 实际开始时间
|
||||
|
||||
// 报工日期 当天
|
||||
|
||||
// 计划工时
|
||||
simulationWork.getPlanWorkHour();
|
||||
if (ObjectUtils.isEmpty(simulationWork.getPlanWorkHour())) {
|
||||
return SdmResponse.failed("计划工时不能为空");
|
||||
}
|
||||
|
||||
// 标准工时
|
||||
simulationWork.getPlanWorkHour();
|
||||
|
||||
// 责任人工号
|
||||
// 根据userId查询工号
|
||||
UserQueryReq userReq = new UserQueryReq();
|
||||
userReq.setUserId(Long.valueOf(simulationWork.getOwner()));
|
||||
userReq.setTenantId(ThreadLocalContext.getTenantId());
|
||||
SdmResponse<CIDUserResp> sdmResponse = sysUserFeignClient.queryUserDetail(userReq);
|
||||
if (sdmResponse.getData() != null) {
|
||||
sdmResponse.getData().getUsername();
|
||||
}
|
||||
|
||||
// 确认人工号
|
||||
userReq.setUserId(Long.valueOf(simulationWork.getCreator()));
|
||||
SdmResponse<CIDUserResp> sdmResponse2 = sysUserFeignClient.queryUserDetail(userReq);
|
||||
if (sdmResponse2.getData() != null) {
|
||||
sdmResponse2.getData().getUsername();
|
||||
}
|
||||
|
||||
// SAP工序ID 固定为2C
|
||||
|
||||
// 工时属性 固定为研发
|
||||
|
||||
}
|
||||
}
|
||||
// SimulationWork simulationWork = this.getById(workId);
|
||||
//
|
||||
// // 查询此条报工对应的task
|
||||
// SpdmTaskListReq taskListReq = new SpdmTaskListReq();
|
||||
// taskListReq.setTaskId(simulationWork.getTaskId());
|
||||
// taskListReq.setType(TaskQryTypeEnum.ALL.getCode());
|
||||
// taskListReq.setIdMap(req.getIdMap());
|
||||
// taskListReq.setCurrent(1);
|
||||
// taskListReq.setSize(10);
|
||||
// SdmResponse response = taskService.list(taskListReq);
|
||||
// if (response.isSuccess()) {
|
||||
// JSONObject dataObj = (JSONObject) response.getData();
|
||||
// List<SpdmNewTaskVo> taskVoList = (List<SpdmNewTaskVo>) dataObj.get("data");
|
||||
// if (CollectionUtils.isNotEmpty(taskVoList)) {
|
||||
// SpdmNewTaskVo taskVo = taskVoList.get(0);
|
||||
// // 构造EP创建任务参数
|
||||
// // 项目号
|
||||
//
|
||||
// // 机台号
|
||||
//
|
||||
// // 工位号
|
||||
//
|
||||
// String projectCode = getNodeCodeByType(taskVo, req.getIdMap(), "project");
|
||||
// String machineCode = getNodeCodeByType(taskVo, req.getIdMap(), "machine");
|
||||
// String workspaceCode = getNodeCodeByType(taskVo, req.getIdMap(), "workspace");
|
||||
//
|
||||
// // 工序 任务名称-学科
|
||||
//// taskVo.getTaskName() + "-" + taskVo.getDiscipline();
|
||||
//
|
||||
// // 任务详情 报工名称-应完成阶段
|
||||
// Map<String, String> taskProgressMap = taskProgressService.getNameByValueMap();
|
||||
//// simulationWork.getWorkName() + "-" + taskProgressMap.get(simulationWork.getShouldProgress());
|
||||
//
|
||||
// // 创建时间
|
||||
//
|
||||
// // 计划开始时间
|
||||
// simulationWork.getPlanBeginTime();
|
||||
// if (ObjectUtils.isEmpty(simulationWork.getPlanBeginTime())) {
|
||||
// return SdmResponse.failed("计划开始时间不能为空");
|
||||
// }
|
||||
//
|
||||
// // 计划完成时间
|
||||
// simulationWork.getPlanFinishTime();
|
||||
// if (ObjectUtils.isEmpty(simulationWork.getPlanFinishTime())) {
|
||||
// return SdmResponse.failed("计划完成时间不能为空");
|
||||
// }
|
||||
//
|
||||
// // 实际开始时间
|
||||
//
|
||||
// // 报工日期 当天
|
||||
//
|
||||
// // 计划工时
|
||||
// simulationWork.getPlanWorkHour();
|
||||
// if (ObjectUtils.isEmpty(simulationWork.getPlanWorkHour())) {
|
||||
// return SdmResponse.failed("计划工时不能为空");
|
||||
// }
|
||||
//
|
||||
// // 标准工时
|
||||
// simulationWork.getPlanWorkHour();
|
||||
//
|
||||
// // 责任人工号
|
||||
// // 根据userId查询工号
|
||||
// UserQueryReq userReq = new UserQueryReq();
|
||||
// userReq.setUserId(Long.valueOf(simulationWork.getOwner()));
|
||||
// userReq.setTenantId(ThreadLocalContext.getTenantId());
|
||||
// SdmResponse<CIDUserResp> sdmResponse = sysUserFeignClient.queryUserDetail(userReq);
|
||||
// if (sdmResponse.getData() != null) {
|
||||
// sdmResponse.getData().getUsername();
|
||||
// }
|
||||
//
|
||||
// // 确认人工号
|
||||
// userReq.setUserId(Long.valueOf(simulationWork.getCreator()));
|
||||
// SdmResponse<CIDUserResp> sdmResponse2 = sysUserFeignClient.queryUserDetail(userReq);
|
||||
// if (sdmResponse2.getData() != null) {
|
||||
// sdmResponse2.getData().getUsername();
|
||||
// }
|
||||
//
|
||||
// // SAP工序ID 固定为2C
|
||||
//
|
||||
// // 工时属性 固定为研发
|
||||
//
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
boolean updateFlag = this.lambdaUpdate()
|
||||
@@ -510,17 +510,22 @@ public class SimulationWorkServiceImpl extends ServiceImpl<SimulationWorkMapper,
|
||||
|
||||
// 判断是否传了taskId
|
||||
if (StringUtils.isNotBlank(req.getTaskId())) {
|
||||
// 传了taskId,查询该任务下当前用户是创建人或负责人的报工
|
||||
// 传了taskId,查询某条任务下的报工
|
||||
PageHelper.startPage(req.getCurrent(), req.getSize());
|
||||
workList = this.lambdaQuery()
|
||||
.eq(SimulationWork::getTaskId, req.getTaskId())
|
||||
.and(wrapper -> wrapper
|
||||
.eq(SimulationWork::getOwner, userId)
|
||||
.or()
|
||||
.eq(SimulationWork::getCreator, userId))
|
||||
.list();
|
||||
if (req.getType() != null && req.getType() == 1) {
|
||||
// type=1:查询当前登录人为owner(我执行的)
|
||||
workList = this.lambdaQuery()
|
||||
.eq(SimulationWork::getTaskId, req.getTaskId())
|
||||
.eq(SimulationWork::getOwner, userId)
|
||||
.list();
|
||||
} else {
|
||||
// type=0或其他:查询当前任务下所有报工
|
||||
workList = this.lambdaQuery()
|
||||
.eq(SimulationWork::getTaskId, req.getTaskId())
|
||||
.list();
|
||||
}
|
||||
} else {
|
||||
// 不传taskId,根据type查询,将filteredTaskIds条件加入SQL
|
||||
// 不传taskId,查询的是报工列表,根据type查询,将filteredTaskIds条件加入SQL
|
||||
PageHelper.startPage(req.getCurrent(), req.getSize());
|
||||
if (req.getType() != null && req.getType() == 0) {
|
||||
// type=0:查询当前登录人为creator(我确认的)
|
||||
|
||||
Reference in New Issue
Block a user