Commit 0bacb9d7 by Suvalue

科室查询

parent 4994743b
......@@ -6,6 +6,7 @@ import com.bsoft.api.common.annotations.Token;
import com.bsoft.api.model.SerDepartment;
import com.bsoft.api.model.SysRole;
import com.bsoft.api.model.SysUser;
import com.bsoft.api.model.reqmodel.Disease;
import com.bsoft.api.model.respmodel.SysMenuList;
import com.bsoft.api.service.SysMenuService;
import com.bsoft.api.service.SysUserOrgRsService;
......@@ -13,10 +14,7 @@ import com.bsoft.api.service.SysUserRoleRsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
......@@ -78,8 +76,8 @@ public class UserController {
@PostMapping("dept")
@Token
@ApiOperation("查询用户科室")
public Object getOrgByUser(@ApiIgnore @CurrentUser Long userId) throws Exception {
List<SerDepartment> sysMenuList = sysUserOrgRsService.getUserOrg(userId);
public Object getOrgByUser(@ApiIgnore @CurrentUser Long userId, @RequestBody Disease.DiseaseIDorLevel disease) throws Exception {
List<SerDepartment> sysMenuList = sysUserOrgRsService.getUserOrg(userId, disease.getDisease(), disease.getDate());
return Result.success(sysMenuList);
}
}
......@@ -5,10 +5,7 @@ import com.bsoft.api.common.enums.ProjectType;
import com.bsoft.api.common.enums.StateType;
import com.bsoft.api.common.enums.TypeState;
import com.bsoft.api.mapper.*;
import com.bsoft.api.model.DicOrg;
import com.bsoft.api.model.SerPageValueConfig;
import com.bsoft.api.model.SerProjValue;
import com.bsoft.api.model.SerProjValueSz;
import com.bsoft.api.model.*;
import com.bsoft.api.model.reqmodel.AddBudgetValue;
import com.bsoft.api.model.reqmodel.BudgetValue;
import com.bsoft.api.model.respmodel.*;
......@@ -35,6 +32,8 @@ public class SerProjValueServiceImpl implements SerProjValueService {
private DicOrgMapper dicOrgMapper;
@Resource
private SerProjValueSzMapper projValueSzMapper;
@Resource
private SysRoleMapper roleMapper;
//查询项目数值
@Override
......@@ -117,7 +116,9 @@ public class SerProjValueServiceImpl implements SerProjValueService {
List<DicOrg> orgList = dicOrgMapper.selectByUser(userId);
String orgCode = orgList.get(0).getOrgCode();
List<Summary> result = serProjMapper.selectDept(date, budgetType, userId);
SysRole role = roleMapper.selectByUser(userId);
List<Summary> result = serProjMapper.selectDept(date, budgetType, !role.getRoleCode().equals(1L) ? userId : null);
if (result != null && result.size() > 0) {
for (Summary summary : result) {
summary.setProjTypeList(new ArrayList<>());
......@@ -130,7 +131,7 @@ public class SerProjValueServiceImpl implements SerProjValueService {
for (Map<String, Object> enumInfo : enumList) {
projType = new SummaryProjType();
projType.setProjTypeName(String.valueOf(enumInfo.get("description")));
values = serProjValueMapper.selectValue((Integer) enumInfo.get("value"), null,
values = serProjValueMapper.selectValue((Integer) enumInfo.get("value"), null,
null, summary.getDeptCode(), date, budgetType, orgCode);
// if (values != null && values.size() > 0) {
// for (SerProjValueResp value : values) {
......
......@@ -97,13 +97,15 @@
from SER_PROJ_VALUE v
join SER_PROJ p on p.ID =v.PROJ_ID and p.STATE = 1
where 1=1
and EXISTS(select o2.ORG_CODE as DEPT_CODE
from SYS_USER_ORG_RS rs2
join DIC_ORG o2 on o2.id = rs2.ORG_ID and rs2.STATE = 1
where o2.STATE = 1
and rs2.USER_ID = #{userId,jdbcType=DECIMAL}
and o2.ORG_CODE = v.DEPT_CODE
)
<if test="userId!=null">
and EXISTS(select o2.ORG_CODE as DEPT_CODE
from SYS_USER_ORG_RS rs2
join DIC_ORG o2 on o2.id = rs2.ORG_ID and rs2.STATE = 1
where o2.STATE = 1
and rs2.USER_ID = #{userId,jdbcType=DECIMAL}
and o2.ORG_CODE = v.DEPT_CODE
)
</if>
<if test="date!=null">
and v.`DATE`= LEFT(#{date,jdbcType=DECIMAL},4)
</if>
......
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