Commit 3c5bb45a authored by 赵然's avatar 赵然

zr

parent 70fb5cef
<component name="libraryTable">
<library name="Maven: commons-logging:commons-logging:1.2">
<CLASSES>
<root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.2/commons-logging-1.2.jar!/" />
</CLASSES>
<JAVADOC>
<root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.2/commons-logging-1.2-javadoc.jar!/" />
</JAVADOC>
<SOURCES>
<root url="jar://$MAVEN_REPOSITORY$/commons-logging/commons-logging/1.2/commons-logging-1.2-sources.jar!/" />
</SOURCES>
</library>
</component>
\ No newline at end of file
......@@ -69,7 +69,7 @@ public class CreatUrlModule {
Map<String, String> params=new HashMap<String, String>();
params.put("uid",userId);
params.put("credits",credits);
params.put("timestamp",String.valueOf(System.currentTimeMillis() + 240 * 60 * 1000));
params.put("timestamp",String.valueOf(System.currentTimeMillis() + 10080 * 60 * 1000));
if(dcustom!=null&&dcustom!=""&&dcustom != "null") {
if(type == null || type.equals("1")) {
......
......@@ -13,7 +13,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.persistence.criteria.CriteriaBuilder;
import javax.servlet.http.HttpServletRequest;
import javax.swing.text.BadLocationException;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -29,7 +31,6 @@ public class NewSignModule {
ViewService viewService;
final Base64.Decoder decoder = Base64.getDecoder();
/**
* 功能:清除所有的签到记录
* @return
......@@ -37,7 +38,7 @@ public class NewSignModule {
@RequestMapping(value = "/clearAll", method= RequestMethod.POST)
@ResponseBody
public Map clearAll(HttpServletRequest request) throws Exception {
viewService.count();
//viewService.count();
//String userId = request.getParameter("userId");
java.net.URLDecoder urlDecoder=new java.net.URLDecoder();
String userId = urlDecoder.decode(request.getParameter("userId"),"utf-8");
......@@ -78,6 +79,9 @@ public class NewSignModule {
//sqlService.update("update ckvtable.tb_kvtable_"+tag+" set int_value = '"+count+"' where consumer_id = '"+consumerId+"' and vkey = 'cl_good_cid_itemId_"+consumerId+"_"+cardId+"'");
sqlService.update("DELETE FROM projectx.tb_action_record where user_id = '"+consumerId+"' and project_id = '"+projectId+"' and playway_id = '"+playwayId+"'");
//清除kv表数据
sqlService.update("DELETE FROM projectx.tb_kvdata_expire where string_key = 'K008_"+consumerId+"_sign_"+projectId+"'");
map.put("success", "true");
map.put("message", "用户"+userId+"的签到记录清除成功!");
} catch (Exception e) {
......@@ -96,7 +100,7 @@ public class NewSignModule {
@RequestMapping(value = "/clearToday", method= RequestMethod.POST)
@ResponseBody
public Map clearToday(HttpServletRequest request) throws Exception {
viewService.count();
//viewService.count();
//String userId = request.getParameter("userId");
java.net.URLDecoder urlDecoder=new java.net.URLDecoder();
String userId = urlDecoder.decode(request.getParameter("userId"),"utf-8");
......@@ -121,6 +125,7 @@ public class NewSignModule {
System.out.println("用户consumer_id为:" + consumerId);
Map<String, String> map = new HashMap<>();
//String sql = "SELECT * FROM ckvtable.tb_kvtable_"+tag+" where consumer_id = '"+consumerId+"' and vkey = 'cl_good_cid_itemId_"+consumerId+"_"+cardId+"';";
......@@ -137,6 +142,20 @@ public class NewSignModule {
//sqlService.update("update ckvtable.tb_kvtable_"+tag+" set int_value = '"+count+"' where consumer_id = '"+consumerId+"' and vkey = 'cl_good_cid_itemId_"+consumerId+"_"+cardId+"'");
sqlService.update("DELETE FROM projectx.tb_action_record where user_id = '"+consumerId+"' and project_id = '"+projectId+"' and playway_id = '"+playwayId+"' and to_days(gmt_create) = to_days(now())" );
//还原kv表当天数据
String sqlkv = "SELECT * FROM projectx.tb_kvdata_expire where string_key = 'K008_"+consumerId+"_sign_"+projectId+"'";
Response responsekv = sqlService.findSimpleResult(sqlkv);
System.out.println("查询结果为:" + responsekv.asString());
String int_value = responsekv.jsonPath().getString("int_value");
if(int_value.equals("1")){
sqlService.update("DELETE FROM projectx.tb_kvdata_expire where string_key = 'K008_"+consumerId+"_sign_"+projectId+"'");
}else{
String intval = String.valueOf(Integer.valueOf(int_value)-1);
String sign_date = this.getTime(-1);
sqlService.update("UPDATE projectx.tb_kvdata_expire set int_value ='"+intval+"',string_value = '"+sign_date+"' where string_key = 'K008_"+consumerId+"_sign_"+projectId+"'");
}
map.put("success", "true");
map.put("message", "用户"+userId+"当日的签到记录清除成功!");
} catch (Exception e) {
......@@ -154,7 +173,7 @@ public class NewSignModule {
@RequestMapping(value = "/getSignInfo", method= RequestMethod.POST)
@ResponseBody
public Map getSignInfo(HttpServletRequest request) throws Exception {
viewService.count();
//viewService.count();
//String userId = request.getParameter("userId");
java.net.URLDecoder urlDecoder=new java.net.URLDecoder();
String userId = urlDecoder.decode(request.getParameter("userId"),"utf-8");
......@@ -228,7 +247,7 @@ public class NewSignModule {
@RequestMapping(value = "/doSign", method= RequestMethod.POST)
@ResponseBody
public Map doSign(HttpServletRequest request) throws Exception {
viewService.count();
//viewService.count();
java.net.URLDecoder urlDecoder=new java.net.URLDecoder();
String userId = urlDecoder.decode(request.getParameter("userId"),"utf-8");
......@@ -263,6 +282,7 @@ public class NewSignModule {
int i= Integer.valueOf(continue_day);
if(discon.equals("1")) {
//断签
while (i > 1) {
String sign_date = this.getTime(i * (-1));
Thread.sleep(500);
......@@ -270,7 +290,9 @@ public class NewSignModule {
sqlService.update(sql2);
i--;
}
sqlService.update("INSERT INTO projectx.tb_kvdata_expire (`string_key`,`int_value`,`string_value`,`expire`) VALUES ('K008_"+consumerId+"_sign_"+projectId+"','"+String.valueOf(Integer.valueOf(continue_day)-1)+"','"+this.getTime(-2)+"','2099-12-30 00:00:00');");
}else {
//连续签到
while (i > 0) {
String sign_date = this.getTime(i * (-1));
Thread.sleep(500);
......@@ -278,6 +300,7 @@ public class NewSignModule {
sqlService.update(sql2);
i--;
}
sqlService.update("INSERT INTO projectx.tb_kvdata_expire (`string_key`,`int_value`,`string_value`,`expire`) VALUES ('K008_"+consumerId+"_sign_"+projectId+"','"+continue_day+"','"+this.getTime(-1)+"','2099-12-30 00:00:00');");
}
Map<String, String> map = new HashMap<>();
......
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