Commit 62398097 authored by KeYong's avatar KeYong

更新接口

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