Browse Source

Merge remote-tracking branch 'origin/prod-5.1.3' into prod-5.1.3

zhongwei
yang_shj 4 months ago
parent
commit
3c749f06b5
  1. 8
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmDefinitionController.java
  2. 17
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ObjectUserServiceImpl.java
  3. 35
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/EventServiceImpl.java
  4. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java
  5. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java
  6. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java
  7. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsAnalyseExampleServiceImpl.java
  8. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java
  9. 1
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java
  10. 2
      hzims-service/ticket/pom.xml
  11. 12
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java
  12. BIN
      hzims-service/ticket/src/main/resources/template/电气第一种工作票模版.docx

8
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmDefinitionController.java

@ -18,7 +18,9 @@ import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController; import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Condition;
import org.springblade.core.mp.support.Query; import org.springblade.core.mp.support.Query;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.system.user.cache.UserCache; import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
@ -89,9 +91,9 @@ public class EmDefinitionController extends BladeController {
@ApiOperationSupport(order = 2) @ApiOperationSupport(order = 2)
@ApiOperation(value = "新增", notes = "传入EmDefinitionDTO") @ApiOperation(value = "新增", notes = "传入EmDefinitionDTO")
public R save(@Valid @RequestBody EmDefinitionDTO emDefinitionDTO) { public R save(@Valid @RequestBody EmDefinitionDTO emDefinitionDTO) {
EmDefinitionEntity emDefinition = new EmDefinitionEntity(); EmDefinitionEntity definition = BeanUtil.copy(emDefinitionDTO, EmDefinitionEntity.class);
Func.copy(emDefinitionDTO, emDefinition); definition.setCreateUser(AuthUtil.getUserId());
return R.data(emDefinitionService.save(emDefinition)); return R.data(emDefinitionService.save(definition));
} }
/** /**

17
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ObjectUserServiceImpl.java

@ -11,7 +11,9 @@ import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.constant.BladeConstant; import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.utils.CollectionUtil; import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.ObjectUtil; import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.system.user.cache.UserCache;
import org.springblade.system.user.entity.User; import org.springblade.system.user.entity.User;
import org.springblade.system.user.feign.IUserClient; import org.springblade.system.user.feign.IUserClient;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -53,11 +55,11 @@ public class ObjectUserServiceImpl extends ServiceImpl<ObjectUserMapper, ObjectU
if(objectUsers.isEmpty()){ if(objectUsers.isEmpty()){
return new ArrayList<>(); return new ArrayList<>();
} }
R<List<User>> users = userClient.userListByCodeAndNameAndAccount(AuthUtil.getTenantId(),content.getUserCode(),content.getUserName(),content.getLoginName()); // R<List<User>> users = userClient.userListByCodeAndNameAndAccount(AuthUtil.getTenantId(),content.getUserCode(),content.getUserName(),content.getLoginName());
if(!users.isSuccess() || CollectionUtil.isEmpty(users.getData())){ // if(!users.isSuccess() || CollectionUtil.isEmpty(users.getData())){
return new ArrayList<>(); // return new ArrayList<>();
} // }
Map<Long,User> userMap = users.getData().stream().collect(Collectors.toMap(User::getId, Function.identity())); // Map<Long,User> userMap = users.getData().stream().collect(Collectors.toMap(User::getId, Function.identity()));
return objectUsers.stream().map(objectUser->{ return objectUsers.stream().map(objectUser->{
ObjectUserListVO builder = new ObjectUserListVO(); ObjectUserListVO builder = new ObjectUserListVO();
builder.setId(objectUser.getId()); builder.setId(objectUser.getId());
@ -65,7 +67,8 @@ public class ObjectUserServiceImpl extends ServiceImpl<ObjectUserMapper, ObjectU
builder.setObjName(objectUser.getObjName()); builder.setObjName(objectUser.getObjName());
builder.setTempCode(objectUser.getTempCode()); builder.setTempCode(objectUser.getTempCode());
builder.setTempName(objectUser.getTempName()); builder.setTempName(objectUser.getTempName());
User user = userMap.get(objectUser.getUserId()); // User user = userMap.get(objectUser.getUserId());
User user = UserCache.getUser(objectUser.getUserId());
if(ObjectUtil.isNotEmpty(user)){ if(ObjectUtil.isNotEmpty(user)){
builder.setUserCode(user.getCode()); builder.setUserCode(user.getCode());
builder.setUserName(user.getRealName()); builder.setUserName(user.getRealName());
@ -73,6 +76,6 @@ public class ObjectUserServiceImpl extends ServiceImpl<ObjectUserMapper, ObjectU
builder.setUserId(user.getId()); builder.setUserId(user.getId());
} }
return builder; return builder;
}).collect(Collectors.toList()); }).filter(o -> Func.isNotEmpty(o.getUserId())).collect(Collectors.toList());
} }
} }

35
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/EventServiceImpl.java

@ -1,6 +1,7 @@
package com.hnac.hzinfo.inspect.task.service.impl; package com.hnac.hzinfo.inspect.task.service.impl;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.hnac.hzims.operational.defect.constants.DefectConstant; import com.hnac.hzims.operational.defect.constants.DefectConstant;
@ -92,31 +93,35 @@ public class EventServiceImpl extends ServiceImpl<TaskEventMapper, EventEntity>
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean addTaskEvent(EventAddVO eventVO){ public boolean addTaskEvent(EventAddVO eventVO){
BladeUser user = AuthUtil.getUser();
//第一次登记时,需领用任务 //第一次登记时,需领用任务
if(!AuthUtil.isAdministrator()){ if(!AuthUtil.isAdministrator()){
// 判断当前登录人是否在任务人员列表中
ITaskService taskService = SpringUtil.getBean(ITaskService.class); ITaskService taskService = SpringUtil.getBean(ITaskService.class);
TaskEntity taskEntity = taskService.getById(eventVO.getTaskId()); TaskEntity taskEntity = taskService.getById(eventVO.getTaskId());
TaskUserEntity taskUserEntity = taskUserService.getOne(Wrappers.<TaskUserEntity>lambdaQuery().eq(TaskUserEntity::getTaskId,eventVO.getTaskId()).eq(TaskUserEntity::getUserId,user == null ? eventVO.getUserId() : user.getUserId())); BladeUser user = AuthUtil.getUser();
if(taskUserEntity==null){ LambdaQueryWrapper<TaskUserEntity> wrapper = Wrappers.<TaskUserEntity>lambdaQuery()
.eq(TaskUserEntity::getTaskId, eventVO.getTaskId())
.eq(TaskUserEntity::getUserId, user == null ? eventVO.getUserId() : user.getUserId());
TaskUserEntity taskUserEntity = taskUserService.getOne(wrapper);
if(taskUserEntity == null){
throw new ServiceException("该任务已被别人领取"); throw new ServiceException("该任务已被别人领取");
} }
if(TaskContants.ClaimStatusEnum.UN_COLLECT.getStatus().equals(taskUserEntity.getClaimStatus())){ if(TaskContants.ClaimStatusEnum.UN_COLLECT.getStatus().equals(taskUserEntity.getClaimStatus())){
taskUserEntity.setClaimStatus(TaskContants.ClaimStatusEnum.COLLECT.getStatus()); taskUserEntity.setClaimStatus(TaskContants.ClaimStatusEnum.COLLECT.getStatus());
taskUserEntity.setClaimTime(LocalDateTime.now()); taskUserEntity.setClaimTime(LocalDateTime.now());
taskUserService.updateById(taskUserEntity); taskUserService.updateById(taskUserEntity);
if(PlanContants.PlanMethodEnum.SEIZE.getMethod().equals(taskEntity.getMethod())){//如果是抢占任务,删除能够抢占此任务的其他人 if(PlanContants.PlanMethodEnum.SEIZE.getMethod().equals(taskEntity.getMethod())){
taskUserService.remove(Wrappers.<TaskUserEntity>lambdaQuery().eq(TaskUserEntity::getTaskId,eventVO.getTaskId()).ne(TaskUserEntity::getId,taskUserEntity.getUserId())); //如果是抢占任务,删除能够抢占此任务的其他人
LambdaQueryWrapper<TaskUserEntity> removeUser = Wrappers.<TaskUserEntity>lambdaQuery()
.eq(TaskUserEntity::getTaskId, eventVO.getTaskId())
.ne(TaskUserEntity::getUserId, taskUserEntity.getUserId());
taskUserService.remove(removeUser);
} }
} }
} }
EventEntity event = BeanUtil.copy(eventVO, EventEntity.class); EventEntity event = BeanUtil.copy(eventVO, EventEntity.class);
event.setUserId(eventVO.getUserId()); event.setUserId(eventVO.getUserId());
// if(Func.isEmpty(user)){
// event.setTenantId("000000");
// }
event.setObjectId(eventVO.getObjId()); event.setObjectId(eventVO.getObjId());
event.setCode(CodeUtils.randomCode()); event.setCode(CodeUtils.randomCode());
boolean success = this.save(event); boolean success = this.save(event);
@ -160,18 +165,6 @@ public class EventServiceImpl extends ServiceImpl<TaskEventMapper, EventEntity>
if(success && fileList.size()>0){ if(success && fileList.size()>0){
success = eventAttachmentService.saveBatch(fileList); success = eventAttachmentService.saveBatch(fileList);
} }
//如果是问题则启动工作流引擎
if(TaskContants.ProblemEnum.yes.getType().equals(eventVO.getIsProblem())){
//TODO 并入缺陷处理模块
// startFlow(user,taskObj,event);
/* OperPhenomenonEntity phenomenon = new OperPhenomenonEntity();
phenomenon.setSourceCode(DefectConstant.DefectSourceEnum.XJ.getStatus());
phenomenon.setSourceId(event.getId());
phenomenon.setFinder(user == null ? eventVO.getUserId() : user.getUserId());
phenomenon.setDescripiton(eventVO.getDescription());
phenomenon.setInitResult(eventVO.getInitResult());
startPhenomenonFlow(phenomenon);*/
}
checkProjectFinish(eventVO); checkProjectFinish(eventVO);
return success; return success;
} }

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/task/service/impl/TaskServiceImpl.java

@ -1192,7 +1192,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, TaskEntity> impleme
if (CollectionUtil.isEmpty(list)||CollectionUtil.isEmpty(undoneIds)){ if (CollectionUtil.isEmpty(list)||CollectionUtil.isEmpty(undoneIds)){
voteChartVo.setFinishRate(0.00d); voteChartVo.setFinishRate(0.00d);
}else { }else {
BigDecimal divide = new BigDecimal(finishIds.size()).divide(new BigDecimal(list.size()),2, RoundingMode.UP); BigDecimal divide = new BigDecimal(finishIds.size()).divide(new BigDecimal(list.size()),2, RoundingMode.HALF_UP).setScale(2,RoundingMode.HALF_UP);
voteChartVo.setFinishRate(divide.doubleValue()); voteChartVo.setFinishRate(divide.doubleValue());
} }
return voteChartVo; return voteChartVo;

2
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java

@ -144,7 +144,7 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service, StartProces
if (StringUtils.isNotBlank(param)){ if (StringUtils.isNotBlank(param)){
variables=JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(param,DateUtil.PATTERN_DATETIME), Map.class); variables=JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(param,DateUtil.PATTERN_DATETIME), Map.class);
}else { }else {
variables = JSONObject.parseObject(entity); variables=JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(accessPlanV4DTO,DateUtil.PATTERN_DATETIME), Map.class);
} }
variables.put("creator", TaskUtil.getTaskUser(String.valueOf(AuthUtil.getUserId()))); variables.put("creator", TaskUtil.getTaskUser(String.valueOf(AuthUtil.getUserId())));
R result = compensateProcessClient.startFlow(AuthUtil.getUserId().toString(), R result = compensateProcessClient.startFlow(AuthUtil.getUserId().toString(),

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java

@ -120,13 +120,13 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service, StartProces
if (StringUtils.isNotBlank(param)){ if (StringUtils.isNotBlank(param)){
variables=JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(param,DateUtil.PATTERN_DATETIME), Map.class); variables=JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(param,DateUtil.PATTERN_DATETIME), Map.class);
}else { }else {
variables = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(entity, DateUtil.PATTERN_DATETIME), Map.class); variables = JSONObject.parseObject(JSONObject.toJSONStringWithDateFormat(accessTaskV4DTO, DateUtil.PATTERN_DATETIME), Map.class);
} }
if(ObjectUtil.isNotEmpty(accessTaskV4DTO.getCreateUser())){ if(ObjectUtil.isNotEmpty(accessTaskV4DTO.getCreateUser())){
variables.put("startFlowUserId",accessTaskV4DTO.getCreateUser().toString()); variables.put("startFlowUserId",accessTaskV4DTO.getCreateUser().toString());
} }
variables.put("solve",TaskUtil.getTaskUser(accessTaskV4DTO.getHandler().toString())); variables.put("solve",TaskUtil.getTaskUser(accessTaskV4DTO.getHandler().toString()));
R<BladeFlow> result = compensateProcessClient.startFlow(AuthUtil.getUserId().toString(),dictValue, R result = compensateProcessClient.startFlow(AuthUtil.getUserId().toString(),dictValue,
FlowUtil.getBusinessKey("access_task_v4", FlowUtil.getBusinessKey("access_task_v4",
String.valueOf(accessTaskV4DTO.getId())), accessTaskV4DTO.getName(),variables); String.valueOf(accessTaskV4DTO.getId())), accessTaskV4DTO.getName(),variables);
log.error("开启检修任务流程失败{}" + result); log.error("开启检修任务流程失败{}" + result);

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/duty/service/impl/ImsAnalyseExampleServiceImpl.java

@ -70,7 +70,8 @@ public class ImsAnalyseExampleServiceImpl extends ServiceImpl<ImsAnalyseExampleM
// if(DataResultCode.ANALYZE_INSTANCE_UNDEFINE.getCode()==analyzeDataByAnalyzeCode.getCode()){ // if(DataResultCode.ANALYZE_INSTANCE_UNDEFINE.getCode()==analyzeDataByAnalyzeCode.getCode()){
// throw new ServiceException("找不到对应的分析实例,请检查好配置后重试!"); // throw new ServiceException("找不到对应的分析实例,请检查好配置后重试!");
// } // }
throw new ServiceException("设备数据查询异常,请检查好配置后重试!"); log.error("getAnalyzeDataByAnalyzeCode接口请求失败:{},请求参数为:{}",JSON.toJSONString(analyzeDataByAnalyzeCode),JSON.toJSONString(analyzeDataCondition));
return R.fail("设备数据查询异常,请检查分析实例相关配置后重试!");
} }
return analyzeDataByAnalyzeCode; return analyzeDataByAnalyzeCode;
} }

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java

@ -27,4 +27,7 @@ public class OperMaintenanceMonitorReportMonthDTO implements Serializable {
@ApiModelProperty(value = "机构ID") @ApiModelProperty(value = "机构ID")
private Long deptId; private Long deptId;
@ApiModelProperty(value = "站点编号")
private String stationCode;
} }

1
hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java

@ -49,6 +49,7 @@ public class OperMaintenanceMonitorServiceImpl implements IOperMaintenanceMonito
eq(OperMaintenancePlanEntity::getIsDeleted, 0L); eq(OperMaintenancePlanEntity::getIsDeleted, 0L);
ge(OperMaintenancePlanEntity::getDisposeTime, startDate); ge(OperMaintenancePlanEntity::getDisposeTime, startDate);
lt(OperMaintenancePlanEntity::getDisposeTime, startDate.plusMonths(1)); lt(OperMaintenancePlanEntity::getDisposeTime, startDate.plusMonths(1));
eq(StringUtil.isNotBlank(req.getStationCode()),OperMaintenancePlanEntity::getStationCode,req.getStationCode());
eq(Func.isNotEmpty(req.getDeptId()), OperMaintenancePlanEntity::getCreateDept, req.getDeptId()); eq(Func.isNotEmpty(req.getDeptId()), OperMaintenancePlanEntity::getCreateDept, req.getDeptId());
}}); }});

2
hzims-service/ticket/pom.xml

@ -15,7 +15,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- <poi.version>3.17</poi.version>--> <!-- <poi.version>3.17</poi.version>-->
<documents4j.version>1.0.3</documents4j.version> <documents4j.version>1.1.5</documents4j.version>
<swagger-bootstrap-ui.version>1.9.6</swagger-bootstrap-ui.version> <swagger-bootstrap-ui.version>1.9.6</swagger-bootstrap-ui.version>
<!--特定版本--> <!--特定版本-->
<poi.version>4.1.2</poi.version> <poi.version>4.1.2</poi.version>

12
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/FirstWorkTicketServiceImpl.java

@ -370,11 +370,13 @@ public class FirstWorkTicketServiceImpl extends ServiceImpl<WorkTicketInfoMapper
return result; return result;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
params.put("ticketInfoDangers", dangerList); params.put("ticketInfoDangers", dangerList);
params.put("isSafety",workTicketInfoEntity.getIsSafety() ? "☑" : "□"); params.put("isSafety", workTicketInfoEntity.getIsSafety());
params.put("isHazard",workTicketInfoEntity.getIsHazard() ? "☑" : "□"); params.put("isHazard", workTicketInfoEntity.getIsHazard());
params.put("isRailway",workTicketInfoEntity.getIsRailway() ? "☑" : "□"); params.put("isRailway", workTicketInfoEntity.getIsRailway());
params.put("isLimited",workTicketInfoEntity.getIsLimited() ? "☑" : "□"); params.put("isLimited", workTicketInfoEntity.getIsLimited());
params.put("isStart",workTicketInfoEntity.getIsStart() ? "☑" : "□"); params.put("isStart", workTicketInfoEntity.getIsStart());
params.put("isTestTrue", true);
params.put("isTestFalse", false);
// 许可人许可环节 // 许可人许可环节
if(ObjectUtil.isNotEmpty(workTicketInfoEntity.getLicenseTime())) { if(ObjectUtil.isNotEmpty(workTicketInfoEntity.getLicenseTime())) {
String licensorName = StringUtil.isNotBlank(workTicketInfoEntity.getLicensorName()) && Func.isNotEmpty(workTicketInfoEntity.getLicensorName()) ? String licensorName = StringUtil.isNotBlank(workTicketInfoEntity.getLicensorName()) && Func.isNotEmpty(workTicketInfoEntity.getLicensorName()) ?

BIN
hzims-service/ticket/src/main/resources/template/电气第一种工作票模版.docx

Binary file not shown.
Loading…
Cancel
Save