| | |
| | | package com.yeshi.fanli.controller.admin;
|
| | |
|
| | | import java.io.BufferedReader;
|
| | | import java.io.File;
|
| | | import java.io.FileOutputStream;
|
| | | import java.io.FileReader;
|
| | | import java.io.IOException;
|
| | | import java.io.InputStream;
|
| | | import java.io.OutputStream;
|
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | |
| | | import org.yeshi.utils.IPUtil;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | | import org.yeshi.utils.entity.wx.RedPackRecord;
|
| | | import org.yeshi.utils.wx.WXUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | |
| | | import com.yeshi.fanli.service.inter.push.PushRecordService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.FileUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
| | | sb.append(t+"\r\n");
|
| | | }
|
| | |
|
| | | String opid_str = sb.toString();
|
| | | if (!StringUtil.isNullOrEmpty(opid_str) && opid_str.endsWith("\r\n")) {
|
| | | opid_str = opid_str.substring(0, opid_str.length() - 2);
|
| | | }
|
| | | |
| | | OutputStream os = response.getOutputStream();
|
| | | byte[] byt = sb.toString().getBytes();
|
| | | byte[] byt = opid_str.getBytes();
|
| | | os.write(byt);
|
| | | os.flush();
|
| | | os.close();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | |
| | | |
| | | @RequestMapping(value = "preAutoUser")
|
| | | public void preAutoUser(String callback, Integer pageIndex, Integer pageSize, PrintWriter out) {
|
| | | try {
|
| | | List<UserInfo> list = extractService.preAutoUser();
|
| | | if (list == null || list.isEmpty()) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无用户满足自动提现条件"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | if (pageSize == null || pageSize < 1) {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | }
|
| | | |
| | | int count = list.size();
|
| | | int totalPage = count % pageSize == 0 ? count / pageSize : count / pageSize + 1;
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | | |
| | | List<UserInfo> listResult = null;
|
| | | if (pageIndex < totalPage) {
|
| | | int start = (pageIndex - 1) * pageSize;
|
| | | listResult = list.subList(start, start + pageSize);
|
| | | } else if (pageIndex == totalPage) {
|
| | | listResult = list.subList((pageIndex - 1) * pageSize, list.size());
|
| | | } else {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("没有更多了"));
|
| | | return;
|
| | | }
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", listResult);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.controller.admin.homemodule;
|
| | |
|
| | | import java.io.PrintWriter;
|
| | | import java.util.ArrayList;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.springframework.stereotype.Controller;
|
| | | import org.springframework.web.bind.annotation.RequestMapping;
|
| | | import org.yeshi.utils.JsonUtil;
|
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.google.gson.GsonBuilder;
|
| | | import com.google.gson.reflect.TypeToken;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialLabel;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialLabelException;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialLabelService;
|
| | | import com.yeshi.fanli.tag.PageEntity;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | | @Controller
|
| | | @RequestMapping("admin/new/api/v1/specialLabel")
|
| | | public class SpecialLabelAdminController {
|
| | |
|
| | | @Resource
|
| | | private SpecialLabelService specialLabelService;
|
| | | |
| | |
|
| | | /**
|
| | | * 保存信息
|
| | | * |
| | | * @param callback
|
| | | * @param specialLabel
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "save")
|
| | | public void save(String callback, SpecialLabel specialLabel, PrintWriter out) {
|
| | | try {
|
| | | specialLabelService.save(specialLabel);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
|
| | | } catch (SpecialLabelException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param key 模糊查询:说明、标识
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer state, PrintWriter out) {
|
| | | try {
|
| | | // 统计
|
| | | long count = specialLabelService.countQuery(key, state);
|
| | | if (count == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | |
|
| | | if (pageSize == null || pageSize < 1) {
|
| | | pageSize = Constant.PAGE_SIZE;
|
| | | }
|
| | | |
| | | List<SpecialLabel> list = specialLabelService.listQuery((pageIndex - 1) * pageSize, pageSize, key, state);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | | GsonBuilder gsonBuilder = new GsonBuilder();
|
| | | gsonBuilder.serializeNulls(); |
| | | Gson gson = gsonBuilder.setDateFormat("yyyy/MM/dd HH:mm:ss").create();
|
| | |
|
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", gson.toJson(list));
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除
|
| | | * @param callback
|
| | | * @param idArray
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "delete")
|
| | | public void delete(String callback, String idArray, PrintWriter out) {
|
| | | try {
|
| | | if (StringUtil.isNullOrEmpty(idArray)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | Gson gson = new Gson();
|
| | | List<Long> list = gson.fromJson(idArray, new TypeToken<ArrayList<Long>>() {}.getType());
|
| | |
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("未检测到删除的数据"));
|
| | | return;
|
| | | }
|
| | | |
| | | int count = specialLabelService.deleteByPrimaryKeyBatch(list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | | /**
|
| | | * 查询
|
| | | * @param callback
|
| | | * @param pageIndex
|
| | | * @param pageSize
|
| | | * @param key 模糊查询:说明、标识
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "getBySpecialId")
|
| | | public void getBySpecialId(String callback, Long specialId, PrintWriter out) {
|
| | | try {
|
| | | List<SpecialLabel> list = specialLabelService.getLabelsBySpecialId(specialId);
|
| | | if (list == null) {
|
| | | list = new ArrayList<SpecialLabel>();
|
| | | }
|
| | | |
| | | int count = list.size();
|
| | | PageEntity pe = new PageEntity(1, count, count, 1);
|
| | | |
| | | JSONObject data = new JSONObject();
|
| | | data.put("pe", pe);
|
| | | data.put("result_list", list);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 批量商品添加标签-关联lableId
|
| | | * |
| | | * @param callback
|
| | | * @param labIds
|
| | | * @param goodIds
|
| | | * @param request
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "batchGoodsAddLables")
|
| | | public void batchGoodsAddLables(String callback, String labIds, String ids, HttpServletRequest request, PrintWriter out) {
|
| | | if (StringUtil.isNullOrEmpty(ids)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择需操作的专题"));
|
| | | return;
|
| | | }
|
| | |
|
| | | Gson gson = new Gson();
|
| | | List<Long> idList = gson.fromJson(ids, new TypeToken<ArrayList<Long>>() {}.getType());
|
| | | if (idList == null || idList.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择需操作的专题"));
|
| | | return;
|
| | | }
|
| | | |
| | | try {
|
| | | List<Long> labIdList = gson.fromJson(labIds, new TypeToken<ArrayList<Long>>() {}.getType());
|
| | | specialLabelService.stickLabelOnSpecial(idList, labIdList);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.entity.accept.AcceptData;
|
| | | import com.yeshi.fanli.entity.bus.clazz.GoodsClass;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.Special;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialLabel;
|
| | | import com.yeshi.fanli.entity.dynamic.DynamicInfo;
|
| | | import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
|
| | | import com.yeshi.fanli.service.inter.dynamic.DynamicInfoService;
|
| | |
| | |
|
| | | @Resource
|
| | | private SpecialService specialService;
|
| | | |
| | |
|
| | |
|
| | | /**
|
| | |
| | | listKey.add("special_channel_pdd");
|
| | | }
|
| | |
|
| | | List<Special> list = specialService.listByPlaceKeyList((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, listKey, platformCode,
|
| | | List<Special> list = specialService.listByPlaceKeyHasLabel((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE, listKey, platformCode,
|
| | | Integer.parseInt(acceptData.getVersion()));
|
| | |
|
| | | long time = System.currentTimeMillis();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | if (Constant.IS_TEST) {// 测试标签
|
| | | List<ClientTextStyleVO> labels = new ArrayList<>();
|
| | | labels.add(new ClientTextStyleVO("文章标签", "#FE0014"));
|
| | | labels.add(new ClientTextStyleVO("标签内容", "#FE0014"));
|
| | | special.setLabels(labels);
|
| | | List<SpecialLabel> listLabels = special.getListLabels();
|
| | | if (listLabels != null && !listLabels.isEmpty()) {
|
| | | List<ClientTextStyleVO> labels = new ArrayList<>();
|
| | | for (SpecialLabel specialLabel: listLabels) {
|
| | | labels.add(new ClientTextStyleVO(specialLabel.getName(), specialLabel.getBgColor()));
|
| | | }
|
| | | special.setLabels(labels);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | * @param count
|
| | | * @return
|
| | | */
|
| | | List<Long> getAutoExtractUserIds(@Param("start") int start, @Param("count") int count, @Param("money") BigDecimal money);
|
| | | List<UserInfo> getAutoExtractUserIds(@Param("start") int start, @Param("count") int count, @Param("money") BigDecimal money);
|
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.homemodule; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialLabelMap; |
| | | |
| | | public interface SpecialLabelMapMapper extends BaseMapper<SpecialLabelMap> { |
| | | |
| | | /** |
| | | * 删除此专题所有标签 |
| | | * @param list |
| | | */ |
| | | void deleteBySpecialIds(@Param("list")List<Long> list); |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.homemodule; |
| | | |
| | | import java.util.List; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialLabel; |
| | | |
| | | public interface SpecialLabelMapper extends BaseMapper<SpecialLabel> { |
| | | |
| | | /** |
| | | * 批量删除 |
| | | * @param list 主键id |
| | | * @return |
| | | */ |
| | | int deleteByPrimaryKeyBatch(List<Long> list); |
| | | |
| | | |
| | | /** |
| | | * 查询列表-后台 |
| | | * @param start |
| | | * @param count |
| | | * @param key |
| | | * @param state |
| | | * @return |
| | | */ |
| | | List<SpecialLabel> listQuery(@Param("start") long start, @Param("count") int count, @Param("key") String key, @Param("state")Integer state); |
| | | |
| | | long countQuery(@Param("key") String key, @Param("state")Integer state); |
| | | |
| | | |
| | | /** |
| | | * 查询专题标题 |
| | | * @param specialId |
| | | * @return |
| | | */ |
| | | List<SpecialLabel> getLabelsBySpecialId(@Param("specialId")Long specialId); |
| | | |
| | | } |
| | |
| | | long countByPlaceKeyList(@Param("list") List<String> list, @Param("sex")Integer sex
|
| | | , @Param("platform") Integer platform, @Param("versionCode") Integer versionCode);
|
| | |
|
| | | |
| | | |
| | | /**
|
| | | * 根据多个位置标识查询
|
| | | * @param list
|
| | | * @param sex
|
| | | * @param platform
|
| | | * @param versionCode
|
| | | * @return
|
| | | */
|
| | | List<Special> listByPlaceKeyHasLabel(@Param("start")long start, @Param("count")int count,@Param("list") List<String> list, @Param("sex")Integer sex
|
| | | , @Param("platform") Integer platform, @Param("versionCode") Integer versionCode);
|
| | | |
| | | } |
| | |
| | | @Expose
|
| | | private long countDownTime;//倒计时
|
| | |
|
| | | private List<SpecialLabel> listLabels; //标签
|
| | | |
| | | @Expose
|
| | | private List<ClientTextStyleVO> labels; //标签
|
| | |
|
| | |
| | | this.labels = labels;
|
| | | }
|
| | |
|
| | | public List<SpecialLabel> getListLabels() {
|
| | | return listLabels;
|
| | | }
|
| | |
|
| | | public void setListLabels(List<SpecialLabel> listLabels) {
|
| | | this.listLabels = listLabels;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.homemodule;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 专题标签
|
| | | * |
| | | */
|
| | | @Table("yeshi_ec_special_label")
|
| | | public class SpecialLabel implements Serializable {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | |
|
| | | @Column(name = "sl_id")
|
| | | private Long id;
|
| | |
|
| | | // 名称
|
| | | @Column(name = "sl_name")
|
| | | private String name;
|
| | |
|
| | | // 背景颜色
|
| | | @Column(name = "sl_bg_color")
|
| | | private String bgColor;
|
| | | |
| | | // 备注
|
| | | @Column(name = "sl_remark")
|
| | | private String remark;
|
| | | |
| | | // 状态:1启用 0停用
|
| | | @Column(name = "sl_state")
|
| | | private Integer state;
|
| | | |
| | | // 创建时间
|
| | | @Column(name = "sl_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | // 更新时间
|
| | | @Column(name = "sl_update_time")
|
| | | private Date updateTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public String getName() {
|
| | | return name;
|
| | | }
|
| | |
|
| | | public void setName(String name) {
|
| | | this.name = name;
|
| | | }
|
| | |
|
| | | public String getRemark() {
|
| | | return remark;
|
| | | }
|
| | |
|
| | | public void setRemark(String remark) {
|
| | | this.remark = remark;
|
| | | }
|
| | |
|
| | | public Integer getState() {
|
| | | return state;
|
| | | }
|
| | |
|
| | | public void setState(Integer state) {
|
| | | this.state = state;
|
| | | }
|
| | |
|
| | | 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;
|
| | | }
|
| | |
|
| | | public String getBgColor() {
|
| | | return bgColor;
|
| | | }
|
| | |
|
| | | public void setBgColor(String bgColor) {
|
| | | this.bgColor = bgColor;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.entity.bus.homemodule;
|
| | |
|
| | | import java.io.Serializable;
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 专题标签映射
|
| | | * |
| | | */
|
| | | /**
|
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_special_label_map")
|
| | | public class SpecialLabelMap implements Serializable {
|
| | |
|
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | |
|
| | | @Column(name = "slm_id")
|
| | | private Long id;
|
| | |
|
| | | // 专题id
|
| | | @Column(name = "slm_spid")
|
| | | private Long spid;
|
| | |
|
| | | // 标签id
|
| | | @Column(name = "slm_lab_id")
|
| | | private Long labId;
|
| | | |
| | | @Column(name = "slm_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public Long getSpid() {
|
| | | return spid;
|
| | | }
|
| | |
|
| | | public void setSpid(Long spid) {
|
| | | this.spid = spid;
|
| | | }
|
| | |
|
| | | public Long getLabId() {
|
| | | return labId;
|
| | | }
|
| | |
|
| | | public void setLabId(Long labId) {
|
| | | this.labId = labId;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | |
|
| | | }
|
New file |
| | |
| | | package com.yeshi.fanli.exception.homemodule;
|
| | |
|
| | | import com.yeshi.fanli.exception.BaseException;
|
| | |
|
| | | public class SpecialLabelException extends BaseException {
|
| | | |
| | | private static final long serialVersionUID = 1L;
|
| | | |
| | | public SpecialLabelException(int code, String msg) {
|
| | | super(code, msg);
|
| | | }
|
| | |
|
| | | public SpecialLabelException() {
|
| | | super();
|
| | | }
|
| | | }
|
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.homemodule.SpecialLabelMapMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.SpecialLabelMap"> |
| | | <id column="slm_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="slm_spid" property="spid" jdbcType="BIGINT"/> |
| | | <result column="slm_lab_id" property="labId" jdbcType="BIGINT"/> |
| | | <result column="slm_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">slm_id,slm_spid,slm_lab_id,slm_create_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_special_label_map where slm_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_special_label_map where slm_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialLabelMap" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special_label_map (slm_id,slm_spid,slm_lab_id,slm_create_time) values (#{id,jdbcType=BIGINT},#{spid,jdbcType=BIGINT},#{labId,jdbcType=BIGINT},#{createTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialLabelMap" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special_label_map |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">slm_id,</if> |
| | | <if test="spid != null">slm_spid,</if> |
| | | <if test="labId != null">slm_lab_id,</if> |
| | | <if test="createTime != null">slm_create_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="spid != null">#{spid,jdbcType=BIGINT},</if> |
| | | <if test="labId != null">#{labId,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialLabelMap">update yeshi_ec_special_label_map set slm_spid = #{spid,jdbcType=BIGINT},slm_lab_id = #{labId,jdbcType=BIGINT},slm_create_time = #{createTime,jdbcType=TIMESTAMP} where slm_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialLabelMap">update yeshi_ec_special_label_map |
| | | <set> |
| | | <if test="spid != null">slm_spid=#{spid,jdbcType=BIGINT},</if> |
| | | <if test="labId != null">slm_lab_id=#{labId,jdbcType=BIGINT},</if> |
| | | <if test="createTime != null">slm_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where slm_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <delete id="deleteBySpecialIds" parameterType="java.util.List"> |
| | | delete from yeshi_ec_special_label_map |
| | | WHERE slm_spid in <foreach collection="list" item="item" open="(" close=")" separator=",">#{item}</foreach> |
| | | </delete> |
| | | |
| | | |
| | | </mapper> |
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.homemodule.SpecialLabelMapper"> |
| | | <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.homemodule.SpecialLabel"> |
| | | <id column="sl_id" property="id" jdbcType="BIGINT"/> |
| | | <result column="sl_name" property="name" jdbcType="VARCHAR"/> |
| | | <result column="sl_bg_color" property="bgColor" jdbcType="VARCHAR"/> |
| | | <result column="sl_remark" property="remark" jdbcType="VARCHAR"/> |
| | | <result column="sl_state" property="state" jdbcType="INTEGER"/> |
| | | <result column="sl_create_time" property="createTime" jdbcType="TIMESTAMP"/> |
| | | <result column="sl_update_time" property="updateTime" jdbcType="TIMESTAMP"/> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">sl_id,sl_name,sl_bg_color,sl_remark,sl_state,sl_create_time,sl_update_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long">select |
| | | <include refid="Base_Column_List"/>from yeshi_ec_special_label where sl_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_special_label where sl_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialLabel" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special_label (sl_id,sl_name,sl_bg_color,sl_remark,sl_state,sl_create_time,sl_update_time) values (#{id,jdbcType=BIGINT},#{name,jdbcType=VARCHAR},#{bgColor,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP})</insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialLabel" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_special_label |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">sl_id,</if> |
| | | <if test="name != null">sl_name,</if> |
| | | <if test="bgColor != null">sl_bg_color,</if> |
| | | <if test="remark != null">sl_remark,</if> |
| | | <if test="state != null">sl_state,</if> |
| | | <if test="createTime != null">sl_create_time,</if> |
| | | <if test="updateTime != null">sl_update_time,</if> |
| | | </trim>values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="name != null">#{name,jdbcType=VARCHAR},</if> |
| | | <if test="bgColor != null">#{bgColor,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null">#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="state != null">#{state,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.bus.homemodule.SpecialLabel">update yeshi_ec_special_label set sl_name = #{name,jdbcType=VARCHAR},sl_bg_color = #{bgColor,jdbcType=VARCHAR},sl_remark = #{remark,jdbcType=VARCHAR},sl_state = #{state,jdbcType=INTEGER},sl_create_time = #{createTime,jdbcType=TIMESTAMP},sl_update_time = #{updateTime,jdbcType=TIMESTAMP} where sl_id = #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.homemodule.SpecialLabel">update yeshi_ec_special_label |
| | | <set> |
| | | <if test="name != null">sl_name=#{name,jdbcType=VARCHAR},</if> |
| | | <if test="bgColor != null">sl_bg_color=#{bgColor,jdbcType=VARCHAR},</if> |
| | | <if test="remark != null">sl_remark=#{remark,jdbcType=VARCHAR},</if> |
| | | <if test="state != null">sl_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">sl_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">sl_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | </set> where sl_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | <delete id="deleteByPrimaryKeyBatch" parameterType="java.util.List"> |
| | | delete from yeshi_ec_special_label |
| | | WHERE sl_id in <foreach collection="list" item="item" open="(" close=")" separator=",">#{item}</foreach> |
| | | </delete> |
| | | |
| | | |
| | | <select id="listQuery" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_special_label` |
| | | WHERE 1=1 |
| | | <if test='key != null and key != ""'> |
| | | AND sl_name like '%${key}%' |
| | | </if> |
| | | <if test='state != null'> |
| | | AND sl_state = #{state} |
| | | </if> |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countQuery" resultType="java.lang.Long"> |
| | | SELECT IFNULL(count(sl_id),0) FROM `yeshi_ec_special_label` |
| | | WHERE 1=1 |
| | | <if test='key != null and key != ""'> |
| | | AND sl_name like '%${key}%' |
| | | </if> |
| | | <if test='state != null'> |
| | | AND sl_state = #{state} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getLabelsBySpecialId" resultMap="BaseResultMap"> |
| | | SELECT <include refid="Base_Column_List" /> FROM `yeshi_ec_special_label` l |
| | | LEFT JOIN yeshi_ec_special_label_map m ON m.`slm_lab_id` = l.`sl_id` |
| | | WHERE l.`sl_state` = 1 AND m.`slm_spid` = #{specialId} |
| | | </select> |
| | | </mapper> |
| | |
| | | <association property="jumpDetail" column="b_jumpid"
|
| | | select="com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper.selectByPrimaryKey">
|
| | | </association>
|
| | |
|
| | | </resultMap>
|
| | | |
| | | |
| | | <resultMap id="ResultLableMap" type="com.yeshi.fanli.entity.bus.homemodule.Special">
|
| | | <id column="b_id" property="id" jdbcType="BIGINT" />
|
| | | <result column="b_name" property="name" jdbcType="VARCHAR" />
|
| | | <result column="b_card" property="card" jdbcType="VARCHAR" />
|
| | | <result column="b_card_id" property="cardId" jdbcType="BIGINT" />
|
| | | <result column="b_main_picture" property="picture" jdbcType="VARCHAR" />
|
| | | <result column="b_icon" property="icon" jdbcType="VARCHAR" />
|
| | | <result column="b_sub_picture" property="subPicture" jdbcType="VARCHAR" />
|
| | | <result column="b_params" property="params" jdbcType="VARCHAR" />
|
| | | <result column="b_jump_login" property="jumpLogin" jdbcType="VARCHAR" />
|
| | | <result column="b_orderby" property="orderby" jdbcType="INTEGER" />
|
| | | <result column="b_order_man" property="orderMan" jdbcType="INTEGER" />
|
| | | <result column="b_order_woman" property="orderWoman" jdbcType="INTEGER" />
|
| | | <result column="b_state" property="state" jdbcType="BIGINT" />
|
| | | <result column="b_sex" property="sex" jdbcType="INTEGER" />
|
| | | <result column="b_show_type" property="showType" jdbcType="VARCHAR" />
|
| | | <result column="b_remark" property="remark" jdbcType="VARCHAR" />
|
| | | <result column="b_min_android_version_code" property="minAndroidVersionCode" jdbcType="INTEGER"/>
|
| | | <result column="b_min_ios_version_code" property="minIOSVersionCode" jdbcType="INTEGER"/>
|
| | | <result column="b_start_time" property="startTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="b_end_time" property="endTime" jdbcType="TIMESTAMP"/>
|
| | | <result column="b_createtime" property="createtime" jdbcType="TIMESTAMP" />
|
| | | <result column="b_updatetime" property="updatetime" jdbcType="TIMESTAMP" />
|
| | |
|
| | | <!-- 背景图片 -->
|
| | | <result column="cd_bottom_picture" property="bottomPicture"
|
| | | jdbcType="VARCHAR" />
|
| | |
|
| | | <association property="jumpDetail" column="b_jumpid"
|
| | | select="com.yeshi.fanli.dao.mybatis.common.JumpDetailV2Mapper.selectByPrimaryKey">
|
| | | </association>
|
| | | |
| | | <collection property="listLabels" column="sl_id" resultMap="com.yeshi.fanli.dao.mybatis.homemodule.SpecialLabelMapper.BaseResultMap"/>
|
| | | </resultMap>
|
| | | |
| | | |
| | | <sql id="Base_Column_List">b_id,b_name,b_card,b_card_id,b_main_picture,b_icon,b_sub_picture,b_jumpid,b_params,b_jump_login,b_orderby,b_order_man,b_order_woman,b_state,b_sex,b_show_type,b_remark,b_min_android_version_code,b_min_ios_version_code,b_start_time,b_end_time,b_createtime,b_updatetime</sql>
|
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap"
|
| | | parameterType="java.lang.Long">
|
| | |
| | | </if>
|
| | | <include refid="Sex_Screen" />
|
| | | </select>
|
| | | |
| | | |
| | | <select id="listByPlaceKeyHasLabel" resultMap="ResultLableMap">
|
| | | SELECT sp.*,c.`cd_bottom_picture`,lab.* FROM `yeshi_ec_special` sp
|
| | | RIGHT JOIN
|
| | | (SELECT c.* FROM yeshi_ec_special_card c
|
| | | LEFT JOIN
|
| | | `yeshi_ec_special_place` pc ON pc.`sp_id` = c.`cd_place_id`
|
| | | WHERE
|
| | | c.`cd_state` = 0
|
| | | AND IF(c.`cd_start_time` IS NULL,TRUE,
|
| | | c.`cd_start_time`<![CDATA[<=]]>NOW())
|
| | | AND IF(c.`cd_end_time` IS NULL,TRUE,c.`cd_end_time`<![CDATA[>=]]>NOW())
|
| | | AND pc.`sp_key` in
|
| | | <foreach collection="list" item="item" open="(" close=")" separator=",">
|
| | | #{item}
|
| | | </foreach>
|
| | | )c ON sp.`b_card_id` = c.`cd_id`
|
| | | LEFT JOIN `yeshi_ec_special_label_map` mp ON mp.`slm_spid` = sp.`b_id`
|
| | | LEFT JOIN (SELECT * FROM yeshi_ec_special_label WHERE sl_state = 1)lab ON lab.sl_id = mp.`slm_lab_id`
|
| | | WHERE sp.`b_state` = 0 |
| | | AND IF(sp.b_start_time IS NULL,TRUE, sp.b_start_time<![CDATA[<=]]> NOW()) |
| | | AND IF(sp.b_end_time IS NULL,TRUE, sp.b_end_time <![CDATA[>=]]> NOW())
|
| | | <if test="platform == 1">
|
| | | AND IF(sp.`b_min_android_version_code` IS NOT NULL, #{versionCode}<![CDATA[>=]]> sp.b_min_android_version_code,TRUE)
|
| | | </if>
|
| | | <if test="platform == 2">
|
| | | AND IF(sp.`b_min_ios_version_code` IS NOT NULL, #{versionCode}<![CDATA[>=]]> sp.b_min_ios_version_code,TRUE)
|
| | | </if>
|
| | | <include refid="Sex_Screen" />
|
| | | <if test="sex == null"> ORDER BY sp.`b_orderby`</if>
|
| | | LIMIT ${start},${count}
|
| | | </select>
|
| | | |
| | | </mapper>
|
New file |
| | |
| | | package com.yeshi.fanli.service.impl.homemodule;
|
| | |
|
| | | import java.util.Date;
|
| | | import java.util.List;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | |
|
| | | import org.springframework.stereotype.Service;
|
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.homemodule.SpecialLabelMapMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.homemodule.SpecialLabelMapper;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialLabel;
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialLabelMap;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialLabelException;
|
| | | import com.yeshi.fanli.service.inter.homemodule.SpecialLabelService;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | @Service
|
| | | public class SpecialLabelImpl implements SpecialLabelService {
|
| | |
|
| | | @Resource
|
| | | private SpecialLabelMapper specialLabelMapper;
|
| | | |
| | | @Resource
|
| | | private SpecialLabelMapMapper specialLabelMapMapper;
|
| | | |
| | | |
| | | @Override
|
| | | public void save(SpecialLabel record) throws SpecialLabelException{
|
| | | String name = record.getName();
|
| | | if (StringUtil.isNullOrEmpty(name))
|
| | | throw new SpecialLabelException(1, "名称不能为空");
|
| | | |
| | | String bgColor = record.getBgColor();
|
| | | if (StringUtil.isNullOrEmpty(bgColor))
|
| | | throw new SpecialLabelException(1, "背景色不能为空");
|
| | | |
| | | if (record.getState() == null)
|
| | | record.setState(0);
|
| | | |
| | | record.setUpdateTime(new Date());
|
| | | |
| | | Long id = record.getId();
|
| | | if (id == null) {
|
| | | record.setCreateTime(new Date());
|
| | | specialLabelMapper.insert(record);
|
| | | } else {
|
| | | SpecialLabel resultObj = specialLabelMapper.selectByPrimaryKey(id);
|
| | | if (resultObj == null)
|
| | | throw new SpecialLabelException(1, "操作内容已不存在");
|
| | |
|
| | | record.setCreateTime(resultObj.getCreateTime());
|
| | | specialLabelMapper.updateByPrimaryKey(record);
|
| | | }
|
| | | }
|
| | | |
| | |
|
| | | @Override
|
| | | public int deleteByPrimaryKeyBatch(List<Long> list){
|
| | | return specialLabelMapper.deleteByPrimaryKeyBatch(list);
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | @Override
|
| | | public List<SpecialLabel> listQuery(long start, int count, String key, Integer state) {
|
| | | return specialLabelMapper.listQuery(start, count, key, state);
|
| | | }
|
| | |
|
| | |
|
| | | @Override
|
| | | public long countQuery(String key, Integer state) {
|
| | | return specialLabelMapper.countQuery(key, state);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<SpecialLabel> getLabelsBySpecialId(Long specialId) {
|
| | | return specialLabelMapper.getLabelsBySpecialId(specialId);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | @Transactional(rollbackFor= Exception.class)
|
| | | public void stickLabelOnSpecial(List<Long> idList, List<Long> labIdList) {
|
| | | if (idList == null || idList.isEmpty())
|
| | | return;
|
| | | |
| | | // 清空标签
|
| | | specialLabelMapMapper.deleteBySpecialIds(idList);
|
| | | |
| | | if (labIdList == null || labIdList.isEmpty()) {
|
| | | return;
|
| | | }
|
| | | |
| | | // 新增标签
|
| | | Date date = new Date();
|
| | | for (Long id:idList) {
|
| | | for (Long labid:labIdList) {
|
| | | SpecialLabelMap objectMap = new SpecialLabelMap();
|
| | | objectMap.setLabId(labid);
|
| | | objectMap.setSpid(id);
|
| | | objectMap.setCreateTime(date);
|
| | | specialLabelMapMapper.insertSelective(objectMap);
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | |
| | | public long countByPlaceKeyList(List<String> list, Integer platform, Integer versionCode) {
|
| | | return specialMapper.countByPlaceKeyList(list, null, platform, versionCode);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Cacheable(value = "specialCache", key = "'listByPlaceKeyHasLabel'+#start+'-'+#platform+'-'+#versionCode+'-'+#list")
|
| | | public List<Special> listByPlaceKeyHasLabel(long start, int count, List<String> list, Integer platform, Integer versionCode) {
|
| | | return specialMapper.listByPlaceKeyHasLabel(start, count, list, null, platform, versionCode);
|
| | | }
|
| | | |
| | |
|
| | | /**
|
| | | * 处理 数据
|
| | |
| | | }
|
| | |
|
| | |
|
| | | |
| | | @Override
|
| | | public List<UserInfo> preAutoUser() throws Exception {
|
| | | int page = 0;
|
| | | int pageSize = 100;
|
| | | int maxSize = 300;
|
| | | Date nowDate = new Date();
|
| | | // 条件3:距离上一次成功领取微信红包已经超过了30天时间,可在第31天再次下发;
|
| | | String receivedDate = DateUtil.reduceDayTostring(30, nowDate);
|
| | | // 条件4:距离上一次未成功领取微信红包已经超过了15天时间,可在第16天再次下发;
|
| | | String refundDate = DateUtil.reduceDayTostring(15, nowDate);
|
| | | |
| | | // 余额最低限制
|
| | | BigDecimal minSurplus = BigDecimal.valueOf(Constant.AUTO_EXTRACT_MIN_SURPLUS);
|
| | | |
| | | List<UserInfo> list = new ArrayList<UserInfo>();
|
| | | |
| | | while (true) {
|
| | | // 查询满足条件 1、2 的uid
|
| | | List<UserInfo> listUser = userInfoService.getAutoExtractUserIds(page * pageSize, pageSize, minSurplus);
|
| | | if (listUser == null || listUser.isEmpty())
|
| | | break;
|
| | | |
| | | List<Long> listId = new ArrayList<Long>();
|
| | | for (UserInfo userInfo: listUser) {
|
| | | listId.add(userInfo.getId());
|
| | | }
|
| | | |
| | | // 查询记录是否满足
|
| | | List<Long> listValid = extractWeiXinRecordService.getValidUsers(listId, receivedDate, refundDate);
|
| | | if (listValid == null || listValid.isEmpty()) {
|
| | | page ++;
|
| | | continue;
|
| | | }
|
| | | |
| | | for (Long uid: listValid) {
|
| | | if (list.size() >= maxSize)
|
| | | break;
|
| | | for (UserInfo userInfo: listUser) {
|
| | | if (list.size() >= maxSize)
|
| | | break;
|
| | | |
| | | if (userInfo.getId().longValue() == uid.longValue()) {
|
| | | list.add(userInfo);
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | |
| | | if (list.size() >= maxSize)
|
| | | break;
|
| | | |
| | | page ++;
|
| | | }
|
| | | return list;
|
| | | }
|
| | | |
| | | |
| | | |
| | | @Override
|
| | | public List<String> getAutoExtractOpenIds() throws Exception {
|
| | | int page = 0;
|
| | | int pageSize = 100;
|
| | | int maxSize = 300;
|
| | | int maxSize = 301; // appId + 实际openid300个
|
| | | Date nowDate = new Date();
|
| | | // 条件3:距离上一次成功领取微信红包已经超过了30天时间,可在第31天再次下发;
|
| | | String receivedDate = DateUtil.reduceDayTostring(30, nowDate);
|
| | |
| | |
|
| | | while (true) {
|
| | | // 查询满足条件 1、2 的uid
|
| | | List<Long> listId = userInfoService.getAutoExtractUserIds(page * pageSize, pageSize, minSurplus);
|
| | | if (listId == null || listId.isEmpty())
|
| | | List<UserInfo> listUser = userInfoService.getAutoExtractUserIds(page * pageSize, pageSize, minSurplus);
|
| | | if (listUser == null || listUser.isEmpty())
|
| | | break;
|
| | | |
| | | List<Long> listId = new ArrayList<Long>();
|
| | | for (UserInfo userInfo: listUser) {
|
| | | listId.add(userInfo.getId());
|
| | | }
|
| | |
|
| | | // 查询记录是否满足
|
| | | List<Long> listValid = extractWeiXinRecordService.getValidUsers(listId, receivedDate, refundDate);
|
| | |
| | | @Transactional(rollbackFor = Exception.class)
|
| | | private UserInfo subHongBaoByUid(Long uid, BigDecimal money, BigDecimal minSurplus) {
|
| | | UserInfo userInfo = userInfoMapper.selectByPrimaryKeyForUpdate(uid);
|
| | | if (userInfo != null && userInfo.getMyHongBao().compareTo(minSurplus) >= 0) {
|
| | | if (userInfo != null && !StringUtil.isNullOrEmpty(userInfo.getWxOpenId())
|
| | | && !StringUtil.isNullOrEmpty(userInfo.getWxUnionId()) && userInfo.getMyHongBao().compareTo(minSurplus) >= 0) {
|
| | | // 微信提现记录
|
| | | ExtractWeiXinRecord extractRecord = new ExtractWeiXinRecord();
|
| | | extractRecord.setUid(uid);
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | public List<Long> getAutoExtractUserIds(int start, int count, BigDecimal minSurplus) {
|
| | | public List<UserInfo> getAutoExtractUserIds(int start, int count, BigDecimal minSurplus) {
|
| | | return userInfoMapper.getAutoExtractUserIds(start, count, minSurplus);
|
| | | }
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.service.inter.homemodule;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | import com.yeshi.fanli.entity.bus.homemodule.SpecialLabel;
|
| | | import com.yeshi.fanli.exception.homemodule.SpecialLabelException;
|
| | |
|
| | | public interface SpecialLabelService {
|
| | |
|
| | | public void save(SpecialLabel record) throws SpecialLabelException;
|
| | |
|
| | | /**
|
| | | * 批量删除
|
| | | * @param list 主键id
|
| | | * @return
|
| | | */
|
| | | public int deleteByPrimaryKeyBatch(List<Long> list);
|
| | |
|
| | | /**
|
| | | * 查询列表- 后台
|
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param state
|
| | | * @return
|
| | | */
|
| | | public List<SpecialLabel> listQuery(long start, int count, String key, Integer state);
|
| | |
|
| | | public long countQuery(String key, Integer state);
|
| | |
|
| | | |
| | | /**
|
| | | * 查询专题相应有效的标签
|
| | | * @param specialId
|
| | | * @return
|
| | | */
|
| | | public List<SpecialLabel> getLabelsBySpecialId(Long specialId);
|
| | |
|
| | | /**
|
| | | * 专题贴上标签
|
| | | * @param idList
|
| | | * @param labIdList
|
| | | */
|
| | | public void stickLabelOnSpecial(List<Long> idList, List<Long> labIdList);
|
| | |
|
| | |
|
| | | }
|
| | |
| | |
|
| | | public long countByPlaceKeyList(List<String> list, Integer platform, Integer versionCode);
|
| | |
|
| | |
|
| | | /**
|
| | | * 查询专题并返回标签
|
| | | * @param list
|
| | | * @param platform
|
| | | * @param versionCode
|
| | | * @return
|
| | | */
|
| | | public List<Special> listByPlaceKeyHasLabel(long start, int count, List<String> list, Integer platform, Integer versionCode);
|
| | |
|
| | |
|
| | | }
|
| | |
| | | * @throws ExtractException
|
| | | */
|
| | | public void updateManualExtractRecord(List<RedPackRecord> list) throws ExtractException;
|
| | |
|
| | | /**
|
| | | * |
| | | * @return
|
| | | * @throws Exception
|
| | | */
|
| | | public List<UserInfo> preAutoUser() throws Exception;
|
| | |
|
| | | }
|
| | |
| | | * @param page
|
| | | * @param count
|
| | | */
|
| | | public List<Long> getAutoExtractUserIds(int page, int count, BigDecimal minSurplus);
|
| | | public List<UserInfo> getAutoExtractUserIds(int page, int count, BigDecimal minSurplus);
|
| | |
|
| | | }
|