Commit 62398097 authored by KeYong's avatar KeYong

更新接口

parent 7dc1ea9c
...@@ -18,8 +18,8 @@ public enum OrderByEnum { ...@@ -18,8 +18,8 @@ public enum OrderByEnum {
PLAN_TASK_NUM_DESC("计划维保设施数倒序", "4", "taskPlanNum desc"), PLAN_TASK_NUM_DESC("计划维保设施数倒序", "4", "taskPlanNum desc"),
FINISH_NUM_DESC("完成数倒序", "5", "finishNum desc"), FINISH_NUM_DESC("完成数倒序", "5", "finishNum desc"),
FINISH_NUM_ASC("完成数正序", "6", "finishNum asc"), FINISH_NUM_ASC("完成数正序", "6", "finishNum asc"),
DATE_DESC("维保记录时间倒序", "1", "checkDate desc"), DATE_DESC("维保记录时间倒序", "7", "checkDate desc"),
DATE_ASC("维保记录时间正序", "2", "checkDate asc"); DATE_ASC("维保记录时间正序", "8", "checkDate asc");
/** /**
* 名字 * 名字
......
...@@ -16,6 +16,7 @@ import com.yeejoin.amos.maintenance.core.common.request.CommonPageable; ...@@ -16,6 +16,7 @@ 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.AppPointCheckRespone; import com.yeejoin.amos.maintenance.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.maintenance.core.common.response.GraphInitDataResponse; import com.yeejoin.amos.maintenance.core.common.response.GraphInitDataResponse;
import com.yeejoin.amos.maintenance.core.framework.PersonIdentify;
import com.yeejoin.amos.maintenance.core.util.StringUtil; import com.yeejoin.amos.maintenance.core.util.StringUtil;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -483,6 +484,7 @@ public class CheckController extends AbstractBaseController { ...@@ -483,6 +484,7 @@ public class CheckController extends AbstractBaseController {
return CommonResponseUtil.success(checkService.obtainLastCheckRecord(relationId)); return CommonResponseUtil.success(checkService.obtainLastCheckRecord(relationId));
} }
@PersonIdentify(isNeedIdentity = true)
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保记录分页查询", notes = "维保记录分页查询") @ApiOperation(value = "维保记录分页查询", notes = "维保记录分页查询")
@GetMapping(value = "/page") @GetMapping(value = "/page")
...@@ -494,7 +496,7 @@ public class CheckController extends AbstractBaseController { ...@@ -494,7 +496,7 @@ public class CheckController extends AbstractBaseController {
@ApiParam(value = "开始时间") @RequestParam(value = "beginTime", required = false) String beginTime, @ApiParam(value = "开始时间") @RequestParam(value = "beginTime", required = false) String beginTime,
@ApiParam(value = "结束时间") @RequestParam(value = "endTime", required = false) String endTime, @ApiParam(value = "结束时间") @RequestParam(value = "endTime", required = false) String endTime,
@ApiParam(value = "维保人员") @RequestParam(value = "personId", required = false) String person, @ApiParam(value = "维保人员") @RequestParam(value = "personId", required = false) String person,
@ApiParam(value = "业主单位") @RequestParam(value = "teamId", required = false) String team, @ApiParam(value = "业主单位") @RequestParam(value = "teamId", required = false) String teamId,
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber, @ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception{ @ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception{
HashMap<String, Object> params = new HashMap<>(); HashMap<String, Object> params = new HashMap<>();
...@@ -509,7 +511,7 @@ public class CheckController extends AbstractBaseController { ...@@ -509,7 +511,7 @@ public class CheckController extends AbstractBaseController {
params.put("beginTime", beginTime); params.put("beginTime", beginTime);
params.put("endTime", endTime); params.put("endTime", endTime);
params.put("person", person); params.put("person", person);
params.put("team", team); params.put("teamId", teamId);
params.put("orgCode", loginOrgCode); params.put("orgCode", loginOrgCode);
CommonPageable pageable = new CommonPageable(pageNumber, pageSize); CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
return CommonResponseUtil.success(checkService.getCheckPage(params, pageable)); return CommonResponseUtil.success(checkService.getCheckPage(params, pageable));
......
...@@ -1036,16 +1036,13 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1036,16 +1036,13 @@ public class CheckServiceImpl implements ICheckService {
if (total == 0) { if (total == 0) {
return new PageImpl<>(content, page, total); return new PageImpl<>(content, page, total);
} }
params.put("offset", page.getOffset());
params.put("pageSize", page.getPageSize());
content = checkMapper.getChecks(params); content = checkMapper.getChecks(params);
if (0 < content.size()) { if (0 < content.size()) {
for(HashMap<String, Object> map : content) { for(HashMap<String, Object> map : content) {
if (map.containsKey("isOk")) { if (map.containsKey("isOk")) {
map.put("status", CheckStatusEnum.getEnum(String.valueOf(map.get("isOk")))); map.put("status", CheckStatusEnum.getEnum(String.valueOf(map.get("isOk"))).getName());
}
if (map.containsKey("address")) {
map.put("address", content.stream().filter(x -> map.get("checkId").equals(x.get("checkId")) &&
x.containsKey("buildingName")
).findFirst().get().get("buildingName") + String.valueOf(map.get("address")));
} }
} }
} }
......
...@@ -1896,17 +1896,21 @@ ...@@ -1896,17 +1896,21 @@
pc.id checkId, pc.id checkId,
pc.user_id userId, pc.user_id userId,
pc.is_ok isOk, pc.is_ok isOk,
pc.check_time checkDate, pr.owner_id ownerId,
pc.check_time maintenanceDate, date_format(
pc.check_time ,
'%Y-%m-%d %H:%i:%s'
) checkDate,
pp.id pointId, pp.id pointId,
pp.equipment_id equipmentId, pp.equipment_id equipmentId,
pp.equipment_name equipmentName, pp.equipment_name equipmentName,
pp.belong_system_id systemId, pp.belong_system_id systemId,
pp.belong_system_name systemName, pp.belong_system_name systemName,
pp.address address, pp.address address,
pp.building_name buildingName CONCAT(pp.address, pp.building_name) buildingName
FROM p_check pc FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id LEFT JOIN p_point pp ON pp.id = pc.point_id
LEFT JOIN p_route pr on pr.id = pc.route_id
) a ) a
<include refid="mobile-check-record-where" /> <include refid="mobile-check-record-where" />
limit #{offset},#{pageSize} limit #{offset},#{pageSize}
...@@ -1957,10 +1961,10 @@ ...@@ -1957,10 +1961,10 @@
<choose> <choose>
<when test="identityType==1"> <when test="identityType==1">
And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} ) And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} )
<if test="companyId != null"> and a.owner_id = #{teamId}</if> <if test="companyId != null"> and a.ownerId = #{teamId}</if>
</when> </when>
<when test="identityType==2"> <when test="identityType==2">
And a.owner_id = #{teamId} And a.ownerId = #{teamId}
</when> </when>
</choose> </choose>
</where> </where>
...@@ -1990,17 +1994,20 @@ ...@@ -1990,17 +1994,20 @@
FROM ( FROM (
SELECT SELECT
pc.id checkId, pc.id checkId,
pc.user_id userId,
pc.is_ok isOk, pc.is_ok isOk,
pc.create_date maintenanceDate, pr.owner_id ownerId,
pc.check_time checkDate,
pp.id pointId, pp.id pointId,
pp.equipment_id equipmentId, pp.equipment_id equipmentId,
pp.equipment_name equipmentName, pp.equipment_name equipmentName,
pp.belong_system_id systemId, pp.belong_system_id systemId,
pp.belong_system_name systemName, pp.belong_system_name systemName,
pp.address address, pp.address address,
pp.building_name buildingName CONCAT(pp.address, pp.building_name) buildingName
FROM p_check pc FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id LEFT JOIN p_point pp ON pp.id = pc.point_id
LEFT JOIN p_route pr on pr.id = pc.route_id
) a ) a
<include refid="mobile-check-record-where" /> <include refid="mobile-check-record-where" />
</select> </select>
......
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