Commit 4bb03dbc authored by KeYong's avatar KeYong

Merge branch 'developer' of 172.16.10.76:moa/amos-boot-biz into develop

parents 770be55d 16713cca
...@@ -81,7 +81,7 @@ public interface WorkflowFeignService { ...@@ -81,7 +81,7 @@ public interface WorkflowFeignService {
* @param taskID * @param taskID
* @return * @return
*/ */
@RequestMapping(value = "/task/pickuptask/{taskID}", method = RequestMethod.GET) @RequestMapping(value = "/task/pickuptask/{taskID}", method = RequestMethod.PUT)
JSONObject pickuptask(@PathVariable("taskID") String taskID) ; JSONObject pickuptask(@PathVariable("taskID") String taskID) ;
/** /**
* 直接完成任务 * 直接完成任务
...@@ -94,5 +94,14 @@ public interface WorkflowFeignService { ...@@ -94,5 +94,14 @@ public interface WorkflowFeignService {
@RequestMapping(value = "/task/getTaskAssign/{taskId}", method = RequestMethod.GET) @RequestMapping(value = "/task/getTaskAssign/{taskId}", method = RequestMethod.GET)
JSONObject getTaskAssign(@PathVariable("taskId") String taskId) ; JSONObject getTaskAssign(@PathVariable("taskId") String taskId) ;
/**
* 不操作FormInstance直接完成任务
* @param taskID
* @param variable
* @return
* @throws Exception
*/
@RequestMapping(value = "/task/completeTask/noFromInstanceAdd/{taskID}", method = RequestMethod.POST)
JSONObject completeNoExecuteFromInstanceAdd(@PathVariable("taskID") String taskID, @RequestBody(required = false) HashMap<String, Object> variable) throws Exception;
} }
...@@ -3,10 +3,8 @@ ...@@ -3,10 +3,8 @@
<mapper <mapper
namespace="com.yeejoin.amos.boot.module.common.api.mapper.KeySiteMapper"> namespace="com.yeejoin.amos.boot.module.common.api.mapper.KeySiteMapper">
<select id="getPageList" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"> <select id="getPageList" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto">
SELECT SELECT
c.`name` as name, c.`name` as name,
c.belong_id as belongId, c.belong_id as belongId,
cou.biz_org_name as belongName, cou.biz_org_name as belongName,
...@@ -33,35 +31,33 @@ SELECT ...@@ -33,35 +31,33 @@ SELECT
c.rec_date AS recDate, c.rec_date AS recDate,
c.fire_endurance_rate_name as fireEnduranceRateName, c.fire_endurance_rate_name as fireEnduranceRateName,
c.use_nature_name as useNatureName c.use_nature_name as useNatureName
FROM FROM
cb_key_site c cb_key_site c
left join cb_org_usr cou on c.belong_id =cou.sequence_nbr left join cb_org_usr cou on c.belong_id =cou.sequence_nbr
where c.is_delete=FALSE where c.is_delete=FALSE
<if test="name != null and name != ''"> <if test="name != null and name != ''">
AND c.`name` like concat(#{name}, '%') AND c.`name` like concat(#{name}, '%')
</if> </if>
<if test="buildingId != null and buildingId != -1"> <if test="buildingId != null and buildingId != -1">
AND c.`building_id`= #{buildingId} AND c.`building_id`= #{buildingId}
</if> </if>
<if test="fireEnduranceRate != null and fireEnduranceRate != ''"> <if test="fireEnduranceRate != null and fireEnduranceRate != ''">
AND c.`fire_endurance_rate`= #{fireEnduranceRate} AND c.`fire_endurance_rate`= #{fireEnduranceRate}
</if> </if>
<if test="useNature != null and useNature != ''"> <if test="useNature != null and useNature != ''">
AND c.`use_nature`= #{useNature} AND c.`use_nature`= #{useNature}
</if> </if>
<if test="fireFacilitiesInfo != null and fireFacilitiesInfo != ''"> <if test="fireFacilitiesInfo != null and fireFacilitiesInfo != ''">
AND c.`fire_facilities_info`= #{fireFacilitiesInfo} AND c.`fire_facilities_info`= #{fireFacilitiesInfo}
</if> </if>
<if test="belongId != null and belongId!='-1' and belongId != -1"> <if test="belongId != null and belongId!='-1' and belongId != -1">
AND c.`belong_id`= #{belongId} AND c.`belong_id`= #{belongId}
</if> </if>
order by c.rec_date desc
</select> </select>
<select id="getSequenceNbr" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"> <select id="getSequenceNbr" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto">
SELECT c.`name` as name,
SELECT
c.`name` as name,
c.belong_id as belongId, c.belong_id as belongId,
cou.biz_org_name as belongName, cou.biz_org_name as belongName,
c.building_id as buildingId, c.building_id as buildingId,
...@@ -87,16 +83,14 @@ where c.is_delete=FALSE ...@@ -87,16 +83,14 @@ where c.is_delete=FALSE
c.rec_date AS recDate, c.rec_date AS recDate,
c.fire_endurance_rate_name as fireEnduranceRateName, c.fire_endurance_rate_name as fireEnduranceRateName,
c.use_nature_name as useNatureName c.use_nature_name as useNatureName
FROM FROM cb_key_site c
cb_key_site c left join cb_org_usr cou on c.belong_id = cou.sequence_nbr
left join cb_org_usr cou on c.belong_id =cou.sequence_nbr where c.sequence_nbr = #{sequenceNbr}
where c.sequence_nbr=#{sequenceNbr} and c.is_delete=FALSE; and c.is_delete = FALSE;
</select> </select>
<select id="getKeySiteList" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto"> <select id="getKeySiteList" resultType="com.yeejoin.amos.boot.module.common.api.dto.KeySiteDto">
SELECT c.`name` as name,
SELECT
c.`name` as name,
c.belong_id as belongId, c.belong_id as belongId,
cou.biz_org_name as belongName, cou.biz_org_name as belongName,
c.building_id as buildingId, c.building_id as buildingId,
...@@ -122,10 +116,9 @@ where c.sequence_nbr=#{sequenceNbr} and c.is_delete=FALSE; ...@@ -122,10 +116,9 @@ where c.sequence_nbr=#{sequenceNbr} and c.is_delete=FALSE;
c.rec_date AS recDate, c.rec_date AS recDate,
c.fire_endurance_rate_name as fireEnduranceRateName, c.fire_endurance_rate_name as fireEnduranceRateName,
c.use_nature_name as useNatureName c.use_nature_name as useNatureName
FROM FROM cb_key_site c
cb_key_site c left join cb_org_usr cou on c.belong_id = cou.sequence_nbr
left join cb_org_usr cou on c.belong_id =cou.sequence_nbr where c.is_delete = FALSE;
where c.is_delete=FALSE; </select>
</select>
</mapper> </mapper>
package com.yeejoin.amos.maintenance.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import org.hibernate.annotations.Where;
@Entity
@Table(name="p_app_version")
@NamedQuery(name="AppVersion.findAll", query="SELECT c FROM AppVersion c")
@Where(clause="is_latest_version=1")//表示未删除的数据
public class AppVersion extends BasicEntity {
/**
*
*/
private static final long serialVersionUID = -3207180951171522450L;
/**
* app版本
*/
@Column(name="version")
private String version;
/**
* 版本说明
*/
@Column(name="remark")
private String remark;
/**
* app发布人id
*/
@Column(name="publisher")
private int publisher;
/**
* app发布人名称
*/
@Column(name="publisher_name")
private String publisherName;
/**
* 是否需要强制更新
*/
@Column(name="update_type")
private int updateType;
/**
* 是否为最新版本
*/
@Column(name="is_latest_version")
private Boolean isLatestVersion;
/**
* app保存路径
*/
@Column(name="url")
private String url;
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public int getPublisher() {
return publisher;
}
public void setPublisher(int publisher) {
this.publisher = publisher;
}
public String getPublisherName() {
return publisherName;
}
public void setPublisherName(String publisherName) {
this.publisherName = publisherName;
}
public int getUpdateType() {
return updateType;
}
public void setUpdateType(int updateType) {
this.updateType = updateType;
}
public Boolean getIsLatestVersion() {
return isLatestVersion;
}
public void setIsLatestVersion(Boolean isLatestVersion) {
this.isLatestVersion = isLatestVersion;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
}
package com.yeejoin.amos.maintenance.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
@Entity
@Table(name="p_config")
@NamedQuery(name="Config.findAll", query="SELECT c FROM Config c")
public class Config extends BasicEntity {
private static final long serialVersionUID = 1L;
/**
* 描述
*/
@Column(name="des")
private String des;
/**
* 名称
*/
@Column(name="name")
private String name;
/**
* 属性
*/
@Column(name="attribute")
private String attribute;
public String getDes() {
return des;
}
public void setDes(String des) {
this.des = des;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getAttribute() {
return attribute;
}
public void setAttribute(String attribute) {
this.attribute = attribute;
}
}
...@@ -192,8 +192,6 @@ public class AlertCalled extends BaseEntity { ...@@ -192,8 +192,6 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty(value = "使用单位") @ApiModelProperty(value = "使用单位")
private String useUnit; private String useUnit;
@TableField(exist=false)
@ApiModelProperty(value = "地址") @ApiModelProperty(value = "地址")
private String address; private String address;
......
...@@ -26,16 +26,16 @@ ...@@ -26,16 +26,16 @@
<select id="queryNearlyCount" resultType="java.util.Map"> <select id="queryNearlyCount" resultType="java.util.Map">
SELECT SELECT
DATE_ADD(#{beginDate},INTERVAL -1 DAY) dateTime, DATE_ADD(#{beginDate},INTERVAL -7 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM FROM
tz_alert_called tz_alert_called
WHERE 1 = 1 WHERE 1 = 1
<if test="beginDate != null and beginDate != ''"> <if test="beginDate != null and beginDate != ''">
and call_time >= DATE_ADD(#{beginDate},INTERVAL -1 DAY) and call_time >= DATE_ADD(#{beginDate},INTERVAL -7 DAY)
</if> </if>
<if test="endDate != null and endDate != ''"> <if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -1 DAY) and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -7 DAY)
</if> </if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" > <if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode} and org_code= #{orgCode}
...@@ -43,16 +43,16 @@ ...@@ -43,16 +43,16 @@
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
DATE_ADD(#{beginDate},INTERVAL -2 DAY) dateTime, DATE_ADD(#{beginDate},INTERVAL -6 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM FROM
tz_alert_called tz_alert_called
WHERE 1 = 1 WHERE 1 = 1
<if test="beginDate != null and beginDate != ''"> <if test="beginDate != null and beginDate != ''">
and call_time >= DATE_ADD(#{beginDate},INTERVAL -2 DAY) and call_time >= DATE_ADD(#{beginDate},INTERVAL -6 DAY)
</if> </if>
<if test="endDate != null and endDate != ''"> <if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -2 DAY) and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -6 DAY)
</if> </if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" > <if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode} and org_code= #{orgCode}
...@@ -60,16 +60,16 @@ ...@@ -60,16 +60,16 @@
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
DATE_ADD(#{beginDate},INTERVAL -3 DAY) dateTime, DATE_ADD(#{beginDate},INTERVAL -5 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM FROM
tz_alert_called tz_alert_called
WHERE 1 = 1 WHERE 1 = 1
<if test="beginDate != null and beginDate != ''"> <if test="beginDate != null and beginDate != ''">
and call_time >= DATE_ADD(#{beginDate},INTERVAL -3 DAY) and call_time >= DATE_ADD(#{beginDate},INTERVAL -5 DAY)
</if> </if>
<if test="endDate != null and endDate != ''"> <if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -3 DAY) and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -5 DAY)
</if> </if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" > <if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode} and org_code= #{orgCode}
...@@ -94,16 +94,16 @@ ...@@ -94,16 +94,16 @@
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
DATE_ADD(#{beginDate},INTERVAL -5 DAY) dateTime, DATE_ADD(#{beginDate},INTERVAL -3 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM FROM
tz_alert_called tz_alert_called
WHERE 1 = 1 WHERE 1 = 1
<if test="beginDate != null and beginDate != ''"> <if test="beginDate != null and beginDate != ''">
and call_time >= DATE_ADD(#{beginDate},INTERVAL -5 DAY) and call_time >= DATE_ADD(#{beginDate},INTERVAL -3 DAY)
</if> </if>
<if test="endDate != null and endDate != ''"> <if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -5 DAY) and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -3 DAY)
</if> </if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" > <if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode} and org_code= #{orgCode}
...@@ -111,16 +111,16 @@ ...@@ -111,16 +111,16 @@
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
DATE_ADD(#{beginDate},INTERVAL -6 DAY) dateTime, DATE_ADD(#{beginDate},INTERVAL -2 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM FROM
tz_alert_called tz_alert_called
WHERE 1 = 1 WHERE 1 = 1
<if test="beginDate != null and beginDate != ''"> <if test="beginDate != null and beginDate != ''">
and call_time >= DATE_ADD(#{beginDate},INTERVAL -6 DAY) and call_time >= DATE_ADD(#{beginDate},INTERVAL -2 DAY)
</if> </if>
<if test="endDate != null and endDate != ''"> <if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -6 DAY) and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -2 DAY)
</if> </if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" > <if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode} and org_code= #{orgCode}
...@@ -128,16 +128,16 @@ ...@@ -128,16 +128,16 @@
</if> </if>
UNION ALL UNION ALL
SELECT SELECT
DATE_ADD(#{beginDate},INTERVAL -7 DAY) dateTime, DATE_ADD(#{beginDate},INTERVAL -1 DAY) dateTime,
sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount sum( CASE WHEN father_alert is null THEN 1 ELSE 0 END ) majorAlertCount
FROM FROM
tz_alert_called tz_alert_called
WHERE 1 = 1 WHERE 1 = 1
<if test="beginDate != null and beginDate != ''"> <if test="beginDate != null and beginDate != ''">
and call_time >= DATE_ADD(#{beginDate},INTERVAL -7 DAY) and call_time >= DATE_ADD(#{beginDate},INTERVAL -1 DAY)
</if> </if>
<if test="endDate != null and endDate != ''"> <if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -7 DAY) and call_time <![CDATA[ <= ]]> DATE_ADD(#{endDate},INTERVAL -1 DAY)
</if> </if>
<if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" > <if test="orgCode != null and orgCode != '' and recUserId != null and recUserId != ''" >
and org_code= #{orgCode} and org_code= #{orgCode}
......
...@@ -344,7 +344,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -344,7 +344,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Map<String, Object> map = checkExcuteTaskAuthMap(sequenceNbr, userInfo); Map<String, Object> map = checkExcuteTaskAuthMap(sequenceNbr, userInfo);
if (Boolean.parseBoolean(map.get("checkFlag").toString())) { if (Boolean.parseBoolean(map.get("checkFlag").toString())) {
if (map.get("name").toString().startsWith(PROCESS_NAME[4])) { if (map.get("name").toString().startsWith(PROCESS_NAME[4])) {
workflowFeignService.completeByVariable(map.get("taskId").toString(), conditionMap); workflowFeignService.completeNoExecuteFromInstanceAdd(map.get("taskId").toString(), conditionMap);
} else { } else {
workflowFeignService.pickupAndCompleteTask(map.get("taskId").toString(), conditionMap); workflowFeignService.pickupAndCompleteTask(map.get("taskId").toString(), conditionMap);
......
...@@ -67,6 +67,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite ...@@ -67,6 +67,7 @@ public class KeySiteServiceImpl extends BaseService<KeySiteDto, KeySite, KeySite
String useNature, String fireFacilitiesInfo, Long belongId){ String useNature, String fireFacilitiesInfo, Long belongId){
return keySiteMapper.getPageList(page,name,buildingId,fireEnduranceRate,useNature,fireFacilitiesInfo,belongId); return keySiteMapper.getPageList(page,name,buildingId,fireEnduranceRate,useNature,fireFacilitiesInfo,belongId);
} }
@Override @Override
public List<Object> getBuildTree() { public List<Object> getBuildTree() {
ResponseModel<Object> response = equipFeignClient.getBuildingTree(); ResponseModel<Object> response = equipFeignClient.getBuildingTree();
......
package com.yeejoin.amos.maintenance.business.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.yeejoin.amos.maintenance.business.service.intfc.IAppService;
import com.yeejoin.amos.maintenance.business.util.CommonResponse;
import com.yeejoin.amos.maintenance.business.util.CommonResponseUtil;
import com.yeejoin.amos.maintenance.common.enums.CheckStatisticsTypeEnum;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskExecution;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.maintenance.common.enums.TaskStatisticsTypeEnum;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@RestController
@RequestMapping(value = "/api/common")
@Api(tags="公共接口api")
public class CommonController extends AbstractBaseController{
/*@Autowired
IUserService userService;*/
@Autowired
private IAppService iAppService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "任务统计口径类型", notes = "任务统计口径类型")
@RequestMapping(value = "/taskgetStatisticsType", method = RequestMethod.GET)
public CommonResponse getTaskStatisticsType() {
return CommonResponseUtil.success(TaskStatisticsTypeEnum.getEnumList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "巡检统计口径类型", notes = "巡检统计口径类型")
@RequestMapping(value = "/checkStatisticsType", method = RequestMethod.GET)
public CommonResponse getCheckStatisticsType() {
return CommonResponseUtil.success(CheckStatisticsTypeEnum.getEnumList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "计划任务完成种类", notes = "计划任务完成种类")
@RequestMapping(value = "/planTaskFinishStatus", method = RequestMethod.GET)
public CommonResponse getPlanTaskFinishStatus() {
return CommonResponseUtil.success(PlanTaskFinishStatusEnum.getEnumList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "计划任务执行情况种类", notes = "计划任务执行情况种类")
@RequestMapping(value = "/planTaskExecution", method = RequestMethod.GET)
public CommonResponse getPlanTaskExecution() {
return CommonResponseUtil.success(PlanTaskExecution.getEnumList());
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取app最新版本信息", notes = "获取app最新版本信息")
@RequestMapping(value = "/queryAppVersion", method = RequestMethod.GET)
//@Authorization(ingore=true)
public CommonResponse getAppLastVersion() {
return CommonResponseUtil.success(iAppService.queryAppLastVersion());
}
}
package com.yeejoin.amos.maintenance.business.controller;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.yeejoin.amos.maintenance.business.dao.repository.IConfigDao;
import com.yeejoin.amos.maintenance.business.util.CommonResponse;
import com.yeejoin.amos.maintenance.business.util.CommonResponseUtil;
import com.yeejoin.amos.maintenance.dao.entity.Config;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/**
* 获取主题信息
*
* @author
*
*/
@RestController
@RequestMapping(value = "/api/config")
@Api(tags="配置接口api")
public class ConfigController extends AbstractBaseController{
private final Logger log = LoggerFactory.getLogger(ConfigController.class);
@Autowired
private IConfigDao configDao ;
/**
* <pre>
* 获取配置接口信息
* </pre>
*
*
* @return
*/
//@Authorization(ingore = true)
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "获取配置接口信息", notes = " 获取配置接口信息")
@RequestMapping(value = "/getConfigsInfo", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse getConfigsInfo() {
List<Config> configs = configDao.findAll();
return CommonResponseUtil.success(configs);
}
}
package com.yeejoin.amos.maintenance.business.controller; package com.yeejoin.amos.maintenance.business.controller;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.http.MediaType;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.maintenance.business.dto.PointDto; import com.yeejoin.amos.maintenance.business.dto.PointDto;
import com.yeejoin.amos.maintenance.business.param.MovePointParam;
import com.yeejoin.amos.maintenance.business.param.PointImportParam; import com.yeejoin.amos.maintenance.business.param.PointImportParam;
import com.yeejoin.amos.maintenance.business.param.PointImportQueryParam; import com.yeejoin.amos.maintenance.business.param.PointImportQueryParam;
import com.yeejoin.amos.maintenance.business.param.PointParam; import com.yeejoin.amos.maintenance.business.param.PointParam;
import com.yeejoin.amos.maintenance.business.service.intfc.ICatalogTreeService; import com.yeejoin.amos.maintenance.business.service.intfc.ICatalogTreeService;
import com.yeejoin.amos.maintenance.business.service.intfc.IPointService; import com.yeejoin.amos.maintenance.business.service.intfc.IPointService;
import com.yeejoin.amos.maintenance.business.util.CommonResponse; import com.yeejoin.amos.maintenance.business.util.*;
import com.yeejoin.amos.maintenance.business.util.CommonResponseUtil;
import com.yeejoin.amos.maintenance.business.util.DaoCriteria;
import com.yeejoin.amos.maintenance.business.util.FileHelper;
import com.yeejoin.amos.maintenance.business.util.PointParamUtils;
import com.yeejoin.amos.maintenance.business.vo.MaintenanceResourceData; import com.yeejoin.amos.maintenance.business.vo.MaintenanceResourceData;
import com.yeejoin.amos.maintenance.business.vo.PointClassifyVo; import com.yeejoin.amos.maintenance.business.vo.PointClassifyVo;
import com.yeejoin.amos.maintenance.business.vo.PointInputItemVo; import com.yeejoin.amos.maintenance.business.vo.PointInputItemVo;
import com.yeejoin.amos.maintenance.business.vo.PointVo; import com.yeejoin.amos.maintenance.business.vo.PointVo;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable; import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.request.CommonRequest; import com.yeejoin.amos.maintenance.core.common.request.CommonRequest;
import com.yeejoin.amos.maintenance.core.common.response.PointResponse;
import com.yeejoin.amos.maintenance.dao.entity.Point; import com.yeejoin.amos.maintenance.dao.entity.Point;
import com.yeejoin.amos.maintenance.dao.entity.PointClassify; import com.yeejoin.amos.maintenance.dao.entity.PointClassify;
import com.yeejoin.amos.maintenance.feign.RemoteSecurityService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
@RestController @RestController
@RequestMapping(value = "/api/point") @RequestMapping(value = "/api/point")
...@@ -73,9 +46,6 @@ public class PointController extends AbstractBaseController { ...@@ -73,9 +46,6 @@ public class PointController extends AbstractBaseController {
@Autowired @Autowired
private ICatalogTreeService catalogTreeService; private ICatalogTreeService catalogTreeService;
@Autowired
private RemoteSecurityService remoteSecurityService;
/** /**
* 增加巡检点 * 增加巡检点
* *
...@@ -86,23 +56,14 @@ public class PointController extends AbstractBaseController { ...@@ -86,23 +56,14 @@ public class PointController extends AbstractBaseController {
@ApiOperation(value = "新增巡检点", notes = "新增巡检点") @ApiOperation(value = "新增巡检点", notes = "新增巡检点")
@PostMapping(value = "/addPoint", produces = "application/json;charset=UTF-8") @PostMapping(value = "/addPoint", produces = "application/json;charset=UTF-8")
public CommonResponse addPoint(@ApiParam(value = "巡检点", required = true) @RequestBody PointParam pointParam) { public CommonResponse addPoint(@ApiParam(value = "巡检点", required = true) @RequestBody PointParam pointParam) {
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
try {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams); String loginOrgCode = getOrgCode(reginParams);
//点归属于公司 //点归属于公司
pointParam.getPoint().setOrgCode(loginOrgCode); pointParam.getPoint().setOrgCode(loginOrgCode);
pointParam.getPoint().setCreatorId(user.getUserId()); pointParam.getPoint().setCreatorId(getUserId());
Point point = iPointService.addPoint(pointParam); Point point = iPointService.addPoint(pointParam);
return CommonResponseUtil.success(point); return CommonResponseUtil.success(point);
} catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(), e);
return CommonResponseUtil.failure("巡检点新增失败");
}
} }
/** /**
......
package com.yeejoin.amos.maintenance.business.dao.repository;
import org.springframework.data.jpa.repository.Query;
import com.yeejoin.amos.maintenance.dao.entity.AppVersion;
public interface AppVersionDao extends BaseDao<AppVersion, Long>{
@Query(value="SELECT * FROM p_app_version v ORDER BY v.id DESC LIMIT 0,1", nativeQuery = true)
AppVersion findLastVersion();
}
package com.yeejoin.amos.maintenance.business.dao.repository;
import java.util.List;
import org.springframework.stereotype.Repository;
import com.yeejoin.amos.maintenance.dao.entity.Config;
@Repository("configDao")
public interface IConfigDao extends BaseDao<Config, Long>{
List<Config> findAll();
}
package com.yeejoin.amos.maintenance.business.entity.mybatis; package com.yeejoin.amos.maintenance.business.entity.mybatis;
import lombok.Data;
import java.util.Date; import java.util.Date;
/**
* @author DELL
*/
@Data
public class PlanTaskPointInputItemBo { public class PlanTaskPointInputItemBo {
/** /**
...@@ -66,152 +72,31 @@ public class PlanTaskPointInputItemBo { ...@@ -66,152 +72,31 @@ public class PlanTaskPointInputItemBo {
private Long classifyId; private Long classifyId;
//新增执行部门 /**
* 执行部门
*/
private String depId; private String depId;
//执行人名称 /**
* 执行人名称
*/
private String userName; private String userName;
//执行部门名称
private String depName;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getDepName() {
return depName;
}
public void setDepName(String depName) {
this.depName = depName;
}
public Long getInputItemId() {
return inputItemId;
}
public void setInputItemId(Long inputItemId) {
this.inputItemId = inputItemId;
}
public int getOrderNo() {
return orderNo;
}
public void setOrderNo(int orderNo) {
this.orderNo = orderNo;
}
public long getPointId() {
return pointId;
}
public void setPointId(long pointId) {
this.pointId = pointId;
}
public long getPlanTaskId() {
return planTaskId;
}
public void setPlanTaskId(long planTaskId) {
this.planTaskId = planTaskId;
}
public long getRouteId() {
return routeId;
}
public void setRouteId(long routeId) {
this.routeId = routeId;
}
public long getPlanId() {
return planId;
}
public void setPlanId(long planId) { /**
this.planId = planId; * 执行部门名称
} */
private String depName;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public long getRoutePointItemId() {
return routePointItemId;
}
public void setRoutePointItemId(long routePointItemId) {
this.routePointItemId = routePointItemId;
}
public long getPlanTaskDetailId() {
return planTaskDetailId;
}
public void setPlanTaskDetailId(long planTaskDetailId) {
this.planTaskDetailId = planTaskDetailId;
}
public String getClassifyName() {
return classifyName;
}
public void setClassifyName(String classifyName) {
this.classifyName = classifyName;
}
public Long getClassifyId() {
return classifyId;
}
public void setClassifyId(Long classifyId) {
this.classifyId = classifyId;
}
public String getInputName() {
return inputName;
}
public void setInputName(String inputName) {
this.inputName = inputName;
}
public String getDepId() {
return depId;
}
public void setDepId(String depId) { /**
this.depId = depId; * 冗余字段:点名称
} */
private String pointName;
/**
* 冗余字段:路线名称
*/
private String routeName;
/**
* 冗余字段:计划名称
*/
private String planName;
} }
package com.yeejoin.amos.maintenance.business.feign; package com.yeejoin.amos.maintenance.business.feign;
import com.yeejoin.amos.maintenance.business.util.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
//装备 /**
@FeignClient(name = "${equip.fegin.name}") * @author DELL
public interface EquipFeign { */ //装备
@RequestMapping(value = "${equip.fegin.prefix}" + "/equipSpecific/getSourceNameByEquipSpeId", method = RequestMethod.GET, consumes = "application/json") @FeignClient(name = "${equip.feign.name}")
LinkedHashMap<String, Object> getEquipDetail(@RequestParam(value = "id", required = true) Long id); public interface EquipFeignClient {
String PREFIX = "${equip.feign.prefix}";
@RequestMapping(value = "${equip.fegin.prefix}" + "/equipSpecific/getSourceNameList", method = RequestMethod.POST, consumes = "application/json") @RequestMapping(value = PREFIX + "/equipSpecific/getSourceNameByEquipSpeId", method = RequestMethod.GET, consumes = "application/json")
LinkedHashMap<String, Object> getEquipDetail(@RequestParam(value = "id") Long id);
@RequestMapping(value = PREFIX + "/equipSpecific/getSourceNameList", method = RequestMethod.POST, consumes = "application/json")
LinkedHashMap<String, Object> getEquipList(@RequestBody Long id); LinkedHashMap<String, Object> getEquipList(@RequestBody Long id);
@RequestMapping(value = "${equip.fegin.prefix}" + "/warehouse-structure/listAll", method = RequestMethod.GET, consumes = "application/json") @RequestMapping(value = PREFIX + "/warehouse-structure/listAll", method = RequestMethod.GET, consumes = "application/json")
String getStructureNameAll(); String getStructureNameAll();
/** /**
...@@ -24,10 +30,10 @@ public interface EquipFeign { ...@@ -24,10 +30,10 @@ public interface EquipFeign {
* *
* @return * @return
*/ */
@RequestMapping(value = "${equip.fegin.prefix}" + "/building/tree", method = RequestMethod.GET, consumes = "application/json") @RequestMapping(value = PREFIX + "/building/tree", method = RequestMethod.GET, consumes = "application/json")
LinkedHashMap<String, Object> getBuildingTree(); LinkedHashMap<String, Object> getBuildingTree();
@RequestMapping(value = "${equip.fegin.prefix}" + "/building/getBuildingAbsolutePosition", method = RequestMethod.GET, consumes = "application/json") @RequestMapping(value = PREFIX + "/building/getBuildingAbsolutePosition", method = RequestMethod.GET, consumes = "application/json")
LinkedHashMap<String, Object> getBuildingAbsolutePosition(); LinkedHashMap<String, Object> getBuildingAbsolutePosition();
/** /**
...@@ -35,7 +41,7 @@ public interface EquipFeign { ...@@ -35,7 +41,7 @@ public interface EquipFeign {
* *
* @return * @return
*/ */
@RequestMapping(value = "${equip.fegin.prefix}" + "/area/tree", method = RequestMethod.GET, consumes = "application/json") @RequestMapping(value = PREFIX + "/area/tree", method = RequestMethod.GET, consumes = "application/json")
LinkedHashMap<String, Object> getRegionTress(); LinkedHashMap<String, Object> getRegionTress();
/** /**
...@@ -45,7 +51,7 @@ public interface EquipFeign { ...@@ -45,7 +51,7 @@ public interface EquipFeign {
* @param id * @param id
* @return * @return
*/ */
@GetMapping(value = "${equip.fegin.prefix}+/maintenanceResourceData/getFireFacilityList") @GetMapping(value = PREFIX+"/maintenanceResourceData/getFireFacilityList")
List<Map<String, Object>> overTimeMaintenanceFacility(@RequestParam String type, @RequestParam String id); ResponseModel<List<Map<String, Object>>> overTimeMaintenanceFacility(@RequestParam String type, @RequestParam String id);
} }
package com.yeejoin.amos.maintenance.business.service.impl;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.AppVersionDao;
import com.yeejoin.amos.maintenance.business.dao.repository.IMsgSubscribeDao;
import com.yeejoin.amos.maintenance.business.param.UserMsgInitParam;
import com.yeejoin.amos.maintenance.business.service.intfc.IAppService;
import com.yeejoin.amos.maintenance.business.service.intfc.IMsgSubscribeService;
import com.yeejoin.amos.maintenance.common.enums.MsgSubscribeTypeEnum;
import com.yeejoin.amos.maintenance.dao.entity.AppVersion;
import com.yeejoin.amos.maintenance.dao.entity.MsgSubscribe;
import org.assertj.core.util.Lists;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
@Service("iAppService")
public class AppServiceImpl implements IAppService {
@Autowired
private IMsgSubscribeDao msgSubscribeDao;
@Autowired
private AppVersionDao appVersionDao;
@Autowired
private IMsgSubscribeService msgSubscribeService;
@Autowired
private PlanTaskMapper planTaskMapper;
@Override
public AppVersion queryAppLastVersion() {
// TODO Auto-generated method stub
return appVersionDao.findLastVersion();
}
/**
* 新增用户时初始化消息订阅(p_msg_subscribe)表
*
* @param userDTO
*/
@Override
public List<MsgSubscribe> saveUserMsgInit(UserMsgInitParam userInitParam) {
Long count = msgSubscribeDao.countByUserId(userInitParam.getUserId());
if (count > 0) { // 已存在用户订阅,直接返回
return msgSubscribeService.queryMsgSubscribes(userInitParam.getUserId());
}
List<MsgSubscribe> msgConfigs = new ArrayList<MsgSubscribe>();
for (MsgSubscribeTypeEnum type : MsgSubscribeTypeEnum.values()) {
MsgSubscribe msgSub = new MsgSubscribe();
msgSub.setOrgCode(userInitParam.getOrgCode());
msgSub.setUserId(userInitParam.getUserId());
if (type.equals(MsgSubscribeTypeEnum.PLANBEGIN)
|| type.equals(MsgSubscribeTypeEnum.PLANWARN)
|| type.equals(MsgSubscribeTypeEnum.PLANEND)) {
msgSub.setAttribute1("False");
msgSub.setAttribute2(10 + "");
} else if (type.equals(MsgSubscribeTypeEnum.CHECKTYPE)
|| type.equals(MsgSubscribeTypeEnum.CHECKEMAIL)) {
msgSub.setAttribute1("error");
}
msgSub.setMsgType(type.getName());
msgSubscribeDao.saveAndFlush(msgSub);
msgConfigs.add(msgSub);
}
return msgConfigs;
}
@Override
public List<String> getHaveToDoList(String userId) {
int taskCount = planTaskMapper.getCurrentPlanTaskCount(userId);
List<String> havetoDoList = Lists.newArrayList();
if (taskCount > 0) {
havetoDoList.add("planPatrol");
}
return havetoDoList;
}
}
\ No newline at end of file
...@@ -21,7 +21,7 @@ import com.yeejoin.amos.maintenance.business.dto.CheckDto; ...@@ -21,7 +21,7 @@ import com.yeejoin.amos.maintenance.business.dto.CheckDto;
import com.yeejoin.amos.maintenance.business.dto.CheckRecordDto; import com.yeejoin.amos.maintenance.business.dto.CheckRecordDto;
import com.yeejoin.amos.maintenance.business.dto.CheckShotDto; import com.yeejoin.amos.maintenance.business.dto.CheckShotDto;
import com.yeejoin.amos.maintenance.business.entity.mybatis.*; import com.yeejoin.amos.maintenance.business.entity.mybatis.*;
import com.yeejoin.amos.maintenance.business.feign.EquipFeign; import com.yeejoin.amos.maintenance.business.feign.EquipFeignClient;
import com.yeejoin.amos.maintenance.business.param.*; import com.yeejoin.amos.maintenance.business.param.*;
import com.yeejoin.amos.maintenance.business.service.intfc.ICheckService; import com.yeejoin.amos.maintenance.business.service.intfc.ICheckService;
import com.yeejoin.amos.maintenance.business.service.intfc.IEquipmentHandlerService; import com.yeejoin.amos.maintenance.business.service.intfc.IEquipmentHandlerService;
...@@ -246,8 +246,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -246,8 +246,8 @@ public class CheckServiceImpl implements ICheckService {
//6.消息广播最近维保日期 //6.消息广播最近维保日期
if(StringUtil.isNotEmpty(point.getOriginalId())){ if(StringUtil.isNotEmpty(point.getOriginalId())){
JSONObject jsonObject = new JSONObject(); JSONObject jsonObject = new JSONObject();
jsonObject.put("facilityId",point.getOriginalId()); jsonObject.put("fireFacilityId",point.getOriginalId());
jsonObject.put("checkTime",check.getCheckTime()); jsonObject.put("maintenanceTime",check.getCheckTime());
mqttGateway.publish(CHECK_UPDATE_TOPIC,jsonObject.toJSONString()); mqttGateway.publish(CHECK_UPDATE_TOPIC,jsonObject.toJSONString());
} }
//7.返回不合格记录 //7.返回不合格记录
...@@ -950,7 +950,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -950,7 +950,7 @@ public class CheckServiceImpl implements ICheckService {
} }
@Autowired @Autowired
private EquipFeign equipment; private EquipFeignClient equipment;
@Override @Override
public List<HashMap<String, Object>> getEquipByCheckId(CheckDetailInputPageParam param) { public List<HashMap<String, Object>> getEquipByCheckId(CheckDetailInputPageParam param) {
......
...@@ -23,7 +23,7 @@ import com.yeejoin.amos.maintenance.business.dao.repository.IMsgDao; ...@@ -23,7 +23,7 @@ import com.yeejoin.amos.maintenance.business.dao.repository.IMsgDao;
import com.yeejoin.amos.maintenance.business.dao.repository.IPlanTaskDetailDao; import com.yeejoin.amos.maintenance.business.dao.repository.IPlanTaskDetailDao;
import com.yeejoin.amos.maintenance.business.dao.repository.IPointDao; import com.yeejoin.amos.maintenance.business.dao.repository.IPointDao;
import com.yeejoin.amos.maintenance.business.dao.repository.IRouteDao; import com.yeejoin.amos.maintenance.business.dao.repository.IRouteDao;
import com.yeejoin.amos.maintenance.business.feign.EquipFeign; import com.yeejoin.amos.maintenance.business.feign.EquipFeignClient;
import com.yeejoin.amos.maintenance.business.service.intfc.IMessageService; import com.yeejoin.amos.maintenance.business.service.intfc.IMessageService;
import com.yeejoin.amos.maintenance.business.util.StringUtil; import com.yeejoin.amos.maintenance.business.util.StringUtil;
import com.yeejoin.amos.maintenance.business.vo.MsgVo; import com.yeejoin.amos.maintenance.business.vo.MsgVo;
...@@ -106,7 +106,7 @@ public class MessageServiceImpl implements IMessageService { ...@@ -106,7 +106,7 @@ public class MessageServiceImpl implements IMessageService {
private RemoteSecurityService remoteSecurityService; private RemoteSecurityService remoteSecurityService;
@Autowired @Autowired
private EquipFeign equipFeign; private EquipFeignClient equipFeign;
@Override @Override
public void pushCheckMessage(String toke,String product,String appKey,Long checkId) { public void pushCheckMessage(String toke,String product,String appKey,Long checkId) {
try{ try{
......
...@@ -3,7 +3,6 @@ package com.yeejoin.amos.maintenance.business.service.impl; ...@@ -3,7 +3,6 @@ package com.yeejoin.amos.maintenance.business.service.impl;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.baomidou.mybatisplus.extension.api.R;
import com.google.common.base.Joiner; import com.google.common.base.Joiner;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
...@@ -14,7 +13,7 @@ import com.yeejoin.amos.maintenance.business.dao.mapper.RouteMapper; ...@@ -14,7 +13,7 @@ import com.yeejoin.amos.maintenance.business.dao.mapper.RouteMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.*; import com.yeejoin.amos.maintenance.business.dao.repository.*;
import com.yeejoin.amos.maintenance.business.dto.PointDto; import com.yeejoin.amos.maintenance.business.dto.PointDto;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckPtListBo; import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckPtListBo;
import com.yeejoin.amos.maintenance.business.feign.EquipFeign; import com.yeejoin.amos.maintenance.business.feign.EquipFeignClient;
import com.yeejoin.amos.maintenance.business.param.*; import com.yeejoin.amos.maintenance.business.param.*;
import com.yeejoin.amos.maintenance.business.service.intfc.IPointService; import com.yeejoin.amos.maintenance.business.service.intfc.IPointService;
import com.yeejoin.amos.maintenance.business.util.DaoCriteria; import com.yeejoin.amos.maintenance.business.util.DaoCriteria;
...@@ -92,7 +91,7 @@ public class PointServiceImpl implements IPointService { ...@@ -92,7 +91,7 @@ public class PointServiceImpl implements IPointService {
@Autowired @Autowired
private RemoteSecurityService remoteSecurityService; private RemoteSecurityService remoteSecurityService;
@Autowired @Autowired
private EquipFeign equipFeign; private EquipFeignClient equipFeign;
@Autowired @Autowired
Sequence sequence; Sequence sequence;
......
...@@ -2,14 +2,14 @@ package com.yeejoin.amos.maintenance.business.service.impl; ...@@ -2,14 +2,14 @@ package com.yeejoin.amos.maintenance.business.service.impl;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper; import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.maintenance.business.feign.EquipFeign; import com.yeejoin.amos.maintenance.business.feign.EquipFeignClient;
import com.yeejoin.amos.maintenance.business.service.intfc.IStatisticsService; import com.yeejoin.amos.maintenance.business.service.intfc.IStatisticsService;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskDetailIsFinishEnum; import com.yeejoin.amos.maintenance.common.enums.PlanTaskDetailIsFinishEnum;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -24,7 +24,7 @@ public class StatisticsServiceImpl implements IStatisticsService { ...@@ -24,7 +24,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
@Autowired @Autowired
PlanTaskMapper planTaskMapper; PlanTaskMapper planTaskMapper;
@Autowired @Autowired
EquipFeign equipFeign; EquipFeignClient equipFeign;
@Override @Override
public Map<String, Object> taskStatusStatistics(ReginParams.PersonIdentity opIdentifyInfo, String orgCode) { public Map<String, Object> taskStatusStatistics(ReginParams.PersonIdentity opIdentifyInfo, String orgCode) {
...@@ -37,8 +37,8 @@ public class StatisticsServiceImpl implements IStatisticsService { ...@@ -37,8 +37,8 @@ public class StatisticsServiceImpl implements IStatisticsService {
resultMap.put("waitExecuteTask", statusNumberMap.get(PlanTaskDetailIsFinishEnum.UNFINISHED.getValue()) == null ? 0L : statusNumberMap.get(PlanTaskDetailIsFinishEnum.UNFINISHED.getValue())); resultMap.put("waitExecuteTask", statusNumberMap.get(PlanTaskDetailIsFinishEnum.UNFINISHED.getValue()) == null ? 0L : statusNumberMap.get(PlanTaskDetailIsFinishEnum.UNFINISHED.getValue()));
// 超时任务数量 // 超时任务数量
resultMap.put("overTimeTask", statusNumberMap.get(PlanTaskDetailIsFinishEnum.OVERTIME.getValue()) == null ? 0L : statusNumberMap.get(PlanTaskDetailIsFinishEnum.OVERTIME.getValue())); resultMap.put("overTimeTask", statusNumberMap.get(PlanTaskDetailIsFinishEnum.OVERTIME.getValue()) == null ? 0L : statusNumberMap.get(PlanTaskDetailIsFinishEnum.OVERTIME.getValue()));
List<Map<String, Object>> overTimeFacility = new ArrayList<>(); ResponseModel<List<Map<String, Object>>> response = equipFeign.overTimeMaintenanceFacility(opIdentifyInfo.getIdentityType(),opIdentifyInfo.getCompanyId());
//overTimeFacility = equipFeign.overTimeMaintenanceFacility(opIdentifyInfo.getIdentityType(),opIdentifyInfo.getCompanyId()); List<Map<String, Object>> overTimeFacility = response.getResult();
// 到期维保设备 // 到期维保设备
resultMap.put("overTimeFacility", overTimeFacility.size()); resultMap.put("overTimeFacility", overTimeFacility.size());
return resultMap; return resultMap;
......
package com.yeejoin.amos.maintenance.business.service.intfc;
import java.util.List;
import com.yeejoin.amos.maintenance.business.param.UserMsgInitParam;
import com.yeejoin.amos.maintenance.dao.entity.AppVersion;
import com.yeejoin.amos.maintenance.dao.entity.MsgSubscribe;
public interface IAppService {
AppVersion queryAppLastVersion();
List<MsgSubscribe> saveUserMsgInit(UserMsgInitParam userInitParam);
List<String> getHaveToDoList(String userId);
}
package com.yeejoin.amos.maintenance.business.service.intfc; package com.yeejoin.amos.maintenance.business.service.intfc;
import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo; import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo;
import com.yeejoin.amos.maintenance.business.vo.CodeOrderVo; import com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam;
import com.yeejoin.amos.maintenance.business.vo.LeavePlanTaskVo; import com.yeejoin.amos.maintenance.business.param.PlanTaskPageParam;
import com.yeejoin.amos.maintenance.business.vo.PlanTaskVo; import com.yeejoin.amos.maintenance.business.vo.PlanTaskVo;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable; import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.dao.entity.PlanTask;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam; import java.text.ParseException;
import com.yeejoin.amos.maintenance.business.param.PlanTaskPageParam; import java.util.HashMap;
import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone; import java.util.List;
import com.yeejoin.amos.maintenance.dao.entity.PlanTask; import java.util.Map;
public interface IPlanTaskService { public interface IPlanTaskService {
...@@ -39,8 +35,10 @@ public interface IPlanTaskService { ...@@ -39,8 +35,10 @@ public interface IPlanTaskService {
* 执行计划导出 * 执行计划导出
*/ */
List<PlanTaskVo> planTaskReport(String toke, String product, String appKey, PlanTaskPageParam params); List<PlanTaskVo> planTaskReport(String toke, String product, String appKey, PlanTaskPageParam params);
/** /**
* 自动任务执行 * 自动任务执行
*
* @param runDate * @param runDate
*/ */
void taskExecution(String runDate); void taskExecution(String runDate);
...@@ -61,10 +59,9 @@ public interface IPlanTaskService { ...@@ -61,10 +59,9 @@ public interface IPlanTaskService {
void disablePlanTask(Long[] routeIds); void disablePlanTask(Long[] routeIds);
/** /**
* 计划任务列表 * 计划任务列表
*
* @param params * @param params
* @param page * @param page
* @return * @return
...@@ -74,19 +71,15 @@ public interface IPlanTaskService { ...@@ -74,19 +71,15 @@ public interface IPlanTaskService {
/** /**
* 根据计划ID获取所有的 任务计划巡检点 * 根据计划ID获取所有的 任务计划巡检点
*
* @param param * @param param
* @return * @return
*/ */
List getPlanTaskPoints(Map<String, Object> param); List getPlanTaskPoints(Map<String, Object> param);
/** /**
* 获取用户当前所有有的计划任务
* @param userId
* @return
*/
int getCurrentPlanTaskCount(String userId);
/**
* 今日执行情况 * 今日执行情况
*
* @param params * @param params
* @return * @return
*/ */
...@@ -94,43 +87,26 @@ public interface IPlanTaskService { ...@@ -94,43 +87,26 @@ public interface IPlanTaskService {
/** /**
* 根据id获取执行计划 * 根据id获取执行计划
*
* @param ids * @param ids
* @return * @return
*/ */
List<PlanTaskVo> getPlanTaskListByIds(String toke,String product,String appKey,Long[] ids); List<PlanTaskVo> getPlanTaskListByIds(String toke, String product, String appKey, Long[] ids);
/**
* 根据任务id点id 获取点详情
* @param planTaskId
* @param pointId
* @return
*/
AppPointCheckRespone queryPointPlanTaskDetail(String toke,String product,String appKey,Long planTaskId,Long pointId);
AppPointCheckRespone queryPointPlanTaskDetailInVersion2(String toke,String product,String appKey,Long planTaskId,Long pointId);
Map<String, Object> getPlanTaskStatisticsForApp(HashMap<String, Object> params);
/** /**
* 获取公司计划累计情况 * 获取公司计划累计情况
*
* @param loginOrgCode * @param loginOrgCode
* @return * @return
*/ */
String getCumulativePlanCountByOrgCode(String loginOrgCode); String getCumulativePlanCountByOrgCode(String loginOrgCode);
List<LeavePlanTaskVo> queryLeavePlanTask(HashMap<String, Object> params);
PlanTask selectPlanTaskStatus(Long id); PlanTask selectPlanTaskStatus(Long id);
void reformStatisticsPlanTask(String strBginDate, String strEndDate, String userId, String orgCode) throws ParseException;
void initPlanStatusOrGenDate(); void initPlanStatusOrGenDate();
List<Map<String,Object>> queryPlanTaskTimeAxis(Long userId,Integer createDate);
List<Map<String,Object>> queryTimeAxis(Long userId,Integer createDate);
/** /**
* 任务点详情 * 任务点详情
* *
......
...@@ -19,6 +19,6 @@ public @interface PersonIdentify { ...@@ -19,6 +19,6 @@ public @interface PersonIdentify {
* 是否进行人员校验 * 是否进行人员校验
* @return * @return
*/ */
boolean isNeedIdentity() default false; boolean isNeedIdentity() default true;
} }
...@@ -40,7 +40,7 @@ public class PersonIdentifyAspect { ...@@ -40,7 +40,7 @@ public class PersonIdentifyAspect {
String identityType = "1"; String identityType = "1";
String personSeq = "1421016571081420802"; String personSeq = "1421016571081420802";
String personName = "SHG"; String personName = "SHG";
String companyId = "10"; String companyId = "1420727427956502529";
reginParam.setPersonIdentity(new ReginParams.PersonIdentity(identityType, personSeq, personName, companyId)); reginParam.setPersonIdentity(new ReginParams.PersonIdentity(identityType, personSeq, personName, companyId));
redisUtils.set(buildKey(RequestContext.getToken()), JSONObject.toJSONString(reginParam)); redisUtils.set(buildKey(RequestContext.getToken()), JSONObject.toJSONString(reginParam));
} }
......
...@@ -38,8 +38,6 @@ public class JobService implements IJobService { ...@@ -38,8 +38,6 @@ public class JobService implements IJobService {
@Autowired @Autowired
private IPlanTaskDao iPlanTaskDao; private IPlanTaskDao iPlanTaskDao;
@Autowired
private IPlanDao iPlanDao;
@Autowired @Autowired
private IPlanTaskDetailDao iPlanTaskDetailDao; private IPlanTaskDetailDao iPlanTaskDetailDao;
...@@ -51,9 +49,6 @@ public class JobService implements IJobService { ...@@ -51,9 +49,6 @@ public class JobService implements IJobService {
private PlanTaskMapper planTaskMapper; private PlanTaskMapper planTaskMapper;
@Autowired @Autowired
private MsgMapper msgMapper;
@Autowired
private ICheckDao iCheckDao; private ICheckDao iCheckDao;
@Autowired @Autowired
...@@ -69,14 +64,10 @@ public class JobService implements IJobService { ...@@ -69,14 +64,10 @@ public class JobService implements IJobService {
private ITaskFeedbackDao taskFeedbackDao; private ITaskFeedbackDao taskFeedbackDao;
@Autowired @Autowired
private CheckMapper checkMapper;
@Autowired
private RemoteSecurityService remoteSecurityService; private RemoteSecurityService remoteSecurityService;
@Value("${amosRefresh.patrol.topic}") @Value("${amosRefresh.patrol.topic}")
private String patrolTopic; private String patrolTopic;
@Autowired
private MqttGateway webMqttComponent;
@Override @Override
@Transactional @Transactional
...@@ -204,12 +195,15 @@ public class JobService implements IJobService { ...@@ -204,12 +195,15 @@ public class JobService implements IJobService {
check.setUserId(planTask.getUserId()); check.setUserId(planTask.getUserId());
check.setUserName(planTask.getUserName()); check.setUserName(planTask.getUserName());
check.setDepName(""); check.setDepName("");
check.setPointName(arg.getPointName());
check.setPointId(arg.getPointId()); check.setPointId(arg.getPointId());
check.setUploadTime(new Date()); check.setUploadTime(new Date());
check.setPlanId(arg.getPlanId()); check.setPlanId(arg.getPlanId());
check.setPlanName(arg.getPlanName());
check.setPlanTaskId(arg.getPlanTaskId()); check.setPlanTaskId(arg.getPlanTaskId());
check.setPlanTaskDetailId(arg.getPlanTaskDetailId()); check.setPlanTaskDetailId(arg.getPlanTaskDetailId());
check.setRouteId(arg.getRouteId()); check.setRouteId(arg.getRouteId());
check.setRouteName(arg.getRouteName());
check.setCheckTime(arg.getEndTime()); check.setCheckTime(arg.getEndTime());
check.setIsOk(CheckStatusEnum.OMISSION.getCode()); check.setIsOk(CheckStatusEnum.OMISSION.getCode());
check = iCheckDao.saveAndFlush(check); check = iCheckDao.saveAndFlush(check);
...@@ -301,7 +295,6 @@ public class JobService implements IJobService { ...@@ -301,7 +295,6 @@ public class JobService implements IJobService {
@Override @Override
public void planTaskAddJob(PlanTask planTask) { public void planTaskAddJob(PlanTask planTask) {
// TODO Auto-generated method stub
try { try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date endTime = sdf.parse(planTask.getEndTime()); Date endTime = sdf.parse(planTask.getEndTime());
...@@ -316,30 +309,6 @@ public class JobService implements IJobService { ...@@ -316,30 +309,6 @@ public class JobService implements IJobService {
|| PlanTaskFinishStatusEnum.UNDERWAY.getValue() == status) { || PlanTaskFinishStatusEnum.UNDERWAY.getValue() == status) {
addJob("planTask", XJConstant.STATUS_MONITOR_END, planTask.getId(), endTime);// 添加监控任务开始结束定时任务 addJob("planTask", XJConstant.STATUS_MONITOR_END, planTask.getId(), endTime);// 添加监控任务开始结束定时任务
} }
// 查询需要推送消息提醒
List<MsgConfigParam> configParam = msgMapper.getPlanTaskMsgConfigByUserIdAndStatus(planTask.getUserId().split(","),
"True");
if (!configParam.isEmpty()) {
configParam.forEach(config -> {
String jobType = "";
Date time = new Date();
int minute = Integer.valueOf(config.getValue());
long tempTime = minute * 60 * 1000;
if (MsgSubscribeTypeEnum.PLANWARN.getName().equals(config.getMsgType())) {
time = new Date(beginTime.getTime() - tempTime);
jobType = XJConstant.PLAN_TASK_WARN_MSG_PUSH + "-" + config.getUserId();
} else if (MsgSubscribeTypeEnum.PLANBEGIN.getName().equals(config.getMsgType())) {
time = new Date(beginTime.getTime() + tempTime);
jobType = XJConstant.PLAN_TASK_BEGIN_MSG_PUSH + "-" + config.getUserId();
} else if (MsgSubscribeTypeEnum.PLANEND.getName().equals(config.getMsgType())) {
time = new Date(endTime.getTime() + tempTime);
jobType = XJConstant.PLAN_TASK_END_MSG_PUSH + "-" + config.getUserId();
}
addJob("planTask", jobType, planTask.getId(), time);
});
}
} else { } else {
updatePlanTaskStatus(planTask, PlanTaskFinishStatusEnum.OVERTIME.getValue()); updatePlanTaskStatus(planTask, PlanTaskFinishStatusEnum.OVERTIME.getValue());
} }
......
...@@ -25,9 +25,9 @@ import com.yeejoin.amos.boot.module.tzs.biz.service.impl.DispatchPaperServiceImp ...@@ -25,9 +25,9 @@ import com.yeejoin.amos.boot.module.tzs.biz.service.impl.DispatchPaperServiceImp
import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ESAlertCalledService; import com.yeejoin.amos.boot.module.tzs.biz.service.impl.ESAlertCalledService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.AlertBeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -147,7 +147,7 @@ public class AlertCalledController extends BaseController { ...@@ -147,7 +147,7 @@ public class AlertCalledController extends BaseController {
alertCallInfoDto.setCallTime(DateUtils.stampToDate(System.currentTimeMillis(),"yyyy-MM-dd HH:mm:ss ")); alertCallInfoDto.setCallTime(DateUtils.stampToDate(System.currentTimeMillis(),"yyyy-MM-dd HH:mm:ss "));
alertCallInfoDto.setWorkOrderNumber(workOrderNumber); alertCallInfoDto.setWorkOrderNumber(workOrderNumber);
alertCallInfoDto.setRecUserId(getUserInfo().getUserId()); alertCallInfoDto.setRecUserId(getUserInfo().getUserId());
alertCallInfoDto.setRecUserName(getUserInfo().getUserName()); alertCallInfoDto.setRecUserName(getUserInfo().getRealName());
return ResponseHelper.buildResponse(alertCallInfoDto); return ResponseHelper.buildResponse(alertCallInfoDto);
} }
...@@ -162,12 +162,13 @@ public class AlertCalledController extends BaseController { ...@@ -162,12 +162,13 @@ public class AlertCalledController extends BaseController {
String number = DateUtils.stampToDate(SystemClock.now(),"yyyy-MM-dd HH:mm:ss SSS"); String number = DateUtils.stampToDate(SystemClock.now(),"yyyy-MM-dd HH:mm:ss SSS");
String newNumber = number.replace("-","").replace(" ","").replace(":",""); String newNumber = number.replace("-","").replace(" ","").replace(":","");
ReginParams reginParams =getSelectedOrgInfo(); ReginParams reginParams =getSelectedOrgInfo();
// Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.dateFormat(new Date(),"")+" 00:00:00", AgencyUserModel user = reginParams.getUserModel();
// DateUtils.dateFormat(new Date(),"")+" 23:59:59",reginParams.getCompany().getOrgCode(), String orgCode = ValidationUtil.isEmpty(user.getCompanys()) ? null : user.getCompanys().get(0).getOrgCode();
// reginParams.getUserModel().getUserId());
Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_TIME_PATTERN), Map<String, Object> map = iAlertCalledService.getAlertInfoList(DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_TIME_PATTERN),
DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_TIME_PATTERN),null, DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_TIME_PATTERN),orgCode,
null); user.getUserId());
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(newNumber); stringBuilder.append(newNumber);
String workOrderNumber = stringBuilder.append(map.get("calledCount") == null ? "1" : String.valueOf(Integer.parseInt(map.get("calledCount").toString()) + 1)).toString() ; String workOrderNumber = stringBuilder.append(map.get("calledCount") == null ? "1" : String.valueOf(Integer.parseInt(map.get("calledCount").toString()) + 1)).toString() ;
...@@ -257,7 +258,7 @@ public class AlertCalledController extends BaseController { ...@@ -257,7 +258,7 @@ public class AlertCalledController extends BaseController {
page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper); page = iAlertCalledService.page(pageBean, alertCalledQueryWrapper);
IPage<AlertCalledDto> calledVoIPage = AlertBeanDtoVoUtils.alertCalledIPageDto(page); IPage<AlertCalledDto> calledVoIPage = AlertBeanDtoVoUtils.alertCalledIPageDto(page);
calledVoIPage.getRecords().stream().forEach(e->{ calledVoIPage.getRecords().stream().forEach(e->{
e.setAlertAddress(e.getCity()+e.getDistrict()); //e.setAlertAddress(e.getAddress());
}); });
return ResponseHelper.buildResponse(calledVoIPage); return ResponseHelper.buildResponse(calledVoIPage);
} }
...@@ -319,6 +320,7 @@ public class AlertCalledController extends BaseController { ...@@ -319,6 +320,7 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询警情事件记录", notes = "查询警情事件记录") @ApiOperation(value = "查询警情事件记录", notes = "查询警情事件记录")
@PostMapping("/selectRecord") @PostMapping("/selectRecord")
...@@ -344,43 +346,39 @@ public class AlertCalledController extends BaseController { ...@@ -344,43 +346,39 @@ public class AlertCalledController extends BaseController {
/** /**
* 冻结工单-维修 * 冻结工单-维修
* @param forzenResult
* @param alertId
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveForzen") @PostMapping(value = "/saveForzen")
@ApiOperation(httpMethod = "POST", value = "冻结工单-维修", notes = "冻结工单-维修") @ApiOperation(httpMethod = "POST", value = "冻结工单-维修", notes = "冻结工单-维修")
public ResponseModel<Boolean> forzenAlertById(@ApiParam(value = "冻结原因", required = true) @RequestParam String forzenResult, @ApiParam(value = "警情id", required = true) @RequestParam Long alertId) { public ResponseModel<Boolean> forzenAlertById(@RequestBody AlertCalledDto alertCalledDto) {
if (ValidationUtil.isEmpty(alertId) if (ValidationUtil.isEmpty(alertCalledDto.getSequenceNbr())
|| ValidationUtil.isEmpty(forzenResult)){ || ValidationUtil.isEmpty(alertCalledDto.getForzenResult())){
throw new BadRequest("参数校验失败."); throw new BadRequest("参数校验失败.");
} }
LambdaUpdateWrapper<AlertCalled> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<AlertCalled> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(AlertCalled::getForzenResult,forzenResult); updateWrapper.set(AlertCalled::getForzenResult,alertCalledDto.getForzenResult());
updateWrapper.set(AlertCalled::getAlertStage,1); updateWrapper.set(AlertCalled::getAlertStage,1);
updateWrapper.eq(AlertCalled::getSequenceNbr,alertId); updateWrapper.eq(AlertCalled::getSequenceNbr,alertCalledDto.getSequenceNbr());
return ResponseHelper.buildResponse(iAlertCalledService.update(updateWrapper)); return ResponseHelper.buildResponse(iAlertCalledService.update(updateWrapper));
} }
/** /**
* 工单结案-投诉 * 工单结案-投诉
* @param finalReason
* @param alertId
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/saveFinalReason") @PostMapping(value = "/saveFinalReason")
@ApiOperation(httpMethod = "POST", value = "工单结案-投诉", notes = "工单结案-投诉") @ApiOperation(httpMethod = "POST", value = "工单结案-投诉", notes = "工单结案-投诉")
public ResponseModel<Boolean> finishAlertById(@ApiParam(value = "结案说明", required = true) @RequestParam String finalReason, @ApiParam(value = "警情id", required = true) @RequestParam Long alertId) { public ResponseModel<Boolean> finishAlertById(@RequestBody AlertCalledDto alertCalledDto) {
if (ValidationUtil.isEmpty(finalReason) if (ValidationUtil.isEmpty(alertCalledDto.getFinalReason())
|| ValidationUtil.isEmpty(alertId)){ || ValidationUtil.isEmpty(alertCalledDto.getSequenceNbr())){
throw new BadRequest("参数校验失败."); throw new BadRequest("参数校验失败.");
} }
LambdaUpdateWrapper<AlertCalled> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<AlertCalled> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(AlertCalled::getFinalReason,finalReason); updateWrapper.set(AlertCalled::getFinalReason,alertCalledDto.getFinalReason());
updateWrapper.set(AlertCalled::getAlertStage,1); updateWrapper.set(AlertCalled::getAlertStage,1);
updateWrapper.eq(AlertCalled::getSequenceNbr,alertId); updateWrapper.eq(AlertCalled::getSequenceNbr,alertCalledDto.getSequenceNbr());
return ResponseHelper.buildResponse(iAlertCalledService.update(updateWrapper)); return ResponseHelper.buildResponse(iAlertCalledService.update(updateWrapper));
} }
......
...@@ -297,7 +297,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -297,7 +297,7 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
dispatchSaveFeedbackDto.setErrorResult(value); dispatchSaveFeedbackDto.setErrorResult(value);
break; break;
case TzsCommonParam.FIX_REMARK: case TzsCommonParam.FIX_REMARK:
value = alertFormValue.getFieldValueCode(); value = alertFormValue.getFieldValue();
dispatchSaveFeedbackDto.setFixRemark(value); dispatchSaveFeedbackDto.setFixRemark(value);
break; break;
} }
...@@ -365,12 +365,14 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -365,12 +365,14 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
break; break;
} }
}); });
if(StringUtils.isNotBlank(dispatchSaveFeedbackDto.getFeedbackCode())) {
dispatchPaper.setFeedbackCode(dispatchSaveFeedbackDto.getFeedbackCode()); dispatchPaper.setFeedbackCode(dispatchSaveFeedbackDto.getFeedbackCode());
dispatchPaper.setFeedbackType(dispatchSaveFeedbackDto.getFeedbackType()); dispatchPaper.setFeedbackType(DispatchPaperEnums.getEnumById(dispatchSaveFeedbackDto.getFeedbackCode()).getValue());
}
dispatchPaper.setFeedbackFinishTime(dispatchSaveFeedbackDto.getFeedbackFinishTime()); dispatchPaper.setFeedbackFinishTime(dispatchSaveFeedbackDto.getFeedbackFinishTime());
dispatchPaper.setFeedbackUid(dispatchSaveFeedbackDto.getFeedbackUid()); dispatchPaper.setFeedbackUid(dispatchSaveFeedbackDto.getFeedbackUid());
dispatchPaper.setFeedbackUname(dispatchSaveFeedbackDto.getFeedbackUname()); dispatchPaper.setFeedbackUname(dispatchSaveFeedbackDto.getFeedbackUname());
if(dispatchPaper.getFeedbackTime() == null && dispatchSaveFeedbackDto.getFeedbackTime() != null) { if(dispatchPaper.getFeedbackTime() == null && dispatchSaveFeedbackDto.getFeedbackFinishTime() != null) {
// 维修反馈 // 维修反馈
Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId(); Long taskId = dispatchPaper.getRepairOrgTaskId() != null ? dispatchPaper.getRepairOrgTaskId() : dispatchPaper.getUseOrgTaskId();
if(taskId == null) { if(taskId == null) {
...@@ -379,8 +381,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -379,8 +381,8 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchSaveFeedbackDto.getAlertId(),TzsCommonParam.WXFK,taskId,user); repairConsultServiceImpl.saveRepairConsultByAlertIdType(dispatchSaveFeedbackDto.getAlertId(),TzsCommonParam.WXFK,taskId,user);
// 修改警情到维修反馈 // 修改警情到维修反馈
alertCalledServiceImpl.updateAlertStageByAlertId(dispatchSaveFeedbackDto.getAlertId(),TzsCommonParam.WXFK); alertCalledServiceImpl.updateAlertStageByAlertId(dispatchSaveFeedbackDto.getAlertId(),TzsCommonParam.WXFK);
dispatchPaper.setFeedbackTime(dispatchSaveFeedbackDto.getFeedbackFinishTime()); // 没有回访时间只有维修完成时间
} }
dispatchPaper.setFeedbackTime(dispatchSaveFeedbackDto.getFeedbackTime());
// 保存动态表单数据 // 保存动态表单数据
iAlertFormValueService.updateBatchById(dynamicFormAlert); iAlertFormValueService.updateBatchById(dynamicFormAlert);
// 保存派遣表 // 保存派遣表
...@@ -568,8 +570,10 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -568,8 +570,10 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
break; break;
} }
}); });
if(StringUtils.isNotBlank(dispatchRepairFeedbackDto.getFeedbackCode())) {
dispatchPaper.setFeedbackCode(dispatchRepairFeedbackDto.getFeedbackCode()); dispatchPaper.setFeedbackCode(dispatchRepairFeedbackDto.getFeedbackCode());
dispatchPaper.setFeedbackType(dispatchRepairFeedbackDto.getFeedbackType()); dispatchPaper.setFeedbackType(DispatchPaperEnums.getEnumById(dispatchRepairFeedbackDto.getFeedbackCode()).getValue());
}
dispatchPaper.setFeedbackFinishTime(dispatchRepairFeedbackDto.getFeedbackFinishTime()); dispatchPaper.setFeedbackFinishTime(dispatchRepairFeedbackDto.getFeedbackFinishTime());
dispatchPaper.setFeedbackUid(dispatchRepairFeedbackDto.getFeedbackUid()); dispatchPaper.setFeedbackUid(dispatchRepairFeedbackDto.getFeedbackUid());
dispatchPaper.setFeedbackUname(dispatchRepairFeedbackDto.getFeedbackUname()); dispatchPaper.setFeedbackUname(dispatchRepairFeedbackDto.getFeedbackUname());
...@@ -772,8 +776,10 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa ...@@ -772,8 +776,10 @@ public class DispatchPaperServiceImpl extends BaseService<DispatchPaperDto,Dispa
break; break;
} }
}); });
if(StringUtils.isNotBlank(dispatchConsultFeedbackDto.getFeedbackCode())) {
dispatchPaper.setFeedbackCode(dispatchConsultFeedbackDto.getFeedbackCode()); dispatchPaper.setFeedbackCode(dispatchConsultFeedbackDto.getFeedbackCode());
dispatchPaper.setFeedbackType(dispatchConsultFeedbackDto.getFeedbackType()); dispatchPaper.setFeedbackType(DispatchPaperEnums.getEnumById(dispatchConsultFeedbackDto.getFeedbackCode()).getValue());
}
if(dispatchPaper.getFeedbackTime() == null && dispatchConsultFeedbackDto.getFeedbackTime() != null) { if(dispatchPaper.getFeedbackTime() == null && dispatchConsultFeedbackDto.getFeedbackTime() != null) {
tempMap.put("FEEDBACK",true); tempMap.put("FEEDBACK",true);
} }
......
...@@ -93,7 +93,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -93,7 +93,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$call",emergency_call); content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$call",emergency_call);
content = content.replace("$area",area).replace("$alertType",alertType); content = content.replace("$area",area).replace("$alertType",alertType);
} else if(TzsCommonParam.PQ.equals(type)) { } else if(TzsCommonParam.PQ.equals(type)) {
String createUser = user.getUserName(); String createUser = user.getRealName();
DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId); DispatchTask dispatchTask = dispatchTaskServiceImpl.getById(taskId);
String unit = dispatchTask.getResponseOrgName(); String unit = dispatchTask.getResponseOrgName();
if(unit == null) if(unit == null)
...@@ -129,7 +129,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai ...@@ -129,7 +129,7 @@ public class RepairConsultServiceImpl extends BaseService<RepairConsultDto,Repai
String FKFS = rescueProcessDto.getArriveFeedbackType(); String FKFS = rescueProcessDto.getArriveFeedbackType();
content = content.replace("$FKFS",FKFS); content = content.replace("$FKFS",FKFS);
} else if(TzsCommonParam.JYHF.equals(type)) { } else if(TzsCommonParam.JYHF.equals(type)) {
String createUser = user.getUserName(); String createUser = user.getRealName();
String create = alertCalledVo.getEmergencyPerson(); String create = alertCalledVo.getEmergencyPerson();
content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$create",create); content = content.replace("$createTime",createTime).replace("$createUser",createUser).replace("$create",create);
} else if(TzsCommonParam.WXFK.equals(type)) { //从派遣单获取数据 } else if(TzsCommonParam.WXFK.equals(type)) { //从派遣单获取数据
......
...@@ -31,8 +31,8 @@ spring.liquibase.enabled=true ...@@ -31,8 +31,8 @@ spring.liquibase.enabled=true
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
equip.fegin.name=AMOS-EQUIPMANAGE equip.feign.name=AMOS-EQUIPMANAGE-SHG
equip.fegin.prefix=/equip equip.feign.prefix=/equip
input.custom.prefix = QYZD input.custom.prefix = QYZD
input.statute.prefix = FG input.statute.prefix = FG
...@@ -54,7 +54,7 @@ management.endpoints.web.exposure.exclude=* ...@@ -54,7 +54,7 @@ management.endpoints.web.exposure.exclude=*
## redis失效时间 ## redis失效时间
redis.cache.failure.time=10800 redis.cache.failure.time=10800
## eureka properties: ## eureka properties:
eureka.client.registry-fetch-interval-seconds=5 eureka.client.registry-fetch-interval-seconds=50
eureka.instance.prefer-ip-address=true eureka.instance.prefer-ip-address=true
management.endpoint.health.show-details=always management.endpoint.health.show-details=always
management.endpoints.web.exposure.include=* management.endpoints.web.exposure.include=*
......
...@@ -378,13 +378,14 @@ ...@@ -378,13 +378,14 @@
</select> </select>
<select id="getPlanTaskPointInputItemByPlanTaskId" resultType="com.yeejoin.amos.maintenance.business.entity.mybatis.PlanTaskPointInputItemBo"> <select id="getPlanTaskPointInputItemByPlanTaskId" resultType="com.yeejoin.amos.maintenance.business.entity.mybatis.PlanTaskPointInputItemBo">
SELECT SELECT
ppi.input_item_id inputItemId, ppi.input_item_id inputItemId,
temp1.order_no orderNo, temp1.order_no orderNo,
temp1.routePointItemId, temp1.routePointItemId,
temp1.classifyId, temp1.classifyId,
temp1.classifyName, temp1.classifyName,
temp1.routeName,
temp1.pointName,
pii.`name` inputName, pii.`name` inputName,
temp2.* temp2.*
FROM FROM
...@@ -399,11 +400,15 @@ ...@@ -399,11 +400,15 @@
prp.route_id, prp.route_id,
prpi.id routePointItemId, prpi.id routePointItemId,
ppc.id classifyId, ppc.id classifyId,
ppc.`name` classifyName ppc.`name` classifyName,
r.name as routeName,
p.name as pointName
FROM FROM
p_route_point_item prpi p_route_point_item prpi
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id
LEFT JOIN p_point_classify ppc ON prpi.point_classify_id = ppc.id LEFT JOIN p_point_classify ppc ON prpi.point_classify_id = ppc.id
LEFT JOIN p_route r ON r.id = prp.route_id
LEFT JOIN p_point p ON p.id = prp.point_id
) temp1 ON(ppi.id = temp1.point_input_item_id) ) temp1 ON(ppi.id = temp1.point_input_item_id)
RIGHT JOIN RIGHT JOIN
...@@ -417,16 +422,15 @@ ...@@ -417,16 +422,15 @@
ptd.org_code AS orgCode, ptd.org_code AS orgCode,
ptd.end_time AS endTime, ptd.end_time AS endTime,
pptd.id as planTaskDetailId, pptd.id as planTaskDetailId,
(select p_plan.dept_id from p_plan where p_plan.id=ptd.plan_id) depId (select p_plan.dept_id from p_plan where p_plan.id=ptd.plan_id) depId,
(select p_plan.name from p_plan where p_plan.id=ptd.plan_id) planName
FROM FROM
p_plan_task_detail pptd, p_plan_task_detail pptd,
p_plan_task ptd p_plan_task ptd
WHERE WHERE
pptd.task_no = ptd.id pptd.task_no = ptd.id
AND ptd.id = #{planTaskId} and pptd.`status` = #{planTaskDetailStatus} AND ptd.id = #{planTaskId} and pptd.`status` = #{planTaskDetailStatus}
) temp2 on(temp1.point_id = temp2.pointId ) temp2 on temp1.point_id = temp2.pointId AND temp1.route_id = temp2.routeId
AND temp1.route_id = temp2.routeId)
</select> </select>
<!-- 巡检执行情况统计分页用 --> <!-- 巡检执行情况统计分页用 -->
<select id="countChkExListData" resultType="long"> <select id="countChkExListData" resultType="long">
......
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