部分修改
This commit is contained in:
parent
76b4004687
commit
e3edc8d751
@ -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");
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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> {
|
||||
StaffEntity selectByPhone(@Param("phone") String phone);
|
||||
|
||||
StaffEntity selectStaffByEmployeeId(@Param("employeeId") String employeeId);
|
||||
|
||||
List<StaffEntity> selectBySearchName(@Param("page") IPage page, @Param("model") FindByNameModel nameModel);
|
||||
}
|
||||
|
||||
@ -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> {
|
||||
StaffEntity selectByPhone(String userName);
|
||||
|
||||
StaffEntity selectStaffByEmployeeId(String employeeId);
|
||||
|
||||
List<StaffEntity> selectBySearchName(IPage page, FindByNameModel nameModel);
|
||||
}
|
||||
|
||||
|
||||
@ -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<StaffDao, StaffEntity> impleme
|
||||
return staffDao.selectStaffByEmployeeId(employeeId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<StaffEntity> selectBySearchName(IPage page, FindByNameModel nameModel){
|
||||
return staffDao.selectBySearchName(page, nameModel);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageUtils queryPage(Map<String, Object> params) {
|
||||
|
||||
@ -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<FindEmployeeResModel> data = new ArrayList<>();
|
||||
PageUtils pageUtils = staffService.queryPage();
|
||||
Page<StaffEntity> employeesInfoPage = staffService.selectPage(
|
||||
new Page<>(nameModel.getCurrPage(), nameModel.getPageSize()),
|
||||
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);
|
||||
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<FindEmployeeResModel> data = new ArrayList<>();
|
||||
Page<SpecialApplyInfo> specialApplyInfoPage = specialApplyInfoService.selectPage(
|
||||
new Page<>(nameModel.getCurrPage(), nameModel.getPageSize()),
|
||||
new EntityWrapper<SpecialApplyInfo>()
|
||||
.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<FindEmployeeResModel> 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<FindEquipmentResModel> data = new Page<>();
|
||||
/*Page<FindEquipmentResModel> data = new Page<>();
|
||||
Page<EquipmentInfo> equipmentInfoPage = iEquipmentInfoService.selectPage(
|
||||
new Page<>(nameModel.getCurrPage(), nameModel.getPageSize()),
|
||||
new EntityWrapper<EquipmentInfo>()
|
||||
@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ public class EquipmentController extends AbstractController {
|
||||
model.setSpecId(equipmentSpecs1.getId());
|
||||
}
|
||||
});
|
||||
addRecord(equipmentInfo);
|
||||
// addRecord(equipmentInfo);
|
||||
return R.ok().put("data", model);
|
||||
|
||||
}
|
||||
|
||||
@ -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<SpecialApplyInfo> {
|
||||
|
||||
@ -32,4 +36,6 @@ public interface SpecialApplyInfoMapper extends BaseMapper<SpecialApplyInfo> {
|
||||
|
||||
|
||||
SpecialApplyInfo selectSpecialApplyInfoByTypeDesc(@Param("owner") String owner);
|
||||
|
||||
List<SpecialApplyInfo> selectBySearchName(@Param("page") IPage page, @Param("model") FindByNameModel nameModel);
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@ -32,4 +36,6 @@ public interface SpecialApplyInfoService extends IService<SpecialApplyInfo> {
|
||||
|
||||
|
||||
SpecialApplyInfo selectSpecialApplyInfoByTypeDesc(String owner);
|
||||
|
||||
List<SpecialApplyInfo> selectBySearchName(IPage page, FindByNameModel nameModel);
|
||||
}
|
||||
@ -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;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 其他可申领信息表 服务类
|
||||
@ -64,5 +68,10 @@ public class SpecialApplyInfoServiceImpl extends ServiceImpl<SpecialApplyInfoMap
|
||||
return specialApplyInfoMapper.selectSpecialApplyInfoByTypeDesc(owner);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SpecialApplyInfo> selectBySearchName(IPage page, FindByNameModel nameModel){
|
||||
return specialApplyInfoMapper.selectBySearchName(page, nameModel);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -140,5 +140,6 @@
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
|
||||
@ -21,13 +21,13 @@
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
|
||||
<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>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
<update id="updateSpecialApplyInfoById" parameterType="SpecialApplyInfo" >
|
||||
update
|
||||
special_apply_info
|
||||
equipment_special_apply_info
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||
@ -56,7 +56,7 @@
|
||||
|
||||
<update id="updateCoverSpecialApplyInfoById" parameterType="SpecialApplyInfo" >
|
||||
update
|
||||
special_apply_info
|
||||
equipment_special_apply_info
|
||||
set
|
||||
is_delete = #{isDelete},
|
||||
gmt_create = #{gmtCreate},
|
||||
@ -67,13 +67,20 @@
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
|
||||
<select id="selectSpecialApplyInfoByTypeDesc"
|
||||
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>
|
||||
|
||||
</mapper>
|
||||
|
||||
@ -437,4 +437,10 @@
|
||||
select * from lz_staff where is_delete = 0 and employee_id = #{employeeId} limit 1
|
||||
</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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user