Commit 594d208c authored by zhangsen's avatar zhangsen

xuqiu

parent c466eefa
...@@ -55,11 +55,13 @@ public interface PersonBasicMapper extends BaseMapper<PersonBasic> { ...@@ -55,11 +55,13 @@ public interface PersonBasicMapper extends BaseMapper<PersonBasic> {
@Param("size") Integer size, @Param("size") Integer size,
@Param("parentCode") String parentCode, @Param("parentCode") String parentCode,
@Param("date") String date, @Param("date") String date,
@Param("qrCodeColor") String qrCodeColor); @Param("qrCodeColor") String qrCodeColor,
@Param("ne") String ne);
Integer getPersonYardByPageCount(@Param("parentCode") String parentCode, Integer getPersonYardByPageCount(@Param("parentCode") String parentCode,
@Param("date") String date, @Param("date") String date,
@Param("qrCodeColor") String qrCodeColor); @Param("qrCodeColor") String qrCodeColor,
@Param("ne") String ne);
List<StationQrCodeStatistics> getPersonStatistics(); List<StationQrCodeStatistics> getPersonStatistics();
} }
...@@ -226,7 +226,10 @@ ...@@ -226,7 +226,10 @@
AND a.rec_date like concat(#{date},'%') AND a.rec_date like concat(#{date},'%')
</if> </if>
<if test="qrCodeColor != null and qrCodeColor != ''"> <if test="qrCodeColor != null and qrCodeColor != ''">
AND a.qrcode_color like concat(#{qrCodeColor},'%') AND a.qrcode_color = #{qrCodeColor}
</if>
<if test="ne != null and ne != ''">
AND a.qrcode_color != #{ne}
</if> </if>
</where> </where>
ORDER BY a.rec_date DESC ORDER BY a.rec_date DESC
...@@ -248,7 +251,10 @@ ...@@ -248,7 +251,10 @@
AND a.rec_date like concat(#{date},'%') AND a.rec_date like concat(#{date},'%')
</if> </if>
<if test="qrCodeColor != null and qrCodeColor != ''"> <if test="qrCodeColor != null and qrCodeColor != ''">
AND a.qrcode_color like concat(#{qrCodeColor},'%') AND a.qrcode_color = #{qrCodeColor}
</if>
<if test="ne != null and ne != ''">
AND a.qrcode_color != #{ne}
</if> </if>
</where> </where>
</select> </select>
......
...@@ -107,10 +107,10 @@ public class PersonQrCodeController extends BaseController { ...@@ -107,10 +107,10 @@ public class PersonQrCodeController extends BaseController {
Page<Map<String, Object>> resultList = new Page<>(); Page<Map<String, Object>> resultList = new Page<>();
if ("person".equals(dataType)) { if ("person".equals(dataType)) {
resultList = personBasicServiceImpl.getPersonYardByPage(parentCode, current, size, date, qrCodeColor); resultList = personBasicServiceImpl.getPersonYardByPage(parentCode, current, size, date, qrCodeColor, null, null);
} else if ("equip".equals(dataType)) { } else if ("equip".equals(dataType)) {
List<Map<String, Object>> equipYardByPage = sjglZsjZsbtzMapper.getEquipYardByPage((current - 1) * size, size, parentCode, date, qrCodeColor); List<Map<String, Object>> equipYardByPage = sjglZsjZsbtzMapper.getEquipYardByPage((current - 1) * size, size, parentCode, date, qrCodeColor, null);
Integer equipYardByPageCount = sjglZsjZsbtzMapper.getEquipYardByPageCount(parentCode, date, qrCodeColor); Integer equipYardByPageCount = sjglZsjZsbtzMapper.getEquipYardByPageCount(parentCode, date, qrCodeColor, null);
equipYardByPage.forEach(item -> { equipYardByPage.forEach(item -> {
String name = QrcodeColorEnum.getName(String.valueOf(item.get("qrCodeColor"))); String name = QrcodeColorEnum.getName(String.valueOf(item.get("qrCodeColor")));
item.put("name", name); item.put("name", name);
...@@ -120,8 +120,8 @@ public class PersonQrCodeController extends BaseController { ...@@ -120,8 +120,8 @@ public class PersonQrCodeController extends BaseController {
resultList.setSize(size); resultList.setSize(size);
resultList.setTotal(equipYardByPageCount); resultList.setTotal(equipYardByPageCount);
} else if ("job".equals(dataType)) { } else if ("job".equals(dataType)) {
List<Map<String, Object>> jobYardByPage = sjglZsjZsbtzMapper.getJobYardByPage((current - 1) * size, size, parentCode, date, qrCodeColor); List<Map<String, Object>> jobYardByPage = sjglZsjZsbtzMapper.getJobYardByPage((current - 1) * size, size, parentCode, date, qrCodeColor, null);
Integer jobYardByPageCount = sjglZsjZsbtzMapper.getJobYardByPageCount(parentCode, date, qrCodeColor); Integer jobYardByPageCount = sjglZsjZsbtzMapper.getJobYardByPageCount(parentCode, date, qrCodeColor, null);
jobYardByPage.forEach(item -> { jobYardByPage.forEach(item -> {
String name = QrcodeColorEnum.getName(String.valueOf(item.get("qrCodeColor"))); String name = QrcodeColorEnum.getName(String.valueOf(item.get("qrCodeColor")));
item.put("name", name); item.put("name", name);
...@@ -159,11 +159,11 @@ public class PersonQrCodeController extends BaseController { ...@@ -159,11 +159,11 @@ public class PersonQrCodeController extends BaseController {
String yellowToGreen = result.get("yellowToGreen").toString(); String yellowToGreen = result.get("yellowToGreen").toString();
Integer countAll = 0; Integer countAll = 0;
if ("RYFM".equals(dataType) || "person".equals(dataType)) { if ("RYFM".equals(dataType) || "person".equals(dataType)) {
countAll = personBasicMapper.getPersonYardByPageCount(parentCode, null, null); countAll = personBasicMapper.getPersonYardByPageCount(parentCode, null, null, null);
} else if ("equip".equals(dataType)) { } else if ("equip".equals(dataType)) {
countAll = sjglZsjZsbtzMapper.getEquipYardByPageCount(parentCode, null, null); countAll = sjglZsjZsbtzMapper.getEquipYardByPageCount(parentCode, null, null, null);
} else if ("job".equals(dataType)) { } else if ("job".equals(dataType)) {
countAll = sjglZsjZsbtzMapper.getJobYardByPageCount(parentCode, null, null); countAll = sjglZsjZsbtzMapper.getJobYardByPageCount(parentCode, null, null, null);
} }
result.put("redToGreenPercent", getPercent(new BigDecimal(red), new BigDecimal(countAll))); result.put("redToGreenPercent", getPercent(new BigDecimal(red), new BigDecimal(countAll)));
result.put("redPercent", getPercent(new BigDecimal(redToGreen), new BigDecimal(countAll))); result.put("redPercent", getPercent(new BigDecimal(redToGreen), new BigDecimal(countAll)));
...@@ -263,48 +263,54 @@ public class PersonQrCodeController extends BaseController { ...@@ -263,48 +263,54 @@ public class PersonQrCodeController extends BaseController {
return ResponseHelper.buildResponse(map); return ResponseHelper.buildResponse(map);
} }
//
// @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
// @GetMapping(value = "/getStationDetailInfo") @GetMapping(value = "/getStationEquipInfo")
// @ApiOperation(httpMethod = "GET", value = "评估大屏 - 场站信息查询", notes = "评估大屏 - 场站信息查询") @ApiOperation(httpMethod = "GET", value = "评估大屏 - 场站二级弹窗API", notes = "评估大屏 - 场站二级弹窗API")
// public ResponseModel<Map<String, Object>> getStationEquipInfo(@RequestParam(required = true, value = "parentCode") String parentCode, public ResponseModel<Page<Map<String, Object>>> getStationEquipInfo(@RequestParam(value = "parentCode") String parentCode,
// @RequestParam(required = false, value = "column") String column) { @RequestParam(required = false, value = "column") String column,
// FeignClientResult<Map<String, Object>> sevenEntity = null; @RequestParam(required = false, value = "score") BigDecimal score,
// try { @RequestParam(value = "current") Integer current,
// sevenEntity = idxFeign.healthIndexData(parentCode, null); @RequestParam(value = "size") Integer size,
// } catch (Exception e) { @RequestParam(required = false, value = "date") String date) {
// e.printStackTrace(); Page<Map<String, Object>> resultList = new Page<>();
// } if ("V1".equals(column)) {
// FeignClientResult<Integer> sevenEntityMcb = null; resultList = personBasicServiceImpl.getPersonYardByPage(parentCode, current, size, date, null, "green", score);
// try { } else if ("S1".equals(column)) {
// sevenEntityMcb = mcbWarningFeign.getWarningInfoCountByObjectId(parentCode); List<Map<String, Object>> equipYardByPage = sjglZsjZsbtzMapper.getEquipYardByPage((current - 1) * size, size, parentCode, date, null, "green");
// } catch (Exception e) { Integer equipYardByPageCount = sjglZsjZsbtzMapper.getEquipYardByPageCount(parentCode, date, null, "green");
// e.printStackTrace(); equipYardByPage.forEach(item -> {
// } String name = QrcodeColorEnum.getName(String.valueOf(item.get("qrCodeColor")));
// String score = "100"; item.put("name", name);
// String gradeColor = "green"; item.put("faultInfo", "该存在缺陷或者告警");
// Integer warningCount = 0; item.put("faultLevel", "严重");
// if (sevenEntity != null && 200 == sevenEntity.getStatus()) { if (!Objects.isNull(score)) {
// Map<String, Object> result = sevenEntity.getResult(); item.put("mark", new BigDecimal(100).subtract(score));
// score = result.get("score").toString(); }
// gradeColor = result.get("gradeColor").toString(); });
// } resultList.setRecords(equipYardByPage);
// if (sevenEntityMcb != null && 200 == sevenEntityMcb.getStatus()) { resultList.setCurrent(current);
// warningCount = sevenEntityMcb.getResult(); resultList.setSize(size);
// } resultList.setTotal(equipYardByPageCount);
// HashMap<String, Object> map = new HashMap<>(); } else if ("P1".equals(column)) {
// map.put("score", score); List<Map<String, Object>> jobYardByPage = sjglZsjZsbtzMapper.getJobYardByPage((current - 1) * size, size, parentCode, date, null, "green");
// map.put("gradeColor", gradeColor); Integer jobYardByPageCount = sjglZsjZsbtzMapper.getJobYardByPageCount(parentCode, date, null, "green");
// map.put("warningCount", warningCount); jobYardByPage.forEach(item -> {
// LambdaQueryWrapper<StationBasic> stationBasicLambdaQueryWrapper = new LambdaQueryWrapper<>(); String name = QrcodeColorEnum.getName(String.valueOf(item.get("qrCodeColor")));
// stationBasicLambdaQueryWrapper.eq(StationBasic::getProjectOrgCode, parentCode); item.put("name", name);
// stationBasicLambdaQueryWrapper.last("limit 1"); item.put("faultInfo", "该任务超时");
// StationBasic stationBasic = stationBasicMapper.selectOne(stationBasicLambdaQueryWrapper); item.put("faultLevel", "严重");
// map.put("stationMasterName", stationBasic.getStationMasterName()); if (!Objects.isNull(score)) {
// map.put("mobilePhone", stationBasic.getMobilePhone()); item.put("mark", new BigDecimal(100).subtract(score));
// map.put("recDate", stationBasic.getRecDate()); }
// return ResponseHelper.buildResponse(map); });
// } resultList.setRecords(jobYardByPage);
resultList.setCurrent(current);
resultList.setSize(size);
resultList.setTotal(jobYardByPageCount);
}
return ResponseHelper.buildResponse(resultList);
}
} }
...@@ -56,14 +56,16 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> { ...@@ -56,14 +56,16 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
@Param("size") Integer size, @Param("size") Integer size,
@Param("parentCode") String parentCode, @Param("parentCode") String parentCode,
@Param("date") String date, @Param("date") String date,
@Param("qrCodeColor") String qrCodeColor); @Param("qrCodeColor") String qrCodeColor,
@Param("ne") String ne);
/** /**
* 设备赋码列表 * 设备赋码列表
*/ */
Integer getEquipYardByPageCount(@Param("parentCode") String parentCode, Integer getEquipYardByPageCount(@Param("parentCode") String parentCode,
@Param("date") String date, @Param("date") String date,
@Param("qrCodeColor") String qrCodeColor); @Param("qrCodeColor") String qrCodeColor,
@Param("ne") String ne);
...@@ -75,12 +77,14 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> { ...@@ -75,12 +77,14 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
@Param("size") Integer size, @Param("size") Integer size,
@Param("parentCode") String parentCode, @Param("parentCode") String parentCode,
@Param("date") String date, @Param("date") String date,
@Param("qrCodeColor") String qrCodeColor); @Param("qrCodeColor") String qrCodeColor,
@Param("ne") String ne);
/** /**
* 任务赋码列表数量统计 * 任务赋码列表数量统计
*/ */
Integer getJobYardByPageCount(@Param("parentCode") String parentCode, Integer getJobYardByPageCount(@Param("parentCode") String parentCode,
@Param("date") String date, @Param("date") String date,
@Param("qrCodeColor") String qrCodeColor); @Param("qrCodeColor") String qrCodeColor,
@Param("ne") String ne);
} }
...@@ -22,9 +22,11 @@ import org.springframework.stereotype.Service; ...@@ -22,9 +22,11 @@ import org.springframework.stereotype.Service;
import org.typroject.tyboot.component.emq.EmqKeeper; import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.math.BigDecimal;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
...@@ -115,13 +117,20 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -115,13 +117,20 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
Integer current, Integer current,
Integer size, Integer size,
String date, String date,
String qrCodeColor) { String qrCodeColor,
List<Map<String, Object>> resultList = personBasicMapper.getPersonYardByPage((current - 1) * size, size , parentCode, date, qrCodeColor); String ne,
Integer count = personBasicMapper.getPersonYardByPageCount(parentCode, date, qrCodeColor); BigDecimal score) {
List<Map<String, Object>> resultList = personBasicMapper.getPersonYardByPage((current - 1) * size, size , parentCode, date, qrCodeColor, ne);
Integer count = personBasicMapper.getPersonYardByPageCount(parentCode, date, qrCodeColor, ne);
resultList.forEach(item -> { resultList.forEach(item -> {
String name = QrcodeColorEnum.getName(String.valueOf(item.get("qrCodeColor"))); String name = QrcodeColorEnum.getName(String.valueOf(item.get("qrCodeColor")));
item.put("name", name); item.put("name", name);
item.put("faultInfo", "证书不全或临期");
item.put("faultLevel", "严重");
if (!Objects.isNull(score)) {
item.put("mark", new BigDecimal(100).subtract(score));
}
}); });
Page<Map<String, Object>> mapPage = new Page<>(); Page<Map<String, Object>> mapPage = new Page<>();
mapPage.setRecords(resultList); mapPage.setRecords(resultList);
......
...@@ -114,7 +114,10 @@ ...@@ -114,7 +114,10 @@
AND a.UPDATE_TIME like concat(#{date},'%') AND a.UPDATE_TIME like concat(#{date},'%')
</if> </if>
<if test="qrCodeColor != null and qrCodeColor != ''"> <if test="qrCodeColor != null and qrCodeColor != ''">
AND a.QRCODE_COLOR like concat(#{qrCodeColor},'%') AND a.QRCODE_COLOR = #{qrCodeColor}
</if>
<if test="ne != null and ne != ''">
AND a.QRCODE_COLOR != #{ne}
</if> </if>
</where> </where>
ORDER BY a.CREATE_TIME DESC ORDER BY a.CREATE_TIME DESC
...@@ -135,7 +138,10 @@ ...@@ -135,7 +138,10 @@
AND a.UPDATE_TIME like concat(#{date},'%') AND a.UPDATE_TIME like concat(#{date},'%')
</if> </if>
<if test="qrCodeColor != null and qrCodeColor != ''"> <if test="qrCodeColor != null and qrCodeColor != ''">
AND a.QRCODE_COLOR like concat(#{qrCodeColor},'%') AND a.QRCODE_COLOR = #{qrCodeColor}
</if>
<if test="ne != null and ne != ''">
AND a.QRCODE_COLOR != #{ne}
</if> </if>
</where> </where>
</select> </select>
...@@ -157,7 +163,10 @@ ...@@ -157,7 +163,10 @@
AND a.CREATE_TIME like concat(#{date},'%') AND a.CREATE_TIME like concat(#{date},'%')
</if> </if>
<if test="qrCodeColor != null and qrCodeColor != ''"> <if test="qrCodeColor != null and qrCodeColor != ''">
AND a.QRCODE_COLOR like concat(#{qrCodeColor},'%') AND a.QRCODE_COLOR = #{qrCodeColor}
</if>
<if test="ne != null and ne != ''">
AND a.QRCODE_COLOR != #{ne}
</if> </if>
</where> </where>
ORDER BY a.CREATE_TIME DESC ORDER BY a.CREATE_TIME DESC
...@@ -178,7 +187,10 @@ ...@@ -178,7 +187,10 @@
AND a.CREATE_TIME like concat(#{date},'%') AND a.CREATE_TIME like concat(#{date},'%')
</if> </if>
<if test="qrCodeColor != null and qrCodeColor != ''"> <if test="qrCodeColor != null and qrCodeColor != ''">
AND a.QRCODE_COLOR like concat(#{qrCodeColor},'%') AND a.QRCODE_COLOR = #{qrCodeColor}
</if>
<if test="ne != null and ne != ''">
AND a.QRCODE_COLOR != #{ne}
</if> </if>
</where> </where>
</select> </select>
......
...@@ -715,23 +715,23 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -715,23 +715,23 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
} }
public Page<Map<String, Object>> getPersonYardByPage(String parentCode, // public Page<Map<String, Object>> getPersonYardByPage(String parentCode,
Integer current, // Integer current,
Integer size, // Integer size,
String date, // String date,
String qrCodeColor) { // String qrCodeColor) {
List<Map<String, Object>> resultList = personBasicMapper.getPersonYardByPage((current - 1) * size, size , parentCode, date, qrCodeColor); // List<Map<String, Object>> resultList = personBasicMapper.getPersonYardByPage((current - 1) * size, size , parentCode, date, qrCodeColor);
Integer count = personBasicMapper.getPersonYardByPageCount(parentCode, date, qrCodeColor); // Integer count = personBasicMapper.getPersonYardByPageCount(parentCode, date, qrCodeColor);
//
resultList.forEach(item -> { // resultList.forEach(item -> {
String name = QrcodeColorEnum.getName(String.valueOf(item.get("qrCodeColor"))); // String name = QrcodeColorEnum.getName(String.valueOf(item.get("qrCodeColor")));
item.put("name", name); // item.put("name", name);
}); // });
Page<Map<String, Object>> mapPage = new Page<>(); // Page<Map<String, Object>> mapPage = new Page<>();
mapPage.setRecords(resultList); // mapPage.setRecords(resultList);
mapPage.setCurrent(current); // mapPage.setCurrent(current);
mapPage.setSize(size); // mapPage.setSize(size);
mapPage.setTotal(count); // mapPage.setTotal(count);
return mapPage; // return mapPage;
} // }
} }
\ No newline at end of file
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