企业端-小程序接口和调试修改

This commit is contained in:
79493 2022-12-14 16:21:56 +08:00
parent 1223757e67
commit ebf8ca0158
6 changed files with 57 additions and 6 deletions

View File

@ -8,6 +8,7 @@ import java.io.Serializable;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
/** /**
* <p> * <p>
* 行业清单 * 行业清单
@ -16,6 +17,7 @@ import io.swagger.annotations.ApiModelProperty;
* @author * @author
* @since 2022-09-20 * @since 2022-09-20
*/ */
@TableName("in_list") @TableName("in_list")
@ApiModel(value="InList对象", description="行业清单") @ApiModel(value="InList对象", description="行业清单")
public class InList implements Serializable { public class InList implements Serializable {

View File

@ -221,6 +221,14 @@
<artifactId>commons-pool2</artifactId> <artifactId>commons-pool2</artifactId>
</dependency> </dependency>
<!-- redis --> <!-- redis -->
<!-- easyExcel -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>easyexcel</artifactId>
<version>3.1.3</version>
</dependency>
<!-- easyExcel -->
</dependencies> </dependencies>
<build> <build>
<plugins> <plugins>

View File

@ -550,6 +550,11 @@ public class BaseController {
@Autowired @Autowired
protected EntPostListDetailMapper entPostListDetailMapper; protected EntPostListDetailMapper entPostListDetailMapper;
@Autowired
protected InListMapper inListMapper;
@Autowired
protected InListItemMapper inListItemMapper;
/** /**
* 新都文件地址处理 * 新都文件地址处理

View File

@ -1,5 +1,8 @@
package com.rzyc.controller; package com.rzyc.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.read.listener.PageReadListener;
import com.alibaba.fastjson.JSON;
import com.common.utils.RandomNumber; import com.common.utils.RandomNumber;
import com.common.utils.StringUtils; import com.common.utils.StringUtils;
import com.common.utils.model.*; import com.common.utils.model.*;
@ -7,10 +10,13 @@ import com.common.utils.upload.FileUpload;
import com.rzyc.bean.file.FileResult; import com.rzyc.bean.file.FileResult;
import com.rzyc.bean.file.FileResults; import com.rzyc.bean.file.FileResults;
import com.rzyc.model.Sysdocument; import com.rzyc.model.Sysdocument;
import com.rzyc.model.ent.InList;
import com.rzyc.service.PcBusinessService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -23,6 +29,14 @@ public class UploadController extends com.rzyc.controller.BaseController {
private static Map<String,String> mFileTypes = new HashMap<String,String>(); private static Map<String,String> mFileTypes = new HashMap<String,String>();
private PcBusinessService pcBusinessService;
@Autowired
public UploadController(PcBusinessService pcBusinessService) {
this.pcBusinessService = pcBusinessService;
}
static { static {
/* 图片文件 start */ /* 图片文件 start */
mFileTypes.put("jpg", "1"); mFileTypes.put("jpg", "1");
@ -291,5 +305,20 @@ public class UploadController extends com.rzyc.controller.BaseController {
/**
* EasyExcel读取
* @return
* @throws Exception
*/
@ApiOperation(value = "EasyExcel读取", notes = "EasyExcel读取")
@ResponseBody
@RequestMapping(value = "/readEasyExcel", method = RequestMethod.GET)
public String readEasyExcel(MultipartFile file)throws Exception{
pcBusinessService.repeatedRead(file);
return "success";
}
} }

View File

@ -1,5 +1,6 @@
package com.rzyc.service; package com.rzyc.service;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.common.utils.*; import com.common.utils.*;
@ -14,7 +15,6 @@ import com.rzyc.config.RedisUtil;
import com.rzyc.controller.BaseController; import com.rzyc.controller.BaseController;
import com.rzyc.enums.DelState; import com.rzyc.enums.DelState;
import com.rzyc.enums.RedisKeys; import com.rzyc.enums.RedisKeys;
import com.rzyc.mapper.EntPostTaskMapper;
import com.rzyc.model.*; import com.rzyc.model.*;
import com.rzyc.model.dto.*; import com.rzyc.model.dto.*;
import com.rzyc.model.ent.EntPost; import com.rzyc.model.ent.EntPost;
@ -23,14 +23,14 @@ import com.rzyc.model.dto.SparePartDto;
import com.rzyc.model.ent.InEntList; import com.rzyc.model.ent.InEntList;
import com.rzyc.model.ent.SysEnterprise; import com.rzyc.model.ent.SysEnterprise;
import org.apache.commons.math3.analysis.function.Sin; import com.rzyc.utils.easyexcel.EasyExcelInList;
import org.junit.Test; import com.rzyc.utils.easyexcel.InListListener;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.text.ParseException; import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -1195,4 +1195,11 @@ public class PcBusinessService extends BaseController {
singleResult.setData(list); singleResult.setData(list);
return singleResult; return singleResult;
} }
public SingleResult repeatedRead(MultipartFile file) throws IOException {
SingleResult singleResult = new SingleResult();
EasyExcel.read(file.getInputStream(), EasyExcelInList.class, new InListListener(inListMapper,inListItemMapper,baseInClassMapper)).doReadAll();
return singleResult;
}
} }

View File

@ -292,7 +292,7 @@ public class PcCompanyController extends com.rzyc.controller.BaseController {
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
Pager<BookEntHT> pager = new Pager<>(); Pager<BookEntHT> pager = new Pager<>();
PageHelper.startPage(page, pageSize); PageHelper.startPage(page, pageSize);
List<BookEntHT>bookEntHTS = bookEntHTMapper.dangerDetailByCompanyId(SysEnterpriseId); List<BookEntHT>bookEntHTS = bookEntHTMapper.dangerDetailByCompanyId(SysEnterpriseId,null);
Page<BookEntHT>bookEnt =(Page<BookEntHT>) bookEntHTS; Page<BookEntHT>bookEnt =(Page<BookEntHT>) bookEntHTS;
getDatePage(pager,bookEnt); getDatePage(pager,bookEnt);
if (bookEntHTS != null){ if (bookEntHTS != null){