|
@@ -1,5 +1,6 @@
|
|
|
package com.iamberry.wechat.handles.activity;
|
|
|
|
|
|
+import com.iamberry.app.tool.log.RatFWLogger;
|
|
|
import com.iamberry.wechat.core.entity.ResultMsg;
|
|
|
import com.iamberry.wechat.core.entity.WechatUtils;
|
|
|
import com.iamberry.wechat.core.entity.activity.Activity;
|
|
@@ -49,6 +50,10 @@ public class ActivityHandler {
|
|
|
private SystemService systemService;
|
|
|
@Autowired
|
|
|
private CouponItemService couponItemService;
|
|
|
+ @Autowired
|
|
|
+ private SendMessageUtil sendMessageUtil;
|
|
|
+ @Autowired
|
|
|
+ private RatFWLogger logger;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -128,8 +133,6 @@ public class ActivityHandler {
|
|
|
@ResponseBody
|
|
|
@RequestMapping("/participate_activity")
|
|
|
public synchronized ResultMsg getColorPatterns(HttpServletRequest req){
|
|
|
- long start = new Date().getTime();
|
|
|
-
|
|
|
ResultMsg rm = ResultMsg.getSuccess();
|
|
|
|
|
|
Member member = WechatUtils.getUserBySession(req);
|
|
@@ -158,7 +161,12 @@ public class ActivityHandler {
|
|
|
String codeName = name + "Code.png";
|
|
|
String headName = name + "Head.png";
|
|
|
String imgName = name + ".png";
|
|
|
+
|
|
|
+ long start = new Date().getTime();
|
|
|
boolean flag = generatePoster(member,filePath,codeName,imgName,headName);
|
|
|
+ long end = new Date().getTime();
|
|
|
+ System.out.println("生成时间为:"+ (end-start));
|
|
|
+
|
|
|
if(!flag){
|
|
|
rm = ResultMsg.getError();
|
|
|
rm.setMessage("生成图片失败");
|
|
@@ -181,9 +189,22 @@ public class ActivityHandler {
|
|
|
Integer f = 0;
|
|
|
if(acList==null || acList.size() < 1 ){
|
|
|
f = activityService.save(activity);
|
|
|
+ try {
|
|
|
+ sendMessageUtil.participateInSuccess(
|
|
|
+ ResultInfo.ACTIVITY_SUCCESS,
|
|
|
+ ResultInfo.HELP_NAME,
|
|
|
+ ResultInfo.ACTIVITY_DATE,
|
|
|
+ ResultInfo.SOODO_NAME,
|
|
|
+ ResultInfo.ACTIVITY_REM,
|
|
|
+ ResultInfo.ACTIVITY_USER_REM,
|
|
|
+ member.getUserOpenid(),
|
|
|
+ ResultInfo.help_url
|
|
|
+ );
|
|
|
+ } catch (Exception e) {
|
|
|
+ logger.info("============助力成功信息发送失败============");
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
- long end = new Date().getTime();
|
|
|
- System.out.println("生成时间为:"+ (end-start));
|
|
|
if(f < 1){
|
|
|
return rm;
|
|
|
}else{
|
|
@@ -246,7 +267,7 @@ public class ActivityHandler {
|
|
|
}
|
|
|
|
|
|
//生成机器二维码
|
|
|
- String json = String.format(NameUtils.QR_SCENE, 2592000, ResultInfo.barCodeActivity + member.getUserOpenid());
|
|
|
+ String json = String.format(NameUtils.QR_SCENE_STR, 2592000, ResultInfo.barCodeActivity + member.getUserOpenid());
|
|
|
QRCJson qrc = WeixinUtil.createQrcode(json);
|
|
|
try {
|
|
|
/*下载二维码*/
|
|
@@ -267,7 +288,7 @@ public class ActivityHandler {
|
|
|
ImageUtils.pressPost(newImg,
|
|
|
headImg,PosterNumUtils.HEAD_X,PosterNumUtils.HEAD_Y,
|
|
|
codeImg,PosterNumUtils.CODE_X,PosterNumUtils.CODE_Y,
|
|
|
- name,PosterNumUtils.TEXT_X,PosterNumUtils.TEXT_Y,Color.black,PosterNumUtils.TEXT_FONT_SIZE
|
|
|
+ name,PosterNumUtils.TEXT_X,PosterNumUtils.TEXT_Y,new Color(51, 51, 51),PosterNumUtils.TEXT_FONT_SIZE
|
|
|
);
|
|
|
/*添加文字*/
|
|
|
// ImageUtils.pressImage(newImg,headImg,PosterNumUtils.HEAD_X,PosterNumUtils.HEAD_Y,1);
|