Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
liwen 11 months ago
parent
commit
601056f00f
  1. 21
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java
  2. 6
      hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java
  3. 7
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java
  4. 2
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java
  5. 14
      hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java
  6. 3
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java
  7. 14
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml
  8. 4
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.java
  9. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.xml
  10. 9
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessPlanV4ServiceImpl.java
  11. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/AccessTaskV4ServiceImpl.java
  12. 2
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/service/impl/OperAccessStatisticsServiceImpl.java
  13. 6
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java
  14. 2
      hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java

21
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessStatisticsEntity.java

@ -35,6 +35,20 @@ public class OperAccessStatisticsEntity extends TenantEntity {
/** /**
* 任务ID * 任务ID
*/ */
@ApiModelProperty(value = "设备编号")
@JsonSerialize(nullsUsing = NullSerializer.class)
private String emCode;
/**
* 任务ID
*/
@ApiModelProperty(value = "设备名称")
@JsonSerialize(nullsUsing = NullSerializer.class)
private String emName;
/**
* 任务ID
*/
@ApiModelProperty(value = "任务ID") @ApiModelProperty(value = "任务ID")
@JsonSerialize(nullsUsing = NullSerializer.class) @JsonSerialize(nullsUsing = NullSerializer.class)
private Long taskId; private Long taskId;
@ -59,6 +73,13 @@ public class OperAccessStatisticsEntity extends TenantEntity {
private Date planEndTime; private Date planEndTime;
/** /**
* 实际工时
*/
@ApiModelProperty(value = "计划工时")
@JsonSerialize(nullsUsing = NullSerializer.class)
private Integer planHours;
/**
* 实际开始时间 * 实际开始时间
*/ */
@ApiModelProperty(value = "实际开始时间") @ApiModelProperty(value = "实际开始时间")

6
hzims-service-api/hzims-operational-api/src/main/java/com/hnac/hzims/operational/access/entity/OperAccessTaskEntity.java

@ -79,6 +79,12 @@ public class OperAccessTaskEntity extends TenantEntity {
private Date planEndTime; private Date planEndTime;
/** /**
* 计划结束时间
*/
@ApiModelProperty(value = "计划工时")
private Integer planHours;
/**
* 实际开始时间 * 实际开始时间
*/ */
@ApiModelProperty(value = "实际开始时间") @ApiModelProperty(value = "实际开始时间")

7
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/controller/EmInfoController.java

@ -420,4 +420,11 @@ public class EmInfoController extends BladeController {
public R<List<EmInfoEntity>> hkVideoDevices() { public R<List<EmInfoEntity>> hkVideoDevices() {
return R.data(em_infoService.hkVideoDevices()); return R.data(em_infoService.hkVideoDevices());
} }
@GetMapping("/select")
@ApiOperationSupport(order = 13)
@ApiOperation(value = "下拉框设备查询")
public R<List<EmInfoEntity>> select(@RequestParam(value = "deptId",required = false) Long deptId) {
return R.data(em_infoService.select(deptId));
}
} }

2
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/IEmInfoService.java

@ -94,4 +94,6 @@ public interface IEmInfoService extends BaseService<EmInfoEntity> {
List<EmInfoEntity> hkVideoDevices(); List<EmInfoEntity> hkVideoDevices();
List<EmInfoEntity> deviceByPath(String emCode); List<EmInfoEntity> deviceByPath(String emCode);
List<EmInfoEntity> select(Long deptId);
} }

14
hzims-service/equipment/src/main/java/com/hnac/hzims/equipment/service/impl/EmInfoServiceImpl.java

@ -990,4 +990,18 @@ public class EmInfoServiceImpl extends BaseServiceImpl<EmInfoMapper, EmInfoEntit
return this.list(Wrappers.<EmInfoEntity>lambdaQuery().in(EmInfoEntity::getNumber, Arrays.asList(deviceCodes))); return this.list(Wrappers.<EmInfoEntity>lambdaQuery().in(EmInfoEntity::getNumber, Arrays.asList(deviceCodes)));
} }
/**
* 根据机构查询设备
* @param deptId
* @return
*/
@Override
public List<EmInfoEntity> select(Long deptId) {
if(ObjectUtil.isEmpty(deptId)){
return this.list();
}
return this.list(Wrappers.<EmInfoEntity>lambdaQuery()
.eq(EmInfoEntity::getDepartment,deptId));
}
} }

3
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/dto/OperAccessStatisticsDTO.java

@ -20,6 +20,9 @@ public class OperAccessStatisticsDTO extends OperAccessStatisticsEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ApiModelProperty("设备编码")
private String emCode;
@ApiModelProperty(value = "任务名称") @ApiModelProperty(value = "任务名称")
private String taskName; private String taskName;

14
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessStatisticsMapper.xml

@ -3,12 +3,15 @@
<mapper namespace="com.hnac.hzims.operational.access.mapper.OperAccessStatisticsMapper"> <mapper namespace="com.hnac.hzims.operational.access.mapper.OperAccessStatisticsMapper">
<!-- 通用查询映射结果 --> <!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity"> <resultMap id="BaseResultMap" type="com.hnac.hzims.operational.access.vo.OperAccessStatisticsVO">
<result column="ID" property="id"/> <result column="ID" property="id"/>
<result column="PID" property="pid"/> <result column="PID" property="pid"/>
<result column="TASK_ID" property="taskId"/>
<result column="EM_CODE" property="emCode"/>
<result column="MANAGER" property="manager"/> <result column="MANAGER" property="manager"/>
<result column="PLAN_START_TIME" property="planStartTime"/> <result column="PLAN_START_TIME" property="planStartTime"/>
<result column="PLAN_END_TIME" property="planEndTime"/> <result column="PLAN_END_TIME" property="planEndTime"/>
<result column="PLAN_HOURS" property="planHours"/>
<result column="ACT_START_TIME" property="actStartTime"/> <result column="ACT_START_TIME" property="actStartTime"/>
<result column="ACT_END_TIME" property="actEndTime"/> <result column="ACT_END_TIME" property="actEndTime"/>
<result column="HOURS" property="hours"/> <result column="HOURS" property="hours"/>
@ -22,12 +25,19 @@
<result column="CREATE_TIME" property="createTime"/> <result column="CREATE_TIME" property="createTime"/>
<result column="UPDATE_USER" property="updateUser"/> <result column="UPDATE_USER" property="updateUser"/>
<result column="UPDATE_TIME" property="updateTime"/> <result column="UPDATE_TIME" property="updateTime"/>
<collection property="details"
select="com.hnac.hzims.operational.access.mapper.OperAccessTaskDetailMapper.selectByTaskId"
column="TASK_ID">
</collection>
</resultMap> </resultMap>
<select id="selectPageList" resultType="com.hnac.hzims.operational.access.vo.OperAccessStatisticsVO"> <select id="selectPageList" resultMap="BaseResultMap">
SELECT OT.`NAME` AS taskName,OS.* FROM hzims_oper_access_statistics OS SELECT OT.`NAME` AS taskName,OS.* FROM hzims_oper_access_statistics OS
JOIN hzims_oper_access_task OT JOIN hzims_oper_access_task OT
ON OS.`TASK_ID` = OT.`ID` ON OS.`TASK_ID` = OT.`ID`
WHERE OS.IS_DELETED = 0 WHERE OS.IS_DELETED = 0
<if test="dto.emCode != null and dto.emCode != ''">
and OS.emCode = #{dto.emCode}
</if>
<if test="dto.taskName != null"> <if test="dto.taskName != null">
and OT.`NAME` like concat('%',#{dto.taskName},'%') and OT.`NAME` like concat('%',#{dto.taskName},'%')
</if> </if>

4
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.java

@ -2,8 +2,11 @@ package com.hnac.hzims.operational.access.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity; import com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper; import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
import java.util.List;
/** /**
* *
* Mapper 接口 * Mapper 接口
@ -13,4 +16,5 @@ import org.springblade.core.datascope.mapper.UserDataScopeBaseMapper;
**/ **/
public interface OperAccessTaskDetailMapper extends BaseMapper<OperAccessTaskDetailEntity> { public interface OperAccessTaskDetailMapper extends BaseMapper<OperAccessTaskDetailEntity> {
List<OperAccessTaskDetailEntity> selectByTaskId(@Param("taskId") Long taskId);
} }

5
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/mapper/OperAccessTaskDetailMapper.xml

@ -17,5 +17,10 @@
<result column="UPDATE_USER" property="updateUser"/> <result column="UPDATE_USER" property="updateUser"/>
<result column="UPDATE_TIME" property="updateTime"/> <result column="UPDATE_TIME" property="updateTime"/>
</resultMap> </resultMap>
<select id="selectByTaskId" resultType="com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity">
SELECT NAME,CONTENT
FROM HZIMS_OPER_ACCESS_TASK_DETAIL
WHERE TASK_ID = #{taskId}
</select>
</mapper> </mapper>

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

@ -32,6 +32,9 @@ import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.time.Duration;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -229,7 +232,7 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{
if(ObjectUtil.isEmpty(plan)){ if(ObjectUtil.isEmpty(plan)){
throw new ServiceException("未查询到检修计划!"); throw new ServiceException("未查询到检修计划!");
} }
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
for(OperAccessContentDTO item : entity.getAccessContents()){ for(OperAccessContentDTO item : entity.getAccessContents()){
//任务参数 //任务参数
AccessTaskV4DTO task = BeanUtil.copy(item, AccessTaskV4DTO.class); AccessTaskV4DTO task = BeanUtil.copy(item, AccessTaskV4DTO.class);
@ -239,6 +242,10 @@ public class AccessPlanV4ServiceImpl implements AccessPlanV4Service{
task.setProcDefId(plan.getProcDefId()); task.setProcDefId(plan.getProcDefId());
task.setHandler(item.getManager()); task.setHandler(item.getManager());
task.setPlanId(plan.getId()); task.setPlanId(plan.getId());
LocalDateTime start = LocalDateTime.parse(DateUtil.format(task.getPlanStartTime(),DateUtil.PATTERN_DATETIME), formatter);
LocalDateTime end = LocalDateTime.parse(DateUtil.format(task.getPlanEndTime(),DateUtil.PATTERN_DATETIME), formatter);
Duration duration = Duration.between(start, end);
task.setPlanHours((int) duration.toHours());
task.setContentId(item.getId()); task.setContentId(item.getId());
task.setEmCode(item.getEmCode()); task.setEmCode(item.getEmCode());
task.setTenantId(plan.getTenantId()); task.setTenantId(plan.getTenantId());

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

@ -251,6 +251,8 @@ public class AccessTaskV4ServiceImpl implements AccessTaskV4Service {
OperAccessStatisticsDTO statisticsDTO = BeanUtil.copy(entity, OperAccessStatisticsDTO.class); OperAccessStatisticsDTO statisticsDTO = BeanUtil.copy(entity, OperAccessStatisticsDTO.class);
statisticsDTO.setId(null); statisticsDTO.setId(null);
statisticsDTO.setTaskId(entity.getId()); statisticsDTO.setTaskId(entity.getId());
statisticsDTO.setEmCode(entity.getEmCode());
statisticsDTO.setPlanHours(entity.getPlanHours());
statisticsDTO.setManager(entity.getHandler()); statisticsDTO.setManager(entity.getHandler());
OperAccessContentEntity content = contentService.getById(entity.getId()); OperAccessContentEntity content = contentService.getById(entity.getId());
if (ObjectUtil.isNotEmpty(content)) { if (ObjectUtil.isNotEmpty(content)) {

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

@ -50,8 +50,6 @@ public class OperAccessStatisticsServiceImpl extends BaseServiceImpl<OperAccessS
@Override @Override
public R<IPage<OperAccessStatisticsVO>> list(OperAccessStatisticsDTO req, IPage<OperAccessStatisticsVO> page) { public R<IPage<OperAccessStatisticsVO>> list(OperAccessStatisticsDTO req, IPage<OperAccessStatisticsVO> page) {
List<OperAccessStatisticsEntity> operAccessStatisticsVOS = this.baseMapper.selectPageList(page, req); List<OperAccessStatisticsEntity> operAccessStatisticsVOS = this.baseMapper.selectPageList(page, req);
/* IPage pages = super.page(Condition.getPage(query), getQueryWrapperByList(req));
pages.setRecords(OperAccessStatisticsWrapper.build().listVO(pages.getRecords()));*/
return R.data(page.setRecords(OperAccessStatisticsWrapper.build().listVO(operAccessStatisticsVOS))); return R.data(page.setRecords(OperAccessStatisticsWrapper.build().listVO(operAccessStatisticsVOS)));
} }

6
hzims-service/operational/src/main/java/com/hnac/hzims/operational/access/vo/OperAccessStatisticsVO.java

@ -1,10 +1,13 @@
package com.hnac.hzims.operational.access.vo; package com.hnac.hzims.operational.access.vo;
import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity; import com.hnac.hzims.operational.access.entity.OperAccessStatisticsEntity;
import com.hnac.hzims.operational.access.entity.OperAccessTaskDetailEntity;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.List;
/** /**
* 模型VO * 模型VO
* *
@ -28,4 +31,7 @@ public class OperAccessStatisticsVO extends OperAccessStatisticsEntity {
@ApiModelProperty(value = "任务名称") @ApiModelProperty(value = "任务名称")
private String taskName; private String taskName;
@ApiModelProperty(value = "检修内容")
private List<OperAccessTaskDetailEntity> details;
} }

2
hzims-service/ticket/src/main/java/com/hnac/hzims/ticket/repair/service/impl/WorkTaskServiceImpl.java

@ -20,6 +20,7 @@ import org.springblade.flow.core.utils.FlowUtil;
import org.springblade.flow.core.utils.TaskUtil; import org.springblade.flow.core.utils.TaskUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.Map; import java.util.Map;
/** /**
@ -67,6 +68,7 @@ public class WorkTaskServiceImpl extends BaseServiceImpl<WorkTaskMapper, WorkTas
* @param workTask * @param workTask
*/ */
private void saveWorkTask(WorkTaskVO workTask) { private void saveWorkTask(WorkTaskVO workTask) {
workTask.setCode("GZRWD" + DateUtil.format(new Date(),DateUtil.PATTERN_DATETIME_MINI));
this.save(workTask); this.save(workTask);
} }

Loading…
Cancel
Save