Browse Source

死亡人员导入(火化时间、来源)

LIVE_YE 3 năm trước cách đây
mục cha
commit
01c02c8147

+ 4 - 0
boman-api/boman-domain/src/main/java/com/boman/domain/ThirdPartInfo.java

@@ -225,6 +225,10 @@ public class ThirdPartInfo extends BaseEntity{
    */
   private String isLocal;
 
+  /**
+   * 数据来源
+   */
+  private String source;
 
 
 

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

@@ -243,12 +243,12 @@ public class CzrkController extends BaseController {
     @Log(title = "人员信息", businessType = BusinessType.IMPORT)
     @PreAuthorize(hasPermi = "system:czrk:importData")
     @PostMapping("/importData")
-    public AjaxResult importData(MultipartFile file) throws Exception
+    public AjaxResult importData(MultipartFile file,String source) throws Exception
     {
         ExcelUtil<ThirdPartInfo> util = new ExcelUtil<ThirdPartInfo>(ThirdPartInfo.class);
         List<ThirdPartInfo> thirdPartInfoList = util.importExcel(file.getInputStream());
         //String operName = SecurityUtils.getUsername();
-        String message = czrkService.importUser(thirdPartInfoList);
+        String message = czrkService.importUser(thirdPartInfoList,source);
         return AjaxResult.success(message);
     }
 

+ 10 - 3
boman-web-core/src/main/java/com/boman/web/core/service/czrk/CzrkServiceImpl.java

@@ -41,7 +41,6 @@ import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.context.request.RequestContextHolder;
 import org.springframework.web.context.request.ServletRequestAttributes;
 import javax.annotation.Resource;
-import java.sql.Date;
 import java.sql.Timestamp;
 import java.text.SimpleDateFormat;
 import java.util.*;
@@ -1089,7 +1088,7 @@ public class CzrkServiceImpl implements ICzrkService {
 
     @Override
     @Transactional(rollbackFor = Exception.class)
-    public String importUser(List<ThirdPartInfo> thirdPartInfoList) {
+    public String importUser(List<ThirdPartInfo> thirdPartInfoList,String source) {
         if (StringUtils.isNull(thirdPartInfoList) || thirdPartInfoList.size() == 0) {
             throw new CustomException("导入数据不能为空!");
         }
@@ -1102,7 +1101,14 @@ public class CzrkServiceImpl implements ICzrkService {
         try{
             for (ThirdPartInfo thirdPartInfo : thirdPartInfoList) {
 
-                thirdPartInfo.setCremationTime(DateUtils.checkDate(thirdPartInfo.getCremationTime()));
+                if(StringUtils.isNotEmpty(thirdPartInfo.getCremationTime())){
+                    Calendar calendar = new GregorianCalendar(1900,0,-1);
+                    Date date = calendar.getTime();
+                    Date dd = DateUtils.addDays(date,Integer.valueOf(thirdPartInfo.getCremationTime()));
+                    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+                    thirdPartInfo.setCremationTime(format.format(dd));
+                }
+
                 //将ThirdPartInfo对象所有字段赋值
                 //ThirdPartInfoUtils.setValue(thirdPartInfo);
                 // 防止有空行,IdCard是必须要有的
@@ -1110,6 +1116,7 @@ public class CzrkServiceImpl implements ICzrkService {
                     continue;
                 }
                 //将信息存入ThirdPartInfo表
+                thirdPartInfo.setSource(source);
                 thirdPartInfo.setStatus("4");
                 thirdPartInfo.setCreateBy(sysUser.getUserName());
                 thirdPartInfo.setUpdateBy(sysUser.getUserName());

+ 1 - 1
boman-web-core/src/main/java/com/boman/web/core/service/czrk/ICzrkService.java

@@ -143,7 +143,7 @@ public interface ICzrkService {
 
     List<Czrk> getAllCzrk(Czrk czrk);
 
-    String importUser(List<ThirdPartInfo> thirdPartInfoList);
+    String importUser(List<ThirdPartInfo> thirdPartInfoList,String source);
 
     List<ThirdPartInfo> listDie(ThirdPartInfo thirdPartInfo);
 }

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

@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="villageId" column="village_id"/>
         <result property="village" column="village"/>
         <result property="isLocal" column="is_local"/>
-
+        <result property="source" column="source"/>
 
     </resultMap>
 
@@ -79,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             village_towns,
             village_id,
             village,
-            is_local,create_time,update_time)
+            is_local,source,create_time,update_time)
         values
         <foreach item="thirdPartInfo" index="index" collection="thirdPartInfoList" separator=",">
             (#{thirdPartInfo.cremationCertificate},
@@ -115,6 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{thirdPartInfo.villageId},
             #{thirdPartInfo.village},
             #{thirdPartInfo.isLocal},
+            #{thirdPartInfo.source},
             sysdate(),sysdate())
         </foreach>
     </insert>
@@ -122,7 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <select id="queryList" resultMap="ThirdPartInfoResult">
         select id, cremation_certificate, cremation_time, user_name, id_card, age, gender, nation, township, village_group,
                home_phone, is_deposit, is_cold_storage,cause_of_death,status,
-               is_hmbz,sjgm,jzdx,remarks,is_local_account,is_local,create_time
+               is_hmbz,sjgm,jzdx,remarks,is_local_account,is_local,create_time,source
         from third_part_info
         <where>
             is_del = 'N'