Commit 8a62f863 authored by KeYong's avatar KeYong

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

parents e8026901 b2b01429
...@@ -11,9 +11,9 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -11,9 +11,9 @@ import org.springframework.web.bind.annotation.RequestParam;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import javax.servlet.http.HttpServletResponse; import feign.Response;
@FeignClient(name = "AMOS-API-WORKFLOW", path = "workflow", configuration = { CommonMultipartSupportConfig.class }) @FeignClient(name = "AMOS-API-WORKFLOW-CHENZHAO", path = "workflow", configuration = { CommonMultipartSupportConfig.class })
public interface WorkflowFeignService { public interface WorkflowFeignService {
/** /**
* 发起流程 * 发起流程
...@@ -109,11 +109,11 @@ public interface WorkflowFeignService { ...@@ -109,11 +109,11 @@ public interface WorkflowFeignService {
/** /**
* 流程图高亮 * 流程图高亮
* */ * */
@RequestMapping(value = "/activitiHistory/gethighLineImg/{processInstanceId}",method = RequestMethod.GET) @RequestMapping(value = "/activitiHistory/gethighLineImg/{processInstanceId}", method = RequestMethod.GET)
JSONObject thighLineImg(@PathVariable("processInstanceId") String processInstanceId, HttpServletResponse resp) ; Response thighLineImg(@PathVariable("processInstanceId") String processInstanceId) ;
/** /**
* 流程图高亮图片 * 流程图高亮图片
* */ * */
@RequestMapping(value = "/activitiHistory/gethighLine",method = RequestMethod.GET) @RequestMapping(value = "/activitiHistory/gethighLine",method = RequestMethod.GET)
JSONObject thighLine(@RequestParam("instanceId") String instanceId); Response thighLine(@RequestParam("instanceId") String instanceId);
} }
package com.yeejoin.amos.boot.module.common.api.enums; package com.yeejoin.amos.boot.module.common.api.enums;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
public enum FailureStatuEnum { public enum FailureStatuEnum {
WAITING_AUDIT(0,"待审核"), WAITING_AUDIT(0,"待审核"),
...@@ -27,5 +32,14 @@ public enum FailureStatuEnum { ...@@ -27,5 +32,14 @@ public enum FailureStatuEnum {
return name; return name;
} }
public static List<HashMap<String,String>> getEnumList() {
List<HashMap<String, String>> list = new ArrayList<>();
for (FailureStatuEnum testEnum : EnumSet.allOf(FailureStatuEnum.class)) {
HashMap<String, String> map = new HashMap<>();
map.put(testEnum.name,testEnum.code.toString());
list.add(map);
}
return list;
} }
}
...@@ -23,10 +23,12 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> { ...@@ -23,10 +23,12 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> {
/** /**
* 查询全部 分页 * 查询全部 分页
* *
* @param page * @param current 当前页
* @return * @return
*/ */
IPage<FailureDetails> selectAllPage(Page page);
List<FailureDetails> selectAllPage(Long current,Long size, Long currentStatus,
String startTime,String endTime, Integer submissionPid);
/** /**
* 查询我发起的 分页 * 查询我发起的 分页
...@@ -35,31 +37,94 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> { ...@@ -35,31 +37,94 @@ public interface FailureDetailsMapper extends BaseMapper<FailureDetails> {
* *
* @return * @return
*/ */
IPage<FailureDetails> selectISubPage(Page page, String submissionPid); List<FailureDetails> selectISubPage(Long current,Long size, Long currentStatus,
String startTime,String endTime, Integer submissionPid);
/** /**
* 查询待处理 分页 * 查询待处理 分页
* *
* @param page * @param
* @return * @return
*/ */
IPage<FailureDetails> selectInProcessing(Page page); List<FailureDetails> selectInProcessing(Long current,Long size,Long currentStatus,
String startTime,String endTime, Integer submissionPid);
/**
IPage<FailureDetails> selectStatusWaitTj(Page page); * 查询待处理 应急指挥科人员分页
*
IPage<FailureDetails> selectStatusWaitWx(); * @param
* @return
*/
List<FailureDetails> selectStatusWaitTj(Long current,Long size,Long currentStatus,
String startTime,String endTime, Integer submissionPid);
/**
* 查询待处理 维修人员分页
*
* @param
* @return
*/
List<FailureDetails> selectStatusWaitWx(Long current,Long size,Long currentStatus,
String startTime,String endTime, Integer submissionPid);
List<StatusDto> selectStatusCount(); /**
* 统计 全部
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
*
* @return
*/
List<StatusDto> selectStatusCount(Long currentStatus,String startTime,String endTime, Integer submissionPid);
List<StatusDto> selectStatusWx();
List<StatusDto> selectStatusFq(); /**
* 统计 维修人员
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
*
* @return
*/
List<StatusDto> selectStatusWx(Long currentStatus,String startTime,String endTime, Integer submissionPid);
/**
* 统计 应急指挥科人员
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
*
* @return
*/
List<StatusDto> selectStatusFq(Long currentStatus,String startTime,String endTime, Integer submissionPid);
/**
* 统计 我发起
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
*
* @return
*/
List<StatusDto> selectStatusFqp(Long currentStatus,String startTime,String endTime, Integer submissionPid);
/**
* 统计 领导
*
* @param currentStatus 状态
* @param startTime 起始时间
* @param endTime 结束时间
* @param submissionPid 报送人
*
* @return
*/
List<StatusDto> selectStatusLeader(Long currentStatus,String startTime,String endTime, Integer submissionPid);
List<StatusDto> selectStatusFqp(Integer submissionPid);
List<StatusDto> selectStatusLeader();
} }
package com.yeejoin.amos.boot.module.common.api.mapper; package com.yeejoin.amos.boot.module.common.api.mapper;
import java.util.List;
import java.util.Map;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
...@@ -12,6 +7,10 @@ import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto; ...@@ -12,6 +7,10 @@ import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitZhDto; import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitZhDto;
import com.yeejoin.amos.boot.module.common.api.dto.RequestData; import com.yeejoin.amos.boot.module.common.api.dto.RequestData;
import com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit; import com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/** /**
* 联动单位 Mapper 接口 * 联动单位 Mapper 接口
...@@ -59,7 +58,7 @@ public interface LinkageUnitMapper extends BaseMapper<LinkageUnit> { ...@@ -59,7 +58,7 @@ public interface LinkageUnitMapper extends BaseMapper<LinkageUnit> {
* @return * @return
*/ */
Page<List<LinkageUnitDto>> getEmergencyLinkageUnitList(IPage<LinkageUnitDto> page,String unitName, Page<List<LinkageUnitDto>> getEmergencyLinkageUnitList(IPage<LinkageUnitDto> page,String unitName,
String linkageUnitTypeCode, String emergencyLinkageUnitCode); String linkageUnitType, String emergencyLinkageUnitCode);
List<LinkageUnitDto> exportToExcel(); List<LinkageUnitDto> exportToExcel();
......
...@@ -45,8 +45,17 @@ ...@@ -45,8 +45,17 @@
a.latitude, a.latitude,
a.longitude, a.longitude,
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1)
AS distance AS distance,
FROM cb_linkage_unit a case when csps.person_number is null then 0 else
csps.person_number end as userNum,
case when cre.vehicle_number is null then 0 else cre.vehicle_number end as
carNum
FROM
cb_linkage_unit a
LEFT JOIN cb_special_position_staff csps ON a.sequence_nbr =
csps.company_id
LEFT JOIN cb_rescue_equipment cre on a.sequence_nbr = cre.company_id
where a.longitude is not null and where a.longitude is not null and
a.latitude is not null a.latitude is not null
<if test='par.distance!=null'> <if test='par.distance!=null'>
...@@ -87,28 +96,38 @@ ...@@ -87,28 +96,38 @@
emergency_linkage_unit_code emergency_linkage_unit_code
</select> </select>
<select id="exportToExcel" resultType="com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto"> <select id="exportToExcel"
resultType="com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto">
select select
a.unit_name unitName, a.unit_name unitName,
a.linkage_unit_type linkageUnitType, a.linkage_unit_type
linkageUnitType,
a.address , a.address ,
a.latitude, a.latitude,
a.longitude, a.longitude,
a.agreement_start_date agreementStartDate, a.agreement_start_date agreementStartDate,
a.agreement_end_date agreementEndDate, a.agreement_end_date
agreementEndDate,
a.contact_user contactUser, a.contact_user contactUser,
a.contact_phone contactPhone, a.contact_phone
contactPhone,
b.* b.*
from cb_linkage_unit a LEFT JOIN from cb_linkage_unit a LEFT JOIN
(SELECT (SELECT
m.instance_id, m.instance_id,
max(case m.field_code when 'emergencyServiceContent' then m.field_value end) emergencyServiceContent, max(case m.field_code when 'emergencyServiceContent' then
max(case m.field_code when 'fireRescueCapability' then m.field_value end) fireRescueCapability, m.field_value end) emergencyServiceContent,
max(case m.field_code when 'responsibilitiesSituation' then m.field_value end) responsibilitiesSituation, max(case m.field_code when
max(case m.field_code when 'unitSituation' then m.field_value end) unitSituation 'fireRescueCapability' then m.field_value end) fireRescueCapability,
FROM cb_dynamic_form_instance m GROUP BY m.instance_id) b max(case m.field_code when 'responsibilitiesSituation' then
m.field_value end) responsibilitiesSituation,
max(case m.field_code
when 'unitSituation' then m.field_value end) unitSituation
FROM
cb_dynamic_form_instance m GROUP BY m.instance_id) b
on b.instance_id=a.instance_id where a.unit_name is not null on
b.instance_id=a.instance_id where a.unit_name is not null
</select> </select>
...@@ -120,13 +139,18 @@ ...@@ -120,13 +139,18 @@
clu.unit_code AS unitCode, clu.unit_code AS unitCode,
clu.parent_id AS parentId, clu.parent_id AS parentId,
clu.linkage_unit_type AS linkageUnitType, clu.linkage_unit_type AS linkageUnitType,
clu.linkage_unit_type_code AS linkageUnitTypeCode, clu.linkage_unit_type_code AS
clu.administrative_divisions AS administrativeDivisions, linkageUnitTypeCode,
clu.administrative_divisions_code AS administrativeDivisionsCode, clu.administrative_divisions AS
administrativeDivisions,
clu.administrative_divisions_code AS
administrativeDivisionsCode,
clu.address AS address, clu.address AS address,
clu.longitude AS longitude, clu.longitude AS
longitude,
clu.latitude AS latitude, clu.latitude AS latitude,
clu.agreement_start_date AS agreementStartDate, clu.agreement_start_date AS
agreementStartDate,
clu.agreement_end_date AS agreementEndDate, clu.agreement_end_date AS agreementEndDate,
clu.emergency_linkage_unit AS emergencyLinkageUnit, clu.emergency_linkage_unit AS emergencyLinkageUnit,
clu.emergency_linkage_unit_code AS emergencyLinkageUnitCode, clu.emergency_linkage_unit_code AS emergencyLinkageUnitCode,
...@@ -157,14 +181,16 @@ ...@@ -157,14 +181,16 @@
FROM FROM
cb_linkage_unit clu cb_linkage_unit clu
WHERE clu.is_delete=0 WHERE clu.is_delete=0
<if test="unitName != null and unitName != ''"> <if test="unitName != null and unitName != ''">
AND clu.unit_name LIKE concat(#{unitName}, '%') AND clu.unit_name LIKE concat(#{unitName}, '%')
</if> </if>
<if test="linkageUnitTypeCode != null and linkageUnitTypeCode != ''"> <if
AND clu.linkage_unit_type_code =#{linkageUnitTypeCode} test="linkageUnitType != null and linkageUnitType != ''">
AND clu.linkage_unit_type =#{linkageUnitType}
</if> </if>
<if test="emergencyLinkageUnitCode != null and emergencyLinkageUnitCode != ''"> <if
AND clu.emergency_linkage_unit_code =#{emergencyLinkageUnitCode} test="emergencyLinkageUnitCode != null and emergencyLinkageUnitCode != ''">
AND clu.emergency_linkage_unit_code =#{emergencyLinkageUnitCode}
</if> </if>
</select> </select>
</mapper> </mapper>
...@@ -6,8 +6,6 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -6,8 +6,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.List;
/** /**
* 调派资源dto * 调派资源dto
* *
......
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 调派资源统计dto
*
* @author tb
* @date 2021-08-20
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AllArgsConstructor
@ApiModel(value="ResourceStatisticsDto", description="调派资源统计dto")
public class ResourceStatisticsDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "类型")
private String type;
@ApiModelProperty(value = "全部")
private Integer allCount = 0;
@ApiModelProperty(value = "到场")
private Integer arrived = 0;
@ApiModelProperty(value = "途中")
private Integer underway = 0;
public ResourceStatisticsDto(String type, Integer allCount) {
this.type = type;
this.allCount = allCount;
this.arrived = 0;
this.underway = 0;
}
}
...@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto; ...@@ -10,6 +10,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferResourceDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferResourceDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ResourceStatisticsDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer; import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -96,6 +97,15 @@ public interface PowerTransferMapper extends BaseMapper<PowerTransfer> { ...@@ -96,6 +97,15 @@ public interface PowerTransferMapper extends BaseMapper<PowerTransfer> {
@Param("alertCalledId") Long alertCalledId); @Param("alertCalledId") Long alertCalledId);
/** /**
* 根据类型查询力量调派统计
*
* @param alertCalledId
* @param type
* @return
*/
List<ResourceStatisticsDto> getPowerTransferTeamResourceCount(Long alertCalledId, String type);
/**
* 根据参数获取警情当前已调派车辆资源列表信息 * 根据参数获取警情当前已调派车辆资源列表信息
* *
* @param alertCalledId 警情id * @param alertCalledId 警情id
......
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.PowerCompanyCountDto; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.PowerCompanyCountDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferResourceDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferResourceDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ResourceStatisticsDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer; import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto;
...@@ -43,4 +44,13 @@ public interface IPowerTransferService extends IService<PowerTransfer> { ...@@ -43,4 +44,13 @@ public interface IPowerTransferService extends IService<PowerTransfer> {
* @return * @return
*/ */
IPage<PowerTransferResourceDto> getPowerTransferPageByParam(Long alertCalledId, String type, Page<PowerTransferResourceDto> page); IPage<PowerTransferResourceDto> getPowerTransferPageByParam(Long alertCalledId, String type, Page<PowerTransferResourceDto> page);
/**
* 根据参数查询力量调派资源统计信息
*
* @param alertCalledId 警情id
* @param type 查询类型
* @return
*/
List<ResourceStatisticsDto> getPowerTransferStatistics(Long alertCalledId, String type);
} }
...@@ -210,6 +210,32 @@ ...@@ -210,6 +210,32 @@
transfer.alert_called_id = #{alertCalledId} transfer.alert_called_id = #{alertCalledId}
AND is_distribution_agencies = 0 AND is_distribution_agencies = 0
</select> </select>
<select id="getPowerTransferTeamResourceCount"
resultType="com.yeejoin.amos.boot.module.jcs.api.dto.ResourceStatisticsDto">
SELECT
"team" type,
count( DISTINCT company.company_id ) allCount
FROM
jc_power_transfer_company company
LEFT JOIN jc_power_transfer transfer ON transfer.sequence_nbr = company.power_transfer_id
WHERE
transfer.alert_called_id = #{alertCalledId}
AND is_distribution_agencies = 0 UNION ALL
SELECT
"car" type,
count( DISTINCT car.resources_id ) allCount
FROM
jc_power_transfer_company_resources car
LEFT JOIN jc_power_transfer_company company ON company.sequence_nbr = car.power_transfer_company_id
LEFT JOIN jc_power_transfer transfer ON transfer.sequence_nbr = company.power_transfer_id
WHERE
transfer.alert_called_id = #{alertCalledId}
AND is_distribution_agencies = 0
UNION ALL
SELECT
"person" type,
0 allCount
</select>
<select id="getPowerTransferCarResource" <select id="getPowerTransferCarResource"
resultType="com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferResourceDto"> resultType="com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferResourceDto">
SELECT DISTINCT SELECT DISTINCT
......
...@@ -390,6 +390,32 @@ public class InputItem extends BasicEntity { ...@@ -390,6 +390,32 @@ public class InputItem extends BasicEntity {
return this.getId() == inputItem.getId(); return this.getId() == inputItem.getId();
} }
/**
* 维保公司id
*/
private String companyId;
/**
* 维保公司名称
*/
private String companyName;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public String getLevel() { public String getLevel() {
return level; return level;
} }
......
...@@ -2,9 +2,9 @@ package com.yeejoin.amos.maintenance.dao.entity; ...@@ -2,9 +2,9 @@ package com.yeejoin.amos.maintenance.dao.entity;
import java.sql.Time; import java.sql.Time;
import java.util.Date; import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import javax.persistence.*; import javax.persistence.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.LastModifiedDate; import org.springframework.data.annotation.LastModifiedDate;
...@@ -65,6 +65,32 @@ public class Plan extends BasicEntity { ...@@ -65,6 +65,32 @@ public class Plan extends BasicEntity {
private String ownerId; private String ownerId;
/**
* 维保公司id
*/
private String companyId;
/**
* 维保公司名称
*/
private String companyName;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
@Transient @Transient
public String getOwnerId() { public String getOwnerId() {
return ownerId; return ownerId;
......
...@@ -80,6 +80,32 @@ public class Point extends BasicEntity { ...@@ -80,6 +80,32 @@ public class Point extends BasicEntity {
private String extendJson; private String extendJson;
/** /**
* 维保公司id
*/
private String companyId;
/**
* 维保公司名称
*/
private String companyName;
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
/**
* 定点拍照数 * 定点拍照数
*/ */
@Column(name="fixed_shot") @Column(name="fixed_shot")
......
...@@ -51,6 +51,16 @@ public class Route extends BasicEntity { ...@@ -51,6 +51,16 @@ public class Route extends BasicEntity {
private String orgCode; private String orgCode;
/** /**
* 维保公司id
*/
private String companyId;
/**
* 维保公司名称
*/
private String companyName;
/**
* 备注说明 * 备注说明
*/ */
private String remark; private String remark;
...@@ -133,6 +143,22 @@ public class Route extends BasicEntity { ...@@ -133,6 +143,22 @@ public class Route extends BasicEntity {
return coordinates; return coordinates;
} }
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
public void setCoordinates(String coordinates) { public void setCoordinates(String coordinates) {
this.coordinates = coordinates; this.coordinates = coordinates;
} }
......
...@@ -422,8 +422,10 @@ public class CommandController extends BaseController { ...@@ -422,8 +422,10 @@ public class CommandController extends BaseController {
@TycloudOperation( needAuth = true,ApiLevel = UserType.AGENCY) @TycloudOperation( needAuth = true,ApiLevel = UserType.AGENCY)
@GetMapping(value = "/SY") @GetMapping(value = "/SY")
@ApiOperation(httpMethod = "GET", value = "根据id查询水源", notes = "根据id查询水源") @ApiOperation(httpMethod = "GET", value = "根据id查询水源", notes = "根据id查询水源")
public ResponseModel<WaterResourceDto> selectOne( Long id) { public ResponseModel<JSONObject> selectOne( Long id) {
return ResponseHelper.buildResponse(iWaterResourceService.selectBySequenceNbr(id)); JSONObject jsonObject= JSONObject.parseObject(JSONObject.toJSONString(iWaterResourceService.selectBySequenceNbr(id)));
jsonObject.remove("managementUnit");
return ResponseHelper.buildResponse(jsonObject);
} }
...@@ -945,7 +947,7 @@ public class CommandController extends BaseController { ...@@ -945,7 +947,7 @@ public class CommandController extends BaseController {
@ApiOperation(httpMethod = "GET",value = "app-根据警情id查询力量调派列表", notes = "app-根据警情id查询力量调派列表") @ApiOperation(httpMethod = "GET",value = "app-根据警情id查询力量调派列表", notes = "app-根据警情id查询力量调派列表")
@GetMapping(value = "/app/transferList") @GetMapping(value = "/app/transferList")
public ResponseModel getPowerTransferList(@RequestParam String alertId, public ResponseModel getPowerTransferList(@RequestParam String alertId,
@RequestParam(defaultValue = "company") String type, @RequestParam(defaultValue = "team") String type,
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) { @RequestParam(value = "size") int size) {
Page page = new Page(); Page page = new Page();
...@@ -953,4 +955,12 @@ public class CommandController extends BaseController { ...@@ -953,4 +955,12 @@ public class CommandController extends BaseController {
page.setCurrent(current); page.setCurrent(current);
return ResponseHelper.buildResponse(powerTransferService.getPowerTransferPageByParam(Long.valueOf(alertId), type, page)); return ResponseHelper.buildResponse(powerTransferService.getPowerTransferPageByParam(Long.valueOf(alertId), type, page));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "app-根据警情id查询力量调派资源统计", notes = "app-根据警情id查询力量调派资源统计")
@GetMapping(value = "/app/transfer/statistics")
public ResponseModel getPowerTransferStatistics(@RequestParam String alertId,
@RequestParam(defaultValue = "team") String type) {
return ResponseHelper.buildResponse(powerTransferService.getPowerTransferStatistics(Long.valueOf(alertId), type));
}
} }
\ No newline at end of file
...@@ -123,12 +123,12 @@ public class LinkageUnitController extends BaseController { ...@@ -123,12 +123,12 @@ public class LinkageUnitController extends BaseController {
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "联动单位分页查询", notes = "联动单位分页查询") @ApiOperation(httpMethod = "GET", value = "联动单位分页查询", notes = "联动单位分页查询")
public ResponseModel<Page<LinkageUnitDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam public ResponseModel<Page<LinkageUnitDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size, String unitName, String linkageUnitTypeCode, String inAgreement, String emergencyLinkageUnitCode) { (value = "size") int size, String unitName, String linkageUnitType, String inAgreement, String emergencyLinkageUnitCode) {
Page<LinkageUnitDto> page = new Page<LinkageUnitDto>(); Page<LinkageUnitDto> page = new Page<LinkageUnitDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
Page<LinkageUnitDto> linkageUnitDtoPage = linkageUnitServiceImpl.queryForLinkageUnitPage(page, false, Page<LinkageUnitDto> linkageUnitDtoPage = linkageUnitServiceImpl.queryForLinkageUnitPage(page, false,
unitName, linkageUnitTypeCode, emergencyLinkageUnitCode,inAgreement); unitName, linkageUnitType, emergencyLinkageUnitCode,inAgreement);
return ResponseHelper.buildResponse(linkageUnitDtoPage); return ResponseHelper.buildResponse(linkageUnitDtoPage);
} }
......
package com.yeejoin.amos.boot.module.common.biz.controller; package com.yeejoin.amos.boot.module.common.biz.controller;
import java.util.List; import com.baomidou.mybatisplus.core.metadata.IPage;
import java.util.Map;
import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.MaintenanceCompanyServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.utils.MyException;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -22,17 +27,9 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation; ...@@ -22,17 +27,9 @@ import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import com.baomidou.mybatisplus.core.metadata.IPage; import javax.servlet.http.HttpServletRequest;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import java.util.List;
import com.yeejoin.amos.boot.module.common.api.dto.OrgMenuDto; import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.entity.MaintenanceCompany;
import com.yeejoin.amos.boot.module.common.api.service.IMaintenanceCompanyService;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.MaintenanceCompanyServiceImpl;
import com.yeejoin.amos.boot.module.common.biz.utils.MyException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
/** /**
* 维保单位 * 维保单位
......
...@@ -384,10 +384,9 @@ public class WaterResourceController extends BaseController { ...@@ -384,10 +384,9 @@ public class WaterResourceController extends BaseController {
@GetMapping(value = "/select_list") @GetMapping(value = "/select_list")
public ResponseModel<List<WaterResourceDto>> selectList(String name, Long sequenceNbr, public ResponseModel<List<WaterResourceDto>> selectList(String name, Long sequenceNbr,
Long belongFightingSystemId, Long belongBuildingId, Long belongFightingSystemId, Long belongBuildingId,
String belongBuilding, String resourceType) { String belongBuilding, String resourceType, String classifyId) {
return ResponseHelper.buildResponse(waterResourceServiceImpl.queryWaterResourceList(true, name, sequenceNbr, return ResponseHelper.buildResponse(waterResourceServiceImpl.queryWaterResourceList(true, name,
belongFightingSystemId, belongBuildingId, sequenceNbr, belongFightingSystemId, belongBuildingId, belongBuilding, resourceType, classifyId));
belongBuilding, resourceType));
} }
/** /**
......
...@@ -73,65 +73,62 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -73,65 +73,62 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public static Integer SELECY_ISUBMIT = 8; public static Integer SELECY_ISUBMIT = 8;
public String[] roleName = {"maintenance_department_maintenance_personnel", "emergency_command_staff"}; public String[] roleName = {"maintenance_department_maintenance_personnel", "emergency_command_staff"};
/** /**
* 分页查询 * 分页查询接口
* @param type 查询类型
* @param currentStatus 状态
* @param startTime 起始时间
* @param startTime 结束时间
* @param userId 用户id
*/ */
public IPage<FailureDetails> queryAllPage(long size, long current) { public IPage<FailureDetails> queryForFailureDetailsPage(Page<FailureDetails> page, ReginParams userInfo, Long currentStatus,
Page pages = new Page<>(current, size); String startTime, String endTime, Integer userId, Integer type) {
LambdaQueryWrapper<FailureDetails> lambdaQueryWrapper = new LambdaQueryWrapper(); //当传递类型参数为全部查询时
lambdaQueryWrapper.orderByDesc(FailureDetails::getSubmissionTime);
return page(pages, lambdaQueryWrapper);
}
public IPage<FailureDetails> queryForFailureDetailsPage(Page<FailureDetails> page, ReginParams userInfo,
Integer type) {
if (type.equals(SELECY_ALL)) { if (type.equals(SELECY_ALL)) {
return this.baseMapper.selectAllPage(page);
List<FailureDetails> list = this.baseMapper.selectAllPage(page.getCurrent(), page.getSize(), currentStatus, startTime, endTime, userId);
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(list);
return iPage;
} }
//当传递类型参数为我提交时
if (type.equals(SELECY_ISUBMIT)) { if (type.equals(SELECY_ISUBMIT)) {
return baseMapper.selectISubPage(page, userInfo.getUserModel().getUserId()); List<FailureDetails> list = baseMapper.selectISubPage(page.getCurrent(), page.getSize(), currentStatus, startTime, endTime, Integer.parseInt(userInfo.getUserModel().getUserId()));
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(list);
return iPage;
} }
return this.queryForWaitManage(page, userInfo); //否则就查询待处理
return this.queryForWaitManage(page, userInfo, currentStatus, startTime, endTime, userId);
} }
/**
* 我发起分页查询
*/
public IPage<FailureDetails> queryForPage(Page<FailureDetails> page, String submissionPid) {
if (submissionPid == null) {
return null;
}
Page pages = new Page<>(page.getCurrent(), page.getSize());
LambdaQueryWrapper<FailureDetails> lambdaQueryWrapper = new LambdaQueryWrapper();
lambdaQueryWrapper.eq(FailureDetails::getSubmissionPid, submissionPid);
lambdaQueryWrapper.orderByDesc(FailureDetails::getSubmissionTime);
return page(pages, lambdaQueryWrapper);
}
/** /**
* 待处理分页查询 * 待处理分页查询
*/ */
public IPage<FailureDetails> queryForWaitManage(Page<FailureDetails> page, ReginParams userInfo) { public IPage<FailureDetails> queryForWaitManage(Page<FailureDetails> page, ReginParams userInfo, Long currentStatus,
String startTime, String endTime, Integer userId) {
if (userInfo.getRole().getRoleName().equals(roleName[0])) { if (userInfo.getRole().getRoleName().equals(roleName[0])) {
return baseMapper.selectStatusWaitWx(); IPage<FailureDetails> wxIpage = new Page<>();
List<FailureDetails> list = baseMapper.selectStatusWaitWx(page.getCurrent(), page.getSize(),currentStatus, startTime, endTime, userId);
wxIpage.setRecords(list);
return wxIpage;
} else if (userInfo.getRole().getRoleName().equals(roleName[1])) { } else if (userInfo.getRole().getRoleName().equals(roleName[1])) {
return baseMapper.selectStatusWaitTj(page); currentStatus = FailureStatuEnum.WAITING_SUBMIT.getCode().longValue();
List<FailureDetails> list = baseMapper.selectStatusWaitTj(page.getCurrent(), page.getSize(), currentStatus, startTime, endTime, userId);
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(list);
return iPage;
} }
return baseMapper.selectInProcessing(page); List<FailureDetails> list = baseMapper.selectInProcessing(page.getCurrent(), page.getSize(), currentStatus, startTime, endTime, userId);
IPage<FailureDetails> iPage = new Page<>();
iPage.setRecords(list);
return iPage;
} }
/** /**
* 列表查询 示例
*/
public List<FailureDetailsDto> queryForFailureDetailsList() {
return this.queryForList("", false);
}
/**
* 根据状态查询 * 根据状态查询
*/ */
...@@ -169,18 +166,18 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -169,18 +166,18 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
/** /**
* 查询任务状态数量 * 查询任务状态数量
*/ */
public List<CurrentStatusDto> queryStatusCount(ReginParams userInfo, Integer type) { public List<CurrentStatusDto> queryStatusCount(ReginParams userInfo, Integer type, Long currentStatus, String startTime, String endTime, Integer userId) {
List<StatusDto> statusDtos = null; List<StatusDto> statusDtos = null;
if (type.equals(SELECY_STATUS) &&userInfo.getRole().getRoleName().equals(roleName[0])) { if (type.equals(SELECY_STATUS) && userInfo.getRole().getRoleName().equals(roleName[0])) {
statusDtos = baseMapper.selectStatusWx(); statusDtos = baseMapper.selectStatusWx(currentStatus, startTime, endTime, userId);
} else if (type.equals(SELECY_STATUS) && userInfo.getRole().getRoleName().equals(roleName[1])) { } else if (type.equals(SELECY_STATUS) && userInfo.getRole().getRoleName().equals(roleName[1])) {
statusDtos = baseMapper.selectStatusFq(); statusDtos = baseMapper.selectStatusFq(currentStatus, startTime, endTime, userId);
} else if (type.equals(SELECY_ISUBMIT)) { } else if (type.equals(SELECY_ISUBMIT)) {
statusDtos = baseMapper.selectStatusFqp(Integer.parseInt(userInfo.getUserModel().getUserId())); statusDtos = baseMapper.selectStatusFqp(currentStatus, startTime, endTime, Integer.parseInt(userInfo.getUserModel().getUserId()));
} else if (type.equals(SELECY_ALL)){ } else if (type.equals(SELECY_ALL)) {
statusDtos = baseMapper.selectStatusCount(); statusDtos = baseMapper.selectStatusCount(currentStatus, startTime, endTime, userId);
}else { } else {
statusDtos = baseMapper.selectStatusLeader(); statusDtos = baseMapper.selectStatusLeader(currentStatus, startTime, endTime, userId);
} }
List<CurrentStatusDto> currentStatusDtoList = new ArrayList<>(); List<CurrentStatusDto> currentStatusDtoList = new ArrayList<>();
statusDtos.forEach(e -> { statusDtos.forEach(e -> {
...@@ -515,16 +512,6 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -515,16 +512,6 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
} }
list.add(detail); list.add(detail);
} }
// datArray.stream().forEach(i -> {
// JSONObject detail = JSONObject.parseObject(JSONObject.toJSONString(i));
// if (detail.containsKey("operator") && !detail.getString("name").equals("维修中")) {
// // 从流程记录表中拿到处理人的名称
// FailureRepairlog failureRepairlog = failureRepairlogService
// .findByprocessAuditor(detail.getString("operator"));
// detail.replace("operator", failureRepairlog.getProcessAuditorName());
// list.add(detail);
// }
// });
} }
return list; return list;
} }
...@@ -617,7 +604,5 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa ...@@ -617,7 +604,5 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
} }
} }
return list; return list;
} }
} }
\ No newline at end of file
...@@ -110,7 +110,7 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail ...@@ -110,7 +110,7 @@ public class FailureVerifyServiceImpl extends BaseService<FailureVerifyDto, Fail
Date processTime = model.getVerifyTime(); Date processTime = model.getVerifyTime();
String processDepartment = model.getVerifyDepartment(); String processDepartment = model.getVerifyDepartment();
Integer processAuditorId = Integer.parseInt(userInfo.getUserModel().getUserId()); Integer processAuditorId = Integer.parseInt(userInfo.getUserModel().getUserId());
String processAuditorCid = userInfo.getRole().getRoleName(); String processAuditorCid = userInfo.getUserModel().getRealName();
Long auditDepartmentId = (userInfo.getDepartment().getSequenceNbr()); Long auditDepartmentId = (userInfo.getDepartment().getSequenceNbr());
Boolean repairlog = null; Boolean repairlog = null;
if (condition == AuditResultEnum.AGREE.getCode()) { if (condition == AuditResultEnum.AGREE.getCode()) {
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import com.alibaba.fastjson.JSON;
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.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -74,9 +73,9 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU ...@@ -74,9 +73,9 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
@Override @Override
public Page<LinkageUnitDto> queryForLinkageUnitPage(IPage<LinkageUnitDto> page, public Page<LinkageUnitDto> queryForLinkageUnitPage(IPage<LinkageUnitDto> page,
@Condition(Operator.eq) Boolean isDelete, @Condition(Operator.like) String unitName, @Condition(Operator.eq) Boolean isDelete, @Condition(Operator.like) String unitName,
@Condition(Operator.eq) String linkageUnitTypeCode, @Condition(Operator.eq) String emergencyLinkageUnitCode, @Condition(Operator.eq) String linkageUnitType, @Condition(Operator.eq) String emergencyLinkageUnitCode,
String inAgreement) { String inAgreement) {
Page<List<LinkageUnitDto>> linkageUnitList = linkageUnitMapper.getEmergencyLinkageUnitList(page,unitName, linkageUnitTypeCode, emergencyLinkageUnitCode); Page<List<LinkageUnitDto>> linkageUnitList = linkageUnitMapper.getEmergencyLinkageUnitList(page,unitName, linkageUnitType, emergencyLinkageUnitCode);
List<Map> linkageUnitListMap =JSONArray.parseArray(JSONArray.toJSONString(linkageUnitList.getRecords()), Map.class); List<Map> linkageUnitListMap =JSONArray.parseArray(JSONArray.toJSONString(linkageUnitList.getRecords()), Map.class);
List<Map<String, Object>> pageList = dynamicFormInstanceService.listAll(getGroupCode()); List<Map<String, Object>> pageList = dynamicFormInstanceService.listAll(getGroupCode());
...@@ -104,7 +103,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU ...@@ -104,7 +103,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
Page<LinkageUnitDto> page1 = new Page<LinkageUnitDto>(); Page<LinkageUnitDto> page1 = new Page<LinkageUnitDto>();
page1.setCurrent(page.getCurrent()); page1.setCurrent(page.getCurrent());
page1.setSize(page.getSize()); page1.setSize(page.getSize());
page1.setTotal(detaiList.size()); page1.setTotal(linkageUnitList.getTotal()); // TOTAL 需要统计所有存在的数据BUG2590 by kongfm
page1.setRecords(detaiList); page1.setRecords(detaiList);
return page1; return page1;
} }
......
...@@ -579,6 +579,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -579,6 +579,7 @@ public class MaintenanceCompanyServiceImpl
MaintenanceCompany maintenanceCompany = new MaintenanceCompany(); MaintenanceCompany maintenanceCompany = new MaintenanceCompany();
if (ValidationUtil.isEmpty(seq)) { if (ValidationUtil.isEmpty(seq)) {
maintenanceCompany = getMaintenanceCompany(amosUserId); maintenanceCompany = getMaintenanceCompany(amosUserId);
seq = maintenanceCompany.getSequenceNbr();
} }
// 机场单位列表基本信息 // 机场单位列表基本信息
if (pageNum == -1 || pageSize == -1) { if (pageNum == -1 || pageSize == -1) {
...@@ -586,7 +587,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -586,7 +587,7 @@ public class MaintenanceCompanyServiceImpl
} }
Page page = new Page(pageNum, pageSize); Page page = new Page(pageNum, pageSize);
Page<Map<String, Object>> companys = new Page<>(pageNum, pageSize); Page<Map<String, Object>> companys = new Page<>(pageNum, pageSize);
Page<OrgUsrDto> pageResult = this.baseMapper.selectOrgUsrPageList(page, maintenanceCompany.getSequenceNbr()); Page<OrgUsrDto> pageResult = this.baseMapper.selectOrgUsrPageList(page, seq);
List<Map<String, Object>> finalResultMap = Lists.newArrayList(); List<Map<String, Object>> finalResultMap = Lists.newArrayList();
// 机场组装单位动态表单数据 // 机场组装单位动态表单数据
pageResult.getRecords().forEach(orgUsrDto -> { pageResult.getRecords().forEach(orgUsrDto -> {
......
...@@ -82,9 +82,10 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -82,9 +82,10 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
@Condition(Operator.eq) Long belongFightingSystemId, @Condition(Operator.eq) Long belongFightingSystemId,
@Condition(Operator.eq) Long belongBuildingId, @Condition(Operator.eq) Long belongBuildingId,
@Condition(Operator.like) String belongBuilding, @Condition(Operator.like) String belongBuilding,
@Condition(Operator.eq) String resourceType) { @Condition(Operator.eq) String resourceType,
@Condition(Operator.eq) String equipId) {
return this.queryForList("", false, isDelete, name, sequenceNbr, belongFightingSystemId, belongBuildingId, return this.queryForList("", false, isDelete, name, sequenceNbr, belongFightingSystemId, belongBuildingId,
belongBuilding, resourceType); belongBuilding, resourceType, equipId);
} }
......
...@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto ...@@ -16,6 +16,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferResourceDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferResourceDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferSimpleDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ResourceStatisticsDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer; import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransfer;
...@@ -372,8 +373,8 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -372,8 +373,8 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
} }
IPage<PowerTransferResourceDto> resultPage = null; IPage<PowerTransferResourceDto> resultPage = null;
switch (type) { switch (type) {
case "company": case "team":
resultPage = powerTransferMapper.getPowerTransferTeamResource(page, alertCalledId); resultPage = getPowerTransferTeamResource(page, alertCalledId);
break; break;
case "car": case "car":
resultPage = getPowerTransferCarResource(page, alertCalledId); resultPage = getPowerTransferCarResource(page, alertCalledId);
...@@ -388,7 +389,28 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -388,7 +389,28 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
return resultPage; return resultPage;
} }
private IPage<PowerTransferResourceDto> getPowerTransferCarResource(Page<PowerTransferResourceDto> page, Long alertCalledId) { @Override
public List<ResourceStatisticsDto> getPowerTransferStatistics(Long alertCalledId, String type) {
List<ResourceStatisticsDto> result;
result = powerTransferMapper.getPowerTransferTeamResourceCount(alertCalledId, type);
if (ValidationUtil.isEmpty(result)) {
ResourceStatisticsDto team = new ResourceStatisticsDto("team", 0, 0, 0);
ResourceStatisticsDto car = new ResourceStatisticsDto("car", 0, 0, 0);
ResourceStatisticsDto person = new ResourceStatisticsDto("person", 0, 0, 0);
result.add(team);
result.add(car);
result.add(person);
}
return result;
}
public IPage<PowerTransferResourceDto> getPowerTransferTeamResource(Page<PowerTransferResourceDto> page,
Long alertCalledId) {
return powerTransferMapper.getPowerTransferTeamResource(page, alertCalledId);
}
private IPage<PowerTransferResourceDto> getPowerTransferCarResource(Page<PowerTransferResourceDto> page,
Long alertCalledId) {
ResponseModel<Object> result = equipFeignClient.getFireCarListAll(); ResponseModel<Object> result = equipFeignClient.getFireCarListAll();
Map<String, List<Map<String, Object>>> carInfoMap = Maps.newConcurrentMap(); Map<String, List<Map<String, Object>>> carInfoMap = Maps.newConcurrentMap();
if (!ValidationUtil.isEmpty(result)) { if (!ValidationUtil.isEmpty(result)) {
...@@ -405,7 +427,6 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe ...@@ -405,7 +427,6 @@ public class PowerTransferServiceImpl extends BaseService<PowerTransferDto, Powe
String seq = car.getSequenceNbr().toString(); String seq = car.getSequenceNbr().toString();
car.setName((String) finalCarInfoMap.get(seq).get(0).get("name")); car.setName((String) finalCarInfoMap.get(seq).get(0).get("name"));
String carStateCode = (String) finalCarInfoMap.get(seq).get(0).get("carState"); String carStateCode = (String) finalCarInfoMap.get(seq).get(0).get("carState");
FireCarStatusEnum.getEnum(carStateCode);
car.setCarState(!ValidationUtil.isEmpty(FireCarStatusEnum.getEnum(carStateCode)) ? car.setCarState(!ValidationUtil.isEmpty(FireCarStatusEnum.getEnum(carStateCode)) ?
FireCarStatusEnum.getEnum(carStateCode).getName() : ""); FireCarStatusEnum.getEnum(carStateCode).getName() : "");
List<String> images = (List<String>) finalCarInfoMap.get(seq).get(0).get("image"); List<String> images = (List<String>) finalCarInfoMap.get(seq).get(0).get("image");
......
...@@ -528,19 +528,19 @@ public class CheckController extends AbstractBaseController { ...@@ -528,19 +528,19 @@ public class CheckController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "维保记录排序条件列表", notes = "维保记录排序条件列表") @ApiOperation(httpMethod = "GET", value = "维保记录排序条件列表", notes = "维保记录排序条件列表")
@RequestMapping(value = "/orderBy/list", method = RequestMethod.GET) @RequestMapping(value = "/orderBy/list", method = RequestMethod.GET)
public CommonResponse getOrderByList() { public ResponseModel getOrderByList() {
return CommonResponseUtil.success(CheckRecordOrderByEnum.getEnumList()); return ResponseHelper.buildResponse(CheckRecordOrderByEnum.getEnumList());
} }
@ApiOperation(value = "/设备设施维保记录分页列表",notes = "外部接口装备和者水源使用") @ApiOperation(value = "/设备设施维保记录分页列表",notes = "外部接口装备和者水源使用")
@GetMapping(value = "page/{originalId}/list") @GetMapping(value = "page/{originalId}/list")
public CommonResponse getCheckListByOriginalId( public ResponseModel getCheckListByOriginalId(
@PathVariable String originalId, @PathVariable String originalId,
@RequestParam(value = "current") int pageNum, @RequestParam(value = "current") int pageNum,
@RequestParam(value = "size") int pageSize @RequestParam(value = "size") int pageSize
){ ){
CommonPageable pageable = new CommonPageable(pageNum,pageSize); CommonPageable pageable = new CommonPageable(pageNum,pageSize);
return CommonResponseUtil.success(checkService.getCheckListByOriginalId(originalId,pageable)); return ResponseHelper.buildResponse(checkService.getCheckListByOriginalId(originalId,pageable));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
......
...@@ -9,6 +9,7 @@ import java.util.List; ...@@ -9,6 +9,7 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.yeejoin.amos.maintenance.core.framework.PersonIdentify;
import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.ss.usermodel.WorkbookFactory; import org.apache.poi.ss.usermodel.WorkbookFactory;
...@@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestMethod; ...@@ -27,6 +28,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -79,23 +81,20 @@ public class InputItemController extends AbstractBaseController { ...@@ -79,23 +81,20 @@ public class InputItemController extends AbstractBaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@ApiOperation(value = "新增检查项", notes = "新增检查项") @ApiOperation(value = "新增检查项", notes = "新增检查项")
@RequestMapping(value = "/addItem", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "/addItem", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse addNewItem(@ApiParam(value = "检查项信息") @RequestBody InputItemParam param) { public CommonResponse addNewItem(@ApiParam(value = "检查项信息") @RequestBody InputItemParam param) {
if (ObjectUtils.isEmpty(param.getId())) {
return updateItem(param);
}
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
try { try {
InputItem inputItem = new InputItem();
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams); String loginOrgCode = getOrgCode(reginParams);
InputItem inputItem = new InputItem();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
BeanUtils.copyProperties(param, inputItem); BeanUtils.copyProperties(param, inputItem);
inputItem.setCompanyId(personIdentity.getCompanyId());
inputItem.setCompanyName(personIdentity.getCompanyName());
inputItem.setOrgCode(loginOrgCode); inputItem.setOrgCode(loginOrgCode);
inputItem.setCreateBy(user.getUserId()); inputItem.setCreateBy(RequestContext.getExeUserId());
inputItemService.addNewInputItem(inputItem); inputItemService.addNewInputItem(inputItem);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} catch (Exception e) { } catch (Exception e) {
...@@ -122,19 +121,17 @@ public class InputItemController extends AbstractBaseController { ...@@ -122,19 +121,17 @@ public class InputItemController extends AbstractBaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "更新检查项", notes = "更新检查项") @PersonIdentify
@ApiOperation(value = "更新检查项,没用到", notes = "更新检查项")
@RequestMapping(value = "/updateItem", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT) @RequestMapping(value = "/updateItem", produces = "application/json;charset=UTF-8", method = RequestMethod.PUT)
public CommonResponse updateItem(@ApiParam(value = "检查项详情", required = false) @RequestBody InputItemParam param) { public CommonResponse updateItem(@ApiParam(value = "检查项详情", required = false) @RequestBody InputItemParam param) {
if (ObjectUtils.isEmpty(param.getId())) {
return addNewItem(param);
}
AgencyUserModel user = getUserInfo();
if (ObjectUtils.isEmpty(user)) {
return CommonResponseUtil.failure("用户session过期");
}
try { try {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
InputItem inputItem = new InputItem(); InputItem inputItem = new InputItem();
BeanUtils.copyProperties(param, inputItem); BeanUtils.copyProperties(param, inputItem);
inputItem.setCompanyId(personIdentity.getCompanyId());
inputItem.setCompanyName(personIdentity.getCompanyName());
inputItem.setId(param.getId()); inputItem.setId(param.getId());
inputItemService.updateInputItem(inputItem); inputItemService.updateInputItem(inputItem);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.maintenance.business.controller;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import com.yeejoin.amos.maintenance.core.framework.PersonIdentify;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -12,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -84,16 +86,19 @@ public class PlanController extends AbstractBaseController { ...@@ -84,16 +86,19 @@ public class PlanController extends AbstractBaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@ApiOperation(value = "巡检计划新增及编辑", notes = "巡检计划新增及编辑") @ApiOperation(value = "巡检计划新增及编辑", notes = "巡检计划新增及编辑")
@RequestMapping(value = "/addPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST) @RequestMapping(value = "/addPlan", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse checkPlanAdd(@ApiParam(value = "巡检计划", required = true) @RequestBody Plan param) { public CommonResponse checkPlanAdd(@ApiParam(value = "巡检计划", required = true) @RequestBody Plan param) {
try { try {
String userId = getUserId();
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
String loginOrgCode = getOrgCode(reginParams); String loginOrgCode = getOrgCode(reginParams);
HashMap<String, Object> map = new HashMap<String, Object>(); HashMap<String, Object> map = new HashMap<String, Object>();
param.setCompanyId(personIdentity.getCompanyId());
param.setCompanyName(personIdentity.getCompanyName());
map.put("org_code", loginOrgCode); map.put("org_code", loginOrgCode);
map.put("user_id", userId); map.put("user_id", RequestContext.getExeUserId());
map.put("param", param); map.put("param", param);
planService.addPlan(map); planService.addPlan(map);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
...@@ -150,7 +155,7 @@ public class PlanController extends AbstractBaseController { ...@@ -150,7 +155,7 @@ public class PlanController extends AbstractBaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询巡检计划明细", notes = "查询巡检计划明细") @ApiOperation(value = "查询维保计划明细", notes = "查询维保计划明细")
@RequestMapping(value = "/detail/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/detail/{id}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryPointById(@ApiParam(value = "计划id", required = true) @PathVariable(name = "id") Long id) { public CommonResponse queryPointById(@ApiParam(value = "计划id", required = true) @PathVariable(name = "id") Long id) {
......
...@@ -27,6 +27,8 @@ import org.springframework.web.bind.annotation.*; ...@@ -27,6 +27,8 @@ import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.HashMap; import java.util.HashMap;
...@@ -47,6 +49,7 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -47,6 +49,7 @@ public class PlanTaskController extends AbstractBaseController {
/** /**
* 计划执行查询 * 计划执行查询
*
* @param queryRequests * @param queryRequests
* @param commonPageable * @param commonPageable
* @return * @return
...@@ -196,10 +199,10 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -196,10 +199,10 @@ public class PlanTaskController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保任务查询-mobile", notes = "根据用户条件查询所有计划任务-mobile") @ApiOperation(value = "维保任务查询-mobile", notes = "根据用户条件查询所有计划任务-mobile")
@RequestMapping(value = "/queryPlanTask", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/queryPlanTask", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryLoginUserPlanTask( public ResponseModel<Page<Map<String, Object>>> qryLoginUserPlanTask(
@ApiParam(value = "人员") @RequestParam(value = "userId", required = false) Long userId, @ApiParam(value = "人员") @RequestParam(value = "userId", required = false) Long userId,
@ApiParam(value = "开始日期") @RequestParam(value = "startDate",required = false) String startTime, @ApiParam(value = "开始日期") @RequestParam(value = "startDate", required = false) String startTime,
@ApiParam(value = "结束日期") @RequestParam(value = "endDate",required = false) String endTime, @ApiParam(value = "结束日期") @RequestParam(value = "endDate", required = false) String endTime,
@ApiParam(value = "维保状态") @RequestParam(value = "finishStatus", required = false) Integer finishStatus, @ApiParam(value = "维保状态") @RequestParam(value = "finishStatus", required = false) Integer finishStatus,
@ApiParam(value = "排序条件") @RequestParam(value = "orderBy", defaultValue = "1") String orderBy, @ApiParam(value = "排序条件") @RequestParam(value = "orderBy", defaultValue = "1") String orderBy,
@ApiParam(value = "业主单位") @RequestParam(value = "companyId", required = false) String companyId, @ApiParam(value = "业主单位") @RequestParam(value = "companyId", required = false) String companyId,
...@@ -218,13 +221,13 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -218,13 +221,13 @@ public class PlanTaskController extends AbstractBaseController {
params.put("finishStatus", finishStatus); params.put("finishStatus", finishStatus);
params.put("orderBy", PlanTaskOrderByEnum.getEumByCode(orderBy).getOderBy()); params.put("orderBy", PlanTaskOrderByEnum.getEumByCode(orderBy).getOderBy());
CommonPageable pageable = new CommonPageable(pageNumber, pageSize); CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
return CommonResponseUtil.success(planTaskService.getPlanTasks(params, pageable)); return ResponseHelper.buildResponse(planTaskService.getPlanTasks(params, pageable));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保设施分页列表-mobile", notes = "维保设施分页列表-mobile") @ApiOperation(value = "维保设施分页列表-mobile", notes = "维保设施分页列表-mobile")
@RequestMapping(value = "/point/{planTaskId}/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "/point/{planTaskId}/list", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse qryPlanTaskById( public ResponseModel qryPlanTaskById(
@ApiParam(value = "巡检计划任务ID", required = true) @PathVariable Long planTaskId, @ApiParam(value = "巡检计划任务ID", required = true) @PathVariable Long planTaskId,
@ApiParam(value = "建筑id", required = true) @RequestParam(value = "buildingId", required = false) String buildingId, @ApiParam(value = "建筑id", required = true) @RequestParam(value = "buildingId", required = false) String buildingId,
@ApiParam(value = "维保状态", required = true) @RequestParam(value = "isFinish", required = false) String isFinish, @ApiParam(value = "维保状态", required = true) @RequestParam(value = "isFinish", required = false) String isFinish,
...@@ -239,39 +242,37 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -239,39 +242,37 @@ public class PlanTaskController extends AbstractBaseController {
param.put("systemId", systemId); param.put("systemId", systemId);
param.put("pointNo", pointNo); param.put("pointNo", pointNo);
param.put("pointName", pointName); param.put("pointName", pointName);
return CommonResponseUtil.success(planTaskService.getPlanTaskPoints(param)); return ResponseHelper.buildResponse(planTaskService.getPlanTaskPoints(param));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "查询维保设施,检查内容详情") @ApiOperation(value = "查询维保设施,检查内容详情")
@GetMapping(value = "/task-point-detail") @GetMapping(value = "/task-point-detail")
public CommonResponse planTaskPointDetail( public ResponseModel planTaskPointDetail(
@RequestParam(value = "routePointId") String routePointId, @RequestParam(value = "routePointId") String routePointId,
@RequestParam(value = "id") String planTaskDetailId @RequestParam(value = "id") String planTaskDetailId
) { ) {
return CommonResponseUtil.success(planTaskService.planTaskPointDetail(planTaskDetailId, routePointId)); return ResponseHelper.buildResponse(planTaskService.planTaskPointDetail(planTaskDetailId, routePointId));
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保设施完成状态下拉列表") @ApiOperation(value = "维保设施完成状态下拉列表")
@GetMapping(value = "/taskDetail/finishStatus/list") @GetMapping(value = "/taskDetail/finishStatus/list")
public CommonResponse planTaskPointDetail() { public ResponseModel planTaskPointDetail() {
return CommonResponseUtil.success(PlanTaskDetailIsFinishEnum.getEnumList()); return ResponseHelper.buildResponse(PlanTaskDetailIsFinishEnum.getEnumList());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "计划任务完成状态列表", notes = "计划任务完成状态列表") @ApiOperation(httpMethod = "GET", value = "计划任务完成状态列表", notes = "计划任务完成状态列表")
@RequestMapping(value = "/finishStatus/list", method = RequestMethod.GET) @RequestMapping(value = "/finishStatus/list", method = RequestMethod.GET)
public CommonResponse getPlanTaskFinishStatus() { public ResponseModel getPlanTaskFinishStatus() {
return CommonResponseUtil.success(PlanTaskFinishStatusEnum.getEnumList()); return ResponseHelper.buildResponse(PlanTaskFinishStatusEnum.getEnumList());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "维保任务排序条件", notes = "维保任务排序条件") @ApiOperation(httpMethod = "GET", value = "维保任务排序条件", notes = "维保任务排序条件")
@RequestMapping(value = "/orderBy/list", method = RequestMethod.GET) @RequestMapping(value = "/orderBy/list", method = RequestMethod.GET)
public CommonResponse getOrderByList() { public ResponseModel getOrderByList() {
return CommonResponseUtil.success(PlanTaskOrderByEnum.getEnumList()); return ResponseHelper.buildResponse(PlanTaskOrderByEnum.getEnumList());
} }
} }
\ No newline at end of file
...@@ -15,6 +15,7 @@ import com.yeejoin.amos.maintenance.business.vo.PointInputItemVo; ...@@ -15,6 +15,7 @@ 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.framework.PersonIdentify;
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 io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -27,6 +28,7 @@ import org.springframework.data.domain.Page; ...@@ -27,6 +28,7 @@ import org.springframework.data.domain.Page;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -53,14 +55,17 @@ public class PointController extends AbstractBaseController { ...@@ -53,14 +55,17 @@ public class PointController extends AbstractBaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@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) {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams); String loginOrgCode = getOrgCode(reginParams);
//点归属于公司 ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
pointParam.getPoint().setCompanyId(personIdentity.getCompanyId());
pointParam.getPoint().setCompanyName(personIdentity.getCompanyName());
pointParam.getPoint().setOrgCode(loginOrgCode); pointParam.getPoint().setOrgCode(loginOrgCode);
pointParam.getPoint().setCreatorId(getUserId()); pointParam.getPoint().setCreatorId(RequestContext.getExeUserId());
Point point = iPointService.addPoint(pointParam); Point point = iPointService.addPoint(pointParam);
return CommonResponseUtil.success(point); return CommonResponseUtil.success(point);
...@@ -92,14 +97,19 @@ public class PointController extends AbstractBaseController { ...@@ -92,14 +97,19 @@ public class PointController extends AbstractBaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@ApiOperation(value = "更新巡检点", notes = "更新巡检点") @ApiOperation(value = "更新巡检点", notes = "更新巡检点")
@PutMapping(value = "/updatePoint", produces = "application/json;charset=UTF-8") @PutMapping(value = "/updatePoint", produces = "application/json;charset=UTF-8")
public CommonResponse updatePoint(@ApiParam(value = "巡检点", required = true) @RequestBody PointParam pointParam) { public CommonResponse updatePoint(@ApiParam(value = "巡检点", required = true) @RequestBody PointParam pointParam) {
try { try {
ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
pointParam.getPoint().setCompanyId(personIdentity.getCompanyId());
pointParam.getPoint().setCompanyName(personIdentity.getCompanyName());
pointParam.getPoint().setCreatorId(RequestContext.getExeUserId());
iPointService.updatePoint(pointParam); iPointService.updatePoint(pointParam);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return CommonResponseUtil.failure("更新巡检点失败"); return CommonResponseUtil.failure("更新巡检点失败");
} }
......
...@@ -7,8 +7,10 @@ import java.util.List; ...@@ -7,8 +7,10 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.yeejoin.amos.maintenance.core.framework.PersonIdentify;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -20,6 +22,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
...@@ -58,18 +61,22 @@ public class RouteController extends AbstractBaseController { ...@@ -58,18 +61,22 @@ public class RouteController extends AbstractBaseController {
* @return CommonResponse * @return CommonResponse
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@ApiOperation(value = "新增巡检路线", notes = "新增巡检路线") @ApiOperation(value = "新增巡检路线", notes = "新增巡检路线")
@PostMapping(value = "/addRoute", produces = "application/json;charset=UTF-8") @PostMapping(value = "/addRoute", produces = "application/json;charset=UTF-8")
public CommonResponse addRoute(@ApiParam(value = "巡检路线", required = true) @RequestBody Route route) { public CommonResponse addRoute(@ApiParam(value = "巡检路线", required = true) @RequestBody Route route) {
try { try {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
String loginOrgCode = getOrgCode(reginParams); String loginOrgCode = getOrgCode(reginParams);
route.setOrgCode(loginOrgCode); route.setOrgCode(loginOrgCode);
route.setIsDelete(false); route.setIsDelete(false);
if (routeService.existRouteName(loginOrgCode, route.getName())) { if (routeService.existRouteName(loginOrgCode, route.getName())) {
return CommonResponseUtil.failure("巡检路线名称重复"); return CommonResponseUtil.failure("巡检路线名称重复");
} }
route.setCreatorId(getUserId()); route.setCompanyId(personIdentity.getCompanyId());
route.setCompanyName(personIdentity.getCompanyName());
route.setCreatorId(RequestContext.getExeUserId());
routeService.addRoute(route); routeService.addRoute(route);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} catch (Exception e) { } catch (Exception e) {
...@@ -85,14 +92,18 @@ public class RouteController extends AbstractBaseController { ...@@ -85,14 +92,18 @@ public class RouteController extends AbstractBaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@ApiOperation(value = "更新巡检路线", notes = "更新巡检路线") @ApiOperation(value = "更新巡检路线", notes = "更新巡检路线")
@PutMapping(value = "/updateRoute", produces = "application/json;charset=UTF-8") @PutMapping(value = "/updateRoute", produces = "application/json;charset=UTF-8")
public CommonResponse updateRoute(@ApiParam(value = "巡检路线", required = true) @RequestBody Route route) { public CommonResponse updateRoute(@ApiParam(value = "巡检路线", required = true) @RequestBody Route route) {
try { try {
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
ReginParams.PersonIdentity personIdentity = reginParams.getPersonIdentity();
String orgCode = getOrgCode(reginParams); String orgCode = getOrgCode(reginParams);
route.setCompanyId(personIdentity.getCompanyId());
route.setCompanyName(personIdentity.getCompanyName());
route.setOrgCode(orgCode); route.setOrgCode(orgCode);
route.setCreatorId(getUserId()); route.setCreatorId(RequestContext.getExeUserId());
routeService.updateRoute(route); routeService.updateRoute(route);
return CommonResponseUtil.success(); return CommonResponseUtil.success();
} catch (Exception e) { } catch (Exception e) {
......
...@@ -16,6 +16,7 @@ import com.yeejoin.amos.maintenance.business.service.intfc.IPlanTaskService; ...@@ -16,6 +16,7 @@ import com.yeejoin.amos.maintenance.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.maintenance.business.util.PlanTaskUtil; import com.yeejoin.amos.maintenance.business.util.PlanTaskUtil;
import com.yeejoin.amos.maintenance.business.vo.CalDateVo; import com.yeejoin.amos.maintenance.business.vo.CalDateVo;
import com.yeejoin.amos.maintenance.business.vo.PlanTaskVo; import com.yeejoin.amos.maintenance.business.vo.PlanTaskVo;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskDetailIsFinishEnum;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum; import com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable; import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.util.DateUtil; import com.yeejoin.amos.maintenance.core.util.DateUtil;
...@@ -512,8 +513,15 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -512,8 +513,15 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
} }
@Override @Override
public List getPlanTaskPoints(Map<String, Object> param) { public List<Map<String,Object>> getPlanTaskPoints(Map<String, Object> param) {
return planTaskMapper.getPlanTaskPoints(param); List<Map<String,Object>> result = planTaskMapper.getPlanTaskPoints(param);
result.forEach(r->{
if(r.containsKey("isFinish")){
String isFinishDesc = PlanTaskDetailIsFinishEnum.getName(Integer.parseInt(r.get("isFinish").toString()));
r.put("isFinishDesc",isFinishDesc);
}
});
return result;
} }
@Override @Override
......
...@@ -76,7 +76,7 @@ public class RouteServiceImpl implements IRouteService { ...@@ -76,7 +76,7 @@ public class RouteServiceImpl implements IRouteService {
@Override @Override
@Transactional @Transactional
public Route addRoute(Route route) { public Route addRoute(Route route) {
String creatorId = route.getCreatorId(); String creatorId = route.getCreatorId();
String orgCode = route.getOrgCode(); String orgCode = route.getOrgCode();
route = iRouteDao.saveAndFlush(route); route = iRouteDao.saveAndFlush(route);
......
...@@ -75,7 +75,7 @@ public interface IPlanTaskService { ...@@ -75,7 +75,7 @@ public interface IPlanTaskService {
* @param param * @param param
* @return * @return
*/ */
List getPlanTaskPoints(Map<String, Object> param); List<Map<String,Object>> getPlanTaskPoints(Map<String, Object> param);
/** /**
* 今日执行情况 * 今日执行情况
......
...@@ -12,10 +12,6 @@ ...@@ -12,10 +12,6 @@
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-maintenance-biz</artifactId> <artifactId>amos-boot-module-maintenance-biz</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<artifactId>mysql-connector-java</artifactId>
<groupId>mysql</groupId>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -58,4 +58,114 @@ ...@@ -58,4 +58,114 @@
ALTER TABLE p_check_shot add COLUMN `photo_conf_key` varchar(32) DEFAULT NULL COMMENT '照片配置key(关联照片和拍照设置)'; ALTER TABLE p_check_shot add COLUMN `photo_conf_key` varchar(32) DEFAULT NULL COMMENT '照片配置key(关联照片和拍照设置)';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="suhuiguang" id="1629788256095-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_input_item" columnName="company_id"/>
</not>
</preConditions>
<comment>p_input_item add COLUMN company_id 维保公司id</comment>
<sql>
ALTER TABLE p_input_item add COLUMN `company_id` varchar(32) DEFAULT NULL COMMENT '维保公司id';
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1629788256095-3">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_input_item" columnName="company_name"/>
</not>
</preConditions>
<comment>p_input_item add COLUMN company_name '维保公司名称'</comment>
<sql>
ALTER TABLE p_input_item add COLUMN `company_name` varchar(255) DEFAULT NULL COMMENT '维保公司名称';
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1629788256095-4">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point" columnName="company_id"/>
</not>
</preConditions>
<comment>p_point add COLUMN company_id 维保公司id</comment>
<sql>
ALTER TABLE p_point add COLUMN `company_id` varchar(32) DEFAULT NULL COMMENT '维保公司id';
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1629788256095-5">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_point" columnName="company_name"/>
</not>
</preConditions>
<comment>p_point add COLUMN company_name '维保公司名称'</comment>
<sql>
ALTER TABLE p_point add COLUMN `company_name` varchar(255) DEFAULT NULL COMMENT '维保公司名称';
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1629788256095-6">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_route" columnName="company_id"/>
</not>
</preConditions>
<comment>p_route add COLUMN company_id 维保公司id</comment>
<sql>
ALTER TABLE p_route add COLUMN `company_id` varchar(32) DEFAULT NULL COMMENT '维保公司id';
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1629788256095-7">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_route" columnName="company_name"/>
</not>
</preConditions>
<comment>p_route add COLUMN company_name '维保公司名称'</comment>
<sql>
ALTER TABLE p_route add COLUMN `company_name` varchar(255) DEFAULT NULL COMMENT '维保公司名称';
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1629788256095-8">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_plan" columnName="company_id"/>
</not>
</preConditions>
<comment>p_plan add COLUMN company_id 维保公司id</comment>
<sql>
ALTER TABLE p_plan add COLUMN `company_id` varchar(32) DEFAULT NULL COMMENT '维保公司id';
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1629788256095-9">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_plan" columnName="company_name"/>
</not>
</preConditions>
<comment>p_plan add COLUMN company_name '维保公司名称'</comment>
<sql>
ALTER TABLE p_plan add COLUMN `company_name` varchar(255) DEFAULT NULL COMMENT '维保公司名称';
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1629788256095-10">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_check" columnName="company_id"/>
</not>
</preConditions>
<comment>p_check add COLUMN company_id 维保公司id</comment>
<sql>
ALTER TABLE p_check add COLUMN `company_id` varchar(32) DEFAULT NULL COMMENT '维保公司id';
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1629788256095-11">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_check" columnName="company_name"/>
</not>
</preConditions>
<comment>p_check add COLUMN company_name '维保公司名称'</comment>
<sql>
ALTER TABLE p_check add COLUMN `company_name` varchar(255) DEFAULT NULL COMMENT '维保公司名称';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
<if test="testRequirement != null ">test_requirement=#{testRequirement},</if> <if test="testRequirement != null ">test_requirement=#{testRequirement},</if>
<if test="inputClassify != null ">input_classify=#{inputClassify},</if> <if test="inputClassify != null ">input_classify=#{inputClassify},</if>
<if test="unit != null ">unit=#{unit},</if> <if test="unit != null ">unit=#{unit},</if>
<if test="companyId != null ">company_id=#{companyId},</if>
<if test="companyName != null ">company_name=#{companyName}</if>
</trim> </trim>
WHERE id=#{id} WHERE id=#{id}
</update> </update>
......
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