Commit 4994743b by Suvalue

科室列表修改

parent 82360aa8
...@@ -4,11 +4,13 @@ import com.bsoft.api.common.Result; ...@@ -4,11 +4,13 @@ import com.bsoft.api.common.Result;
import com.bsoft.api.common.annotations.CurrentUser; import com.bsoft.api.common.annotations.CurrentUser;
import com.bsoft.api.common.annotations.Token; import com.bsoft.api.common.annotations.Token;
import com.bsoft.api.model.SerDepartment; import com.bsoft.api.model.SerDepartment;
import com.bsoft.api.model.reqmodel.Disease;
import com.bsoft.api.service.SysUserOrgRsService; import com.bsoft.api.service.SysUserOrgRsService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
...@@ -28,8 +30,8 @@ public class DeptController { ...@@ -28,8 +30,8 @@ public class DeptController {
@PostMapping("/dept/list") @PostMapping("/dept/list")
@Token @Token
@ApiOperation("查询科室列表") @ApiOperation("查询科室列表")
public Object getList(@ApiIgnore @CurrentUser Long userId) { public Object getList(@ApiIgnore @CurrentUser Long userId, @RequestBody Disease.DiseaseIDorLevel disease) {
List<SerDepartment> sysMenuList = sysUserOrgRsService.getUserOrg(userId); List<SerDepartment> sysMenuList = sysUserOrgRsService.getUserOrg(userId, disease.getDisease(), disease.getDate());
return Result.success(sysMenuList); return Result.success(sysMenuList);
} }
} }
...@@ -19,5 +19,8 @@ public interface DicOrgMapper { ...@@ -19,5 +19,8 @@ public interface DicOrgMapper {
List<DicOrg> selectByUser(@Param("userId") Long userId); List<DicOrg> selectByUser(@Param("userId") Long userId);
List<SerDepartment> selectDeptByUser(@Param("userId") Long userId,@Param("orgId") Long orgId); List<SerDepartment> selectDeptByUser(@Param("userId") Long userId, @Param("orgId") Long orgId);
List<SerDepartment> selectDeptByDisease(@Param("userId") Long userId, @Param("orgId") Long orgId,
@Param("disease") String disease, @Param("date") String date);
} }
\ No newline at end of file
...@@ -51,10 +51,15 @@ public class SysUserOrgRsServiceImpl implements SysUserOrgRsService { ...@@ -51,10 +51,15 @@ public class SysUserOrgRsServiceImpl implements SysUserOrgRsService {
} }
@Override @Override
public List<SerDepartment> getUserOrg(Long userId) { public List<SerDepartment> getUserOrg(Long userId, String disease, String date) {
List<DicOrg> orgList = dicOrgMapper.selectByUser(userId); List<DicOrg> orgList = dicOrgMapper.selectByUser(userId);
Long orgId = orgList != null && orgList.size() > 0 ? orgList.get(0).getId() : null; Long orgId = orgList != null && orgList.size() > 0 ? orgList.get(0).getId() : null;
List<SerDepartment> list = orgMapper.selectDeptByUser(userId,orgId); List<SerDepartment> list = null;
if (disease != null) {
list = orgMapper.selectDeptByUser(userId, orgId);
} else {
list = orgMapper.selectDeptByDisease(userId, orgId, disease, date);
}
return list; return list;
} }
......
...@@ -6,5 +6,5 @@ import com.bsoft.api.model.SysUserOrgRs; ...@@ -6,5 +6,5 @@ import com.bsoft.api.model.SysUserOrgRs;
import java.util.List; import java.util.List;
public interface SysUserOrgRsService extends ServiceBase<SysUserOrgRs> { public interface SysUserOrgRsService extends ServiceBase<SysUserOrgRs> {
List<SerDepartment> getUserOrg(Long userId); List<SerDepartment> getUserOrg(Long userId, String disease, String date);
} }
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