diff --git a/src/main/java/com/lz/config/ShiroConfig.java b/src/main/java/com/lz/config/ShiroConfig.java index 0eae9bdf..9b7bb581 100644 --- a/src/main/java/com/lz/config/ShiroConfig.java +++ b/src/main/java/com/lz/config/ShiroConfig.java @@ -64,6 +64,7 @@ public class ShiroConfig { filterMap.put("/captcha.jpg", "anon"); filterMap.put("/aaa.txt", "anon"); filterMap.put("/dtlg/login", "anon"); + filterMap.put("/api/**", "anon"); filterMap.put("/dtlg/luck", "anon"); filterMap.put("/dtlg/look", "anon"); filterMap.put("/dtlg/jump", "anon"); diff --git a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java index 26c69009..f4ce2d75 100644 --- a/src/main/java/com/lz/modules/app/controller/ResultRecordController.java +++ b/src/main/java/com/lz/modules/app/controller/ResultRecordController.java @@ -35,10 +35,7 @@ import org.apache.commons.collections.CollectionUtils; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.text.SimpleDateFormat; diff --git a/src/main/java/com/lz/modules/app/dao/StaffDao.java b/src/main/java/com/lz/modules/app/dao/StaffDao.java index 8a27ceac..eb2e1bca 100644 --- a/src/main/java/com/lz/modules/app/dao/StaffDao.java +++ b/src/main/java/com/lz/modules/app/dao/StaffDao.java @@ -1,11 +1,13 @@ package com.lz.modules.app.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.lz.modules.app.dto.GraphicsStatisticalDto; import com.lz.modules.app.dto.StaffBaseInfoDto; import com.lz.modules.app.dto.StaffDto; import com.lz.modules.app.dto.StaffStatisticalDto; import com.lz.modules.app.entity.StaffEntity; +import com.lz.modules.equipment.entity.model.FindByNameModel; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -74,4 +76,6 @@ public interface StaffDao extends BaseMapper { StaffEntity selectByPhone(@Param("phone") String phone); StaffEntity selectStaffByEmployeeId(@Param("employeeId") String employeeId); + + List selectBySearchName(@Param("page") IPage page, @Param("model") FindByNameModel nameModel); } diff --git a/src/main/java/com/lz/modules/app/service/StaffService.java b/src/main/java/com/lz/modules/app/service/StaffService.java index eab5315d..4ca790ee 100644 --- a/src/main/java/com/lz/modules/app/service/StaffService.java +++ b/src/main/java/com/lz/modules/app/service/StaffService.java @@ -1,5 +1,6 @@ package com.lz.modules.app.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.lz.common.utils.PageUtils; import com.lz.modules.app.dto.GraphicsStatisticalDto; @@ -7,6 +8,7 @@ import com.lz.modules.app.dto.StaffBaseInfoDto; import com.lz.modules.app.dto.StaffDto; import com.lz.modules.app.dto.StaffStatisticalDto; import com.lz.modules.app.entity.StaffEntity; +import com.lz.modules.equipment.entity.model.FindByNameModel; import com.lz.modules.job.model.responseBo.DepartmentStaffBo; import java.util.List; @@ -71,5 +73,7 @@ public interface StaffService extends IService { StaffEntity selectByPhone(String userName); StaffEntity selectStaffByEmployeeId(String employeeId); + + List selectBySearchName(IPage page, FindByNameModel nameModel); } diff --git a/src/main/java/com/lz/modules/app/service/impl/StaffServiceImpl.java b/src/main/java/com/lz/modules/app/service/impl/StaffServiceImpl.java index b60a1d9f..fe0e0b49 100644 --- a/src/main/java/com/lz/modules/app/service/impl/StaffServiceImpl.java +++ b/src/main/java/com/lz/modules/app/service/impl/StaffServiceImpl.java @@ -16,6 +16,7 @@ import com.lz.modules.app.dto.StaffStatisticalDto; import com.lz.modules.app.dao.StaffDao; import com.lz.modules.app.entity.*; import com.lz.modules.app.service.*; +import com.lz.modules.equipment.entity.model.FindByNameModel; import com.lz.modules.job.model.responseBo.DepartmentStaffBo; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; @@ -92,6 +93,11 @@ public class StaffServiceImpl extends ServiceImpl impleme return staffDao.selectStaffByEmployeeId(employeeId); } + @Override + public List selectBySearchName(IPage page, FindByNameModel nameModel){ + return staffDao.selectBySearchName(page, nameModel); + } + @Override public PageUtils queryPage(Map params) { diff --git a/src/main/java/com/lz/modules/equipment/controller/EmployeeController.java b/src/main/java/com/lz/modules/equipment/controller/EmployeeController.java index ac5bb577..8b6b5ff0 100644 --- a/src/main/java/com/lz/modules/equipment/controller/EmployeeController.java +++ b/src/main/java/com/lz/modules/equipment/controller/EmployeeController.java @@ -32,7 +32,9 @@ import org.springframework.web.bind.annotation.RestController; import javax.validation.Valid; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -57,61 +59,28 @@ public class EmployeeController extends AbstractController { @PostMapping("findEmployeeByName") public R findEmployeeByName(@RequestBody @ApiParam FindByNameModel nameModel){ - List data = new ArrayList<>(); - PageUtils pageUtils = staffService.queryPage(); - Page employeesInfoPage = staffService.selectPage( - new Page<>(nameModel.getCurrPage(), nameModel.getPageSize()), - new EntityWrapper() - .eq("is_delete",0) - .like(StringUtil.isNotBlank(nameModel.getName()),"name",nameModel.getName())); - if(CollectionUtils.isEmpty(employeesInfoPage.getRecords())){ - return R.ok(); - } - employeesInfoPage.getRecords().stream().forEach(employeesInfo -> { - FindEmployeeResModel model = new FindEmployeeResModel(); - BeanUtils.copyProperties(employeesInfo,model); - model.setUserId(employeesInfo.getId()); - data.add(model); - }); - Page list = new Page<>(); - list.setTotal(employeesInfoPage.getPages()); - //list.setTotal(employeesInfoPage.getTotal()); - //list.setSize(employeesInfoPage.getSize()); - //long pages = list.getPages(); - list.setRecords(data); - return R.ok().put("data", list); + PageUtils pageUtils = PageUtils.startPage(nameModel.getCurrPage(), nameModel.getPageSize()).doSelect( + page -> staffService.selectBySearchName(page, nameModel) + ); + return R.ok().put("data", pageUtils); } @PostMapping("findSpecialApplyByName") public R findSpecialApplyByName(@RequestBody @ApiParam FindByNameModel nameModel){ List data = new ArrayList<>(); - Page specialApplyInfoPage = specialApplyInfoService.selectPage( - new Page<>(nameModel.getCurrPage(), nameModel.getPageSize()), - new EntityWrapper() - .eq("is_delete", 0) - .like(StringUtil.isNotBlank(nameModel.getName()), "type_desc", nameModel.getName())); + PageUtils pageUtils = PageUtils.startPage(nameModel.getCurrPage(), nameModel.getPageSize()).doSelect( + page -> specialApplyInfoService.selectBySearchName(page, nameModel) + ); - if(CollectionUtils.isEmpty(specialApplyInfoPage.getRecords())){ - return R.ok(); - } - specialApplyInfoPage.getRecords().stream().forEach(specialApplyInfo -> { - FindEmployeeResModel model = new FindEmployeeResModel(); - model.setUserId(specialApplyInfo.getId()); - model.setName(specialApplyInfo.getTypeDesc()); - data.add(model); - }); - Page list = new Page<>(); - list.setTotal(specialApplyInfoPage.getPages()); - list.setRecords(data); - return R.ok().put("data", list); + return R.ok().put("data", pageUtils); } @PostMapping("findUsersEquipmentsByName") public R findUsersEquipmentsByName(@RequestBody @ApiParam FindEquipmentsByNameModel nameModel){ - Page data = new Page<>(); + /*Page data = new Page<>(); Page equipmentInfoPage = iEquipmentInfoService.selectPage( new Page<>(nameModel.getCurrPage(), nameModel.getPageSize()), new EntityWrapper() @@ -130,7 +99,8 @@ public class EmployeeController extends AbstractController { }).collect(Collectors.toList()); data.setTotal(equipmentInfoPage.getPages()); data.setRecords(list); - return R.ok().put("data", data); + return R.ok().put("data", data);*/ + return null; } diff --git a/src/main/java/com/lz/modules/equipment/controller/EquipmentController.java b/src/main/java/com/lz/modules/equipment/controller/EquipmentController.java index b3c53326..f3264b0b 100644 --- a/src/main/java/com/lz/modules/equipment/controller/EquipmentController.java +++ b/src/main/java/com/lz/modules/equipment/controller/EquipmentController.java @@ -79,7 +79,7 @@ public class EquipmentController extends AbstractController { model.setSpecId(equipmentSpecs1.getId()); } }); - addRecord(equipmentInfo); + // addRecord(equipmentInfo); return R.ok().put("data", model); } diff --git a/src/main/java/com/lz/modules/equipment/dao/SpecialApplyInfoMapper.java b/src/main/java/com/lz/modules/equipment/dao/SpecialApplyInfoMapper.java index 5fddc5a1..2b0b33d9 100644 --- a/src/main/java/com/lz/modules/equipment/dao/SpecialApplyInfoMapper.java +++ b/src/main/java/com/lz/modules/equipment/dao/SpecialApplyInfoMapper.java @@ -8,10 +8,14 @@ package com.lz.modules.equipment.dao; * @since 2020-07-31 */ import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.lz.modules.equipment.entity.SpecialApplyInfo; +import com.lz.modules.equipment.entity.model.FindByNameModel; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + @Mapper public interface SpecialApplyInfoMapper extends BaseMapper { @@ -32,4 +36,6 @@ public interface SpecialApplyInfoMapper extends BaseMapper { SpecialApplyInfo selectSpecialApplyInfoByTypeDesc(@Param("owner") String owner); + + List selectBySearchName(@Param("page") IPage page, @Param("model") FindByNameModel nameModel); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/equipment/entity/model/FindByNameModel.java b/src/main/java/com/lz/modules/equipment/entity/model/FindByNameModel.java index 1c2b5113..99df3c72 100644 --- a/src/main/java/com/lz/modules/equipment/entity/model/FindByNameModel.java +++ b/src/main/java/com/lz/modules/equipment/entity/model/FindByNameModel.java @@ -12,6 +12,6 @@ import lombok.Data; @Data @ApiModel(value = "查找用户信息") public class FindByNameModel extends BasePage{ - @ApiModelProperty(value = "员工姓名", name = "name") + @ApiModelProperty(value = "使用地信息", name = "name") private String name; } diff --git a/src/main/java/com/lz/modules/equipment/service/SpecialApplyInfoService.java b/src/main/java/com/lz/modules/equipment/service/SpecialApplyInfoService.java index 6b0a43ae..aa61f634 100644 --- a/src/main/java/com/lz/modules/equipment/service/SpecialApplyInfoService.java +++ b/src/main/java/com/lz/modules/equipment/service/SpecialApplyInfoService.java @@ -1,8 +1,12 @@ package com.lz.modules.equipment.service; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import com.lz.modules.equipment.entity.SpecialApplyInfo; +import com.lz.modules.equipment.entity.model.FindByNameModel; + +import java.util.List; /** *

@@ -32,4 +36,6 @@ public interface SpecialApplyInfoService extends IService { SpecialApplyInfo selectSpecialApplyInfoByTypeDesc(String owner); + + List selectBySearchName(IPage page, FindByNameModel nameModel); } \ No newline at end of file diff --git a/src/main/java/com/lz/modules/equipment/service/impl/SpecialApplyInfoServiceImpl.java b/src/main/java/com/lz/modules/equipment/service/impl/SpecialApplyInfoServiceImpl.java index f9ec5ae2..91301735 100644 --- a/src/main/java/com/lz/modules/equipment/service/impl/SpecialApplyInfoServiceImpl.java +++ b/src/main/java/com/lz/modules/equipment/service/impl/SpecialApplyInfoServiceImpl.java @@ -1,12 +1,16 @@ package com.lz.modules.equipment.service.impl; +import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.lz.modules.equipment.dao.SpecialApplyInfoMapper; import com.lz.modules.equipment.entity.SpecialApplyInfo; +import com.lz.modules.equipment.entity.model.FindByNameModel; import com.lz.modules.equipment.service.SpecialApplyInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** *

* 其他可申领信息表 服务类 @@ -64,5 +68,10 @@ public class SpecialApplyInfoServiceImpl extends ServiceImpl selectBySearchName(IPage page, FindByNameModel nameModel){ + return specialApplyInfoMapper.selectBySearchName(page, nameModel); + } + } diff --git a/src/main/resources/mapper/app/ResultDetailMapper.xml b/src/main/resources/mapper/app/ResultDetailMapper.xml index 3dae9e21..bfab52ee 100644 --- a/src/main/resources/mapper/app/ResultDetailMapper.xml +++ b/src/main/resources/mapper/app/ResultDetailMapper.xml @@ -140,5 +140,6 @@ + diff --git a/src/main/resources/mapper/equipment/SpecialApplyInfoMapper.xml b/src/main/resources/mapper/equipment/SpecialApplyInfoMapper.xml index d7b9b53d..1de70e8f 100644 --- a/src/main/resources/mapper/equipment/SpecialApplyInfoMapper.xml +++ b/src/main/resources/mapper/equipment/SpecialApplyInfoMapper.xml @@ -21,13 +21,13 @@ - insert into special_apply_info( + insert into equipment_special_apply_info( type_desc, is_delete, gmt_create, @@ -43,7 +43,7 @@ update - special_apply_info + equipment_special_apply_info is_delete = #{isDelete}, gmt_create = #{gmtCreate}, @@ -56,7 +56,7 @@ update - special_apply_info + equipment_special_apply_info set is_delete = #{isDelete}, gmt_create = #{gmtCreate}, @@ -67,13 +67,20 @@ - update special_apply_info set is_delete = 1 where id=#{id} limit 1 + update equipment_special_apply_info set is_delete = 1 where id=#{id} limit 1 + + diff --git a/src/main/resources/mapper/generator/StaffDao.xml b/src/main/resources/mapper/generator/StaffDao.xml index 78b598d2..1136ba1e 100644 --- a/src/main/resources/mapper/generator/StaffDao.xml +++ b/src/main/resources/mapper/generator/StaffDao.xml @@ -437,4 +437,10 @@ select * from lz_staff where is_delete = 0 and employee_id = #{employeeId} limit 1 + +