Commit 0e0d3597 authored by 王琮's avatar 王琮

修改核酸采集导入

parent 82e29673
......@@ -10,6 +10,7 @@ import com.ruoyi.common.utils.DictUtils;
import com.ruoyi.system.domain.Gldry;
import com.ruoyi.system.domain.HsjcExportTemplate;
import com.ruoyi.system.domain.Yxry;
import com.ruoyi.system.domain.vo.HscjErrorDto;
import com.ruoyi.system.mapper.SysDictDataMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
......@@ -27,7 +28,7 @@ import org.springframework.web.multipart.MultipartFile;
/**
* 核酸采集Controller
*
*
* @author ruoyi
* @date 2022-11-28
*/
......@@ -125,8 +126,8 @@ public class HscjController extends BaseController
@PreAuthorize("@ss.hasPermi('system:hscj:import')")
@PostMapping("/importData")
public void importHscjData(MultipartFile file,HttpServletResponse response) throws Exception{
ExcelUtil<Hscj> util = new ExcelUtil<Hscj>(Hscj.class);
List<Hscj> dataList = util.importExcel(file.getInputStream());
ExcelUtil<HscjErrorDto> util = new ExcelUtil<HscjErrorDto>(HscjErrorDto.class);
List<HscjErrorDto> dataList = util.importExcel(file.getInputStream());
hscjService.importList(dataList,response);
}
......
......@@ -6,19 +6,20 @@ spring:
druid:
# 主库数据源
master:
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url: jdbc:mysql://124.71.16.228:18085/gxq?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowMultiQueries=true
username: root
password: 111111
password: njk34nj3k423k
# url: jdbc:mysql://health_db:3306/gxq?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8
# username: root
# password: njk34nj3k423k
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
enabled: true
url: jdbc:mysql://127.0.0.1:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2B8&allowMultiQueries=true
username: root
password: wc199921
# 初始连接数
initialSize: 5
# 最小连接池数量
......@@ -38,7 +39,7 @@ spring:
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
webStatFilter:
webStatFilter:
enabled: true
statViewServlet:
enabled: true
......@@ -57,4 +58,4 @@ spring:
merge-sql: true
wall:
config:
multi-statement-allow: true
\ No newline at end of file
multi-statement-allow: true
......@@ -4,9 +4,10 @@ import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.Type;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.data.annotation.Transient;
......@@ -25,7 +26,7 @@ public class Hscj extends BaseEntity
/** 省 */
// 新增字段
@Excel(name = "省")
@Excel(name = "省",type = Type.EXPORT)
private String province;
/** 市 */
......@@ -33,14 +34,14 @@ public class Hscj extends BaseEntity
private String city;
/** 居住地所在区 */
@Excel(name = "居住地所在区", dictType = "residential_area")
@Excel(name = "")
private String area;
/** 街道/镇 */
@Excel(name = "街道/镇")
@Excel(name = "街道")
private String street;
@Excel(name = "居委会")
@Excel(name = "社区")
// 新增字段2
private String committee;
......@@ -60,8 +61,7 @@ public class Hscj extends BaseEntity
@Excel(name = "采集管号", cellType = Excel.ColumnType.STRING)
private String cjgh;
/** 采集管号 */
@Excel(name = "是否混管", readConverterExp = "0=单管,1=混管",combo = {"单管","混管"})
@Excel(name = "是否混管", readConverterExp = "0=单管,1=混管")
private String isHun;
/** 姓名 */
......@@ -69,15 +69,15 @@ public class Hscj extends BaseEntity
private String userName;
/** 身份证号码 */
@Excel(name = "身份证号", cellType = Excel.ColumnType.STRING)
@Excel(name = "身份证号", cellType = Excel.ColumnType.STRING)
private String cardNo;
/** 身份证号码格式校验 */
@Excel(name = "身份证格式校验")
@Excel(name = "身份证格式校验",type = Type.EXPORT)
private String checkCard;
/** 联系方式 */
@Excel(name = "联系方式")
@Excel(name = "电话")
private String phone;
/** 性别 */
......@@ -93,7 +93,7 @@ public class Hscj extends BaseEntity
private Long age;
/** 类别 */
@Excel(name = "人员类别")
@Excel(name = "类别")
private String category;
/** 人员关系 */
......@@ -136,12 +136,7 @@ public class Hscj extends BaseEntity
@Excel(name = "备注")
private String remark;
// 新增字段
// @Excel(name = "居委会")
// private String committee;
/** 状态(0正常 1停用) */
// @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
private String status;
/** 删除标志(0代表存在 2代表删除) */
......@@ -149,8 +144,8 @@ public class Hscj extends BaseEntity
/**创建时间*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
// @Excel(name = "创建时间",dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**导出选中IDLIST */
@Transient()
private List<String> idList;
......
package com.ruoyi.system.domain.vo;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.Type;
import com.ruoyi.system.domain.Hscj;
import org.apache.poi.ss.usermodel.IndexedColors;
public class HscjErrorDto extends Hscj {
@Excel(name = "错误提示", type = Type.EXPORT,color = IndexedColors.RED)
private String error;
public String getError() {
return error;
}
public void setError(String error) {
this.error = error;
}
}
......@@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.Hscj;
import com.ruoyi.system.domain.Yxry;
import com.ruoyi.system.domain.vo.HscjErrorDto;
import org.apache.ibatis.annotations.Param;
/**
......@@ -74,7 +75,7 @@ public interface HscjMapper
List<Hscj> checkCardBatch(List<Hscj> hscjList);
int insertBatch(@Param("list")List<Hscj> list);
int insertBatch(@Param("list")List<HscjErrorDto> list);
int updateBatch(List<Hscj> updateList);
}
......@@ -3,20 +3,21 @@ package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.Hscj;
import com.ruoyi.system.domain.Zlqk;
import com.ruoyi.system.domain.vo.HscjErrorDto;
import javax.servlet.http.HttpServletResponse;
/**
* 核酸采集Service接口
*
*
* @author ruoyi
* @date 2022-11-28
*/
public interface IHscjService
public interface IHscjService
{
/**
* 查询核酸采集
*
*
* @param id 核酸采集主键
* @return 核酸采集
*/
......@@ -24,7 +25,7 @@ public interface IHscjService
/**
* 查询核酸采集列表
*
*
* @param hscj 核酸采集
* @return 核酸采集集合
*/
......@@ -39,7 +40,7 @@ public interface IHscjService
/**
* 新增核酸采集
*
*
* @param hscj 核酸采集
* @return 结果
*/
......@@ -47,7 +48,7 @@ public interface IHscjService
/**
* 修改核酸采集
*
*
* @param hscj 核酸采集
* @return 结果
*/
......@@ -55,7 +56,7 @@ public interface IHscjService
/**
* 批量删除核酸采集
*
*
* @param ids 需要删除的核酸采集主键集合
* @return 结果
*/
......@@ -63,13 +64,13 @@ public interface IHscjService
/**
* 删除核酸采集信息
*
*
* @param id 核酸采集主键
* @return 结果
*/
public int deleteHscjById(Long id);
void importList(List<Hscj> list, HttpServletResponse response);
void importList(List<HscjErrorDto> list, HttpServletResponse response);
List<Hscj> checkCard(Hscj hscj);
}
......@@ -260,7 +260,7 @@
</trim>
</insert>
<insert id="insertBatch" parameterType="com.ruoyi.system.domain.Hscj">
<insert id="insertBatch" parameterType="com.ruoyi.system.domain.vo.HscjErrorDto">
insert into hscj
(committee,province,city,area,street,community,cj_place,cjgh,user_name,card_no,check_card,phone,sex,address,
age,category,cj_time,cj_name,cj_phone,b_type,laboratory,jc_time,cj_result,rygx,boxhao,create_by,create_time,remark,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment