Commit 0fcc40d691b9392d0ede5cd13f54c6ae0d5b7722
1 parent
1c59a038
归还钥匙、领取钥匙使用车辆自编号
Showing
11 changed files
with
185 additions
and
94 deletions
Bsth-admin/pom.xml
| @@ -148,6 +148,12 @@ | @@ -148,6 +148,12 @@ | ||
| 148 | <artifactId>spring-boot-starter-actuator</artifactId> | 148 | <artifactId>spring-boot-starter-actuator</artifactId> |
| 149 | </dependency> | 149 | </dependency> |
| 150 | 150 | ||
| 151 | + <dependency> | ||
| 152 | + <groupId>net.sourceforge.tess4j</groupId> | ||
| 153 | + <artifactId>tess4j</artifactId> | ||
| 154 | + <version>5.9.0</version> | ||
| 155 | + </dependency> | ||
| 156 | + | ||
| 151 | </dependencies> | 157 | </dependencies> |
| 152 | 158 | ||
| 153 | <build> | 159 | <build> |
Bsth-admin/src/main/java/com/ruoyi/driver/controller/DriverController.java
| 1 | package com.ruoyi.driver.controller; | 1 | package com.ruoyi.driver.controller; |
| 2 | 2 | ||
| 3 | -import java.util.List; | ||
| 4 | -import javax.servlet.http.HttpServletRequest; | ||
| 5 | -import javax.servlet.http.HttpServletResponse; | ||
| 6 | - | ||
| 7 | -import com.baomidou.mybatisplus.core.metadata.IPage; | 3 | +import com.ruoyi.common.annotation.Log; |
| 4 | +import com.ruoyi.common.core.controller.BaseController; | ||
| 5 | +import com.ruoyi.common.core.domain.AjaxResult; | ||
| 6 | +import com.ruoyi.common.core.page.TableDataInfo; | ||
| 7 | +import com.ruoyi.common.enums.BusinessType; | ||
| 8 | import com.ruoyi.common.global.Result; | 8 | import com.ruoyi.common.global.Result; |
| 9 | +import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 10 | +import com.ruoyi.driver.domain.Driver; | ||
| 11 | +import com.ruoyi.driver.service.IDriverService; | ||
| 9 | import com.ruoyi.pojo.request.DriverRequestVo; | 12 | import com.ruoyi.pojo.request.DriverRequestVo; |
| 10 | import com.ruoyi.pojo.request.DriverSignInRequestVo; | 13 | import com.ruoyi.pojo.request.DriverSignInRequestVo; |
| 11 | import com.ruoyi.pojo.request.FaceRegistrationFeedbackVo; | 14 | import com.ruoyi.pojo.request.FaceRegistrationFeedbackVo; |
| @@ -13,20 +16,15 @@ import com.ruoyi.pojo.request.FaceUpdateReqVo; | @@ -13,20 +16,15 @@ import com.ruoyi.pojo.request.FaceUpdateReqVo; | ||
| 13 | import io.swagger.annotations.Api; | 16 | import io.swagger.annotations.Api; |
| 14 | import io.swagger.annotations.ApiOperation; | 17 | import io.swagger.annotations.ApiOperation; |
| 15 | import io.swagger.annotations.ApiParam; | 18 | import io.swagger.annotations.ApiParam; |
| 16 | -import org.springframework.beans.BeanUtils; | ||
| 17 | import org.springframework.beans.factory.annotation.Autowired; | 19 | import org.springframework.beans.factory.annotation.Autowired; |
| 18 | import org.springframework.validation.annotation.Validated; | 20 | import org.springframework.validation.annotation.Validated; |
| 19 | import org.springframework.web.bind.annotation.*; | 21 | import org.springframework.web.bind.annotation.*; |
| 20 | -import com.ruoyi.common.annotation.Log; | ||
| 21 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 22 | -import com.ruoyi.common.core.domain.AjaxResult; | ||
| 23 | -import com.ruoyi.common.enums.BusinessType; | ||
| 24 | -import com.ruoyi.driver.domain.Driver; | ||
| 25 | -import com.ruoyi.driver.service.IDriverService; | ||
| 26 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 27 | -import com.ruoyi.common.core.page.TableDataInfo; | ||
| 28 | import org.springframework.web.multipart.MultipartFile; | 22 | import org.springframework.web.multipart.MultipartFile; |
| 29 | 23 | ||
| 24 | +import javax.servlet.http.HttpServletRequest; | ||
| 25 | +import javax.servlet.http.HttpServletResponse; | ||
| 26 | +import java.util.List; | ||
| 27 | + | ||
| 30 | /** | 28 | /** |
| 31 | * 驾驶员信息Controller | 29 | * 驾驶员信息Controller |
| 32 | * | 30 | * |
| @@ -68,7 +66,11 @@ public class DriverController extends BaseController { | @@ -68,7 +66,11 @@ public class DriverController extends BaseController { | ||
| 68 | public TableDataInfo list(DriverRequestVo driver) { | 66 | public TableDataInfo list(DriverRequestVo driver) { |
| 69 | startPage(); | 67 | startPage(); |
| 70 | List<Driver> list = driverService.selectDriverList(driver); | 68 | List<Driver> list = driverService.selectDriverList(driver); |
| 71 | - return getDataTable(list); | 69 | + TableDataInfo dataInfo = getDataTable(list); |
| 70 | + | ||
| 71 | + driverService.combInfo(list); | ||
| 72 | + | ||
| 73 | + return dataInfo; | ||
| 72 | } | 74 | } |
| 73 | 75 | ||
| 74 | 76 |
Bsth-admin/src/main/java/com/ruoyi/driver/service/IDriverService.java
| 1 | package com.ruoyi.driver.service; | 1 | package com.ruoyi.driver.service; |
| 2 | 2 | ||
| 3 | -import java.io.IOException; | ||
| 4 | -import java.util.List; | ||
| 5 | - | ||
| 6 | import com.baomidou.mybatisplus.extension.service.IService; | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
| 7 | import com.ruoyi.common.core.domain.AjaxResult; | 4 | import com.ruoyi.common.core.domain.AjaxResult; |
| 8 | import com.ruoyi.common.exception.file.InvalidExtensionException; | 5 | import com.ruoyi.common.exception.file.InvalidExtensionException; |
| @@ -16,6 +13,8 @@ import org.springframework.web.multipart.MultipartFile; | @@ -16,6 +13,8 @@ import org.springframework.web.multipart.MultipartFile; | ||
| 16 | 13 | ||
| 17 | import javax.servlet.http.HttpServletRequest; | 14 | import javax.servlet.http.HttpServletRequest; |
| 18 | import javax.servlet.http.HttpServletResponse; | 15 | import javax.servlet.http.HttpServletResponse; |
| 16 | +import java.io.IOException; | ||
| 17 | +import java.util.List; | ||
| 19 | 18 | ||
| 20 | /** | 19 | /** |
| 21 | * 驾驶员信息Service接口 | 20 | * 驾驶员信息Service接口 |
| @@ -43,6 +42,8 @@ public interface IDriverService extends IService<Driver> | @@ -43,6 +42,8 @@ public interface IDriverService extends IService<Driver> | ||
| 43 | 42 | ||
| 44 | List<Driver> selectDriverIdJobCodePersonnelName(Driver driver); | 43 | List<Driver> selectDriverIdJobCodePersonnelName(Driver driver); |
| 45 | 44 | ||
| 45 | + List<Driver> combInfo(List<Driver> lists); | ||
| 46 | + | ||
| 46 | /** | 47 | /** |
| 47 | * 新增驾驶员信息 | 48 | * 新增驾驶员信息 |
| 48 | * | 49 | * |
Bsth-admin/src/main/java/com/ruoyi/driver/service/impl/DriverServiceImpl.java
| @@ -45,7 +45,7 @@ import com.ruoyi.utils.ConstDateUtil; | @@ -45,7 +45,7 @@ import com.ruoyi.utils.ConstDateUtil; | ||
| 45 | import com.ruoyi.utils.ListUtils; | 45 | import com.ruoyi.utils.ListUtils; |
| 46 | import org.apache.commons.collections4.CollectionUtils; | 46 | import org.apache.commons.collections4.CollectionUtils; |
| 47 | import org.apache.commons.io.FilenameUtils; | 47 | import org.apache.commons.io.FilenameUtils; |
| 48 | -import org.apache.tomcat.util.buf.StringUtils; | 48 | +import org.apache.commons.lang3.StringUtils; |
| 49 | import org.slf4j.Logger; | 49 | import org.slf4j.Logger; |
| 50 | import org.slf4j.LoggerFactory; | 50 | import org.slf4j.LoggerFactory; |
| 51 | import org.springframework.beans.factory.annotation.Autowired; | 51 | import org.springframework.beans.factory.annotation.Autowired; |
| @@ -149,29 +149,27 @@ public class DriverServiceImpl extends ServiceImpl<DriverMapper, Driver> impleme | @@ -149,29 +149,27 @@ public class DriverServiceImpl extends ServiceImpl<DriverMapper, Driver> impleme | ||
| 149 | public List<Driver> selectDriverList(DriverRequestVo driver) { | 149 | public List<Driver> selectDriverList(DriverRequestVo driver) { |
| 150 | List<Driver> drivers = driverMapper.selectDriverList(driver); | 150 | List<Driver> drivers = driverMapper.selectDriverList(driver); |
| 151 | 151 | ||
| 152 | - SysDictData source = new SysDictData(); | ||
| 153 | - source.setDictType("resource_base_url"); | ||
| 154 | - List<SysDictData> sysDictDatas = sysDictDataService.queryDictDateList(source); | ||
| 155 | - | ||
| 156 | - String url1 = ""; | ||
| 157 | - String flag1 = null; | 152 | + return drivers; |
| 153 | + } | ||
| 158 | 154 | ||
| 159 | - if (CollectionUtils.isNotEmpty(sysDictDatas)) { | ||
| 160 | - for (SysDictData s : sysDictDatas) { | ||
| 161 | - if (Objects.equals(s.getDiscKey(), "resource_base_url")) { | ||
| 162 | - url1 = s.getDictValueStr(); | ||
| 163 | - continue; | ||
| 164 | - } | 155 | + @Override |
| 156 | + public List<Driver> selectDriverIdJobCodePersonnelName(Driver driver) { | ||
| 157 | + driver.setParams(null); | ||
| 158 | + LambdaQueryWrapper<Driver> wrapper = new LambdaQueryWrapper<>(driver); | ||
| 159 | + wrapper.select(Driver::getId, Driver::getJobCode, Driver::getPersonnelName); | ||
| 160 | + return list(wrapper); | ||
| 161 | + } | ||
| 165 | 162 | ||
| 166 | - if (org.apache.commons.lang3.StringUtils.equals(s.getDiscKey(), "resource_base_url_flag")) { | ||
| 167 | - flag1 = s.getDictValueStr(); | ||
| 168 | - continue; | ||
| 169 | - } | ||
| 170 | - } | 163 | + @Override |
| 164 | + public List<Driver> combInfo(List<Driver> drivers) { | ||
| 165 | + if (CollectionUtils.isEmpty(drivers)) { | ||
| 166 | + return drivers; | ||
| 171 | } | 167 | } |
| 168 | + SysDictData source = sysDictDataService.getResourceBaseUrl(); | ||
| 169 | + | ||
| 170 | + | ||
| 171 | + String url = source.getDictValueStr(); | ||
| 172 | 172 | ||
| 173 | - String url = url1; | ||
| 174 | - String flag = flag1; | ||
| 175 | 173 | ||
| 176 | List<EquipmentDriverExpand> list = equipmentMapper.querySignListByJobCode(drivers); | 174 | List<EquipmentDriverExpand> list = equipmentMapper.querySignListByJobCode(drivers); |
| 177 | for (Driver item : drivers) { | 175 | for (Driver item : drivers) { |
| @@ -179,29 +177,16 @@ public class DriverServiceImpl extends ServiceImpl<DriverMapper, Driver> impleme | @@ -179,29 +177,16 @@ public class DriverServiceImpl extends ServiceImpl<DriverMapper, Driver> impleme | ||
| 179 | List<String> collect = list.stream().filter(todo -> item.getJobCode().equals(todo.getJobCode())).map(EquipmentDriverExpand::getDeviceId).collect(Collectors.toList()); | 177 | List<String> collect = list.stream().filter(todo -> item.getJobCode().equals(todo.getJobCode())).map(EquipmentDriverExpand::getDeviceId).collect(Collectors.toList()); |
| 180 | item.setSignInEquipment(StringUtils.join(collect)); | 178 | item.setSignInEquipment(StringUtils.join(collect)); |
| 181 | } | 179 | } |
| 182 | - if (org.apache.commons.lang3.StringUtils.equals("1", flag)) { | 180 | + if (source.isCombationVal()) { |
| 183 | drivers = drivers.stream().map(d -> { | 181 | drivers = drivers.stream().map(d -> { |
| 184 | - String fil = "/"; | ||
| 185 | 182 | ||
| 186 | - if (org.apache.commons.lang3.StringUtils.startsWith(d.getImage(), "/") || org.apache.commons.lang3.StringUtils.startsWith(d.getImage(), "\\")) { | ||
| 187 | - fil = ""; | ||
| 188 | - } else if (org.apache.commons.lang3.StringUtils.endsWith(url, "/")) { | ||
| 189 | - fil = ""; | ||
| 190 | - } | ||
| 191 | - d.setImage(org.apache.commons.lang3.StringUtils.join(url, fil, d.getImage())); | 183 | + d.setImage(sysDictDataService.combationValue(d.getImage(),source)); |
| 192 | 184 | ||
| 193 | return d; | 185 | return d; |
| 194 | }).collect(Collectors.toList()); | 186 | }).collect(Collectors.toList()); |
| 187 | + return drivers; | ||
| 195 | } | 188 | } |
| 196 | - return drivers; | ||
| 197 | - } | ||
| 198 | - | ||
| 199 | - @Override | ||
| 200 | - public List<Driver> selectDriverIdJobCodePersonnelName(Driver driver) { | ||
| 201 | - driver.setParams(null); | ||
| 202 | - LambdaQueryWrapper<Driver> wrapper = new LambdaQueryWrapper<>(driver); | ||
| 203 | - wrapper.select(Driver::getId, Driver::getJobCode, Driver::getPersonnelName); | ||
| 204 | - return list(wrapper); | 189 | + return null; |
| 205 | } | 190 | } |
| 206 | 191 | ||
| 207 | private DriverSignInRecommendation checkTime(List<DriverScheduling> dto, Long now) { | 192 | private DriverSignInRecommendation checkTime(List<DriverScheduling> dto, Long now) { |
Bsth-admin/src/main/java/com/ruoyi/in/controller/SignInController.java
| 1 | package com.ruoyi.in.controller; | 1 | package com.ruoyi.in.controller; |
| 2 | 2 | ||
| 3 | -import java.io.IOException; | ||
| 4 | -import java.util.List; | ||
| 5 | -import javax.servlet.http.HttpServletRequest; | ||
| 6 | -import javax.servlet.http.HttpServletResponse; | ||
| 7 | - | 3 | +import com.ruoyi.common.annotation.Log; |
| 4 | +import com.ruoyi.common.core.controller.BaseController; | ||
| 5 | +import com.ruoyi.common.core.domain.AjaxResult; | ||
| 6 | +import com.ruoyi.common.core.domain.entity.SysDictData; | ||
| 7 | +import com.ruoyi.common.core.page.TableDataInfo; | ||
| 8 | +import com.ruoyi.common.enums.BusinessType; | ||
| 8 | import com.ruoyi.common.exception.file.FileUploadException; | 9 | import com.ruoyi.common.exception.file.FileUploadException; |
| 10 | +import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 11 | +import com.ruoyi.domain.sign.in.resource.LinggangSignInResource; | ||
| 12 | +import com.ruoyi.in.domain.SignIn; | ||
| 13 | +import com.ruoyi.in.service.ISignInService; | ||
| 9 | import com.ruoyi.pojo.response.SignInResponseVo; | 14 | import com.ruoyi.pojo.response.SignInResponseVo; |
| 15 | +import com.ruoyi.service.sign.in.resource.LinggangSignInResourceService; | ||
| 16 | +import com.ruoyi.system.service.ISysDictDataService; | ||
| 10 | import io.swagger.annotations.Api; | 17 | import io.swagger.annotations.Api; |
| 11 | import io.swagger.annotations.ApiOperation; | 18 | import io.swagger.annotations.ApiOperation; |
| 12 | import io.swagger.annotations.ApiParam; | 19 | import io.swagger.annotations.ApiParam; |
| 20 | +import org.apache.commons.collections4.CollectionUtils; | ||
| 13 | import org.springframework.beans.factory.annotation.Autowired; | 21 | import org.springframework.beans.factory.annotation.Autowired; |
| 14 | import org.springframework.validation.annotation.Validated; | 22 | import org.springframework.validation.annotation.Validated; |
| 15 | -import org.springframework.web.bind.annotation.GetMapping; | ||
| 16 | -import org.springframework.web.bind.annotation.PostMapping; | ||
| 17 | -import org.springframework.web.bind.annotation.PutMapping; | ||
| 18 | -import org.springframework.web.bind.annotation.DeleteMapping; | ||
| 19 | -import org.springframework.web.bind.annotation.PathVariable; | ||
| 20 | -import org.springframework.web.bind.annotation.RequestBody; | ||
| 21 | -import org.springframework.web.bind.annotation.RequestMapping; | ||
| 22 | -import org.springframework.web.bind.annotation.RestController; | ||
| 23 | -import com.ruoyi.common.annotation.Log; | ||
| 24 | -import com.ruoyi.common.core.controller.BaseController; | ||
| 25 | -import com.ruoyi.common.core.domain.AjaxResult; | ||
| 26 | -import com.ruoyi.common.enums.BusinessType; | ||
| 27 | -import com.ruoyi.in.domain.SignIn; | ||
| 28 | -import com.ruoyi.in.service.ISignInService; | ||
| 29 | -import com.ruoyi.common.utils.poi.ExcelUtil; | ||
| 30 | -import com.ruoyi.common.core.page.TableDataInfo; | 23 | +import org.springframework.web.bind.annotation.*; |
| 24 | + | ||
| 25 | +import javax.servlet.http.HttpServletRequest; | ||
| 26 | +import javax.servlet.http.HttpServletResponse; | ||
| 27 | +import java.io.IOException; | ||
| 28 | +import java.util.List; | ||
| 29 | +import java.util.Objects; | ||
| 30 | +import java.util.Optional; | ||
| 31 | +import java.util.Set; | ||
| 32 | +import java.util.stream.Collectors; | ||
| 31 | 33 | ||
| 32 | /** | 34 | /** |
| 33 | * 签到Controller | 35 | * 签到Controller |
| @@ -41,6 +43,10 @@ import com.ruoyi.common.core.page.TableDataInfo; | @@ -41,6 +43,10 @@ import com.ruoyi.common.core.page.TableDataInfo; | ||
| 41 | public class SignInController extends BaseController { | 43 | public class SignInController extends BaseController { |
| 42 | @Autowired | 44 | @Autowired |
| 43 | private ISignInService signInService; | 45 | private ISignInService signInService; |
| 46 | + @Autowired | ||
| 47 | + private LinggangSignInResourceService signInResourceService; | ||
| 48 | + @Autowired | ||
| 49 | + private ISysDictDataService sysDictDataService; | ||
| 44 | 50 | ||
| 45 | /** | 51 | /** |
| 46 | * 查询签到列表 | 52 | * 查询签到列表 |
| @@ -51,7 +57,26 @@ public class SignInController extends BaseController { | @@ -51,7 +57,26 @@ public class SignInController extends BaseController { | ||
| 51 | public TableDataInfo list(SignInResponseVo signIn) { | 57 | public TableDataInfo list(SignInResponseVo signIn) { |
| 52 | startPage(); | 58 | startPage(); |
| 53 | List<SignInResponseVo> list = signInService.selectSignInList(signIn); | 59 | List<SignInResponseVo> list = signInService.selectSignInList(signIn); |
| 54 | - return getDataTable(list); | 60 | + TableDataInfo tableDataInfo = getDataTable(list); |
| 61 | + if (CollectionUtils.isNotEmpty(list)) { | ||
| 62 | + Set<Long> ids = list.stream().map(SignInResponseVo::getId).collect(Collectors.toSet()); | ||
| 63 | + SysDictData source = sysDictDataService.getResourceBaseUrl(); | ||
| 64 | + List<LinggangSignInResource> resources = signInResourceService.listBySignIds(ids); | ||
| 65 | + if (CollectionUtils.isNotEmpty(resources)) { | ||
| 66 | + resources.stream().forEach(r -> { | ||
| 67 | + Optional<SignInResponseVo> optVo = list.stream().filter(l -> Objects.equals(l.getId(), r.getSignId())).findFirst(); | ||
| 68 | + if (optVo.isPresent()) { | ||
| 69 | + if (Objects.equals(r.getResourceType(), 2)) { | ||
| 70 | + optVo.get().setVideoURL(sysDictDataService.combationValue(r.getPath(), source)); | ||
| 71 | + } else { | ||
| 72 | + optVo.get().setImage(sysDictDataService.combationValue(r.getPath(), source)); | ||
| 73 | + } | ||
| 74 | + } | ||
| 75 | + }); | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + return tableDataInfo; | ||
| 55 | } | 80 | } |
| 56 | 81 | ||
| 57 | /** | 82 | /** |
| @@ -123,14 +148,13 @@ public class SignInController extends BaseController { | @@ -123,14 +148,13 @@ public class SignInController extends BaseController { | ||
| 123 | // public AjaxResult remove(@PathVariable Long[] ids) { | 148 | // public AjaxResult remove(@PathVariable Long[] ids) { |
| 124 | // return toAjax(signInService.deleteSignInByIds(ids)); | 149 | // return toAjax(signInService.deleteSignInByIds(ids)); |
| 125 | // } | 150 | // } |
| 126 | - | ||
| 127 | @GetMapping("/repair") | 151 | @GetMapping("/repair") |
| 128 | - public AjaxResult repairSignRecord(HttpServletRequest request){ | 152 | + public AjaxResult repairSignRecord(HttpServletRequest request) { |
| 129 | return AjaxResult.success(signInService.repairSignRecord(request)); | 153 | return AjaxResult.success(signInService.repairSignRecord(request)); |
| 130 | } | 154 | } |
| 131 | 155 | ||
| 132 | @GetMapping("/repairAll/{date}") | 156 | @GetMapping("/repairAll/{date}") |
| 133 | - public AjaxResult repairAllSignRecord(HttpServletRequest request,@PathVariable("date") String date){ | ||
| 134 | - return AjaxResult.success(signInService.repairAllSignRecord(request,date)); | 157 | + public AjaxResult repairAllSignRecord(HttpServletRequest request, @PathVariable("date") String date) { |
| 158 | + return AjaxResult.success(signInService.repairAllSignRecord(request, date)); | ||
| 135 | } | 159 | } |
| 136 | } | 160 | } |
Bsth-admin/src/main/java/com/ruoyi/pojo/response/SignInResponseVo.java
| @@ -26,6 +26,9 @@ public class SignInResponseVo extends SignIn { | @@ -26,6 +26,9 @@ public class SignInResponseVo extends SignIn { | ||
| 26 | */ | 26 | */ |
| 27 | String date; | 27 | String date; |
| 28 | 28 | ||
| 29 | + @ExcelIgnore | ||
| 30 | + private String VideoURL; | ||
| 31 | + | ||
| 29 | 32 | ||
| 30 | public SignInResponseVo(SignIn signIn){ | 33 | public SignInResponseVo(SignIn signIn){ |
| 31 | this.setDeviceId(signIn.getDeviceId()); | 34 | this.setDeviceId(signIn.getDeviceId()); |
Bsth-admin/src/main/java/com/ruoyi/service/impl/sign/in/resource/LinggangSignInResourceServiceImpl.java
| @@ -19,10 +19,7 @@ import org.springframework.stereotype.Service; | @@ -19,10 +19,7 @@ import org.springframework.stereotype.Service; | ||
| 19 | import org.springframework.transaction.annotation.Transactional; | 19 | import org.springframework.transaction.annotation.Transactional; |
| 20 | 20 | ||
| 21 | import java.io.File; | 21 | import java.io.File; |
| 22 | -import java.util.Collections; | ||
| 23 | -import java.util.List; | ||
| 24 | -import java.util.Objects; | ||
| 25 | -import java.util.UUID; | 22 | +import java.util.*; |
| 26 | import java.util.stream.Collectors; | 23 | import java.util.stream.Collectors; |
| 27 | 24 | ||
| 28 | @Slf4j | 25 | @Slf4j |
| @@ -65,6 +62,17 @@ public class LinggangSignInResourceServiceImpl extends ServiceImpl<LinggangSignI | @@ -65,6 +62,17 @@ public class LinggangSignInResourceServiceImpl extends ServiceImpl<LinggangSignI | ||
| 65 | public List<LinggangSignInResource> list(LinggangSignInResource entity) { | 62 | public List<LinggangSignInResource> list(LinggangSignInResource entity) { |
| 66 | return list(new LambdaQueryWrapper<>(entity)); | 63 | return list(new LambdaQueryWrapper<>(entity)); |
| 67 | } | 64 | } |
| 65 | + | ||
| 66 | + @Override | ||
| 67 | + public List<LinggangSignInResource> listBySignIds(Collection<Long> signIds) { | ||
| 68 | + if (CollectionUtils.isEmpty(signIds)) { | ||
| 69 | + return Collections.emptyList(); | ||
| 70 | + } | ||
| 71 | + | ||
| 72 | + LambdaQueryWrapper<LinggangSignInResource> wrapper = new LambdaQueryWrapper<>(); | ||
| 73 | + wrapper.in(LinggangSignInResource::getSignId, signIds); | ||
| 74 | + return list(wrapper); | ||
| 75 | + } | ||
| 68 | // @Override | 76 | // @Override |
| 69 | // public List<LinggangSignInResource> listOfSelect(LinggangSignInResource entity) { | 77 | // public List<LinggangSignInResource> listOfSelect(LinggangSignInResource entity) { |
| 70 | // LambdaQueryWrapper<LinggangSignInResource> wrapper = new LambdaQueryWrapper<>(entity); | 78 | // LambdaQueryWrapper<LinggangSignInResource> wrapper = new LambdaQueryWrapper<>(entity); |
Bsth-admin/src/main/java/com/ruoyi/service/sign/in/resource/LinggangSignInResourceService.java
| @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService; | @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService; | ||
| 5 | import com.ruoyi.domain.OrderEntity; | 5 | import com.ruoyi.domain.OrderEntity; |
| 6 | import com.ruoyi.domain.sign.in.resource.LinggangSignInResource; | 6 | import com.ruoyi.domain.sign.in.resource.LinggangSignInResource; |
| 7 | 7 | ||
| 8 | +import java.util.Collection; | ||
| 8 | import java.util.List; | 9 | import java.util.List; |
| 9 | 10 | ||
| 10 | 11 | ||
| @@ -22,6 +23,8 @@ public interface LinggangSignInResourceService extends IService<LinggangSignInRe | @@ -22,6 +23,8 @@ public interface LinggangSignInResourceService extends IService<LinggangSignInRe | ||
| 22 | */ | 23 | */ |
| 23 | List<LinggangSignInResource> list(LinggangSignInResource entity); | 24 | List<LinggangSignInResource> list(LinggangSignInResource entity); |
| 24 | 25 | ||
| 26 | + List<LinggangSignInResource> listBySignIds(Collection<Long> signIds); | ||
| 27 | + | ||
| 25 | // List<LinggangSignInResource> listOfIds(java.util.Collection<java.lang.Long> ids); | 28 | // List<LinggangSignInResource> listOfIds(java.util.Collection<java.lang.Long> ids); |
| 26 | // /*** | 29 | // /*** |
| 27 | // *用于页面选择 | 30 | // *用于页面选择 |
Bsth-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDictData.java
| @@ -169,6 +169,10 @@ public class SysDictData extends BaseEntity { | @@ -169,6 +169,10 @@ public class SysDictData extends BaseEntity { | ||
| 169 | this.discKey = discKey; | 169 | this.discKey = discKey; |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | + public boolean isCombationVal(){ | ||
| 173 | + return org.apache.commons.lang3.StringUtils.equals("1", getStatus()); | ||
| 174 | + } | ||
| 175 | + | ||
| 172 | @Override | 176 | @Override |
| 173 | public String toString() { | 177 | public String toString() { |
| 174 | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) | 178 | return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) |
Bsth-system/src/main/java/com/ruoyi/system/service/ISysDictDataService.java
| 1 | package com.ruoyi.system.service; | 1 | package com.ruoyi.system.service; |
| 2 | 2 | ||
| 3 | -import java.util.Collection; | ||
| 4 | -import java.util.List; | ||
| 5 | - | ||
| 6 | import com.baomidou.mybatisplus.extension.service.IService; | 3 | import com.baomidou.mybatisplus.extension.service.IService; |
| 7 | import com.ruoyi.common.core.domain.entity.SysDictData; | 4 | import com.ruoyi.common.core.domain.entity.SysDictData; |
| 8 | 5 | ||
| 6 | +import java.util.Collection; | ||
| 7 | +import java.util.List; | ||
| 8 | + | ||
| 9 | /** | 9 | /** |
| 10 | * 字典 业务层 | 10 | * 字典 业务层 |
| 11 | * | 11 | * |
| @@ -26,6 +26,10 @@ public interface ISysDictDataService extends IService<SysDictData> { | @@ -26,6 +26,10 @@ public interface ISysDictDataService extends IService<SysDictData> { | ||
| 26 | 26 | ||
| 27 | SysDictData getOne(SysDictData sysDictData); | 27 | SysDictData getOne(SysDictData sysDictData); |
| 28 | 28 | ||
| 29 | + SysDictData getResourceBaseUrl(); | ||
| 30 | + | ||
| 31 | + String combationValue(String url,SysDictData dictData); | ||
| 32 | + | ||
| 29 | /** | 33 | /** |
| 30 | * 根据字典类型和字典键值查询字典数据信息 | 34 | * 根据字典类型和字典键值查询字典数据信息 |
| 31 | * | 35 | * |
Bsth-system/src/main/java/com/ruoyi/system/service/impl/SysDictDataServiceImpl.java
| 1 | package com.ruoyi.system.service.impl; | 1 | package com.ruoyi.system.service.impl; |
| 2 | 2 | ||
| 3 | -import java.util.Collection; | ||
| 4 | -import java.util.List; | ||
| 5 | - | ||
| 6 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; | 3 | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| 7 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; | 4 | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| 8 | -import org.apache.commons.collections4.CollectionUtils; | ||
| 9 | -import org.springframework.beans.factory.annotation.Autowired; | ||
| 10 | -import org.springframework.stereotype.Service; | ||
| 11 | import com.ruoyi.common.core.domain.entity.SysDictData; | 5 | import com.ruoyi.common.core.domain.entity.SysDictData; |
| 12 | import com.ruoyi.common.utils.DictUtils; | 6 | import com.ruoyi.common.utils.DictUtils; |
| 13 | import com.ruoyi.system.mapper.SysDictDataMapper; | 7 | import com.ruoyi.system.mapper.SysDictDataMapper; |
| 14 | import com.ruoyi.system.service.ISysDictDataService; | 8 | import com.ruoyi.system.service.ISysDictDataService; |
| 9 | +import org.apache.commons.collections4.CollectionUtils; | ||
| 10 | +import org.apache.commons.lang3.StringUtils; | ||
| 11 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 12 | +import org.springframework.stereotype.Service; | ||
| 13 | + | ||
| 14 | +import java.util.Collection; | ||
| 15 | +import java.util.List; | ||
| 16 | +import java.util.Objects; | ||
| 15 | 17 | ||
| 16 | /** | 18 | /** |
| 17 | * 字典 业务层处理 | 19 | * 字典 业务层处理 |
| @@ -55,6 +57,55 @@ public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDi | @@ -55,6 +57,55 @@ public class SysDictDataServiceImpl extends ServiceImpl<SysDictDataMapper, SysDi | ||
| 55 | return getOne(wrapper); | 57 | return getOne(wrapper); |
| 56 | } | 58 | } |
| 57 | 59 | ||
| 60 | + @Override | ||
| 61 | + public SysDictData getResourceBaseUrl() { | ||
| 62 | + SysDictData source = new SysDictData(); | ||
| 63 | + source.setDictType("resource_base_url"); | ||
| 64 | + List<SysDictData> sysDictDatas = queryDictDateList(source); | ||
| 65 | + | ||
| 66 | + String url1 = ""; | ||
| 67 | + String flag1 = null; | ||
| 68 | + | ||
| 69 | + if (CollectionUtils.isNotEmpty(sysDictDatas)) { | ||
| 70 | + for (SysDictData s : sysDictDatas) { | ||
| 71 | + if (Objects.equals(s.getDiscKey(), "resource_base_url")) { | ||
| 72 | + url1 = s.getDictValueStr(); | ||
| 73 | + continue; | ||
| 74 | + } | ||
| 75 | + | ||
| 76 | + if (org.apache.commons.lang3.StringUtils.equals(s.getDiscKey(), "resource_base_url_flag")) { | ||
| 77 | + flag1 = s.getDictValueStr(); | ||
| 78 | + continue; | ||
| 79 | + } | ||
| 80 | + } | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + SysDictData target = new SysDictData(); | ||
| 84 | + target.setDictValue(url1); | ||
| 85 | + target.setStatus(flag1); | ||
| 86 | + | ||
| 87 | + return target; | ||
| 88 | + } | ||
| 89 | + | ||
| 90 | + @Override | ||
| 91 | + public String combationValue(String url, SysDictData dictData) { | ||
| 92 | + if (Objects.isNull(dictData) || StringUtils.isEmpty(url)) { | ||
| 93 | + return url; | ||
| 94 | + } | ||
| 95 | + | ||
| 96 | + if (dictData.isCombationVal()) { | ||
| 97 | + String fil = "/"; | ||
| 98 | + | ||
| 99 | + if (org.apache.commons.lang3.StringUtils.startsWith(url, "/") || org.apache.commons.lang3.StringUtils.startsWith(url, "\\")) { | ||
| 100 | + fil = ""; | ||
| 101 | + } else if (org.apache.commons.lang3.StringUtils.endsWith(dictData.getDictValueStr(), "/")) { | ||
| 102 | + fil = ""; | ||
| 103 | + } | ||
| 104 | + return org.apache.commons.lang3.StringUtils.join(dictData.getDictValueStr(), fil, url); | ||
| 105 | + } | ||
| 106 | + return url; | ||
| 107 | + } | ||
| 108 | + | ||
| 58 | /** | 109 | /** |
| 59 | * 根据字典类型和字典键值查询字典数据信息 | 110 | * 根据字典类型和字典键值查询字典数据信息 |
| 60 | * | 111 | * |