diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/baidu/TestBaidu.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/baidu/TestBaidu.java index 71f7c499..263954fb 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/baidu/TestBaidu.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/app/baidu/TestBaidu.java @@ -1,11 +1,19 @@ package com.ruoyi.web.controller.app.baidu; +import java.util.Date; + public class TestBaidu { public static void main(String[] args) throws Exception { - OcrIdCardBAI ocrIdCardBAI = new OcrIdCardBAI(); - String result = ocrIdCardBAI.idcard("D:/ruoyi/uploadPath/id_card/18321826195_card_front.jpg", "front", "true", "true", "true", "false"); - System.out.println(result); +// OcrIdCardBAI ocrIdCardBAI = new OcrIdCardBAI(); +// String result = ocrIdCardBAI.idcard("D:/ruoyi/uploadPath/id_card/18321826195_card_front.jpg", "front", "true", "true", "true", "false"); +// System.out.println(result); + long currentTimeMillis = System.currentTimeMillis(); + // 利用毫秒值构造Date对象 + Date calculationTime = new Date(currentTimeMillis-1000000000); + + System.out.println(calculationTime); + } } diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java index 7074708c..5e8dce37 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java @@ -201,6 +201,10 @@ public class SysRegisterService Date currentDate = new Date(currentTimeMillis); userInfo.setUpdateTime(currentDate); + //设置上一次计算时间大约为10天前 + Date calculationTime = new Date(currentTimeMillis-1000000000); + userInfo.setCalculationTime(calculationTime); + int infoFlag = userInfoService.insertUserInfo(userInfo); if (infoFlag == 0) { msg = "个人信息注册失败,请联系系统管理人员"; diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserInfo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserInfo.java index bfc3390a..f2685179 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserInfo.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserInfo.java @@ -112,6 +112,9 @@ public class UserInfo extends BaseEntity @Excel(name = "背景图地址") private String backGround; + @Excel(name = "上一次计算时间") + private Date calculationTime; + public void setUserId(Long userId) @@ -339,6 +342,12 @@ public class UserInfo extends BaseEntity this.backGround = backGround; } + public Date getCalculationTime() + { + return calculationTime; + } + public void setCalculationTime(Date calculationTime){this.calculationTime = calculationTime;} + @Override @@ -368,6 +377,8 @@ public class UserInfo extends BaseEntity .append("tConsumption", gettConsumption()) .append("updateTime", getUpdateTime()) .append("birth", getBirth()) + .append("backGround", getBackGround()) + .append("calculationTime", getCalculationTime()) .toString(); } } diff --git a/ruoyi-system/src/main/resources/mapper/system/UserInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/system/UserInfoMapper.xml index faacb375..414160a6 100644 --- a/ruoyi-system/src/main/resources/mapper/system/UserInfoMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/UserInfoMapper.xml @@ -30,10 +30,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select user_id, authentication_status, real_name, id_card, sex, signature, avatar, card_front, card_back, email, receive_rockets, send_rockets, shares, followers, s_online_time, s_mr_time, s_consumption, th_consumption, phonenumber, t_mr_time, t_online_time, t_consumption, update_time, date_of_birth, back_ground from user_info + select user_id, authentication_status, real_name, id_card, sex, signature, avatar, card_front, card_back, email, receive_rockets, send_rockets, shares, followers, s_online_time, s_mr_time, s_consumption, th_consumption, phonenumber, t_mr_time, t_online_time, t_consumption, update_time, date_of_birth, back_ground, calculation_time from user_info @@ -99,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time date_of_birth back_ground + calculation_time #{userId}, @@ -126,6 +129,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateTime}, #{birth}, #{backGround}, + #{calculationTime}, @@ -156,6 +160,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_time = #{updateTime}, date_of_birth = #{birth}, back_ground = #{backGround}, + calculation_time = #{calculationTime}, where user_id = #{userId}