Commit f083aaec by Suvalue

科室权限添加

parent 5fe80db4
...@@ -4,14 +4,11 @@ import com.bsoft.api.common.Result; ...@@ -4,14 +4,11 @@ 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.QuerySummary;
import com.bsoft.api.service.SerDeptService;
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;
......
package com.bsoft.api.controller; package com.bsoft.api.controller;
import com.bsoft.api.common.Result; import com.bsoft.api.common.Result;
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.SerDisease; import com.bsoft.api.model.SerDisease;
import com.bsoft.api.model.reqmodel.Disease; import com.bsoft.api.model.reqmodel.Disease;
...@@ -12,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -12,6 +13,7 @@ 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.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List; import java.util.List;
...@@ -22,24 +24,26 @@ public class SerDiseaseController { ...@@ -22,24 +24,26 @@ public class SerDiseaseController {
private final static Object obj = new Object(); private final static Object obj = new Object();
@Autowired @Autowired
private SerDiseaseService serDiseaseService; private SerDiseaseService serDiseaseService;
/** /**
* 根据pageId查询板块数值 * 根据pageId查询板块数值
*
* @return * @return
* @throws Exception * @throws Exception
*/ */
@PostMapping("disease/list") @PostMapping("disease/list")
@Token @Token
@ApiOperation("根据疾病编码或者疾病等级查询疾病列表") @ApiOperation("根据疾病编码或者疾病等级查询疾病列表")
public Object getDiseaseByLevel(@RequestBody Disease.DiseaseIDorLevel disease) throws InterruptedException { public Object getDiseaseByLevel(@ApiIgnore @CurrentUser Long userId,@RequestBody Disease.DiseaseIDorLevel disease) throws InterruptedException {
List<DiseaseLevel> diseaseLevel = serDiseaseService.selectListByIdorLevel(disease.getDate(),disease.getDisease(), List<DiseaseLevel> diseaseLevel = serDiseaseService.selectListByIdorLevel(disease.getDate(),disease.getDisease(),
disease.getLevel(),disease.getDoctor(),disease.getDept()); disease.getLevel(),disease.getDoctor(),disease.getDept(),userId);
return Result.success(diseaseLevel); return Result.success(diseaseLevel);
} }
@PostMapping("disease/name") @PostMapping("disease/name")
@Token @Token
@ApiOperation("根据疾病名称查询疾病信息") @ApiOperation("根据疾病名称查询疾病信息")
public Object getDiseaseByMdcName(@RequestBody Disease.DiseaseName disease) throws InterruptedException { public Object getDiseaseByMdcName(@RequestBody Disease.DiseaseName disease) throws InterruptedException {
List<SerDisease> list = serDiseaseService.selectByMdcName(disease.getDate(),disease.getMdcName(),disease.getDoctor(),disease.getDept()); List<SerDisease> list = serDiseaseService.selectByMdcName(disease.getDate(),disease.getMdcName(),disease.getDoctor(),disease.getDept());
return Result.success(list); return Result.success(list);
} }
......
package com.bsoft.api.controller; package com.bsoft.api.controller;
import com.bsoft.api.common.Result; import com.bsoft.api.common.Result;
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.reqmodel.AddBudgetValue; import com.bsoft.api.model.reqmodel.AddBudgetValue;
import com.bsoft.api.model.reqmodel.QueryBudgetValue; import com.bsoft.api.model.reqmodel.QueryBudgetValue;
...@@ -12,6 +13,7 @@ import io.swagger.annotations.ApiOperation; ...@@ -12,6 +13,7 @@ import io.swagger.annotations.ApiOperation;
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.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -24,8 +26,8 @@ public class SerProjValueController { ...@@ -24,8 +26,8 @@ public class SerProjValueController {
@PostMapping("budget/value") @PostMapping("budget/value")
@Token @Token
@ApiOperation("查询预算编制数据") @ApiOperation("查询预算编制数据")
public Object getProjValue(@RequestBody QueryBudgetValue request) throws Throwable { public Object getProjValue(@ApiIgnore @CurrentUser Long userId,@RequestBody QueryBudgetValue request) throws Throwable {
Object result = projValueService.getValue(request.getProjectType(),request.getDate(),request.getDeptCode()); Object result = projValueService.getValue(request.getProjectType(),request.getDate(),request.getDeptCode(),userId);
return Result.success(result); return Result.success(result);
} }
...@@ -33,8 +35,8 @@ public class SerProjValueController { ...@@ -33,8 +35,8 @@ public class SerProjValueController {
@PostMapping("budget/save") @PostMapping("budget/save")
@Token @Token
@ApiOperation("保存数据") @ApiOperation("保存数据")
public Object save(@RequestBody AddBudgetValue request) throws Throwable { public Object save(@ApiIgnore @CurrentUser Long userId,@RequestBody AddBudgetValue request) throws Throwable {
boolean result = projValueService.save(request); boolean result = projValueService.save(userId,request);
if(result) if(result)
return Result.success(null); return Result.success(null);
else else
...@@ -44,8 +46,8 @@ public class SerProjValueController { ...@@ -44,8 +46,8 @@ public class SerProjValueController {
@PostMapping("budget/summary") @PostMapping("budget/summary")
@Token @Token
@ApiOperation("查询预算编制汇总数据") @ApiOperation("查询预算编制汇总数据")
public Object getSummary(@RequestBody QuerySummary request) throws Throwable { public Object getSummary(@ApiIgnore @CurrentUser Long userId,@RequestBody QuerySummary request) throws Throwable {
Object result = projValueService.getSummary(request.getDate(),request.getBudgetType()); Object result = projValueService.getSummary(request.getDate(),request.getBudgetType(),userId);
return Result.success(result); return Result.success(result);
} }
......
...@@ -19,5 +19,5 @@ public interface DicOrgMapper { ...@@ -19,5 +19,5 @@ public interface DicOrgMapper {
int updateByPrimaryKey(DicOrg record); int updateByPrimaryKey(DicOrg record);
List<SerDepartment> selectDeptByUser(@Param("userId") Long userId); List<SerDepartment> selectDeptByUser(@Param("userId") Long userId,@Param("orgId") Long orgId);
} }
\ No newline at end of file
...@@ -14,23 +14,24 @@ public interface SerDiseaseMapper { ...@@ -14,23 +14,24 @@ public interface SerDiseaseMapper {
SerDisease selectByPrimaryKey(Long id); SerDisease selectByPrimaryKey(Long id);
SerDisease selectByCode(@Param("code") String code, @Param("date") String date, @Param("docCode") String docCode, SerDisease selectByCode(@Param("code") String code,@Param("date") String date,@Param("docCode") String docCode,
@Param("deptCode") String deptCode); @Param("deptCode") String deptCode);
List<SerDisease> selectAll(); List<SerDisease> selectAll();
List<SerDisease> selectByMdcName(@Param("date") String date,@Param("mdcName") String mdcName, List<SerDisease> selectByMdcName(@Param("date") String date,@Param("mdcName") String mdcName,
@Param("docCode") String docCode,@Param("deptCode")String deptCode); @Param("docCode") String docCode,@Param("deptCode") String deptCode);
List<DiseaseLevel> selectByLevel(@Param("date") String date,@Param("level") Integer level, List<DiseaseLevel> selectByLevel(@Param("date") String date,@Param("level") Integer level,
@Param("docCode") String docCode,@Param("deptCode") String deptCode); @Param("docCode") String docCode,@Param("deptCode") String deptCode,
@Param("orgId") Long orgId,@Param("userId") Long userId);
List<DiseaseLevel> selectByParentId(@Param("date") String date,@Param("parentId") Integer parentId, List<DiseaseLevel> selectByParentId(@Param("date") String date,@Param("parentId") Integer parentId,
@Param("docCode") String docCode,@Param("deptCode") String deptCode); @Param("docCode") String docCode,@Param("deptCode") String deptCode);
DiseaseLevel selectParentById(@Param("date") String date, @Param("diseaseId") Integer diseaseId); DiseaseLevel selectParentById(@Param("date") String date,@Param("diseaseId") Integer diseaseId);
List<DiseaseLevel> selectSonById(@Param("date") String date, @Param("diseaseId") Integer diseaseId, List<DiseaseLevel> selectSonById(@Param("date") String date,@Param("diseaseId") Integer diseaseId,
@Param("docCode") String docCode,@Param("deptCode") String deptCode); @Param("docCode") String docCode,@Param("deptCode") String deptCode);
int updateByPrimaryKey(SerDisease record); int updateByPrimaryKey(SerDisease record);
......
...@@ -22,10 +22,10 @@ public interface SerProjValueMapper { ...@@ -22,10 +22,10 @@ public interface SerProjValueMapper {
@Param("typeState") Integer typeState, @Param("typeState") Integer typeState,
@Param("exponentId") Integer exponentId, @Param("exponentId") Integer exponentId,
@Param("dept") String dept,@Param("date") Integer date, @Param("dept") String dept,@Param("date") Integer date,
@Param("budgetType") Integer budgetType); @Param("budgetType") Integer budgetType,@Param("hosCode") String hosCode);
int deleteByDeptWithDate(@Param("dept") String dept,@Param("date") BigDecimal date, int deleteByDeptWithDate(@Param("dept") String dept,@Param("date") BigDecimal date,
@Param("projType") Integer projType); @Param("projType") Integer projType);
void updateValue(@Param("date") BigDecimal date); void updateValue(@Param("date") BigDecimal date,@Param("hosCode") String hosCode);
} }
\ No newline at end of file
...@@ -77,4 +77,6 @@ public class SerProjValue { ...@@ -77,4 +77,6 @@ public class SerProjValue {
private String szUnit; private String szUnit;
private String hosCode;
} }
\ No newline at end of file
package com.bsoft.api.model.reqmodel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class DeptReq {
@ApiModelProperty(value = "机构ID", required = true)
@NotNull(message = "机构ID参数必穿")
private Long orgId;
}
package com.bsoft.api.service.Impl; package com.bsoft.api.service.Impl;
import com.bsoft.api.mapper.DicOrgMapper;
import com.bsoft.api.mapper.SerDiseaseMapper; import com.bsoft.api.mapper.SerDiseaseMapper;
import com.bsoft.api.model.DicOrg;
import com.bsoft.api.model.SerDisease; import com.bsoft.api.model.SerDisease;
import com.bsoft.api.model.respmodel.DiseaseLevel; import com.bsoft.api.model.respmodel.DiseaseLevel;
import com.bsoft.api.service.SerDiseaseService; import com.bsoft.api.service.SerDiseaseService;
import com.bsoft.common.utils.StringUtil; import com.bsoft.common.utils.StringUtil;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -14,39 +17,42 @@ import java.util.List; ...@@ -14,39 +17,42 @@ import java.util.List;
public class SerDiseaseServiceImpl implements SerDiseaseService { public class SerDiseaseServiceImpl implements SerDiseaseService {
@Resource @Resource
private SerDiseaseMapper serDiseaseMapper; private SerDiseaseMapper serDiseaseMapper;
@Resource
private DicOrgMapper dicOrgMapper;
@Override @Override
public List<DiseaseLevel> selectListByIdorLevel(String date, String diseaseCode,Integer level,String docCode,String deptCode){ public List<DiseaseLevel> selectListByIdorLevel(String date,String diseaseCode,Integer level,String docCode,String deptCode,Long userId) {
List<DiseaseLevel> list = new ArrayList<>(); List<DiseaseLevel> list = new ArrayList<>();
docCode= StringUtil.isNullOrEmpty(docCode)?null:docCode; docCode = StringUtil.isNullOrEmpty(docCode) ? null : docCode;
deptCode= StringUtil.isNullOrEmpty(deptCode)?null:deptCode; deptCode = StringUtil.isNullOrEmpty(deptCode) ? null : deptCode;
if(diseaseCode!=null&&diseaseCode!=""){ if(diseaseCode != null && diseaseCode != ""){
list = selectByCode(date,diseaseCode,docCode,deptCode); list = selectByCode(date,diseaseCode,docCode,deptCode);
}else{ }else{
list = selectByLevel(date,level,docCode,deptCode); list = selectByLevel(date,level,docCode,deptCode,userId);
} }
return list; return list;
} }
@Override @Override
public List<SerDisease> selectByMdcName(String date, String mdcName,String docCode,String deptCode) { public List<SerDisease> selectByMdcName(String date,String mdcName,String docCode,String deptCode) {
mdcName= StringUtil.isNullOrEmpty(mdcName)?null:mdcName; mdcName = StringUtil.isNullOrEmpty(mdcName) ? null : mdcName;
docCode= StringUtil.isNullOrEmpty(docCode)?null:docCode; docCode = StringUtil.isNullOrEmpty(docCode) ? null : docCode;
deptCode= StringUtil.isNullOrEmpty(deptCode)?null:deptCode; deptCode = StringUtil.isNullOrEmpty(deptCode) ? null : deptCode;
return serDiseaseMapper.selectByMdcName(date,mdcName,docCode,deptCode); return serDiseaseMapper.selectByMdcName(date,mdcName,docCode,deptCode);
} }
/** /**
* 根据Code查询父子级别列表 * 根据Code查询父子级别列表
*
* @param date 时间 * @param date 时间
* @param diseaseCode ID * @param diseaseCode ID
* @return * @return
*/ */
private List<DiseaseLevel> selectByCode(String date, String diseaseCode,String docCode,String deptCode){ private List<DiseaseLevel> selectByCode(String date,String diseaseCode,String docCode,String deptCode) {
SerDisease disease = serDiseaseMapper.selectByCode(diseaseCode,date,docCode,deptCode); SerDisease disease = serDiseaseMapper.selectByCode(diseaseCode,date,docCode,deptCode);
if(disease==null){ if(disease == null){
return null; return null;
} }
//查询父级菜单对象 //查询父级菜单对象
...@@ -54,9 +60,9 @@ public class SerDiseaseServiceImpl implements SerDiseaseService { ...@@ -54,9 +60,9 @@ public class SerDiseaseServiceImpl implements SerDiseaseService {
List<DiseaseLevel> parentList = new ArrayList<>(); List<DiseaseLevel> parentList = new ArrayList<>();
//查询同级菜单列表 //查询同级菜单列表
List<DiseaseLevel> serDiseaseList = serDiseaseMapper.selectByParentId(date,disease.getParentId().intValue(),docCode,deptCode); List<DiseaseLevel> serDiseaseList = serDiseaseMapper.selectByParentId(date,disease.getParentId().intValue(),docCode,deptCode);
List<DiseaseLevel> diseaseLevelList = new ArrayList<>(); List<DiseaseLevel> diseaseLevelList = new ArrayList<>();
for (DiseaseLevel serDiseases: serDiseaseList) { for(DiseaseLevel serDiseases : serDiseaseList){
DiseaseLevel diseaseLevel1 = new DiseaseLevel(); DiseaseLevel diseaseLevel1 = new DiseaseLevel();
//查询子级菜单列表 //查询子级菜单列表
if(serDiseases.getMdcCode().equals(diseaseCode)){ if(serDiseases.getMdcCode().equals(diseaseCode)){
...@@ -74,25 +80,26 @@ public class SerDiseaseServiceImpl implements SerDiseaseService { ...@@ -74,25 +80,26 @@ public class SerDiseaseServiceImpl implements SerDiseaseService {
diseaseLevel1.setParentId(serDiseases.getParentId()); diseaseLevel1.setParentId(serDiseases.getParentId());
diseaseLevelList.add(diseaseLevel1); diseaseLevelList.add(diseaseLevel1);
} }
if(diseaseLevel!=null){ if(diseaseLevel != null){
diseaseLevel.setDiseaseLevelList(diseaseLevelList); diseaseLevel.setDiseaseLevelList(diseaseLevelList);
parentList.add(diseaseLevel); parentList.add(diseaseLevel);
return parentList; return parentList;
}else { }else{
return diseaseLevelList; return diseaseLevelList;
} }
} }
/** /**
* 根据等级查询所有该等级数据 * 根据等级查询所有该等级数据
*
* @param date * @param date
* @param level * @param level
* @return * @return
*/ */
private List<DiseaseLevel> selectByLevel(String date, Integer level,String docCode,String deptCode) { private List<DiseaseLevel> selectByLevel(String date,Integer level,String docCode,String deptCode,Long userId) {
if(level==null){ if(level == null){
level=0; level = 0;
} }
return serDiseaseMapper.selectByLevel(date,level,docCode,deptCode); return serDiseaseMapper.selectByLevel(date,level,docCode,deptCode,null,userId);
} }
} }
...@@ -4,10 +4,8 @@ import com.bsoft.api.common.enums.BudgetType; ...@@ -4,10 +4,8 @@ import com.bsoft.api.common.enums.BudgetType;
import com.bsoft.api.common.enums.ProjectType; import com.bsoft.api.common.enums.ProjectType;
import com.bsoft.api.common.enums.StateType; import com.bsoft.api.common.enums.StateType;
import com.bsoft.api.common.enums.TypeState; import com.bsoft.api.common.enums.TypeState;
import com.bsoft.api.mapper.SerPageProjValueMapper; import com.bsoft.api.mapper.*;
import com.bsoft.api.mapper.SerPageValueConfigMapper; import com.bsoft.api.model.DicOrg;
import com.bsoft.api.mapper.SerProjMapper;
import com.bsoft.api.mapper.SerProjValueMapper;
import com.bsoft.api.model.SerPageValueConfig; import com.bsoft.api.model.SerPageValueConfig;
import com.bsoft.api.model.SerProjValue; import com.bsoft.api.model.SerProjValue;
import com.bsoft.api.model.reqmodel.AddBudgetValue; import com.bsoft.api.model.reqmodel.AddBudgetValue;
...@@ -32,10 +30,15 @@ public class SerProjValueServiceImpl implements SerProjValueService { ...@@ -32,10 +30,15 @@ public class SerProjValueServiceImpl implements SerProjValueService {
private SerPageProjValueMapper pageProjValueMapper; private SerPageProjValueMapper pageProjValueMapper;
@Resource @Resource
private SerPageValueConfigMapper pageValueConfigMapper; private SerPageValueConfigMapper pageValueConfigMapper;
@Resource
private DicOrgMapper dicOrgMapper;
//查询项目数值 //查询项目数值
@Override @Override
public Object getValue(Integer projectType,Integer date,String deptCode) throws Throwable { public Object getValue(Integer projectType,Integer date,String deptCode,Long userId) throws Throwable {
List<DicOrg> orgList = dicOrgMapper.selectByUser(userId);
String orgCode = orgList != null && orgList.size() > 0 ? orgList.get(0).getOrgCode() : null;
List<ProjectValue> result = new ArrayList<>(); List<ProjectValue> result = new ArrayList<>();
List<Map<String,Object>> enumList = TypeState.all(); List<Map<String,Object>> enumList = TypeState.all();
if(enumList != null && enumList.size() > 0){ if(enumList != null && enumList.size() > 0){
...@@ -51,7 +54,7 @@ public class SerProjValueServiceImpl implements SerProjValueService { ...@@ -51,7 +54,7 @@ public class SerProjValueServiceImpl implements SerProjValueService {
if(projectInfo != null && projectInfo.size() > 0){ if(projectInfo != null && projectInfo.size() > 0){
for(ProjectInfo projInfo : projectInfo){ for(ProjectInfo projInfo : projectInfo){
values = serProjValueMapper.selectValue(projectType,(Integer)enumInfo.get("value"), values = serProjValueMapper.selectValue(projectType,(Integer)enumInfo.get("value"),
projInfo.getExponentId(),deptCode,date,BudgetType.NOT.getValue()); projInfo.getExponentId(),deptCode,date,BudgetType.NOT.getValue(),orgCode);
resultValues = getLevelData(values,BigDecimal.valueOf(PROJ_TOP_PARENT_ID)); resultValues = getLevelData(values,BigDecimal.valueOf(PROJ_TOP_PARENT_ID));
if(resultValues != null && resultValues.size() > 0) if(resultValues != null && resultValues.size() > 0)
projInfo.setProjectValues(resultValues); projInfo.setProjectValues(resultValues);
...@@ -66,8 +69,10 @@ public class SerProjValueServiceImpl implements SerProjValueService { ...@@ -66,8 +69,10 @@ public class SerProjValueServiceImpl implements SerProjValueService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public boolean save(AddBudgetValue request) { public boolean save(Long userId,AddBudgetValue request) {
int result = 0; int result = 0;
List<DicOrg> orgList = dicOrgMapper.selectByUser(userId);
String orgCode = orgList.get(0).getOrgCode();
if(request != null && request.getBudgetValues() != null && request.getBudgetValues().size() > 0){ if(request != null && request.getBudgetValues() != null && request.getBudgetValues().size() > 0){
//先进行删除操作 //先进行删除操作
result = serProjValueMapper.deleteByDeptWithDate(request.getDeptCode(),request.getDate(),request.getProjType()); result = serProjValueMapper.deleteByDeptWithDate(request.getDeptCode(),request.getDate(),request.getProjType());
...@@ -80,16 +85,20 @@ public class SerProjValueServiceImpl implements SerProjValueService { ...@@ -80,16 +85,20 @@ public class SerProjValueServiceImpl implements SerProjValueService {
info.setCreateDate(new Date()); info.setCreateDate(new Date());
info.setState(BigDecimal.valueOf(StateType.ON.getValue())); info.setState(BigDecimal.valueOf(StateType.ON.getValue()));
info.setVersion(String.valueOf(version)); info.setVersion(String.valueOf(version));
info.setHosCode(orgCode);
serProjValueMapper.insert(info); serProjValueMapper.insert(info);
} }
//调用计算数值存储过程 //调用计算数值存储过程
serProjValueMapper.updateValue(request.getDate()); serProjValueMapper.updateValue(request.getDate(),orgCode);
} }
return result > 0; return result > 0;
} }
@Override @Override
public Object getSummary(Integer date,Integer budgetType) { public Object getSummary(Integer date,Integer budgetType,Long userId) {
List<DicOrg> orgList = dicOrgMapper.selectByUser(userId);
String orgCode = orgList.get(0).getOrgCode();
List<Summary> result = serProjMapper.selectDept(date,budgetType); List<Summary> result = serProjMapper.selectDept(date,budgetType);
if(result != null && result.size() > 0){ if(result != null && result.size() > 0){
for(Summary summary : result){ for(Summary summary : result){
...@@ -102,7 +111,7 @@ public class SerProjValueServiceImpl implements SerProjValueService { ...@@ -102,7 +111,7 @@ public class SerProjValueServiceImpl implements SerProjValueService {
projType = new SummaryProjType(); projType = new SummaryProjType();
projType.setProjTypeName(String.valueOf(enumInfo.get("description"))); projType.setProjTypeName(String.valueOf(enumInfo.get("description")));
List<SerProjValueResp> values = serProjValueMapper.selectValue((Integer)enumInfo.get("value"),null, List<SerProjValueResp> values = serProjValueMapper.selectValue((Integer)enumInfo.get("value"),null,
null,summary.getDeptCode(),date,budgetType); null,summary.getDeptCode(),date,budgetType,orgCode);
if(values != null) if(values != null)
projType.setProject(values); projType.setProject(values);
summary.getProjTypeList().add(projType); summary.getProjTypeList().add(projType);
......
...@@ -2,6 +2,7 @@ package com.bsoft.api.service.Impl; ...@@ -2,6 +2,7 @@ package com.bsoft.api.service.Impl;
import com.bsoft.api.mapper.DicOrgMapper; import com.bsoft.api.mapper.DicOrgMapper;
import com.bsoft.api.mapper.SysUserOrgRsMapper; import com.bsoft.api.mapper.SysUserOrgRsMapper;
import com.bsoft.api.model.DicOrg;
import com.bsoft.api.model.SerDepartment; import com.bsoft.api.model.SerDepartment;
import com.bsoft.api.model.SysUserOrgRs; import com.bsoft.api.model.SysUserOrgRs;
import com.bsoft.api.service.SysUserOrgRsService; import com.bsoft.api.service.SysUserOrgRsService;
...@@ -16,6 +17,8 @@ public class SysUserOrgRsServiceImpl implements SysUserOrgRsService { ...@@ -16,6 +17,8 @@ public class SysUserOrgRsServiceImpl implements SysUserOrgRsService {
private SysUserOrgRsMapper sysUserOrgRsMapper; private SysUserOrgRsMapper sysUserOrgRsMapper;
@Resource @Resource
private DicOrgMapper orgMapper; private DicOrgMapper orgMapper;
@Resource
private DicOrgMapper dicOrgMapper;
@Override @Override
public int add(SysUserOrgRs sysUserOrgRs) { public int add(SysUserOrgRs sysUserOrgRs) {
...@@ -49,7 +52,9 @@ public class SysUserOrgRsServiceImpl implements SysUserOrgRsService { ...@@ -49,7 +52,9 @@ public class SysUserOrgRsServiceImpl implements SysUserOrgRsService {
@Override @Override
public List<SerDepartment> getUserOrg(Long userId) { public List<SerDepartment> getUserOrg(Long userId) {
List<SerDepartment> list = orgMapper.selectDeptByUser(userId); List<DicOrg> orgList = dicOrgMapper.selectByUser(userId);
Long orgId = orgList != null && orgList.size() > 0 ? orgList.get(0).getId() : null;
List<SerDepartment> list = orgMapper.selectDeptByUser(userId,orgId);
return list; return list;
} }
......
...@@ -8,5 +8,6 @@ import java.util.List; ...@@ -8,5 +8,6 @@ import java.util.List;
public interface SerDiseaseService { public interface SerDiseaseService {
List<SerDisease> selectByMdcName(String date,String mdcName,String docCode,String deptCode); List<SerDisease> selectByMdcName(String date,String mdcName,String docCode,String deptCode);
List<DiseaseLevel> selectListByIdorLevel(String date,String diseaseCode,Integer level,String docCode,String deptCode);
List<DiseaseLevel> selectListByIdorLevel(String date,String diseaseCode,Integer level,String docCode,String deptCode,Long userId);
} }
...@@ -6,13 +6,13 @@ import java.util.Map; ...@@ -6,13 +6,13 @@ import java.util.Map;
public interface SerProjValueService { public interface SerProjValueService {
//顶级项目的父级id //顶级项目的父级id
final static Integer PROJ_TOP_PARENT_ID =0; final static Integer PROJ_TOP_PARENT_ID = 0;
Object getValue(Integer projectType,Integer date,String deptCode) throws Throwable; Object getValue(Integer projectType,Integer date,String deptCode,Long userId) throws Throwable;
boolean save(AddBudgetValue request); boolean save(Long userId,AddBudgetValue request);
Object getSummary(Integer date,Integer budgetType); Object getSummary(Integer date,Integer budgetType,Long userId);
Object getData(Integer date,Integer page); Object getData(Integer date,Integer page);
......
...@@ -71,12 +71,16 @@ ...@@ -71,12 +71,16 @@
SELECT o.* SELECT o.*
FROM SYS_USER_ORG_RS uor,DIC_ORG o FROM SYS_USER_ORG_RS uor,DIC_ORG o
where uor.ORG_ID=o.ID and uor.USER_ID= #{userId,jdbcType=DECIMAL} where uor.ORG_ID=o.ID and uor.USER_ID= #{userId,jdbcType=DECIMAL}
and uor.STATE = 1 and o.STATE = 1 and uor.STATE = 1 and o.STATE = 1 and o.PARENT_ID = 0
</select> </select>
<select id="selectDeptByUser" resultMap="SummaryDept"> <select id="selectDeptByUser" resultMap="SummaryDept">
select o.ID,o.ORG_CODE as KSBM,o.ORG_NAME as KSMC select o.ID,o.ORG_CODE as KSBM,o.ORG_NAME as KSMC
from SYS_USER_ORG_RS rs from SYS_USER_ORG_RS rs
join DIC_ORG o on o.id = rs.ORG_ID and rs.STATE = 1 join DIC_ORG o on o.id = rs.ORG_ID and rs.STATE = 1
where o.STATE = 1 and o.PARENT_ID != 0 and rs.USER_ID = #{userId,jdbcType=DECIMAL} where o.STATE = 1
<if test="orgId!=null">
and o.PARENT_ID = #{orgId,jdbcType=DECIMAL}
</if>
and rs.USER_ID = #{userId,jdbcType=DECIMAL}
</select> </select>
</mapper> </mapper>
\ No newline at end of file
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
MDC_NUM, PARENT_ID, LEVEL, MDC_NUM, PARENT_ID, LEVEL,
ORG_ID, ORG_NAME) ORG_ID, ORG_NAME)
values ( values (
#{mdcCode,jdbcType=VARCHAR}, #{mdcName,jdbcType=VARCHAR}, #{date,jdbcType=DECIMAL}, #{mdcCode,jdbcType=VARCHAR}, #{mdcName,jdbcType=VARCHAR}, #{date,jdbcType=DECIMAL},
#{mdcNum,jdbcType=DECIMAL}, #{parentId,jdbcType=DECIMAL}, #{level,jdbcType=DECIMAL}, #{mdcNum,jdbcType=DECIMAL}, #{parentId,jdbcType=DECIMAL}, #{level,jdbcType=DECIMAL},
#{orgId,jdbcType=DECIMAL}, #{orgName,jdbcType=VARCHAR}) #{orgId,jdbcType=DECIMAL}, #{orgName,jdbcType=VARCHAR})
</insert> </insert>
<update id="updateByPrimaryKey" parameterType="com.bsoft.api.model.SerDisease"> <update id="updateByPrimaryKey" parameterType="com.bsoft.api.model.SerDisease">
...@@ -109,10 +109,18 @@ ...@@ -109,10 +109,18 @@
and d."LEVEL" = #{level,jdbcType=DECIMAL} and d."LEVEL" = #{level,jdbcType=DECIMAL}
</if> </if>
<if test="docCode!=null"> <if test="docCode!=null">
and rs.DOC_CODE=#{docCode,jdbcType=VARCHAR} and rs.DOC_CODE = #{docCode,jdbcType=DECIMAL}
</if> </if>
<if test="deptCode!=null"> <if test="deptCode!=null">
and rs.DEPT_CODE=#{deptCode,jdbcType=VARCHAR} and rs.DEPT_CODE = #{deptCode,jdbcType=VARCHAR}
</if>
<if test="deptCode==null">
and rs.DEPT_CODE in(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}
)
</if> </if>
order by d.MDC_NUM order by d.MDC_NUM
</select> </select>
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<result column="CSYSZ_UNIT" jdbcType="VARCHAR" property="csyszUnit" /> <result column="CSYSZ_UNIT" jdbcType="VARCHAR" property="csyszUnit" />
<result column="YSZ_UNIT" jdbcType="VARCHAR" property="yszUnit" /> <result column="YSZ_UNIT" jdbcType="VARCHAR" property="yszUnit" />
<result column="SZ_UNIT" jdbcType="VARCHAR" property="szUnit" /> <result column="SZ_UNIT" jdbcType="VARCHAR" property="szUnit" />
<result column="HOSCODE" jdbcType="VARCHAR" property="hosCode" />
</resultMap> </resultMap>
<resultMap id="SerProjValueResp" extends="BaseResultMap" type="com.bsoft.api.model.respmodel.SerProjValueResp"> <resultMap id="SerProjValueResp" extends="BaseResultMap" type="com.bsoft.api.model.respmodel.SerProjValueResp">
<result column="PROJ_NAME" jdbcType="VARCHAR" property="projName"/> <result column="PROJ_NAME" jdbcType="VARCHAR" property="projName"/>
...@@ -45,14 +46,14 @@ ...@@ -45,14 +46,14 @@
YSZ, YSZ_TB, SZ, ZXPL, YSZ, YSZ_TB, SZ, ZXPL,
"DATE", DEPT_CODE, SORT, "DATE", DEPT_CODE, SORT,
VERSION, QNZ_UNIT, CSYSZ_UNIT, VERSION, QNZ_UNIT, CSYSZ_UNIT,
YSZ_UNIT, SZ_UNIT) YSZ_UNIT, SZ_UNIT,HOSCODE)
values (#{id,jdbcType=DECIMAL},#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL}, values (#{id,jdbcType=DECIMAL},#{createDate,jdbcType=TIMESTAMP}, #{createUserid,jdbcType=DECIMAL}, #{state,jdbcType=DECIMAL},
#{projId,jdbcType=DECIMAL}, #{qnz,jdbcType=DECIMAL}, #{wqqs,jdbcType=DECIMAL}, #{projId,jdbcType=DECIMAL}, #{qnz,jdbcType=DECIMAL}, #{wqqs,jdbcType=DECIMAL},
#{ls,jdbcType=DECIMAL}, #{mb,jdbcType=DECIMAL}, #{csysz,jdbcType=DECIMAL}, #{csyszTb,jdbcType=DECIMAL}, #{ls,jdbcType=DECIMAL}, #{mb,jdbcType=DECIMAL}, #{csysz,jdbcType=DECIMAL}, #{csyszTb,jdbcType=DECIMAL},
#{ysz,jdbcType=DECIMAL}, #{yszTb,jdbcType=DECIMAL}, #{sz,jdbcType=DECIMAL}, #{zxpl,jdbcType=DECIMAL}, #{ysz,jdbcType=DECIMAL}, #{yszTb,jdbcType=DECIMAL}, #{sz,jdbcType=DECIMAL}, #{zxpl,jdbcType=DECIMAL},
#{date,jdbcType=DECIMAL}, #{deptCode,jdbcType=VARCHAR}, #{sort,jdbcType=DECIMAL}, #{date,jdbcType=DECIMAL}, #{deptCode,jdbcType=VARCHAR}, #{sort,jdbcType=DECIMAL},
#{version,jdbcType=VARCHAR}, #{qnzUnit,jdbcType=VARCHAR}, #{csyszUnit,jdbcType=VARCHAR}, #{version,jdbcType=VARCHAR}, #{qnzUnit,jdbcType=VARCHAR}, #{csyszUnit,jdbcType=VARCHAR},
#{yszUnit,jdbcType=VARCHAR}, #{szUnit,jdbcType=VARCHAR}) #{yszUnit,jdbcType=VARCHAR}, #{szUnit,jdbcType=VARCHAR}, #{hosCode,jdbcType=VARCHAR})
</insert> </insert>
<update id="updateByPrimaryKey" parameterType="com.bsoft.api.model.SerProjValue"> <update id="updateByPrimaryKey" parameterType="com.bsoft.api.model.SerProjValue">
update SER_PROJ_VALUE update SER_PROJ_VALUE
...@@ -77,20 +78,21 @@ ...@@ -77,20 +78,21 @@
QNZ_UNIT = #{qnzUnit,jdbcType=VARCHAR}, QNZ_UNIT = #{qnzUnit,jdbcType=VARCHAR},
CSYSZ_UNIT = #{csyszUnit,jdbcType=VARCHAR}, CSYSZ_UNIT = #{csyszUnit,jdbcType=VARCHAR},
YSZ_UNIT = #{yszUnit,jdbcType=VARCHAR}, YSZ_UNIT = #{yszUnit,jdbcType=VARCHAR},
SZ_UNIT = #{szUnit,jdbcType=VARCHAR} SZ_UNIT = #{szUnit,jdbcType=VARCHAR},
HOSCODE = #{hosCode,jdbcType=VARCHAR}
where ID = #{id,jdbcType=DECIMAL} where ID = #{id,jdbcType=DECIMAL}
</update> </update>
<select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.math.BigDecimal" resultMap="BaseResultMap">
select ID, CREATE_DATE, CREATE_USERID, "STATE", PROJ_ID, QNZ, WQQS, LS, MB, CSYSZ, select ID, CREATE_DATE, CREATE_USERID, "STATE", PROJ_ID, QNZ, WQQS, LS, MB, CSYSZ,
CSYSZ_TB, YSZ, YSZ_TB, SZ, ZXPL, "DATE", DEPT_CODE, SORT, VERSION, QNZ_UNIT, CSYSZ_UNIT, CSYSZ_TB, YSZ, YSZ_TB, SZ, ZXPL, "DATE", DEPT_CODE, SORT, VERSION, QNZ_UNIT, CSYSZ_UNIT,
YSZ_UNIT, SZ_UNIT YSZ_UNIT, SZ_UNIT, HOSCODE
from SER_PROJ_VALUE from SER_PROJ_VALUE
where ID = #{id,jdbcType=DECIMAL} where ID = #{id,jdbcType=DECIMAL}
</select> </select>
<select id="selectAll" resultMap="BaseResultMap"> <select id="selectAll" resultMap="BaseResultMap">
select ID, CREATE_DATE, CREATE_USERID, "STATE", PROJ_ID, QNZ, WQQS, LS, MB, CSYSZ, select ID, CREATE_DATE, CREATE_USERID, "STATE", PROJ_ID, QNZ, WQQS, LS, MB, CSYSZ,
CSYSZ_TB, YSZ, YSZ_TB, SZ, ZXPL, "DATE", DEPT_CODE, SORT, VERSION, QNZ_UNIT, CSYSZ_UNIT, CSYSZ_TB, YSZ, YSZ_TB, SZ, ZXPL, "DATE", DEPT_CODE, SORT, VERSION, QNZ_UNIT, CSYSZ_UNIT,
YSZ_UNIT, SZ_UNIT YSZ_UNIT, SZ_UNIT, HOSCODE
from SER_PROJ_VALUE from SER_PROJ_VALUE
</select> </select>
<select id="selectValue" resultMap="SerProjValueResp"> <select id="selectValue" resultMap="SerProjValueResp">
...@@ -107,6 +109,9 @@ ...@@ -107,6 +109,9 @@
<if test="date!=null"> <if test="date!=null">
AND v."DATE" = #{date,jdbcType=DECIMAL} AND v."DATE" = #{date,jdbcType=DECIMAL}
</if> </if>
<if test="hosCode!=null">
AND v.HOSCODE = #{hosCode,jdbcType=VARCHAR}
</if>
GROUP BY v.PROJ_ID GROUP BY v.PROJ_ID
)m on m.PROJ_ID = p.ID )m on m.PROJ_ID = p.ID
left JOIN SER_PROJ_VALUE v ON v.PROJ_ID = m.PROJ_ID AND v.VERSION = m.VERSION left JOIN SER_PROJ_VALUE v ON v.PROJ_ID = m.PROJ_ID AND v.VERSION = m.VERSION
...@@ -116,6 +121,9 @@ ...@@ -116,6 +121,9 @@
<if test="date!=null"> <if test="date!=null">
AND v."DATE" = #{date,jdbcType=DECIMAL} AND v."DATE" = #{date,jdbcType=DECIMAL}
</if> </if>
<if test="hosCode!=null">
AND v.HOSCODE = #{hosCode,jdbcType=VARCHAR}
</if>
WHERE 1 = 1 and p."STATE" = 1 WHERE 1 = 1 and p."STATE" = 1
<if test="projType!=null"> <if test="projType!=null">
AND p.PROJ_TYPE = #{projType,jdbcType=DECIMAL} AND p.PROJ_TYPE = #{projType,jdbcType=DECIMAL}
...@@ -142,7 +150,8 @@ ...@@ -142,7 +150,8 @@
</update> </update>
<update id="updateValue" statementType="CALLABLE"> <update id="updateValue" statementType="CALLABLE">
{call ESTIMATE_UPDATE_GZD_BL( {call ESTIMATE_UPDATE_GZD_BL(
#{date,jdbcType=DECIMAL} #{date,jdbcType=DECIMAL},
#{hosCode,jdbcType=VARCHAR}
)} )}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
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