parent
5c69ee692f
commit
171ef18412
5 changed files with 175 additions and 0 deletions
@ -0,0 +1,66 @@ |
|||||||
|
package org.springblade.modules.business.contraller; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
||||||
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.boot.ctrl.BladeController; |
||||||
|
import org.springblade.core.mp.support.Condition; |
||||||
|
import org.springblade.core.mp.support.Query; |
||||||
|
import org.springblade.core.secure.utils.AuthUtil; |
||||||
|
import org.springblade.core.tool.api.R; |
||||||
|
import org.springblade.core.tool.utils.Func; |
||||||
|
import org.springblade.modules.business.pojo.entity.Information; |
||||||
|
import org.springblade.modules.business.pojo.entity.Invoice; |
||||||
|
import org.springblade.modules.business.service.IInvoiceService; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
/** |
||||||
|
* 发票表 控制器 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
* @since 2024-10-14 |
||||||
|
*/ |
||||||
|
@RestController |
||||||
|
@AllArgsConstructor |
||||||
|
@RequestMapping("/invoice") |
||||||
|
public class InvoiceController extends BladeController { |
||||||
|
|
||||||
|
private final IInvoiceService invoiceService; |
||||||
|
|
||||||
|
/** |
||||||
|
* 资料表 分页 |
||||||
|
*/ |
||||||
|
@GetMapping("/list") |
||||||
|
public R<List<Invoice>> list(Invoice invoice) { |
||||||
|
return R.data(invoiceService.list(Wrappers.lambdaQuery(invoice).eq(Invoice::getUserId, AuthUtil.getUserId()).orderByDesc(Invoice::getCreateTime))); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 资料表 新增 |
||||||
|
*/ |
||||||
|
@GetMapping("/save") |
||||||
|
public R save(@RequestBody Invoice invoice) { |
||||||
|
invoice.setUserId(AuthUtil.getUserId()); |
||||||
|
return R.data(invoiceService.save(invoice)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 资料表 修改 |
||||||
|
*/ |
||||||
|
@GetMapping("/update") |
||||||
|
public R update(@RequestBody Invoice invoice) { |
||||||
|
return R.data(invoiceService.updateById(invoice)); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 资料表 删除 |
||||||
|
*/ |
||||||
|
@GetMapping("/remove") |
||||||
|
public R remove(@RequestParam String ids) { |
||||||
|
return R.status(invoiceService.deleteLogic(Func.toLongList(ids))); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
|
||||||
|
package org.springblade.modules.business.mapper; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||||
|
import org.springblade.modules.business.pojo.entity.Invoice; |
||||||
|
|
||||||
|
/** |
||||||
|
* 发票表 Mapper 接口 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
* @since 2024-10-14 |
||||||
|
*/ |
||||||
|
|
||||||
|
public interface InvoiceMapper extends BaseMapper<Invoice> { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,58 @@ |
|||||||
|
package org.springblade.modules.business.pojo.entity; |
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||||
|
import lombok.Data; |
||||||
|
import lombok.EqualsAndHashCode; |
||||||
|
import org.springblade.core.mp.base.BaseEntity; |
||||||
|
|
||||||
|
/** |
||||||
|
* 发票表 实体类 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
* @since 2024-10-14 |
||||||
|
*/ |
||||||
|
@Data |
||||||
|
@TableName("lab_invoice") |
||||||
|
@EqualsAndHashCode(callSuper = true) |
||||||
|
public class Invoice extends BaseEntity { |
||||||
|
|
||||||
|
/** |
||||||
|
* 用户ID |
||||||
|
*/ |
||||||
|
private Long userId; |
||||||
|
|
||||||
|
/** |
||||||
|
* 公司名称 |
||||||
|
*/ |
||||||
|
private String companyName; |
||||||
|
|
||||||
|
/** |
||||||
|
* 税号 |
||||||
|
*/ |
||||||
|
private String taxCode; |
||||||
|
|
||||||
|
/** |
||||||
|
* 公司电话 |
||||||
|
*/ |
||||||
|
private String companyPhone; |
||||||
|
|
||||||
|
/** |
||||||
|
* 开户行 |
||||||
|
*/ |
||||||
|
private String openBank; |
||||||
|
|
||||||
|
/** |
||||||
|
* 账号 |
||||||
|
*/ |
||||||
|
private String number; |
||||||
|
|
||||||
|
/** |
||||||
|
* 公司地址 |
||||||
|
*/ |
||||||
|
private String address; |
||||||
|
|
||||||
|
/** |
||||||
|
* 备注 |
||||||
|
*/ |
||||||
|
private String remark; |
||||||
|
} |
||||||
@ -0,0 +1,14 @@ |
|||||||
|
package org.springblade.modules.business.service; |
||||||
|
|
||||||
|
import org.springblade.core.mp.base.BaseService; |
||||||
|
import org.springblade.modules.business.pojo.entity.Invoice; |
||||||
|
|
||||||
|
/** |
||||||
|
* 发票表 服务类 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
* @since 2024-10-14 |
||||||
|
*/ |
||||||
|
public interface IInvoiceService extends BaseService<Invoice> { |
||||||
|
|
||||||
|
} |
||||||
@ -0,0 +1,21 @@ |
|||||||
|
|
||||||
|
package org.springblade.modules.business.service.impl; |
||||||
|
|
||||||
|
import lombok.AllArgsConstructor; |
||||||
|
import org.springblade.core.mp.base.BaseServiceImpl; |
||||||
|
import org.springblade.modules.business.mapper.InvoiceMapper; |
||||||
|
import org.springblade.modules.business.pojo.entity.Invoice; |
||||||
|
import org.springblade.modules.business.service.IInvoiceService; |
||||||
|
import org.springframework.stereotype.Service; |
||||||
|
|
||||||
|
/** |
||||||
|
* 发票表 服务实现类 |
||||||
|
* |
||||||
|
* @author BladeX |
||||||
|
* @since 2024-10-14 |
||||||
|
*/ |
||||||
|
@Service |
||||||
|
@AllArgsConstructor |
||||||
|
public class InvoiceServiceImpl extends BaseServiceImpl<InvoiceMapper, Invoice> implements IInvoiceService { |
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue