Commit 8778477c by guojuxing

发票管理接口

parent 59efe7f1
......@@ -65,6 +65,19 @@ public class InvoiceAccountApiServiceImpl implements InvoiceAccountApiService {
}
@Override
public ServiceResponse<Void> disable(Integer id) {
TabInvoiceAccount tab = invoiceAccountService.getById(id);
if (tab == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "主键有误");
}
InvoiceAccountDTO dto = new InvoiceAccountDTO();
dto.setInvoiceAccountId(id);
dto.setStatus(0);
invoiceAccountService.update(dto);
return ServiceResponse.success();
}
@Override
public ServiceResponse<InvoiceAccountDTO> getById(Integer invoiceAccountId) {
TabInvoiceAccount tab = invoiceAccountService.getById(invoiceAccountId);
if (tab == null) {
......@@ -77,7 +90,7 @@ public class InvoiceAccountApiServiceImpl implements InvoiceAccountApiService {
public ServiceResponse<InvoiceAccountDTO> getEnable() {
TabInvoiceAccount tab = invoiceAccountService.getEnable();
if (tab == null) {
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "没有开启数据,请添加");
return ServiceResponse.failure(ErrorCode.PARAMETER_ERROR.getCode(), "没有启用的开票户信息,请启用");
}
return ServiceResponse.success(EntityUtil.changeEntityNew(InvoiceAccountDTO.class, tab));
}
......
......@@ -65,7 +65,7 @@ public class InvoiceManageApiServiceImpl implements InvoiceManageApiService{
//开票户信息插入
TabInvoiceAccount account = invoiceAccountService.getEnable();
if (account == null) {
return ServiceResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), "开票户信息未设置,请前往添加");
return ServiceResponse.failure(ErrorCode.SYSTEM_ERROR.getCode(), "没有启用的开票户信息,请启用");
}
invoiceManageDTO.setInvoicerId(account.getInvoiceAccountId());
invoiceManageService.update(invoiceManageDTO);
......
......@@ -78,6 +78,46 @@ public class InvoiceManageController {
}
/**
* 新增开票户信息
* @param dto
* @return
*/
@RequestMapping("/save-invoice-account")
public RestResponse saveInvoiceAccount(InvoiceAccountDTO dto) {
return ResultControllerUtils.commonResult(invoiceAccountApiService.save(dto));
}
/**
* 编辑开票户信息
* @param dto
* @return
*/
@RequestMapping("/edit-invoice-account")
public RestResponse editInvoiceAccount(InvoiceAccountDTO dto) {
return ResultControllerUtils.commonResult(invoiceAccountApiService.update(dto));
}
/**
* 开启开票户信息
* @param id
* @return
*/
@RequestMapping("/enable-invoice-account")
public RestResponse enableInvoiceAccount(Integer id) {
return ResultControllerUtils.commonResult(invoiceAccountApiService.enable(id));
}
/**
* 关闭开票户信息
* @param id
* @return
*/
@RequestMapping("/disable-invoice-account")
public RestResponse disableInvoiceAccount(Integer id) {
return ResultControllerUtils.commonResult(invoiceAccountApiService.disable(id));
}
/**
* 详情
* @param invoiceManageId
* @return
......
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