| @@ -0,0 +1,36 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * Created by Stormeye on 2018/08/09. | |||||
| */ | |||||
| public enum EnumMsgSend { | |||||
| MSG_SEND_IMMEDIATELY(1, "立即发送"), | |||||
| MSG_SEND_NOT_IMMEDIATELY(0, "不立即发送") | |||||
| ; | |||||
| public static EnumMsgSend getEnum(Integer code) { | |||||
| for (EnumMsgSend value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumMsgSend(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,34 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * Created by Stormeye on 2018/08/09. | |||||
| */ | |||||
| public enum EnumMsgSendSetTime { | |||||
| MSG_SEND_STATUS_SET_TIME(0, "定时") | |||||
| ; | |||||
| public static EnumMsgSendSetTime getEnum(Integer code) { | |||||
| for (EnumMsgSendSetTime value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumMsgSendSetTime(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,35 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * Created by Stormeye on 2018/08/09. | |||||
| */ | |||||
| public enum EnumMsgSendStatus { | |||||
| MSG_SEND_SUCCESS(1,"发送成功"), | |||||
| MSG_SEND_FAIL(0,"发送失败") | |||||
| ; | |||||
| public static EnumMsgSendStatus getEnum(Integer code) { | |||||
| for (EnumMsgSendStatus value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumMsgSendStatus(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -6,12 +6,7 @@ package com.iformall.enums; | |||||
| public enum EnumMsgStatus { | public enum EnumMsgStatus { | ||||
| MSG_STATUS_DRAFT(2, "草稿"), | MSG_STATUS_DRAFT(2, "草稿"), | ||||
| MSG_STATUS_NOT_SEND(0, "未发送"), | MSG_STATUS_NOT_SEND(0, "未发送"), | ||||
| MSG_STATUS_SENDED(1, "已发送"), | |||||
| MSG_SEND_STATUS_SET_TIME(0, "定时"), | |||||
| MSG_SEND_IMMEDIATELY(1, "立即发送"), | |||||
| MSG_SEND_NOT_IMMEDIATELY(0, "不立即发送"), | |||||
| MSG_SEND_SUCCESS(1,"发送成功"), | |||||
| MSG_SEND_FAIL(0,"发送失败") | |||||
| MSG_STATUS_SENDED(1, "已发送") | |||||
| ; | ; | ||||
| public static EnumMsgStatus getEnum(Integer code) { | public static EnumMsgStatus getEnum(Integer code) { | ||||
| @@ -181,11 +181,11 @@ public class CouponInjectServiceImpl implements CouponInjectService { | |||||
| return; | return; | ||||
| } | } | ||||
| if(record.getSendType().equals(EnumCouponInjectSendType.TIMING.getCode())){ | if(record.getSendType().equals(EnumCouponInjectSendType.TIMING.getCode())){ | ||||
| wxmsg.setIsright(EnumMsgStatus.MSG_SEND_NOT_IMMEDIATELY.getCode());//值是相反的 | |||||
| wxmsg.setIsright(EnumMsgSend.MSG_SEND_NOT_IMMEDIATELY.getCode());//值是相反的 | |||||
| wxmsg.setSendtime(DateUtils.date2String(record.getSendTime(),"yyyy-MM-dd HH:mm:ss")); | wxmsg.setSendtime(DateUtils.date2String(record.getSendTime(),"yyyy-MM-dd HH:mm:ss")); | ||||
| wxmsg.setStatus(EnumMsgStatus.MSG_STATUS_NOT_SEND.getCode()); | wxmsg.setStatus(EnumMsgStatus.MSG_STATUS_NOT_SEND.getCode()); | ||||
| }else{ | }else{ | ||||
| wxmsg.setIsright(EnumMsgStatus.MSG_SEND_IMMEDIATELY.getCode());//立即发送 | |||||
| wxmsg.setIsright(EnumMsgSend.MSG_SEND_IMMEDIATELY.getCode());//立即发送 | |||||
| wxmsg.setStatus(EnumMsgStatus.MSG_STATUS_SENDED.getCode()); | wxmsg.setStatus(EnumMsgStatus.MSG_STATUS_SENDED.getCode()); | ||||
| wxmsg.setSendtime(com.iformall.utils.DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss")); | wxmsg.setSendtime(com.iformall.utils.DateUtils.getSystemTime("yyyy-MM-dd HH:mm:ss")); | ||||
| @@ -8,6 +8,7 @@ import com.iformall.domain.po.WxMsgCallback; | |||||
| import com.iformall.domain.po.WxMsgConfig; | import com.iformall.domain.po.WxMsgConfig; | ||||
| import com.iformall.domain.po.WxMsgModel; | import com.iformall.domain.po.WxMsgModel; | ||||
| import com.iformall.domain.po.WxMsgValidationcodeModel; | import com.iformall.domain.po.WxMsgValidationcodeModel; | ||||
| import com.iformall.enums.EnumMsgSendStatus; | |||||
| import com.iformall.enums.EnumMsgStatus; | import com.iformall.enums.EnumMsgStatus; | ||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.WxMsgCallbackService; | import com.iformall.service.WxMsgCallbackService; | ||||
| @@ -94,7 +95,7 @@ public class WxMsgCallbackServiceImpl implements WxMsgCallbackService { | |||||
| wxMsgCallback.setId(idWorker.nextId()); | wxMsgCallback.setId(idWorker.nextId()); | ||||
| wxMsgCallback.setCallbackId(callbackId); | wxMsgCallback.setCallbackId(callbackId); | ||||
| wxMsgCallback.setTenantId(tenantId); | wxMsgCallback.setTenantId(tenantId); | ||||
| wxMsgCallback.setStatus(EnumMsgStatus.MSG_SEND_FAIL.getCode()); | |||||
| wxMsgCallback.setStatus(EnumMsgSendStatus.MSG_SEND_FAIL.getCode()); | |||||
| wxMsgCallback.setCreatetime(new Date()); | wxMsgCallback.setCreatetime(new Date()); | ||||
| wxMsgCallbackMapper.insertSelective(wxMsgCallback); | wxMsgCallbackMapper.insertSelective(wxMsgCallback); | ||||
| } | } | ||||
| @@ -11,6 +11,7 @@ import com.iformall.domain.po.WxCUserBasicInfo; | |||||
| import com.iformall.domain.po.WxMsg; | import com.iformall.domain.po.WxMsg; | ||||
| import com.iformall.domain.po.WxMsgCallback; | import com.iformall.domain.po.WxMsgCallback; | ||||
| import com.iformall.domain.po.WxMsgConfig; | import com.iformall.domain.po.WxMsgConfig; | ||||
| import com.iformall.enums.EnumMsgSendStatus; | |||||
| import com.iformall.enums.EnumMsgStatus; | import com.iformall.enums.EnumMsgStatus; | ||||
| import com.iformall.mapper.WxCUserBasicInfoMapper; | import com.iformall.mapper.WxCUserBasicInfoMapper; | ||||
| import com.iformall.mapper.WxMsgCallbackMapper; | import com.iformall.mapper.WxMsgCallbackMapper; | ||||
| @@ -280,9 +281,9 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| String ret = jsonObjectResult.get("ret").toString(); | String ret = jsonObjectResult.get("ret").toString(); | ||||
| String batchNo = jsonObjectResult.get("data").toString(); | String batchNo = jsonObjectResult.get("data").toString(); | ||||
| if (ret.equals("1")) { | if (ret.equals("1")) { | ||||
| wxMsg.setSendstatus(EnumMsgStatus.MSG_SEND_SUCCESS.getCode()); | |||||
| wxMsg.setSendstatus(EnumMsgSendStatus.MSG_SEND_SUCCESS.getCode()); | |||||
| } else { | } else { | ||||
| wxMsg.setSendstatus(EnumMsgStatus.MSG_SEND_FAIL.getCode()); | |||||
| wxMsg.setSendstatus(EnumMsgSendStatus.MSG_SEND_FAIL.getCode()); | |||||
| } | } | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| @@ -318,7 +319,7 @@ public class WxMsgServiceImpl implements WxMsgService { | |||||
| wxMsgCallback.setTenantId(wxmsg.getTenantId()); | wxMsgCallback.setTenantId(wxmsg.getTenantId()); | ||||
| wxMsgCallback.setBatchNo(batchNo); | wxMsgCallback.setBatchNo(batchNo); | ||||
| wxMsgCallback.setMsgId(wxmsg.getId()); | wxMsgCallback.setMsgId(wxmsg.getId()); | ||||
| wxMsgCallback.setStatus(EnumMsgStatus.MSG_SEND_FAIL.getCode()); | |||||
| wxMsgCallback.setStatus(EnumMsgSendStatus.MSG_SEND_FAIL.getCode()); | |||||
| wxMsgCallback.setCreatetime(new Date()); | wxMsgCallback.setCreatetime(new Date()); | ||||
| wxMsgCallbackMapper.insertSelective(wxMsgCallback); | wxMsgCallbackMapper.insertSelective(wxMsgCallback); | ||||
| } | } | ||||