| | |
| | | import com.ruoyi.framework.aspectj.lang.annotation.Log; |
| | | import com.ruoyi.framework.aspectj.lang.enums.BusinessType; |
| | | import com.ruoyi.framework.web.controller.BaseController; |
| | | import com.ruoyi.framework.web.domain.AjaxResult; |
| | | import com.ruoyi.framework.web.domain.R; |
| | | import com.ruoyi.framework.web.page.TableDataInfo; |
| | | import com.ruoyi.purchase.dto.PaymentHistoryRecordVo; |
| | | import com.ruoyi.purchase.dto.PaymentLedgerDto; |
| | | import com.ruoyi.purchase.dto.PaymentRegistrationDto; |
| | | import com.ruoyi.purchase.pojo.PaymentRegistration; |
| | | import com.ruoyi.purchase.service.IPaymentRegistrationService; |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import jakarta.servlet.http.HttpServletResponse; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | */ |
| | | @RestController |
| | | @RequestMapping("/purchase/paymentRegistration") |
| | | @AllArgsConstructor |
| | | public class PaymentRegistrationController extends BaseController { |
| | | @Autowired |
| | | private IPaymentRegistrationService paymentRegistrationService; |
| | | |
| | | /** |
| | |
| | | * 获取付款登记详细信息 |
| | | */ |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | return success(paymentRegistrationService.selectPaymentRegistrationById(id)); |
| | | public R<?> getInfo(@PathVariable("id") Long id) { |
| | | return R.ok(paymentRegistrationService.selectPaymentRegistrationById(id)); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "付款登记", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult add(@RequestBody List<PaymentRegistration> paymentRegistration) { |
| | | return toAjax(paymentRegistrationService.insertPaymentRegistration(paymentRegistration)); |
| | | public R<?> add(@RequestBody List<PaymentRegistration> paymentRegistration) { |
| | | paymentRegistrationService.insertPaymentRegistration(paymentRegistration); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @Log(title = "付款登记", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public AjaxResult edit(@RequestBody PaymentRegistration paymentRegistration) { |
| | | return toAjax(paymentRegistrationService.updatePaymentRegistration(paymentRegistration)); |
| | | public R<?> edit(@RequestBody PaymentRegistration paymentRegistration) { |
| | | paymentRegistrationService.updatePaymentRegistration(paymentRegistration); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "付款登记", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/del") |
| | | public AjaxResult remove(@RequestBody Long[] ids) { |
| | | return toAjax(paymentRegistrationService.deletePaymentRegistrationByIds(ids)); |
| | | public R<?> remove(@RequestBody Long[] ids) { |
| | | paymentRegistrationService.deletePaymentRegistrationByIds(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Log(title = "付款登记", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/delete") |
| | | public AjaxResult delete(@RequestBody Long[] ids) { |
| | | return toAjax(paymentRegistrationService.delete(ids)); |
| | | public R<?> delete(@RequestBody Long[] ids) { |
| | | paymentRegistrationService.delete(ids); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 获取付款登记详细信息 |
| | | */ |
| | | @GetMapping(value = "/byPurchaseId/{id}") |
| | | public AjaxResult getPurchaseInfo(@PathVariable("id") Long id) { |
| | | return success(paymentRegistrationService.selectPaymentRegistrationByPurchaseId(id)); |
| | | public R<?> getPurchaseInfo(@PathVariable("id") Long id) { |
| | | return R.ok(paymentRegistrationService.selectPaymentRegistrationByPurchaseId(id)); |
| | | } |
| | | |
| | | /** |
| | | * 获取付款登记详细信息 |
| | | */ |
| | | @GetMapping(value = "/paymentLedgerList") |
| | | public AjaxResult paymentLedgerList(PaymentLedgerDto paymentLedgerDto, Page page, |
| | | public R<?> paymentLedgerList(PaymentLedgerDto paymentLedgerDto, Page page, |
| | | Integer detailPageNum, |
| | | Integer detailPageSize) { |
| | | IPage<Map<String, Object>> mapIPage = paymentRegistrationService.selectPaymentLedgerList(paymentLedgerDto, page, detailPageNum, detailPageSize); |
| | | return success(mapIPage); |
| | | return R.ok(mapIPage); |
| | | } |
| | | |
| | | /** |
| | | * 供应商往来分页接口 |
| | | */ |
| | | @GetMapping("/supplierNameListPage") |
| | | public AjaxResult supplierNameListPage(PaymentLedgerDto paymentLedgerDto, Page page){ |
| | | return success(paymentRegistrationService.supplierNameListPage(page,paymentLedgerDto)); |
| | | public R<?> supplierNameListPage(PaymentLedgerDto paymentLedgerDto, Page page){ |
| | | return R.ok(paymentRegistrationService.supplierNameListPage(page,paymentLedgerDto)); |
| | | } |
| | | |
| | | /** |
| | | * 供应商往来分页接口 |
| | | */ |
| | | @GetMapping("/supplierNameListPageDetails") |
| | | public AjaxResult supplierNameListPageDetails(PaymentLedgerDto paymentLedgerDto){ |
| | | return success(paymentRegistrationService.supplierNameListPageDetails(paymentLedgerDto)); |
| | | public R<?> supplierNameListPageDetails(PaymentLedgerDto paymentLedgerDto){ |
| | | return R.ok(paymentRegistrationService.supplierNameListPageDetails(paymentLedgerDto)); |
| | | } |
| | | |
| | | /** |
| | | * 获取本月应付信息 |
| | | */ |
| | | @GetMapping(value = "/paymentMonthList") |
| | | public AjaxResult paymentMonthList() { |
| | | return success(paymentRegistrationService.paymentMonthList()); |
| | | public R<?> paymentMonthList() { |
| | | return R.ok(paymentRegistrationService.paymentMonthList()); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getPaymentRecordList/{supplierId}") |
| | | public AjaxResult getPaymentRecordList(@PathVariable Long supplierId) { |
| | | public R<?> getPaymentRecordList(@PathVariable Long supplierId) { |
| | | List<PaymentHistoryRecordVo> paymentRecordList = paymentRegistrationService.getPaymentRecordList(supplierId); |
| | | return success(paymentRecordList); |
| | | return R.ok(paymentRecordList); |
| | | } |
| | | |
| | | /** |