Commit 2976a61b authored by zhangch's avatar zhangch
parents 6a3fb304 78bcd7ed
......@@ -6,10 +6,10 @@ import lombok.Data;
import java.io.Serializable;
/**
* 护理服务项目列表VO
* 护理机构护理项目配置列表VO
*/
@Data
public class NursingServiceItemsVO extends PageInfo implements Serializable {
public class OrganProjectVO extends PageInfo implements Serializable {
/**
* 护理服务项目id
*/
......
......@@ -2,16 +2,22 @@ package com.hungraim.ltc.governance.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.governance.service.NursingServiceItemsService;
import com.hungraim.ltc.pojo.vo.governance.NursingServiceItemsVO;
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.governance.OrganProjectVO;
import com.hungraim.ltc.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 护理服务项目Controller
* 护理服务项目配置Controller
*
* @author czz
*/
......@@ -24,47 +30,97 @@ public class NursingServiceItemsController {
private NursingServiceItemsService nursingServiceItemsService;
/**
* 服务参数详细配置
* 护理机构护理项目配置列表
*
* @param organIds 机构id
* @param name 护理服务项目名称
* @param status 状态
*/
@RequestMapping("/organProjectList")
public Result<Page<OrganProjectVO>> organProjectList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize,
String organIds, String name, String status) {
Page<OrganProjectVO> page = new Page<>(pageNum, pageSize);
page = nursingServiceItemsService.organProjectList(page, organIds, name, status);
return Result.success(page);
}
/**
* 护理机构护理项目配置
*
* @param project 护理项目 护理项目id(如果为null就是新增,否则就是修改)
*/
@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("参数异常!");
}
nursingServiceItemsService.organProjectConfig(project);
return Result.success();
}
/**
* 失能等级定义配置列表
*/
@RequestMapping("/disableLevelConfigList")
public Result<List<ChCfgSrvDisableLevel>> disableLevelConfigList() {
List<ChCfgSrvDisableLevel> list = nursingServiceItemsService.disableLevelConfigList();
return Result.success(list);
}
/**
* 失能等级定义配置
*
* @param disableLevelId 失能等级定义id(如果为null就是新增,否则就是修改)
* @param disableLevelName 失能等级定义列表 失能等级
* @param disableLevelStartValue 失能等级定义列表 值1
* @param disableLevelEndValue 失能等级定义列表 值2
* @param disableLevelRemark 失能等级定义列表 备注
* -----------
* @param modeName 服务方式定义列表 服务方式
* @param modeRemark 服务方式定义列表 备注
* -----------
* @param itemId 服务项目定义列表 序号
* @param showNumber 服务项目定义列表 展示序号
* @param itemName 服务项目定义列表 服务项目
* @param cateId 服务项目定义列表 服务项目分类
* @param srvLevelId 服务项目定义列表 服务等级
* @param chooseFlag 服务项目定义列表 是否必选
* @param payType 服务项目定义列表 付款类型 1,基金支付0自费费用
* @param itemRemark 服务项目定义列表 备注
*/
@RequestMapping("/serviceConfigInfo")
public Result<Object> serviceConfigInfo(String[] disableLevelName, String[] disableLevelStartValue, String[] disableLevelEndValue, String[] disableLevelRemark,
String[] modeName, String[] modeRemark,
String[] itemId, String[] showNumber, String[] itemName, String[] cateId, String[] srvLevelId, String[] chooseFlag, String[] payType, String[] itemRemark) {
// nursingServiceItemsService.serviceConfigInfo(page, organIds, aprName, status);
@RequestMapping("/disableLevelConfig")
public Result<Object> disableLevelConfig(String disableLevelId, String disableLevelName, Short disableLevelStartValue, Short disableLevelEndValue, String disableLevelRemark) {
//参数校验
if (StringUtils.isBlank(disableLevelId)
|| StringUtils.isBlank(disableLevelName)
|| disableLevelStartValue == null
|| disableLevelEndValue == null
) {
return Result.failed("参数异常!");
}
nursingServiceItemsService.disableLevelConfig(disableLevelId, disableLevelName, disableLevelStartValue, disableLevelEndValue, disableLevelRemark);
return Result.success();
}
/**
* 护理服务项目列表
*
* @param organIds 机构id
* @param name 护理服务项目名称
* @param status 状态
* 服务方式定义配置列表
*/
@RequestMapping("/nursingServiceItemsList")
public Result<Page<NursingServiceItemsVO>> nursingServiceItemsList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize,
String organIds, String name, String status) {
Page<NursingServiceItemsVO> page = new Page<>(pageNum, pageSize);
page = nursingServiceItemsService.nursingServiceItemsList(page, organIds, name, status);
return Result.success(page);
@RequestMapping("/modeConfigList")
public Result<List<ChCfgSrvMode>> modeConfigList() {
List<ChCfgSrvMode> list = nursingServiceItemsService.modeConfigList();
return Result.success(list);
}
/**
* 服务方式定义配置
*
* @param modeId 服务方式定义id(如果为null就是新增,否则就是修改)
* @param modeName 服务方式定义列表 服务方式
* @param modeRemark 服务方式定义列表 备注
*/
@RequestMapping("/modeConfig")
public Result<Object> modeConfig(String modeId, String modeName, String modeRemark) {
//参数校验
if (StringUtils.isBlank(modeId)
|| StringUtils.isBlank(modeName)
) {
return Result.failed("参数异常!");
}
nursingServiceItemsService.modeConfig(modeId, modeName, modeRemark);
return Result.success();
}
}
......@@ -3,7 +3,7 @@ package com.hungraim.ltc.governance.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvOrganProject;
import com.hungraim.ltc.pojo.vo.governance.NursingServiceItemsVO;
import com.hungraim.ltc.pojo.vo.governance.OrganProjectVO;
import com.hungraim.ltc.pojo.vo.governance.ProgramSetAndProjectVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -23,5 +23,5 @@ public interface ChSrvOrganProjectMapper extends BaseMapper<ChSrvOrganProject> {
*/
List<ProgramSetAndProjectVo> selectOrganProjectsBySrvOrganId(@Param("srvOrganId") Long srvOrganId);
Page<NursingServiceItemsVO> nursingServiceItemsList(Page<NursingServiceItemsVO> page, List<String> organIds, String name, String status);
Page<OrganProjectVO> organProjectList(Page<OrganProjectVO> page, List<String> organIds, String name, String status);
}
\ No newline at end of file
package com.hungraim.ltc.governance.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface DisableLevelMapper extends BaseMapper<ChCfgSrvDisableLevel> {
}
\ No newline at end of file
package com.hungraim.ltc.governance.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.SysConfig.ChCfgSrvMode;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
@Mapper
@Repository
public interface SrvModeMapper extends BaseMapper<ChCfgSrvMode> {
}
\ No newline at end of file
package com.hungraim.ltc.governance.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.vo.governance.NursingServiceItemsVO;
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.governance.OrganProjectVO;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public interface NursingServiceItemsService {
Page<NursingServiceItemsVO> nursingServiceItemsList(Page<NursingServiceItemsVO> page, String organIds, String name, String status);
Page<OrganProjectVO> organProjectList(Page<OrganProjectVO> page, String organIds, String name, String status);
void organProjectConfig(ChSrvOrganProject project);
void disableLevelConfig(String disableLevelId, String disableLevelName, Short disableLevelStartValue, Short disableLevelEndValue, String disableLevelRemark);
void modeConfig(String modeId, String modeName, String modeRemark);
List<ChCfgSrvDisableLevel> disableLevelConfigList();
List<ChCfgSrvMode> modeConfigList();
}
......@@ -20,7 +20,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* 失能评定标准service
......@@ -41,59 +40,10 @@ public class DisableAssessmentCriteriaServiceImpl implements DisableAssessmentCr
@Override
public void addOrUpdateDisableAssessmentCriteria(Long aprId, String organId, String estimateName, String remark, Integer status, JSONArray project) {
Date date = new Date();
ChCfgApr chCfgApr = new ChCfgApr();
if (aprId != null) {//编辑
updateDisableAssessmentCriteria(aprId, organId, estimateName, remark, status, project, date);
} else {//新增
addDisableAssessmentCriteria(organId, estimateName, remark, status, project, date);
}
}
/**
* 失能评定标准定义新增
*/
private void addDisableAssessmentCriteria(String organId, String estimateName, String remark, Integer status, JSONArray project, Date date) {
//鉴定标准配置
ChCfgApr apr = new ChCfgApr();
apr.setOrganId(organId);
apr.setEstimateName(estimateName);
apr.setRemark(remark);
apr.setEffTime(date);
apr.setStatus(status.shortValue());
chCfgAprMapper.insert(apr);
//鉴定项目定义
for (int i = 0; i < project.size(); i++) {
ChCfgAprItem item = new ChCfgAprItem();
JSONObject itemObject = project.getJSONObject(i);
String projectNama = itemObject.getStr("projectNama");
String minVal = itemObject.getStr("minVal");
String maxVal = itemObject.getStr("maxVal");
item.setItemName(projectNama);
item.setMinValue(Short.parseShort(minVal));
item.setMaxValue(Short.parseShort(maxVal));
item.setAprId(apr.getAprId());
chCfgAprItemMapper.insert(item);
//鉴定项目定义明细
JSONArray projectScoreCriteria = itemObject.getJSONArray("projectScoreCriteria");
for (int j = 0; j < projectScoreCriteria.size(); j++) {
ChCfgAprItemClause clause = new ChCfgAprItemClause();
JSONObject clauseObject = projectScoreCriteria.getJSONObject(j);
String criteria = clauseObject.getStr("criteria");
String reference = clauseObject.getStr("reference");
clause.setClauseDesc(criteria);
clause.setClauseValue(Short.parseShort(reference));
clause.setItemId(item.getItemId());
clause.setAprId(apr.getAprId());
chCfgAprItemClauseMapper.insert(clause);
}
}
}
/**
* 失能评定标准定义编辑
*/
private void updateDisableAssessmentCriteria(Long aprId, String organId, String estimateName, String remark, Integer status, JSONArray project, Date date) {
//鉴定标准配置
ChCfgApr chCfgApr = chCfgAprMapper.selectById(aprId);
chCfgApr = chCfgAprMapper.selectById(aprId);
chCfgApr.setOrganId(organId);
chCfgApr.setEstimateName(estimateName);
chCfgApr.setRemark(remark);
......@@ -103,81 +53,28 @@ public class DisableAssessmentCriteriaServiceImpl implements DisableAssessmentCr
chCfgApr.setLcd(date);
chCfgApr.setStatus(status.shortValue());
chCfgAprMapper.updateById(chCfgApr);
//鉴定项目
List<ChCfgAprItem> itemList = chCfgAprItemMapper.selectList(new QueryWrapper<ChCfgAprItem>().eq("apr_id", aprId));
chCfgAprItemMapper.delete(new QueryWrapper<ChCfgAprItem>().eq("apr_id", chCfgApr.getAprId()));
chCfgAprItemClauseMapper.delete(new QueryWrapper<ChCfgAprItemClause>().eq("apr_id", chCfgApr.getAprId()));
} else {//新增
//鉴定标准配置
chCfgApr.setOrganId(organId);
chCfgApr.setEstimateName(estimateName);
chCfgApr.setRemark(remark);
chCfgApr.setEffTime(date);
chCfgApr.setStatus(status.shortValue());
chCfgAprMapper.insert(chCfgApr);
}
//鉴定项目定义
for (int i = 0; i < project.size(); i++) {
ChCfgAprItem item = new ChCfgAprItem();
JSONObject itemObject = project.getJSONObject(i);
Long itemId = itemObject.getLong("itemId");
String projectNama = itemObject.getStr("projectNama");
String minVal = itemObject.getStr("minVal");
String maxVal = itemObject.getStr("maxVal");
if (itemId != null) {
//修改id对应的鉴定项目
boolean flag = false;
for (ChCfgAprItem item : itemList) {
if (Objects.equals(item.getItemId(), itemId)) {
if (item.getFcd() == null) {
item.setFcd(date);//首次操作时间
}
item.setItemName(projectNama);
item.setMinValue(Short.parseShort(minVal));
item.setMaxValue(Short.parseShort(maxVal));
chCfgAprItemMapper.updateById(item);
itemList.remove(item);
flag = true;
}
}
if (!flag) {
throw new RuntimeException("无效的itemId!");
}
//鉴定项目定义明细
List<ChCfgAprItemClause> itemClauseList = chCfgAprItemClauseMapper.selectList(new QueryWrapper<ChCfgAprItemClause>().eq("item_id", itemId));
JSONArray projectScoreCriteria = itemObject.getJSONArray("projectScoreCriteria");
for (int j = 0; j < projectScoreCriteria.size(); j++) {
ChCfgAprItemClause clause = new ChCfgAprItemClause();
JSONObject clauseObject = projectScoreCriteria.getJSONObject(j);
Long clauseId = clauseObject.getLong("clauseId");
String criteria = clauseObject.getStr("criteria");
String reference = clauseObject.getStr("reference");
if (clauseId != null) {
flag = false;
for (ChCfgAprItemClause item : itemClauseList) {
if (Objects.equals(item.getClauseId(), clauseId)) {
if (item.getFcd() == null) {
item.setFcd(date);//首次操作时间
}
clause.setClauseDesc(criteria);
clause.setClauseValue(Short.parseShort(reference));
clause.setItemId(itemId);
clause.setAprId(aprId);
chCfgAprItemClauseMapper.updateById(clause);
itemClauseList.remove(item);
flag = true;
}
}
if (!flag) {
throw new RuntimeException("无效的clauseId!");
}
} else {
ChCfgAprItemClause cl = new ChCfgAprItemClause();
cl.setClauseDesc(criteria);
cl.setClauseValue(Short.parseShort(reference));
cl.setItemId(itemId);
cl.setAprId(aprId);
chCfgAprItemClauseMapper.insert(cl);
}
}
//删除多余的评定项目明细
for (ChCfgAprItemClause item : itemClauseList) {
chCfgAprItemClauseMapper.deleteById(item);
}
} else {
//没有对应的鉴定项目就新增
ChCfgAprItem item = new ChCfgAprItem();
item.setItemName(projectNama);
item.setMinValue(Short.parseShort(minVal));
item.setMaxValue(Short.parseShort(maxVal));
item.setAprId(aprId);
item.setAprId(chCfgApr.getAprId());
chCfgAprItemMapper.insert(item);
//鉴定项目定义明细
JSONArray projectScoreCriteria = itemObject.getJSONArray("projectScoreCriteria");
......@@ -189,16 +86,11 @@ public class DisableAssessmentCriteriaServiceImpl implements DisableAssessmentCr
clause.setClauseDesc(criteria);
clause.setClauseValue(Short.parseShort(reference));
clause.setItemId(item.getItemId());
clause.setAprId(aprId);
clause.setAprId(chCfgApr.getAprId());
chCfgAprItemClauseMapper.insert(clause);
}
}
}
//删除多余的评定项目
for (ChCfgAprItem item : itemList) {
chCfgAprItemMapper.deleteById(item);
}
}
@Override
public Page<CfgAprVO> getDisableAssessmentCriteriaList(Page<CfgAprVO> page, String organIds, String aprName, String status) {
......
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.governance.dao.ChSrvOrganProjectMapper;
import com.hungraim.ltc.governance.dao.DisableLevelMapper;
import com.hungraim.ltc.governance.dao.SrvModeMapper;
import com.hungraim.ltc.governance.service.NursingServiceItemsService;
import com.hungraim.ltc.pojo.vo.governance.NursingServiceItemsVO;
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.governance.OrganProjectVO;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@Service
......@@ -16,14 +24,72 @@ public class NursingServiceItemsServiceImpl implements NursingServiceItemsServic
@Autowired
private ChSrvOrganProjectMapper chSrvOrganProjectMapper;
@Autowired
private DisableLevelMapper disableLevelMapper;
@Autowired
private SrvModeMapper srvModeMapper;
@Override
public Page<NursingServiceItemsVO> nursingServiceItemsList(Page<NursingServiceItemsVO> page, String organIds, String name, String status) {
public Page<OrganProjectVO> organProjectList(Page<OrganProjectVO> page, String organIds, String name, String status) {
List<String> organIdList = null;
if (StrUtil.isNotBlank(organIds)) {
organIdList = Arrays.asList(organIds.split(","));
}
return chSrvOrganProjectMapper.nursingServiceItemsList(page, organIdList, name, status);
return chSrvOrganProjectMapper.organProjectList(page, organIdList, name, status);
}
@Override
public void organProjectConfig(ChSrvOrganProject project) {
if (project.getProjectId() != null) {
project.setEffTime(new Date());//创建时间
chSrvOrganProjectMapper.updateById(project);
} else {
chSrvOrganProjectMapper.insert(project);
}
}
@Override
public void disableLevelConfig(String disableLevelId, String disableLevelName, Short disableLevelStartValue, Short disableLevelEndValue, String disableLevelRemark) {
if (StringUtils.isNotBlank(disableLevelId)) {
ChCfgSrvDisableLevel chCfgSrvDisableLevel = disableLevelMapper.selectById(disableLevelId);
chCfgSrvDisableLevel.setDisableLevelName(disableLevelName);
chCfgSrvDisableLevel.setStartValue(disableLevelStartValue);
chCfgSrvDisableLevel.setEndValue(disableLevelEndValue);
chCfgSrvDisableLevel.setRemark(disableLevelRemark);
disableLevelMapper.updateById(chCfgSrvDisableLevel);
} else {
ChCfgSrvDisableLevel chCfgSrvDisableLevel = new ChCfgSrvDisableLevel();
chCfgSrvDisableLevel.setDisableLevelName(disableLevelName);
chCfgSrvDisableLevel.setStartValue(disableLevelStartValue);
chCfgSrvDisableLevel.setEndValue(disableLevelEndValue);
chCfgSrvDisableLevel.setRemark(disableLevelRemark);
disableLevelMapper.insert(chCfgSrvDisableLevel);
}
}
@Override
public void modeConfig(String modeId, String modeName, String modeRemark) {
if (StringUtils.isNotBlank(modeId)) {
ChCfgSrvMode chCfgSrvMode = srvModeMapper.selectById(modeId);
chCfgSrvMode.setModeName(modeName);
chCfgSrvMode.setRemark(modeRemark);
srvModeMapper.updateById(chCfgSrvMode);
} else {
ChCfgSrvMode chCfgSrvMode = new ChCfgSrvMode();
chCfgSrvMode.setModeName(modeName);
chCfgSrvMode.setRemark(modeRemark);
srvModeMapper.insert(chCfgSrvMode);
}
}
@Override
public List<ChCfgSrvDisableLevel> disableLevelConfigList() {
return disableLevelMapper.selectList(new QueryWrapper<>());
}
@Override
public List<ChCfgSrvMode> modeConfigList() {
return srvModeMapper.selectList(new QueryWrapper<>());
}
}
......@@ -68,7 +68,7 @@
AND STATUS = 0
</select>
<select id="nursingServiceItemsList" resultType="com.hungraim.ltc.pojo.vo.governance.NursingServiceItemsVO">
<select id="organProjectList" resultType="com.hungraim.ltc.pojo.vo.governance.OrganProjectVO">
SELECT
--护理服务项目id
project.project_id projectId,
......
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