Преглед изворни кода

Merge remote-tracking branch 'origin/master'

Administrator пре 3 година
родитељ
комит
400efb60f7
28 измењених фајлова са 608 додато и 77 уклоњено
  1. 122 0
      boman-api/boman-domain/src/main/java/com.boman.domain/YmjzImportErrorLog.java
  2. 4 1
      boman-api/boman-domain/src/main/java/com/boman/domain/VaccineInfoOperation.java
  3. 1 1
      boman-api/boman-domain/src/main/java/com/boman/domain/VaccineInfoUser.java
  4. 11 0
      boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/DateUtils.java
  5. 13 0
      boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/poi/ExcelUtil.java
  6. 13 0
      boman-web-core/src/main/java/com/boman/web/core/controller/ImportExportExcelController.java
  7. 26 26
      boman-web-core/src/main/java/com/boman/web/core/controller/MoveYmjzDataController.java
  8. 2 4
      boman-web-core/src/main/java/com/boman/web/core/controller/VaccineInfoController.java
  9. 1 2
      boman-web-core/src/main/java/com/boman/web/core/controller/VaccineInfoOperationController.java
  10. 3 3
      boman-web-core/src/main/java/com/boman/web/core/mapper/StandardlyMapper.java
  11. 3 2
      boman-web-core/src/main/java/com/boman/web/core/mapper/VaccineInfoMapper.java
  12. 1 1
      boman-web-core/src/main/java/com/boman/web/core/mapper/VaccineInfoOperationMapper.java
  13. 10 3
      boman-web-core/src/main/java/com/boman/web/core/mapper/VaccineInfoUserMapper.java
  14. 15 0
      boman-web-core/src/main/java/com/boman/web/core/mapper/YmjzImportErrorLogMapper.java
  15. 9 0
      boman-web-core/src/main/java/com/boman/web/core/service/excel/IImportExportExcelService.java
  16. 197 3
      boman-web-core/src/main/java/com/boman/web/core/service/excel/ImportExportExcelServiceImpl.java
  17. 1 1
      boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/IVaccineInfoOperationService.java
  18. 1 1
      boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/IVaccineInfoService.java
  19. 1 1
      boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/IVaccineInfoUserService.java
  20. 1 1
      boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoOperationServiceImpl.java
  21. 17 11
      boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoServiceImpl.java
  22. 1 2
      boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoUserServiceImpl.java
  23. 18 0
      boman-web-core/src/main/java/com/boman/web/core/service/ymjz/YmjzImportErrorLogService.java
  24. 23 0
      boman-web-core/src/main/java/com/boman/web/core/service/ymjz/YmjzImportErrorLogServiceImpl.java
  25. 55 6
      boman-web-core/src/main/resources/mapper/VaccineInfoMapper.xml
  26. 4 4
      boman-web-core/src/main/resources/mapper/VaccineInfoOperationMapper.xml
  27. 9 4
      boman-web-core/src/main/resources/mapper/VaccineInfoUserMapper.xml
  28. 46 0
      boman-web-core/src/main/resources/mapper/YmjzImportErrorLogMapper.xml

+ 122 - 0
boman-api/boman-domain/src/main/java/com.boman.domain/YmjzImportErrorLog.java

@@ -0,0 +1,122 @@
+package com.boman.domain;
+
+
+import lombok.Builder;
+
+import java.util.Date;
+
+/**
+ * 疫苗接种导入错误日志
+ */
+@Builder
+public class YmjzImportErrorLog {
+
+    private Long id;
+    private String username;
+    private String place;
+    private String vaccineName;
+    private String jici;
+    private Date vaccinationTime;
+    private String vaccinationPlace;
+    private String isDel;
+    private String createBy;
+    private Date createTime;
+    private String updateBy;
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public String getPlace() {
+        return place;
+    }
+
+    public void setPlace(String place) {
+        this.place = place;
+    }
+
+    public String getVaccineName() {
+        return vaccineName;
+    }
+
+    public void setVaccineName(String vaccineName) {
+        this.vaccineName = vaccineName;
+    }
+
+    public String getJici() {
+        return jici;
+    }
+
+    public void setJici(String jici) {
+        this.jici = jici;
+    }
+
+    public Date getVaccinationTime() {
+        return vaccinationTime;
+    }
+
+    public void setVaccinationTime(Date vaccinationTime) {
+        this.vaccinationTime = vaccinationTime;
+    }
+
+    public String getVaccinationPlace() {
+        return vaccinationPlace;
+    }
+
+    public void setVaccinationPlace(String vaccinationPlace) {
+        this.vaccinationPlace = vaccinationPlace;
+    }
+
+    public String getIsDel() {
+        return isDel;
+    }
+
+    public void setIsDel(String isDel) {
+        this.isDel = isDel;
+    }
+
+    public String getCreateBy() {
+        return createBy;
+    }
+
+    public void setCreateBy(String createBy) {
+        this.createBy = createBy;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public String getUpdateBy() {
+        return updateBy;
+    }
+
+    public void setUpdateBy(String updateBy) {
+        this.updateBy = updateBy;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+}

+ 4 - 1
boman-web-core/src/main/java/com/boman/web/core/domain/VaccineInfoOperation.java → boman-api/boman-domain/src/main/java/com/boman/domain/VaccineInfoOperation.java

@@ -1,4 +1,7 @@
-package com.boman.web.core.domain;
+package com.boman.domain;
+
+import com.boman.domain.annotation.Excel;
+import com.fasterxml.jackson.annotation.JsonFormat;
 
 import java.util.Date;
 import java.util.List;

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/domain/VaccineInfoUser.java → boman-api/boman-domain/src/main/java/com/boman/domain/VaccineInfoUser.java

@@ -1,4 +1,4 @@
-package com.boman.web.core.domain;
+package com.boman.domain;
 
 import com.boman.domain.BaseEntity;
 import com.boman.domain.annotation.Excel;

+ 11 - 0
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/DateUtils.java

@@ -49,6 +49,17 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
         return new Date();
     }
 
+    public static Date formatDate(String dateStr) {
+        SimpleDateFormat format = new SimpleDateFormat(YYYY_MM_DD_HH_MM_SS);
+        try {
+            return format.parse(dateStr);
+        } catch (ParseException e) {
+            e.printStackTrace();
+        }
+
+        return null;
+    }
+
     public static Date addDayOfDate(Date date,int i){
         Calendar c = Calendar.getInstance();
         c.setTime(date);

+ 13 - 0
boman-common/boman-common-core/src/main/java/com/boman/common/core/utils/poi/ExcelUtil.java

@@ -346,6 +346,19 @@ public class ExcelUtil<T>
         return dataList;
     }
 
+    /**
+     * 功能描述: 读取excel种的数据
+     *
+     * @param sheetName sheetName
+     * @param is        inputStream
+     * @return java.util.List<com.alibaba.fastjson.JSONObject>
+     */
+    public Sheet importExcel4Ymjz(String sheetName, InputStream is) throws Exception {
+        this.type = Type.IMPORT;
+        this.wb = WorkbookFactory.create(is);
+        return getSheet(sheetName);
+    }
+
     private Sheet getSheet(String sheetName) throws IOException {
         Sheet sheet;
         if (StringUtils.isNotEmpty(sheetName)) {

+ 13 - 0
boman-web-core/src/main/java/com/boman/web/core/controller/ImportExportExcelController.java

@@ -8,6 +8,7 @@ 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;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import java.util.List;
@@ -31,5 +32,17 @@ public class ImportExportExcelController {
         return service.importCommonData(tableName, dataList);
     }
 
+    /**
+     * 功能描述: 导入疫苗接种数据
+     *
+     * @param file file
+     * @return com.boman.domain.dto.AjaxResult
+     */
+    @PostMapping("/importYmjz")
+    public AjaxResult importYmjz(MultipartFile file) throws Exception{
+        return AjaxResult.success(service.importYmjz(file));
+    }
+
+
 
 }

+ 26 - 26
boman-web-core/src/main/java/com/boman/web/core/controller/MoveYmjzDataController.java

@@ -1,7 +1,7 @@
 package com.boman.web.core.controller;
 
 import com.alibaba.fastjson.JSONObject;
-import com.boman.web.core.domain.VaccineInfoOperation;
+import com.boman.domain.VaccineInfoOperation;
 import com.boman.web.core.mapper.StandardlyMapper;
 import com.boman.web.core.service.vaccineInfo.IVaccineInfoService;
 import com.boman.web.core.service.vaccineInfo.impl.VaccineInfoServiceImpl;
@@ -100,36 +100,36 @@ public class MoveYmjzDataController {
                 stringBuilder.append(insert);
                 System.err.println("count: " + i + ", " + insert);
             } else {
-//                idCard = info.getIdCard();
-//                Integer age = 0;
-//                try {
-//                    age = VaccineInfoServiceImpl.getAge(info.getIdCard());
-//                } catch (Exception e) {
-//                    age = null;
-//                }
-//                VaccineInfoServiceImpl.shouldSlow(info);
-//                String update = String.format("UPDATE vaccine_info " +
-//                                "set code = '%s', crowd_classification = '%s', vaccine_name = '%s', manufacturer = '%s'" +
-//                                ", jici = '%s', vaccination_time = '%s', age = '%s', birthday = '%s', progress = '%s'" +
-//                                ", dept_id = '%s', `is_vaccination` = '是', `should_be` = '%s', `should_slow` = '%s' " +
-//                                "where code = '%s' or (id_card like '%s' and user_name like '%s' ); -- %s \r\n"
-//                        , 受种者编码, 人群分类, 生产厂家, 生产厂家
-//                        , 接种针次, 接种日期, age, 出生日期, progress
-//                        , info.getDeptId(), Strings.nullToEmpty(info.getShouldBe()), Strings.nullToEmpty(info.getShouldSlow()),
-//                        受种者编码, "%" + split[1] + "%", "%" + 受种者姓名 + "%",i);
-//                stringBuilder.append(update);
-//                System.err.println("count: " + i + ", " + update);
+                idCard = info.getIdCard();
+                Integer age = 0;
+                try {
+                    age = VaccineInfoServiceImpl.getAge(info.getIdCard());
+                } catch (Exception e) {
+                    age = null;
+                }
+                VaccineInfoServiceImpl.shouldSlow(info);
+                String update = String.format("UPDATE vaccine_info " +
+                                "set code = '%s', crowd_classification = '%s', vaccine_name = '%s', manufacturer = '%s'" +
+                                ", jici = '%s', vaccination_time = '%s', age = '%s', birthday = '%s', progress = '%s'" +
+                                ", dept_id = '%s', `is_vaccination` = '是', `should_be` = '%s', `should_slow` = '%s' " +
+                                "where code = '%s' or (id_card like '%s' and user_name like '%s' ); -- %s \r\n"
+                        , 受种者编码, 人群分类, 生产厂家, 生产厂家
+                        , 接种针次, 接种日期, age, 出生日期, progress
+                        , info.getDeptId(), Strings.nullToEmpty(info.getShouldBe()), Strings.nullToEmpty(info.getShouldSlow()),
+                        受种者编码, "%" + split[1] + "%", "%" + 受种者姓名 + "%",i);
+                stringBuilder.append(update);
+                System.err.println("count: " + i + ", " + update);
             }
 
-//            Long maxId = IdUtils.getMaxId("vaccine_info_user", "id");
-//            String userInsert = String.format("insert into vaccine_info_user (id, id_card, vaccine_name, jici, vaccination_time, vaccination_place) " +
-//                    "values('%s', '%s', '%s', '%s', '%s', '%s');\r\n", maxId, idCard, 生产厂家, 接种针次, 接种日期, 接种单位);
-//            stringBuilder.append(userInsert);
-//            System.err.println("vaccine_info_user count: " + i + ", " + userInsert);
+            Long maxId = IdUtils.getMaxId("vaccine_info_user", "id");
+            String userInsert = String.format("insert into vaccine_info_user (id, id_card, vaccine_name, jici, vaccination_time, vaccination_place) " +
+                    "values('%s', '%s', '%s', '%s', '%s', '%s');\r\n", maxId, idCard, 生产厂家, 接种针次, 接种日期, 接种单位);
+            stringBuilder.append(userInsert);
+            System.err.println("vaccine_info_user count: " + i + ", " + userInsert);
         }
 
 //        File file = new File("F:\\desk\\ymjz\\jmjl2021-09-18.sql");
-        File file = new File("/usr/local/sql/jmjl2021-09-18-1.sql");
+        File file = new File("/usr/local/sql/jmjl2021-09-24.sql");
         if (!file.exists()) {
             file.createNewFile();
         }

+ 2 - 4
boman-web-core/src/main/java/com/boman/web/core/controller/VaccineInfoController.java

@@ -9,13 +9,11 @@ import com.boman.common.core.utils.StringUtils;
 import com.boman.common.core.utils.poi.ExcelUtil;
 import com.boman.common.core.web.controller.BaseController;
 import com.boman.common.core.web.page.TableDataInfo;
-import com.boman.common.datascope.annotation.DataScope;
 import com.boman.common.log.annotation.Log;
 import com.boman.common.log.enums.BusinessType;
-import com.boman.common.security.annotation.PreAuthorize;
 import com.boman.domain.dto.AjaxResult;
-import com.boman.web.core.domain.VaccineInfoOperation;
-import com.boman.web.core.domain.VaccineInfoUser;
+import com.boman.domain.VaccineInfoOperation;
+import com.boman.domain.VaccineInfoUser;
 import com.boman.web.core.service.vaccineInfo.IVaccineInfoService;
 import com.boman.web.core.service.vaccineInfo.IVaccineInfoUserService;
 import org.springframework.beans.factory.annotation.Autowired;

+ 1 - 2
boman-web-core/src/main/java/com/boman/web/core/controller/VaccineInfoOperationController.java

@@ -9,7 +9,6 @@ import com.boman.common.core.web.controller.BaseController;
 import com.boman.common.core.web.page.TableDataInfo;
 import com.boman.common.log.annotation.Log;
 import com.boman.common.log.enums.BusinessType;
-import com.boman.common.security.annotation.PreAuthorize;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.web.core.service.vaccineInfo.IVaccineInfoOperationService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -21,7 +20,7 @@ import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
-import com.boman.web.core.domain.VaccineInfoOperation;
+import com.boman.domain.VaccineInfoOperation;
 
 import javax.servlet.http.HttpServletResponse;
 

+ 3 - 3
boman-web-core/src/main/java/com/boman/web/core/mapper/StandardlyMapper.java

@@ -1,7 +1,7 @@
 package com.boman.web.core.mapper;
 
 import com.alibaba.fastjson.JSONObject;
-import com.boman.web.core.domain.VaccineInfoOperation;
+import com.boman.domain.VaccineInfoOperation;
 import com.boman.web.core.utils.ColumnUtils;
 import com.google.common.collect.Lists;
 import org.apache.commons.lang3.StringUtils;
@@ -90,8 +90,8 @@ public interface StandardlyMapper {
     @Select({"select * from vaccination_statistic where is_del = 'N' and xz = #{deptName}"})
     List<JSONObject> list1(@Param("deptName") String deptName);
 
-    @Update({"update vaccination_statistic set is_del = 'Y'"})
-    int updateAll();
+    @Update({"update vaccination_statistic set is_del = 'Y' where create_by = #{username}"})
+    int updateAll(@Param("username") String username);
 
     @Select("select * from ymjz20210923")
     List<JSONObject> selectAll();

+ 3 - 2
boman-web-core/src/main/java/com/boman/web/core/mapper/VaccineInfoMapper.java

@@ -1,7 +1,6 @@
 package com.boman.web.core.mapper;
 
-import com.boman.common.datasource.annotation.Slave;
-import com.boman.web.core.domain.VaccineInfoOperation;
+import com.boman.domain.VaccineInfoOperation;
 
 import java.util.List;
 
@@ -58,6 +57,8 @@ public interface VaccineInfoMapper
      */
     public int updateVaccineInfo(VaccineInfoOperation vaccineInfo);
 
+    int update(VaccineInfoOperation info);
+
     /**
      * 删除疫苗信息
      * 

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/mapper/VaccineInfoOperationMapper.java

@@ -1,7 +1,7 @@
 package com.boman.web.core.mapper;
 
 import java.util.List;
-import com.boman.web.core.domain.VaccineInfoOperation;
+import com.boman.domain.VaccineInfoOperation;
 
 /**
  * 疫苗信息操作Mapper接口

+ 10 - 3
boman-web-core/src/main/java/com/boman/web/core/mapper/VaccineInfoUserMapper.java

@@ -1,11 +1,9 @@
 package com.boman.web.core.mapper;
 
 import com.alibaba.fastjson.JSONObject;
-import com.boman.web.core.domain.VaccineInfoOperation;
-import com.boman.web.core.domain.VaccineInfoUser;
+import com.boman.domain.VaccineInfoUser;
 import org.apache.ibatis.annotations.Param;
 
-import java.util.Date;
 import java.util.List;
 
 /**
@@ -66,4 +64,13 @@ public interface VaccineInfoUserMapper {
     int listBy1jici();
 
     List<JSONObject> todayCnt(@Param("todayStart") String todayStart, @Param("todayEnd") String todayEnd);
+
+    /**
+     * 功能描述: 根据身份证和接种计次查询
+     *
+     * @param sfz  sfz
+     * @param jzjc jzjc
+     * @return int
+     */
+    int countByIdCardAndJici(@Param("sfz") String sfz, @Param("jzjc") String jzjc);
 }

+ 15 - 0
boman-web-core/src/main/java/com/boman/web/core/mapper/YmjzImportErrorLogMapper.java

@@ -0,0 +1,15 @@
+package com.boman.web.core.mapper;
+
+import com.boman.domain.YmjzImportErrorLog;
+
+public interface YmjzImportErrorLogMapper {
+
+    /**
+     * 功能描述: insert错误日志
+     *
+     * @param errorLog errorLog
+     * @return int
+     */
+    int insertErrorLog(YmjzImportErrorLog errorLog);
+
+}

+ 9 - 0
boman-web-core/src/main/java/com/boman/web/core/service/excel/IImportExportExcelService.java

@@ -2,6 +2,7 @@ package com.boman.web.core.service.excel;
 
 import com.alibaba.fastjson.JSONObject;
 import com.boman.domain.dto.AjaxResult;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.List;
 
@@ -19,4 +20,12 @@ public interface IImportExportExcelService {
      * @return void
      */
     AjaxResult importCommonData(String tableName, List<JSONObject> dataList);
+
+    /**
+     * 功能描述: 导入疫苗接种数据
+     *
+     * @param file
+     * @return java.lang.Object
+     */
+    String importYmjz(MultipartFile file) throws Exception;
 }

+ 197 - 3
boman-web-core/src/main/java/com/boman/web/core/service/excel/ImportExportExcelServiceImpl.java

@@ -1,17 +1,36 @@
 package com.boman.web.core.service.excel;
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
+import com.boman.common.core.utils.DateUtils;
+import com.boman.common.core.utils.SecurityUtils;
+import com.boman.common.core.utils.poi.ExcelUtil;
+import com.boman.domain.VaccineInfoOperation;
+import com.boman.domain.VaccineInfoUser;
+import com.boman.domain.YmjzImportErrorLog;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.domain.dto.FormDataDto;
+import com.boman.domain.utils.ThreadPoolService;
+import com.boman.web.core.mapper.StandardlyMapper;
+import com.boman.web.core.mapper.VaccineInfoMapper;
+import com.boman.web.core.mapper.VaccineInfoUserMapper;
 import com.boman.web.core.service.TableServiceCmdService;
-import com.boman.web.core.service.save.IBaseSaveService;
+import com.boman.web.core.service.vaccineInfo.impl.VaccineInfoServiceImpl;
+import com.boman.web.core.service.ymjz.YmjzImportErrorLogService;
+import com.boman.web.core.utils.IdUtils;
+import org.apache.poi.ss.usermodel.Row;
+import org.apache.poi.ss.usermodel.Sheet;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 
-import static com.boman.common.core.utils.obj.ObjectUtils.*;
+import static com.boman.common.core.utils.obj.ObjectUtils.requireNonNull;
 
 /**
  * @author shiqian
@@ -20,10 +39,18 @@ import static com.boman.common.core.utils.obj.ObjectUtils.*;
 @Service
 public class ImportExportExcelServiceImpl implements IImportExportExcelService {
 
+    private static final Logger LOGGER = LoggerFactory.getLogger(ImportExportExcelServiceImpl.class);
+
     @Resource
-    private IBaseSaveService saveService;
+    private StandardlyMapper mapper;
     @Resource
     private TableServiceCmdService cmdService;
+    @Resource
+    private VaccineInfoMapper vaccineInfoMapper;
+    @Resource
+    private VaccineInfoUserMapper vaccineInfoUserMapper;
+    @Resource
+    private YmjzImportErrorLogService errorLogService;
 
 
     /**
@@ -62,5 +89,172 @@ public class ImportExportExcelServiceImpl implements IImportExportExcelService {
         return AjaxResult.success("成功", result);
     }
 
+    @Override
+    public String importYmjz(MultipartFile file) throws Exception {
+        ExcelUtil<VaccineInfoOperation> util = new ExcelUtil<>(VaccineInfoOperation.class);
+        Sheet sheet = util.importExcel4Ymjz("", file.getInputStream());
+        int rows = sheet.getPhysicalNumberOfRows();
+        String username = SecurityUtils.getUsername();
+        ThreadPoolService.execute(() -> {
+            // 往data中赋值
+            for (int i = 1; i < rows; i++) {
+                saveRel(sheet.getRow(i), i, username);
+            }
+        });
+
+        String msg = "数据导入中,系统将自动处理数据,%s后请查看结果。";
+        if (rows <= 1000) {
+            msg = String.format(msg, "20分钟");
+        } else if (rows >= 5000 && rows <= 10000) {
+            msg = String.format(msg, "1小时");
+        } else if (rows > 10000 && rows <= 50000) {
+            msg = String.format(msg, "2小时");
+        } else {
+            msg = String.format(msg, "4小时");
+        }
+
+        return msg;
+    }
+
+    private void saveRel(Row row, int i, String username) {
+        // excel 14列
+        // 身份证
+        String sfz = row.getCell(4).getStringCellValue();
+        String[] split = sfz.split("\\**\\**\\**\\**\\*");
+        // 受种者编码
+        String szzbm = row.getCell(0).getStringCellValue();
+        // 受种者姓名
+        String szzxm = row.getCell(1).getStringCellValue();
+        // 生产厂家
+        String sccj = row.getCell(11).getStringCellValue();
+        // 接种针次
+        String jzjc = row.getCell(12).getStringCellValue();
+        // 受种者性别
+        String xb = row.getCell(2).getStringCellValue();
+        // 出生日期
+        String csrq = row.getCell(3).getStringCellValue();
+        // 电话号码
+        String dhhm = row.getCell(5).getStringCellValue();
+        // 住址
+        String place = row.getCell(6).getStringCellValue();
+        // 工作单位
+        String gzdw = row.getCell(7).getStringCellValue();
+        // 人群分类
+        String rqfl = row.getCell(8).getStringCellValue();
+        // 接种单位
+        String jzdw = row.getCell(9).getStringCellValue();
+        // 接种日期
+        String jzsj = row.getCell(13).getStringCellValue();
+        VaccineInfoOperation in = mapper.getByCode(szzbm, "%" + split[1] + "%", "%" + szzxm + "%");
+        String progress = VaccineInfoServiceImpl.getIsSuccess(sccj, jzjc);
+        Date now = new Date();
+        if (in == null) {
+            in = new VaccineInfoOperation();
+            Long maxId = IdUtils.getMaxId("vaccine_info", "id");
+            in.setId(maxId);
+            in.setUserName(szzxm);
+            in.setGender(xb);
+            in.setIdCard(sfz);
+            in.setPhoneNum(dhhm);
+            in.setIsVaccination("是");
+            in.setVaccineName(sccj);
+            in.setJici(jzjc);
+            in.setVaccinationTime(DateUtils.formatDate(jzsj));
+            in.setVaccinationPlace(jzdw);
+            in.setShouldBe("是");
+            in.setProgress(progress);
+            in.setShouldSlow("否");
+            in.setCode(szzbm);
+            in.setBirthday(csrq);
+            in.setWorkUnit(gzdw);
+            in.setCrowdClassification(rqfl);
+            in.setManufacturer(sccj);
+            in.setAge(0);
+            in.setDeptId(1L);
+            in.setStatus("2");
+            in.setCreateBy(username);
+            in.setUpdateBy(username);
+            in.setCreateTime(now);
+            in.setUpdateTime(now);
+            try {
+                vaccineInfoMapper.insertVaccineInfo(in);
+            } catch (Exception e) {
+                YmjzImportErrorLog log = YmjzImportErrorLog.builder()
+                        .id(IdUtils.getMaxId("ymjz_import_error_log", "id"))
+                        .username(szzxm).place(place).vaccineName(sccj).jici(jzjc).vaccinationTime(DateUtils.formatDate(jzsj))
+                        .vaccinationPlace(jzdw).createBy(username).updateBy(username).createTime(now).updateTime(now).build();
+                errorLogService.insertErrorLog(log);
+                e.printStackTrace();
+            }
+
+            LOGGER.info("count: {}, info insert: [{}]", i, JSON.toJSONString(in));
+        } else {
+            sfz = in.getIdCard();
+            Integer age;
+            try {
+                age = VaccineInfoServiceImpl.getAge(in.getIdCard());
+            } catch (Exception e) {
+                age = null;
+            }
 
+            VaccineInfoServiceImpl.shouldSlow(in);
+            in.setCode(szzbm);
+            in.setCrowdClassification(rqfl);
+            in.setVaccineName(sccj);
+            in.setManufacturer(sccj);
+            in.setJici(jzjc);
+            in.setVaccinationTime(DateUtils.formatDate(jzsj));
+            in.setBirthday(csrq);
+            in.setProgress(progress);
+            in.setVaccinationPlace(jzdw);
+            in.setIdCard(split[1]);
+            in.setUserName(szzxm);
+            in.setAge(age);
+            in.setUpdateTime(now);
+            in.setUpdateBy(username);
+            try {
+                vaccineInfoMapper.update(in);
+            } catch (Exception e) {
+                YmjzImportErrorLog log = YmjzImportErrorLog.builder()
+                        .id(IdUtils.getMaxId("ymjz_import_error_log", "id"))
+                        .username(szzxm).place(place).vaccineName(sccj).jici(jzjc).vaccinationTime(DateUtils.formatDate(jzsj))
+                        .vaccinationPlace(jzdw).createBy(username).updateBy(username).createTime(now).updateTime(now).build();
+                errorLogService.insertErrorLog(log);
+                e.printStackTrace();
+            }
+            LOGGER.info("count: {}, info update: [{}]", i, JSON.toJSONString(in));
+        }
+
+        // 防止重复导入
+        if (!sfz.contains("\\**")) {
+            int count = vaccineInfoUserMapper.countByIdCardAndJici(sfz, jzjc);
+            if (count > 0) {
+                return;
+            }
+        }
+
+        Long maxId = IdUtils.getMaxId("vaccine_info_user", "id");
+        VaccineInfoUser user = new VaccineInfoUser();
+        user.setId(maxId);
+        user.setIdCard(sfz);
+        user.setVaccineName(sccj);
+        user.setJici(jzjc);
+        user.setVaccinationTime(DateUtils.formatDate(jzsj));
+        user.setVaccinationPlace(jzdw);
+        user.setCreateBy(username);
+        user.setUpdateBy(username);
+        user.setUpdateTime(now);
+        user.setCreateTime(now);
+        try {
+            vaccineInfoUserMapper.insertVaccineInfoUser(user);
+        } catch (Exception e) {
+            YmjzImportErrorLog log = YmjzImportErrorLog.builder()
+                    .id(IdUtils.getMaxId("ymjz_import_error_log", "id"))
+                    .username(szzxm).place(place).vaccineName(sccj).jici(jzjc).vaccinationTime(DateUtils.formatDate(jzsj))
+                    .vaccinationPlace(jzdw).createBy(username).updateBy(username).createTime(now).updateTime(now).build();
+            errorLogService.insertErrorLog(log);
+            e.printStackTrace();
+        }
+        LOGGER.info("count: {}, vaccine user: [{}]", i, JSON.toJSONString(user));
+    }
 }

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/IVaccineInfoOperationService.java

@@ -1,7 +1,7 @@
 package com.boman.web.core.service.vaccineInfo;
 
 import java.util.List;
-import com.boman.web.core.domain.VaccineInfoOperation;
+import com.boman.domain.VaccineInfoOperation;
 
 /**
  * 疫苗信息操作Service接口

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/IVaccineInfoService.java

@@ -2,7 +2,7 @@ package com.boman.web.core.service.vaccineInfo;
 
 import com.alibaba.fastjson.JSONObject;
 import com.boman.domain.dto.AjaxResult;
-import com.boman.web.core.domain.VaccineInfoOperation;
+import com.boman.domain.VaccineInfoOperation;
 
 import java.util.List;
 

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/IVaccineInfoUserService.java

@@ -1,7 +1,7 @@
 package com.boman.web.core.service.vaccineInfo;
 
 import com.alibaba.fastjson.JSONObject;
-import com.boman.web.core.domain.VaccineInfoUser;
+import com.boman.domain.VaccineInfoUser;
 
 import java.util.List;
 

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoOperationServiceImpl.java

@@ -7,7 +7,7 @@ import com.boman.web.core.service.vaccineInfo.IVaccineInfoOperationService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.boman.web.core.mapper.VaccineInfoOperationMapper;
-import com.boman.web.core.domain.VaccineInfoOperation;
+import com.boman.domain.VaccineInfoOperation;
 
 /**
  * 疫苗信息操作Service业务层处理

+ 17 - 11
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoServiceImpl.java

@@ -10,20 +10,18 @@ import com.boman.common.core.utils.obj.ObjectUtils;
 import com.boman.common.core.utils.sql.SqlUtil;
 import com.boman.common.core.web.page.PageDomain;
 import com.boman.common.core.web.page.TableSupport;
-import com.boman.common.datascope.annotation.DataScope;
 import com.boman.domain.SysDept;
 import com.boman.domain.dto.AjaxResult;
 import com.boman.system.api.RemoteDeptService;
 import com.boman.system.api.RemoteDictDataService;
-import com.boman.web.core.domain.VaccineInfoOperation;
-import com.boman.web.core.domain.VaccineInfoUser;
+import com.boman.domain.VaccineInfoOperation;
+import com.boman.domain.VaccineInfoUser;
 import com.boman.web.core.mapper.StandardlyMapper;
 import com.boman.web.core.mapper.VaccineInfoMapper;
 import com.boman.web.core.mapper.VaccineInfoOperationMapper;
 import com.boman.web.core.mapper.VaccineInfoUserMapper;
 import com.boman.web.core.service.save.IBaseSaveService;
 import com.boman.web.core.service.vaccineInfo.IVaccineInfoService;
-import com.boman.web.core.service.vaccineInfo.IVaccineInfoUserService;
 import com.boman.web.core.utils.AuthUtils;
 import com.boman.web.core.utils.IdUtils;
 import com.boman.web.core.utils.VaccineUtils;
@@ -35,8 +33,6 @@ import org.springframework.transaction.annotation.Isolation;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.Size;
 import java.sql.Timestamp;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -168,7 +164,9 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
                 }
             }
             vaccineInfoOperation.setDeptIdList(deptIdList);
+            LOGGER.info("查询开始");
             vaccineInfoOperations = vaccineInfoMapper.selectVaccineInfoList(vaccineInfoOperation);
+            LOGGER.info("查询结束");
         }
         if (vaccineInfoOperations != null && vaccineInfoOperations.size() > 0) {
             for (VaccineInfoOperation infoOperation : vaccineInfoOperations) {
@@ -465,7 +463,12 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
             } else {
                 return "否";
             }
+        } else if ("康希诺生物".equals(vaccineName)) {
+            if ("1".equals(jici)) {
+                return "是";
+            }
         }
+
         return "否";
     }
 
@@ -799,6 +802,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
                 }
             }
         }
+
         return age;
     }
 
@@ -896,8 +900,8 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
     @Override
     @Transactional(isolation = Isolation.READ_COMMITTED, rollbackFor = Exception.class)
     public AjaxResult statistic() {
-        List<JSONObject> result = new ArrayList<>(17);
         List<SysDept> allTowns = remoteDeptService.getByParentId(1L);
+        List<JSONObject> result = new ArrayList<>(allTowns.size());
         List<String> townNameList = ObjectUtils.map(allTowns, SysDept::getDeptName);
 
         LOGGER.info("开始查询");
@@ -905,7 +909,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
         List<VaccineInfoOperation> infoList = vaccineInfoMapper.listByTotalTaskCnt();
         LOGGER.info("查询用时: {} s", (System.currentTimeMillis() - l) / 1000);
         // 暂且如此
-        standardlyMapper.updateAll();
+        standardlyMapper.updateAll(SecurityUtils.getUsername());
         Date todayStart = DateUtils.getTodayStart(), todayEnd = DateUtils.getTodayEnd();
         for (String townName : townNameList) {
             int zrws = 0, zjzs = 0, drrws = 0, drjzs = 0, dez = 0, dsz = 0;
@@ -941,7 +945,7 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
                 // 接种时间和接种疫苗种类判断 当日任务数
                 if (null != vaccinationTime) {
                     String vaccineName = info.getVaccineName();
-                    judgeTodayTask(vaccineName, vaccinationTime, drrws, todayStart, todayEnd);
+                    drrws = judgeTodayTask(vaccineName, vaccinationTime, drrws, todayStart, todayEnd);
                 }
             }
 
@@ -969,15 +973,17 @@ public class VaccineInfoServiceImpl implements IVaccineInfoService {
         return AjaxResult.success("成功", result);
     }
 
-    private void judgeTodayTask(String vaccineName, Date vaccinationTime, int drrws, Date todayStart, Date todayEnd) {
+    private int judgeTodayTask(String vaccineName, Date vaccinationTime, int drrws, Date todayStart, Date todayEnd) {
         Date nextTime = VaccineUtils.getNextTime(vaccineName, vaccinationTime);
         if (nextTime == null) {
-            return;
+            return drrws;
         }
 
         if (nextTime.before(todayEnd) && nextTime.after(todayStart)) {
             drrws++;
         }
+
+        return drrws;
     }
 
     @Override

+ 1 - 2
boman-web-core/src/main/java/com/boman/web/core/service/vaccineInfo/impl/VaccineInfoUserServiceImpl.java

@@ -2,7 +2,7 @@ package com.boman.web.core.service.vaccineInfo.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.boman.common.core.utils.StringUtils;
-import com.boman.web.core.domain.VaccineInfoUser;
+import com.boman.domain.VaccineInfoUser;
 import com.boman.web.core.mapper.SyncMapper;
 import com.boman.web.core.mapper.VaccineInfoUserMapper;
 import com.boman.web.core.service.TableServiceCmdService;
@@ -14,7 +14,6 @@ import org.springframework.stereotype.Service;
 import javax.annotation.Resource;
 import java.text.SimpleDateFormat;
 import java.util.*;
-import java.util.stream.Collectors;
 
 
 /**

+ 18 - 0
boman-web-core/src/main/java/com/boman/web/core/service/ymjz/YmjzImportErrorLogService.java

@@ -0,0 +1,18 @@
+package com.boman.web.core.service.ymjz;
+
+import com.boman.domain.YmjzImportErrorLog;
+
+/**
+ * @author shiqian
+ * @date 2021年09月29日 15:52
+ **/
+public interface YmjzImportErrorLogService {
+
+    /**
+     * 功能描述: insert错误日志
+     *
+     * @param errorLog errorLog
+     * @return int
+     */
+    int insertErrorLog(YmjzImportErrorLog errorLog);
+}

+ 23 - 0
boman-web-core/src/main/java/com/boman/web/core/service/ymjz/YmjzImportErrorLogServiceImpl.java

@@ -0,0 +1,23 @@
+package com.boman.web.core.service.ymjz;
+
+import com.boman.domain.YmjzImportErrorLog;
+import com.boman.web.core.mapper.YmjzImportErrorLogMapper;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+/**
+ * @author shiqian
+ * @date 2021年09月29日 15:53
+ **/
+@Service
+public class YmjzImportErrorLogServiceImpl implements YmjzImportErrorLogService{
+
+    @Resource
+    private YmjzImportErrorLogMapper mapper;
+
+    @Override
+    public int insertErrorLog(YmjzImportErrorLog errorLog) {
+        return mapper.insertErrorLog(errorLog);
+    }
+}

+ 55 - 6
boman-web-core/src/main/resources/mapper/VaccineInfoMapper.xml

@@ -4,7 +4,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.boman.web.core.mapper.VaccineInfoMapper">
     
-    <resultMap type="VaccineInfoOperation" id="VaccineInfoResult">
+    <resultMap type="com.boman.domain.VaccineInfoOperation" id="VaccineInfoResult">
         <result property="id"    column="id"    />
         <result property="villageTowns"    column="village_towns" />
         <result property="village"    column="village"    />
@@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <collection  property="vaccineInfoUserList"   javaType="java.util.List"        resultMap="VaccineInfoUser" />
     </resultMap>
 
-    <resultMap id="VaccineInfoUser" type="com.boman.web.core.domain.VaccineInfoUser">
+    <resultMap id="VaccineInfoUser" type="com.boman.domain.VaccineInfoUser">
         <id     property="id"       column="id_user"        />
         <result property="idCard"     column="id_card_user"      />
         <result property="vaccineName"      column="vaccine_name_user"       />
@@ -75,7 +75,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
                on vi.id_card = viu.id_card and viu.is_del = 'N'
     </sql>
 
-    <select id="selectVaccineInfoList" parameterType="VaccineInfoOperation" resultMap="VaccineInfoResult">
+    <select id="selectVaccineInfoList"  resultMap="VaccineInfoResult">
         select vi.id, vi.village_towns, vi.village, vi.villager_group,vi.age, vi.house_type, vi.domicile, vi.province, vi.city,vi.should_slow,
         vi.region, vi.user_name, vi.gender, vi.id_card, vi.phone_num, vi.key_industries, vi.is_vaccination, vi.vaccine_name, vi.jici,
         vi.vaccination_time, vi.vaccination_place, vi.contraindication, vi.suspend,vi.suspend_url,vi.other_url,vi.vaccination_time,
@@ -158,7 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         and vi.is_del = 'N'
     </select>
         
-    <insert id="insertVaccineInfo" parameterType="VaccineInfoOperation" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertVaccineInfo"  useGeneratedKeys="true" keyProperty="id">
         insert into vaccine_info
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="villageTowns != null">village_towns,</if>
@@ -250,7 +250,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
     </insert>
 
-    <update id="updateVaccineInfo" parameterType="VaccineInfoOperation">
+    <update id="updateVaccineInfo" >
         update vaccine_info
         <trim prefix="SET" suffixOverrides=",">
             <if test="villageTowns != null">village_towns = #{villageTowns},</if>
@@ -299,6 +299,55 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where id = #{id}
     </update>
 
+    <update id="update" >
+        update vaccine_info
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="villageTowns != null">village_towns = #{villageTowns},</if>
+            <if test="village != null">village = #{village},</if>
+            <if test="villagerGroup != null">villager_group = #{villagerGroup},</if>
+            <if test="houseType != null">house_type = #{houseType},</if>
+            <if test="domicile != null">domicile = #{domicile},</if>
+            <if test="province != null">province = #{province},</if>
+            <if test="city != null">city = #{city},</if>
+            <if test="region != null and region != ''">region = #{region},</if>
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="gender != null">gender = #{gender},</if>
+<!--            <if test="idCard != null">id_card = #{idCard},</if>-->
+            <if test="phoneNum != null">phone_num = #{phoneNum},</if>
+            <if test="keyIndustries != null">key_industries = #{keyIndustries},</if>
+            <if test="isVaccination != null">is_vaccination = #{isVaccination},</if>
+            <if test="vaccineName != null">vaccine_name = #{vaccineName},</if>
+            <if test="jici != null">jici = #{jici},</if>
+            <if test="vaccinationTime != null">vaccination_time = #{vaccinationTime},</if>
+            <if test="vaccinationPlace != null">vaccination_place = #{vaccinationPlace},</if>
+            <if test="contraindication != null">contraindication = #{contraindication},</if>
+            <if test="suspend != null">suspend = #{suspend},</if>
+            <if test="shouldBe != null">should_be = #{shouldBe},</if>
+            <if test="other != null">other = #{other},</if>
+            <if test="progress != null">progress = #{progress},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="isDel != null and isDel != ''">is_del = #{isDel},</if>
+            <if test="code != null and code != ''">code = #{code},</if>
+            <if test="birthday != null and birthday != ''">birthday = #{birthday},</if>
+            <if test="workUnit != null and workUnit != ''">work_unit = #{workUnit},</if>
+            <if test="crowdClassification != null and crowdClassification != ''">crowd_classification = #{crowdClassification},</if>
+            <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
+            <if test="nowIn != null and nowIn != ''">now_in = #{nowIn},</if>
+            <if test="url != null and url != ''">url = #{url},</if>
+            <if test="shouldSlow != null and shouldSlow != ''">should_slow = #{shouldSlow},</if>
+            <if test="suspendUrl != null and suspendUrl != ''">suspend_url = #{suspendUrl},</if>
+            <if test="otherUrl != null and otherUrl != ''">other_url = #{otherUrl},</if>
+            <if test="age != null and age != ''">age = #{age},</if>
+            <if test="deptId != null">dept_id = #{deptId},</if>
+        </trim>
+        where code = #{code} or (id_card like concat('%', #{idCard}, '%') and user_name like concat('%', #{userName}, '%'))
+    </update>
+
     <delete id="deleteVaccineInfoById" parameterType="Long">
         update  vaccine_info set is_del = 'Y' where id = #{id}
     </delete>
@@ -311,7 +360,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     </delete>
 
 
-    <select id="findHjInfo" parameterType="VaccineInfoOperation" resultMap="VaccineInfoResult">
+    <select id="findHjInfo"  resultMap="VaccineInfoResult">
         select id, user_name ,gender, birthday,age,code from vaccine_info
         <where>
             is_del = 'N'

+ 4 - 4
boman-web-core/src/main/resources/mapper/VaccineInfoOperationMapper.xml

@@ -4,7 +4,7 @@
         "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.boman.web.core.mapper.VaccineInfoOperationMapper">
 
-    <resultMap type="VaccineInfoOperation" id="VaccineInfoOperationResult">
+    <resultMap type="com.boman.domain.VaccineInfoOperation" id="VaccineInfoOperationResult">
         <result property="id" column="id"/>
         <result property="villageTowns" column="village_towns"/>
         <result property="village" column="village"/>
@@ -62,7 +62,7 @@
         from vaccine_info_operation
     </sql>
 
-    <select id="selectVaccineInfoOperationList" parameterType="VaccineInfoOperation"
+    <select id="selectVaccineInfoOperationList" 
             resultMap="VaccineInfoOperationResult">
         <include refid="selectVaccineInfoOperationVo"/>
         <where>
@@ -112,7 +112,7 @@
         where id = #{id}
     </select>
 
-    <insert id="insertVaccineInfoOperation" parameterType="VaccineInfoOperation" useGeneratedKeys="true"
+    <insert id="insertVaccineInfoOperation"  useGeneratedKeys="true"
             keyProperty="id">
         insert into vaccine_info_operation
         <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -207,7 +207,7 @@
         </trim>
     </insert>
 
-    <update id="updateVaccineInfoOperation" parameterType="VaccineInfoOperation">
+    <update id="updateVaccineInfoOperation" >
         update vaccine_info_operation
         <trim prefix="SET" suffixOverrides=",">
             <if test="villageTowns != null">village_towns = #{villageTowns},</if>

+ 9 - 4
boman-web-core/src/main/resources/mapper/VaccineInfoUserMapper.xml

@@ -5,7 +5,7 @@
 <mapper namespace="com.boman.web.core.mapper.VaccineInfoUserMapper">
 
 
-    <resultMap id="VaccineInfoUser" type="com.boman.web.core.domain.VaccineInfoUser">
+    <resultMap id="VaccineInfoUser" type="com.boman.domain.VaccineInfoUser">
         <id     property="id"       column="id"        />
         <result property="idCard"     column="id_card"      />
         <result property="vaccineName"      column="vaccine_name"       />
@@ -27,7 +27,7 @@
                select id,id_card,vaccine_name,jici,vaccination_time,vaccination_place,progress,url,status from vaccine_info_user  where id_card = #{idCard} and is_del = 'N'
     </select>
 
-    <select id="selectIdCardList" parameterType="VaccineInfoUser" resultType="java.lang.String">
+    <select id="selectIdCardList"  resultType="java.lang.String">
         SELECT DISTINCT id_card FROM vaccine_info_user
         <where>
             is_del = 'N'
@@ -37,7 +37,7 @@
         </where>
     </select>
 
-    <insert id="insertVaccineInfoUser" parameterType="VaccineInfoUser" useGeneratedKeys="true" keyProperty="id">
+    <insert id="insertVaccineInfoUser"  useGeneratedKeys="true" keyProperty="id">
         insert into vaccine_info_user
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="idCard != null">id_card,</if>
@@ -71,7 +71,7 @@
         </trim>
     </insert>
 
-    <update id="updateVaccineInfoUser" parameterType="VaccineInfoUser">
+    <update id="updateVaccineInfoUser" >
         update vaccine_info_user
         <trim prefix="SET" suffixOverrides=",">
             <if test="idCard != null">id_card = #{idCard},</if>
@@ -104,6 +104,11 @@
         SELECT count(1) FROM vaccine_info_user where is_del = 'N' and jici = '1';
     </select>
 
+    <select id="countByIdCardAndJici" resultType="int">
+        SELECT count(1) FROM vaccine_info_user where id_card = #{sfz} and jici = #{jzjc};
+    </select>
+
+
     <select id="todayCnt" resultType="com.alibaba.fastjson.JSONObject">
         SELECT count(1) one FROM vaccine_info_user WHERE is_del = 'N' AND jici = '1'
             AND vaccination_time &gt;= #{todayStart}

+ 46 - 0
boman-web-core/src/main/resources/mapper/YmjzImportErrorLogMapper.xml

@@ -0,0 +1,46 @@
+<?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="com.boman.web.core.mapper.YmjzImportErrorLogMapper">
+
+    <resultMap type="com.boman.domain.YmjzImportErrorLog" id="YmjzImportErrorLogResult">
+        <result property="id"    column="id"    />
+        <result property="username"    column="username"    />
+        <result property="town"    column="town"    />
+        <result property="vaccineName"    column="vaccine_name"    />
+        <result property="jici"    column="jici"    />
+        <result property="vaccinationTime"    column="vaccination_time"    />
+        <result property="vaccinationPlace"    column="vaccination_place"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateBy"    column="update_by"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="isDel"    column="is_del"    />
+    </resultMap>
+
+    <insert id="insertErrorLog" parameterType="com.boman.domain.YmjzImportErrorLog">
+        insert into ymjz_import_error_log (
+            <if test="username != null and username != ''">username,</if>
+            <if test="town != null and town != ''">town,</if>
+            <if test="vaccineName != null and vaccineName != ''">vaccine_name,</if>
+            <if test="jici != null and remark != ''">jici,</if>
+            <if test="vaccinationTime != null and vaccinationTime != ''">vaccination_time,</if>
+            <if test="vaccinationPlace != null and vaccinationPlace != ''">vaccination_place,</if>
+            <if test="createBy != null and createBy != ''">create_by,</if>
+            <if test="updateBy != null and updateBy != ''">update_by,</if>
+            create_time, updateTime
+        )values(
+            <if test="username != null and username != ''">#{username},</if>
+            <if test="town != null and town != ''">#{town},</if>
+            <if test="vaccineName != null and vaccineName != ''">#{vaccine_name},</if>
+            <if test="jici != null and remark != ''">#{jici},</if>
+            <if test="vaccinationTime != null and vaccinationTime != ''">#{vaccination_time},</if>
+            <if test="vaccinationPlace != null and vaccinationPlace != ''">#{vaccination_place},</if>
+            <if test="createBy != null and createBy != ''">#{create_by},</if>
+            <if test="updateBy != null and updateBy != ''">#{update_by},</if>
+            sysdate(), sysdate()
+        )
+    </insert>
+
+</mapper>