SweepCodeService.java 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. package com.bofeng.service;
  2. import com.bofeng.JwtHelper;
  3. import com.bofeng.dao.*;
  4. import com.bofeng.entity.*;
  5. import com.yvan.PageDb;
  6. import com.yvan.platform.StringUtils;
  7. import org.apache.shiro.util.CollectionUtils;
  8. import org.springframework.beans.BeanUtils;
  9. import org.springframework.beans.factory.annotation.Autowired;
  10. import org.springframework.stereotype.Service;
  11. import org.springframework.transaction.annotation.Transactional;
  12. import java.text.ParseException;
  13. import java.text.SimpleDateFormat;
  14. import java.util.ArrayList;
  15. import java.util.List;
  16. import java.util.Map;
  17. @Service
  18. @Transactional(readOnly = true)
  19. public class SweepCodeService {
  20. @Autowired
  21. private SweepCodeMapper sweepCodeMapper;
  22. @Autowired
  23. private OutScanEstateMapper outScanEstateMapper;
  24. @Autowired
  25. private RbMapper rbMapper;
  26. @Autowired
  27. private MsSuspectedMapper msSuspectedMapper;
  28. @Autowired
  29. private MsReportLogMapper msReportLogMapper;
  30. @Autowired
  31. private MsReportService msReportService;
  32. @Autowired
  33. private ScanService scanService;
  34. @Autowired
  35. private MsReportMapper msReportMapper;
  36. public List<SysUptownHouse> selectCode(PageDb pageDb, Map<String, Object> queryParam) {
  37. List<SysUptownHouse> sysUptownHouses = sweepCodeMapper.selectCode(pageDb,queryParam);
  38. return sysUptownHouses;
  39. }
  40. // public List<SysUptownHouse> selectLingyunUser(PageDb pageDb, Map<String, Object> queryParam) {
  41. // Long userId = JwtHelper.getUserId();
  42. // if (userId > 7000 && userId < 8000) {
  43. // queryParam.put("unitId", userId);
  44. // }
  45. // queryParam.put("uptownId", 1238790987234L);
  46. // List<SysUptownHouse> sysUptownHouses = sweepCodeMapper.selectLingyunUser(pageDb,queryParam);
  47. // return sysUptownHouses;
  48. // }
  49. public List<ExcelRiBaoLYBM4> selectLingyunUser(PageDb pageDb, Map<String, Object> queryParam, Long uptownId) throws ParseException {
  50. Long userId = JwtHelper.getUserId();
  51. if (userId > 7000 && userId < 8000) {
  52. queryParam.put("unitId", userId);
  53. }
  54. queryParam.put("uptownId", uptownId);
  55. queryParam.put("orderStr", " suu.unit_id asc,suho.linkman ");
  56. queryParam.put("unitType", 7000); // 对应的sql查询中部门大于7000
  57. List<ExcelRiBaoLYBM4> sysUptownHouses = rbMapper.exSelectLingyunUserPage(pageDb,queryParam);
  58. if (sysUptownHouses != null && sysUptownHouses.size() > 0) {
  59. String tripDet;
  60. for (ExcelRiBaoLYBM4 excelRiBaoLYBM4 : sysUptownHouses) {
  61. if (excelRiBaoLYBM4.getIsContact() == 0) {
  62. excelRiBaoLYBM4.setIsContactDesc("正常");
  63. } else if (excelRiBaoLYBM4.getIsContact() == 1) {
  64. excelRiBaoLYBM4.setIsContactDesc("异常");
  65. }
  66. if (excelRiBaoLYBM4.getIsSuspected() == 0) {
  67. excelRiBaoLYBM4.setIsSuspectedDesc("否");
  68. } else if (excelRiBaoLYBM4.getIsSuspected() == 1) {
  69. excelRiBaoLYBM4.setIsSuspectedDesc("是");
  70. }
  71. tripDet = "";
  72. //出行详细
  73. List<MsTripDet> listDet = msSuspectedMapper.selectTripSuspected(excelRiBaoLYBM4.getTripId());
  74. if (listDet != null && listDet.size() > 0) {
  75. for (MsTripDet msTripDet : listDet) {
  76. tripDet += "出发地:" + msReportService.getLocalOther(msTripDet.getStartLocal(), msTripDet.getStartLocalOther()) + ",";
  77. tripDet += "目的地:" + msReportService.getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
  78. tripDet += "出行方式:" + msReportService.getTripType(msTripDet.getTripType()) + ",";
  79. tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
  80. }
  81. excelRiBaoLYBM4.setTripDetDesc(tripDet.substring(0, tripDet.length() - 1));
  82. }
  83. // 复工
  84. excelRiBaoLYBM4.setReturnWork(scanService.returnWorkLYlist(excelRiBaoLYBM4.getUserId(), excelRiBaoLYBM4.getLinkman(), excelRiBaoLYBM4.getPhone()));
  85. // 昨天定位和今天定位是否2公里
  86. List<MsReport> msReports = msReportMapper.selectLatelyLocal(excelRiBaoLYBM4.getUserId());
  87. if (msReports.size() == 2) {
  88. Double dis = scanService.getDistance(Double.parseDouble(msReports.get(1).getLongitude()),Double.parseDouble(msReports.get(1).getLatitude()),Double.parseDouble(msReports.get(0).getLongitude()), Double.parseDouble(msReports.get(0).getLatitude()));
  89. if (dis <= 2000) {
  90. excelRiBaoLYBM4.setLiving(1);
  91. } else {
  92. excelRiBaoLYBM4.setLiving(2);
  93. }
  94. } else {
  95. excelRiBaoLYBM4.setLiving(0);
  96. }
  97. // 出行轨迹是否出门
  98. List<MsReportLog> msReportLogs = msReportLogMapper.logAddr(excelRiBaoLYBM4.getUserId());
  99. if (msReportLogs.size() > 1) {
  100. excelRiBaoLYBM4.setTravelRecords(1);
  101. } else if (msReportLogs.size() == 1) {
  102. excelRiBaoLYBM4.setTravelRecords(2);
  103. } else {
  104. excelRiBaoLYBM4.setTravelRecords(0);
  105. }
  106. }
  107. }
  108. return sysUptownHouses;
  109. }
  110. public List<ExcelRiBaoLYBM4> selectLingyunUserNotOnJob(PageDb pageDb, Map<String, Object> queryParam,Long notOnJob) throws ParseException {
  111. // Long userId = JwtHelper.getUserId();
  112. // if (userId > 7000 && userId < 8000) {
  113. // queryParam.put("unitId", userId);
  114. // }
  115. queryParam.put("notOnJob", notOnJob);
  116. queryParam.put("orderStr", " op.create_at desc ");
  117. List<ExcelRiBaoLYBM4> sysUptownHouses = rbMapper.exSelectLingyunUserPage(pageDb,queryParam);
  118. if (sysUptownHouses != null && sysUptownHouses.size() > 0) {
  119. String tripDet;
  120. for (ExcelRiBaoLYBM4 excelRiBaoLYBM4 : sysUptownHouses) {
  121. if (excelRiBaoLYBM4.getIsContact() == 0) {
  122. excelRiBaoLYBM4.setIsContactDesc("正常");
  123. } else if (excelRiBaoLYBM4.getIsContact() == 1) {
  124. excelRiBaoLYBM4.setIsContactDesc("异常");
  125. }
  126. if (excelRiBaoLYBM4.getIsSuspected() == 0) {
  127. excelRiBaoLYBM4.setIsSuspectedDesc("否");
  128. } else if (excelRiBaoLYBM4.getIsSuspected() == 1) {
  129. excelRiBaoLYBM4.setIsSuspectedDesc("是");
  130. }
  131. tripDet = "";
  132. //出行详细
  133. List<MsTripDet> listDet = msSuspectedMapper.selectTripSuspected(excelRiBaoLYBM4.getTripId());
  134. if (listDet != null && listDet.size() > 0) {
  135. for (MsTripDet msTripDet : listDet) {
  136. tripDet += "出发地:" + msReportService.getLocalOther(msTripDet.getStartLocal(), msTripDet.getStartLocalOther()) + ",";
  137. tripDet += "目的地:" + msReportService.getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
  138. tripDet += "出行方式:" + msReportService.getTripType(msTripDet.getTripType()) + ",";
  139. tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
  140. }
  141. excelRiBaoLYBM4.setTripDetDesc(tripDet.substring(0, tripDet.length() - 1));
  142. }
  143. // 复工
  144. excelRiBaoLYBM4.setReturnWork(scanService.returnWorkLYlist(excelRiBaoLYBM4.getUserId(), excelRiBaoLYBM4.getLinkman(), excelRiBaoLYBM4.getPhone()));
  145. }
  146. }
  147. return sysUptownHouses;
  148. }
  149. public List<ExcelRiBaoLYBM4> HCUser(PageDb pageDb, Map<String, Object> queryParam) {
  150. queryParam.put("uptownId", 100000002L);
  151. List<ExcelRiBaoLYBM4> sysUptownHouses = rbMapper.exSelectLingyunUserPage(pageDb,queryParam);
  152. if (sysUptownHouses != null && sysUptownHouses.size() > 0) {
  153. String tripDet;
  154. for (ExcelRiBaoLYBM4 excelRiBaoLYBM4 : sysUptownHouses) {
  155. if (excelRiBaoLYBM4.getIsContact() == 0) {
  156. excelRiBaoLYBM4.setIsContactDesc("正常");
  157. } else if (excelRiBaoLYBM4.getIsContact() == 1) {
  158. excelRiBaoLYBM4.setIsContactDesc("异常");
  159. }
  160. if (excelRiBaoLYBM4.getIsSuspected() == 0) {
  161. excelRiBaoLYBM4.setIsSuspectedDesc("否");
  162. } else if (excelRiBaoLYBM4.getIsSuspected() == 1) {
  163. excelRiBaoLYBM4.setIsSuspectedDesc("是");
  164. }
  165. tripDet = "";
  166. //出行详细
  167. List<MsTripDet> listDet = msSuspectedMapper.selectTripSuspected(excelRiBaoLYBM4.getTripId());
  168. if (listDet != null && listDet.size() > 0) {
  169. for (MsTripDet msTripDet : listDet) {
  170. tripDet += "出发地:" + msReportService.getLocalOther(msTripDet.getStartLocal(), msTripDet.getStartLocalOther()) + ",";
  171. tripDet += "目的地:" + msReportService.getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
  172. tripDet += "出行方式:" + msReportService.getTripType(msTripDet.getTripType()) + ",";
  173. tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
  174. }
  175. excelRiBaoLYBM4.setTripDetDesc(tripDet.substring(0, tripDet.length() - 1));
  176. }
  177. }
  178. }
  179. return sysUptownHouses;
  180. }
  181. public List<ExcelRiBaoLYBM4> selectLingyunUserHistory(PageDb pageDb, Long userId) {
  182. List<ExcelRiBaoLYBM4> sysUptownHouses = rbMapper.exSelectLingyunUserHistory(pageDb,userId);
  183. if (sysUptownHouses != null && sysUptownHouses.size() > 0) {
  184. String tripDet;
  185. for (ExcelRiBaoLYBM4 excelRiBaoLYBM4 : sysUptownHouses) {
  186. if (excelRiBaoLYBM4.getIsContact() == 0) {
  187. excelRiBaoLYBM4.setIsContactDesc("正常");
  188. } else if (excelRiBaoLYBM4.getIsContact() == 1) {
  189. excelRiBaoLYBM4.setIsContactDesc("异常");
  190. }
  191. if (excelRiBaoLYBM4.getIsSuspected() == 0) {
  192. excelRiBaoLYBM4.setIsSuspectedDesc("否");
  193. } else if (excelRiBaoLYBM4.getIsSuspected() == 1) {
  194. excelRiBaoLYBM4.setIsSuspectedDesc("是");
  195. }
  196. tripDet = "";
  197. //出行详细
  198. List<MsTripDet> listDet = msSuspectedMapper.selectTripSuspected(excelRiBaoLYBM4.getTripId());
  199. if (listDet != null && listDet.size() > 0) {
  200. for (MsTripDet msTripDet : listDet) {
  201. tripDet += "出发地:" + msReportService.getLocalOther(msTripDet.getStartLocal(), msTripDet.getStartLocalOther()) + ",";
  202. tripDet += "目的地:" + msReportService.getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
  203. tripDet += "出行方式:" + msReportService.getTripType(msTripDet.getTripType()) + ",";
  204. tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
  205. }
  206. excelRiBaoLYBM4.setTripDetDesc(tripDet.substring(0, tripDet.length() - 1));
  207. }
  208. // 昨天定位和今天定位是否2公里
  209. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  210. List<MsReport> msReports = msReportMapper.selectLatelyLocalDetails(sdf.format(excelRiBaoLYBM4.getReportDate()), excelRiBaoLYBM4.getUserId());
  211. if (msReports.size() == 2) {
  212. Double dis = scanService.getDistance(Double.parseDouble(msReports.get(1).getLongitude()),Double.parseDouble(msReports.get(1).getLatitude()),Double.parseDouble(msReports.get(0).getLongitude()), Double.parseDouble(msReports.get(0).getLatitude()));
  213. if (dis <= 2000) {
  214. excelRiBaoLYBM4.setLiving(1);
  215. } else {
  216. excelRiBaoLYBM4.setLiving(2);
  217. }
  218. } else {
  219. excelRiBaoLYBM4.setLiving(0);
  220. }
  221. // 出行轨迹是否出门
  222. List<MsReportLog> msReportLogs = msReportLogMapper.logAddrHistory(excelRiBaoLYBM4.getUserId(), sdf.format(excelRiBaoLYBM4.getReportDate()));
  223. if (msReportLogs.size() > 1) {
  224. excelRiBaoLYBM4.setTravelRecords(1);
  225. } else if (msReportLogs.size() == 1) {
  226. excelRiBaoLYBM4.setTravelRecords(2);
  227. } else {
  228. excelRiBaoLYBM4.setTravelRecords(0);
  229. }
  230. }
  231. }
  232. return sysUptownHouses;
  233. }
  234. public List<ExcelRiBaoLYBM4> exSelectLingyunUser(Map<String, Object> queryParam, Long uptownId, Long userId) throws ParseException {
  235. queryParam.put("uptownId", uptownId);
  236. queryParam.put("unitType", 7000); // 对应的sql查询中部门大于7000
  237. List<ExcelRiBaoLYBM4> sysUptownHouses = rbMapper.exSelectLingyunUser(queryParam);
  238. if (sysUptownHouses != null && sysUptownHouses.size() > 0) {
  239. String tripDet;
  240. for (ExcelRiBaoLYBM4 excelRiBaoLYBM4 : sysUptownHouses) {
  241. if (excelRiBaoLYBM4.getIsContact() == 0) {
  242. excelRiBaoLYBM4.setIsContactDesc("正常");
  243. } else if (excelRiBaoLYBM4.getIsContact() == 1) {
  244. excelRiBaoLYBM4.setIsContactDesc("异常");
  245. }
  246. if (excelRiBaoLYBM4.getIsSuspected() == 0) {
  247. excelRiBaoLYBM4.setIsSuspectedDesc("否");
  248. } else if (excelRiBaoLYBM4.getIsSuspected() == 1) {
  249. excelRiBaoLYBM4.setIsSuspectedDesc("是");
  250. }
  251. if (excelRiBaoLYBM4.getReportStatus() == 0) {
  252. excelRiBaoLYBM4.setReportStatusDesc("未上报");
  253. } else if (excelRiBaoLYBM4.getMsStatus() == 1) {
  254. excelRiBaoLYBM4.setReportStatusDesc("正常");
  255. } else {
  256. excelRiBaoLYBM4.setReportStatusDesc("异常");
  257. }
  258. if(StringUtils.isNullOrEmpty(excelRiBaoLYBM4.getOldOpenId())){
  259. excelRiBaoLYBM4.setIsBand("否");
  260. }else{
  261. excelRiBaoLYBM4.setIsBand("是");
  262. }
  263. tripDet = "";
  264. //出行详细
  265. List<MsTripDet> listDet = msSuspectedMapper.selectTripSuspected(excelRiBaoLYBM4.getTripId());
  266. if (listDet != null && listDet.size() > 0) {
  267. for (MsTripDet msTripDet : listDet) {
  268. tripDet += "出发地:" + msReportService.getLocalOther(msTripDet.getStartLocal(), msTripDet.getStartLocalOther()) + ",";
  269. tripDet += "目的地:" + msReportService.getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
  270. tripDet += "出行方式:" + msReportService.getTripType(msTripDet.getTripType()) + ",";
  271. tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
  272. }
  273. excelRiBaoLYBM4.setTripDetDesc(tripDet.substring(0, tripDet.length() - 1));
  274. }// 复工
  275. if (userId > 7000 && userId < 8000) {
  276. excelRiBaoLYBM4.setReturnWork(scanService.returnWorkLYlist(excelRiBaoLYBM4.getUserId(), excelRiBaoLYBM4.getLinkman(), excelRiBaoLYBM4.getPhone()));
  277. if (excelRiBaoLYBM4.getReturnWork() == 1) {
  278. excelRiBaoLYBM4.setReturnWorkMsg("允许复工");
  279. } else {
  280. excelRiBaoLYBM4.setReturnWorkMsg("禁止复工");
  281. }
  282. }
  283. // 昨天定位和今天定位是否2公里
  284. List<MsReport> msReports = msReportMapper.selectLatelyLocal(excelRiBaoLYBM4.getUserId());
  285. if (msReports.size() == 2) {
  286. Double dis = scanService.getDistance(Double.parseDouble(msReports.get(1).getLongitude()),Double.parseDouble(msReports.get(1).getLatitude()),Double.parseDouble(msReports.get(0).getLongitude()), Double.parseDouble(msReports.get(0).getLatitude()));
  287. if (dis <= 2000) {
  288. excelRiBaoLYBM4.setLiving(1);
  289. } else {
  290. excelRiBaoLYBM4.setLiving(2);
  291. }
  292. } else {
  293. excelRiBaoLYBM4.setLiving(0);
  294. }
  295. // 出行轨迹是否出门
  296. List<MsReportLog> msReportLogs = msReportLogMapper.logAddr(excelRiBaoLYBM4.getUserId());
  297. if (msReportLogs.size() > 1) {
  298. excelRiBaoLYBM4.setTravelRecords(1);
  299. } else if (msReportLogs.size() == 1) {
  300. excelRiBaoLYBM4.setTravelRecords(2);
  301. } else {
  302. excelRiBaoLYBM4.setTravelRecords(0);
  303. }
  304. }
  305. }
  306. return sysUptownHouses;
  307. }
  308. public List<ExcelRiBaoHCBM4> exSelectHCUser(Map<String, Object> queryParam) {
  309. queryParam.put("uptownId", 100000002L);
  310. List<ExcelRiBaoHCBM4> sysUptownHouses = rbMapper.exSelectHCUser(queryParam);
  311. if (sysUptownHouses != null && sysUptownHouses.size() > 0) {
  312. String tripDet;
  313. for (ExcelRiBaoHCBM4 excelRiBaoLYBM4 : sysUptownHouses) {
  314. if (excelRiBaoLYBM4.getIsContact() == 0) {
  315. excelRiBaoLYBM4.setIsContactDesc("正常");
  316. } else if (excelRiBaoLYBM4.getIsContact() == 1) {
  317. excelRiBaoLYBM4.setIsContactDesc("异常");
  318. }
  319. if (excelRiBaoLYBM4.getIsSuspected() == 0) {
  320. excelRiBaoLYBM4.setIsSuspectedDesc("否");
  321. } else if (excelRiBaoLYBM4.getIsSuspected() == 1) {
  322. excelRiBaoLYBM4.setIsSuspectedDesc("是");
  323. }
  324. tripDet = "";
  325. //出行详细
  326. List<MsTripDet> listDet = msSuspectedMapper.selectTripSuspected(excelRiBaoLYBM4.getTripId());
  327. if (listDet != null && listDet.size() > 0) {
  328. for (MsTripDet msTripDet : listDet) {
  329. tripDet += "出发地:" + msReportService.getLocalOther(msTripDet.getStartLocal(), msTripDet.getStartLocalOther()) + ",";
  330. tripDet += "目的地:" + msReportService.getLocalOther(msTripDet.getEndLocal(), msTripDet.getEndLocalOther()) + ",";
  331. tripDet += "出行方式:" + msReportService.getTripType(msTripDet.getTripType()) + ",";
  332. tripDet += "车次/航班/车牌:" + msTripDet.getTripTypeDesp() + ",";
  333. }
  334. excelRiBaoLYBM4.setTripDetDesc(tripDet.substring(0, tripDet.length() - 1));
  335. }
  336. }
  337. }
  338. return sysUptownHouses;
  339. }
  340. public List<SysUptownHouse> export(Map<String, Object> queryParam) {
  341. List<SysUptownHouse> sysUptownHouses = sweepCodeMapper.export(queryParam);
  342. if(sysUptownHouses.size() != 0){
  343. for (int i = 0; i < sysUptownHouses.size(); i++) {
  344. if(sysUptownHouses.get(i).getInType() == 1 ){
  345. sysUptownHouses.get(i).setInTypeStr("进入");
  346. }else if(sysUptownHouses.get(i).getInType() == 2 ){
  347. sysUptownHouses.get(i).setInTypeStr("外出");
  348. }
  349. if(sysUptownHouses.get(i).getGoStatus() == 1 ){
  350. sysUptownHouses.get(i).setGoStatusStr("允许");
  351. }else if(sysUptownHouses.get(i).getGoStatus() == -1 ){
  352. sysUptownHouses.get(i).setGoStatusStr("禁止");
  353. }
  354. }
  355. }
  356. return sysUptownHouses;
  357. }
  358. public List<SysUptownHouseLY> selectCodeLY(PageDb pageDb, Map<String, Object> queryParam) {
  359. List<SysUptownHouseLY> sysUptownHouses = sweepCodeMapper.selectCodeLY(pageDb,queryParam);
  360. return sysUptownHouses;
  361. }
  362. public List<SysUptownHouseLY> exportLY(Map<String, Object> queryParam) {
  363. List<SysUptownHouseLY> sysUptownHouses = sweepCodeMapper.exportLY(queryParam);
  364. if(sysUptownHouses.size() != 0){
  365. for (int i = 0; i < sysUptownHouses.size(); i++) {
  366. if(sysUptownHouses.get(i).getInType() == 1 ){
  367. sysUptownHouses.get(i).setInTypeStr("进入");
  368. }else if(sysUptownHouses.get(i).getInType() == 2 ){
  369. sysUptownHouses.get(i).setInTypeStr("外出");
  370. }
  371. if(sysUptownHouses.get(i).getGoStatus() == 1 ){
  372. sysUptownHouses.get(i).setGoStatusStr("允许");
  373. }else if(sysUptownHouses.get(i).getGoStatus() == -1 ){
  374. sysUptownHouses.get(i).setGoStatusStr("禁止");
  375. }
  376. }
  377. }
  378. return sysUptownHouses;
  379. }
  380. public List<SysUptownHouseLY> selectCodeHC(PageDb pageDb, Map<String, Object> queryParam) {
  381. List<SysUptownHouseLY> sysUptownHouses = sweepCodeMapper.selectCodeHC(pageDb,queryParam);
  382. return sysUptownHouses;
  383. }
  384. public List<SysUptownHouseLY> exportHC(Map<String, Object> queryParam) {
  385. List<SysUptownHouseLY> sysUptownHouses = sweepCodeMapper.exportHC(queryParam);
  386. if(sysUptownHouses.size() != 0){
  387. for (int i = 0; i < sysUptownHouses.size(); i++) {
  388. if(sysUptownHouses.get(i).getInType() == 1 ){
  389. sysUptownHouses.get(i).setInTypeStr("进入");
  390. }else if(sysUptownHouses.get(i).getInType() == 2 ){
  391. sysUptownHouses.get(i).setInTypeStr("外出");
  392. }
  393. if(sysUptownHouses.get(i).getGoStatus() == 1 ){
  394. sysUptownHouses.get(i).setGoStatusStr("允许");
  395. }else if(sysUptownHouses.get(i).getGoStatus() == -1 ){
  396. sysUptownHouses.get(i).setGoStatusStr("禁止");
  397. }
  398. }
  399. }
  400. return sysUptownHouses;
  401. }
  402. public List<OutScanClock> selectClockLY(PageDb pageDb, Map<String, Object> queryParam) {
  403. queryParam.put("uptownId", 1238790987234L);
  404. Long userId = JwtHelper.getUserId();
  405. if (userId > 7000 && userId < 8000) {
  406. queryParam.put("unitId", userId);
  407. }
  408. List<OutScanClock> list = sweepCodeMapper.selectClockLY(pageDb,queryParam);
  409. return list;
  410. }
  411. public List<OutScanClock> exSelectClockLY(Map<String, Object> queryParam) {
  412. queryParam.put("uptownId", 1238790987234L);
  413. List<OutScanClock> list = sweepCodeMapper.exSelectClockLY(queryParam);
  414. return list;
  415. }
  416. public List<Clock> exClockCount(Map<String, Object> queryParam) {
  417. return sweepCodeMapper.exClockCount(queryParam);
  418. }
  419. public List<OutScanEstate> selectXunJian(PageDb pageDb, Map<String, Object> queryParam) {
  420. List<OutScanEstate> outScanEstates = outScanEstateMapper.selectXunJian(pageDb,queryParam);
  421. return outScanEstates;
  422. }
  423. public List<OutScanEstate> exportXunJian(Map<String, Object> queryParam) {
  424. List<OutScanEstate> outScanEstates = outScanEstateMapper.exportXunJian(queryParam);
  425. if(outScanEstates.size() != 0){
  426. for (int i = 0; i < outScanEstates.size(); i++) {
  427. if(outScanEstates.get(i).getGoStatus() == 1 ){
  428. outScanEstates.get(i).setGoStatusStr("允许");
  429. }else if(outScanEstates.get(i).getGoStatus() == -1 ){
  430. outScanEstates.get(i).setGoStatusStr("禁止");
  431. }
  432. }
  433. }
  434. return outScanEstates;
  435. }
  436. /**
  437. * 复制list实体 list -> another list
  438. * @param target 目标list实体
  439. * @param soucreList 源list实体
  440. * @param <T>
  441. * @param <F>
  442. * @return
  443. */
  444. public <T, F> List<F> listCopyToAotherList(Class<F> target, List<T> soucreList) {
  445. if (!CollectionUtils.isEmpty(soucreList)) {
  446. List<F> targetList = new ArrayList<>();
  447. for (T t : soucreList) {
  448. try {
  449. F f = target.newInstance();
  450. BeanUtils.copyProperties(t, f);
  451. targetList.add(f);
  452. } catch (Exception e) {
  453. //
  454. }
  455. }
  456. return targetList;
  457. } else {
  458. return null;
  459. }
  460. }
  461. public List<MsReportLog> selectLogAddrHistory(PageDb pageDb, Long userId, String reportDate) {
  462. return msReportLogMapper.selectLogAddrHistory(pageDb, userId, reportDate);
  463. }
  464. }