Browse Source

更新采购发票,收付款线条,

jihs 4 years ago
parent
commit
dfae1b5841

+ 19 - 0
src/main/java/org/jeecg/common/dto/invoice/PurchaseReqDTO.java

@@ -0,0 +1,19 @@
+package org.jeecg.common.dto.invoice;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+/**
+   * @Author jihaosen
+   * @date 2021/2/26
+   */
+ @ApiModel("采购发票或销售发票参数请求")
+ @Data
+public class PurchaseReqDTO {
+     @ApiModelProperty("id")
+     private String id;
+
+    public PurchaseReqDTO() {
+    }
+}

+ 237 - 0
src/main/java/org/jeecg/modules/basedata/controller/BaseArchivesCollectionLineController.java

@@ -0,0 +1,237 @@
+package org.jeecg.modules.basedata.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.basedata.entity.BaseArchivesCollectionLine;
+import org.jeecg.modules.basedata.service.IBaseArchivesCollectionLineService;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+
+import org.jeecgframework.poi.excel.ExcelImportUtil;
+import org.jeecgframework.poi.excel.def.NormalExcelConstants;
+import org.jeecgframework.poi.excel.entity.ExportParams;
+import org.jeecgframework.poi.excel.entity.ImportParams;
+import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.servlet.ModelAndView;
+import com.alibaba.fastjson.JSON;
+
+ /**
+ * @Title: Controller
+ * @Description: 收付款条线档案
+ * @author: jeecg-boot
+ * @date2021-03-02
+ * @version: V1.0
+ */
+@RestController
+@RequestMapping("/basedata/baseArchivesCollectionLine")
+@Slf4j
+public class BaseArchivesCollectionLineController {
+	@Autowired
+	private IBaseArchivesCollectionLineService baseArchivesCollectionLineService;
+	
+	/**
+	  * 分页列表查询
+	 * @param baseArchivesCollectionLine
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@GetMapping(value = "/list")
+	public Result<IPage<BaseArchivesCollectionLine>> queryPageList(BaseArchivesCollectionLine baseArchivesCollectionLine,
+									  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+									  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+									  HttpServletRequest req) {
+		Result<IPage<BaseArchivesCollectionLine>> result = new Result<IPage<BaseArchivesCollectionLine>>();
+		QueryWrapper<BaseArchivesCollectionLine> queryWrapper = QueryGenerator.initQueryWrapper(baseArchivesCollectionLine, req.getParameterMap());
+		Page<BaseArchivesCollectionLine> page = new Page<BaseArchivesCollectionLine>(pageNo, pageSize);
+		IPage<BaseArchivesCollectionLine> pageList = baseArchivesCollectionLineService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+	
+	/**
+	  *   添加
+	 * @param baseArchivesCollectionLine
+	 * @return
+	 */
+	@PostMapping(value = "/add")
+	public Result<BaseArchivesCollectionLine> add(@RequestBody BaseArchivesCollectionLine baseArchivesCollectionLine) {
+		Result<BaseArchivesCollectionLine> result = new Result<BaseArchivesCollectionLine>();
+		try {
+			baseArchivesCollectionLineService.save(baseArchivesCollectionLine);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			e.printStackTrace();
+			log.info(e.getMessage());
+			result.error500("操作失败");
+		}
+		return result;
+	}
+	
+	/**
+	  *  编辑
+	 * @param baseArchivesCollectionLine
+	 * @return
+	 */
+	@PutMapping(value = "/edit")
+	public Result<BaseArchivesCollectionLine> edit(@RequestBody BaseArchivesCollectionLine baseArchivesCollectionLine) {
+		Result<BaseArchivesCollectionLine> result = new Result<BaseArchivesCollectionLine>();
+		BaseArchivesCollectionLine baseArchivesCollectionLineEntity = baseArchivesCollectionLineService.getById(baseArchivesCollectionLine.getId());
+		if(baseArchivesCollectionLineEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = baseArchivesCollectionLineService.updateById(baseArchivesCollectionLine);
+			//TODO 返回false说明什么?
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	/**
+	  *   通过id删除
+	 * @param id
+	 * @return
+	 */
+	@DeleteMapping(value = "/delete")
+	public Result<BaseArchivesCollectionLine> delete(@RequestParam(name="id",required=true) String id) {
+		Result<BaseArchivesCollectionLine> result = new Result<BaseArchivesCollectionLine>();
+		BaseArchivesCollectionLine baseArchivesCollectionLine = baseArchivesCollectionLineService.getById(id);
+		if(baseArchivesCollectionLine==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = baseArchivesCollectionLineService.removeById(id);
+			if(ok) {
+				result.success("删除成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	/**
+	  *  批量删除
+	 * @param ids
+	 * @return
+	 */
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<BaseArchivesCollectionLine> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		Result<BaseArchivesCollectionLine> result = new Result<BaseArchivesCollectionLine>();
+		if(ids==null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		}else {
+			this.baseArchivesCollectionLineService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+	
+	/**
+	  * 通过id查询
+	 * @param id
+	 * @return
+	 */
+	@GetMapping(value = "/queryById")
+	public Result<BaseArchivesCollectionLine> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<BaseArchivesCollectionLine> result = new Result<BaseArchivesCollectionLine>();
+		BaseArchivesCollectionLine baseArchivesCollectionLine = baseArchivesCollectionLineService.getById(id);
+		if(baseArchivesCollectionLine==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(baseArchivesCollectionLine);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+  /**
+      * 导出excel
+   *
+   * @param request
+   * @param response
+   */
+  @RequestMapping(value = "/exportXls")
+  public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+      // Step.1 组装查询条件
+      QueryWrapper<BaseArchivesCollectionLine> queryWrapper = null;
+      try {
+          String paramsStr = request.getParameter("paramsStr");
+          if (oConvertUtils.isNotEmpty(paramsStr)) {
+              String deString = URLDecoder.decode(paramsStr, "UTF-8");
+              BaseArchivesCollectionLine baseArchivesCollectionLine = JSON.parseObject(deString, BaseArchivesCollectionLine.class);
+              queryWrapper = QueryGenerator.initQueryWrapper(baseArchivesCollectionLine, request.getParameterMap());
+          }
+      } catch (UnsupportedEncodingException e) {
+          e.printStackTrace();
+      }
+
+      //Step.2 AutoPoi 导出Excel
+      ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+      List<BaseArchivesCollectionLine> pageList = baseArchivesCollectionLineService.list(queryWrapper);
+      //导出文件名称
+      mv.addObject(NormalExcelConstants.FILE_NAME, "收付款条线档案列表");
+      mv.addObject(NormalExcelConstants.CLASS, BaseArchivesCollectionLine.class);
+      mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("收付款条线档案列表数据", "导出人:Jeecg", "导出信息"));
+      mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+      return mv;
+  }
+
+  /**
+      * 通过excel导入数据
+   *
+   * @param request
+   * @param response
+   * @return
+   */
+  @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+  public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+      MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+      Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+      for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+          MultipartFile file = entity.getValue();// 获取上传文件对象
+          ImportParams params = new ImportParams();
+          params.setTitleRows(2);
+          params.setHeadRows(1);
+          params.setNeedSave(true);
+          try {
+              List<BaseArchivesCollectionLine> listBaseArchivesCollectionLines = ExcelImportUtil.importExcel(file.getInputStream(), BaseArchivesCollectionLine.class, params);
+              for (BaseArchivesCollectionLine baseArchivesCollectionLineExcel : listBaseArchivesCollectionLines) {
+                  baseArchivesCollectionLineService.save(baseArchivesCollectionLineExcel);
+              }
+              return Result.ok("文件导入成功!数据行数:" + listBaseArchivesCollectionLines.size());
+          } catch (Exception e) {
+              log.error(e.getMessage());
+              return Result.error("文件导入失败!");
+          } finally {
+              try {
+                  file.getInputStream().close();
+              } catch (IOException e) {
+                  e.printStackTrace();
+              }
+          }
+      }
+      return Result.ok("文件导入失败!");
+  }
+
+}

+ 15 - 12
src/main/java/org/jeecg/modules/basedata/controller/BaseArchivesCostController.java

@@ -1,17 +1,19 @@
 package org.jeecg.modules.basedata.controller;
 
 import java.util.List;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.google.common.collect.Lists;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiImplicitParam;
 import io.swagger.annotations.ApiImplicitParams;
 import io.swagger.annotations.ApiOperation;
-import org.apache.commons.lang.StringUtils;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.aspect.annotation.NotDuplicate;
 import org.jeecg.common.constant.CommonConstant;
 import org.jeecg.common.dto.basedata.ArchivesCostListRespDTO;
 import org.jeecg.common.dto.basedata.ArchivesCostReqDTO;
+import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.modules.basedata.entity.BaseArchivesCost;
 import org.jeecg.modules.basedata.service.IBaseArchivesCostService;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -26,8 +28,9 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
+import javax.servlet.http.HttpServletRequest;
 
- /**
+/**
    * @Author jihaosen
    * @date 2021/2/24
    */
@@ -46,18 +49,18 @@ public class BaseArchivesCostController {
 			 @ApiImplicitParam(name="pkOrg", value="组织",required=false, dataType="String"),
 	 })
 	 @GetMapping(value = "/list")
-	 public Result<List<ArchivesCostListRespDTO>> queryPageList(String pkOrg) {
-		 Result<List<ArchivesCostListRespDTO>> result = new Result<List<ArchivesCostListRespDTO>>();
-		 QueryWrapper<BaseArchivesCost> queryWrapper = new QueryWrapper<>();
-		 queryWrapper.eq("del_flag", CommonConstant.STATUS_NORMAL.toString());
-		 if(StringUtils.isNotBlank(pkOrg)){
-			 queryWrapper.eq("pk_org", pkOrg);
-		 }
+	 public Result<IPage<BaseArchivesCost>> queryPageList(BaseArchivesCost baseArchivesCost,
+		  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+		  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+	  HttpServletRequest req) {
+		 Result<IPage<BaseArchivesCost>> result = new Result<IPage<BaseArchivesCost>>();
+		 QueryWrapper<BaseArchivesCost> queryWrapper = QueryGenerator.initQueryWrapper(baseArchivesCost, req.getParameterMap());
+		 Page<BaseArchivesCost> page = new Page<BaseArchivesCost>(pageNo, pageSize);
+		 queryWrapper.eq("del_flag", "0");
 		 queryWrapper.orderByAsc("create_time");
-		 List<BaseArchivesCost> list = baseArchivesCostService.list(queryWrapper);
-		 List<ArchivesCostListRespDTO> archivesCostListRespDTOS = getArchivesCostData(list);
+		 IPage<BaseArchivesCost> pageList = baseArchivesCostService.page(page, queryWrapper);
 		 result.setSuccess(true);
-		 result.setResult(archivesCostListRespDTOS);
+		 result.setResult(pageList);
 		 return result;
 	 }
 

+ 55 - 0
src/main/java/org/jeecg/modules/basedata/entity/BaseArchivesCollectionLine.java

@@ -0,0 +1,55 @@
+package org.jeecg.modules.basedata.entity;
+
+import java.io.Serializable;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * @Description: 收付款条线档案
+ * @author: jeecg-boot
+ * @date2021-03-02
+ * @version: V1.0
+ */
+@Data
+@TableName("base_archives_collection_line")
+public class BaseArchivesCollectionLine implements Serializable {
+    private static final long serialVersionUID = 1L;
+    
+	/**id*/
+	@TableId(type = IdType.UUID)
+	private java.lang.String id;
+	/**编码*/
+	@Excel(name = "编码", width = 15)
+	private java.lang.String code;
+	/**名称*/
+	@Excel(name = "名称", width = 15)
+	private java.lang.String name;
+	/**创建时间*/
+	@Excel(name = "创建时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private java.util.Date createTime;
+	/**创建人*/
+	@Excel(name = "创建人", width = 15)
+	private java.lang.String createBy;
+	/**修改时间*/
+	@Excel(name = "修改时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private java.util.Date updateTime;
+	/**修改人*/
+	@Excel(name = "修改人", width = 15)
+	private java.lang.String updateBy;
+	/**删除状态(0,正常,1已删除)*/
+	@Excel(name = "删除状态(0,正常,1已删除)", width = 15)
+	private java.lang.String delFlag;
+	/**组织*/
+	@Excel(name = "组织", width = 15)
+	private java.lang.String pkOrg;
+}

+ 17 - 0
src/main/java/org/jeecg/modules/basedata/mapper/BaseArchivesCollectionLineMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.basedata.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.basedata.entity.BaseArchivesCollectionLine;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 收付款条线档案
+ * @author: jeecg-boot
+ * @date2021-03-02
+ * @version: V1.0
+ */
+public interface BaseArchivesCollectionLineMapper extends BaseMapper<BaseArchivesCollectionLine> {
+
+}

+ 5 - 0
src/main/java/org/jeecg/modules/basedata/mapper/xml/BaseArchivesCollectionLineMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.basedata.mapper.BaseArchivesCollectionLineMapper">
+
+</mapper>

+ 14 - 0
src/main/java/org/jeecg/modules/basedata/service/IBaseArchivesCollectionLineService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.basedata.service;
+
+import org.jeecg.modules.basedata.entity.BaseArchivesCollectionLine;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 收付款条线档案
+ * @author: jeecg-boot
+ * @date2021-03-02
+ * @version: V1.0
+ */
+public interface IBaseArchivesCollectionLineService extends IService<BaseArchivesCollectionLine> {
+
+}

+ 19 - 0
src/main/java/org/jeecg/modules/basedata/service/impl/BaseArchivesCollectionLineServiceImpl.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.basedata.service.impl;
+
+import org.jeecg.modules.basedata.entity.BaseArchivesCollectionLine;
+import org.jeecg.modules.basedata.mapper.BaseArchivesCollectionLineMapper;
+import org.jeecg.modules.basedata.service.IBaseArchivesCollectionLineService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 收付款条线档案
+ * @author: jeecg-boot
+ * @date2021-03-02
+ * @version: V1.0
+ */
+@Service
+public class BaseArchivesCollectionLineServiceImpl extends ServiceImpl<BaseArchivesCollectionLineMapper, BaseArchivesCollectionLine> implements IBaseArchivesCollectionLineService {
+
+}

+ 183 - 0
src/main/java/org/jeecg/modules/invoice/controller/InvoiceManagePurchaseController.java

@@ -0,0 +1,183 @@
+package org.jeecg.modules.invoice.controller;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.validation.Valid;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiImplicitParam;
+import io.swagger.annotations.ApiImplicitParams;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.common.constant.CommonConstant;
+import org.jeecg.common.dto.invoice.PurchaseReqDTO;
+import org.jeecg.common.system.query.QueryGenerator;
+import org.jeecg.modules.invoice.entity.InvoiceManagePurchase;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.modules.invoice.service.InvoiceManagePurchaseService;
+import org.jeecg.modules.system.service.ISysSerialPatternService;
+import org.jeecg.modules.system.vo.CallResult;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.BindingResult;
+import org.springframework.web.bind.annotation.DeleteMapping;
+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.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+   * @Author jihaosen
+   * @date 2021/2/26
+   */
+@Api("采购发票和销售发票接口")
+@RestController
+@RequestMapping("/invoice/invoiceManagePurchase")
+@Slf4j
+public class InvoiceManagePurchaseController {
+	@Autowired
+	private InvoiceManagePurchaseService invoiceManagePurchaseService;
+	@Autowired
+	private ISysSerialPatternService sysSerialPatternService;
+
+	
+	@GetMapping(value = "/list")
+	@ApiOperation(value = "分页查询接口", notes = "采购发票和销售发票分页查询")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name="pkOrg", value="组织",required=false, dataType="String"),
+			@ApiImplicitParam(name="type", value="类型(1.采购发票 2.销售发票)",required=true, dataType="String"),
+			@ApiImplicitParam(name="billcode", value="单据编号",required=false, dataType="String")
+			})
+	public Result<IPage<InvoiceManagePurchase>> queryPageList(InvoiceManagePurchase invoiceManagePurchase,
+	  @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+	  @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+	  HttpServletRequest req) {
+		Result<IPage<InvoiceManagePurchase>> result = new Result<IPage<InvoiceManagePurchase>>();
+		QueryWrapper<InvoiceManagePurchase> queryWrapper = QueryGenerator.initQueryWrapper(invoiceManagePurchase, req.getParameterMap());
+		Page<InvoiceManagePurchase> page = new Page<InvoiceManagePurchase>(pageNo, pageSize);
+		queryWrapper.eq("del_flag", CommonConstant.STATUS_NORMAL.toString());
+		queryWrapper.orderByDesc("create_time");
+		IPage<InvoiceManagePurchase> pageList = invoiceManagePurchaseService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+	
+	@ApiOperation(value = "新增", notes = "新增采购发票和销售发票")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name="pkOrg", value="组织",required=false, dataType="String"),
+			@ApiImplicitParam(name="type", value="类型(1.采购发票 2.销售发票)",required=true, dataType="String"),
+			@ApiImplicitParam(name="proArchivesId", value="项目档案id)",required=true, dataType="String"),
+			@ApiImplicitParam(name="proCode", value="项目编码",required=true, dataType="String"),
+			@ApiImplicitParam(name="proName", value="项目名称",required=true, dataType="String"),
+			@ApiImplicitParam(name="coArchivesId", value="收款条线档案id",required=true, dataType="String"),
+			@ApiImplicitParam(name="coArchivesName", value="收付款条线",required=true, dataType="String"),
+			@ApiImplicitParam(name="proBusinessId", value="项目档案里程碑表id",required=true, dataType="String"),
+			@ApiImplicitParam(name="proArchivesMilestone", value="项目档案里程碑(项目档案—商务,页签中的收款计划)",required=true, dataType="String"),
+			@ApiImplicitParam(name="price", value="金额 (里程碑与首付款条线对应金额)",required=true, dataType="String"),
+			@ApiImplicitParam(name="uncoPrice", value="未收票金额",required=true, dataType="String"),
+			@ApiImplicitParam(name="coPrice", value="收票金额",required=true, dataType="String"),
+			@ApiImplicitParam(name="currentUser", value="填写人(当前用户)",required=true, dataType="String"),
+	})
+	@PostMapping(value = "/add")
+	public Result<InvoiceManagePurchase> add(@RequestBody @Valid InvoiceManagePurchase invoiceManagePurchase, BindingResult bindingResult) {
+		Result<InvoiceManagePurchase> result = new Result<InvoiceManagePurchase>();
+		try {
+
+			StringBuilder sb = new StringBuilder();
+			if (bindingResult.hasErrors()){
+				//记录错误信息
+				bindingResult.getAllErrors().stream().forEach(error -> sb.append(error.getDefaultMessage() + "<br/>"));
+				result.error500(sb.toString());
+				return result;
+			}
+			// 设置编码
+			CallResult<String> nextSerial = sysSerialPatternService.getNextSerial(invoiceManagePurchase, "invoice_manage_purchase", "billcode", true);
+			if(!nextSerial.isSucceed()){
+				throw new RuntimeException("获取编号失败");
+			}
+			invoiceManagePurchase.setBillcode(nextSerial.getContent());
+			invoiceManagePurchaseService.save(invoiceManagePurchase);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			e.printStackTrace();
+			log.info(e.getMessage());
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	 @ApiOperation(value = "编辑", notes = "修改采购发票或销售发票的数据")
+	 @ApiImplicitParams({
+			 @ApiImplicitParam(name="id", value="id",required=true, dataType="String"),
+			 @ApiImplicitParam(name="pkOrg", value="组织",required=false, dataType="String"),
+			 @ApiImplicitParam(name="type", value="类型(1.采购发票 2.销售发票)",required=true, dataType="String"),
+			 @ApiImplicitParam(name="proArchivesId", value="项目档案id)",required=true, dataType="String"),
+			 @ApiImplicitParam(name="proCode", value="项目编码",required=true, dataType="String"),
+			 @ApiImplicitParam(name="proName", value="项目名称",required=true, dataType="String"),
+			 @ApiImplicitParam(name="coArchivesId", value="收款条线档案id",required=true, dataType="String"),
+			 @ApiImplicitParam(name="coArchivesName", value="收付款条线",required=true, dataType="String"),
+			 @ApiImplicitParam(name="proBusinessId", value="项目档案里程碑表id",required=true, dataType="String"),
+			 @ApiImplicitParam(name="proArchivesMilestone", value="项目档案里程碑(项目档案—商务,页签中的收款计划)",required=true, dataType="String"),
+			 @ApiImplicitParam(name="price", value="金额 (里程碑与首付款条线对应金额)",required=true, dataType="String"),
+			 @ApiImplicitParam(name="uncoPrice", value="未收票金额",required=true, dataType="String"),
+			 @ApiImplicitParam(name="coPrice", value="收票金额",required=true, dataType="String"),
+			 @ApiImplicitParam(name="currentUser", value="填写人(当前用户)",required=true, dataType="String"),
+	 })
+	@PutMapping(value = "/edit")
+	public Result<InvoiceManagePurchase> edit(@RequestBody InvoiceManagePurchase invoiceManagePurchase) {
+		Result<InvoiceManagePurchase> result = new Result<InvoiceManagePurchase>();
+		InvoiceManagePurchase invoiceManagePurchaseEntity = invoiceManagePurchaseService.getById(invoiceManagePurchase.getId());
+		if(invoiceManagePurchaseEntity==null) {
+			result.error500("未找到对应实体");
+		}else {
+			boolean ok = invoiceManagePurchaseService.updateById(invoiceManagePurchase);
+			if(ok) {
+				result.success("修改成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	@ApiOperation(value = "删除", notes = "根据id删除采购发票和销售发票")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "id", value = "组织", required = true, dataType = "String")
+	})
+	@DeleteMapping(value = "/delete")
+	public Result<InvoiceManagePurchase> delete(@RequestBody PurchaseReqDTO reqDTO) {
+		Result<InvoiceManagePurchase> result = new Result<InvoiceManagePurchase>();
+		InvoiceManagePurchase invoiceManagePurchase = invoiceManagePurchaseService.getById(reqDTO.getId());
+		if(invoiceManagePurchase==null) {
+			result.error500("未找到对应实体");
+		}else {
+			invoiceManagePurchase.setDelFlag("1");
+			boolean ok = invoiceManagePurchaseService.updateById(invoiceManagePurchase);
+			if(ok) {
+				result.success("删除成功!");
+			}
+		}
+		
+		return result;
+	}
+	
+	@ApiOperation(value = "通过id查询", notes = "通过id查询采购发票和销售发票")
+	@ApiImplicitParams({
+			@ApiImplicitParam(name = "id", value = "组织", required = true, dataType = "String")
+	})
+	@GetMapping(value = "/queryById")
+	public Result<InvoiceManagePurchase> queryById(@RequestParam(name="id",required=true) String id) {
+		Result<InvoiceManagePurchase> result = new Result<InvoiceManagePurchase>();
+		InvoiceManagePurchase invoiceManagePurchase = invoiceManagePurchaseService.getById(id);
+		if(invoiceManagePurchase==null) {
+			result.error500("未找到对应实体");
+		}else {
+			result.setResult(invoiceManagePurchase);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+}

+ 109 - 0
src/main/java/org/jeecg/modules/invoice/entity/InvoiceManagePurchase.java

@@ -0,0 +1,109 @@
+package org.jeecg.modules.invoice.entity;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+import java.util.Date;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import javax.validation.constraints.NotEmpty;
+
+/**
+ * @Description: 采购,销售发票
+ * @author: jeecg-boot
+ * @date2021-02-26
+ * @version: V1.0
+ */
+@ApiModel("采购,销售发票")
+@Data
+@TableName("invoice_manage_purchase")
+public class InvoiceManagePurchase implements Serializable {
+	private static final long serialVersionUID = 4097348073460739726L;
+	@ApiModelProperty("id")
+	@TableId(type = IdType.UUID)
+	private String id;
+	@ApiModelProperty("单据编号")
+	private String billcode;
+	@ApiModelProperty("类型(1.采购发票 2.销售发票)")
+	@NotEmpty(message = "参数type不能为空")
+	private String type;
+	@ApiModelProperty("项目档案id")
+	private String proArchivesId;
+	@NotEmpty(message = "参数proCode不为空")
+	@ApiModelProperty("项目编码")
+	private String proCode;
+	@ApiModelProperty("项目名称")
+	@NotEmpty(message = "参数proName不为空")
+	private String proName;
+	@ApiModelProperty("收款条线档案id")
+	@NotEmpty(message = "参数coArchivesId不能为空")
+	private String coArchivesId;
+	@ApiModelProperty("收付款条线")
+	@NotEmpty(message = "参数coArchivesName不能为空")
+	private String coArchivesName;
+	@ApiModelProperty("项目档案里程碑表id")
+	@NotEmpty(message = "参数proBusinessId不能为空")
+	private String proBusinessId;
+	@ApiModelProperty("项目档案里程碑(项目档案—商务,页签中的收款计划)")
+	@NotEmpty(message = "参数proArchivesMilestone不能为空")
+	private String proArchivesMilestone;
+	@ApiModelProperty("金额(里程碑与首付款条线对应金额)")
+	private BigDecimal price;
+	@ApiModelProperty("未收票金额")
+	private BigDecimal uncoPrice;
+	@ApiModelProperty("收票金额")
+	private BigDecimal coPrice;
+	@ApiModelProperty("填写人(当前用户)")
+	@TableField(value = "`current_user`")
+	private String currentUser;
+	@ApiModelProperty("创建时间")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private Date createTime;
+	@ApiModelProperty("创建人")
+	private String createBy;
+	@ApiModelProperty("修改时间")
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+	private Date updateTime;
+	@ApiModelProperty("修改人")
+	private String updateBy;
+	@ApiModelProperty("删除状态(0,正常,1已删除)")
+	private String delFlag;
+	@ApiModelProperty("组织")
+	private String pkOrg;
+
+	public InvoiceManagePurchase() {
+	}
+
+	public InvoiceManagePurchase(String id, String billcode, String type, String proCode, String proArchivesId, String proName, String coArchivesId,
+	 String coArchivesName, String proBusinessId, String proArchivesMilestone, BigDecimal price, BigDecimal uncoPrice,
+	 BigDecimal coPrice, String currentUser, Date createTime, String createBy, Date updateTime, String updateBy, String delFlag, String pkOrg) {
+		this.id = id;
+		this.billcode = billcode;
+		this.type = type;
+		this.proArchivesId = proArchivesId;
+		this.proCode = proCode;
+		this.proName = proName;
+		this.coArchivesId = coArchivesId;
+		this.coArchivesName = coArchivesName;
+		this.proBusinessId = proBusinessId;
+		this.proArchivesMilestone = proArchivesMilestone;
+		this.price = price;
+		this.uncoPrice = uncoPrice;
+		this.coPrice = coPrice;
+		this.currentUser = currentUser;
+		this.createTime = createTime;
+		this.createBy = createBy;
+		this.updateTime = updateTime;
+		this.updateBy = updateBy;
+		this.delFlag = delFlag;
+		this.pkOrg = pkOrg;
+	}
+}

+ 17 - 0
src/main/java/org/jeecg/modules/invoice/mapper/InvoiceManagePurchaseMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.invoice.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.invoice.entity.InvoiceManagePurchase;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 采购,销售发票
+ * @author: jeecg-boot
+ * @date2021-02-26
+ * @version: V1.0
+ */
+public interface InvoiceManagePurchaseMapper extends BaseMapper<InvoiceManagePurchase> {
+
+}

+ 5 - 0
src/main/java/org/jeecg/modules/invoice/mapper/xml/InvoiceManagePurchaseMapper.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.jeecg.modules.invoice.mapper.InvoiceManagePurchaseMapper">
+
+</mapper>

+ 14 - 0
src/main/java/org/jeecg/modules/invoice/service/InvoiceManagePurchaseService.java

@@ -0,0 +1,14 @@
+package org.jeecg.modules.invoice.service;
+
+import org.jeecg.modules.invoice.entity.InvoiceManagePurchase;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @Description: 采购,销售发票
+ * @author: jeecg-boot
+ * @date2021-02-26
+ * @version: V1.0
+ */
+public interface InvoiceManagePurchaseService extends IService<InvoiceManagePurchase> {
+
+}

+ 18 - 0
src/main/java/org/jeecg/modules/invoice/service/impl/InvoiceManagePurchaseServiceImpl.java

@@ -0,0 +1,18 @@
+package org.jeecg.modules.invoice.service.impl;
+
+import org.jeecg.modules.invoice.entity.InvoiceManagePurchase;
+import org.jeecg.modules.invoice.mapper.InvoiceManagePurchaseMapper;
+import org.jeecg.modules.invoice.service.InvoiceManagePurchaseService;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @Description: 采购,销售发票
+ * @author: jeecg-boot
+ * @date2021-02-26
+ * @version: V1.0
+ */
+@Service
+public class InvoiceManagePurchaseServiceImpl extends ServiceImpl<InvoiceManagePurchaseMapper, InvoiceManagePurchase> implements InvoiceManagePurchaseService {
+
+}