Преглед на файлове

死亡人员导入(时间)

LIVE_YE преди 3 години
родител
ревизия
ad0f58d04a

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

@@ -495,4 +495,17 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
             }else{
                 age--;//当前月份在生日之前,年龄减一
             } } return age; }
+
+
+    public static String checkDate(String str){
+        String format1 = null;
+        try {
+            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+            Date date = new Date(str);
+            format1 = format.format(date);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return format1;
+    }
 }

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

@@ -1102,9 +1102,7 @@ public class CzrkServiceImpl implements ICzrkService {
         try{
             for (ThirdPartInfo thirdPartInfo : thirdPartInfoList) {
 
-                //SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
-                //String  str = sdf.format(DateUtils.formatDate(thirdPartInfo.getCremationTime()));
-
+                thirdPartInfo.setCremationTime(DateUtils.checkDate(thirdPartInfo.getCremationTime()));
                 //将ThirdPartInfo对象所有字段赋值
                 //ThirdPartInfoUtils.setValue(thirdPartInfo);
                 // 防止有空行,IdCard是必须要有的

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

@@ -79,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             village_towns,
             village_id,
             village,
-            is_local)
+            is_local,create_time,update_time)
         values
         <foreach item="thirdPartInfo" index="index" collection="thirdPartInfoList" separator=",">
             (#{thirdPartInfo.cremationCertificate},
@@ -114,7 +114,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{thirdPartInfo.villageTowns},
             #{thirdPartInfo.villageId},
             #{thirdPartInfo.village},
-            #{thirdPartInfo.isLocal})
+            #{thirdPartInfo.isLocal},
+            sysdate(),sysdate())
         </foreach>
     </insert>