部分修改

This commit is contained in:
wulin 2020-09-10 09:30:52 +08:00
parent 76b4004687
commit e3edc8d751
14 changed files with 72 additions and 55 deletions

View File

@ -64,6 +64,7 @@ public class ShiroConfig {
filterMap.put("/captcha.jpg", "anon"); filterMap.put("/captcha.jpg", "anon");
filterMap.put("/aaa.txt", "anon"); filterMap.put("/aaa.txt", "anon");
filterMap.put("/dtlg/login", "anon"); filterMap.put("/dtlg/login", "anon");
filterMap.put("/api/**", "anon");
filterMap.put("/dtlg/luck", "anon"); filterMap.put("/dtlg/luck", "anon");
filterMap.put("/dtlg/look", "anon"); filterMap.put("/dtlg/look", "anon");
filterMap.put("/dtlg/jump", "anon"); filterMap.put("/dtlg/jump", "anon");

View File

@ -35,10 +35,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;

View File

@ -1,11 +1,13 @@
package com.lz.modules.app.dao; package com.lz.modules.app.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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.GraphicsStatisticalDto;
import com.lz.modules.app.dto.StaffBaseInfoDto; import com.lz.modules.app.dto.StaffBaseInfoDto;
import com.lz.modules.app.dto.StaffDto; import com.lz.modules.app.dto.StaffDto;
import com.lz.modules.app.dto.StaffStatisticalDto; import com.lz.modules.app.dto.StaffStatisticalDto;
import com.lz.modules.app.entity.StaffEntity; 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.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -74,4 +76,6 @@ public interface StaffDao extends BaseMapper<StaffEntity> {
StaffEntity selectByPhone(@Param("phone") String phone); StaffEntity selectByPhone(@Param("phone") String phone);
StaffEntity selectStaffByEmployeeId(@Param("employeeId") String employeeId); StaffEntity selectStaffByEmployeeId(@Param("employeeId") String employeeId);
List<StaffEntity> selectBySearchName(@Param("page") IPage page, @Param("model") FindByNameModel nameModel);
} }

View File

@ -1,5 +1,6 @@
package com.lz.modules.app.service; package com.lz.modules.app.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.PageUtils; import com.lz.common.utils.PageUtils;
import com.lz.modules.app.dto.GraphicsStatisticalDto; 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.StaffDto;
import com.lz.modules.app.dto.StaffStatisticalDto; import com.lz.modules.app.dto.StaffStatisticalDto;
import com.lz.modules.app.entity.StaffEntity; import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.equipment.entity.model.FindByNameModel;
import com.lz.modules.job.model.responseBo.DepartmentStaffBo; import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
import java.util.List; import java.util.List;
@ -71,5 +73,7 @@ public interface StaffService extends IService<StaffEntity> {
StaffEntity selectByPhone(String userName); StaffEntity selectByPhone(String userName);
StaffEntity selectStaffByEmployeeId(String employeeId); StaffEntity selectStaffByEmployeeId(String employeeId);
List<StaffEntity> selectBySearchName(IPage page, FindByNameModel nameModel);
} }

View File

@ -16,6 +16,7 @@ import com.lz.modules.app.dto.StaffStatisticalDto;
import com.lz.modules.app.dao.StaffDao; import com.lz.modules.app.dao.StaffDao;
import com.lz.modules.app.entity.*; import com.lz.modules.app.entity.*;
import com.lz.modules.app.service.*; import com.lz.modules.app.service.*;
import com.lz.modules.equipment.entity.model.FindByNameModel;
import com.lz.modules.job.model.responseBo.DepartmentStaffBo; import com.lz.modules.job.model.responseBo.DepartmentStaffBo;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -92,6 +93,11 @@ public class StaffServiceImpl extends ServiceImpl<StaffDao, StaffEntity> impleme
return staffDao.selectStaffByEmployeeId(employeeId); return staffDao.selectStaffByEmployeeId(employeeId);
} }
@Override
public List<StaffEntity> selectBySearchName(IPage page, FindByNameModel nameModel){
return staffDao.selectBySearchName(page, nameModel);
}
@Override @Override
public PageUtils queryPage(Map<String, Object> params) { public PageUtils queryPage(Map<String, Object> params) {

View File

@ -32,7 +32,9 @@ import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid; import javax.validation.Valid;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
@ -57,61 +59,28 @@ public class EmployeeController extends AbstractController {
@PostMapping("findEmployeeByName") @PostMapping("findEmployeeByName")
public R findEmployeeByName(@RequestBody @ApiParam FindByNameModel nameModel){ public R findEmployeeByName(@RequestBody @ApiParam FindByNameModel nameModel){
List<FindEmployeeResModel> data = new ArrayList<>(); PageUtils pageUtils = PageUtils.startPage(nameModel.getCurrPage(), nameModel.getPageSize()).doSelect(
PageUtils pageUtils = staffService.queryPage(); page -> staffService.selectBySearchName(page, nameModel)
Page<StaffEntity> employeesInfoPage = staffService.selectPage( );
new Page<>(nameModel.getCurrPage(), nameModel.getPageSize()), return R.ok().put("data", pageUtils);
new EntityWrapper<StaffEntity>()
.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<FindEmployeeResModel> 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);
} }
@PostMapping("findSpecialApplyByName") @PostMapping("findSpecialApplyByName")
public R findSpecialApplyByName(@RequestBody @ApiParam FindByNameModel nameModel){ public R findSpecialApplyByName(@RequestBody @ApiParam FindByNameModel nameModel){
List<FindEmployeeResModel> data = new ArrayList<>(); List<FindEmployeeResModel> data = new ArrayList<>();
Page<SpecialApplyInfo> specialApplyInfoPage = specialApplyInfoService.selectPage( PageUtils pageUtils = PageUtils.startPage(nameModel.getCurrPage(), nameModel.getPageSize()).doSelect(
new Page<>(nameModel.getCurrPage(), nameModel.getPageSize()), page -> specialApplyInfoService.selectBySearchName(page, nameModel)
new EntityWrapper<SpecialApplyInfo>() );
.eq("is_delete", 0)
.like(StringUtil.isNotBlank(nameModel.getName()), "type_desc", nameModel.getName()));
if(CollectionUtils.isEmpty(specialApplyInfoPage.getRecords())){ return R.ok().put("data", pageUtils);
return R.ok();
}
specialApplyInfoPage.getRecords().stream().forEach(specialApplyInfo -> {
FindEmployeeResModel model = new FindEmployeeResModel();
model.setUserId(specialApplyInfo.getId());
model.setName(specialApplyInfo.getTypeDesc());
data.add(model);
});
Page<FindEmployeeResModel> list = new Page<>();
list.setTotal(specialApplyInfoPage.getPages());
list.setRecords(data);
return R.ok().put("data", list);
} }
@PostMapping("findUsersEquipmentsByName") @PostMapping("findUsersEquipmentsByName")
public R findUsersEquipmentsByName(@RequestBody @ApiParam FindEquipmentsByNameModel nameModel){ public R findUsersEquipmentsByName(@RequestBody @ApiParam FindEquipmentsByNameModel nameModel){
Page<FindEquipmentResModel> data = new Page<>(); /*Page<FindEquipmentResModel> data = new Page<>();
Page<EquipmentInfo> equipmentInfoPage = iEquipmentInfoService.selectPage( Page<EquipmentInfo> equipmentInfoPage = iEquipmentInfoService.selectPage(
new Page<>(nameModel.getCurrPage(), nameModel.getPageSize()), new Page<>(nameModel.getCurrPage(), nameModel.getPageSize()),
new EntityWrapper<EquipmentInfo>() new EntityWrapper<EquipmentInfo>()
@ -130,7 +99,8 @@ public class EmployeeController extends AbstractController {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
data.setTotal(equipmentInfoPage.getPages()); data.setTotal(equipmentInfoPage.getPages());
data.setRecords(list); data.setRecords(list);
return R.ok().put("data", data); return R.ok().put("data", data);*/
return null;
} }

View File

@ -79,7 +79,7 @@ public class EquipmentController extends AbstractController {
model.setSpecId(equipmentSpecs1.getId()); model.setSpecId(equipmentSpecs1.getId());
} }
}); });
addRecord(equipmentInfo); // addRecord(equipmentInfo);
return R.ok().put("data", model); return R.ok().put("data", model);
} }

View File

@ -8,10 +8,14 @@ package com.lz.modules.equipment.dao;
* @since 2020-07-31 * @since 2020-07-31
*/ */
import com.baomidou.mybatisplus.core.mapper.BaseMapper; 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.SpecialApplyInfo;
import com.lz.modules.equipment.entity.model.FindByNameModel;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper @Mapper
public interface SpecialApplyInfoMapper extends BaseMapper<SpecialApplyInfo> { public interface SpecialApplyInfoMapper extends BaseMapper<SpecialApplyInfo> {
@ -32,4 +36,6 @@ public interface SpecialApplyInfoMapper extends BaseMapper<SpecialApplyInfo> {
SpecialApplyInfo selectSpecialApplyInfoByTypeDesc(@Param("owner") String owner); SpecialApplyInfo selectSpecialApplyInfoByTypeDesc(@Param("owner") String owner);
List<SpecialApplyInfo> selectBySearchName(@Param("page") IPage page, @Param("model") FindByNameModel nameModel);
} }

View File

@ -12,6 +12,6 @@ import lombok.Data;
@Data @Data
@ApiModel(value = "查找用户信息") @ApiModel(value = "查找用户信息")
public class FindByNameModel extends BasePage{ public class FindByNameModel extends BasePage{
@ApiModelProperty(value = "员工姓名", name = "name") @ApiModelProperty(value = "使用地信息", name = "name")
private String name; private String name;
} }

View File

@ -1,8 +1,12 @@
package com.lz.modules.equipment.service; package com.lz.modules.equipment.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.modules.equipment.entity.SpecialApplyInfo; import com.lz.modules.equipment.entity.SpecialApplyInfo;
import com.lz.modules.equipment.entity.model.FindByNameModel;
import java.util.List;
/** /**
* <p> * <p>
@ -32,4 +36,6 @@ public interface SpecialApplyInfoService extends IService<SpecialApplyInfo> {
SpecialApplyInfo selectSpecialApplyInfoByTypeDesc(String owner); SpecialApplyInfo selectSpecialApplyInfoByTypeDesc(String owner);
List<SpecialApplyInfo> selectBySearchName(IPage page, FindByNameModel nameModel);
} }

View File

@ -1,12 +1,16 @@
package com.lz.modules.equipment.service.impl; package com.lz.modules.equipment.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lz.modules.equipment.dao.SpecialApplyInfoMapper; import com.lz.modules.equipment.dao.SpecialApplyInfoMapper;
import com.lz.modules.equipment.entity.SpecialApplyInfo; import com.lz.modules.equipment.entity.SpecialApplyInfo;
import com.lz.modules.equipment.entity.model.FindByNameModel;
import com.lz.modules.equipment.service.SpecialApplyInfoService; import com.lz.modules.equipment.service.SpecialApplyInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* <p> * <p>
* 其他可申领信息表 服务类 * 其他可申领信息表 服务类
@ -64,5 +68,10 @@ public class SpecialApplyInfoServiceImpl extends ServiceImpl<SpecialApplyInfoMap
return specialApplyInfoMapper.selectSpecialApplyInfoByTypeDesc(owner); return specialApplyInfoMapper.selectSpecialApplyInfoByTypeDesc(owner);
} }
@Override
public List<SpecialApplyInfo> selectBySearchName(IPage page, FindByNameModel nameModel){
return specialApplyInfoMapper.selectBySearchName(page, nameModel);
}
} }

View File

@ -140,5 +140,6 @@
</select> </select>
</mapper> </mapper>

View File

@ -21,13 +21,13 @@
<select id="selectSpecialApplyInfoById" resultType="SpecialApplyInfo" > <select id="selectSpecialApplyInfoById" resultType="SpecialApplyInfo" >
select * from special_apply_info where id=#{id} and is_delete = 0 limit 1 select * from equipment_special_apply_info where id=#{id} and is_delete = 0 limit 1
</select> </select>
<insert id="insertSpecialApplyInfo" parameterType="SpecialApplyInfo" useGeneratedKeys="true" keyProperty="id" > <insert id="insertSpecialApplyInfo" parameterType="SpecialApplyInfo" useGeneratedKeys="true" keyProperty="id" >
insert into special_apply_info( insert into equipment_special_apply_info(
<if test="typeDesc != null">type_desc, </if> <if test="typeDesc != null">type_desc, </if>
is_delete, is_delete,
gmt_create, gmt_create,
@ -43,7 +43,7 @@
<update id="updateSpecialApplyInfoById" parameterType="SpecialApplyInfo" > <update id="updateSpecialApplyInfoById" parameterType="SpecialApplyInfo" >
update update
special_apply_info equipment_special_apply_info
<trim prefix="set" suffixOverrides=","> <trim prefix="set" suffixOverrides=",">
<if test="isDelete != null">is_delete = #{isDelete},</if> <if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if> <if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
@ -56,7 +56,7 @@
<update id="updateCoverSpecialApplyInfoById" parameterType="SpecialApplyInfo" > <update id="updateCoverSpecialApplyInfoById" parameterType="SpecialApplyInfo" >
update update
special_apply_info equipment_special_apply_info
set set
is_delete = #{isDelete}, is_delete = #{isDelete},
gmt_create = #{gmtCreate}, gmt_create = #{gmtCreate},
@ -67,13 +67,20 @@
<update id="deleteSpecialApplyInfoById" parameterType="java.lang.Long"> <update id="deleteSpecialApplyInfoById" parameterType="java.lang.Long">
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
</update> </update>
<select id="selectSpecialApplyInfoByTypeDesc" <select id="selectSpecialApplyInfoByTypeDesc"
resultType="com.lz.modules.equipment.entity.SpecialApplyInfo"> resultType="com.lz.modules.equipment.entity.SpecialApplyInfo">
select * from special_apply_info where type_desc=#{owner} and is_delete = 0 limit 1 select * from equipment_special_apply_info where type_desc=#{owner} and is_delete = 0 limit 1
</select>
<select id="selectBySearchName" resultType="SpecialApplyInfo" >
select * from equipment_special_apply_info where is_delete = 0
<if test="model.name != null and model.name != ''">
and type_desc LIKE CONCAT('%',#{model.name},'%')
</if>
</select> </select>
</mapper> </mapper>

View File

@ -437,4 +437,10 @@
select * from lz_staff where is_delete = 0 and employee_id = #{employeeId} limit 1 select * from lz_staff where is_delete = 0 and employee_id = #{employeeId} limit 1
</select> </select>
<select id="selectBySearchName" resultType="com.lz.modules.app.entity.StaffEntity">
select * from lz_staff where is_delete=0
<if test="model.name != null and model.name != ''"></if>
AND name LIKE CONCAT('%',#{model.name},'%')
</select>
</mapper> </mapper>