Merge remote-tracking branch 'origin/master'
| | |
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.springframework.web.bind.annotation.RequestMethod;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.push.DeviceTokenIOS;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceTokenHWService;
|
| | | import com.yeshi.fanli.service.inter.push.IOSPushService;
|
| | | import com.yeshi.fanli.service.inter.push.PushRecordService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping(value = "api/v1/push")
|
| | |
| | |
|
| | | @Resource
|
| | | private DeviceTokenHWService deviceTokenHWService;
|
| | |
|
| | | @Resource
|
| | | private DeviceActiveService deviceActiveService;
|
| | |
|
| | | @RequestMapping(value = "callback", method = RequestMethod.POST)
|
| | | public void callback(AcceptData acceptData, String pushId, PrintWriter out) {
|
| | |
| | | @RequestMapping(value = "/insertDeviceToken", method = RequestMethod.POST)
|
| | | public void insertIOSDeviceToken(AcceptData acceptData, String deviceToken, PrintWriter out) {
|
| | | if (!StringUtil.isNullOrEmpty(acceptData.getDevice()) && !StringUtil.isNullOrEmpty(deviceToken)) {
|
| | | // 添加设备活跃记录
|
| | | DeviceActive da = new DeviceActive();
|
| | | da.setDeviceToken(deviceToken);
|
| | | da.setPlatform(DeviceActive.PLATFORM_IOS);
|
| | | da.setVersionCode(Integer.parseInt(acceptData.getVersion()));
|
| | | deviceActiveService.addDeviceActive(da);
|
| | |
|
| | | DeviceTokenIOS deviceTokenIOS = iosPushService.getDeviceTokenByDeviceToken(deviceToken);
|
| | | if (deviceTokenIOS == null)
|
| | | iosPushService.addDeviceToken(null, Integer.parseInt(acceptData.getVersion()), deviceToken,
|
| | |
| | | @RequestMapping(value = "/uidBindDeviceToken", method = RequestMethod.POST)
|
| | | public void uidBindIOSDeviceToken(AcceptData acceptData, Long uid, String deviceToken, PrintWriter out) {
|
| | | if (uid != null && uid != 0 && !StringUtil.isNullOrEmpty(deviceToken)) {
|
| | | // 添加设备活跃记录
|
| | | DeviceActive da = new DeviceActive();
|
| | | da.setDeviceToken(deviceToken);
|
| | | da.setPlatform(DeviceActive.PLATFORM_IOS);
|
| | | da.setVersionCode(Integer.parseInt(acceptData.getVersion()));
|
| | | deviceActiveService.addDeviceActive(da);
|
| | | // 添加token
|
| | | DeviceTokenIOS deviceTokenIOS = iosPushService.getDeviceTokenByDeviceToken(acceptData.getDevice());
|
| | | if (deviceTokenIOS != null) {
|
| | | deviceTokenIOS.setUid(uid);
|
| | |
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.entity.system.CustomerContent;
|
| | | import com.yeshi.fanli.entity.system.System;
|
| | | import com.yeshi.fanli.entity.system.SystemClientParams;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemClientParamsService;
|
| | | import com.yeshi.fanli.service.inter.config.SystemService;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.service.inter.push.IOSPushService;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | |
|
| | |
| | |
|
| | | @Resource
|
| | | private ConfigService configService;
|
| | |
|
| | | @Resource
|
| | | private DeviceActiveService deviceActiveService;
|
| | |
|
| | | @RequestMapping("getsystemclientparams")
|
| | | public void getSystemClientParams(AcceptData acceptData, PrintWriter out) {
|
| | |
| | | data.put("count", list.size());
|
| | | data.put("systemClientParamsList", gson.toJson(list));
|
| | | out.print(JsonUtil.loadTrueResult(data));
|
| | | // ThreadUtil.run(new Runnable() {
|
| | | // @Override
|
| | | // public void run() {
|
| | | // try {
|
| | | // if ("ios".equalsIgnoreCase(acceptData.getPlatform()))
|
| | | // iosPushService.addDeviceToken(null, Integer.parseInt(acceptData.getVersion()), null,
|
| | | // acceptData.getDevice());
|
| | | // } catch (Exception e) {
|
| | | // }
|
| | | // }
|
| | | // });
|
| | | ThreadUtil.run(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | | try {
|
| | | // 安卓平台添加设备活跃记录
|
| | | if ("android".equalsIgnoreCase(acceptData.getPlatform())) {
|
| | | DeviceActive da = new DeviceActive();
|
| | | da.setDevice(acceptData.getDevice());
|
| | | da.setPlatform(DeviceActive.PLATFORM_ANDROID);
|
| | | da.setVersionCode(Integer.parseInt(acceptData.getVersion()));
|
| | | deviceActiveService.addDeviceActive(da);
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | }
|
| | | }
|
| | | });
|
| | |
|
| | | return;
|
| | | }
|
| | |
| | | redisManager.removeCommonString(key);
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "bindalipaywithverifynew")
|
| | | public void bindAlipayWithVerifyNew(AcceptData acceptData, Long uid, String name, String account, PrintWriter out) {
|
| | |
|
| | | System system = systemService.getSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (uid == null || uid == 0) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请上传用户ID"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(name)) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请上传支付宝实名名称"));
|
| | | return;
|
| | | }
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(account)) {
|
| | | out.print(JsonUtil.loadFalseResult(1, "请上传支付宝账号"));
|
| | | return;
|
| | | }
|
| | |
|
| | | UserInfo user = userInfoService.getUserById(uid);
|
| | |
|
| | | boolean bind = redisManager.isBindAlipayAccountSMSStateValid(user.getPhone());
|
| | | if (!bind) {
|
| | | out.print(JsonUtil.loadFalseResult(90002, "手机验证超时"));
|
| | | return;
|
| | | }
|
| | |
|
| | | String key = "bindalipay-" + uid;
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(redisManager.getCommonString(key))) {
|
| | | out.print(JsonUtil.loadFalseResult(1001, "服务器繁忙,请稍后重试"));
|
| | | return;
|
| | | }
|
| | | redisManager.cacheCommonString(key, "1", 120);
|
| | | // 可以展示给用户看的错误码
|
| | | String[] ALIPAY_CODES = new String[] { "SYSTEM_ERROR", "PERMIT_CHECK_PERM_LIMITED", "PERM_AML_NOT_REALNAME_REV",
|
| | | "PERM_AML_NOT_REALNAME_REV", "PAYEE_USER_INFO_ERROR", "PAYEE_ACC_OCUPIED",
|
| | | "PERMIT_CHECK_PERM_IDENTITY_THEFT", "PERMIT_NON_BANK_LIMIT_PAYEE", "EXCEED_LIMIT_UNRN_DM_AMOUNT" };
|
| | | try {
|
| | | BindingAccount bindingAccount = bindingAccountService.changeAlipayBindingWithVerify(uid, name, account);
|
| | | out.print(JsonUtil.loadTrue(0, JsonUtil.getGson().toJson(bindingAccount), "系统已成功转账0.1元到提现账号中,提现账号验证通过,恭喜你!可以提现了。"));
|
| | | } catch (AlipayTransferException e1) {
|
| | | if (e1.getSubCode().equalsIgnoreCase("PAYEE_NOT_EXIST")) {
|
| | | String msg = "系统未能成功转账0.1元,提现账号信息有误,请核对后重新填写。";
|
| | | out.print(JsonUtil.loadFalseResult(1, msg));
|
| | | } else {
|
| | | for (String st : ALIPAY_CODES) {
|
| | | if (st.equalsIgnoreCase(e1.getSubCode())) {
|
| | | out.print(JsonUtil.loadFalseResult(2, e1.getMsg()));
|
| | | return;
|
| | | }
|
| | | }
|
| | | out.print(JsonUtil.loadFalseResult(3, "支付宝接口出错,验证失败,请联系客服。"));
|
| | | return;
|
| | | }
|
| | |
|
| | | } catch (AlipayApiException e2) {
|
| | | out.print(JsonUtil.loadFalseResult(4, e2.getErrMsg()));
|
| | | return;
|
| | | } catch (AlipayAccountException e3) {
|
| | | // 账户无余额
|
| | | if (e3.getCode() == AlipayAccountException.CODE_NO_MONEY) {
|
| | | out.print(JsonUtil.loadFalseResult(5, "你的账户目前没有余额,无需绑定提现账号。"));
|
| | | return;
|
| | | // 提现次数限制
|
| | | } else if (e3.getCode() == AlipayAccountException.CODE_TIMES_LIMIT) {
|
| | | out.print(JsonUtil.loadFalseResult(6, "每月仅可修改1次提现账号,请下月再试吧。"));
|
| | | return;
|
| | | } else {
|
| | | out.print(JsonUtil.loadFalseResult(7, e3.getMsg()));
|
| | | return;
|
| | | }
|
| | |
|
| | | } catch (Exception e) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e);
|
| | | } catch (Exception e1) {
|
| | | e1.printStackTrace();
|
| | | }
|
| | | out.print(JsonUtil.loadFalseResult(8, "服务器内部错误,验证失败,请联系客服。"));
|
| | | } finally {
|
| | | redisManager.removeCommonString(key);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 获取用户资金详情
|
| | |
| | |
|
| | | data.put("minMoney", minMoney);
|
| | | data.put("maxMoney", maxMoney);
|
| | | data.put("maxDayCount", maxDayCount);
|
| | | data.put("bindingAccountList", gson.toJson(filterBindingAccount(bindingAccountList)));
|
| | |
|
| | | JSONObject alipayVerify = new JSONObject();
|
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.push; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.entity.push.DeviceActive; |
| | | |
| | | public interface DeviceActiveMapper { |
| | | |
| | | int deleteByPrimaryKey(Long id); |
| | | |
| | | int insert(DeviceActive record); |
| | | |
| | | int insertSelective(DeviceActive record); |
| | | |
| | | DeviceActive selectByPrimaryKey(Long id); |
| | | |
| | | int updateByPrimaryKeySelective(DeviceActive record); |
| | | |
| | | int updateByPrimaryKey(DeviceActive record); |
| | | |
| | | DeviceActive selectByDeviceAndPlatform(@Param("device") String device, @Param("platform") int platform); |
| | | |
| | | DeviceActive selectByDeviceToeknMd5AndPlatform(@Param("deviceTokenMd5") String deviceTokenMd5, |
| | | @Param("platform") int platform); |
| | | } |
| | |
| | | public final static int RESULT_CODE_SUCCESS = 2;// 成功
|
| | | public final static int RESULT_CODE_FAIL = 3;// 失败(通过后3日未处理成功则判断为失败)
|
| | |
|
| | | public final static int STATE_VERFING = 0;
|
| | | public final static int STATE_PASS = 1;
|
| | | public final static int STATE_REJECT = 2;
|
| | |
|
| | | @Id
|
| | | @GeneratedValue(strategy = GenerationType.AUTO)
|
| | | @Expose
|
| | | @Column(name="id")
|
| | | @Column(name = "id")
|
| | | private Long id;
|
| | | @Expose
|
| | | @Column(name="orderId")
|
| | | @Column(name = "orderId")
|
| | | private String orderId;// 订单号
|
| | | @Column(name="type")
|
| | | @Column(name = "type")
|
| | | @Expose
|
| | | private Integer type;// 订单类型 1-淘宝订单
|
| | | @Column(name="state")
|
| | | @Column(name = "state")
|
| | | @Expose
|
| | | private Integer state;// 订单状态 0:审核 1:通过 2:拒绝
|
| | | @Column(name="createTime")
|
| | | @Column(name = "createTime")
|
| | | @Expose
|
| | | private Long createTime;
|
| | | @Column(name="handleTime")
|
| | | @Column(name = "handleTime")
|
| | | @Expose
|
| | | private Long handleTime;
|
| | |
|
| | | @Column(name="uid")
|
| | | @Column(name = "uid")
|
| | | @ManyToOne
|
| | | @JoinColumn(name = "uid")
|
| | | @Expose
|
| | | private UserInfo userInfo;
|
| | |
|
| | | @Column(name="oid")
|
| | | @Column(name = "oid")
|
| | | @ManyToOne
|
| | | @JoinColumn(name = "oid")
|
| | | @Expose
|
| | | private Order order;
|
| | | @Column(name="remake")
|
| | | @Column(name = "remake")
|
| | | @Expose
|
| | | private String remake;
|
| | | @Column(name="judge")
|
| | | @Column(name = "judge")
|
| | | @Expose
|
| | | private String judge;// 系统判定:如果用户在本系统购买并成功上传过订单,且上传的丢失订单后6位相同的话,那么系统判定为匹配
|
| | |
|
| | | @Column(name="result_code")
|
| | | @javax.persistence.Column(name="result_code")
|
| | | @Column(name = "result_code")
|
| | | @javax.persistence.Column(name = "result_code")
|
| | | @Expose
|
| | | private Integer resultCode;// 第三方平台订单爬取结果
|
| | |
|
| | | @Transient
|
| | | private Integer total; |
| | | private Integer total;
|
| | | @Transient
|
| | | private Integer totalPass; |
| | | private Integer totalPass;
|
| | | @Transient
|
| | | private Integer totalReject; |
| | | |
| | | |
| | | private Integer totalReject;
|
| | |
|
| | | public Integer getResultCode() {
|
| | | return resultCode;
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.push;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | @Table("yeshi_ec_device_active")
|
| | | public class DeviceActive {
|
| | |
|
| | | public static final int PLATFORM_ANDROID = 1;
|
| | | public static final int PLATFORM_IOS = 2;
|
| | |
|
| | | @Column(name = "da_id")
|
| | | private Long id;
|
| | | @Column(name = "da_platform")
|
| | | private Integer platform;
|
| | | @Column(name = "da_device")
|
| | | private String device;
|
| | | @Column(name = "da_device_token_md5")
|
| | | private String deviceTokenMd5;
|
| | | @Column(name = "da_device_token")
|
| | | private String deviceToken;
|
| | | @Column(name = "da_version_code")
|
| | | private Integer versionCode;
|
| | | @Column(name = "da_createtime")
|
| | | private Date createTime;
|
| | | @Column(name = "da_updatetime")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Integer getPlatform() {
|
| | | return platform;
|
| | | }
|
| | |
|
| | | public void setPlatform(Integer platform) {
|
| | | this.platform = platform;
|
| | | }
|
| | |
|
| | | public String getDevice() {
|
| | | return device;
|
| | | }
|
| | |
|
| | | public void setDevice(String device) {
|
| | | this.device = device;
|
| | | }
|
| | |
|
| | | public String getDeviceTokenMd5() {
|
| | | return deviceTokenMd5;
|
| | | }
|
| | |
|
| | | public void setDeviceTokenMd5(String deviceTokenMd5) {
|
| | | this.deviceTokenMd5 = deviceTokenMd5;
|
| | | }
|
| | |
|
| | | public String getDeviceToken() {
|
| | | return deviceToken;
|
| | | }
|
| | |
|
| | | public void setDeviceToken(String deviceToken) {
|
| | | this.deviceToken = deviceToken;
|
| | | }
|
| | |
|
| | | public Integer getVersionCode() {
|
| | | return versionCode;
|
| | | }
|
| | |
|
| | | public void setVersionCode(Integer versionCode) {
|
| | | this.versionCode = versionCode;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | public Date getUpdateTime() {
|
| | | return updateTime;
|
| | | }
|
| | |
|
| | | public void setUpdateTime(Date updateTime) {
|
| | | this.updateTime = updateTime;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.yeshi.fanli.dao.mybatis.push.DeviceActiveMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.push.DeviceActive"> |
| | | <id column="da_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="da_platform" property="platform" jdbcType="INTEGER" /> |
| | | <result column="da_device" property="device" jdbcType="VARCHAR" /> |
| | | <result column="da_device_token_md5" property="deviceTokenMd5" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="da_device_token" property="deviceToken" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="da_version_code" property="versionCode" |
| | | jdbcType="INTEGER" /> |
| | | <result column="da_createtime" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="da_updatetime" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">da_id,da_platform,da_device,da_device_token_md5,da_device_token,da_version_code,da_createtime,da_updatetime |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_device_active where da_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | |
| | | <select id="selectByDeviceAndPlatform" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_device_active where da_device = #{device} and |
| | | da_platform=#{platform} |
| | | </select> |
| | | |
| | | <select id="selectByDeviceToeknMd5AndPlatform" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_device_active where da_device_token_md5 = |
| | | #{deviceTokenMd5} and da_platform=#{platform} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_device_active where da_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.push.DeviceActive" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_device_active |
| | | (da_id,da_platform,da_device,da_device_token_md5,da_device_token,da_version_code,da_createtime,da_updatetime) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{platform,jdbcType=INTEGER},#{device,jdbcType=VARCHAR},#{deviceTokenMd5,jdbcType=VARCHAR},#{deviceToken,jdbcType=VARCHAR},#{versionCode,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.push.DeviceActive" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_device_active |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">da_id,</if> |
| | | <if test="platform != null">da_platform,</if> |
| | | <if test="device != null">da_device,</if> |
| | | <if test="deviceTokenMd5 != null">da_device_token_md5,</if> |
| | | <if test="deviceToken != null">da_device_token,</if> |
| | | <if test="versionCode != null">da_version_code,</if> |
| | | <if test="createTime != null">da_createtime,</if> |
| | | <if test="updateTime != null">da_updatetime,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="platform != null">#{platform,jdbcType=INTEGER},</if> |
| | | <if test="device != null">#{device,jdbcType=VARCHAR},</if> |
| | | <if test="deviceTokenMd5 != null">#{deviceTokenMd5,jdbcType=VARCHAR},</if> |
| | | <if test="deviceToken != null">#{deviceToken,jdbcType=VARCHAR},</if> |
| | | <if test="versionCode != null">#{versionCode,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.push.DeviceActive">update |
| | | yeshi_ec_device_active set da_platform = |
| | | #{platform,jdbcType=INTEGER},da_device = |
| | | #{device,jdbcType=VARCHAR},da_device_token_md5 = |
| | | #{deviceTokenMd5,jdbcType=VARCHAR},da_device_token = |
| | | #{deviceToken,jdbcType=VARCHAR},da_version_code = |
| | | #{versionCode,jdbcType=INTEGER},da_createtime = |
| | | #{createTime,jdbcType=TIMESTAMP},da_updatetime = |
| | | #{updateTime,jdbcType=TIMESTAMP} where da_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.push.DeviceActive"> |
| | | update yeshi_ec_device_active |
| | | <set> |
| | | <if test="platform != null">da_platform=#{platform,jdbcType=INTEGER},</if> |
| | | <if test="device != null">da_device=#{device,jdbcType=VARCHAR},</if> |
| | | <if test="deviceTokenMd5 != null">da_device_token_md5=#{deviceTokenMd5,jdbcType=VARCHAR}, |
| | | </if> |
| | | <if test="deviceToken != null">da_device_token=#{deviceToken,jdbcType=VARCHAR},</if> |
| | | <if test="versionCode != null">da_version_code=#{versionCode,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">da_createtime=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">da_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where da_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | } else if (orderList.get(0).getState() == 1
|
| | | && orderList.get(0).getResultCode() == LostOrder.RESULT_CODE_SUCCESS) {
|
| | | return -1;
|
| | | } else if (orderList.get(0).getState() == 1
|
| | | && orderList.get(0).getResultCode() == LostOrder.RESULT_CODE_FAIL) {
|
| | | } else {
|
| | | return -6;
|
| | | }
|
| | | }
|
| | |
| | | // 订单申诉人工通过后,但是隔了3天还未处理成功就视为该订单申诉失败
|
| | | lostOrderDao.update(
|
| | | "update LostOrder lo set lo.resultCode=? where lo.state=1 and lo.resultCode=? and lo.handleTime<?",
|
| | | new Serializable[] { LostOrder.RESULT_CODE_FAIL, LostOrder.RESULT_CODE_VERFING,
|
| | | new Serializable[] { LostOrder.RESULT_CODE_FAIL, LostOrder.RESULT_CODE_FAIL,
|
| | | System.currentTimeMillis() - 1000 * 60 * 60 * 24 * 3L });
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.push;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.push.DeviceActiveMapper;
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | | import com.yeshi.fanli.service.inter.push.DeviceActiveService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class DeviceActiveServiceImpl implements DeviceActiveService {
|
| | | @Resource
|
| | | private DeviceActiveMapper deviceActiveMapper;
|
| | |
|
| | | @Override
|
| | | public void addDeviceActive(DeviceActive deviceActive) {
|
| | | // 添加记录
|
| | | if (deviceActive == null)
|
| | | return;
|
| | | if (deviceActive.getPlatform() == null)
|
| | | return;
|
| | |
|
| | | if (deviceActive.getVersionCode() == null)
|
| | | return;
|
| | |
|
| | | if (deviceActive.getPlatform() == DeviceActive.PLATFORM_ANDROID
|
| | | && StringUtil.isNullOrEmpty(deviceActive.getDevice()))
|
| | | return;
|
| | |
|
| | | if (deviceActive.getPlatform() == DeviceActive.PLATFORM_IOS
|
| | | && StringUtil.isNullOrEmpty(deviceActive.getDeviceToken()))
|
| | | return;
|
| | |
|
| | | switch (deviceActive.getPlatform()) {
|
| | | case DeviceActive.PLATFORM_ANDROID:
|
| | | // Android的唯一标识为device
|
| | | if (StringUtil.isNullOrEmpty(deviceActive.getDevice()))
|
| | | return;
|
| | | DeviceActive da = deviceActiveMapper.selectByDeviceAndPlatform(deviceActive.getDevice(),
|
| | | deviceActive.getPlatform());
|
| | | if (da == null) {
|
| | | deviceActive.setId(null);
|
| | | deviceActive.setUpdateTime(new Date());
|
| | | deviceActive.setCreateTime(new Date());
|
| | | deviceActiveMapper.insertSelective(deviceActive);
|
| | | } else {
|
| | | DeviceActive updateDeviceActive = new DeviceActive();
|
| | | updateDeviceActive.setId(da.getId());
|
| | | updateDeviceActive.setUpdateTime(new Date());
|
| | | updateDeviceActive.setVersionCode(deviceActive.getVersionCode());
|
| | | deviceActiveMapper.updateByPrimaryKeySelective(updateDeviceActive);
|
| | | }
|
| | |
|
| | | break;
|
| | | case DeviceActive.PLATFORM_IOS:
|
| | | // IOS的设备标识为deviceToken
|
| | | if (StringUtil.isNullOrEmpty(deviceActive.getDeviceToken()))
|
| | | return;
|
| | | deviceActive.setDeviceTokenMd5(StringUtil.Md5(deviceActive.getDeviceToken()));
|
| | | DeviceActive da1 = deviceActiveMapper.selectByDeviceToeknMd5AndPlatform(deviceActive.getDeviceTokenMd5(),
|
| | | deviceActive.getPlatform());
|
| | | if (da1 == null) {
|
| | | deviceActive.setId(null);
|
| | | deviceActive.setUpdateTime(new Date());
|
| | | deviceActive.setCreateTime(new Date());
|
| | | deviceActiveMapper.insertSelective(deviceActive);
|
| | | } else {
|
| | | DeviceActive updateDeviceActive = new DeviceActive();
|
| | | updateDeviceActive.setId(da1.getId());
|
| | | updateDeviceActive.setUpdateTime(new Date());
|
| | | updateDeviceActive.setVersionCode(deviceActive.getVersionCode());
|
| | | deviceActiveMapper.updateByPrimaryKeySelective(updateDeviceActive);
|
| | | }
|
| | |
|
| | | break;
|
| | | default:
|
| | | return;
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.push;
|
| | |
|
| | | import com.yeshi.fanli.entity.push.DeviceActive;
|
| | |
|
| | | public interface DeviceActiveService {
|
| | |
|
| | | /**
|
| | | * 添加用户活跃记录
|
| | | * |
| | | * @param deviceActive
|
| | | */
|
| | | public void addDeviceActive(DeviceActive deviceActive);
|
| | |
|
| | | }
|
| | |
| | |
|
| | | #订单返利到账
|
| | | order_fanli_recieve_title=订单返利到账提示
|
| | | order_fanli_recieve_push=你的订单号:[订单编号]的订单返利¥[金额]元已经转入到你的余额中
|
| | | order_fanli_recieve_msg=你的订单号:[订单编号]的订单返利¥[金额]元已经转入到你的余额中
|
| | | order_fanli_recieve_push=你的订单号:[订单号]的订单返利¥[金额]元已经转入到你的余额中
|
| | | order_fanli_recieve_msg=你的订单号:[订单号]的订单返利¥[金额]元已经转入到你的余额中
|
| | |
|
| | | #返利订单被统计
|
| | | fanli_order_statisticed_title=返利订单已被统计
|