From a58d740c8ef15c0bafcf5d3b76abb54333c2028e Mon Sep 17 00:00:00 2001 From: wl <173@qq.com> Date: 星期五, 21 十月 2022 13:34:10 +0800 Subject: [PATCH] 处理 车牌号重复 我的代办重构 导出名字 --- ycl-common/src/main/java/com/ycl/service/depart/impl/UmsDepartServiceImpl.java | 11 -- ycl-common/src/main/java/com/ycl/enums/common/ResultCode.java | 1 ycl-common/src/main/java/com/ycl/entity/user/UmsDepartManage.java | 6 ycl-common/src/main/java/com/ycl/service/user/UmsDepartManageService.java | 4 ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java | 7 + ycl-common/src/main/java/com/ycl/controller/depart/DepartController.java | 20 +++ ycl-common/src/main/java/com/ycl/service/user/impl/UmsDepartManageServiceImpl.java | 70 +++++++++++++ ycl-platform/src/main/java/com/ycl/controller/epuipment/EquipmentBayonetController.java | 12 - ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java | 34 ------ ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml | 20 ++++ ycl-common/src/main/java/com/ycl/controller/user/UmsAdminController.java | 24 ++-- ycl-platform/src/main/java/com/ycl/controller/carManage/CarManageController.java | 22 +++ ycl-common/src/main/java/com/ycl/controller/user/UmsAdminLogController.java | 12 - ycl-platform/src/main/java/com/ycl/entity/carManage/CarSlagcar.java | 20 +++ ycl-platform/src/test/java/com/ycl/sccgplatform/SccgPlatformApplicationTests.java | 9 + 15 files changed, 182 insertions(+), 90 deletions(-) diff --git a/ycl-common/src/main/java/com/ycl/controller/depart/DepartController.java b/ycl-common/src/main/java/com/ycl/controller/depart/DepartController.java index e3d63c6..4f02c6b 100644 --- a/ycl-common/src/main/java/com/ycl/controller/depart/DepartController.java +++ b/ycl-common/src/main/java/com/ycl/controller/depart/DepartController.java @@ -9,7 +9,9 @@ import com.ycl.api.BasePageVO; import com.ycl.api.CommonResult; import com.ycl.controller.BaseController; +import com.ycl.entity.depart.DepartManager; import com.ycl.entity.depart.UmsDepart; +import com.ycl.entity.user.UmsDepartManage; import com.ycl.service.depart.UmsDepartService; import com.ycl.service.user.UmsDepartManageService; import com.ycl.utils.auth.UserAuthUtil; @@ -108,7 +110,7 @@ @ApiOperation("鏌ヨ鍏ㄩ儴閮ㄩ棬") @GetMapping(value = "/page") public CommonResult<IPage<UmsDepartVO>> page(@RequestParam("currentPage") Integer currentPage, @RequestParam("pageSize") Integer pageSize, - @RequestParam(value = "departName", required = false) String departName) { + @RequestParam(value = "departName", required = false) String departName) { IPage<UmsDepartVO> page = new Page<>(currentPage, pageSize); departService.pageDepart(departName, page); return CommonResult.success(page); @@ -121,6 +123,22 @@ return CommonResult.success(basePageDTO); } + @ApiOperation("鐢ㄦ埛淇敼瑙掕壊") + @PutMapping(value = "/user_update_Role") + public CommonResult userUpdateRole(@RequestParam Long id, + @RequestParam List<Long> roles) { + umsAdminDepartService.userUpdateRoles(id, roles); + return CommonResult.success("update success"); + } + + @ApiOperation("鐢ㄦ埛淇敼閮ㄩ棬") + @PutMapping(value = "/user_update_depart") + public CommonResult userUpdateDepart(@RequestParam Long id, + @RequestParam List<UmsDepartManage> departmentIds) { + umsAdminDepartService.userUpdateDepart(id, departmentIds); + return CommonResult.success("update success"); + } + @ApiOperation("鏌ヨ椤剁骇閮ㄩ棬") @GetMapping(value = "/query_father") public CommonResult search() { diff --git a/ycl-common/src/main/java/com/ycl/controller/user/UmsAdminController.java b/ycl-common/src/main/java/com/ycl/controller/user/UmsAdminController.java index 4ac0d6d..f3d12e7 100644 --- a/ycl-common/src/main/java/com/ycl/controller/user/UmsAdminController.java +++ b/ycl-common/src/main/java/com/ycl/controller/user/UmsAdminController.java @@ -54,7 +54,7 @@ @ApiOperation(value = "鐢ㄦ埛娉ㄥ唽") @RequestMapping(value = "/register", method = RequestMethod.POST) @ResponseBody - @LogSave(operationType = "鐢ㄦ埛绠$悊",contain = "娣诲姞鐢ㄦ埛") + @LogSave(operationType = "鐢ㄦ埛绠$悊", contain = "娣诲姞鐢ㄦ埛") public CommonResult<UmsAdmin> register(@Validated @RequestBody UmsAdminParam umsAdminParam) { UmsAdmin umsAdmin = adminService.register(umsAdminParam); if (umsAdmin == null) { @@ -142,7 +142,7 @@ @ApiOperation("淇敼鎸囧畾鐢ㄦ埛淇℃伅") @RequestMapping(value = "/update/{id}", method = RequestMethod.POST) @ResponseBody - @LogSave(operationType = "鐢ㄦ埛绠$悊",contain = "淇敼鐢ㄦ埛") + @LogSave(operationType = "鐢ㄦ埛绠$悊", contain = "淇敼鐢ㄦ埛") public CommonResult update(@PathVariable Long id, @RequestBody UmsAdmin admin) { boolean success = adminService.update(id, admin); if (success) { @@ -154,7 +154,7 @@ @ApiOperation("淇敼鎸囧畾鐢ㄦ埛瀵嗙爜") @RequestMapping(value = "/updatePassword", method = RequestMethod.POST) @ResponseBody - @LogSave(operationType = "鐢ㄦ埛绠$悊",contain = "淇敼鐢ㄦ埛瀵嗙爜") + @LogSave(operationType = "鐢ㄦ埛绠$悊", contain = "淇敼鐢ㄦ埛瀵嗙爜") public CommonResult updatePassword(@Validated @RequestBody UpdateAdminPasswordParam updatePasswordParam) { int status = adminService.updatePassword(updatePasswordParam); if (status > 0) { @@ -173,7 +173,7 @@ @ApiOperation("鍒犻櫎鎸囧畾鐢ㄦ埛淇℃伅") @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST) @ResponseBody - @LogSave(operationType = "鐢ㄦ埛绠$悊",contain = "鍒犻櫎鐢ㄦ埛") + @LogSave(operationType = "鐢ㄦ埛绠$悊", contain = "鍒犻櫎鐢ㄦ埛") public CommonResult delete(@PathVariable Long id) { boolean success = adminService.delete(id); if (success) { @@ -185,7 +185,7 @@ @ApiOperation("淇敼甯愬彿鐘舵��") @RequestMapping(value = "/updateStatus/{id}", method = RequestMethod.POST) @ResponseBody - @LogSave(operationType = "鐢ㄦ埛绠$悊",contain = "鐢ㄦ埛璐﹀彿鍚敤/绂佺敤") + @LogSave(operationType = "鐢ㄦ埛绠$悊", contain = "鐢ㄦ埛璐﹀彿鍚敤/绂佺敤") public CommonResult updateStatus(@PathVariable Long id, @RequestParam(value = "status") Integer status) { UmsAdmin umsAdmin = new UmsAdmin(); umsAdmin.setStatus(status); @@ -219,10 +219,10 @@ @ApiOperation("鎵归噺鍒犻櫎鐢ㄦ埛") @RequestMapping(value = "/deleteBatch", method = RequestMethod.POST) @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "鐢ㄦ埛Ids",required = true, dataType = "Array") + @ApiImplicitParam(name = "ids", value = "鐢ㄦ埛Ids", required = true, dataType = "Array") }) @ResponseBody - @LogSave(operationType = "鐢ㄦ埛绠$悊",contain = "鎵归噺鍒犻櫎鐢ㄦ埛") + @LogSave(operationType = "鐢ㄦ埛绠$悊", contain = "鎵归噺鍒犻櫎鐢ㄦ埛") public CommonResult deleteBatch(@RequestParam("ids") List<Long> ids) { boolean success = adminService.deleteBatch(ids); if (success) { @@ -234,11 +234,11 @@ @ApiOperation("鎵归噺淇敼鐢ㄦ埛鐘舵��") @RequestMapping(value = "/updateStatusBatch", method = RequestMethod.POST) @ApiImplicitParams({ - @ApiImplicitParam(name = "ids", value = "鐢ㄦ埛Ids",required = true, dataType = "Array"), - @ApiImplicitParam(name = "status", value = "鐘舵��0->绂佺敤锛�1->鍚敤",required = true, dataType = "Integer") + @ApiImplicitParam(name = "ids", value = "鐢ㄦ埛Ids", required = true, dataType = "Array"), + @ApiImplicitParam(name = "status", value = "鐘舵��0->绂佺敤锛�1->鍚敤", required = true, dataType = "Integer") }) @ResponseBody - @LogSave(operationType = "鐢ㄦ埛绠$悊",contain = "鐢ㄦ埛璐﹀彿鎵归噺鍚敤/绂佺敤") + @LogSave(operationType = "鐢ㄦ埛绠$悊", contain = "鐢ㄦ埛璐﹀彿鎵归噺鍚敤/绂佺敤") public CommonResult updateStatusBatch(@RequestParam("ids") List<Long> ids, @RequestParam(value = "status") Integer status) { boolean success = adminService.updateStatusBatch(ids, status); if (success) { @@ -247,12 +247,10 @@ return CommonResult.failed(); } - @ApiOperation("鑾峰彇閮ㄩ棬浜哄憳") @RequestMapping(value = "/getDepartUser/{departId}", method = RequestMethod.GET) @ResponseBody public CommonResult<List<UmsAdmin>> getDepartUser(@PathVariable Long departId) { return CommonResult.success(adminService.getDepartUser(departId)); } - -} +} \ No newline at end of file diff --git a/ycl-common/src/main/java/com/ycl/controller/user/UmsAdminLogController.java b/ycl-common/src/main/java/com/ycl/controller/user/UmsAdminLogController.java index 3b468c5..0e6f76f 100644 --- a/ycl-common/src/main/java/com/ycl/controller/user/UmsAdminLogController.java +++ b/ycl-common/src/main/java/com/ycl/controller/user/UmsAdminLogController.java @@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletResponse; import java.net.URLEncoder; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.List; import java.util.stream.Collectors; @@ -95,17 +96,10 @@ Page<UmsAdminLoginLog> umsAdminLoginLogPage = new Page<>(); umsAdminLoginLogPage.setCurrent(logQueryParams.getCurrent()); umsAdminLoginLogPage.setSize(logQueryParams.getSize()); - StringBuilder fileName = new StringBuilder(); - fileName.append(LocalDateTime.now().getYear()) - .append("-") - .append(LocalDateTime.now().getMonthValue()) - .append("-") - .append(LocalDateTime.now().getDayOfMonth()) - .append("鏃ュ織鏁版嵁"); + String fileName ="鏃ュ織鏁版嵁"; response.setContentType("application/vnd.ms-excel"); response.setCharacterEncoding("utf-8"); - String file = URLEncoder.encode(fileName.toString(), "UTF-8").replaceAll("\\+", "%20"); - response.setHeader("Content-disposition", "attachment;filename=" + file + ".xlsx"); + response.setHeader("Content-disposition", "attachment;filename=" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + URLEncoder.encode(fileName + ".xlsx", "utf-8")); EasyExcel .write(response.getOutputStream(), UmsAdminLogVO.class) .sheet("鏁版嵁") diff --git a/ycl-common/src/main/java/com/ycl/entity/user/UmsDepartManage.java b/ycl-common/src/main/java/com/ycl/entity/user/UmsDepartManage.java index 3e965d0..ac1922b 100644 --- a/ycl-common/src/main/java/com/ycl/entity/user/UmsDepartManage.java +++ b/ycl-common/src/main/java/com/ycl/entity/user/UmsDepartManage.java @@ -6,6 +6,7 @@ import com.ycl.api.BaseEntity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import lombok.Data; import lombok.Getter; import lombok.Setter; @@ -19,10 +20,9 @@ * @author lyq * @since 2022-09-09 */ -@Getter -@Setter +@Data @TableName("ums_depart_manager") -@ApiModel(value = "UmsDepartManager瀵硅薄", description = "") +@ApiModel(value = "UmsDepartManager瀵硅薄") public class UmsDepartManage extends BaseEntity implements Serializable { private static final long serialVersionUID = 1L; diff --git a/ycl-common/src/main/java/com/ycl/enums/common/ResultCode.java b/ycl-common/src/main/java/com/ycl/enums/common/ResultCode.java index 16db2f4..05454bd 100644 --- a/ycl-common/src/main/java/com/ycl/enums/common/ResultCode.java +++ b/ycl-common/src/main/java/com/ycl/enums/common/ResultCode.java @@ -26,6 +26,7 @@ FILE_NOT_FOUND(2006, "鏂囦欢涓嶅瓨鍦�"), FILE_TYPE_FAIL(2007, "鏂囦欢鏍煎紡閿欒"), + CAR_NUMBER_REPETITION(2008, "杞︾墝鍙烽噸澶�"), NOT_LOGGED(2015, "鏈櫥褰�,璇风櫥褰曞悗鎿嶄綔"), LOGIN_TIMEOUT(2016, "鐧诲綍瓒呮椂,璇烽噸鏂扮櫥褰�"), diff --git a/ycl-common/src/main/java/com/ycl/service/depart/impl/UmsDepartServiceImpl.java b/ycl-common/src/main/java/com/ycl/service/depart/impl/UmsDepartServiceImpl.java index 6d18845..bc40ae3 100644 --- a/ycl-common/src/main/java/com/ycl/service/depart/impl/UmsDepartServiceImpl.java +++ b/ycl-common/src/main/java/com/ycl/service/depart/impl/UmsDepartServiceImpl.java @@ -1,14 +1,9 @@ package com.ycl.service.depart.impl; -import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.ycl.dto.user.AdminDepartDTO; import com.ycl.entity.depart.UmsDepart; -import com.ycl.entity.dict.DataDictionary; -import com.ycl.entity.user.UmsDepartManage; import com.ycl.enums.common.ResultCode; import com.ycl.exception.ApiException; import com.ycl.mapper.depart.UmsDepartMapper; @@ -17,7 +12,6 @@ import com.ycl.service.depart.UmsDepartService; import com.ycl.service.user.UmsAdminService; import com.ycl.service.user.UmsDepartManageService; -import com.ycl.utils.common.PojoUtils; import com.ycl.vo.depart.DepartVO; import com.ycl.vo.depart.UmsDepartVO; import org.apache.commons.lang3.StringUtils; @@ -27,7 +21,6 @@ import javax.annotation.Resource; import java.time.LocalDateTime; -import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; @@ -94,7 +87,6 @@ umsDepartService.updateById(depart); if (updateDepartVO.getDepartManagerList().size() > 0) { iDepartManagerService.deleteByDepartId(depart.getId()); - updateDepartVO.getDepartManagerList() .forEach(item -> { item.setCreateTime(LocalDateTime.now()); @@ -196,5 +188,4 @@ UmsDepart sccgDepart = this.sccgDepartMapper.selectOne(queryWrapper); return sccgDepart; } - -} +} \ No newline at end of file diff --git a/ycl-common/src/main/java/com/ycl/service/user/UmsDepartManageService.java b/ycl-common/src/main/java/com/ycl/service/user/UmsDepartManageService.java index d09e114..c7a1d6e 100644 --- a/ycl-common/src/main/java/com/ycl/service/user/UmsDepartManageService.java +++ b/ycl-common/src/main/java/com/ycl/service/user/UmsDepartManageService.java @@ -23,4 +23,8 @@ void deletedByDepartId(long departId); BasePageDTO belongDepart(long userId, int current, int pageSize); + + void userUpdateRoles(Long id, List<Long> roles); + + void userUpdateDepart(Long id, List<UmsDepartManage> roles); } diff --git a/ycl-common/src/main/java/com/ycl/service/user/impl/UmsDepartManageServiceImpl.java b/ycl-common/src/main/java/com/ycl/service/user/impl/UmsDepartManageServiceImpl.java index 514b105..b9f8f3a 100644 --- a/ycl-common/src/main/java/com/ycl/service/user/impl/UmsDepartManageServiceImpl.java +++ b/ycl-common/src/main/java/com/ycl/service/user/impl/UmsDepartManageServiceImpl.java @@ -5,18 +5,22 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.ycl.api.BasePageDTO; import com.ycl.entity.depart.UmsDepart; -import com.ycl.entity.user.UmsAdmin; -import com.ycl.entity.user.UmsDepartManage; +import com.ycl.entity.user.*; +import com.ycl.mapper.user.AdminMenuRelationMapper; +import com.ycl.mapper.user.UmsAdminRoleRelationMapper; import com.ycl.mapper.user.UmsDepartManageMapper; +import com.ycl.mapper.user.UmsRoleMenuRelationMapper; import com.ycl.service.depart.UmsDepartService; -import com.ycl.service.user.UmsDepartManageService; import com.ycl.service.user.UmsAdminService; +import com.ycl.service.user.UmsDepartManageService; import com.ycl.vo.depart.DepartVO; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.ArrayList; +import java.util.Date; import java.util.List; +import java.util.stream.Collectors; /** * <p> @@ -35,6 +39,12 @@ private UmsDepartService sccgDepartService; @Resource private UmsAdminService umsAdminService; + @Resource + UmsAdminRoleRelationMapper umsAdminRoleRelationMapper; + @Resource + AdminMenuRelationMapper adminMenuRelationMapper; + @Resource + UmsRoleMenuRelationMapper roleMenuRelationMapper; @Override public List<UmsDepartManage> queryByDepartId(Long departId) { @@ -87,4 +97,56 @@ return basePageDTO; } -} + @Override + public void userUpdateRoles(Long id, List<Long> roles) { + //瑙i櫎鐢ㄦ埛瑙掕壊缁戝畾 + umsAdminRoleRelationMapper.delete(new LambdaQueryWrapper<UmsAdminRoleRelation>().eq(UmsAdminRoleRelation::getAdminId, id)); + //瑙i櫎鐢ㄦ埛缁戝畾瑙掕壊缁戝畾鑿滃崟 + adminMenuRelationMapper.delete(new LambdaQueryWrapper<AdminMenuRelation>().eq(AdminMenuRelation::getAdminId, id)); + //缁戝畾瑙掕壊浜庣敤鎴� + if (!roles.isEmpty()) { + for (Long role : roles) { + UmsAdminRoleRelation urr = new UmsAdminRoleRelation(); + urr.setAdminId(id); + urr.setRoleId(role); + umsAdminRoleRelationMapper.insert(urr); + } + } + //缁戝畾鑿滃崟浜庣敤鎴� + ArrayList<UmsRoleMenuRelation> umsRoleMenuRelations = new ArrayList<>(); + for (Long role : roles) { + umsRoleMenuRelations.addAll(roleMenuRelationMapper + .selectList(new LambdaQueryWrapper<UmsRoleMenuRelation>() + .eq(UmsRoleMenuRelation::getRoleId, role))); + } + umsRoleMenuRelations + .stream() + .map(item->item.getMenuId()) + .collect(Collectors.toList()) + .stream() + .distinct() + .collect(Collectors.toList()) + .stream() + .forEach(item -> { + AdminMenuRelation adminMenuRelation = new AdminMenuRelation(); + adminMenuRelation.setAdminId(id); + adminMenuRelation.setMenuId(item); + adminMenuRelationMapper.insert(adminMenuRelation); + }); + } + + @Override + public void userUpdateDepart(Long id, List<UmsDepartManage> departIds) { + umsDepartManageMapper.delete(new LambdaQueryWrapper<UmsDepartManage>().eq(UmsDepartManage::getUserId,id)); + departIds + .stream() + .forEach(item->{ + UmsDepartManage umsDepartManage = new UmsDepartManage(); + umsDepartManage.setDepartId(item.getDepartId()); + umsDepartManage.setUserId(id); + umsDepartManage.setIsLeader(item.getIsLeader()); + umsDepartManage.setCreateTime(new Date()); + umsDepartManageMapper.insert(umsDepartManage); + }); + } +} \ No newline at end of file diff --git a/ycl-platform/src/main/java/com/ycl/controller/carManage/CarManageController.java b/ycl-platform/src/main/java/com/ycl/controller/carManage/CarManageController.java index 59e643e..c8e08d6 100644 --- a/ycl-platform/src/main/java/com/ycl/controller/carManage/CarManageController.java +++ b/ycl-platform/src/main/java/com/ycl/controller/carManage/CarManageController.java @@ -9,6 +9,8 @@ import com.ycl.controller.BaseController; import com.ycl.entity.carManage.CarEnforcecar; import com.ycl.entity.carManage.CarSlagcar; +import com.ycl.enums.common.ResultCode; +import com.ycl.exception.ApiException; import com.ycl.service.carManage.ICarEnforcecarService; import com.ycl.service.carManage.ICarSlagcarService; import io.swagger.annotations.Api; @@ -91,28 +93,40 @@ @ApiOperation("娣诲姞鎵ф硶杞�") @PostMapping("/addition_enforce") - @LogSave(operationType = "杞︿咯绠$悊",contain = "娣诲姞鎵ф硶杞�") + @LogSave(operationType = "杞︿咯绠$悊", contain = "娣诲姞鎵ф硶杞�") public CommonResult addEnforceCar(@RequestBody CarEnforcecar carEnforcecar) { + CarEnforcecar enforceCar = iCarEnforcecarService + .getOne(new LambdaQueryWrapper<CarEnforcecar>() + .eq(CarEnforcecar::getCarNumber, carEnforcecar.getCarNumber())); + if (StringUtils.isNotBlank(enforceCar.getCarNumber())) { + throw new ApiException(ResultCode.CAR_NUMBER_REPETITION.getMessage()); + } return CommonResult.success(iCarEnforcecarService.save(carEnforcecar)); } @ApiOperation("娣诲姞娓e湡杞�") @PostMapping("/addition_slag") - @LogSave(operationType = "杞︿咯绠$悊",contain = "娣诲姞娓e湡杞�") + @LogSave(operationType = "杞︿咯绠$悊", contain = "娣诲姞娓e湡杞�") public CommonResult addSlagCar(@RequestBody CarSlagcar carSlagcar) { + CarSlagcar slagCar = iCarSlagcarService + .getOne(new LambdaQueryWrapper<CarSlagcar>() + .eq(CarSlagcar::getCarNumber, carSlagcar.getCarNumber())); + if (StringUtils.isNotBlank(slagCar.getCarNumber())) { + throw new ApiException(ResultCode.CAR_NUMBER_REPETITION.getMessage()); + } return CommonResult.success(iCarSlagcarService.save(carSlagcar)); } @ApiOperation("鍒犻櫎鎵ф硶杞�") @DeleteMapping("/deletion_enforce") - @LogSave(operationType = "杞︿咯绠$悊",contain = "鍒犻櫎鎵ф硶杞�") + @LogSave(operationType = "杞︿咯绠$悊", contain = "鍒犻櫎鎵ф硶杞�") public CommonResult deleteEnforceCar(@RequestParam Integer id) { return CommonResult.success(iCarEnforcecarService.removeById(id)); } @ApiOperation("鍒犻櫎娓e湡杞�") @DeleteMapping("/deletion_slag") - @LogSave(operationType = "杞︿咯绠$悊",contain = "鍒犻櫎娓e湡杞�") + @LogSave(operationType = "杞︿咯绠$悊", contain = "鍒犻櫎娓e湡杞�") public CommonResult deleteSlagCar(@RequestParam Integer id) { return CommonResult.success(iCarSlagcarService.removeById(id)); } diff --git a/ycl-platform/src/main/java/com/ycl/controller/epuipment/EquipmentBayonetController.java b/ycl-platform/src/main/java/com/ycl/controller/epuipment/EquipmentBayonetController.java index 21ba024..8f2ef89 100644 --- a/ycl-platform/src/main/java/com/ycl/controller/epuipment/EquipmentBayonetController.java +++ b/ycl-platform/src/main/java/com/ycl/controller/epuipment/EquipmentBayonetController.java @@ -23,6 +23,7 @@ import javax.servlet.http.HttpServletResponse; import java.net.URLEncoder; import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.stream.Collectors; /** @@ -91,17 +92,10 @@ Page<EquipmentBayonet> equipmentBayonetPage = new Page<>(); equipmentBayonetPage.setCurrent(current); equipmentBayonetPage.setSize(size); - StringBuilder fileName = new StringBuilder(); - fileName.append(LocalDateTime.now().getYear()) - .append("-") - .append(LocalDateTime.now().getMonthValue()) - .append("-") - .append(LocalDateTime.now().getDayOfMonth()) - .append("鍗″彛鏁版嵁"); + String fileName ="鍗″彛鏁版嵁"; response.setContentType("application/vnd.ms-excel"); response.setCharacterEncoding("utf-8"); - String file = URLEncoder.encode(fileName.toString(), "UTF-8").replaceAll("\\+", "%20"); - response.setHeader("Content-disposition", "attachment;filename=" + file + ".xlsx"); + response.setHeader("Content-disposition", "attachment;filename=" + LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) + URLEncoder.encode(fileName + ".xlsx", "utf-8")); EasyExcel.write(response.getOutputStream(), EquipmentBayonetVO.class) .sheet("鏁版嵁") .doWrite(iEquipmentBayonetService diff --git a/ycl-platform/src/main/java/com/ycl/entity/carManage/CarSlagcar.java b/ycl-platform/src/main/java/com/ycl/entity/carManage/CarSlagcar.java index 9993a50..d3ef2f8 100644 --- a/ycl-platform/src/main/java/com/ycl/entity/carManage/CarSlagcar.java +++ b/ycl-platform/src/main/java/com/ycl/entity/carManage/CarSlagcar.java @@ -67,4 +67,22 @@ private String constructionOrg; -} + /** + * 鐢佃瘽 + */ + @TableField("phone") + private String phone; + + + /** + * 杞︿富濮撳悕 + */ + @TableField("car_owner") + private String carOwner; + + /** + * 杞︿咯浣跨敤浜哄憳 + */ + @TableField("car_user") + private String carUser; +} \ No newline at end of file diff --git a/ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java b/ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java index a9cd08c..ff0602c 100644 --- a/ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java +++ b/ycl-platform/src/main/java/com/ycl/mapper/caseHandler/DisposeRecordMapper.java @@ -1,7 +1,11 @@ package com.ycl.mapper.caseHandler; -import com.ycl.entity.caseHandler.DisposeRecord; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ycl.entity.caseHandler.DisposeRecord; +import com.ycl.vo.MyBacklogVO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * <p> @@ -13,4 +17,5 @@ */ public interface DisposeRecordMapper extends BaseMapper<DisposeRecord> { + List<MyBacklogVO> selectMyBackList(@Param("id") Long id, @Param("code") String code); } diff --git a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java index f7db044..627cebf 100644 --- a/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java +++ b/ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/DisposeRecordServiceImpl.java @@ -50,39 +50,7 @@ @Override public List<MyBacklogVO> listMyTask(String num, Long userId) { - ArrayList<MyBacklogVO> myBacklogVOS = new ArrayList<>(); - umsAdminRoleRelationMapper - .selectList(new LambdaQueryWrapper<UmsAdminRoleRelation>() - .eq(UmsAdminRoleRelation::getAdminId, userId)) - .forEach(item1 -> - myBacklogVOS.addAll(disposeRecordMapper.selectList( - new LambdaQueryWrapper<DisposeRecord>() - .eq(DisposeRecord::getHandlerRoleId, item1.getRoleId()) - .isNull(DisposeRecord::getEndTime)) - .stream() - .filter(item -> { - if (StringUtils.isBlank(num)) { - return true; - } else { - BaseCase baseCase = baseCaseMapper.selectById(item.getBaseCaseId()); - if (baseCase.getCode().contains(num)) { - return true; - } else { - return false; - } - } - }) - .map(item -> { - MyBacklogVO myBacklogVO = new MyBacklogVO(); - BeanUtils.copyProperties(item, myBacklogVO); - BaseCase baseCase = baseCaseMapper.selectById(item.getBaseCaseId()); - myBacklogVO.setCategory(baseCase.getCategory()); - myBacklogVO.setEventSource(baseCase.getEventSource()); - myBacklogVO.setCode(baseCase.getCode()); - return myBacklogVO; - }).collect(Collectors.toList())) - ); - return myBacklogVOS; + return disposeRecordMapper.selectMyBackList(userId,num); } @Override diff --git a/ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml b/ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml index 6aa50ed..fc7f13a 100644 --- a/ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml +++ b/ycl-platform/src/main/resources/mapper/caseHandler/DisposeRecordMapper.xml @@ -21,4 +21,24 @@ <sql id="Base_Column_List"> id, base_case_id, step_name, start_time, handler_role_id, end_time, state, handler_id, create_user, create_time </sql> + + <select id="selectMyBackList" resultType="com.ycl.vo.MyBacklogVO"> + SELECT + t3.event_source, + t3.category, + t2.step_name, + t3.`code`, + t2.create_time + FROM + ums_admin_role_relation t1 + JOIN ums_dispose_record t2 ON t1.role_id = t2.handler_role_id + JOIN ums_base_case t3 ON t2.base_case_id=t3.id + <where> + t1.admin_id = #{id} + AND ISNULL( t2.end_time ) + <if test="code!='' and code!=null"> + and t3.`code` LIKE CONCAT('%',#{code},'%') + </if> + </where> + </select> </mapper> diff --git a/ycl-platform/src/test/java/com/ycl/sccgplatform/SccgPlatformApplicationTests.java b/ycl-platform/src/test/java/com/ycl/sccgplatform/SccgPlatformApplicationTests.java index 22fe8d9..4a8a6a9 100644 --- a/ycl-platform/src/test/java/com/ycl/sccgplatform/SccgPlatformApplicationTests.java +++ b/ycl-platform/src/test/java/com/ycl/sccgplatform/SccgPlatformApplicationTests.java @@ -7,6 +7,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.format.DateTimeFormatter; import java.util.Map; @SpringBootTest @@ -33,8 +36,10 @@ @Test void createCode() { - System.out.println(utilNumber.createShopCode()); - System.out.println(utilNumber.createCaseCode()); + // LocalDateTime parse = LocalDateTime.parse("2017-02-02 08:59:12", DateTimeFormatter.ofPattern("yyyy-MM-dd hh:mm:ss")); + LocalDateTime ldt = LocalDateTime.parse("2017-02-02 08:44:12", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); + System.out.println(ldt); + } @Test -- Gitblit v1.8.0