Commit 51a1f0c5c2b9dfadcd4c4462c734a95021ab644f
1 parent
6bc04725
添加对接报表
Showing
29 changed files
with
1080 additions
and
36 deletions
Bsth-admin/sql/DDL.sql
| 1 | -ALTER TABLE equipment_exception ADD sign_id INT NULL COMMENT '打卡表ID'; | |
| 2 | - | |
| 3 | - | |
| 4 | -ALTER TABLE equipment_exception_report ADD sign_in varchar(100) NULL COMMENT '签到类型 1 人脸 2 刷卡 3 其他 4 酒精;104 线下酒测'; | |
| 5 | - | |
| 6 | - | |
| 7 | -ALTER TABLE sign_in ADD exception_Id BIGINT NULL COMMENT '异常ID复测签到'; | |
| 8 | - | |
| 9 | - | |
| 1 | +CREATE TABLE lingang_all_in_one.sign_report_day_summary ( | |
| 2 | + id INT auto_increment NOT NULL COMMENT 'ID', | |
| 3 | + dateStr varchar(30) NOT NULL COMMENT '日期 格式为:yyyy-MM-dd', | |
| 4 | + alcohol_Num INT DEFAULT 0 NULL COMMENT '酒驾人数', | |
| 5 | + early_Signing INT DEFAULT 0 NULL COMMENT '早签人数', | |
| 6 | + late_Signing INT DEFAULT 0 NULL COMMENT '晚签人数', | |
| 7 | + normal_Signing INT DEFAULT 0 NULL COMMENT '正常签到人数', | |
| 8 | + CONSTRAINT sign_report_day_summary_pk PRIMARY KEY (id), | |
| 9 | + CONSTRAINT sign_report_day_summary_unique UNIQUE KEY (dateStr) | |
| 10 | +) | |
| 11 | +ENGINE=InnoDB | |
| 12 | +DEFAULT CHARSET=utf8mb4 | |
| 13 | +COLLATE=utf8mb4_0900_ai_ci; | |
| 10 | 14 | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/controller/RefreshController.java
| ... | ... | @@ -6,13 +6,17 @@ import com.ruoyi.common.utils.sign.Base64; |
| 6 | 6 | import com.ruoyi.controller.dss.DssFaceController; |
| 7 | 7 | import com.ruoyi.domain.driver.NewDriver; |
| 8 | 8 | import com.ruoyi.domain.driver.dss.syn.res.dto.FaceRegisterDTO; |
| 9 | +import com.ruoyi.domain.dss.app.vo.SignReportGroupByVo; | |
| 9 | 10 | import com.ruoyi.domain.scheduling.LinggangScheduling; |
| 11 | +import com.ruoyi.domain.sign.in.summary.SignReportDaySummary; | |
| 10 | 12 | import com.ruoyi.equipment.domain.Equipment; |
| 11 | 13 | import com.ruoyi.equipment.service.IEquipmentService; |
| 12 | 14 | import com.ruoyi.job.DriverJob; |
| 15 | +import com.ruoyi.service.SignReportServer; | |
| 13 | 16 | import com.ruoyi.service.driver.NewDriverService; |
| 14 | 17 | import com.ruoyi.service.key.location.LinggangKeyWorkLocationService; |
| 15 | 18 | import com.ruoyi.service.scheduling.LinggangSchedulingService; |
| 19 | +import com.ruoyi.service.sign.in.summary.SignReportDaySummaryService; | |
| 16 | 20 | import com.ruoyi.utils.DateUtil; |
| 17 | 21 | import io.swagger.annotations.ApiOperation; |
| 18 | 22 | import lombok.extern.slf4j.Slf4j; |
| ... | ... | @@ -21,6 +25,7 @@ import org.apache.commons.io.FileUtils; |
| 21 | 25 | import org.apache.commons.lang3.ArrayUtils; |
| 22 | 26 | import org.apache.commons.lang3.StringUtils; |
| 23 | 27 | import org.apache.commons.lang3.time.DateUtils; |
| 28 | +import org.springframework.beans.BeanUtils; | |
| 24 | 29 | import org.springframework.beans.factory.annotation.Autowired; |
| 25 | 30 | import org.springframework.security.access.prepost.PreAuthorize; |
| 26 | 31 | import org.springframework.web.bind.annotation.*; |
| ... | ... | @@ -51,6 +56,11 @@ public class RefreshController { |
| 51 | 56 | private DssFaceController dssFaceController; |
| 52 | 57 | @Autowired |
| 53 | 58 | private IEquipmentService equipmentService; |
| 59 | + @Autowired | |
| 60 | + private SignReportDaySummaryService signReportDaySummaryService; | |
| 61 | + @Autowired | |
| 62 | + private SignReportServer signReportServer; | |
| 63 | + | |
| 54 | 64 | |
| 55 | 65 | @GetMapping(value = "/scheduling") |
| 56 | 66 | @ApiOperation("scheduling") |
| ... | ... | @@ -68,7 +78,7 @@ public class RefreshController { |
| 68 | 78 | @GetMapping(value = "/scheduling/{dateStr}") |
| 69 | 79 | @ApiOperation("scheduling") |
| 70 | 80 | // @PreAuthorize("@ss.hasPermi('refresh:scheduling')") |
| 71 | - public ResponseResult<Boolean> scheduling(@PathVariable String dateStr) throws ParseException { | |
| 81 | + public ResponseResult<Boolean> scheduling(@PathVariable String dateStr) throws ParseException { | |
| 72 | 82 | Date date = DateUtil.YYYY_MM_DD_LINK_HH_MM_SS.parse(dateStr); |
| 73 | 83 | driverJob.runScheduling(date.getTime()); |
| 74 | 84 | |
| ... | ... | @@ -108,7 +118,7 @@ public class RefreshController { |
| 108 | 118 | |
| 109 | 119 | @PostMapping(value = "/driver/init/image") |
| 110 | 120 | @ApiOperation("driver/init/image") |
| 111 | - // @PreAuthorize("@ss.hasPermi('refresh:driver:init:image')") | |
| 121 | + // @PreAuthorize("@ss.hasPermi('refresh:driver:init:image')") | |
| 112 | 122 | public ResponseResult<Boolean> insertDriverInitImage(@RequestParam("imagePath") String imagePath, @RequestParam("device") String device) { |
| 113 | 123 | if (StringUtils.isEmpty(device)) { |
| 114 | 124 | return ResponseResult.error("注册设备号不能为空"); |
| ... | ... | @@ -179,7 +189,7 @@ public class RefreshController { |
| 179 | 189 | |
| 180 | 190 | @PostMapping(value = "/driver/init/image/name") |
| 181 | 191 | @ApiOperation("driver/init/image/name") |
| 182 | - // @PreAuthorize("@ss.hasPermi('refresh:driver:init:image:name')") | |
| 192 | + // @PreAuthorize("@ss.hasPermi('refresh:driver:init:image:name')") | |
| 183 | 193 | public ResponseResult<Object> insertDriverInitImageOfName(@RequestParam("imagePath") String imagePath, @RequestParam("device") String device) { |
| 184 | 194 | if (StringUtils.isEmpty(device)) { |
| 185 | 195 | return ResponseResult.error("注册设备号不能为空"); |
| ... | ... | @@ -269,4 +279,56 @@ public class RefreshController { |
| 269 | 279 | return responseResult; |
| 270 | 280 | } |
| 271 | 281 | |
| 282 | + @GetMapping(value = "/sign/report/summary/{startMonth}") | |
| 283 | + @ApiOperation("/sign/report/summary") | |
| 284 | + public ResponseResult<String> signReportSummary(@PathVariable("startMonth") String startMonth) throws ParseException { | |
| 285 | + Date now = DateUtil.shortDate(new Date()); | |
| 286 | + String dateStr = startMonth + "-01"; | |
| 287 | + Date startDate = DateUtil.YYYY_MM_DD_LINK.parse(dateStr); | |
| 288 | + int index = -1; | |
| 289 | + boolean flag = false; | |
| 290 | + while (true) { | |
| 291 | + index++; | |
| 292 | + Date startDate1 = DateUtils.addMonths(startDate,index); | |
| 293 | + dateStr = DateUtil.YYYY_MM_LINK.format(startDate1); | |
| 294 | + List<SignReportGroupByVo> signReportGroupByVos = signReportServer.querySignReportGroupByDateStrVo(dateStr); | |
| 295 | + | |
| 296 | + if (CollectionUtils.isNotEmpty(signReportGroupByVos)) { | |
| 297 | + for (SignReportGroupByVo byVo : signReportGroupByVos) { | |
| 298 | + Date date = DateUtil.YYYY_MM_DD_LINK.parse(byVo.getDateStr()); | |
| 299 | + if (DateUtils.isSameDay(now, date)) { | |
| 300 | + flag = true; | |
| 301 | + break; | |
| 302 | + }else if(date.getTime()>=now.getTime()){ | |
| 303 | + flag = true; | |
| 304 | + break; | |
| 305 | + } | |
| 306 | + SignReportDaySummary summary = new SignReportDaySummary(); | |
| 307 | + summary.setDatestr(byVo.getDateStr()); | |
| 308 | + | |
| 309 | + List<SignReportDaySummary> summaries = signReportDaySummaryService.list(summary); | |
| 310 | + if (CollectionUtils.isNotEmpty(summaries)) { | |
| 311 | + Set<Integer> ids = summaries.stream().map(SignReportDaySummary::getId).collect(Collectors.toSet()); | |
| 312 | + signReportDaySummaryService.removeByIds(ids); | |
| 313 | + } | |
| 314 | + | |
| 315 | + BeanUtils.copyProperties(byVo, summary); | |
| 316 | + try { | |
| 317 | + signReportDaySummaryService.save(summary); | |
| 318 | + } catch (Exception e) { | |
| 319 | + log.error("保存签到汇总异常:[{}]", dateStr, e); | |
| 320 | + } | |
| 321 | + | |
| 322 | + } | |
| 323 | + } | |
| 324 | + | |
| 325 | + if (flag) { | |
| 326 | + break; | |
| 327 | + } | |
| 328 | + | |
| 329 | + } | |
| 330 | + | |
| 331 | + return ResponseResult.success(); | |
| 332 | + } | |
| 333 | + | |
| 272 | 334 | } | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/controller/ReportController.java
| 1 | 1 | package com.ruoyi.controller; |
| 2 | 2 | |
| 3 | 3 | import com.ruoyi.common.core.domain.AjaxResult; |
| 4 | +import com.ruoyi.common.core.domain.ResponseResult; | |
| 4 | 5 | import com.ruoyi.common.global.Result; |
| 5 | 6 | import com.ruoyi.common.utils.poi.ExcelUtil; |
| 6 | 7 | import com.ruoyi.pojo.request.ReportViewRequestVo; |
| ... | ... | @@ -10,9 +11,7 @@ import com.ruoyi.pojo.response.ReportErrorResponseVo; |
| 10 | 11 | import com.ruoyi.pojo.vo.PersonSignDataResponseVo; |
| 11 | 12 | import com.ruoyi.service.ReportService; |
| 12 | 13 | import com.ruoyi.system.domain.SysNotice; |
| 13 | -import io.swagger.annotations.Api; | |
| 14 | -import io.swagger.annotations.ApiOperation; | |
| 15 | -import io.swagger.annotations.ApiParam; | |
| 14 | +import io.swagger.annotations.*; | |
| 16 | 15 | import org.springframework.security.access.prepost.PreAuthorize; |
| 17 | 16 | import org.springframework.validation.annotation.Validated; |
| 18 | 17 | import org.springframework.web.bind.annotation.*; |
| ... | ... | @@ -90,6 +89,12 @@ public class ReportController { |
| 90 | 89 | return AjaxResult.success(reportService.getErrorReportList(request)); |
| 91 | 90 | } |
| 92 | 91 | |
| 92 | + @ApiOperation("异常报表集合查询") | |
| 93 | + @GetMapping("/error/list/report") | |
| 94 | + public ResponseResult<List<ReportErrorResponseVo>> getErrorListReport(@ApiParam @ModelAttribute ReportErrorRequestVo request) { | |
| 95 | + return ResponseResult.success(reportService.getErrorReportList(request)); | |
| 96 | + } | |
| 97 | + | |
| 93 | 98 | @ApiOperation("签到报表导出") |
| 94 | 99 | @PostMapping("/export") |
| 95 | 100 | public void exportReport(@ApiParam ReportViewRequestVo requestVo, HttpServletResponse response) { | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/controller/app/SignReportController.java
| ... | ... | @@ -2,19 +2,27 @@ package com.ruoyi.controller.app; |
| 2 | 2 | |
| 3 | 3 | import com.ruoyi.common.core.controller.BaseController; |
| 4 | 4 | import com.ruoyi.common.core.domain.ResponseResult; |
| 5 | +import com.ruoyi.domain.dss.app.vo.SignReportGroupByVo; | |
| 5 | 6 | import com.ruoyi.domain.dss.app.vo.SignReportVo; |
| 6 | 7 | import com.ruoyi.service.SignReportServer; |
| 8 | +import com.ruoyi.utils.DateUtil; | |
| 7 | 9 | import io.swagger.annotations.Api; |
| 8 | 10 | import io.swagger.annotations.ApiOperation; |
| 9 | 11 | import io.swagger.annotations.ApiParam; |
| 10 | 12 | import lombok.extern.slf4j.Slf4j; |
| 13 | +import org.apache.commons.lang3.StringUtils; | |
| 14 | +import org.apache.commons.lang3.time.DateUtils; | |
| 11 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 16 | import org.springframework.web.bind.annotation.GetMapping; |
| 13 | 17 | import org.springframework.web.bind.annotation.PathVariable; |
| 14 | 18 | import org.springframework.web.bind.annotation.RequestMapping; |
| 15 | 19 | import org.springframework.web.bind.annotation.RestController; |
| 16 | 20 | |
| 21 | +import java.text.ParseException; | |
| 22 | +import java.util.Date; | |
| 23 | +import java.util.HashSet; | |
| 17 | 24 | import java.util.List; |
| 25 | +import java.util.Set; | |
| 18 | 26 | |
| 19 | 27 | @Slf4j |
| 20 | 28 | @RestController |
| ... | ... | @@ -25,10 +33,54 @@ public class SignReportController extends BaseController { |
| 25 | 33 | private SignReportServer signReportServer; |
| 26 | 34 | |
| 27 | 35 | @ApiOperation("签到数据统计(设备状态、检查人数、异常人数、酒驾人数);(dateStr格式为yyyy-MM-dd)") |
| 28 | - @ApiParam(name = "dateStr", value = "查询日期(格式为yyyy-MM-dd)", required = true,example="2024-12-11") | |
| 36 | + @ApiParam(name = "dateStr", value = "查询日期(格式为yyyy-MM-dd)", required = true, example = "2024-12-11") | |
| 29 | 37 | @GetMapping("/equipment/people/num/{dateStr}") |
| 30 | 38 | public ResponseResult<SignReportVo> equipmentAndPeopleNumStatistics(@PathVariable String dateStr) { |
| 31 | 39 | SignReportVo vo = signReportServer.querySignReportVo(dateStr); |
| 32 | 40 | return ResponseResult.success(vo); |
| 33 | 41 | } |
| 42 | + | |
| 43 | + | |
| 44 | + @ApiOperation("签到每天数据统计(酒驾人数、早签人数、晚签人数、正常签到人数、日期(格式为yyyy-MM-dd));(dateStr格式为yyyy-MM,如2024-03)") | |
| 45 | + @ApiParam(name = "dateStr", value = "查询日期(格式为yyyy-MM)", required = true, example = "2024-12") | |
| 46 | + @GetMapping("/sign/report/group/{dateStr}") | |
| 47 | + public ResponseResult<List<SignReportGroupByVo>> signReportGroupByDateStr(@PathVariable String dateStr) { | |
| 48 | + List<SignReportGroupByVo> vos = null; | |
| 49 | + try { | |
| 50 | + vos = signReportServer.querySignReportGroupByDateStrVo(dateStr); | |
| 51 | + return ResponseResult.success(vos); | |
| 52 | + } catch (ParseException e) { | |
| 53 | + log.error("获取每天签到数据异常", e); | |
| 54 | + return ResponseResult.error(); | |
| 55 | + } | |
| 56 | + } | |
| 57 | + | |
| 58 | + @ApiOperation("签到每月数据统计(酒驾人数、早签人数、晚签人数、正常签到人数、日期(格式为yyyy-MM-dd));(startDateStr和endDateStr格式为yyyy-MM,如2024-03,没有时间请传0,传0后系统会获取当前时间作为endDateStr,向前推12个月作为startDateStr;startDateStr和endDateStr最多间隔1000个月)") | |
| 59 | + @ApiParam(name = "dateStr", value = "查询日期(格式为yyyy-MM)", required = true, example = "2024-12") | |
| 60 | + @GetMapping("/sign/report/group/month/{startDateStr}/{endDateStr}") | |
| 61 | + public ResponseResult<List<SignReportGroupByVo>> signReportGroupMonthByDateStr(@PathVariable String startDateStr, @PathVariable String endDateStr) throws ParseException { | |
| 62 | + if (StringUtils.equals("0", endDateStr)) { | |
| 63 | + endDateStr = DateUtil.YYYY_MM_LINK.format(new Date()); | |
| 64 | + } | |
| 65 | + | |
| 66 | + if (org.apache.commons.lang3.StringUtils.equals("0", startDateStr)) { | |
| 67 | + startDateStr = DateUtil.YYYY_MM_LINK.format(DateUtils.addMonths(new Date(), -12)); | |
| 68 | + } | |
| 69 | + | |
| 70 | + Set<String> dateStrs = new HashSet<>(); | |
| 71 | + Date date = DateUtil.YYYY_MM_DD_LINK.parse(startDateStr + "-01"); | |
| 72 | + for (int i = 0; i < 1000; i++) { | |
| 73 | + String dateStr = DateUtil.YYYY_MM_LINK.format(DateUtils.addMonths(date, i)); | |
| 74 | + dateStrs.add(dateStr); | |
| 75 | + if (StringUtils.equals(dateStr, endDateStr)) { | |
| 76 | + break; | |
| 77 | + } | |
| 78 | + } | |
| 79 | + | |
| 80 | + | |
| 81 | + List<SignReportGroupByVo> vos = signReportServer.querySignReportGroupMonthByDateStr(dateStrs); | |
| 82 | + return ResponseResult.success(vos); | |
| 83 | + | |
| 84 | + } | |
| 85 | + | |
| 34 | 86 | } | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssCarInfoController.java
| ... | ... | @@ -37,7 +37,7 @@ public class DssCarInfoController { |
| 37 | 37 | |
| 38 | 38 | @GetMapping(value = "/device/getPlates") |
| 39 | 39 | @ApiOperation("模糊查询车辆车牌列表") |
| 40 | - public ResponseResult<Set<String>> getPlates(@Valid @RequestBody GetPlatesDTO dto, BindingResult bindingResult) { | |
| 40 | + public ResponseResult<Set<String>> getPlates(@Valid GetPlatesDTO dto, BindingResult bindingResult) { | |
| 41 | 41 | if (bindingResult.hasErrors()) { |
| 42 | 42 | return ResponseResult.error(bindingResult.getFieldError().getDefaultMessage()); |
| 43 | 43 | } |
| ... | ... | @@ -49,21 +49,21 @@ public class DssCarInfoController { |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | CarInfo carInfo = convertCarInfo(dto); |
| 52 | - if (StringUtils.isEmpty(carInfo.getPlateNum())) { | |
| 52 | + if (StringUtils.isEmpty(carInfo.getNbbm())) { | |
| 53 | 53 | return ResponseResult.success(); |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - List<CarInfo> carInfos = carInfoService.likePlateNumPlateNumTop30(carInfo); | |
| 56 | + List<CarInfo> carInfos = carInfoService.listLikeNbbs(carInfo); | |
| 57 | 57 | if (CollectionUtils.isEmpty(carInfos)) { |
| 58 | 58 | return ResponseResult.success(); |
| 59 | 59 | } |
| 60 | - Set<String> plateNums = carInfos.stream().map(CarInfo::getPlateNum).collect(Collectors.toSet()); | |
| 60 | + Set<String> plateNums = carInfos.stream().map(CarInfo::getNbbm).collect(Collectors.toSet()); | |
| 61 | 61 | return ResponseResult.success(plateNums); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | private CarInfo convertCarInfo(GetPlatesDTO dto) { |
| 65 | 65 | CarInfo carInfo = new CarInfo(); |
| 66 | - carInfo.setPlateNum(dto.getPlate()); | |
| 66 | + carInfo.setNbbm(dto.getPlate()); | |
| 67 | 67 | |
| 68 | 68 | return carInfo; |
| 69 | 69 | } | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/DssDriverController.java
| ... | ... | @@ -331,7 +331,7 @@ public class DssDriverController extends BaseController { |
| 331 | 331 | return ResponseResult.success(vos); |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | - @PostMapping(value = "Driver/UpLoadPicture") | |
| 334 | + @PostMapping(value = "/Driver/UpLoadPicture") | |
| 335 | 335 | @ApiOperation(value = "25.酒测照片上传") |
| 336 | 336 | public ResponseResult<Set<String>> UpLoadPicture(@Valid @RequestBody UpLoadPictureDTO dto, BindingResult bindingResult) { |
| 337 | 337 | if (bindingResult.hasErrors()) { | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/KeyBoxController.java
| ... | ... | @@ -125,7 +125,7 @@ public class KeyBoxController extends BaseController { |
| 125 | 125 | if (Objects.isNull(scheduling)) { |
| 126 | 126 | return ResponseResult.error(TipEnum.TIP_3.getCode(), TipEnum.TIP_3.getMsg()); |
| 127 | 127 | } |
| 128 | - LinggangKeyWorkLocation workLocation = queryKeyWorkLocation1(scheduling, dto); | |
| 128 | + LinggangKeyWorkLocation workLocation = queryKeyWorkLocation2(scheduling, dto); | |
| 129 | 129 | |
| 130 | 130 | CarInfo carInfo = queryCarInfo(scheduling.getNbbm()); |
| 131 | 131 | if (Objects.isNull(carInfo)) { |
| ... | ... | @@ -684,6 +684,53 @@ public class KeyBoxController extends BaseController { |
| 684 | 684 | // return linggangKeyWorkLocationService.getOne(workLocation); |
| 685 | 685 | } |
| 686 | 686 | |
| 687 | + /*** | |
| 688 | + * 根据排班时间和钥匙ID查询钥匙 | |
| 689 | + * @author liujun | |
| 690 | + * @date 2024/7/16 17:05 | |
| 691 | + * @param dto | |
| 692 | + * @return com.ruoyi.domain.key.location.LinggangKeyWorkLocation | |
| 693 | + */ | |
| 694 | + private LinggangKeyWorkLocation queryKeyWorkLocation2(LinggangScheduling scheduling, WorkPlateV2DTO dto) { | |
| 695 | + CarInfo carInfo = carInfoService.getOneByNbbm(scheduling.getNbbm()); | |
| 696 | + if (Objects.isNull(carInfo)) { | |
| 697 | + return null; | |
| 698 | + } | |
| 699 | + | |
| 700 | + List<KeyInfo> keyInfos = keyInfoService.listPlateNum(carInfo.getPlateNum()); | |
| 701 | + if (CollectionUtils.isEmpty(keyInfos)) { | |
| 702 | + return null; | |
| 703 | + } | |
| 704 | + | |
| 705 | + LinggangKeyWorkLocation workLocation = new LinggangKeyWorkLocation(); | |
| 706 | + workLocation.setKeyInfoId(keyInfos.get(0).getId()); | |
| 707 | + workLocation.setMaxCreateDate(dto.getTime()); | |
| 708 | + | |
| 709 | + List<LinggangKeyWorkLocation> lists = linggangKeyWorkLocationService.getTenByKeyIdAndTime(workLocation); | |
| 710 | + int size = CollectionUtils.size(lists); | |
| 711 | + if (0 == size) { | |
| 712 | + return null; | |
| 713 | + } else if (1 == size) { | |
| 714 | + LinggangKeyWorkLocation keyWorkLocation = lists.get(0); | |
| 715 | + return Objects.equals(keyWorkLocation.getType1(), 1) ? keyWorkLocation : null; | |
| 716 | + } | |
| 717 | + LinggangKeyWorkLocation keyWorkLocation2 = null; | |
| 718 | + for (int i = 0; i < size; i++) { | |
| 719 | + if (Objects.equals(lists.get(i).getType1(), 1)) { | |
| 720 | + return lists.get(i); | |
| 721 | + } else if (Objects.equals(lists.get(i).getType1(), 0)) { | |
| 722 | + //钥匙没有归还,返回空 | |
| 723 | + return null; | |
| 724 | + } | |
| 725 | + } | |
| 726 | + | |
| 727 | + | |
| 728 | + LinggangKeyWorkLocation keyWorkLocation = lists.get(0); | |
| 729 | + return Objects.equals(keyWorkLocation.getType1(), 1) ? keyWorkLocation : null; | |
| 730 | +// workLocation.setSchedulingId(scheduling.getId()); | |
| 731 | +// return linggangKeyWorkLocationService.getOne(workLocation); | |
| 732 | + } | |
| 733 | + | |
| 687 | 734 | |
| 688 | 735 | private LinggangKeyWorkLocation queryKeyWorkLocation1(LinggangScheduling scheduling, WorkPlateV2DTO dto) { |
| 689 | 736 | CarInfo carInfo = carInfoService.getOneByNbbm(scheduling.getNbbm()); |
| ... | ... | @@ -784,20 +831,22 @@ public class KeyBoxController extends BaseController { |
| 784 | 831 | private WorkPlateV2Vo convertWorkPlateV2Vo(LinggangScheduling scheduling, LinggangKeyWorkLocation workLocation, KeyInfo keyInfo, CarInfo carInfo, |
| 785 | 832 | Equipment equipment, LinggangVenueInfo venueInfo) { |
| 786 | 833 | WorkPlateV2Vo vo = new WorkPlateV2Vo(); |
| 834 | + | |
| 787 | 835 | if (Objects.nonNull(venueInfo)) { |
| 788 | 836 | vo.setYardId(Convert.toStr(venueInfo.getId())); |
| 789 | 837 | vo.setYardName(venueInfo.getName()); |
| 790 | 838 | } |
| 791 | 839 | |
| 792 | - if (Objects.nonNull(equipment)) { | |
| 793 | - vo.setDeviceName(equipment.getName()); | |
| 794 | - vo.setDevice(equipment.getDeviceId()); | |
| 795 | - } | |
| 840 | + | |
| 796 | 841 | // vo.setYardName(keyInfo.getY) |
| 797 | 842 | |
| 798 | 843 | if (Objects.nonNull(workLocation)) { |
| 799 | 844 | vo.setDevice(workLocation.getDevice()); |
| 800 | 845 | vo.setCabinetNo(workLocation.getCabinetNo()); |
| 846 | + | |
| 847 | + if (Objects.nonNull(equipment)) { | |
| 848 | + vo.setDeviceName(equipment.getName()); | |
| 849 | + } | |
| 801 | 850 | } |
| 802 | 851 | vo.setPlateNum(carInfo.getNbbm()); |
| 803 | 852 | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/controller/dss/LansiAppLogController.java
0 → 100644
| 1 | +package com.ruoyi.controller.dss; | |
| 2 | + | |
| 3 | +import com.ruoyi.common.core.controller.BaseController; | |
| 4 | +import com.ruoyi.common.core.domain.ResponseResult; | |
| 5 | +import com.ruoyi.domain.dss2.log.EquipmengLogDTO; | |
| 6 | +import com.ruoyi.equipment.domain.Equipment; | |
| 7 | +import com.ruoyi.equipment.service.IEquipmentService; | |
| 8 | +import io.swagger.annotations.Api; | |
| 9 | +import io.swagger.annotations.ApiOperation; | |
| 10 | +import lombok.extern.slf4j.Slf4j; | |
| 11 | +import org.apache.commons.collections4.CollectionUtils; | |
| 12 | +import org.apache.commons.lang3.StringUtils; | |
| 13 | +import org.slf4j.Logger; | |
| 14 | +import org.slf4j.LoggerFactory; | |
| 15 | +import org.springframework.web.bind.annotation.PostMapping; | |
| 16 | +import org.springframework.web.bind.annotation.RequestBody; | |
| 17 | +import org.springframework.web.bind.annotation.RequestMapping; | |
| 18 | +import org.springframework.web.bind.annotation.RestController; | |
| 19 | + | |
| 20 | +import java.util.HashMap; | |
| 21 | +import java.util.List; | |
| 22 | +import java.util.Map; | |
| 23 | +import java.util.Objects; | |
| 24 | + | |
| 25 | +@RestController | |
| 26 | +@Slf4j | |
| 27 | +@RequestMapping("/dss") | |
| 28 | +@Api(tags = "【蓝斯二期】蓝斯设备日志") | |
| 29 | +public class LansiAppLogController extends BaseController { | |
| 30 | + | |
| 31 | + private final static Map<String, Logger> LOGGER_MAP = new HashMap<>(); | |
| 32 | + | |
| 33 | + public LansiAppLogController(IEquipmentService equipmentService) { | |
| 34 | + List<Equipment> equipmentList = equipmentService.list(); | |
| 35 | + int size = CollectionUtils.size(equipmentList); | |
| 36 | + for (int i = 0; i < size; i++) { | |
| 37 | + String name = StringUtils.join("lansi:", equipmentList.get(i).getDeviceId()); | |
| 38 | + LOGGER_MAP.put(equipmentList.get(i).getDeviceId(), LoggerFactory.getLogger(name)); | |
| 39 | + } | |
| 40 | + } | |
| 41 | + | |
| 42 | + @ApiOperation(value = "设备日志") | |
| 43 | + @PostMapping("/equipment/log") | |
| 44 | + public ResponseResult<Boolean> createLog(@RequestBody EquipmengLogDTO equipmengLogDTO) { | |
| 45 | + | |
| 46 | + Logger logger = LOGGER_MAP.get(equipmengLogDTO.getDevice()); | |
| 47 | + if (Objects.isNull(logger)) { | |
| 48 | + String name = StringUtils.join("lansi:", equipmengLogDTO.getDevice()); | |
| 49 | + logger = LoggerFactory.getLogger(name); | |
| 50 | + LOGGER_MAP.put(equipmengLogDTO.getDevice(), logger); | |
| 51 | + | |
| 52 | + } | |
| 53 | + logger.info("[{}]", equipmengLogDTO); | |
| 54 | + return ResponseResult.success(Boolean.TRUE); | |
| 55 | + } | |
| 56 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/domain/dss/app/entity/SignReportGroupByDay.java
0 → 100644
| 1 | +package com.ruoyi.domain.dss.app.entity; | |
| 2 | + | |
| 3 | + | |
| 4 | +import lombok.Data; | |
| 5 | +import lombok.EqualsAndHashCode; | |
| 6 | +import lombok.experimental.Accessors; | |
| 7 | + | |
| 8 | +@Data | |
| 9 | +@Accessors(chain = true) | |
| 10 | +@EqualsAndHashCode(callSuper = false) | |
| 11 | +public class SignReportGroupByDay { | |
| 12 | + private String jobCode; | |
| 13 | + private String dateStr; | |
| 14 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/domain/dss/app/vo/SignReportGroupByVo.java
0 → 100644
| 1 | +package com.ruoyi.domain.dss.app.vo; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.AllArgsConstructor; | |
| 6 | +import lombok.Data; | |
| 7 | +import lombok.NoArgsConstructor; | |
| 8 | +import lombok.experimental.Accessors; | |
| 9 | + | |
| 10 | +@Data | |
| 11 | +@NoArgsConstructor | |
| 12 | +@AllArgsConstructor | |
| 13 | +@ApiModel(value = "App对接签到每天汇总信息") | |
| 14 | +@Accessors(chain = true) | |
| 15 | +public class SignReportGroupByVo implements java.io.Serializable { | |
| 16 | + @ApiModelProperty(value = "酒驾人数") | |
| 17 | + private Integer alcoholNum=0; | |
| 18 | + @ApiModelProperty(value = "早签人数") | |
| 19 | + private Integer earlySigning=0; | |
| 20 | + @ApiModelProperty(value = "晚签人数") | |
| 21 | + private Integer lateSigning=0; | |
| 22 | + @ApiModelProperty(value = "正常签到人数") | |
| 23 | + private Integer normalSigning=0; | |
| 24 | + | |
| 25 | + @ApiModelProperty(value = "日期") | |
| 26 | + private String dateStr; | |
| 27 | + | |
| 28 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/domain/sign/in/summary/SignReportDaySummary.java
0 → 100644
| 1 | +package com.ruoyi.domain.sign.in.summary; | |
| 2 | + | |
| 3 | +import lombok.Data; | |
| 4 | +import com.baomidou.mybatisplus.annotation.IdType; | |
| 5 | +import com.baomidou.mybatisplus.annotation.TableField; | |
| 6 | +import com.baomidou.mybatisplus.annotation.TableId; | |
| 7 | +import com.baomidou.mybatisplus.annotation.TableName; | |
| 8 | +import org.apache.commons.lang3.StringUtils; | |
| 9 | +import lombok.EqualsAndHashCode; | |
| 10 | +import lombok.experimental.Accessors; | |
| 11 | +import lombok.extern.slf4j.Slf4j; | |
| 12 | +import lombok.NoArgsConstructor; | |
| 13 | +import lombok.AllArgsConstructor; | |
| 14 | +import com.ruoyi.common.annotation.Excel; | |
| 15 | + | |
| 16 | + | |
| 17 | +@Data | |
| 18 | +@Slf4j | |
| 19 | +@NoArgsConstructor | |
| 20 | +@AllArgsConstructor | |
| 21 | +@Accessors(chain = true) | |
| 22 | +@EqualsAndHashCode(callSuper = false) | |
| 23 | +@TableName("sign_report_day_summary") | |
| 24 | +/**签到汇总表 实体*/ public class SignReportDaySummary { | |
| 25 | + /***ID*/ | |
| 26 | + @TableId(value = "id", type = IdType.AUTO) | |
| 27 | + @Excel(name = "ID") | |
| 28 | + private Integer id; | |
| 29 | + | |
| 30 | + | |
| 31 | + /***日期 格式为:yyyy-MM-dd*/ | |
| 32 | + @Excel(name = "日期 格式为:yyyy-MM-dd") | |
| 33 | + private String datestr; | |
| 34 | + | |
| 35 | + | |
| 36 | + /***酒驾人数*/ | |
| 37 | + @Excel(name = "酒驾人数") | |
| 38 | + private Integer alcoholNum; | |
| 39 | + | |
| 40 | + | |
| 41 | + /***早签人数*/ | |
| 42 | + @Excel(name = "早签人数") | |
| 43 | + private Integer earlySigning; | |
| 44 | + | |
| 45 | + | |
| 46 | + /***晚签人数*/ | |
| 47 | + @Excel(name = "晚签人数") | |
| 48 | + private Integer lateSigning; | |
| 49 | + | |
| 50 | + | |
| 51 | + /***正常签到人数*/ | |
| 52 | + @Excel(name = "正常签到人数") | |
| 53 | + private Integer normalSigning; | |
| 54 | + | |
| 55 | + | |
| 56 | + @Override | |
| 57 | + public String toString() { | |
| 58 | + return com.alibaba.fastjson2.JSON.toJSONString(this); | |
| 59 | + } | |
| 60 | +} | |
| 0 | 61 | \ No newline at end of file | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/domain/sign/in/summary/dto/SignReportDaySummaryAddDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.sign.in.summary.dto; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.EqualsAndHashCode; | |
| 7 | +import lombok.experimental.Accessors; | |
| 8 | + | |
| 9 | +@Data | |
| 10 | +@ApiModel(value = "签到汇总表的添加DTO") | |
| 11 | +@Accessors(chain = true) | |
| 12 | +@EqualsAndHashCode(callSuper = false) | |
| 13 | +/**签到汇总表 DTO*/ | |
| 14 | +public class SignReportDaySummaryAddDTO implements java.io.Serializable { | |
| 15 | + private static final long serialVersionUID = 975898577L; | |
| 16 | + | |
| 17 | + /***ID*/ | |
| 18 | + @ApiModelProperty(value = "ID", example = "1") | |
| 19 | + private Integer id; | |
| 20 | + /***日期 格式为:yyyy-MM-dd*/ | |
| 21 | + @ApiModelProperty(value = "日期 格式为:yyyy-MM-dd") | |
| 22 | + private String datestr; | |
| 23 | + /***酒驾人数*/ | |
| 24 | + @ApiModelProperty(value = "酒驾人数", example = "1") | |
| 25 | + private Integer alcoholNum; | |
| 26 | + /***早签人数*/ | |
| 27 | + @ApiModelProperty(value = "早签人数", example = "1") | |
| 28 | + private Integer earlySigning; | |
| 29 | + /***晚签人数*/ | |
| 30 | + @ApiModelProperty(value = "晚签人数", example = "1") | |
| 31 | + private Integer lateSigning; | |
| 32 | + /***正常签到人数*/ | |
| 33 | + @ApiModelProperty(value = "正常签到人数", example = "1") | |
| 34 | + private Integer normalSigning; | |
| 35 | + /***操作人员*/ | |
| 36 | + @ApiModelProperty(value = "操作人员") | |
| 37 | + private String operator; | |
| 38 | + | |
| 39 | + | |
| 40 | + public void clearStrEmpty() { | |
| 41 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.datestr)) { | |
| 42 | + this.datestr = null; | |
| 43 | + } | |
| 44 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.operator)) { | |
| 45 | + this.operator = null; | |
| 46 | + } | |
| 47 | + } | |
| 48 | + | |
| 49 | + | |
| 50 | + @Override | |
| 51 | + public String toString() { | |
| 52 | + return com.alibaba.fastjson2.JSON.toJSONString(this); | |
| 53 | + } | |
| 54 | +} | |
| 0 | 55 | \ No newline at end of file | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/domain/sign/in/summary/dto/SignReportDaySummaryQueryDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.sign.in.summary.dto; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.EqualsAndHashCode; | |
| 7 | +import lombok.experimental.Accessors; | |
| 8 | + | |
| 9 | +@Data | |
| 10 | +@ApiModel(value = "签到汇总表的查询DTO") | |
| 11 | +@Accessors(chain = true) | |
| 12 | +@EqualsAndHashCode(callSuper = false) | |
| 13 | +/**签到汇总表 DTO*/ | |
| 14 | +public class SignReportDaySummaryQueryDTO implements java.io.Serializable { | |
| 15 | + private static final long serialVersionUID = 339131034L; | |
| 16 | + | |
| 17 | + /***ID*/ | |
| 18 | + @ApiModelProperty(value = "ID", example = "1") | |
| 19 | + private Integer id; | |
| 20 | + /***日期 格式为:yyyy-MM-dd*/ | |
| 21 | + @ApiModelProperty(value = "日期 格式为:yyyy-MM-dd") | |
| 22 | + private String datestr; | |
| 23 | + /***酒驾人数*/ | |
| 24 | + @ApiModelProperty(value = "酒驾人数", example = "1") | |
| 25 | + private Integer alcoholNum; | |
| 26 | + /***早签人数*/ | |
| 27 | + @ApiModelProperty(value = "早签人数", example = "1") | |
| 28 | + private Integer earlySigning; | |
| 29 | + /***晚签人数*/ | |
| 30 | + @ApiModelProperty(value = "晚签人数", example = "1") | |
| 31 | + private Integer lateSigning; | |
| 32 | + /***正常签到人数*/ | |
| 33 | + @ApiModelProperty(value = "正常签到人数", example = "1") | |
| 34 | + private Integer normalSigning; | |
| 35 | + | |
| 36 | + | |
| 37 | + public void clearStrEmpty() { | |
| 38 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.datestr)) { | |
| 39 | + this.datestr = null; | |
| 40 | + } | |
| 41 | + } | |
| 42 | + | |
| 43 | + | |
| 44 | + @Override | |
| 45 | + public String toString() { | |
| 46 | + return com.alibaba.fastjson2.JSON.toJSONString(this); | |
| 47 | + } | |
| 48 | +} | |
| 0 | 49 | \ No newline at end of file | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/domain/sign/in/summary/dto/SignReportDaySummaryUpdateDTO.java
0 → 100644
| 1 | +package com.ruoyi.domain.sign.in.summary.dto; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | +import lombok.Data; | |
| 6 | +import lombok.EqualsAndHashCode; | |
| 7 | +import lombok.experimental.Accessors; | |
| 8 | + | |
| 9 | +@Data | |
| 10 | +@ApiModel(value = "签到汇总表的修改DTO") | |
| 11 | +@Accessors(chain = true) | |
| 12 | +@EqualsAndHashCode(callSuper = false) | |
| 13 | +/**签到汇总表 DTO*/ | |
| 14 | +public class SignReportDaySummaryUpdateDTO implements java.io.Serializable { | |
| 15 | + private static final long serialVersionUID = 390073400L; | |
| 16 | + | |
| 17 | + /***ID*/ | |
| 18 | + @ApiModelProperty(value = "ID", example = "1") | |
| 19 | + private Integer id; | |
| 20 | + /***日期 格式为:yyyy-MM-dd*/ | |
| 21 | + @ApiModelProperty(value = "日期 格式为:yyyy-MM-dd") | |
| 22 | + private String datestr; | |
| 23 | + /***酒驾人数*/ | |
| 24 | + @ApiModelProperty(value = "酒驾人数", example = "1") | |
| 25 | + private Integer alcoholNum; | |
| 26 | + /***早签人数*/ | |
| 27 | + @ApiModelProperty(value = "早签人数", example = "1") | |
| 28 | + private Integer earlySigning; | |
| 29 | + /***晚签人数*/ | |
| 30 | + @ApiModelProperty(value = "晚签人数", example = "1") | |
| 31 | + private Integer lateSigning; | |
| 32 | + /***正常签到人数*/ | |
| 33 | + @ApiModelProperty(value = "正常签到人数", example = "1") | |
| 34 | + private Integer normalSigning; | |
| 35 | + /***操作人员*/ | |
| 36 | + @ApiModelProperty(value = "操作人员") | |
| 37 | + private String operator; | |
| 38 | + | |
| 39 | + | |
| 40 | + public void clearStrEmpty() { | |
| 41 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.datestr)) { | |
| 42 | + this.datestr = null; | |
| 43 | + } | |
| 44 | + if (org.apache.commons.lang3.StringUtils.isEmpty(this.operator)) { | |
| 45 | + this.operator = null; | |
| 46 | + } | |
| 47 | + } | |
| 48 | + | |
| 49 | + | |
| 50 | + @Override | |
| 51 | + public String toString() { | |
| 52 | + return com.alibaba.fastjson2.JSON.toJSONString(this); | |
| 53 | + } | |
| 54 | +} | |
| 0 | 55 | \ No newline at end of file | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/domain/sign/in/summary/vo/SignReportDaySummaryVO.java
0 → 100644
| 1 | +package com.ruoyi.domain.sign.in.summary.vo; | |
| 2 | + | |
| 3 | +import io.swagger.annotations.ApiModel; | |
| 4 | +import io.swagger.annotations.ApiModelProperty; | |
| 5 | + | |
| 6 | +import lombok.Data; | |
| 7 | +import lombok.EqualsAndHashCode; | |
| 8 | +import lombok.experimental.Accessors; | |
| 9 | +import lombok.NoArgsConstructor; | |
| 10 | +import lombok.AllArgsConstructor; | |
| 11 | + | |
| 12 | +@Data | |
| 13 | +@NoArgsConstructor | |
| 14 | +@AllArgsConstructor | |
| 15 | +@ApiModel(value = "签到汇总表的VO") | |
| 16 | +@Accessors(chain = true) | |
| 17 | +@EqualsAndHashCode(callSuper = false) | |
| 18 | +/**签到汇总表 VO*/ | |
| 19 | +public class SignReportDaySummaryVO implements java.io.Serializable { | |
| 20 | + private static final long serialVersionUID = 298123219L; | |
| 21 | + | |
| 22 | + /***ID*/ | |
| 23 | + @ApiModelProperty(value = "ID", example = "1") | |
| 24 | + private Integer id; | |
| 25 | + /***日期 格式为:yyyy-MM-dd*/ | |
| 26 | + @ApiModelProperty(value = "日期 格式为:yyyy-MM-dd") | |
| 27 | + private String datestr; | |
| 28 | + /***酒驾人数*/ | |
| 29 | + @ApiModelProperty(value = "酒驾人数", example = "1") | |
| 30 | + private Integer alcoholNum; | |
| 31 | + /***早签人数*/ | |
| 32 | + @ApiModelProperty(value = "早签人数", example = "1") | |
| 33 | + private Integer earlySigning; | |
| 34 | + /***晚签人数*/ | |
| 35 | + @ApiModelProperty(value = "晚签人数", example = "1") | |
| 36 | + private Integer lateSigning; | |
| 37 | + /***正常签到人数*/ | |
| 38 | + @ApiModelProperty(value = "正常签到人数", example = "1") | |
| 39 | + private Integer normalSigning; | |
| 40 | + | |
| 41 | + | |
| 42 | + @Override | |
| 43 | + public String toString() { | |
| 44 | + return com.alibaba.fastjson2.JSON.toJSONString(this); | |
| 45 | + } | |
| 46 | +} | |
| 0 | 47 | \ No newline at end of file | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/job/SignReportSummerJob.java
0 → 100644
| 1 | +package com.ruoyi.job; | |
| 2 | + | |
| 3 | +import com.ruoyi.domain.dss.app.vo.SignReportGroupByVo; | |
| 4 | +import com.ruoyi.domain.sign.in.summary.SignReportDaySummary; | |
| 5 | +import com.ruoyi.service.SignReportServer; | |
| 6 | +import com.ruoyi.service.sign.in.summary.SignReportDaySummaryService; | |
| 7 | +import com.ruoyi.utils.DateUtil; | |
| 8 | +import lombok.extern.slf4j.Slf4j; | |
| 9 | +import org.apache.commons.collections4.CollectionUtils; | |
| 10 | +import org.apache.commons.lang3.StringUtils; | |
| 11 | +import org.apache.commons.lang3.time.DateUtils; | |
| 12 | +import org.springframework.beans.BeanUtils; | |
| 13 | +import org.springframework.beans.factory.InitializingBean; | |
| 14 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 15 | +import org.springframework.stereotype.Component; | |
| 16 | + | |
| 17 | +import java.text.ParseException; | |
| 18 | +import java.util.Date; | |
| 19 | +import java.util.List; | |
| 20 | +import java.util.Set; | |
| 21 | +import java.util.stream.Collectors; | |
| 22 | + | |
| 23 | +@Slf4j | |
| 24 | +@Component("SignReportSummerJob") | |
| 25 | +public class SignReportSummerJob implements InitializingBean { | |
| 26 | + @Autowired | |
| 27 | + private SignReportServer signReportServer; | |
| 28 | + @Autowired | |
| 29 | + private SignReportDaySummaryService signReportDaySummaryService; | |
| 30 | + | |
| 31 | + public void calSignReportSummary() throws ParseException { | |
| 32 | + Date date = new Date(); | |
| 33 | + String dateStr = DateUtil.YYYY_MM_LINK.format(DateUtils.addDays(date, -1)); | |
| 34 | + List<SignReportGroupByVo> signReportGroupByVos = signReportServer.querySignReportGroupByDateStrVo(dateStr); | |
| 35 | + | |
| 36 | + if (CollectionUtils.isNotEmpty(signReportGroupByVos)) { | |
| 37 | + List<SignReportGroupByVo> voList = signReportGroupByVos.stream().filter(s -> StringUtils.equals(s.getDateStr(), dateStr)).collect(Collectors.toList()); | |
| 38 | + | |
| 39 | + if (CollectionUtils.isNotEmpty(voList)) { | |
| 40 | + SignReportDaySummary summary = new SignReportDaySummary(); | |
| 41 | + summary.setDatestr(dateStr); | |
| 42 | + | |
| 43 | + List<SignReportDaySummary> summaries = signReportDaySummaryService.list(summary); | |
| 44 | + if (CollectionUtils.isNotEmpty(summaries)) { | |
| 45 | + Set<Integer> ids = summaries.stream().map(SignReportDaySummary::getId).collect(Collectors.toSet()); | |
| 46 | + signReportDaySummaryService.removeByIds(ids); | |
| 47 | + } | |
| 48 | + for (SignReportGroupByVo vo : voList) { | |
| 49 | + BeanUtils.copyProperties(vo, summary); | |
| 50 | + try { | |
| 51 | + signReportDaySummaryService.save(summary); | |
| 52 | + } catch (Exception e) { | |
| 53 | + log.error("保存签到汇总异常:[{}]", dateStr, e); | |
| 54 | + } | |
| 55 | + } | |
| 56 | + } | |
| 57 | + } | |
| 58 | + } | |
| 59 | + | |
| 60 | + @Override | |
| 61 | + public void afterPropertiesSet() throws Exception { | |
| 62 | + | |
| 63 | + } | |
| 64 | +} | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/mapper/SignReportMappper.java
| 1 | 1 | package com.ruoyi.mapper; |
| 2 | 2 | |
| 3 | 3 | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| 4 | +import com.ruoyi.domain.dss.app.entity.SignReportGroupByDay; | |
| 5 | +import com.ruoyi.domain.dss.app.vo.SignReportGroupByVo; | |
| 4 | 6 | import com.ruoyi.domain.dss.app.vo.SignReportVo; |
| 5 | 7 | import org.apache.ibatis.annotations.Mapper; |
| 6 | 8 | import org.apache.ibatis.annotations.Param; |
| 7 | 9 | |
| 10 | +import java.util.Collection; | |
| 11 | +import java.util.List; | |
| 12 | + | |
| 8 | 13 | @Mapper |
| 9 | 14 | public interface SignReportMappper extends BaseMapper<SignReportVo> { |
| 10 | 15 | SignReportVo querySignReport(@Param("dateStr") String dateStr); |
| 16 | + | |
| 17 | + List<SignReportGroupByDay> querySignReportGroupByDayOfError(@Param("dateStr") String dateStr, @Param("startVal") Integer startVal, @Param("endVal") Integer endVal,@Param("alcoholVal") Integer alcoholVal); | |
| 18 | + | |
| 19 | + List<SignReportGroupByDay> querySignReportAlcoholGroupByDay(@Param("dateStr") String dateStr); | |
| 20 | + | |
| 21 | + List<SignReportGroupByVo> querySignReportAlcoholMonthGroupByDay(@Param("dateStrs") Collection<String> dateStrs); | |
| 11 | 22 | } | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/mapper/sign/in/summary/SignReportDaySummaryMapper.java
0 → 100644
| 1 | +package com.ruoyi.mapper.sign.in.summary; | |
| 2 | + | |
| 3 | +import com.ruoyi.domain.sign.in.summary.SignReportDaySummary; | |
| 4 | +import org.apache.ibatis.annotations.Mapper; | |
| 5 | +import com.baomidou.mybatisplus.core.mapper.BaseMapper; | |
| 6 | + | |
| 7 | + | |
| 8 | +@Mapper | |
| 9 | +/**签到汇总表 Mapper接口*/ | |
| 10 | +public interface SignReportDaySummaryMapper extends BaseMapper<SignReportDaySummary> { | |
| 11 | + /** | |
| 12 | + * 插入有值的列 | |
| 13 | + */ | |
| 14 | + int insertSelective(SignReportDaySummary name); | |
| 15 | +} | |
| 0 | 16 | \ No newline at end of file | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/SignReportServer.java
| 1 | 1 | package com.ruoyi.service; |
| 2 | 2 | |
| 3 | +import com.ruoyi.domain.dss.app.vo.SignReportGroupByVo; | |
| 3 | 4 | import com.ruoyi.domain.dss.app.vo.SignReportVo; |
| 4 | 5 | |
| 6 | +import java.text.ParseException; | |
| 7 | +import java.util.Collection; | |
| 8 | +import java.util.List; | |
| 9 | + | |
| 5 | 10 | public interface SignReportServer { |
| 6 | 11 | |
| 7 | 12 | SignReportVo querySignReportVo(String dateStr); |
| 13 | + | |
| 14 | + List<SignReportGroupByVo> querySignReportGroupByDateStrVo(String dateStr) throws ParseException; | |
| 15 | + | |
| 16 | + List<SignReportGroupByVo> querySignReportGroupMonthByDateStr(Collection<String> dateStrs); | |
| 8 | 17 | } | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/impl/SignReportServerImpl.java
| 1 | 1 | package com.ruoyi.service.impl; |
| 2 | 2 | |
| 3 | +import cn.hutool.core.convert.Convert; | |
| 4 | +import com.ruoyi.domain.dss.app.entity.SignReportGroupByDay; | |
| 3 | 5 | import com.ruoyi.domain.dss.app.vo.SignEquipmentVo; |
| 6 | +import com.ruoyi.domain.dss.app.vo.SignReportGroupByVo; | |
| 4 | 7 | import com.ruoyi.domain.dss.app.vo.SignReportVo; |
| 5 | 8 | import com.ruoyi.equipment.domain.Equipment; |
| 6 | 9 | import com.ruoyi.equipment.service.IEquipmentService; |
| 7 | 10 | import com.ruoyi.mapper.SignReportMappper; |
| 8 | 11 | import com.ruoyi.service.SignReportServer; |
| 12 | +import com.ruoyi.utils.DateUtil; | |
| 13 | +import org.apache.commons.lang3.StringUtils; | |
| 9 | 14 | import org.springframework.stereotype.Service; |
| 10 | 15 | import org.apache.commons.collections4.CollectionUtils; |
| 11 | 16 | import org.springframework.beans.factory.annotation.Autowired; |
| 12 | 17 | |
| 13 | -import java.util.List; | |
| 18 | +import java.text.ParseException; | |
| 19 | +import java.util.*; | |
| 14 | 20 | import java.util.stream.Collectors; |
| 15 | 21 | |
| 16 | 22 | @Service |
| ... | ... | @@ -36,4 +42,99 @@ public class SignReportServerImpl implements SignReportServer { |
| 36 | 42 | } |
| 37 | 43 | return reportVo; |
| 38 | 44 | } |
| 45 | + | |
| 46 | + @Override | |
| 47 | + public List<SignReportGroupByVo> querySignReportGroupByDateStrVo(String dateStr) throws ParseException { | |
| 48 | + //酒驾 | |
| 49 | + List<SignReportGroupByDay> alcoholList = signReportMappper.querySignReportAlcoholGroupByDay(dateStr); | |
| 50 | + List<SignReportGroupByDay> lateSigningList = signReportMappper.querySignReportGroupByDayOfError(dateStr, 30, 39, 33); | |
| 51 | + List<SignReportGroupByDay> earlySigningList = signReportMappper.querySignReportGroupByDayOfError(dateStr, 20, 29, 23); | |
| 52 | + List<SignReportGroupByDay> normalSigningList = signReportMappper.querySignReportGroupByDayOfError(dateStr, 0, 0, 3); | |
| 53 | + | |
| 54 | + int alcoholSize = CollectionUtils.size(alcoholList); | |
| 55 | + int lastSignSize = CollectionUtils.size(lateSigningList); | |
| 56 | + int earlySignSize = CollectionUtils.size(earlySigningList); | |
| 57 | + int normalSignSize = CollectionUtils.size(normalSigningList); | |
| 58 | + | |
| 59 | + if (earlySignSize > 0) { | |
| 60 | + earlySigningList = earlySigningList.stream().filter(l -> !equals(l, alcoholList, alcoholSize)).collect(Collectors.toList()); | |
| 61 | + earlySignSize = CollectionUtils.size(earlySigningList); | |
| 62 | + } | |
| 63 | + | |
| 64 | + int esSize = earlySignSize; | |
| 65 | + List<SignReportGroupByDay> esList = earlySigningList; | |
| 66 | + | |
| 67 | + if (lastSignSize > 0) { | |
| 68 | + lateSigningList = lateSigningList.stream().filter(l -> !equals(l, alcoholList, alcoholSize)).collect(Collectors.toList()); | |
| 69 | + lateSigningList = lateSigningList.stream().filter(l -> !equals(l, esList, esSize)).collect(Collectors.toList()); | |
| 70 | + lastSignSize = CollectionUtils.size(lateSigningList); | |
| 71 | + } | |
| 72 | + | |
| 73 | + int lsSize = lastSignSize; | |
| 74 | + List<SignReportGroupByDay> lsList = lateSigningList; | |
| 75 | + if (normalSignSize > 0) { | |
| 76 | + normalSigningList = normalSigningList.stream().filter(l -> !equals(l, alcoholList, alcoholSize)).collect(Collectors.toList()); | |
| 77 | + normalSigningList = normalSigningList.stream().filter(l -> !equals(l, esList, esSize)).collect(Collectors.toList()); | |
| 78 | + normalSigningList = normalSigningList.stream().filter(l -> !equals(l, lsList, lsSize)).collect(Collectors.toList()); | |
| 79 | + | |
| 80 | + normalSignSize = CollectionUtils.size(normalSigningList); | |
| 81 | + } | |
| 82 | + | |
| 83 | + String dateStr1 = dateStr + "-01"; | |
| 84 | + Date date = DateUtil.YYYY_MM_DD_LINK.parse(dateStr1); | |
| 85 | + Calendar cal = Calendar.getInstance(); | |
| 86 | + cal.setTime(date); | |
| 87 | + int last = cal.getActualMaximum(Calendar.DAY_OF_MONTH); | |
| 88 | + List<SignReportGroupByVo> signReportGroupByVos = new ArrayList<>(); | |
| 89 | + for (int i = 1; i <= last; i++) { | |
| 90 | + if (i < 10) { | |
| 91 | + dateStr1 = StringUtils.join(dateStr, "-0", i); | |
| 92 | + } else { | |
| 93 | + dateStr1 = StringUtils.join(dateStr, "-", i); | |
| 94 | + } | |
| 95 | + | |
| 96 | + SignReportGroupByVo vo = new SignReportGroupByVo(); | |
| 97 | + vo.setDateStr(dateStr1); | |
| 98 | + | |
| 99 | + | |
| 100 | + if (esSize > 0) { | |
| 101 | + long count = esList.stream().filter(el -> Objects.equals(el.getDateStr(), vo.getDateStr())).count(); | |
| 102 | + vo.setEarlySigning(Convert.toInt(count)); | |
| 103 | + } | |
| 104 | + | |
| 105 | + if (lsSize > 0) { | |
| 106 | + long count = lsList.stream().filter(ls -> Objects.equals(ls.getDateStr(), vo.getDateStr())).count(); | |
| 107 | + vo.setLateSigning(Convert.toInt(count)); | |
| 108 | + } | |
| 109 | + | |
| 110 | + if (alcoholSize > 0) { | |
| 111 | + long count = alcoholList.stream().filter(al -> Objects.equals(al.getDateStr(), vo.getDateStr())).count(); | |
| 112 | + vo.setAlcoholNum(Convert.toInt(count)); | |
| 113 | + } | |
| 114 | + | |
| 115 | + if (normalSignSize > 0) { | |
| 116 | + long count = normalSigningList.stream().filter(nl -> Objects.equals(nl.getDateStr(), vo.getDateStr())).count(); | |
| 117 | + vo.setNormalSigning(Convert.toInt(count)); | |
| 118 | + } | |
| 119 | + signReportGroupByVos.add(vo); | |
| 120 | + | |
| 121 | + } | |
| 122 | + | |
| 123 | + return signReportGroupByVos; | |
| 124 | + } | |
| 125 | + | |
| 126 | + @Override | |
| 127 | + public List<SignReportGroupByVo> querySignReportGroupMonthByDateStr(Collection<String> dateStrs) { | |
| 128 | + if (CollectionUtils.isEmpty(dateStrs)) { | |
| 129 | + return Collections.emptyList(); | |
| 130 | + } | |
| 131 | + return signReportMappper.querySignReportAlcoholMonthGroupByDay(dateStrs); | |
| 132 | + } | |
| 133 | + | |
| 134 | + private boolean equals(SignReportGroupByDay srd, List<SignReportGroupByDay> list, int listSize) { | |
| 135 | + if (0 == listSize) { | |
| 136 | + return true; | |
| 137 | + } | |
| 138 | + return list.stream().anyMatch(l -> (Objects.equals(srd.getJobCode(), l.getJobCode()) && Objects.equals(srd.getDateStr(), l.getDateStr()))); | |
| 139 | + } | |
| 39 | 140 | } | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/sign/in/summary/SignReportDaySummaryService.java
0 → 100644
| 1 | +package com.ruoyi.service.sign.in.summary; | |
| 2 | + | |
| 3 | +import com.baomidou.mybatisplus.extension.service.IService; | |
| 4 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
| 5 | + | |
| 6 | +import java.util.List; | |
| 7 | + | |
| 8 | +import com.ruoyi.domain.OrderEntity; | |
| 9 | +import com.ruoyi.domain.sign.in.summary.SignReportDaySummary; | |
| 10 | + | |
| 11 | + | |
| 12 | +/** | |
| 13 | + * 签到汇总表 Service接口 | |
| 14 | + */ | |
| 15 | +public interface SignReportDaySummaryService extends IService<SignReportDaySummary> { | |
| 16 | + /** | |
| 17 | + * 分页查询 | |
| 18 | + */ | |
| 19 | + IPage<SignReportDaySummary> pageList(com.baomidou.mybatisplus.extension.plugins.pagination.Page<SignReportDaySummary> page, SignReportDaySummary entity, OrderEntity orderEntity); | |
| 20 | + | |
| 21 | + /** | |
| 22 | + * 带条件查询 | |
| 23 | + */ | |
| 24 | + List<SignReportDaySummary> list(SignReportDaySummary entity); | |
| 25 | + | |
| 26 | + // List<SignReportDaySummary> listOfIds(java.util.Collection<java.lang.Integer> ids); | |
| 27 | + // /*** | |
| 28 | + // *用于页面选择 | |
| 29 | + // */ | |
| 30 | + // List<SignReportDaySummary> listOfSelect(SignReportDaySummary entity); | |
| 31 | + | |
| 32 | + /** | |
| 33 | + * 条件查询只返回一条数据的方法 | |
| 34 | + */ | |
| 35 | + SignReportDaySummary getOne(SignReportDaySummary entity); | |
| 36 | + | |
| 37 | + Integer countId(SignReportDaySummary entity); | |
| 38 | + | |
| 39 | + /** | |
| 40 | + * 插入有值的列 | |
| 41 | + */ | |
| 42 | + int insertSelective(SignReportDaySummary entity); | |
| 43 | + | |
| 44 | + /***插入数据*/ | |
| 45 | + boolean insert(SignReportDaySummary entity); | |
| 46 | + | |
| 47 | + /** | |
| 48 | + * 根据主键修改数据 | |
| 49 | + */ | |
| 50 | + boolean updateByPrimaryKey(SignReportDaySummary entity); | |
| 51 | + | |
| 52 | + boolean deleteById(Integer id); | |
| 53 | +} | |
| 0 | 54 | \ No newline at end of file | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/service/sign/in/summary/impl/SignReportDaySummaryServiceImpl.java
0 → 100644
| 1 | +package com.ruoyi.service.sign.in.summary.impl; | |
| 2 | + | |
| 3 | +import com.ruoyi.service.sign.in.summary.SignReportDaySummaryService; | |
| 4 | +import org.springframework.beans.factory.annotation.Autowired; | |
| 5 | +import org.springframework.stereotype.Service; | |
| 6 | +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | |
| 7 | +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | |
| 8 | +import com.baomidou.mybatisplus.core.metadata.IPage; | |
| 9 | +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | |
| 10 | + | |
| 11 | +import com.github.pagehelper.PageHelper; | |
| 12 | +import lombok.extern.slf4j.Slf4j; | |
| 13 | + | |
| 14 | +import java.util.Collections; | |
| 15 | +import java.util.List; | |
| 16 | + | |
| 17 | +import com.ruoyi.domain.OrderEntity; | |
| 18 | + | |
| 19 | +import com.ruoyi.mapper.sign.in.summary.SignReportDaySummaryMapper; | |
| 20 | +import com.ruoyi.domain.sign.in.summary.SignReportDaySummary; | |
| 21 | + | |
| 22 | +@Slf4j | |
| 23 | +@Service | |
| 24 | +/**签到汇总表 Service实现类*/ | |
| 25 | +public class SignReportDaySummaryServiceImpl extends ServiceImpl<SignReportDaySummaryMapper, SignReportDaySummary> implements SignReportDaySummaryService { | |
| 26 | + @Autowired | |
| 27 | + private SignReportDaySummaryMapper signReportDaySummaryMapper; | |
| 28 | + | |
| 29 | + /** | |
| 30 | + * 分页查询 | |
| 31 | + */ | |
| 32 | + @Override | |
| 33 | + public IPage<SignReportDaySummary> pageList(Page<SignReportDaySummary> page, SignReportDaySummary entity, OrderEntity orderEntity) { | |
| 34 | + LambdaQueryWrapper<SignReportDaySummary> countWrapper = new LambdaQueryWrapper<>(entity); | |
| 35 | + countWrapper.select(SignReportDaySummary::getId); | |
| 36 | + int count = count(countWrapper); | |
| 37 | + | |
| 38 | + List<SignReportDaySummary> lists = Collections.emptyList(); | |
| 39 | + if (count > 0) { | |
| 40 | + PageHelper.startPage((int) page.getCurrent(), (int) page.getSize(), false); | |
| 41 | + LambdaQueryWrapper<SignReportDaySummary> selectWrapper = new LambdaQueryWrapper<>(entity); | |
| 42 | + orderColumn(selectWrapper, orderEntity); | |
| 43 | + lists = list(selectWrapper); | |
| 44 | + } | |
| 45 | + | |
| 46 | + IPage<SignReportDaySummary> returnPage = new Page<SignReportDaySummary>(); | |
| 47 | + returnPage.setRecords(lists); | |
| 48 | + returnPage.setPages(count % page.getSize() == 0 ? count / page.getSize() : count / page.getSize() + 1); | |
| 49 | + returnPage.setCurrent(page.getCurrent()); | |
| 50 | + returnPage.setSize(page.getSize()); | |
| 51 | + returnPage.setTotal(count); | |
| 52 | + | |
| 53 | + return returnPage; | |
| 54 | + } | |
| 55 | + | |
| 56 | + @Override | |
| 57 | + public List<SignReportDaySummary> list(SignReportDaySummary entity) { | |
| 58 | + return list(new LambdaQueryWrapper<>(entity)); | |
| 59 | + } | |
| 60 | + // @Override | |
| 61 | + // public List<SignReportDaySummary> listOfSelect(SignReportDaySummary entity) { | |
| 62 | + // LambdaQueryWrapper<SignReportDaySummary> wrapper = new LambdaQueryWrapper<>(entity); | |
| 63 | + // wrapper.select(SignReportDaySummary::, SignReportDaySummary::); | |
| 64 | + // return list(wrapper); | |
| 65 | + // } | |
| 66 | + | |
| 67 | + // @Override | |
| 68 | + // public List<SignReportDaySummary> listOfIds(java.util.Collection<java.lang.Integer> ids) { | |
| 69 | + // if (org.springframework.util.CollectionUtils.isEmpty(ids)) { | |
| 70 | + // return java.util.Collections.emptyList(); | |
| 71 | + // } | |
| 72 | + // LambdaQueryWrapper<SignReportDaySummary> wrapper = new LambdaQueryWrapper<>(); | |
| 73 | + // wrapper.select(SignReportDaySummary::getId,SignReportDaySummary::); | |
| 74 | + // wrapper.in(SignReportDaySummary::getId, ids); | |
| 75 | + // return list(wrapper); | |
| 76 | + // } | |
| 77 | + | |
| 78 | + @Override | |
| 79 | + public SignReportDaySummary getOne(SignReportDaySummary entity) { | |
| 80 | + return getOne(new LambdaQueryWrapper<>(entity)); | |
| 81 | + } | |
| 82 | + | |
| 83 | + @Override | |
| 84 | + public Integer countId(SignReportDaySummary entity) { | |
| 85 | + LambdaQueryWrapper<SignReportDaySummary> wrapper = new LambdaQueryWrapper<>(entity); | |
| 86 | + wrapper.select(SignReportDaySummary::getId); | |
| 87 | + return count(wrapper); | |
| 88 | + } | |
| 89 | + | |
| 90 | + | |
| 91 | + /** | |
| 92 | + * 插入有值的列 | |
| 93 | + */ | |
| 94 | + @Override | |
| 95 | + public int insertSelective(SignReportDaySummary entity) { | |
| 96 | + return signReportDaySummaryMapper.insertSelective(entity); | |
| 97 | + } | |
| 98 | + | |
| 99 | + /** | |
| 100 | + * 插入数据 | |
| 101 | + */ | |
| 102 | + @Override | |
| 103 | + public boolean insert(SignReportDaySummary entity) { | |
| 104 | + return save(entity); | |
| 105 | + } | |
| 106 | + | |
| 107 | + /** | |
| 108 | + * 根据主键修改数据 | |
| 109 | + */ | |
| 110 | + @Override | |
| 111 | + public boolean updateByPrimaryKey(SignReportDaySummary entity) { | |
| 112 | + return updateById(entity); | |
| 113 | + } | |
| 114 | + | |
| 115 | + /***根据主键删除数据*/ | |
| 116 | + @Override | |
| 117 | + public boolean deleteById(Integer id) { | |
| 118 | + return removeById(id); | |
| 119 | + } | |
| 120 | + | |
| 121 | + | |
| 122 | + public static void orderColumn(LambdaQueryWrapper<SignReportDaySummary> wrapper, OrderEntity orderEntity) { | |
| 123 | + if (org.apache.commons.lang3.StringUtils.equals("ascending", orderEntity.getOrder())) { | |
| 124 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "id")) { | |
| 125 | + wrapper.orderByAsc(SignReportDaySummary::getId); | |
| 126 | + } | |
| 127 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "datestr")) { | |
| 128 | + wrapper.orderByAsc(SignReportDaySummary::getDatestr); | |
| 129 | + } | |
| 130 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "alcoholNum")) { | |
| 131 | + wrapper.orderByAsc(SignReportDaySummary::getAlcoholNum); | |
| 132 | + } | |
| 133 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "earlySigning")) { | |
| 134 | + wrapper.orderByAsc(SignReportDaySummary::getEarlySigning); | |
| 135 | + } | |
| 136 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "lateSigning")) { | |
| 137 | + wrapper.orderByAsc(SignReportDaySummary::getLateSigning); | |
| 138 | + } | |
| 139 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "normalSigning")) { | |
| 140 | + wrapper.orderByAsc(SignReportDaySummary::getNormalSigning); | |
| 141 | + } | |
| 142 | + } else if (org.apache.commons.lang3.StringUtils.equals("descending", orderEntity.getOrder())) { | |
| 143 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "id")) { | |
| 144 | + wrapper.orderByDesc(SignReportDaySummary::getId); | |
| 145 | + } | |
| 146 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "datestr")) { | |
| 147 | + wrapper.orderByDesc(SignReportDaySummary::getDatestr); | |
| 148 | + } | |
| 149 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "alcoholNum")) { | |
| 150 | + wrapper.orderByDesc(SignReportDaySummary::getAlcoholNum); | |
| 151 | + } | |
| 152 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "earlySigning")) { | |
| 153 | + wrapper.orderByDesc(SignReportDaySummary::getEarlySigning); | |
| 154 | + } | |
| 155 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "lateSigning")) { | |
| 156 | + wrapper.orderByDesc(SignReportDaySummary::getLateSigning); | |
| 157 | + } | |
| 158 | + if (org.apache.commons.lang3.StringUtils.equals(orderEntity.getProp(), "normalSigning")) { | |
| 159 | + wrapper.orderByDesc(SignReportDaySummary::getNormalSigning); | |
| 160 | + } | |
| 161 | + } else { | |
| 162 | + wrapper.orderByDesc(SignReportDaySummary::getId); | |
| 163 | + } | |
| 164 | + } | |
| 165 | +} | |
| 0 | 166 | \ No newline at end of file | ... | ... |
Bsth-admin/src/main/java/com/ruoyi/utils/DateUtil.java
| ... | ... | @@ -19,6 +19,7 @@ public class DateUtil { |
| 19 | 19 | |
| 20 | 20 | public static FastDateFormat YYYY_MM_DD_LINK_HH_MM = FastDateFormat.getInstance("yyyy-MM-dd HH:mm"); |
| 21 | 21 | public static FastDateFormat YYYY_MM_DD_LINK = FastDateFormat.getInstance("yyyy-MM-dd"); |
| 22 | + public static FastDateFormat YYYY_MM_LINK = FastDateFormat.getInstance("yyyy-MM"); | |
| 22 | 23 | public static FastDateFormat YYYY_MM_DD = FastDateFormat.getInstance("yyyyMMdd"); |
| 23 | 24 | public static FastDateFormat HH_MM_ss = FastDateFormat.getInstance("HH:mm:ss"); |
| 24 | 25 | public static DateTimeFormatter YYYY_MM_DD_LINK_HH_MM_SS_Local_Date = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); | ... | ... |
Bsth-admin/src/main/resources/application-druid-dev.yml
| ... | ... | @@ -225,6 +225,4 @@ bsth: |
| 225 | 225 | process: |
| 226 | 226 | sign: |
| 227 | 227 | url: http://127.0.0.1:9103/commonOpenDataApi/sendAppAndSmsNotice |
| 228 | - skip: | |
| 229 | - url: /big/view/queryNumberByType;/big/view/queryLineInfo/*;/big/view/querySignDetails;/report/list/**;/system/dict/data/**;/app/version/check/**;/app/checkDeviceHeart;/app/download;"/driver/**;/in/**;/eexception/**;/equipment/**;/report/**;/login;/register;/captchaImage;/dss/Driver/Auth;/test/**;/login/no/code;/actuator/health;/upload/image/**; | |
| 230 | 228 | ... | ... |
Bsth-admin/src/main/resources/application-druid-devTest.yml
| ... | ... | @@ -12,7 +12,7 @@ spring: |
| 12 | 12 | # 占用端口号 |
| 13 | 13 | port: 465 |
| 14 | 14 | nickname: 酒精测试异常通知 |
| 15 | - form: m18980249160@163.com | |
| 15 | + form: m18980249160@163.com湘AT3259 | |
| 16 | 16 | protocol: smtp |
| 17 | 17 | properties: |
| 18 | 18 | mail: |
| ... | ... | @@ -218,5 +218,3 @@ bsth: |
| 218 | 218 | process: |
| 219 | 219 | sign: |
| 220 | 220 | url: http://127.0.0.1:9103/commonOpenDataApi/sendAppAndSmsNotice |
| 221 | - skip: | |
| 222 | - url: /big/view/queryNumberByType;/big/view/queryLineInfo/*;/big/view/querySignDetails;/report/list/**;/system/dict/data/**;/app/version/check/**;/app/checkDeviceHeart;/app/download;"/driver/**;/in/**;/eexception/**;/equipment/**;/report/**;/login;/register;/captchaImage;/dss/Driver/Auth;/login/no/code;/uploadPath/**;/doc.html | ... | ... |
Bsth-admin/src/main/resources/application-druid-prd.yml
| ... | ... | @@ -234,5 +234,4 @@ bsth: |
| 234 | 234 | process: |
| 235 | 235 | sign: |
| 236 | 236 | url: http://127.0.0.1:9103/commonOpenDataApi/sendAppAndSmsNotice |
| 237 | - skip: | |
| 238 | - url: /big/view/queryNumberByType;/big/view/queryLineInfo/*;/big/view/querySignDetails;/report/list/**;/system/dict/data/**;/app/version/check/**;/app/checkDeviceHeart;/app/download;"/driver/**;/in/**;/eexception/**;/equipment/**;/report/**;/login;/register;/captchaImage;/dss/Driver/Auth;/login/no/code | |
| 237 | + | ... | ... |
Bsth-admin/src/main/resources/application.yml
| ... | ... | @@ -173,4 +173,7 @@ management: |
| 173 | 173 | endpoints: |
| 174 | 174 | web: |
| 175 | 175 | exposure: |
| 176 | - include: "*" | |
| 177 | 176 | \ No newline at end of file |
| 177 | + include: "*" | |
| 178 | +bsth: | |
| 179 | + skip: | |
| 180 | + url: /big/view/queryNumberByType;/big/view/queryLineInfo/*;/big/view/querySignDetails;/report/list/**;/system/dict/data/**;/app/version/check/**;/app/checkDeviceHeart;/app/download;"/driver/**;/in/**;/eexception/**;/equipment/**;/report/**;/login;/register;/captchaImage;/dss/Driver/Auth;/login/no/code;/app/sign/report/equipment/people/num/**;/app/sign/report/equipment/people/num/*;/report/error/list/report;/app/sign/report/sign/report/group/** | |
| 178 | 181 | \ No newline at end of file | ... | ... |
Bsth-admin/src/main/resources/mapper/SignReportMapper.xml
| ... | ... | @@ -17,4 +17,26 @@ |
| 17 | 17 | select si.jobCode from sign_in si where si.create_time like CONCAT(#{dateStr},'%') and si.ex_type =3 GROUP by si.jobCode |
| 18 | 18 | )t1)alcoholNum |
| 19 | 19 | </select> |
| 20 | + | |
| 21 | + <select id="querySignReportGroupByDayOfError" resultType="com.ruoyi.domain.dss.app.entity.SignReportGroupByDay"> | |
| 22 | + select jobCode ,dateStr from( | |
| 23 | + select jobCode,DATE_FORMAT(si.create_time,'%Y-%m-%d') dateStr from sign_in si where si.create_time like CONCAT(#{dateStr},'%') AND si.ex_type1 BETWEEN #{startVal} and #{endVal} and si.ex_type1<![CDATA[ <> ]]>#{alcoholVal} | |
| 24 | + )t group by dateStr,jobCode | |
| 25 | + </select> | |
| 26 | + | |
| 27 | + <select id="querySignReportAlcoholGroupByDay" resultType="com.ruoyi.domain.dss.app.entity.SignReportGroupByDay"> | |
| 28 | + select jobCode ,dateStr from( | |
| 29 | + select jobCode,DATE_FORMAT(si.create_time,'%Y-%m-%d') dateStr from sign_in si where si.create_time like CONCAT(#{dateStr},'%') AND si.ex_type=3 | |
| 30 | + )t group by dateStr,jobCode | |
| 31 | + </select> | |
| 32 | + <select id="querySignReportAlcoholMonthGroupByDay" resultType="com.ruoyi.domain.dss.app.vo.SignReportGroupByVo"> | |
| 33 | + select dateStr,sum(alcohol_Num) alcoholNum,sum(early_Signing) earlySigning,sum(late_Signing) lateSigning,sum(normal_Signing) normalSigning from( | |
| 34 | + select DATE_FORMAT(srds.dateStr,'%Y-%m')dateStr ,alcohol_Num,early_Signing,late_Signing,normal_Signing from sign_report_day_summary srds | |
| 35 | + <where> | |
| 36 | + <foreach collection="dateStrs" item="value" separator=" or " open="(" close=")"> | |
| 37 | + srds.dateStr like CONCAT(#{value},'%') | |
| 38 | + </foreach> | |
| 39 | + </where> | |
| 40 | + )myt group by dateStr order by dateStr | |
| 41 | + </select> | |
| 20 | 42 | </mapper> |
| 21 | 43 | \ No newline at end of file | ... | ... |
Bsth-admin/src/main/resources/mapper/sign/in/summary/SignReportDaySummaryMapper.xml
0 → 100644
| 1 | +<?xml version="1.0" encoding="UTF-8"?> | |
| 2 | +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |
| 3 | +<mapper namespace="com.ruoyi.mapper.sign.in.summary.SignReportDaySummaryMapper"> | |
| 4 | + <resultMap id="BaseResultMap" type="com.ruoyi.domain.sign.in.summary.SignReportDaySummary"> | |
| 5 | + <id column="id" jdbcType="INTEGER" property="id"/> | |
| 6 | + <result column="dateStr" jdbcType="VARCHAR" property="datestr"/> | |
| 7 | + <result column="alcohol_Num" jdbcType="INTEGER" property="alcoholNum"/> | |
| 8 | + <result column="early_Signing" jdbcType="INTEGER" property="earlySigning"/> | |
| 9 | + <result column="late_Signing" jdbcType="INTEGER" property="lateSigning"/> | |
| 10 | + <result column="normal_Signing" jdbcType="INTEGER" property="normalSigning"/> | |
| 11 | + </resultMap> | |
| 12 | + | |
| 13 | + <insert id="insertSelective" keyColumn="id" keyProperty="id" useGeneratedKeys="true" | |
| 14 | + parameterType="com.ruoyi.domain.sign.in.summary.SignReportDaySummary"> | |
| 15 | + INSERT INTO sign_report_day_summary | |
| 16 | + <include refid="insertSelectiveColumn"></include> | |
| 17 | + <include refid="insertSelectiveValue"></include> | |
| 18 | + </insert> | |
| 19 | + | |
| 20 | + <sql id="columns"> | |
| 21 | + id , dateStr , alcohol_Num , early_Signing , late_Signing , normal_Signing | |
| 22 | + </sql> | |
| 23 | + | |
| 24 | + <sql id="insert_columns"> | |
| 25 | + id , dateStr , alcohol_Num , early_Signing , late_Signing , normal_Signing | |
| 26 | + </sql> | |
| 27 | + | |
| 28 | + <sql id="insert_values"> | |
| 29 | + #{id}, #{datestr}, #{alcoholNum}, #{earlySigning}, #{lateSigning}, #{normalSigning} | |
| 30 | + </sql> | |
| 31 | + | |
| 32 | + <sql id="insertSelectiveColumn"> | |
| 33 | + <trim prefix="(" suffix=")" suffixOverrides=","> | |
| 34 | + <if test="null!=id">id,</if> | |
| 35 | + <if test="null!=datestr">dateStr,</if> | |
| 36 | + <if test="null!=alcoholNum">alcohol_Num,</if> | |
| 37 | + <if test="null!=earlySigning">early_Signing,</if> | |
| 38 | + <if test="null!=lateSigning">late_Signing,</if> | |
| 39 | + <if test="null!=normalSigning">normal_Signing,</if> | |
| 40 | + </trim> | |
| 41 | + </sql> | |
| 42 | + | |
| 43 | + <sql id="insertSelectiveValue"> | |
| 44 | + <trim prefix="values (" suffix=")" suffixOverrides=","> | |
| 45 | + <if test="null!=id">#{id,jdbcType=INTEGER},</if> | |
| 46 | + <if test="null!=datestr">#{datestr,jdbcType=VARCHAR},</if> | |
| 47 | + <if test="null!=alcoholNum">#{alcoholNum,jdbcType=INTEGER},</if> | |
| 48 | + <if test="null!=earlySigning">#{earlySigning,jdbcType=INTEGER},</if> | |
| 49 | + <if test="null!=lateSigning">#{lateSigning,jdbcType=INTEGER},</if> | |
| 50 | + <if test="null!=normalSigning">#{normalSigning,jdbcType=INTEGER},</if> | |
| 51 | + </trim> | |
| 52 | + </sql> | |
| 53 | + | |
| 54 | + <sql id="updateByPrimaryKeySelectiveSql"> | |
| 55 | + <set> | |
| 56 | + <if test="null!=id">id = #{id,jdbcType=INTEGER},</if> | |
| 57 | + <if test="null!=datestr">dateStr = #{datestr,jdbcType=VARCHAR},</if> | |
| 58 | + <if test="null!=alcoholNum">alcohol_Num = #{alcoholNum,jdbcType=INTEGER},</if> | |
| 59 | + <if test="null!=earlySigning">early_Signing = #{earlySigning,jdbcType=INTEGER},</if> | |
| 60 | + <if test="null!=lateSigning">late_Signing = #{lateSigning,jdbcType=INTEGER},</if> | |
| 61 | + <if test="null!=normalSigning">normal_Signing = #{normalSigning,jdbcType=INTEGER},</if> | |
| 62 | + </set> | |
| 63 | + </sql> | |
| 64 | + | |
| 65 | + <sql id="where"> | |
| 66 | + <if test="null!=id">AND id = #{id,jdbcType=INTEGER},</if> | |
| 67 | + <if test="null!=datestr">AND dateStr = #{datestr,jdbcType=VARCHAR},</if> | |
| 68 | + <if test="null!=alcoholNum">AND alcohol_Num = #{alcoholNum,jdbcType=INTEGER},</if> | |
| 69 | + <if test="null!=earlySigning">AND early_Signing = #{earlySigning,jdbcType=INTEGER},</if> | |
| 70 | + <if test="null!=lateSigning">AND late_Signing = #{lateSigning,jdbcType=INTEGER},</if> | |
| 71 | + <if test="null!=normalSigning">AND normal_Signing = #{normalSigning,jdbcType=INTEGER},</if> | |
| 72 | + </sql> | |
| 73 | +</mapper> | |
| 0 | 74 | \ No newline at end of file | ... | ... |