Commit aeb39278 authored by zhangch's avatar zhangch

服务项目接口调试、以往错误接口修改

parent b57407d7
package com.hungraim.ltc.api;
import com.hungraim.ltc.pojo.vo.disable.SrvModeVo;
import com.hungraim.ltc.util.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import java.util.List;
@FeignClient("LTC-APPLY-SERVICE")
public interface SrvModeFeignService {
/**
* feign api 获取所有的服务方式接口
* @return 返回所有服务方式
*/
@GetMapping("/api.apply/disable/fndSrvMode")
Result<List<SrvModeVo>> cfgSrvMode();
}
......@@ -73,10 +73,19 @@ public class DisableController {
}
/**
* 查询所有机构
*/
@RequestMapping("/fndAllOrgan")
public Result<List<ChFndOrgan>> fndAllOrgan() {
List<ChFndOrgan> organs = disableService.fndAllOrgan();
return Result.success(organs);
}
/**
* 查询所有服务方式
*/
@RequestMapping("/fndSrvMode")
public Result cfgSrvMode() {
public Result<List<SrvModeVo>> cfgSrvMode() {
List<SrvModeVo> fndSrvModes = disableService.cfgSrvModeList();
return Result.success(fndSrvModes);
}
......
......@@ -91,4 +91,10 @@ public interface DisableService {
List<ChFndDiseaseType> fndAllDisease();
DisableInfoVO getDisableInfo(String disableInfoId);
/**
* 查询所有适用机构
* @return 返回列表
*/
List<ChFndOrgan> fndAllOrgan();
}
......@@ -177,13 +177,13 @@ public class DisableServiceImpl implements DisableService {
public List<ChFndOrgan> fndOrganRoot() {
QueryWrapper<ChFndOrgan> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("IS_LEAF", "1");
queryWrapper.eq("STATUS","1");
queryWrapper.and(wrapper -> wrapper.isNull("PARENT_ID").or().eq("PARENT_ID", ""));
return fndOrganMapper.selectList(queryWrapper);
}
@Override
public List<SrvModeVo> cfgSrvModeList() {
return srvModeMapper.selectAll();
}
......@@ -244,4 +244,12 @@ public class DisableServiceImpl implements DisableService {
public DisableInfoVO getDisableInfo(String disableInfoId) {
return disableApplyMapper.getDisableInfo(disableInfoId);
}
@Override
public List<ChFndOrgan> fndAllOrgan() {
QueryWrapper<ChFndOrgan> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("IS_LEAF", "1");
queryWrapper.eq("STATUS","1");
return fndOrganMapper.selectList(queryWrapper);
}
}
\ No newline at end of file
......@@ -4,8 +4,9 @@
<select id="selectAll" resultType="com.hungraim.ltc.pojo.vo.disable.SrvModeVo">
SELECT MODE_ID srvModeId,
MODE_NAME srvModeName
SELECT MODE_ID srvModeId,
MODE_NAME srvModeName,
REMARK remark
FROM CH_CFG_SRV_MODE
</select>
</mapper>
\ No newline at end of file
......@@ -9,4 +9,5 @@ import lombok.Data;
public class SrvModeVo {
private Integer srvModeId;
private String srvModeName;
private String remark;
}
package com.hungraim.ltc.pojo.vo.governance;
import com.hungraim.ltc.pojo.entity.PageInfo;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 护理机构护理项目配置列表VO
*/
@Data
public class OrganProjectVO extends PageInfo implements Serializable {
public class OrganProjectVO implements Serializable {
/**
* 护理服务项目id
*/
private Integer projectId;
private Long projectId;
/**
* 适用机构
* 护理机构
*/
private String srvOrganName;
/**
* 机构代码
* 护理机构代码
*/
private Long srvOrganId;
/**
* 适用机构
*/
private Integer organId;
private Long organId;
/**
* 模板名称
*/
......@@ -33,5 +38,35 @@ public class OrganProjectVO extends PageInfo implements Serializable {
/**
* 状态
*/
private String status;
private Integer status;
/**
* 类服务包类型(1基础护理、2日常照护项目、3其它、4巡诊)
*/
private Integer categoryType;
/**
* 频次
*/
private Integer itemTimes;
/**
* 频次类型(1:次/每月,2:必要时)
*/
private Integer itemTimesType;
/**
* 服务单价
*/
private BigDecimal itemPrice;
/**
* 是否必需项(是:1;否:0)
*/
private Integer isConf;
/**
* 服务内容
*/
private String serviceContent;
}
......@@ -70,6 +70,20 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--feign服务调用-->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<!--apply-api-->
<dependency>
<groupId>com.hungraim.ltc</groupId>
<artifactId>apply-api</artifactId>
<version>0.0.1</version>
</dependency>
</dependencies>
<build>
......
......@@ -3,6 +3,7 @@ package com.hungraim.ltc;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
......@@ -10,6 +11,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
*/
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableTransactionManagement
public class GovernanceApplication {
public static void main(String[] args) {
......
package com.hungraim.ltc.governance.controller;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.governance.service.NursingServiceItemsService;
import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgSrvMode;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganProject;
import com.hungraim.ltc.pojo.vo.disable.SrvModeVo;
import com.hungraim.ltc.pojo.vo.governance.OrganProjectVO;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
......@@ -55,11 +56,8 @@ public class NursingServiceItemsController {
@RequestMapping("/organProjectConfig")
public Result<Object> organProjectConfig(ChSrvOrganProject project) {
//参数校验
if (project.getSrvOrganId() == null//机构id
|| StringUtils.isBlank(project.getItemName())//服务项目名称
|| project.getStatus() == null//状态 0有效,1无效
) {
return Result.failed("参数异常!");
if (project.getSrvOrganId() == null || StrUtil.isBlank(project.getItemName()) || StrUtil.isBlank(project.getServiceContent()) || project.getCategoryType() == null || project.getItemPrice() == null) {
return Result.failed(ResultCode.REQUEST_PARAM_ERROR);
}
nursingServiceItemsService.organProjectConfig(project);
return Result.success();
......@@ -112,8 +110,8 @@ public class NursingServiceItemsController {
* 服务方式定义配置列表
*/
@RequestMapping("/modeConfigList")
public Result<List<ChCfgSrvMode>> modeConfigList() {
List<ChCfgSrvMode> list = nursingServiceItemsService.modeConfigList();
public Result<List<SrvModeVo>> modeConfigList() {
List<SrvModeVo> list = nursingServiceItemsService.modeConfigList();
return Result.success(list);
}
......
package com.hungraim.ltc.governance.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgSrvMode;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganProject;
import com.hungraim.ltc.pojo.vo.disable.SrvModeVo;
import com.hungraim.ltc.pojo.vo.governance.OrganProjectVO;
import org.springframework.stereotype.Service;
......@@ -22,7 +22,7 @@ public interface NursingServiceItemsService {
List<ChCfgSrvDisableLevel> disableLevelConfigList();
List<ChCfgSrvMode> modeConfigList();
List<SrvModeVo> modeConfigList();
/**
* 删除对应失能等级数据
......
......@@ -3,6 +3,7 @@ package com.hungraim.ltc.governance.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.api.SrvModeFeignService;
import com.hungraim.ltc.governance.dao.ChSrvOrganProjectMapper;
import com.hungraim.ltc.governance.dao.DisableLevelMapper;
import com.hungraim.ltc.governance.dao.SrvModeMapper;
......@@ -10,9 +11,11 @@ import com.hungraim.ltc.governance.service.NursingServiceItemsService;
import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgSrvMode;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganProject;
import com.hungraim.ltc.pojo.vo.disable.SrvModeVo;
import com.hungraim.ltc.pojo.vo.governance.OrganProjectVO;
import com.hungraim.ltc.util.Result;
import lombok.AllArgsConstructor;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
......@@ -20,14 +23,13 @@ import java.util.Date;
import java.util.List;
@Service
@AllArgsConstructor
public class NursingServiceItemsServiceImpl implements NursingServiceItemsService {
@Autowired
private ChSrvOrganProjectMapper chSrvOrganProjectMapper;
@Autowired
private DisableLevelMapper disableLevelMapper;
@Autowired
private SrvModeMapper srvModeMapper;
private final ChSrvOrganProjectMapper chSrvOrganProjectMapper;
private final DisableLevelMapper disableLevelMapper;
private final SrvModeMapper srvModeMapper;
private final SrvModeFeignService srvModeFeignService;
@Override
public Page<OrganProjectVO> organProjectList(Page<OrganProjectVO> page, String organIds, String name, String status) {
......@@ -41,9 +43,9 @@ public class NursingServiceItemsServiceImpl implements NursingServiceItemsServic
@Override
public void organProjectConfig(ChSrvOrganProject project) {
if (project.getProjectId() != null) {
project.setEffTime(new Date());//创建时间
} else {
chSrvOrganProjectMapper.updateById(project);
} else {
project.setEffTime(new Date());//创建时间
chSrvOrganProjectMapper.insert(project);
}
}
......@@ -88,8 +90,12 @@ public class NursingServiceItemsServiceImpl implements NursingServiceItemsServic
}
@Override
public List<ChCfgSrvMode> modeConfigList() {
return srvModeMapper.selectList(new QueryWrapper<>());
public List<SrvModeVo> modeConfigList() {
Result<List<SrvModeVo>> listResult = srvModeFeignService.cfgSrvMode();
if ("00000".equals(listResult.getCode())) {
return listResult.getData();
}
return null;
}
@Override
......
......@@ -75,15 +75,23 @@
--适用机构
organ.srv_organ_name srvOrganName,
--机构代码
project.srv_organ_id organId,
project.srv_organ_id srvOrganId,
org.ORGAN_ID organId,
--护理服务项目名称
project.item_name itemName,
--备注
project.remark remark,
--状态
project.status status
project.status status,
project.CATEGORY_TYPE categoryType,
project.ITEM_TIMES itemTimes,
project.ITEM_TIMES_TYPE itemTimesType,
project.ITEM_PRICE itemPrice,
project.SERVICE_CONTENT serviceContent,
project.IS_CONF isConf
FROM CH_SRV_ORGAN_PROJECT project
left join ch_srv_organ organ on project.SRV_ORGAN_ID = organ.SRV_ORGAN_ID
left join CH_FND_ORGAN org on organ.ORGAN_ID = org.ORGAN_ID
<where>
<if test="organIds != null">
and project.srv_organ_id in
......
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