Commit 8d9e7b2c authored by caotao's avatar caotao

告警时长、任务时长、工单评分接口提交

parent 84b5c6cf
......@@ -219,4 +219,6 @@ public class TdHygfJpInverterWarnDto {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date recDate;
private Long sequenceNbr;
}
......@@ -166,4 +166,6 @@ public class HYGFMaintenanceTickets extends BaseEntity {
@TableField("task_end_time")
private Date taskEndTime;
@TableField("score")
private String score ;
}
......@@ -5,12 +5,14 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.HYGFMaintenanceTicketsDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.HYGFMaintenanceTickets;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import java.util.List;
public interface HYGFMaintenanceTicketsMapper extends BaseMapper<HYGFMaintenanceTickets> {
@Select("SELECT sn_code FROM hygf_jp_inverter WHERE third_station_id = #{stationId}")
List<String> queryInverterSncodesByStationId(String stationId);
@Update("update hygf_maintenance_tickets SET score = #{score} WHERE sequence_nbr = #{sequenceNbr}")
void updateScoreBySequenceNbr(String score,Long sequenceNbr);
List<HYGFMaintenanceTicketsDto> qureyListByQueryparams(@Param("dto") HYGFMaintenanceTicketsDto dto );
}
......@@ -56,6 +56,14 @@ public class HYGFMaintenanceTicketsController extends BaseController {
return ResponseHelper.buildResponse(hygfMaintenanceTicketsServiceimpl.updateHYGFMaintenanceTicketsDto(model));
}
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@PostMapping(value = "/updateScore")
@ApiOperation(httpMethod = "POST", value = "工单打分", notes = "工单打分")
public ResponseModel<HYGFMaintenanceTickets> updateScoreBySequenceNbrMaintenance(@RequestParam(value="sequenceNbr",required = true) Long sequenceNbr,@RequestParam(value="score",required = true) String score) {
hygfMaintenanceTicketsServiceimpl.getBaseMapper().updateScoreBySequenceNbr(score,sequenceNbr);
return ResponseHelper.buildResponse(hygfMaintenanceTicketsServiceimpl.getBaseMapper().selectById(sequenceNbr));
}
/**
* 根据sequenceNbr删除
*
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.unit.DataUnit;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -172,7 +174,18 @@ public class HYGFMaintenanceTicketsServiceImpl extends BaseService<HYGFMaintenan
public HYGFMaintenanceTicketsDto updateHYGFMaintenanceTicketsDto(HYGFMaintenanceTicketsDto hygfMaintenanceTicketsDto) {
hygfMaintenanceTicketsDto.setHandlerStatus("已处理");
hygfMaintenanceTicketsDto.setTaskEndTime(new Date());
if(hygfMaintenanceTicketsDto.getWarningId()>0){
hygfMaintenanceTicketsDto.setTaskEndTime(new Date());
Long day = DateUtil.between(hygfMaintenanceTicketsDto.getTaskEndTime(),hygfMaintenanceTicketsDto.getWarningStartTime(), DateUnit.DAY);
Long hour = DateUtil.between(hygfMaintenanceTicketsDto.getTaskEndTime(),hygfMaintenanceTicketsDto.getWarningStartTime(), DateUnit.HOUR)-day*24;
Long minute = DateUtil.between(hygfMaintenanceTicketsDto.getTaskEndTime(),hygfMaintenanceTicketsDto.getWarningStartTime(), DateUnit.MINUTE)-day*24*60;
hygfMaintenanceTicketsDto.setWarningDuration(day+"天"+hour+"小时"+minute+"分钟");
}else {
Long day = DateUtil.between(hygfMaintenanceTicketsDto.getRecDate(),hygfMaintenanceTicketsDto.getWarningStartTime(), DateUnit.DAY);
Long hour = DateUtil.between(hygfMaintenanceTicketsDto.getRecDate(),hygfMaintenanceTicketsDto.getWarningStartTime(), DateUnit.HOUR)-day*24;
Long minute = DateUtil.between(hygfMaintenanceTicketsDto.getRecDate(),hygfMaintenanceTicketsDto.getWarningStartTime(), DateUnit.MINUTE)-day*24*60;
hygfMaintenanceTicketsDto.setWarningDuration(day+"天"+hour+"小时"+minute+"分钟");
}
this.updateWithModel(hygfMaintenanceTicketsDto);
if(ObjectUtil.isNotEmpty(hygfMaintenanceTicketsDto.getWarningId())){
TdHygfJpInverterWarn tdHygfJpInverterWarn = tdHygfJpInverterWarnMapper.getInverTerWarnByparams(hygfMaintenanceTicketsDto.getWarningId(), hygfMaintenanceTicketsDto.getInverterSn(), hygfMaintenanceTicketsDto.getStationId());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment