Commit 94ee5511 authored by zhangsen's avatar zhangsen

问题处理

parent 7f99da62
...@@ -53,9 +53,13 @@ public interface PersonBasicMapper extends BaseMapper<PersonBasic> { ...@@ -53,9 +53,13 @@ public interface PersonBasicMapper extends BaseMapper<PersonBasic> {
List<Map<String, Object>> getPersonYardByPage(@Param("current") Integer current, List<Map<String, Object>> getPersonYardByPage(@Param("current") Integer current,
@Param("size") Integer size, @Param("size") Integer size,
@Param("parentCode") String parentCode); @Param("parentCode") String parentCode,
@Param("date") String date,
@Param("qrCodeColor") String qrCodeColor);
Integer getPersonYardByPageCount(@Param("parentCode") String parentCode); Integer getPersonYardByPageCount(@Param("parentCode") String parentCode,
@Param("date") String date,
@Param("qrCodeColor") String qrCodeColor);
List<StationQrCodeStatistics> getPersonStatistics(); List<StationQrCodeStatistics> getPersonStatistics();
} }
...@@ -212,7 +212,8 @@ ...@@ -212,7 +212,8 @@
SELECT SELECT
ifnull(b.name, '') as objectName , ifnull(b.name, '') as objectName ,
ifnull(a.qrcode_color, '') AS qrCodeColor, ifnull(a.qrcode_color, '') AS qrCodeColor,
ifnull(c.station_name, '') AS stationName ifnull(c.station_name, '') AS stationName,
ifnull(a.rec_date, '') as recDate
FROM FROM
person_basic a person_basic a
LEFT JOIN person_account b ON a.sequence_nbr = b.person_id LEFT JOIN person_account b ON a.sequence_nbr = b.person_id
...@@ -221,6 +222,12 @@ ...@@ -221,6 +222,12 @@
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND a.project_org_code like concat(#{parentCode},'%') AND a.project_org_code like concat(#{parentCode},'%')
</if> </if>
<if test="date != null and date != ''">
AND a.rec_date like concat(#{date},'%')
</if>
<if test="qrCodeColor != null and qrCodeColor != ''">
AND a.qrcode_color like concat(#{qrCodeColor},'%')
</if>
</where> </where>
ORDER BY a.rec_date DESC ORDER BY a.rec_date DESC
limit #{current},#{size} limit #{current},#{size}
...@@ -237,6 +244,12 @@ ...@@ -237,6 +244,12 @@
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND a.project_org_code like concat(#{parentCode},'%') AND a.project_org_code like concat(#{parentCode},'%')
</if> </if>
<if test="date != null and date != ''">
AND a.rec_date like concat(#{date},'%')
</if>
<if test="qrCodeColor != null and qrCodeColor != ''">
AND a.qrcode_color like concat(#{qrCodeColor},'%')
</if>
</where> </where>
</select> </select>
......
...@@ -75,6 +75,7 @@ public class PersonQrCodeController extends BaseController { ...@@ -75,6 +75,7 @@ public class PersonQrCodeController extends BaseController {
List<Map<String, Object>> maps = new ArrayList<>(); List<Map<String, Object>> maps = new ArrayList<>();
Arrays.stream(QrcodeColorEnum.values()).forEach(item -> { Arrays.stream(QrcodeColorEnum.values()).forEach(item -> {
HashMap<String, Object> map = new HashMap<>(); HashMap<String, Object> map = new HashMap<>();
map.put("qrCodeColor", item.getCode());
map.put("name", item.getName()); map.put("name", item.getName());
map.put("value", collect.getOrDefault("qrCodeColor", 0)); map.put("value", collect.getOrDefault("qrCodeColor", 0));
maps.add(map); maps.add(map);
...@@ -93,14 +94,16 @@ public class PersonQrCodeController extends BaseController { ...@@ -93,14 +94,16 @@ public class PersonQrCodeController extends BaseController {
public ResponseModel<Page<Map<String, Object>>> getPersonYardByPage(@RequestParam(required = false, value = "parentCode") String parentCode, public ResponseModel<Page<Map<String, Object>>> getPersonYardByPage(@RequestParam(required = false, value = "parentCode") String parentCode,
@RequestParam(value = "current") Integer current, @RequestParam(value = "current") Integer current,
@RequestParam(value = "size") Integer size, @RequestParam(value = "size") Integer size,
@RequestParam(required = false, value = "dataType") String dataType) { @RequestParam(required = false, value = "dataType") String dataType,
@RequestParam(required = false) String date,
@RequestParam(required = false) String qrCodeColor) {
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); resultList = personBasicServiceImpl.getPersonYardByPage(parentCode, current, size, date, qrCodeColor);
} else if ("equip".equals(dataType)) { } else if ("equip".equals(dataType)) {
List<Map<String, Object>> equipYardByPage = sjglZsjZsbtzMapper.getEquipYardByPage((current - 1) * size, size, parentCode); List<Map<String, Object>> equipYardByPage = sjglZsjZsbtzMapper.getEquipYardByPage((current - 1) * size, size, parentCode, date, qrCodeColor);
Integer equipYardByPageCount = sjglZsjZsbtzMapper.getEquipYardByPageCount(parentCode); Integer equipYardByPageCount = sjglZsjZsbtzMapper.getEquipYardByPageCount(parentCode, date, qrCodeColor);
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);
...@@ -110,8 +113,8 @@ public class PersonQrCodeController extends BaseController { ...@@ -110,8 +113,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); List<Map<String, Object>> jobYardByPage = sjglZsjZsbtzMapper.getJobYardByPage((current - 1) * size, size, parentCode, date, qrCodeColor);
Integer jobYardByPageCount = sjglZsjZsbtzMapper.getJobYardByPageCount(parentCode); Integer jobYardByPageCount = sjglZsjZsbtzMapper.getJobYardByPageCount(parentCode, date, qrCodeColor);
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);
...@@ -137,7 +140,7 @@ public class PersonQrCodeController extends BaseController { ...@@ -137,7 +140,7 @@ public class PersonQrCodeController extends BaseController {
FeignClientResult<Map<String, Object>> sevenEntity = null; FeignClientResult<Map<String, Object>> sevenEntity = null;
try { try {
sevenEntity = mcbWarningFeign.getQrCodeCount(parentCode, "RYFM"); sevenEntity = mcbWarningFeign.getQrCodeCount(parentCode, dataType);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
...@@ -147,7 +150,14 @@ public class PersonQrCodeController extends BaseController { ...@@ -147,7 +150,14 @@ public class PersonQrCodeController extends BaseController {
String yellow = result.get("yellow").toString(); String yellow = result.get("yellow").toString();
String redToGreen = result.get("redToGreen").toString(); String redToGreen = result.get("redToGreen").toString();
String yellowToGreen = result.get("yellowToGreen").toString(); String yellowToGreen = result.get("yellowToGreen").toString();
Integer countAll = personBasicMapper.getPersonYardByPageCount(parentCode); Integer countAll = 0;
if ("RYFM".equals(dataType) || "person".equals(dataType)) {
countAll = personBasicMapper.getPersonYardByPageCount(parentCode, null, null);
} else if ("equip".equals(dataType)) {
countAll = sjglZsjZsbtzMapper.getEquipYardByPageCount(parentCode, null, null);
} else if ("job".equals(dataType)) {
countAll = sjglZsjZsbtzMapper.getJobYardByPageCount(parentCode, 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)));
result.put("yellowToGreenPercent", getPercent(new BigDecimal(yellow), new BigDecimal(countAll))); result.put("yellowToGreenPercent", getPercent(new BigDecimal(yellow), new BigDecimal(countAll)));
...@@ -167,10 +177,28 @@ public class PersonQrCodeController extends BaseController { ...@@ -167,10 +177,28 @@ public class PersonQrCodeController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@GetMapping(value = "/getQrCodeCountByStation") @GetMapping(value = "/getQrCodeCountByStation")
@ApiOperation(httpMethod = "GET", value = "评估大屏 - 场站 人员赋码数量等统计 【折线图】", notes = "评估大屏 - 场站 人员赋码数量等统计 【折线图】") @ApiOperation(httpMethod = "GET", value = "评估大屏 - 场站 人员赋码数量等统计 【折线图】", notes = "评估大屏 - 场站 人员赋码数量等统计 【折线图】")
public ResponseModel<List<Map<String, Object>>> getQrCodeCountByStation(@RequestParam(required = false, value = "parentCode") String parentCode, public ResponseModel<Map<String, Object>> getQrCodeCountByStation(@RequestParam(required = false, value = "parentCode") String parentCode,
@RequestParam(required = false, value = "dataType") String dataType) { @RequestParam(required = false, value = "dataType") String dataType) {
List<Map<String, Object>> qrCodeCountByStation = stationQrCodeStatisticsMapper.getQrCodeCountByStation(parentCode, dataType); List<Map<String, Object>> qrCodeCountByStation = stationQrCodeStatisticsMapper.getQrCodeCountByStation(parentCode, dataType);
return ResponseHelper.buildResponse(qrCodeCountByStation);
List<Object> redNum = qrCodeCountByStation.stream().map(t -> t.get("redNum")).collect(Collectors.toList());
List<Object> yellowNum = qrCodeCountByStation.stream().map(t -> t.get("yellowNum")).collect(Collectors.toList());
List<Object> date = qrCodeCountByStation.stream().map(t -> t.get("date")).collect(Collectors.toList());
ArrayList<Map<String, Object>> maps = new ArrayList<>();
HashMap<String, Object> map = new HashMap<>();
map.put("data", redNum);
map.put("name", "红码");
maps.add(map);
HashMap<String, Object> map1 = new HashMap<>();
map1.put("data", yellowNum);
map1.put("name", "黄码");
maps.add(map1);
HashMap<String, Object> resultMap = new HashMap<>();
resultMap.put("seriesData", maps);
resultMap.put("axisData", date);
return ResponseHelper.buildResponse(resultMap);
} }
......
...@@ -54,12 +54,16 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> { ...@@ -54,12 +54,16 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
*/ */
List<Map<String, Object>> getEquipYardByPage(@Param("current") Integer current, List<Map<String, Object>> getEquipYardByPage(@Param("current") Integer current,
@Param("size") Integer size, @Param("size") Integer size,
@Param("parentCode") String parentCode); @Param("parentCode") String parentCode,
@Param("date") String date,
@Param("qrCodeColor") String qrCodeColor);
/** /**
* 设备赋码列表 * 设备赋码列表
*/ */
Integer getEquipYardByPageCount(@Param("parentCode") String parentCode); Integer getEquipYardByPageCount(@Param("parentCode") String parentCode,
@Param("date") String date,
@Param("qrCodeColor") String qrCodeColor);
...@@ -69,10 +73,14 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> { ...@@ -69,10 +73,14 @@ public interface SjglZsjZsbtzMapper extends BaseMapper<SjglZsjZsbtz> {
*/ */
List<Map<String, Object>> getJobYardByPage(@Param("current") Integer current, List<Map<String, Object>> getJobYardByPage(@Param("current") Integer current,
@Param("size") Integer size, @Param("size") Integer size,
@Param("parentCode") String parentCode); @Param("parentCode") String parentCode,
@Param("date") String date,
@Param("qrCodeColor") String qrCodeColor);
/** /**
* 任务赋码列表数量统计 * 任务赋码列表数量统计
*/ */
Integer getJobYardByPageCount(@Param("parentCode") String parentCode); Integer getJobYardByPageCount(@Param("parentCode") String parentCode,
@Param("date") String date,
@Param("qrCodeColor") String qrCodeColor);
} }
...@@ -101,7 +101,8 @@ ...@@ -101,7 +101,8 @@
SELECT SELECT
ifnull(a.SBMC, '') as objectName , ifnull(a.SBMC, '') as objectName ,
ifnull(a.QRCODE_COLOR, '') AS qrCodeColor, ifnull(a.QRCODE_COLOR, '') AS qrCodeColor,
ifnull(b.COMPANY_NAME, '') AS stationName ifnull(b.COMPANY_NAME, '') AS stationName,
ifnull(a.UPDATE_TIME, '') as recDate
FROM FROM
sjgl_zsj_zsbtz a sjgl_zsj_zsbtz a
LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE
...@@ -109,6 +110,12 @@ ...@@ -109,6 +110,12 @@
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND b.COMPANY_CODE like concat(#{parentCode},'%') AND b.COMPANY_CODE like concat(#{parentCode},'%')
</if> </if>
<if test="date != null and date != ''">
AND a.UPDATE_TIME like concat(#{date},'%')
</if>
<if test="qrCodeColor != null and qrCodeColor != ''">
AND a.QRCODE_COLOR like concat(#{qrCodeColor},'%')
</if>
</where> </where>
ORDER BY a.CREATE_TIME DESC ORDER BY a.CREATE_TIME DESC
limit #{current},#{size} limit #{current},#{size}
...@@ -124,6 +131,12 @@ ...@@ -124,6 +131,12 @@
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND b.COMPANY_CODE like concat(#{parentCode},'%') AND b.COMPANY_CODE like concat(#{parentCode},'%')
</if> </if>
<if test="date != null and date != ''">
AND a.UPDATE_TIME like concat(#{date},'%')
</if>
<if test="qrCodeColor != null and qrCodeColor != ''">
AND a.QRCODE_COLOR like concat(#{qrCodeColor},'%')
</if>
</where> </where>
</select> </select>
...@@ -131,7 +144,8 @@ ...@@ -131,7 +144,8 @@
SELECT SELECT
ifnull(a.JOB_DESCRIPTION, '') as objectName , ifnull(a.JOB_DESCRIPTION, '') as objectName ,
ifnull(a.qrcode_color, '') AS qrCodeColor, ifnull(a.qrcode_color, '') AS qrCodeColor,
ifnull(b.COMPANY_NAME, '') AS stationName ifnull(b.COMPANY_NAME, '') AS stationName,
ifnull(a.CREATE_TIME, '') as recDate
FROM FROM
fdgl_job_main a fdgl_job_main a
LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE LEFT JOIN privilege_company b ON a.WERKS = b.COMPANY_CODE
...@@ -139,6 +153,12 @@ ...@@ -139,6 +153,12 @@
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND b.COMPANY_CODE like concat(#{parentCode},'%') AND b.COMPANY_CODE like concat(#{parentCode},'%')
</if> </if>
<if test="date != null and date != ''">
AND a.CREATE_TIME like concat(#{date},'%')
</if>
<if test="qrCodeColor != null and qrCodeColor != ''">
AND a.QRCODE_COLOR like concat(#{qrCodeColor},'%')
</if>
</where> </where>
ORDER BY a.CREATE_TIME DESC ORDER BY a.CREATE_TIME DESC
limit #{current},#{size} limit #{current},#{size}
...@@ -154,6 +174,12 @@ ...@@ -154,6 +174,12 @@
<if test="parentCode != null and parentCode != ''"> <if test="parentCode != null and parentCode != ''">
AND b.COMPANY_CODE like concat(#{parentCode},'%') AND b.COMPANY_CODE like concat(#{parentCode},'%')
</if> </if>
<if test="date != null and date != ''">
AND a.CREATE_TIME like concat(#{date},'%')
</if>
<if test="qrCodeColor != null and qrCodeColor != ''">
AND a.QRCODE_COLOR like concat(#{qrCodeColor},'%')
</if>
</where> </where>
</select> </select>
</mapper> </mapper>
...@@ -36,6 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -36,6 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
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 org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -714,9 +715,13 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa ...@@ -714,9 +715,13 @@ public class PersonBasicServiceImpl extends BaseService<PersonBasicDto, PersonBa
} }
public Page<Map<String, Object>> getPersonYardByPage(String parentCode, Integer current, Integer size) { public Page<Map<String, Object>> getPersonYardByPage(String parentCode,
List<Map<String, Object>> resultList = personBasicMapper.getPersonYardByPage((current - 1) * size, size , parentCode); Integer current,
Integer count = personBasicMapper.getPersonYardByPageCount(parentCode); Integer size,
String date,
String qrCodeColor) {
List<Map<String, Object>> resultList = personBasicMapper.getPersonYardByPage((current - 1) * size, size , 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")));
......
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