Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 1 year ago
parent
commit
a703313704
  1. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java
  2. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/dto/OperMaintenanceMonitorReportMonthDTO.java
  3. 107
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/maintenance/service/impl/OperMaintenanceMonitorServiceImpl.java
  4. 1
      hzims-service/operational/src/main/resources/db/1.0.1.sql
  5. 44
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java
  6. 4
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java
  7. BIN
      hzims-service/ticket/src/main/resources/template/电气操作票.docx

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/maintenance/entity/OperMaintenancePlanEntity.java

@ -108,4 +108,10 @@ public class OperMaintenancePlanEntity extends TenantEntity {
@JsonSerialize(nullsUsing = NullSerializer.class)
private Long messageTemplateId;
/**
* 站点code
*/
private String stationCode;
}

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

@ -24,4 +24,9 @@ public class OperMaintenanceMonitorReportMonthDTO implements Serializable {
@ApiModelProperty(value = "月", required = true)
private Integer month;
/**
* 站点code
*/
private String stationCode;
}

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

@ -12,6 +12,7 @@ import com.hnac.hzims.operational.maintenance.mapper.OperMaintenanceTaskMapper;
import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceMonitorService;
import com.hnac.hzims.operational.maintenance.vo.OperMaintenancePlanVO;
import com.hnac.hzims.operational.maintenance.wrapper.OperMaintenancePlanWrapper;
import org.apache.commons.lang3.StringUtils;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.*;
import org.springblade.system.user.cache.UserCache;
@ -32,61 +33,61 @@ import java.util.stream.Collectors;
**/
@Service
public class OperMaintenanceMonitorServiceImpl implements IOperMaintenanceMonitorService {
@Autowired
private OperMaintenanceParameterMapper parameterMapper;
@Autowired
private OperMaintenanceTaskMapper taskMapper;
@Autowired
private OperMaintenancePlanMapper planMapper;
@Autowired
private IImsDutyClassService imsDutyClassService;
@Autowired
private OperMaintenanceParameterMapper parameterMapper;
@Autowired
private OperMaintenanceTaskMapper taskMapper;
@Autowired
private OperMaintenancePlanMapper planMapper;
@Autowired
private IImsDutyClassService imsDutyClassService;
@Override
public R<Map<String, List<OperMaintenancePlanVO>>> reportMonth(OperMaintenanceMonitorReportMonthDTO req) {
List<OperMaintenancePlanEntity> planEntities = planMapper.selectList(new LambdaQueryWrapper<OperMaintenancePlanEntity>() {{
LocalDate startDate = LocalDate.of(req.getYear(), req.getMonth(),1);
// Date startTime = DateUtil.parse(DateUtil.format(DateUtil.now(), "yyyy-MM") + "-01", DateUtil.PATTERN_DATE);
eq(OperMaintenancePlanEntity::getIsDeleted, 0L);
ge(OperMaintenancePlanEntity::getDisposeTime, startDate);
lt(OperMaintenancePlanEntity::getDisposeTime, startDate.with(TemporalAdjusters.lastDayOfMonth()));
}});
@Override
public R<Map<String, List<OperMaintenancePlanVO>>> reportMonth(OperMaintenanceMonitorReportMonthDTO req) {
List<OperMaintenancePlanEntity> planEntities = planMapper.selectList(new LambdaQueryWrapper<OperMaintenancePlanEntity>() {{
LocalDate startDate = LocalDate.of(req.getYear(), req.getMonth(), 1);
// Date startTime = DateUtil.parse(DateUtil.format(DateUtil.now(), "yyyy-MM") + "-01", DateUtil.PATTERN_DATE);
eq(OperMaintenancePlanEntity::getIsDeleted, 0L);
ge(OperMaintenancePlanEntity::getDisposeTime, startDate);
lt(OperMaintenancePlanEntity::getDisposeTime, startDate.with(TemporalAdjusters.lastDayOfMonth()))
.eq(StringUtils.isNoneBlank(req.getStationCode()), OperMaintenancePlanEntity::getStationCode, req.getStationCode());
}});
//获取列表班次ID集合
List<Long> classIdList = planEntities.stream().filter(planEntity -> ObjectUtil.isNotEmpty(planEntity.getImsDutyClassId()))
.map(OperMaintenancePlanEntity::getImsDutyClassId).collect(Collectors.toList());
IImsDutyClassService imsDutyClassService = SpringUtil.getBean(IImsDutyClassService.class);
Map<Long,List<ImsDutyClassEntity>> classMap = null;
if(CollectionUtil.isNotEmpty(classIdList)) {
List<ImsDutyClassEntity> classEntityList = imsDutyClassService.list(new LambdaQueryWrapper<ImsDutyClassEntity>(){{
in(ImsDutyClassEntity::getId,classIdList);
}});
if(CollectionUtil.isNotEmpty(classEntityList)) {
classMap = classEntityList.stream().collect(Collectors.groupingBy(ImsDutyClassEntity::getId));
}
}
//获取列表班次ID集合
List<Long> classIdList = planEntities.stream().filter(planEntity -> ObjectUtil.isNotEmpty(planEntity.getImsDutyClassId()))
.map(OperMaintenancePlanEntity::getImsDutyClassId).collect(Collectors.toList());
IImsDutyClassService imsDutyClassService = SpringUtil.getBean(IImsDutyClassService.class);
Map<Long, List<ImsDutyClassEntity>> classMap = null;
if (CollectionUtil.isNotEmpty(classIdList)) {
List<ImsDutyClassEntity> classEntityList = imsDutyClassService.list(new LambdaQueryWrapper<ImsDutyClassEntity>() {{
in(ImsDutyClassEntity::getId, classIdList);
}});
if (CollectionUtil.isNotEmpty(classEntityList)) {
classMap = classEntityList.stream().collect(Collectors.groupingBy(ImsDutyClassEntity::getId));
}
}
//完善班次与执行人
List<OperMaintenancePlanVO> operMaintenancePlanVOS = new ArrayList<>();
Map<Long, List<ImsDutyClassEntity>> finalClassMap = classMap;
planEntities.forEach(planEntity -> {
OperMaintenancePlanVO planVO = BeanUtil.copy(planEntity,OperMaintenancePlanVO.class);
if(ObjectUtil.isNotEmpty(planEntity.getImsDutyClassId())) {
//类型为班次时 获取班次名称
planVO.setDutyClassName(finalClassMap.get(planEntity.getImsDutyClassId()).get(0).getClassName());
}
else if(ObjectUtil.isNotEmpty(planEntity.getDisposer())) {
//类型为人员类型时 获取执行人名称
planVO.setDisposerName(Optional.ofNullable(UserCache.getUser(planEntity.getDisposer())).map(User::getName).orElse(null));
}
//当月是否生成任务 默认是false
LocalDateTime createTaskTime = com.hnac.hzims.common.utils.DateUtil.DateToLocalDateTime(planEntity.getCreateTaskTime());
if(ObjectUtil.isNotEmpty(createTaskTime) && com.hnac.hzims.common.utils.DateUtil.judgeSameDay(createTaskTime, LocalDate.now())) {
planVO.setGenerateSign(true);
}
operMaintenancePlanVOS.add(planVO);
});
//完善班次与执行人
List<OperMaintenancePlanVO> operMaintenancePlanVOS = new ArrayList<>();
Map<Long, List<ImsDutyClassEntity>> finalClassMap = classMap;
planEntities.forEach(planEntity -> {
OperMaintenancePlanVO planVO = BeanUtil.copy(planEntity, OperMaintenancePlanVO.class);
if (ObjectUtil.isNotEmpty(planEntity.getImsDutyClassId())) {
//类型为班次时 获取班次名称
planVO.setDutyClassName(finalClassMap.get(planEntity.getImsDutyClassId()).get(0).getClassName());
} else if (ObjectUtil.isNotEmpty(planEntity.getDisposer())) {
//类型为人员类型时 获取执行人名称
planVO.setDisposerName(Optional.ofNullable(UserCache.getUser(planEntity.getDisposer())).map(User::getName).orElse(null));
}
//当月是否生成任务 默认是false
LocalDateTime createTaskTime = com.hnac.hzims.common.utils.DateUtil.DateToLocalDateTime(planEntity.getCreateTaskTime());
if (ObjectUtil.isNotEmpty(createTaskTime) && com.hnac.hzims.common.utils.DateUtil.judgeSameDay(createTaskTime, LocalDate.now())) {
planVO.setGenerateSign(true);
}
operMaintenancePlanVOS.add(planVO);
});
Map<String, List<OperMaintenancePlanVO>> data = operMaintenancePlanVOS.stream().collect(Collectors.groupingBy(o -> DateUtil.formatDate(o.getDisposeTime())));
return R.data(new TreeMap<>(data));
}
Map<String, List<OperMaintenancePlanVO>> data = operMaintenancePlanVOS.stream().collect(Collectors.groupingBy(o -> DateUtil.formatDate(o.getDisposeTime())));
return R.data(new TreeMap<>(data));
}
}

1
hzims-service/operational/src/main/resources/db/1.0.1.sql

@ -0,0 +1 @@
alter table hzims_oper_maintenance_plan add station_code varchar(60) comment '站点编码'

44
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/standardTicket/service/impl/OperationTicketServiceImpl.java

@ -118,10 +118,10 @@ public class OperationTicketServiceImpl implements OperationTicketService {
//获取站点编号
String signage = station.getSignage();
if (StringUtils.isBlank(signage) || signage.length() < 2) {
if (StringUtils.isBlank(signage)) {
throw new ServiceException("票据抬头未配置,请您到站点管理配置");
}
signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2);
//signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2);
standardTicketInfoVo.setSignage(signage);
standardTicketInfoVo.setSignageCode(station.getCode());
@ -168,8 +168,9 @@ public class OperationTicketServiceImpl implements OperationTicketService {
try {
JSONObject jsonObject = JSONObject.parseObject(formData);
// standardTicketInfoVo = JSONObject.toJavaObject(jsonObject, StandardTicketInfoVo.class);
standardTicketInfoVo = JSONObject.parseObject(jsonObject.getString("standardTicketInfoVo"),
new TypeReference<StandardTicketInfoVo>(){});
standardTicketInfoVo = JSONObject.parseObject(jsonObject.getString("standardTicketInfoVo"),
new TypeReference<StandardTicketInfoVo>() {
});
} catch (Exception e) {
log.error("获取表单出现异常了~~~~");
e.printStackTrace();
@ -401,10 +402,10 @@ public class OperationTicketServiceImpl implements OperationTicketService {
result = "DZ";
break;
case "4":
result = type;
result = "KJ";
break;
case "5":
result = type;
result = "TJ";
break;
default:
result = "DZ";
@ -433,6 +434,11 @@ public class OperationTicketServiceImpl implements OperationTicketService {
Map<String, Object> workTicketInfoMap = this.convertMap(standardTicketInfoVo);
//导入下在word
Map<String, Object> resultMap = OperationWordHelper.resultMap(workTicketInfoMap);
String name = getBuilder(standardTicketInfoVo.getTicketType());
resultMap.put("headTitle", name);
String workTicketStatus = OperationWordHelper.getWorkTicketStatus(status);
String os = TicketConstant.OS_NAME;
//Windows操作系统
@ -453,6 +459,32 @@ public class OperationTicketServiceImpl implements OperationTicketService {
/**
* 获取操作票的名称
*
* @param ticketType
* @return
*/
private String getBuilder(String ticketType) {
String result = null;
switch (ticketType) {
case "3":
result = "倒闸";
break;
case "4":
result = "开机";
break;
case "5":
result = "停机";
break;
default:
result = "倒闸";
break;
}
return result;
}
/**
* 将查询的数据转换为map
*
* @param standardTicketInfoVo

4
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/twoTicket/service/impl/TicketProcessServiceImpl.java

@ -188,10 +188,10 @@ public class TicketProcessServiceImpl implements TicketProcessService {
//获取站点编号
String signage = station.getSignage();
if (StringUtils.isBlank(signage) || signage.length() < 2) {
if (StringUtils.isBlank(signage)) {
throw new ServiceException("票据抬头未配置,请您到站点管理配置");
}
signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2);
//signage = signage.length() == 2 ? station.getSignage() : station.getSignage().substring(0, 2);
workTicketVo.getWorkTicket().setSignage(station.getSignage());
workTicketVo.getWorkTicket().setSignageCode(station.getCode());

BIN
hzims-service/ticket/src/main/resources/template/电气操作票.docx

Binary file not shown.
Loading…
Cancel
Save