服务管理
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
package com.openhis.web.basicservice.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
@@ -109,4 +110,39 @@ public class HealthcareServiceController {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 服务管理 编辑
|
||||
*
|
||||
* @param healthcareServiceAddOrUpdateParam 表单数据
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@PutMapping(value = "/healthcare-service")
|
||||
public R<?> edit(@Validated @RequestBody HealthcareServiceAddOrUpdateParam healthcareServiceAddOrUpdateParam) {
|
||||
// 服务管理-表单数据
|
||||
HealthcareService healthcareServiceFormData = healthcareServiceAddOrUpdateParam.getHealthcareServiceFormData();
|
||||
boolean res = iHealthcareServiceService.updateHealthcareService(healthcareServiceFormData);
|
||||
return res ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"服务管理"})) :
|
||||
R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务管理 删除
|
||||
*
|
||||
* @param id ID
|
||||
* @return 删除结果
|
||||
*/
|
||||
@DeleteMapping(value = "/healthcare-service")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public R<?> delete(@RequestParam Long id) {
|
||||
boolean res = iHealthcareServiceService.removeById(id);
|
||||
// 同时删除非同定价
|
||||
LambdaQueryWrapper<ChargeItemDefinition> QueryWrapper = new LambdaQueryWrapper<>();
|
||||
QueryWrapper.eq(ChargeItemDefinition::getInstanceId, id).
|
||||
eq(ChargeItemDefinition::getInstanceTable, CommonConstants.TableName.ADM_HEALTHCARE_SERVICE);
|
||||
iChargeItemDefinitionService.remove(QueryWrapper);
|
||||
return res ? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00005, new Object[]{"服务管理"})) :
|
||||
R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00006, null));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -18,4 +18,11 @@ public interface IHealthcareServiceService extends IService<HealthcareService> {
|
||||
*/
|
||||
HealthcareService addHealthcareService(HealthcareService healthcareService);
|
||||
|
||||
/**
|
||||
* 服务管理 编辑
|
||||
* @param healthcareService 表单信息
|
||||
* @return 编辑结果
|
||||
*/
|
||||
boolean updateHealthcareService(HealthcareService healthcareService);
|
||||
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.openhis.administration.domain.HealthcareService;
|
||||
import com.openhis.administration.mapper.HealthcareServiceMapper;
|
||||
import com.openhis.administration.service.IHealthcareServiceService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
@@ -20,6 +19,7 @@ public class HealthcareServiceServiceImpl extends ServiceImpl<HealthcareServiceM
|
||||
|
||||
/**
|
||||
* 服务管理 新增
|
||||
*
|
||||
* @param healthcareService 表单信息
|
||||
* @return 入库后信息
|
||||
*/
|
||||
@@ -30,4 +30,20 @@ public class HealthcareServiceServiceImpl extends ServiceImpl<HealthcareServiceM
|
||||
return healthcareService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 服务管理 编辑
|
||||
*
|
||||
* @param healthcareService 表单信息
|
||||
* @return 编辑结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean updateHealthcareService(HealthcareService healthcareService) {
|
||||
if (healthcareService.getId() == null) {
|
||||
return false;
|
||||
} else {
|
||||
return baseMapper.updateById(healthcareService) > 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user