sl 1 год назад
Родитель
Сommit
15e6467dc8

+ 177 - 0
module_kzks/src/main/java/org/jeecg/modules/contractIncomeInfoNew/controller/ContractIncomeInfoNewController.java

@@ -0,0 +1,177 @@
+package org.jeecg.modules.contractIncomeInfoNew.controller;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+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.contractIncomeInfoNew.entity.ContractIncomeInfoNew;
+import org.jeecg.modules.contractIncomeInfoNew.service.IContractIncomeInfoNewService;
+
+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.jeecg.common.system.base.controller.JeecgController;
+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;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.jeecg.common.aspect.annotation.AutoLog;
+
+ /**
+ * @Description: 导入合同、收款表
+ * @Author: jeecg-boot
+ * @Date:   2024-04-08
+ * @Version: V1.0
+ */
+@Api(tags="导入合同、收款表")
+@RestController
+@RequestMapping("/contractIncomeInfoNew/contractIncomeInfoNew")
+@Slf4j
+public class ContractIncomeInfoNewController extends JeecgController<ContractIncomeInfoNew, IContractIncomeInfoNewService> {
+	@Autowired
+	private IContractIncomeInfoNewService contractIncomeInfoNewService;
+	
+	/**
+	 * 分页列表查询
+	 *
+	 * @param contractIncomeInfoNew
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	//@AutoLog(value = "导入合同、收款表-分页列表查询")
+	@ApiOperation(value="导入合同、收款表-分页列表查询", notes="导入合同、收款表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<ContractIncomeInfoNew>> queryPageList(ContractIncomeInfoNew contractIncomeInfoNew,
+								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+								   HttpServletRequest req) {
+		QueryWrapper<ContractIncomeInfoNew> queryWrapper = QueryGenerator.initQueryWrapper(contractIncomeInfoNew, req.getParameterMap());
+		Page<ContractIncomeInfoNew> page = new Page<ContractIncomeInfoNew>(pageNo, pageSize);
+		IPage<ContractIncomeInfoNew> pageList = contractIncomeInfoNewService.page(page, queryWrapper);
+		return Result.OK(pageList);
+	}
+	
+	/**
+	 *   添加
+	 *
+	 * @param contractIncomeInfoNew
+	 * @return
+	 */
+	@AutoLog(value = "导入合同、收款表-添加")
+	@ApiOperation(value="导入合同、收款表-添加", notes="导入合同、收款表-添加")
+	//@RequiresPermissions("org.jeecg.modules:contract_income_info_new:add")
+	@PostMapping(value = "/add")
+	public Result<String> add(@RequestBody ContractIncomeInfoNew contractIncomeInfoNew) {
+		contractIncomeInfoNewService.save(contractIncomeInfoNew);
+		return Result.OK("添加成功!");
+	}
+	
+	/**
+	 *  编辑
+	 *
+	 * @param contractIncomeInfoNew
+	 * @return
+	 */
+	@AutoLog(value = "导入合同、收款表-编辑")
+	@ApiOperation(value="导入合同、收款表-编辑", notes="导入合同、收款表-编辑")
+	//@RequiresPermissions("org.jeecg.modules:contract_income_info_new:edit")
+	@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
+	public Result<String> edit(@RequestBody ContractIncomeInfoNew contractIncomeInfoNew) {
+		contractIncomeInfoNewService.updateById(contractIncomeInfoNew);
+		return Result.OK("编辑成功!");
+	}
+	
+	/**
+	 *   通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "导入合同、收款表-通过id删除")
+	@ApiOperation(value="导入合同、收款表-通过id删除", notes="导入合同、收款表-通过id删除")
+	//@RequiresPermissions("org.jeecg.modules:contract_income_info_new:delete")
+	@DeleteMapping(value = "/delete")
+	public Result<String> delete(@RequestParam(name="id",required=true) String id) {
+		contractIncomeInfoNewService.removeById(id);
+		return Result.OK("删除成功!");
+	}
+	
+	/**
+	 *  批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "导入合同、收款表-批量删除")
+	@ApiOperation(value="导入合同、收款表-批量删除", notes="导入合同、收款表-批量删除")
+	//@RequiresPermissions("org.jeecg.modules:contract_income_info_new:deleteBatch")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
+		this.contractIncomeInfoNewService.removeByIds(Arrays.asList(ids.split(",")));
+		return Result.OK("批量删除成功!");
+	}
+	
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	//@AutoLog(value = "导入合同、收款表-通过id查询")
+	@ApiOperation(value="导入合同、收款表-通过id查询", notes="导入合同、收款表-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<ContractIncomeInfoNew> queryById(@RequestParam(name="id",required=true) String id) {
+		ContractIncomeInfoNew contractIncomeInfoNew = contractIncomeInfoNewService.getById(id);
+		if(contractIncomeInfoNew==null) {
+			return Result.error("未找到对应数据");
+		}
+		return Result.OK(contractIncomeInfoNew);
+	}
+
+    /**
+    * 导出excel
+    *
+    * @param request
+    * @param contractIncomeInfoNew
+    */
+    //@RequiresPermissions("org.jeecg.modules:contract_income_info_new:exportXls")
+    @RequestMapping(value = "/exportXls")
+    public ModelAndView exportXls(HttpServletRequest request, ContractIncomeInfoNew contractIncomeInfoNew) {
+        return super.exportXls(request, contractIncomeInfoNew, ContractIncomeInfoNew.class, "导入合同、收款表");
+    }
+
+    /**
+      * 通过excel导入数据
+    *
+    * @param request
+    * @param response
+    * @return
+    */
+    //@RequiresPermissions("contract_income_info_new:importExcel")
+    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+        return super.importExcel(request, response, ContractIncomeInfoNew.class);
+    }
+
+}

+ 364 - 0
module_kzks/src/main/java/org/jeecg/modules/contractIncomeInfoNew/entity/ContractIncomeInfoNew.java

@@ -0,0 +1,364 @@
+package org.jeecg.modules.contractIncomeInfoNew.entity;
+
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.Date;
+import java.math.BigDecimal;
+
+import com.alibaba.excel.annotation.ExcelIgnore;
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.converters.bigdecimal.BigDecimalNumberConverter;
+import com.alibaba.excel.converters.bigdecimal.BigDecimalStringConverter;
+import com.alibaba.excel.converters.date.DateStringConverter;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.jeecg.common.aspect.annotation.Dict;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.EqualsAndHashCode;
+import lombok.experimental.Accessors;
+
+/**
+ * @Description: 导入合同、收款表
+ * @Author: jeecg-boot
+ * @Date:   2024-04-08
+ * @Version: V1.0
+ */
+@Data
+@TableName("contract_income_info_new")
+@Accessors(chain = false)
+@EqualsAndHashCode(callSuper = false)
+@ApiModel(value="contract_income_info_new对象", description="导入合同、收款表")
+public class ContractIncomeInfoNew implements Serializable {
+    private static final long serialVersionUID = 1L;
+
+	/**主键*/
+	@TableId(type = IdType.ASSIGN_ID)
+    @ExcelIgnore
+    @ApiModelProperty(value = "主键")
+    private java.lang.String id;
+	/**创建人*/
+    @ExcelIgnore
+    @ApiModelProperty(value = "创建人")
+    private java.lang.String createBy;
+	/**创建日期*/
+    @ExcelIgnore
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "创建日期")
+    private java.util.Date createTime;
+	/**更新人*/
+    @ExcelIgnore
+    @ApiModelProperty(value = "更新人")
+    private java.lang.String updateBy;
+	/**更新日期*/
+    @ExcelIgnore
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "更新日期")
+    private java.util.Date updateTime;
+	/**序号*/
+//	@Excel(name = "序号", width = 15)
+    @ExcelProperty(value = "序号")
+    @ApiModelProperty(value = "序号")
+    private java.lang.String serialno;
+	/**ID*/
+//	@Excel(name = "ID", width = 15)
+    @ExcelProperty(value = "ID")
+    @ApiModelProperty(value = "ID")
+    private java.lang.String htid;
+	/**主合同编号*/
+//	@Excel(name = "主合同编号", width = 15)
+    @ExcelProperty(value = "主合同编号")
+    @ApiModelProperty(value = "主合同编号")
+    private java.lang.String zhtbh;
+	/**合同编号*/
+//	@Excel(name = "合同编号", width = 15)
+    @ExcelProperty(value = "合同编号")
+    @ApiModelProperty(value = "合同编号")
+    private java.lang.String htbh;
+	/**合同名称*/
+//	@Excel(name = "合同名称", width = 15)
+    @ExcelProperty(value = "合同名称")
+    @ApiModelProperty(value = "合同名称")
+    private java.lang.String htname;
+	/**签署日期*/
+//	@Excel(name = "签署日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @ExcelProperty(value = "签署日期", converter = DateStringConverter.class)
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "签署日期")
+    private java.util.Date qsrq;
+	/**甲方(付款方)*/
+//	@Excel(name = "甲方(付款方)", width = 15)
+    @ExcelProperty(value = "甲方(付款方)")
+    @ApiModelProperty(value = "甲方(付款方)")
+    private java.lang.String jf;
+	/**甲方简称*/
+//	@Excel(name = "甲方简称", width = 15)
+    @ExcelProperty(value = "甲方简称")
+    @ApiModelProperty(value = "甲方简称")
+    private java.lang.String jfjc;
+	/**合同金额*/
+//	@Excel(name = "合同金额", width = 15)    //单元格常规格式用这个
+//    @ExcelProperty(converter = BigDecimalStringConverter.class)   //单元格文本格式用这个
+//    @ExcelProperty(converter = BigDecimalNumberConverter.class)  //单元格数值格式用这个
+    @ExcelProperty(value = "合同金额")
+    @ApiModelProperty(value = "合同金额")
+    private java.math.BigDecimal htje;
+	/**自筹*/
+//	@Excel(name = "自筹", width = 15)
+//    @ExcelProperty(converter = BigDecimalStringConverter.class)
+//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+    @ExcelProperty(value = "自筹")
+    @ApiModelProperty(value = "自筹")
+    private java.math.BigDecimal zc;
+	/**合同到款*/
+//	@Excel(name = "合同到款", width = 15)
+//    @ExcelProperty(converter = BigDecimalStringConverter.class)
+//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+    @ExcelProperty(value = "合同到款")
+    @ApiModelProperty(value = "合同到款")
+    private java.math.BigDecimal htdk;
+	/**合同待收款*/
+//	@Excel(name = "合同待收款", width = 15)
+//    @ExcelProperty(converter = BigDecimalStringConverter.class)
+//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+    @ExcelProperty(value = "合同待收款")
+    @ApiModelProperty(value = "合同待收款")
+    private java.math.BigDecimal htdsk;
+	/**合同已开票*/
+//	@Excel(name = "合同已开票", width = 15)
+//    @ExcelProperty(converter = BigDecimalStringConverter.class)
+//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+    @ExcelProperty(value = "合同已开票")
+    @ApiModelProperty(value = "合同已开票")
+    private java.math.BigDecimal htykp;
+	/**合同待开票*/
+//	@Excel(name = "合同待开票", width = 15)
+//    @ExcelProperty(converter = BigDecimalStringConverter.class)
+//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+    @ExcelProperty(value = "合同待开票")
+    @ApiModelProperty(value = "合同待开票")
+    private java.math.BigDecimal htdkp;
+	/**任务编号*/
+//	@Excel(name = "任务编号", width = 15)
+    @ExcelProperty(value = "任务编号")
+    @ApiModelProperty(value = "任务编号")
+    private java.lang.String rwbh;
+	/**任务名称*/
+//	@Excel(name = "任务名称", width = 15)
+    @ExcelProperty(value = "任务名称")
+    @ApiModelProperty(value = "任务名称")
+    private java.lang.String rwname;
+	/**产品型号*/
+//	@Excel(name = "产品型号", width = 15)
+    @ExcelProperty(value = "产品型号")
+    @ApiModelProperty(value = "产品型号")
+    private java.lang.String cpxh;
+	/**阶段*/
+//	@Excel(name = "阶段", width = 15)
+    @ExcelProperty(value = "阶段")
+    @ApiModelProperty(value = "阶段")
+    private java.lang.String jd;
+	/**研制部门*/
+//	@Excel(name = "研制部门", width = 15)
+    @ExcelProperty(value = "研制部门")
+    @ApiModelProperty(value = "研制部门")
+    private java.lang.String yzbm;
+	/**任务应收款*/
+//	@Excel(name = "任务应收款", width = 15)
+//    @ExcelProperty(converter = BigDecimalStringConverter.class)
+//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+    @ExcelProperty(value = "任务应收款")
+    @ApiModelProperty(value = "任务应收款")
+    private java.math.BigDecimal rwyingsk;
+	/**任务已收款*/
+//	@Excel(name = "任务已收款", width = 15)
+//    @ExcelProperty(converter = BigDecimalStringConverter.class)
+//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+    @ExcelProperty(value = "任务已收款")
+    @ApiModelProperty(value = "任务已收款")
+    private java.math.BigDecimal rwyisk;
+	/**发票类型1*/
+//	@Excel(name = "发票类型1", width = 15)
+    @ExcelProperty(value = "发票类型1")
+    @ApiModelProperty(value = "发票类型1")
+    private java.lang.String fptypeone;
+	/**发票1金额*/
+//	@Excel(name = "发票1金额", width = 15)
+//    @ExcelProperty(converter = BigDecimalStringConverter.class)
+//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+    @ExcelProperty(value = "发票1金额")
+    @ApiModelProperty(value = "发票1金额")
+    private java.math.BigDecimal fpjeone;
+	/**1已开票额*/
+//	@Excel(name = "1已开票额", width = 15)
+//    @ExcelProperty(converter = BigDecimalStringConverter.class)
+//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+    @ExcelProperty(value = "1已开票额")
+    @ApiModelProperty(value = "1已开票额")
+    private java.math.BigDecimal ykpeone;
+	/**发票类型2*/
+//	@Excel(name = "发票类型2", width = 15)
+    @ExcelProperty(value = "发票类型2")
+    @ApiModelProperty(value = "发票类型2")
+    private java.lang.String fptypetwo;
+	/**发票2金额*/
+//	@Excel(name = "发票2金额", width = 15)
+//    @ExcelProperty(converter = BigDecimalStringConverter.class)
+//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+    @ExcelProperty(value = "发票2金额")
+    @ApiModelProperty(value = "发票2金额")
+    private java.math.BigDecimal fpjetwo;
+	/**2已开票额*/
+//	@Excel(name = "2已开票额", width = 15)
+//    @ExcelProperty(converter = BigDecimalStringConverter.class)
+//    @ExcelProperty(converter = BigDecimalNumberConverter.class)
+    @ExcelProperty(value = "2已开票额")
+    @ApiModelProperty(value = "2已开票额")
+    private java.math.BigDecimal ykpetwo;
+	/**合同主管部门*/
+//	@Excel(name = "合同主管部门", width = 15)
+    @ExcelProperty(value = "合同主管部门")
+    @ApiModelProperty(value = "合同主管部门")
+    private java.lang.String htzgbm;
+	/**业务员*/
+//	@Excel(name = "业务员", width = 15)
+    @ExcelProperty(value = "业务员")
+    @ApiModelProperty(value = "业务员")
+    private java.lang.String ywy;
+	/**合同履行情况*/
+//	@Excel(name = "合同履行情况", width = 15)
+    @ExcelProperty(value = "合同履行情况")
+    @ApiModelProperty(value = "合同履行情况")
+    private java.lang.String htlxqk;
+	/**合同状态说明*/
+//	@Excel(name = "合同状态说明", width = 15)
+    @ExcelProperty(value = "合同状态说明")
+    @ApiModelProperty(value = "合同状态说明")
+    private java.lang.String htztsm;
+	/**收款单号*/
+//	@Excel(name = "收款单号", width = 15)
+    @ExcelProperty(value = "收款单号")
+    @ApiModelProperty(value = "收款单号")
+    private java.lang.String skdh;
+	/**执行状态*/
+//	@Excel(name = "执行状态", width = 15)
+    @ExcelProperty(value = "执行状态")
+    @ApiModelProperty(value = "执行状态")
+    private java.lang.String zxzt;
+	/**付款方名称*/
+//	@Excel(name = "付款方名称", width = 15)
+    @ExcelProperty(value = "付款方名称")
+    @ApiModelProperty(value = "付款方名称")
+    private java.lang.String fkfmc;
+	/**用户简称*/
+//	@Excel(name = "用户简称", width = 15)
+    @ExcelProperty(value = "用户简称")
+    @ApiModelProperty(value = "用户简称")
+    private java.lang.String yhjc;
+	/**合同类型*/
+//	@Excel(name = "合同类型", width = 15)
+    @ExcelProperty(value = "合同类型")
+    @ApiModelProperty(value = "合同类型")
+    private java.lang.String httype;
+	/**型号*/
+//	@Excel(name = "型号", width = 15)
+    @ExcelProperty(value = "型号")
+    @ApiModelProperty(value = "型号")
+    private java.lang.String xh;
+	/**数量*/
+//	@Excel(name = "数量", width = 15)
+    @ExcelProperty(value = "数量")
+    @ApiModelProperty(value = "数量")
+    private java.lang.Integer sl;
+	/**收款总金额*/
+//	@Excel(name = "收款总金额", width = 15)
+//    @ExcelProperty(converter = BigDecimalStringConverter.class, index = 14)
+//    @ExcelProperty(value = "收款总金额", converter = BigDecimalNumberConverter.class)
+    @ExcelProperty(value = "收款总金额")
+    @ApiModelProperty(value = "收款总金额")
+    private java.math.BigDecimal skzje;
+	/** 任务收款金额 */
+//	@Excel(name = " 任务收款金额 ", width = 15)
+//    @ExcelProperty(converter = BigDecimalStringConverter.class, index = 15)
+//    @ExcelProperty(value = "任务收款金额", converter = BigDecimalNumberConverter.class)
+    @ExcelProperty(value = "任务收款金额")
+    @ApiModelProperty(value = " 任务收款金额 ")
+    private java.math.BigDecimal rwskje;
+	/**到款日期/汇票到期日期*/
+//	@Excel(name = "到款日期/汇票到期日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @ExcelProperty(value = "到款日期/汇票到期日期", converter = DateStringConverter.class)
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "到款日期/汇票到期日期")
+    private java.util.Date dkrq;
+	/**收款类型*/
+//	@Excel(name = "收款类型", width = 15)
+    @ExcelProperty(value = "收款类型")
+    @ApiModelProperty(value = "收款类型")
+    private java.lang.String sktype;
+	/**收款科目代码*/
+//	@Excel(name = "收款科目代码", width = 15)
+    @ExcelProperty(value = "收款科目代码")
+    @ApiModelProperty(value = "收款科目代码")
+    private java.lang.String skkmdm;
+	/**凭证号*/
+//	@Excel(name = "凭证号", width = 15)
+    @ExcelProperty(value = "凭证号")
+    @ApiModelProperty(value = "凭证号")
+    private java.lang.String pzh;
+	/**业务部门*/
+//	@Excel(name = "业务部门", width = 15)
+    @ExcelProperty(value = "业务部门")
+    @ApiModelProperty(value = "业务部门")
+    private java.lang.String ywbm;
+	/**录入人*/
+//	@Excel(name = "录入人", width = 15)
+    @ExcelProperty(value = "录入人")
+    @ApiModelProperty(value = "录入人")
+    private java.lang.String lrr;
+	/**录入日期*/
+//	@Excel(name = "录入日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
+    @ExcelProperty(value = "录入日期", converter = DateStringConverter.class)
+	@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
+    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
+    @ApiModelProperty(value = "录入日期")
+    private java.util.Date lrrq;
+	/**交易流水号*/
+//	@Excel(name = "交易流水号", width = 15)
+    @ExcelProperty(value = "交易流水号")
+    @ApiModelProperty(value = "交易流水号")
+    private java.lang.String jylsh;
+	/**交易ID*/
+//	@Excel(name = "交易ID", width = 15)
+    @ExcelProperty(value = "交易ID")
+    @ApiModelProperty(value = "交易ID")
+    private java.lang.String jyid;
+	/**汇票号*/
+//	@Excel(name = "汇票号", width = 15)
+    @ExcelProperty(value = "汇票号")
+    @ApiModelProperty(value = "汇票号")
+    private java.lang.String hph;
+	/**汇票ID*/
+//	@Excel(name = "汇票ID", width = 15)
+    @ExcelProperty(value = "汇票ID")
+    @ApiModelProperty(value = "汇票ID")
+    private java.lang.String hpid;
+	/**收款单位*/
+//	@Excel(name = "收款单位", width = 15)
+    @ExcelProperty(value = "收款单位")
+    @ApiModelProperty(value = "收款单位")
+    private java.lang.String skdw;
+	/**数据来源:1合同导入  2收款导入*/
+//	@Excel(name = "数据来源:1合同导入  2收款导入", width = 15)
+    @ApiModelProperty(value = "数据来源:1合同导入  2收款导入")
+    private java.lang.Integer sjly;
+}

+ 17 - 0
module_kzks/src/main/java/org/jeecg/modules/contractIncomeInfoNew/mapper/ContractIncomeInfoNewMapper.java

@@ -0,0 +1,17 @@
+package org.jeecg.modules.contractIncomeInfoNew.mapper;
+
+import java.util.List;
+
+import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.contractIncomeInfoNew.entity.ContractIncomeInfoNew;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @Description: 导入合同、收款表
+ * @Author: jeecg-boot
+ * @Date:   2024-04-08
+ * @Version: V1.0
+ */
+public interface ContractIncomeInfoNewMapper extends BaseMapper<ContractIncomeInfoNew> {
+
+}

+ 5 - 0
module_kzks/src/main/java/org/jeecg/modules/contractIncomeInfoNew/mapper/xml/ContractIncomeInfoNewMapper.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.contractIncomeInfoNew.mapper.ContractIncomeInfoNewMapper">
+
+</mapper>

+ 149 - 0
module_kzks/src/main/java/org/jeecg/modules/contractIncomeInfoNew/monitor/ContractIncomeInfoNewListener.java

@@ -0,0 +1,149 @@
+package org.jeecg.modules.contractIncomeInfoNew.monitor;
+
+import com.alibaba.excel.context.AnalysisContext;
+import com.alibaba.excel.event.AnalysisEventListener;
+import com.alibaba.fastjson.JSONObject;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.shiro.SecurityUtils;
+import org.jeecg.common.system.vo.LoginUser;
+import org.jeecg.modules.contractIncomeInfoNew.entity.ContractIncomeInfoNew;
+import org.jeecg.modules.contractIncomeInfoNew.service.IContractIncomeInfoNewService;
+import org.jeecg.modules.message.websocket.WebSocket;
+import org.jeecg.modules.wzOutboundOrderBNew.entity.WzOutboundOrderBNew;
+import org.jeecg.modules.wzOutboundOrderBNew.service.IWzOutboundOrderBNewService;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * ClassName: ContractIncomeInfoNewListener
+ * Package: org.jeecg.modules.contractIncomeInfoNew.monitor
+ * Description:  监听器
+ *
+ * @Author sl
+ * @Create 2024/4/8 17:06
+ * @Version 1.0
+ */
+@Slf4j
+public class ContractIncomeInfoNewListener extends AnalysisEventListener<ContractIncomeInfoNew> {
+    private IContractIncomeInfoNewService contractIncomeInfoNewService;
+
+    //每隔1000条存储数据库,实际使用中可以3000条,然后清理list,方便内存回收
+    private static final int BATCH_COUNT = 3000;
+    private static final List<ContractIncomeInfoNew> list = new CopyOnWriteArrayList<>(); // 存放合同数据的集合
+    private Integer sjly = 1;
+
+    public ContractIncomeInfoNewListener() {
+    }
+
+    public ContractIncomeInfoNewListener(IContractIncomeInfoNewService contractIncomeInfoNewService, Integer sjly) {
+        this.contractIncomeInfoNewService = contractIncomeInfoNewService;
+        this.sjly = sjly;
+    }
+
+//    public ContractIncomeInfoNewListener(IContractIncomeInfoNewService contractIncomeInfoNewService, WebSocket webSocket) {
+//        this.contractIncomeInfoNewService = contractIncomeInfoNewService;
+//        this.webSocket = webSocket;
+//    }
+
+    @Override
+    public void invoke(ContractIncomeInfoNew contractIncomeInfoNew, AnalysisContext analysisContext){
+//        System.out.println(wzOutboundOrderBNew);
+        contractIncomeInfoNew.setSjly(sjly);
+        list.add(contractIncomeInfoNew);
+//        System.out.println(list);
+        //达到BATCH_COUNT了,需要去存储一次数据库,防止数据几万条数据在内存,容易OOM
+        if(list.size() >= BATCH_COUNT){
+            saveData();
+        }
+    }
+
+
+    @Override
+    public void doAfterAllAnalysed(AnalysisContext analysisContext){
+        //这里也要保存数据,确保最后遗留的数据也存储到数据库
+        saveData();
+        log.info("当前表所有数据解析完成!");
+
+
+    }
+
+    //存储数据库
+    private void saveData() {
+        ExecutorService threadPoolExecutors = Executors.newFixedThreadPool(8);
+        try {
+            log.info("{}条数据,开始存储数据库!", list.size());
+            int sonListSize = list.size() / 8;  // 计算将wzList分成8份之后每个子集合的大小
+
+            List<List<ContractIncomeInfoNew>> sonList = new ArrayList<>(); // 用于存放 子集合 的list
+            for (int i = 0; i < 8; i++) {
+                int startIndex = i * sonListSize;
+                int endIndex = (i + 1) * sonListSize;
+                if (i == 7){  // 避免遗漏数据,最后一个集合取全部数据
+                    endIndex = list.size();
+                }
+                // 根据起始索引、终止索引进行截取
+                List<ContractIncomeInfoNew> listSub = list.subList(startIndex, endIndex);
+                sonList.add(listSub);
+            }
+            // 八个线程同步保存数据
+            if (!sonList.isEmpty()){
+                if (!sonList.get(0).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        contractIncomeInfoNewService.saveBatch(sonList.get(0));
+                    });
+                }
+                if (!sonList.get(1).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        contractIncomeInfoNewService.saveBatch(sonList.get(1));
+                    });
+                }
+                if (!sonList.get(2).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        contractIncomeInfoNewService.saveBatch(sonList.get(2));
+                    });
+                }
+                if (!sonList.get(3).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        contractIncomeInfoNewService.saveBatch(sonList.get(3));
+                    });
+                }
+                if (!sonList.get(4).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        contractIncomeInfoNewService.saveBatch(sonList.get(4));
+                    });
+                }
+                if (!sonList.get(5).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        contractIncomeInfoNewService.saveBatch(sonList.get(5));
+                    });
+                }
+                if (!sonList.get(6).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        contractIncomeInfoNewService.saveBatch(sonList.get(6));
+                    });
+                }
+                if (!sonList.get(7).isEmpty()){
+                    threadPoolExecutors.submit(() -> {
+                        contractIncomeInfoNewService.saveBatch(sonList.get(7));
+                    });
+                }
+            }
+            threadPoolExecutors.shutdown();
+            boolean b = threadPoolExecutors.awaitTermination(5, TimeUnit.HOURS);
+            log.info("数据成功入库");
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        } finally {
+            threadPoolExecutors.shutdown();
+            list.clear();
+        }
+    }
+
+
+
+}

+ 19 - 0
module_kzks/src/main/java/org/jeecg/modules/contractIncomeInfoNew/service/IContractIncomeInfoNewService.java

@@ -0,0 +1,19 @@
+package org.jeecg.modules.contractIncomeInfoNew.service;
+
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.contractIncomeInfoNew.entity.ContractIncomeInfoNew;
+import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.wzOutboundOrderBNew.entity.WzOutboundOrderBNew;
+
+/**
+ * @Description: 导入合同、收款表
+ * @Author: jeecg-boot
+ * @Date:   2024-04-08
+ * @Version: V1.0
+ */
+public interface IContractIncomeInfoNewService extends IService<ContractIncomeInfoNew> {
+
+    /* sjly:数据来源:1合同导入 2收款导入 */
+    Result<?> importExcel1(String strUrl, Class<ContractIncomeInfoNew> clazz, Integer sjly);
+
+}

+ 45 - 0
module_kzks/src/main/java/org/jeecg/modules/contractIncomeInfoNew/service/impl/ContractIncomeInfoNewServiceImpl.java

@@ -0,0 +1,45 @@
+package org.jeecg.modules.contractIncomeInfoNew.service.impl;
+
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelReader;
+import com.alibaba.excel.read.metadata.ReadSheet;
+import lombok.extern.slf4j.Slf4j;
+import org.jeecg.common.api.vo.Result;
+import org.jeecg.modules.contractIncomeInfoNew.entity.ContractIncomeInfoNew;
+import org.jeecg.modules.contractIncomeInfoNew.mapper.ContractIncomeInfoNewMapper;
+import org.jeecg.modules.contractIncomeInfoNew.monitor.ContractIncomeInfoNewListener;
+import org.jeecg.modules.contractIncomeInfoNew.service.IContractIncomeInfoNewService;
+import org.springframework.stereotype.Service;
+
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+import java.io.File;
+
+/**
+ * @Description: 导入合同、收款表
+ * @Author: jeecg-boot
+ * @Date:   2024-04-08
+ * @Version: V1.0
+ */
+@Service
+@Slf4j
+public class ContractIncomeInfoNewServiceImpl extends ServiceImpl<ContractIncomeInfoNewMapper, ContractIncomeInfoNew> implements IContractIncomeInfoNewService {
+
+    /* sjly:数据来源:1合同导入 2收款导入 */
+    @Override
+    public Result<?> importExcel1(String strUrl, Class<ContractIncomeInfoNew> clazz, Integer sjly){
+        long startTime = System.currentTimeMillis();
+//        Object data = new Object();
+        ExcelReader excelReader = EasyExcel.read(new File(strUrl), clazz, new ContractIncomeInfoNewListener(this, sjly)).build();
+//        ExcelReader excelReader = EasyExcel.read(new File(strUrl), Object.class, new ContractIncomeInfoNewListenerC(data, this, sjly)).build();
+        ReadSheet readSheet = EasyExcel.readSheet(0).build();
+        excelReader.read(readSheet);
+        //这里千万别忘记关闭,读的时候会创建临时文件,到时磁盘会崩的
+        excelReader.finish();
+        long endTime = System.currentTimeMillis();
+        log.info("导入物资数据花费时间:{}毫秒 | {}分钟", (endTime - startTime), ((endTime - startTime) / 1000 / 60));
+
+        return Result.ok();
+    }
+
+}

+ 14 - 2
module_kzks/src/main/java/org/jeecg/modules/projectImportList/controller/ProjectImportListController.java

@@ -11,6 +11,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.system.base.controller.JeecgController;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.config.JeecgBaseConfig;
+import org.jeecg.modules.contractIncomeInfoNew.entity.ContractIncomeInfoNew;
+import org.jeecg.modules.contractIncomeInfoNew.service.IContractIncomeInfoNewService;
 import org.jeecg.modules.costModelWxPrice.entity.CostModelWxPrice;
 import org.jeecg.modules.costModelWxPrice.service.ICostModelWxPriceService;
 import org.jeecg.modules.kpiImportList.entity.KpiImportList;
@@ -84,6 +86,10 @@ public class ProjectImportListController extends JeecgController<ProjectImportLi
     @SuppressWarnings("all")
     private IKyTaskInfoNewService kyTaskInfoNewService;
 
+    @Autowired
+    @SuppressWarnings("all")
+    private IContractIncomeInfoNewService contractIncomeInfoNewService;
+
 
     /**
      * 通过excel导入其他表的数据
@@ -124,8 +130,14 @@ public class ProjectImportListController extends JeecgController<ProjectImportLi
         } else if (projectImportList.getFileType().equals("9")) { //导入数据包至服务器
             return result.success("");
         } else if (projectImportList.getFileType().equals("10")){//物资导入
-            //return wzOutboundOrderBNewService.importExcel1(url, WzOutboundOrderBNew.class);
-            return wzOutboundOrderBNewService.importExcelNew(url, WzOutboundOrderBNew.class);
+            return wzOutboundOrderBNewService.importExcel1(url, WzOutboundOrderBNew.class);
+//            return wzOutboundOrderBNewService.importExcelNew(url, WzOutboundOrderBNew.class);
+        } else if (projectImportList.getFileType().equals("16")){//合同导入
+            return contractIncomeInfoNewService.importExcel1(url, ContractIncomeInfoNew.class, 1);
+//            return wzOutboundOrderBNewService.importExcelNew(url, WzOutboundOrderBNew.class);
+        } else if (projectImportList.getFileType().equals("17")){//收款导入
+            return contractIncomeInfoNewService.importExcel1(url, ContractIncomeInfoNew.class, 2);
+//            return wzOutboundOrderBNewService.importExcelNew(url, WzOutboundOrderBNew.class);
         } else if (projectImportList.getFileType().equals("15")){
             return kyTaskInfoNewService.importExcel1(url, KyTaskInfoNew.class);
         } else {