增加系统国家天假

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

@ -81,4 +81,7 @@ public interface SysCountryCodeClientApi {
@PostMapping("/updateCountryCode") @PostMapping("/updateCountryCode")
ResultResponse<Void> updateCountryCode(@RequestBody SysCountryCodeCmd cmd); ResultResponse<Void> updateCountryCode(@RequestBody SysCountryCodeCmd cmd);
@PostMapping("/addCountryCode")
ResultResponse<Void> addCountryCode(@RequestBody SysCountryCodeCmd cmd);
} }

View File

@ -13,6 +13,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Caching; import org.springframework.cache.annotation.Caching;
import org.springframework.web.bind.annotation.GetMapping; 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.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -62,4 +63,20 @@ public class SysCountryCodeRestController extends BaseController {
sysCountryCodeService.updateCountryCode(cmd); 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

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

View File

@ -24,6 +24,8 @@ public interface SysCountryCodeService {
void updateCountryCode(SysCountryCodeCmd cmd); void updateCountryCode(SysCountryCodeCmd cmd);
void addCountryCode(SysCountryCodeCmd cmd);
ResultResponse<SysCountryCodeDTO> getSysCountryCodeById(Long id); ResultResponse<SysCountryCodeDTO> getSysCountryCodeById(Long id);
} }

View File

@ -67,4 +67,9 @@ public interface SysCountryCodeService extends BaseService<SysCountryCode> {
* 编辑国家资料 * 编辑国家资料
*/ */
void updateCountryCode(SysCountryCode sysCountryCode); void updateCountryCode(SysCountryCode sysCountryCode);
/**
* 新增国家资料
*/
void addCountryCode(SysCountryCode sysCountryCode);
} }

View File

@ -140,4 +140,9 @@ public class SysCountryCodeServiceImpl extends
ResponseAssert.isTrue(CommonErrorCode.UPDATE_FAILURE, ResponseAssert.isTrue(CommonErrorCode.UPDATE_FAILURE,
updateSelectiveById(sysCountryCode)); updateSelectiveById(sysCountryCode));
} }
@Override
public void addCountryCode(SysCountryCode sysCountryCode) {
ResponseAssert.isTrue(CommonErrorCode.SAVE_FAILURE, save(sysCountryCode));
}
} }

View File

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

View File

@ -71,4 +71,9 @@ public interface SysCountryCodeClientService {
* 编辑国家资料 * 编辑国家资料
*/ */
void updateCountryCode(SysCountryCodeCmd dto); void updateCountryCode(SysCountryCodeCmd dto);
/**
* 新增国家资料
*/
void addCountryCode(SysCountryCodeCmd dto);
} }

View File

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