发票录入

beta-enc
dongxiaoke 2 years ago
parent 0c384d83e9
commit a49f02b161
  1. 15
      jianshui-admin/src/main/java/com/jianshui/web/controller/platform/InvoiceAddController.java
  2. 31
      jianshui-platform/src/main/java/com/jianshui/platform/service/InvoiceAddService.java
  3. 81
      jianshui-platform/src/main/java/com/jianshui/platform/service/impl/InvoiceAddServiceImpl.java

@ -3,9 +3,13 @@ package com.jianshui.web.controller.platform;
import cn.hutool.json.JSON;
import com.jianshui.common.core.controller.BaseController;
import com.jianshui.common.core.domain.AjaxResult;
import com.jianshui.common.utils.ValidateUtils;
import com.jianshui.invoice.mapper.BillInfoMapper;
import com.jianshui.platform.domain.dto.BillInfoPDTO;
import com.jianshui.platform.domain.vo.BillInfoPVO;
import com.jianshui.platform.service.InvoiceAddService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -18,14 +22,13 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("/platForm/documentEntry/")
public class InvoiceAddController extends BaseController {
@Autowired
private static InvoiceAddService addService;
@ApiOperation(value = "单据保存",notes = "单据保存请求")
@PostMapping( "save")
public BillInfoPVO invoiceStatistics(@RequestBody BillInfoPDTO billInfoPDTO) throws Exception {
// TODO: 全电-?
return new BillInfoPVO();
@PostMapping( "invoiceSave")
public AjaxResult invoiceSave(@RequestBody BillInfoPDTO billInfoPDTO) throws Exception {
return toAjax(addService.invoiceSave(billInfoPDTO));
}

@ -0,0 +1,31 @@
package com.jianshui.platform.service;
import com.jianshui.common.core.controller.BaseController;
import com.jianshui.platform.domain.dto.BillInfoPDTO;
import com.jianshui.platform.domain.vo.BillInfoPVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 发票录入
*
*/
public interface InvoiceAddService {
/**
* @Author: kk
* @Description: 单据录入
* @DateTime: 2023/6/5 17:14
* @Params:
* @Return
*/
int invoiceSave(BillInfoPDTO billInfoPDTO);
}

@ -0,0 +1,81 @@
package com.jianshui.platform.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.jianshui.common.core.controller.BaseController;
import com.jianshui.common.utils.ValidateUtils;
import com.jianshui.invoice.domain.BillInfo;
import com.jianshui.invoice.mapper.BillInfoMapper;
import com.jianshui.platform.domain.dto.BillInfoPDTO;
import com.jianshui.platform.domain.vo.BillInfoPVO;
import com.jianshui.platform.service.InvoiceAddService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 发票录入
*
*/
@Service
public class InvoiceAddServiceImpl implements InvoiceAddService {
@Autowired
private static BillInfoMapper billInfoMapper;
@Override
public int invoiceSave(BillInfoPDTO billInfoPDTO) {
ValidateUtils.validate(billInfoPDTO);
BillInfo billInfo = BeanUtil.copyProperties(billInfoPDTO, BillInfo.class);
// 手工录入
billInfo.setSource("3");
return billInfoMapper.insertBillInfo(billInfo);
}
}
Loading…
Cancel
Save