Commit 956022c8 authored by maqing's avatar maqing

用户和护理机构权限问题

parent 40eb8840
...@@ -9,6 +9,7 @@ import com.hungraim.ltc.service.DisableService; ...@@ -9,6 +9,7 @@ import com.hungraim.ltc.service.DisableService;
import com.hungraim.ltc.util.FileUtils; import com.hungraim.ltc.util.FileUtils;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode; import com.hungraim.ltc.util.ResultCode;
import com.hungraim.ltc.util.TokenParsingUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
...@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -17,6 +18,7 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -70,8 +72,9 @@ public class DisableController { ...@@ -70,8 +72,9 @@ public class DisableController {
* 查询所有父机构 * 查询所有父机构
*/ */
@RequestMapping("/fndOrganRoot") @RequestMapping("/fndOrganRoot")
public Result<List<ChFndOrgan>> fndOrganRoot() { public Result<List<ChFndOrgan>> fndOrganRoot(@RequestHeader("Authorization") String token) {
List<ChFndOrgan> organs = disableService.fndOrganRoot(); long organId = TokenParsingUtil.TokenParsing(token, "organId");
List<ChFndOrgan> organs = disableService.fndOrganRoot(organId);
return Result.success(organs); return Result.success(organs);
} }
...@@ -79,8 +82,9 @@ public class DisableController { ...@@ -79,8 +82,9 @@ public class DisableController {
* 查询所有机构 * 查询所有机构
*/ */
@RequestMapping("/fndAllOrgan") @RequestMapping("/fndAllOrgan")
public Result<List<ChFndOrgan>> fndAllOrgan() { public Result<List<ChFndOrgan>> fndAllOrgan(@RequestHeader("Authorization") String token) {
List<ChFndOrgan> organs = disableService.fndAllOrgan(); long organId = TokenParsingUtil.TokenParsing(token, "organId");
List<ChFndOrgan> organs = disableService.fndAllOrgan(organId);
return Result.success(organs); return Result.success(organs);
} }
...@@ -96,31 +100,29 @@ public class DisableController { ...@@ -96,31 +100,29 @@ public class DisableController {
/** /**
* 查询机构(不包含子机构)下所有护理机构 * 查询机构(不包含子机构)下所有护理机构
* *
* @param organId 机构id * @param token
*/ */
@RequestMapping("/srvOrganList") @RequestMapping("/srvOrganList")
public Result<List<ChSrvOrgan>> srvOrganList(String organId) { public Result<List<ChSrvOrgan>> srvOrganList(@RequestHeader("Authorization") String token) {
if (StringUtils.isBlank(organId)) { long organId = TokenParsingUtil.TokenParsing(token, "organId");
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
} List<ChSrvOrgan> chFndSrvModes = disableService.srvOrganList(String.valueOf(organId), srvOrganId, false);
List<ChSrvOrgan> chFndSrvModes = disableService.srvOrganList(organId, false);
return Result.success(chFndSrvModes); return Result.success(chFndSrvModes);
} }
/** /**
* 查询机构下或者包含子机构下的所有护理机构 * 查询机构下或者包含子机构下的所有护理机构
* *
* @param organId 机构id * @param 机构id
*/ */
@RequestMapping("/srvOrganListByIsInvolveChild") @RequestMapping("/srvOrganListByIsInvolveChild")
public Result<List<ChSrvOrgan>> srvOrganListByIsInvolveChild(String organId, Boolean isInvolveChild) { public Result<List<ChSrvOrgan>> srvOrganListByIsInvolveChild(@RequestHeader("Authorization") String token, Boolean isInvolveChild) {
if (StringUtils.isBlank(organId)) { long organId = TokenParsingUtil.TokenParsing(token, "organId");
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
}
if (null == isInvolveChild) { if (null == isInvolveChild) {
isInvolveChild = false; isInvolveChild = false;
} }
List<ChSrvOrgan> chFndSrvModes = disableService.srvOrganList(organId, isInvolveChild); List<ChSrvOrgan> chFndSrvModes = disableService.srvOrganList(String.valueOf(organId),srvOrganId, isInvolveChild);
return Result.success(chFndSrvModes); return Result.success(chFndSrvModes);
} }
......
...@@ -19,6 +19,7 @@ import com.hungraim.ltc.service.SrvOrganService; ...@@ -19,6 +19,7 @@ import com.hungraim.ltc.service.SrvOrganService;
import com.hungraim.ltc.util.FileUtils; import com.hungraim.ltc.util.FileUtils;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode; import com.hungraim.ltc.util.ResultCode;
import com.hungraim.ltc.util.TokenParsingUtil;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.Workbook;
...@@ -53,9 +54,11 @@ public class SrvOrganController { ...@@ -53,9 +54,11 @@ public class SrvOrganController {
* @return 返回护理机构列表 * @return 返回护理机构列表
*/ */
@GetMapping("/list") @GetMapping("/list")
public Result<Page<SrvOrganListVo>> getSrvOrganList(Integer pageNum, Integer pageSize, Long organId, Boolean isInvolveChild, String creditCode, String srvOrganName) { public Result<Page<SrvOrganListVo>> getSrvOrganList(@RequestHeader("Authorization") String token,Integer pageNum,
Integer pageSize, Long organId, Boolean isInvolveChild, String creditCode, String srvOrganName) {
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
Page<SrvOrganListVo> page = new Page<>(pageNum, pageSize); Page<SrvOrganListVo> page = new Page<>(pageNum, pageSize);
page = srvOrganService.getSrvOrganList(page, organId, isInvolveChild, creditCode, srvOrganName); page = srvOrganService.getSrvOrganList(page, organId, isInvolveChild, creditCode, srvOrganName,srvOrganId);
return Result.success(page); return Result.success(page);
} }
...@@ -150,9 +153,10 @@ public class SrvOrganController { ...@@ -150,9 +153,10 @@ public class SrvOrganController {
* @return 返回列表 * @return 返回列表
*/ */
@GetMapping("/srvOrganEmpList") @GetMapping("/srvOrganEmpList")
public Result<Page<SrvOrganEmpListVo>> getSrvOrganEmpListVo(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, Long organId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum, Short isLock, Short empType) { public Result<Page<SrvOrganEmpListVo>> getSrvOrganEmpListVo(@RequestHeader("Authorization") String token,@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, Long organId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum, Short isLock, Short empType) {
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
Page<SrvOrganEmpListVo> page = new Page<>(pageNum, pageSize); Page<SrvOrganEmpListVo> page = new Page<>(pageNum, pageSize);
page = srvOrganEmpService.getSrvOrganEmpListVo(page, organId, isInvolveChild, empName, srvOrganName, certifNum, isLock, empType); page = srvOrganEmpService.getSrvOrganEmpListVo(page, organId, isInvolveChild, empName, srvOrganName, certifNum, isLock, empType,srvOrganId);
return Result.success(page); return Result.success(page);
} }
...@@ -274,9 +278,11 @@ public class SrvOrganController { ...@@ -274,9 +278,11 @@ public class SrvOrganController {
* @param empType 护理人员类型 * @param empType 护理人员类型
*/ */
@GetMapping("/srvOrganExport") @GetMapping("/srvOrganExport")
public void srvOrganExport(Long organId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum, public void srvOrganExport(@RequestHeader("Authorization") String token, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum,
Short isLock, Short empType,HttpServletResponse response){ Short isLock, Short empType,HttpServletResponse response){
Workbook workbook = srvOrganEmpService.srvOrganExport(organId, isInvolveChild, empName, srvOrganName, certifNum, long organId = TokenParsingUtil.TokenParsing(token, "organId");
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
Workbook workbook = srvOrganEmpService.srvOrganExport(organId,srvOrganId, isInvolveChild, empName, srvOrganName, certifNum,
isLock, empType); isLock, empType);
// 命名表格 // 命名表格
String fileName = "srvOrgan.xlsx"; String fileName = "srvOrgan.xlsx";
......
...@@ -28,9 +28,9 @@ public interface ChSrvOrganEmpMapper extends BaseMapper<ChSrvOrganEmp> { ...@@ -28,9 +28,9 @@ public interface ChSrvOrganEmpMapper extends BaseMapper<ChSrvOrganEmp> {
* @param empType 护理人员类型 * @param empType 护理人员类型
* @return 返回列表 * @return 返回列表
*/ */
Page<SrvOrganEmpListVo> getSrvOrganEmpListVo(Page<SrvOrganEmpListVo> page, List<Long> organIds, String empName, String srvOrganName, String certifNum, Short isLock, Short empType); Page<SrvOrganEmpListVo> getSrvOrganEmpListVo(Page<SrvOrganEmpListVo> page, List<Long> organIds, String empName, String srvOrganName, String certifNum, Short isLock, Short empType,Long srvOrganId);
List<SrvOrganEmpExportVo> getSrvOrganEmpExportList(List<Long> organIds, String empName, String srvOrganName, String certifNum, Short isLock, Short empType); List<SrvOrganEmpExportVo> getSrvOrganEmpExportList(List<Long> organIds,Long srvOrganId, String empName, String srvOrganName, String certifNum, Short isLock, Short empType);
} }
\ No newline at end of file
...@@ -29,5 +29,8 @@ public interface SrvOrganMapper extends BaseMapper<ChSrvOrgan> { ...@@ -29,5 +29,8 @@ public interface SrvOrganMapper extends BaseMapper<ChSrvOrgan> {
* @param srvOrganName 护理机构名称 * @param srvOrganName 护理机构名称
* @return 返回护理机构列表 * @return 返回护理机构列表
*/ */
Page<SrvOrganListVo> getSrvOrganList(Page<SrvOrganListVo> page, @Param("organIds") List<Long> organIds, @Param("creditCode") String creditCode, @Param("srvOrganName") String srvOrganName); Page<SrvOrganListVo> getSrvOrganList(Page<SrvOrganListVo> page, @Param("organIds") List<Long> organIds,
@Param("creditCode") String creditCode,
@Param("srvOrganName") String srvOrganName,
@Param("srvOrganId") Long srvOrganId);
} }
...@@ -51,7 +51,7 @@ public interface DisableService { ...@@ -51,7 +51,7 @@ public interface DisableService {
*/ */
List<ChFndDistrict> district(String districtLevel, String districtCode); List<ChFndDistrict> district(String districtLevel, String districtCode);
List<ChFndOrgan> fndOrganRoot(); List<ChFndOrgan> fndOrganRoot(long organId);
/** /**
* 查询所有服务方式 * 查询所有服务方式
...@@ -64,7 +64,7 @@ public interface DisableService { ...@@ -64,7 +64,7 @@ public interface DisableService {
* @param organId 机构id * @param organId 机构id
* @param isInvolveChild 是否包含子机构 * @param isInvolveChild 是否包含子机构
*/ */
List<ChSrvOrgan> srvOrganList(String organId, Boolean isInvolveChild); List<ChSrvOrgan> srvOrganList(String organId,Long srvOrganId, Boolean isInvolveChild);
/** /**
* 查询疾病类型 * 查询疾病类型
...@@ -109,7 +109,7 @@ public interface DisableService { ...@@ -109,7 +109,7 @@ public interface DisableService {
* *
* @return 返回列表 * @return 返回列表
*/ */
List<ChFndOrgan> fndAllOrgan(); List<ChFndOrgan> fndAllOrgan(long organId);
/** /**
* 失能人员信息变更表-新增 * 失能人员信息变更表-新增
......
...@@ -24,7 +24,7 @@ public interface SrvOrganEmpService { ...@@ -24,7 +24,7 @@ public interface SrvOrganEmpService {
* @param empType 护理人员类型 * @param empType 护理人员类型
* @return 返回列表 * @return 返回列表
*/ */
Page<SrvOrganEmpListVo> getSrvOrganEmpListVo(Page<SrvOrganEmpListVo> page, Long organId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum, Short isLock, Short empType); Page<SrvOrganEmpListVo> getSrvOrganEmpListVo(Page<SrvOrganEmpListVo> page, Long organId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum, Short isLock, Short empType,Long srvOrganId);
/** /**
* 修改护理人员的状态 * 修改护理人员的状态
...@@ -65,7 +65,7 @@ public interface SrvOrganEmpService { ...@@ -65,7 +65,7 @@ public interface SrvOrganEmpService {
*/ */
void saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo); void saveOrUpdateSrvOrganEmp(SrvOrganEmpVo srvOrganEmpVo);
Workbook srvOrganExport(Long organId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum, Workbook srvOrganExport(Long organId,Long srvOrganId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum,
Short isLock, Short empType); Short isLock, Short empType);
Page<ChSrvTaskDetailVo> chSrvTaskDetailQuery(Page<ChSrvTaskDetailVo> page,Long empId); Page<ChSrvTaskDetailVo> chSrvTaskDetailQuery(Page<ChSrvTaskDetailVo> page,Long empId);
......
...@@ -20,7 +20,7 @@ public interface SrvOrganService { ...@@ -20,7 +20,7 @@ public interface SrvOrganService {
* @param srvOrganName 护理机构名称 * @param srvOrganName 护理机构名称
* @return 返回护理机构列表 * @return 返回护理机构列表
*/ */
Page<SrvOrganListVo> getSrvOrganList(Page<SrvOrganListVo> page, Long organId, Boolean isInvolveChild, String creditCode, String srvOrganName); Page<SrvOrganListVo> getSrvOrganList(Page<SrvOrganListVo> page, Long organId, Boolean isInvolveChild, String creditCode, String srvOrganName,Long srvOrganId);
/** /**
* 获取所有服务机构等级 * 获取所有服务机构等级
......
...@@ -311,10 +311,13 @@ public class DisableServiceImpl implements DisableService { ...@@ -311,10 +311,13 @@ public class DisableServiceImpl implements DisableService {
} }
@Override @Override
public List<ChFndOrgan> fndOrganRoot() { public List<ChFndOrgan> fndOrganRoot(long organId) {
QueryWrapper<ChFndOrgan> queryWrapper = new QueryWrapper<>(); QueryWrapper<ChFndOrgan> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("IS_LEAF", "1"); queryWrapper.eq("IS_LEAF", "1");
queryWrapper.eq("STATUS", "1"); queryWrapper.eq("STATUS", "1");
if(organId!=0){
queryWrapper.eq("ORGAN_ID", organId);
}
queryWrapper.and(wrapper -> wrapper.isNull("PARENT_ID").or().eq("PARENT_ID", "")); queryWrapper.and(wrapper -> wrapper.isNull("PARENT_ID").or().eq("PARENT_ID", ""));
return fndOrganMapper.selectList(queryWrapper); return fndOrganMapper.selectList(queryWrapper);
} }
...@@ -325,10 +328,19 @@ public class DisableServiceImpl implements DisableService { ...@@ -325,10 +328,19 @@ public class DisableServiceImpl implements DisableService {
} }
@Override @Override
public List<ChSrvOrgan> srvOrganList(String organId, Boolean isInvolveChild) { public List<ChSrvOrgan> srvOrganList(String organId,Long srvOrganId, Boolean isInvolveChild) {
// zhangch 2021-11-04 修改查询条件 new QueryWrapper<ChSrvOrgan>().eq("organ_id", organId).eq("STATUS", (short) 0) // zhangch 2021-11-04 修改查询条件 new QueryWrapper<ChSrvOrgan>().eq("organ_id", organId).eq("STATUS", (short) 0)
List<Long> organIds = organService.getOrganIds(Long.valueOf(organId), isInvolveChild); List<Long> organIds = organService.getOrganIds(Long.valueOf(organId), isInvolveChild);
return srvOrganMapper.selectList(new LambdaQueryWrapper<ChSrvOrgan>().eq(ChSrvOrgan::getStatus, (short) 0).in(ChSrvOrgan::getOrganId, organIds));
LambdaQueryWrapper<ChSrvOrgan> queryWrapper = new LambdaQueryWrapper<ChSrvOrgan>();
queryWrapper.eq(ChSrvOrgan::getStatus, (short) 0);
if(organIds.size() > 0){
queryWrapper.in(ChSrvOrgan::getOrganId, organIds);
}
if(srvOrganId!=0){
queryWrapper.in(ChSrvOrgan::getSrvOrganId, srvOrganId);
}
return srvOrganMapper.selectList(queryWrapper );
} }
@Override @Override
...@@ -388,10 +400,13 @@ public class DisableServiceImpl implements DisableService { ...@@ -388,10 +400,13 @@ public class DisableServiceImpl implements DisableService {
} }
@Override @Override
public List<ChFndOrgan> fndAllOrgan() { public List<ChFndOrgan> fndAllOrgan(long organId) {
QueryWrapper<ChFndOrgan> queryWrapper = new QueryWrapper<>(); QueryWrapper<ChFndOrgan> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("IS_LEAF", "1"); queryWrapper.eq("IS_LEAF", "1");
queryWrapper.eq("STATUS", "1"); queryWrapper.eq("STATUS", "1");
if(organId!=0){
queryWrapper.eq("ORGAN_ID", organId);
}
return fndOrganMapper.selectList(queryWrapper); return fndOrganMapper.selectList(queryWrapper);
} }
......
...@@ -25,7 +25,9 @@ public class OrganServiceImpl implements OrganService { ...@@ -25,7 +25,9 @@ public class OrganServiceImpl implements OrganService {
private void getOrganList(Long organId, List<Long> organIds) { private void getOrganList(Long organId, List<Long> organIds) {
QueryWrapper<ChFndOrgan> queryWrapper = new QueryWrapper<>(); QueryWrapper<ChFndOrgan> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("STATUS", "1"); queryWrapper.eq("STATUS", "1");
if(organId!=0){
queryWrapper.eq("PARENT_ID", organId); queryWrapper.eq("PARENT_ID", organId);
}
List<ChFndOrgan> organs = fndOrganMapper.selectList(queryWrapper); List<ChFndOrgan> organs = fndOrganMapper.selectList(queryWrapper);
if (organs != null && organs.size() != 0) { if (organs != null && organs.size() != 0) {
for (ChFndOrgan chFndOrgan : organs) { for (ChFndOrgan chFndOrgan : organs) {
...@@ -41,7 +43,7 @@ public class OrganServiceImpl implements OrganService { ...@@ -41,7 +43,7 @@ public class OrganServiceImpl implements OrganService {
@Override @Override
public List<Long> getOrganIds(Long organId, Boolean isInvolveChild) { public List<Long> getOrganIds(Long organId, Boolean isInvolveChild) {
List<Long> organIds = new ArrayList<>(); List<Long> organIds = new ArrayList<>();
if (organId != null) { if (organId != null && organId != 0) {
organIds.add(organId); organIds.add(organId);
if (isInvolveChild) { if (isInvolveChild) {
getOrganList(organId, organIds); getOrganList(organId, organIds);
......
...@@ -62,9 +62,9 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService { ...@@ -62,9 +62,9 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
@Override @Override
public Page<SrvOrganEmpListVo> getSrvOrganEmpListVo(Page<SrvOrganEmpListVo> page, Long organId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum, Short isLock, Short empType) { public Page<SrvOrganEmpListVo> getSrvOrganEmpListVo(Page<SrvOrganEmpListVo> page, Long organId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum, Short isLock, Short empType,Long srvOrganId) {
List<Long> organIds = organService.getOrganIds(organId, isInvolveChild); List<Long> organIds = organService.getOrganIds(organId, isInvolveChild);
return chSrvOrganEmpMapper.getSrvOrganEmpListVo(page, organIds, empName, srvOrganName, certifNum, isLock, empType); return chSrvOrganEmpMapper.getSrvOrganEmpListVo(page, organIds, empName, srvOrganName, certifNum, isLock, empType,srvOrganId);
} }
@Override @Override
...@@ -141,10 +141,10 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService { ...@@ -141,10 +141,10 @@ public class SrvOrganEmpServiceImpl implements SrvOrganEmpService {
@Override @Override
public Workbook srvOrganExport(Long organId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum, public Workbook srvOrganExport(Long organId,Long srvOrganId, Boolean isInvolveChild, String empName, String srvOrganName, String certifNum,
Short isLock, Short empType) { Short isLock, Short empType) {
List<Long> organIds = organService.getOrganIds(organId, isInvolveChild); List<Long> organIds = organService.getOrganIds(organId, isInvolveChild);
List<SrvOrganEmpExportVo> srvOrganEmpExportList = chSrvOrganEmpMapper.getSrvOrganEmpExportList(organIds, empName, srvOrganName, certifNum, isLock, empType); List<SrvOrganEmpExportVo> srvOrganEmpExportList = chSrvOrganEmpMapper.getSrvOrganEmpExportList(organIds,srvOrganId, empName, srvOrganName, certifNum, isLock, empType);
for (SrvOrganEmpExportVo record : srvOrganEmpExportList) { for (SrvOrganEmpExportVo record : srvOrganEmpExportList) {
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
......
...@@ -50,9 +50,9 @@ public class SrvOrganServiceImpl implements SrvOrganService { ...@@ -50,9 +50,9 @@ public class SrvOrganServiceImpl implements SrvOrganService {
@Override @Override
public Page<SrvOrganListVo> getSrvOrganList(Page<SrvOrganListVo> page, Long organId, Boolean isInvolveChild, String creditCode, String srvOrganName) { public Page<SrvOrganListVo> getSrvOrganList(Page<SrvOrganListVo> page, Long organId, Boolean isInvolveChild, String creditCode, String srvOrganName,Long srvOrganId) {
List<Long> organIds = organService.getOrganIds(organId, isInvolveChild); List<Long> organIds = organService.getOrganIds(organId, isInvolveChild);
Page<SrvOrganListVo> srvOrganList = srvOrganMapper.getSrvOrganList(page, organIds, creditCode, srvOrganName); Page<SrvOrganListVo> srvOrganList = srvOrganMapper.getSrvOrganList(page, organIds, creditCode, srvOrganName,srvOrganId);
List<SrvOrganListVo> records = srvOrganList.getRecords(); List<SrvOrganListVo> records = srvOrganList.getRecords();
if (records != null && records.size() > 0) { if (records != null && records.size() > 0) {
for (SrvOrganListVo srvOrganListVo : records) { for (SrvOrganListVo srvOrganListVo : records) {
......
...@@ -82,6 +82,9 @@ ...@@ -82,6 +82,9 @@
<if test="empType != null"> <if test="empType != null">
AND T1.EMP_TYPE = #{empType} AND T1.EMP_TYPE = #{empType}
</if> </if>
<if test="srvOrganId != null and srvOrganId != 0">
AND T4.SRV_ORGAN_ID = #{srvOrganId}
</if>
</where> </where>
ORDER BY T1.EFF_TIME DESC ORDER BY T1.EFF_TIME DESC
</select> </select>
...@@ -136,6 +139,9 @@ ...@@ -136,6 +139,9 @@
<if test="empType != null"> <if test="empType != null">
AND T1.EMP_TYPE = #{empType} AND T1.EMP_TYPE = #{empType}
</if> </if>
<if test="srvOrganId != null and srvOrganId != 0" >
AND T4.SRV_ORGAN_ID = #{srvOrganId}
</if>
</where> </where>
ORDER BY T1.EFF_TIME DESC ORDER BY T1.EFF_TIME DESC
</select> </select>
......
...@@ -52,5 +52,8 @@ ...@@ -52,5 +52,8 @@
<if test="srvOrganName != null and srvOrganName != ''"> <if test="srvOrganName != null and srvOrganName != ''">
AND T1.SRV_ORGAN_NAME LIKE CONCAT('%',CONCAT(#{srvOrganName},'%')) AND T1.SRV_ORGAN_NAME LIKE CONCAT('%',CONCAT(#{srvOrganName},'%'))
</if> </if>
<if test="srvOrganId != null and srvOrganId != ''and srvOrganId!=0">
AND T1.SRV_ORGAN_ID = #{srvOrganId}
</if>
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -155,7 +155,7 @@ public class AuthorizationServerConfiguration extends AuthorizationServerConfigu ...@@ -155,7 +155,7 @@ public class AuthorizationServerConfiguration extends AuthorizationServerConfigu
public TokenEnhancer tokenEnhancer() { public TokenEnhancer tokenEnhancer() {
return (accessToken, authentication) -> { return (accessToken, authentication) -> {
UserLoginInfoVO user = (UserLoginInfoVO) authentication.getUserAuthentication().getPrincipal(); UserLoginInfoVO user = (UserLoginInfoVO) authentication.getUserAuthentication().getPrincipal();
Map<String, Object> map = new HashMap<>(4); Map<String, Object> map = new HashMap<>(6);
map.put("name", user.getName()); map.put("name", user.getName());
map.put("avatar", user.getAvatar()); map.put("avatar", user.getAvatar());
map.put("userId", user.getUserId()); map.put("userId", user.getUserId());
......
...@@ -63,6 +63,14 @@ ...@@ -63,6 +63,14 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!--jwt-->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-jwt</artifactId>
<version>1.0.9.RELEASE</version>
<scope>compile</scope>
</dependency>
<!--Excel导入导出--> <!--Excel导入导出-->
<dependency> <dependency>
<groupId>cn.afterturn</groupId> <groupId>cn.afterturn</groupId>
......
package com.hungraim.ltc.util;
import com.alibaba.fastjson.JSONObject;
import com.hungraim.ltc.constant.AuthConstants;
import org.springframework.security.jwt.JwtHelper;
public class TokenParsingUtil {
public static Integer TokenParsing(String token, String id){
//解析token
String subToken = token.substring(AuthConstants.JWT_PREFIX.length());
String claims = JwtHelper.decode(subToken).getClaims();
Integer rid = (Integer) JSONObject.parseObject(claims).get(id);
return rid;
}
}
...@@ -11,13 +11,11 @@ import com.hungraim.ltc.pojo.vo.disable.SrvModeVo; ...@@ -11,13 +11,11 @@ import com.hungraim.ltc.pojo.vo.disable.SrvModeVo;
import com.hungraim.ltc.pojo.vo.governance.OrganProjectVO; import com.hungraim.ltc.pojo.vo.governance.OrganProjectVO;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode; import com.hungraim.ltc.util.ResultCode;
import com.hungraim.ltc.util.TokenParsingUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -43,8 +41,11 @@ public class NursingServiceItemsController { ...@@ -43,8 +41,11 @@ public class NursingServiceItemsController {
* @param status 状态 * @param status 状态
*/ */
@RequestMapping("/organProjectList") @RequestMapping("/organProjectList")
public Result<Page<OrganProjectVO>> organProjectList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, public Result<Page<OrganProjectVO>> organProjectList(@RequestHeader("Authorization") String token,
@RequestParam(defaultValue = "1") Integer pageNum,
@RequestParam(defaultValue = "10") Integer pageSize,
String organIds, String name, String status) { String organIds, String name, String status) {
long organId = TokenParsingUtil.TokenParsing(token, "organId");
Page<OrganProjectVO> page = new Page<>(pageNum, pageSize); Page<OrganProjectVO> page = new Page<>(pageNum, pageSize);
page = nursingServiceItemsService.organProjectList(page, organIds, name, status); page = nursingServiceItemsService.organProjectList(page, organIds, name, status);
return Result.success(page); return Result.success(page);
......
...@@ -11,6 +11,7 @@ import com.hungraim.ltc.pojo.vo.governance.ProgramSetAndProjectVo; ...@@ -11,6 +11,7 @@ import com.hungraim.ltc.pojo.vo.governance.ProgramSetAndProjectVo;
import com.hungraim.ltc.pojo.vo.governance.SvrSendListVo; import com.hungraim.ltc.pojo.vo.governance.SvrSendListVo;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode; import com.hungraim.ltc.util.ResultCode;
import com.hungraim.ltc.util.TokenParsingUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -47,7 +48,8 @@ public class SrvProgramController { ...@@ -47,7 +48,8 @@ public class SrvProgramController {
* @return 返回列表 * @return 返回列表
*/ */
@RequestMapping("/programList") @RequestMapping("/programList")
public Result getProgramList(Long srvOrganId, String realName, String realTel, String programStatus, Integer pageNum, Integer pageSize) { public Result getProgramList(@RequestHeader("Authorization") String token, String realName, String realTel, String programStatus, Integer pageNum, Integer pageSize) {
long srvOrganId = TokenParsingUtil.TokenParsing(token, "srvOrganId");
if (pageNum == null || pageNum < 1) { if (pageNum == null || pageNum < 1) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR); return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
} }
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
INNER JOIN CH_SRV_ORGAN T2 ON T1.SRV_ORGAN_ID = T2.SRV_ORGAN_ID INNER JOIN CH_SRV_ORGAN T2 ON T1.SRV_ORGAN_ID = T2.SRV_ORGAN_ID
INNER JOIN CH_DISABLE_INFO T3 ON T1.DISAB_INFO_ID = T3.DISAB_INFO_ID INNER JOIN CH_DISABLE_INFO T3 ON T1.DISAB_INFO_ID = T3.DISAB_INFO_ID
<where> <where>
<if test="srvOrganId != null"> <if test="srvOrganId != null and srvOrganId != 0">
T1.SRV_ORGAN_ID = #{srvOrganId} T1.SRV_ORGAN_ID = #{srvOrganId}
</if> </if>
<if test="realName != null and realName != ''"> <if test="realName != null and realName != ''">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment