org启用flag
This commit is contained in:
@@ -171,18 +171,33 @@ public class OrganizationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 停用启用
|
* 启用
|
||||||
*
|
*
|
||||||
* @param orgId 主表id
|
* @param orgId 启用数据的Id
|
||||||
*/
|
*/
|
||||||
@PutMapping("/organization-flag")
|
@PutMapping("/organization-active")
|
||||||
public R<?> changeOrgFlag(@RequestParam Long orgId) {
|
public R<?> changeActive(@RequestParam Long orgId) {
|
||||||
|
|
||||||
boolean flagChangeSuccess = organizationService.changeOrgFlag(orgId);
|
boolean activeSuccess = organizationService.activeChange(orgId);
|
||||||
|
|
||||||
return flagChangeSuccess
|
return activeSuccess
|
||||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"机构活动标识"}))
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"启用"}))
|
||||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"机构活动标识"}));
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"启用"}));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 停用
|
||||||
|
*
|
||||||
|
* @param orgId 停用数据的Id
|
||||||
|
*/
|
||||||
|
@PutMapping("/organization-inactive")
|
||||||
|
public R<?> changeInactive(@RequestParam Long orgId) {
|
||||||
|
|
||||||
|
boolean inActiveSuccess = organizationService.activeChange(orgId);
|
||||||
|
|
||||||
|
return inActiveSuccess
|
||||||
|
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00004, new Object[] {"停用"}))
|
||||||
|
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"停用"}));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
package com.openhis.web.basedatamanage.dto;
|
package com.openhis.web.basedatamanage.dto;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
|||||||
@@ -10,5 +10,5 @@ import com.openhis.administration.domain.Organization;
|
|||||||
* @date 2025-02-21
|
* @date 2025-02-21
|
||||||
*/
|
*/
|
||||||
public interface IOrganizationService extends IService<Organization> {
|
public interface IOrganizationService extends IService<Organization> {
|
||||||
boolean changeOrgFlag(Long orgId);
|
boolean activeChange(Long orgId);
|
||||||
}
|
}
|
||||||
@@ -23,20 +23,25 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
|
|||||||
private OrganizationMapper organizationMapper;
|
private OrganizationMapper organizationMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean changeOrgFlag(Long orgId) {
|
public boolean activeChange(Long orgId) {
|
||||||
|
|
||||||
if (orgId != null) {
|
if (orgId != null) {
|
||||||
Organization organization = organizationMapper.selectById(orgId);
|
Organization organization = organizationMapper.selectById(orgId);
|
||||||
if (organization.getActiveFlag().equals(AccountStatus.ACTIVE.getValue())) {
|
if (organization != null) {
|
||||||
organization.setActiveFlag(AccountStatus.INACTIVE.getValue());
|
Integer activeFlag = organization.getActiveFlag();
|
||||||
return true;
|
switch (activeFlag ) {
|
||||||
} else {
|
case 1:
|
||||||
organization.setActiveFlag(AccountStatus.ACTIVE.getValue());
|
organization.setActiveFlag(AccountStatus.INACTIVE.getValue());
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
organization.setActiveFlag(AccountStatus.ACTIVE.getValue());
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
organizationMapper.updateById(organization);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user