增加系统国家天假

This commit is contained in:
hy001 2026-04-24 14:58:43 +08:00
parent 0860b74d96
commit 3b57dba4dc
9 changed files with 105 additions and 52 deletions

View File

@ -79,6 +79,9 @@ public interface SysCountryCodeClientApi {
ResultResponse<PageResult<SysCountryCodeDTO>> sysCountryCodePage(
@RequestBody SysCountryCodePageQryCmd query);
@PostMapping("/updateCountryCode")
ResultResponse<Void> updateCountryCode(@RequestBody SysCountryCodeCmd cmd);
}
@PostMapping("/updateCountryCode")
ResultResponse<Void> updateCountryCode(@RequestBody SysCountryCodeCmd cmd);
@PostMapping("/addCountryCode")
ResultResponse<Void> addCountryCode(@RequestBody SysCountryCodeCmd cmd);
}

View File

@ -10,12 +10,13 @@ import com.red.circle.other.inner.model.cmd.sys.SysCountryCodePageQryCmd;
import com.red.circle.other.inner.model.dto.sys.SysCountryCodeDTO;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Caching;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Caching;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
@ -56,10 +57,26 @@ public class SysCountryCodeRestController extends BaseController {
@CacheEvict(value = ControllerRedisKeyConstant.COUNTRY, key = "'"
+ ControllerRedisKeyConstant.APP_COUNTRY_CODE + "'")
})
@PutMapping
public void updateCountryCode(@RequestBody SysCountryCodeCmd cmd) {
cmd.setUpdateUser(cmd.getReqUserId());
sysCountryCodeService.updateCountryCode(cmd);
}
}
@PutMapping
public void updateCountryCode(@RequestBody SysCountryCodeCmd cmd) {
cmd.setUpdateUser(cmd.getReqUserId());
sysCountryCodeService.updateCountryCode(cmd);
}
/**
* 新增国家列表.
*/
@Caching(evict = {
@CacheEvict(value = ControllerRedisKeyConstant.COUNTRY, key = "'"
+ ControllerRedisKeyConstant.COUNTRY_TOP_SIX + "'"),
@CacheEvict(value = ControllerRedisKeyConstant.COUNTRY, key = "'"
+ ControllerRedisKeyConstant.APP_COUNTRY_CODE + "'")
})
@PostMapping
public void addCountryCode(@RequestBody SysCountryCodeCmd cmd) {
cmd.setCreateUser(cmd.getReqUserId());
cmd.setUpdateUser(cmd.getReqUserId());
sysCountryCodeService.addCountryCode(cmd);
}
}

View File

@ -36,12 +36,17 @@ public class SysCountryCodeServiceImpl implements SysCountryCodeService {
}
@Override
public void updateCountryCode(SysCountryCodeCmd cmd) {
countryCodeClient.updateCountryCode(cmd);
}
@Override
public ResultResponse<SysCountryCodeDTO> getSysCountryCodeById(Long id) {
return countryCodeClient.getById(id);
public void updateCountryCode(SysCountryCodeCmd cmd) {
countryCodeClient.updateCountryCode(cmd);
}
@Override
public void addCountryCode(SysCountryCodeCmd cmd) {
countryCodeClient.addCountryCode(cmd);
}
@Override
public ResultResponse<SysCountryCodeDTO> getSysCountryCodeById(Long id) {
return countryCodeClient.getById(id);
}
}

View File

@ -22,8 +22,10 @@ public interface SysCountryCodeService {
PageResult<SysCountryCodeDTO> sysCountryCodePage(SysCountryCodePageQryCmd query);
void updateCountryCode(SysCountryCodeCmd cmd);
ResultResponse<SysCountryCodeDTO> getSysCountryCodeById(Long id);
}
void updateCountryCode(SysCountryCodeCmd cmd);
void addCountryCode(SysCountryCodeCmd cmd);
ResultResponse<SysCountryCodeDTO> getSysCountryCodeById(Long id);
}

View File

@ -63,8 +63,13 @@ public interface SysCountryCodeService extends BaseService<SysCountryCode> {
*/
PageResult<SysCountryCode> sysCountryCodePage(SysCountryCodePageQryCmd query);
/**
* 编辑国家资料
*/
void updateCountryCode(SysCountryCode sysCountryCode);
}
/**
* 编辑国家资料
*/
void updateCountryCode(SysCountryCode sysCountryCode);
/**
* 新增国家资料
*/
void addCountryCode(SysCountryCode sysCountryCode);
}

View File

@ -136,8 +136,13 @@ public class SysCountryCodeServiceImpl extends
}
@Override
public void updateCountryCode(SysCountryCode sysCountryCode) {
ResponseAssert.isTrue(CommonErrorCode.UPDATE_FAILURE,
updateSelectiveById(sysCountryCode));
}
}
public void updateCountryCode(SysCountryCode sysCountryCode) {
ResponseAssert.isTrue(CommonErrorCode.UPDATE_FAILURE,
updateSelectiveById(sysCountryCode));
}
@Override
public void addCountryCode(SysCountryCode sysCountryCode) {
ResponseAssert.isTrue(CommonErrorCode.SAVE_FAILURE, save(sysCountryCode));
}
}

View File

@ -71,8 +71,14 @@ public class SysCountryCodeClientEndpoint implements SysCountryCodeClientApi {
}
@Override
public ResultResponse<Void> updateCountryCode(SysCountryCodeCmd cmd) {
sysCountryCodeClientService.updateCountryCode(cmd);
return ResultResponse.success();
}
}
public ResultResponse<Void> updateCountryCode(SysCountryCodeCmd cmd) {
sysCountryCodeClientService.updateCountryCode(cmd);
return ResultResponse.success();
}
@Override
public ResultResponse<Void> addCountryCode(SysCountryCodeCmd cmd) {
sysCountryCodeClientService.addCountryCode(cmd);
return ResultResponse.success();
}
}

View File

@ -67,8 +67,13 @@ public interface SysCountryCodeClientService {
*/
PageResult<SysCountryCodeDTO> sysCountryCodePage(SysCountryCodePageQryCmd query);
/**
* 编辑国家资料
*/
void updateCountryCode(SysCountryCodeCmd dto);
}
/**
* 编辑国家资料
*/
void updateCountryCode(SysCountryCodeCmd dto);
/**
* 新增国家资料
*/
void addCountryCode(SysCountryCodeCmd dto);
}

View File

@ -72,7 +72,12 @@ public class SysCountryCodeClientServiceImpl implements SysCountryCodeClientServ
}
@Override
public void updateCountryCode(SysCountryCodeCmd dto) {
sysCountryCodeService.updateCountryCode(countryCodeInnerConvertor.toSysCountryCode(dto));
}
}
public void updateCountryCode(SysCountryCodeCmd dto) {
sysCountryCodeService.updateCountryCode(countryCodeInnerConvertor.toSysCountryCode(dto));
}
@Override
public void addCountryCode(SysCountryCodeCmd dto) {
sysCountryCodeService.addCountryCode(countryCodeInnerConvertor.toSysCountryCode(dto));
}
}