| | |
| | | </projects>
|
| | | <buildSpec>
|
| | | <buildCommand>
|
| | | <name>org.eclipse.wst.common.project.facet.core.builder</name>
|
| | | <arguments>
|
| | | </arguments>
|
| | | </buildCommand>
|
| | | <buildCommand>
|
| | | <name>org.eclipse.jdt.core.javabuilder</name>
|
| | | <arguments>
|
| | | </arguments>
|
| | |
| | | <natures>
|
| | | <nature>org.eclipse.jdt.core.javanature</nature>
|
| | | <nature>org.eclipse.m2e.core.maven2Nature</nature>
|
| | | <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
| | | </natures>
|
| | | </projectDescription>
|
| | |
| | | <?xml version="1.0" encoding="UTF-8"?>
|
| | | <classpath>
|
| | | <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resource">
|
| | | <attributes>
|
| | | <attribute name="maven.pomderived" value="true"/>
|
| | | </attributes>
|
| | | </classpathentry>
|
| | | <classpathentry including="**/*.java" kind="src" output="target/classes" path="src/main/java">
|
| | | <attributes>
|
| | | <attribute name="optional" value="true"/>
|
| | |
| | | <attributes>
|
| | | <attribute name="optional" value="true"/>
|
| | | <attribute name="maven.pomderived" value="true"/>
|
| | | <attribute name="test" value="true"/>
|
| | | </attributes>
|
| | | </classpathentry>
|
| | | <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
| | |
| | | <attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
| | | </attributes>
|
| | | </classpathentry>
|
| | | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
| | | <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resource">
|
| | | <attributes>
|
| | | <attribute name="maven.pomderived" value="true"/>
|
| | | </attributes>
|
| | | </classpathentry>
|
| | | <classpathentry kind="lib" path="libs/aes-jre1.6.jar"/>
|
| | | <classpathentry kind="lib" path="libs/alipay-sdk-java20170324180803.jar"/>
|
| | | <classpathentry kind="lib" path="libs/HMS_SDK_2.6.0.301_ADT.jar"/>
|
| | | <classpathentry kind="lib" path="libs/HMSAgent_2.6.0.302.jar"/>
|
| | | <classpathentry kind="lib" path="libs/javapns-jdk16-2.3.1.jar"/>
|
| | | <classpathentry kind="lib" path="libs/MiPush_SDK_Server_2_2_18.jar"/>
|
| | | <classpathentry kind="lib" path="libs/open-api-sdk-2.0.jar"/>
|
| | | <classpathentry kind="lib" path="libs/PushJavaSDK.jar"/>
|
| | | <classpathentry kind="lib" path="libs/taobao-sdk-java-auto_1533536267316-20180829.jar"/>
|
| | | <classpathentry kind="lib" path="libs/ueditor-1.1.2.jar"/>
|
| | | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_181"/>
|
| | | <classpathentry kind="output" path="target/classes"/>
|
| | | </classpath>
|
| | |
| | | import com.yeshi.fanli.util.AESUtil;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | // 计入记录
|
| | |
|
| | | try {
|
| | | String result = TaoKeApiUtil.getAccessToken(code, Constant.TAOBAO_AUTH_APPKEY,
|
| | | Constant.TAOBAO_AUTH_APPSECRET);
|
| | | String result = TaoKeApiUtil.getAccessToken(code, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | JSONObject data = JSONObject.fromObject(result);
|
| | | data = data.optJSONObject("top_auth_token_create_response").optJSONObject("token_result");
|
| | | String accessToken = data.optString("access_token");
|
| | |
| | |
|
| | | // 获取渠道ID与会员ID
|
| | | if ("share".equalsIgnoreCase(source)) {
|
| | | String relationId = TaoKeApiUtil.getRelationId(accessToken, Constant.TAOBAO_AUTH_APPKEY,
|
| | | Constant.TAOBAO_AUTH_APPSECRET);// 渠道ID
|
| | | String relationId = TaoKeApiUtil.getRelationId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);// 渠道ID
|
| | | if (StringUtil.isNullOrEmpty(relationId))
|
| | | LogHelper.test(uid + "渠道备案失败");
|
| | | try {
|
| | |
| | | errCode = 5;
|
| | | }
|
| | | } else if ("zigou".equalsIgnoreCase(source)) {
|
| | | String specialId = TaoKeApiUtil.getSpecialId(accessToken, Constant.TAOBAO_AUTH_APPKEY,
|
| | | Constant.TAOBAO_AUTH_APPSECRET);
|
| | | String specialId = TaoKeApiUtil.getSpecialId(accessToken, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | |
| | | if (StringUtil.isNullOrEmpty(specialId))
|
| | | LogHelper.test(uid + "会员备案失败");
|
| | | try {
|
| | |
| | |
|
| | | boolean bindInfo = true;
|
| | | // 绑定淘宝:V1.5.3
|
| | | String relationId = TaoKeApiUtil.getRelationId(accessToken, Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET);// 渠道ID
|
| | | String relationId = TaoKeApiUtil.getRelationId(accessToken, Constant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);// 渠道ID
|
| | | if (StringUtil.isNullOrEmpty(relationId)) {
|
| | | LogHelper.test(uid + "渠道备案失败");
|
| | | bindInfo = false;
|
| | |
| | | String specialId = null;
|
| | | if(bindInfo) {
|
| | | specialId = TaoKeApiUtil.getSpecialId(accessToken, Constant.TAOBAO_AUTH_APPKEY,
|
| | | Constant.TAOBAO_AUTH_APPSECRET);
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | if (StringUtil.isNullOrEmpty(specialId)) {
|
| | | LogHelper.test(uid + "会员备案失败");
|
| | | bindInfo = false;
|
| | |
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.factory.MonitorFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | pid = Constant.TAOBAO_SPECIAL_PID_DEFAULT;
|
| | | pid = TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT;
|
| | |
|
| | | } else {// 尚未绑定
|
| | | isNative = true;
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.ThreadUtil;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.MonitorFactory;
|
| | |
| | | // 获取淘客参数
|
| | | ClientTBPid clientTBPid = null;
|
| | | if (simpleGoods.getMaterialLibType() != null && simpleGoods.getMaterialLibType() == 1) {
|
| | | String pid = Constant.TAOBAO_SPECIAL_PID_DEFAULT;
|
| | | clientTBPid = new ClientTBPid(Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET,
|
| | | String pid = TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT;
|
| | | clientTBPid = new ClientTBPid(TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET,
|
| | | pid.split("_")[2], pid.split("_")[3]);
|
| | | } else {
|
| | | if (acceptData.getPlatform().equalsIgnoreCase("android")) {
|
| | |
| | | import java.io.PrintWriter;
|
| | | import java.math.BigDecimal;
|
| | | import java.util.ArrayList;
|
| | | import java.util.HashMap;
|
| | | import java.util.HashSet;
|
| | | import java.util.List;
|
| | | import java.util.Map;
|
| | | import java.util.Set;
|
| | |
|
| | | import javax.annotation.Resource;
|
| | | import javax.print.attribute.standard.NumberUp;
|
| | |
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | | import org.springframework.stereotype.Controller;
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchNav;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoSearchResult;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoUnionConfig;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.service.inter.config.BusinessSystemService;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.config.SuperHotSearchService;
|
| | |
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.SearchFilterUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | | import net.sf.ehcache.Element;
|
| | | import net.sf.json.JSONArray;
|
| | |
| | |
|
| | | @RequestMapping(value = "gethotsearch", method = RequestMethod.POST)
|
| | | public void getHotSearch(AcceptData acceptData, PrintWriter out) {
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | String endprice, String fastFilter, PrintWriter out) {
|
| | | String bid = getHistorySearchBid(acceptData);
|
| | | historySearchService.addHistorySearch(kw, bid);
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | |
|
| | | historySearchService.addHistorySearch(kw, bid);
|
| | |
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(), acceptData.getPackages());
|
| | | BusinessSystem system = businessSystemService.getBusinessSystemCache(acceptData.getPlatform(),
|
| | | acceptData.getPackages());
|
| | | if (system == null) {
|
| | | out.print(JsonUtil.loadFalseResult("系统不存在"));
|
| | | return;
|
| | |
| | | if (result == null) {
|
| | | return null;
|
| | | }
|
| | | // 搜索是否在营销主商品库
|
| | | if (result != null && result.getTaoBaoGoodsBriefs() != null && result.getTaoBaoGoodsBriefs().size() > 0) {
|
| | | String numIds = "";
|
| | | for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs()) {
|
| | | numIds += goods.getAuctionId() + ",";
|
| | | }
|
| | | if (numIds.endsWith(","))
|
| | | numIds = numIds.substring(0, numIds.length() - 1);
|
| | | try {
|
| | | List<TaoBaoGoodsBrief> goodsList = TaoKeApiUtil.getBatchGoodsInfos(numIds);
|
| | | Map<Long, Integer> map = new HashMap<>();
|
| | | for (TaoBaoGoodsBrief g : goodsList)
|
| | | map.put(g.getAuctionId(), g.getMaterialLibType());
|
| | | for (TaoBaoGoodsBrief goods : result.getTaoBaoGoodsBriefs())
|
| | | goods.setMaterialLibType(map.get(goods.getAuctionId()));
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | |
|
| | | List<TaoBaoSearchNav> navList = TaoBaoUtil.getBaseNav();
|
| | | if (result.getNavList() != null)
|
| | |
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.service.inter.config.ConfigService;
|
| | | import com.yeshi.fanli.service.inter.user.UserExtraTaoBaoInfoService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | String link = TaoBaoUtil.getTaoBaoUnionAuthUrl(Constant.TAOBAO_AUTH_APPKEY,
|
| | | String link = TaoBaoUtil.getTaoBaoUnionAuthUrl(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | "http://api.flqapp.com/fanli/client/v1/auth/callback/tb", uid, source);
|
| | |
|
| | | String orderJS = "var orderId= document.getElementById('tp-bought-root').getElementsByClassName('js-order-container')[0].getElementsByTagName('div')[0].getAttribute('data-id');";
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | String link = TaoBaoUtil.getTaoBaoUnionAuthUrl(Constant.TAOBAO_AUTH_APPKEY,
|
| | | String link = TaoBaoUtil.getTaoBaoUnionAuthUrl(TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | "http://api.flqapp.com/fanli/client/v1/auth/callback/tb", uid, source);
|
| | |
|
| | | String orderJS = "var orderId= document.getElementById('tp-bought-root').getElementsByClassName('js-order-container')[0].getElementsByTagName('div')[0].getAttribute('data-id');";
|
| | |
| | | */ |
| | | ThreeSale getRelationshipByBossIdAndWorkerId(@Param("bossId") Long bossId, @Param("workerId") Long workerId); |
| | | |
| | | /** |
| | | * 根据下级查询成功的邀请关系 |
| | | * @param workerId |
| | | * @return |
| | | */ |
| | | ThreeSale selectSuccessByWorkerId(Long workerId); |
| | | |
| | | |
| | | /** |
| | | * 根据邀请者ID查询未失效关系 |
| | |
| | | |
| | | // 通过交易ID获取订单 |
| | | TaoBaoOrder selectTaoBaoOrderByTradeId(String tradeId); |
| | | |
| | | List<TaoBaoOrder> listByTradeId(String tradeId); |
| | | |
| | | int updateByPrimaryKeySelective(TaoBaoOrder record); |
| | | |
| | |
| | | List<Map<String, Object>> countOrderNumber( @Param("dateType") Integer dateType, @Param("year") String year, |
| | | @Param("startTime")String startTime, @Param("endTime")String endTime); |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取长期未更新的订单 |
| | | * @param start |
| | | * @param count |
| | | * @return |
| | | */ |
| | | List<TaoBaoOrder> listLongTimeNoUpdateOrders(@Param("start")long start,@Param("count")int count); |
| | | } |
New file |
| | |
| | | package com.yeshi.fanli.dao.mybatis.taobao; |
| | | |
| | | import com.yeshi.fanli.dao.BaseMapper; |
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrderTradeMap; |
| | | |
| | | public interface TaoBaoOrderTradeMapMapper extends BaseMapper<TaoBaoOrderTradeMap> { |
| | | |
| | | /** |
| | | * 根据交易ID查询 |
| | | * |
| | | * @param tradeId |
| | | * @return |
| | | */ |
| | | TaoBaoOrderTradeMap selectByTradeId(String tradeId); |
| | | |
| | | } |
| | |
| | | * @author Administrator
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_msg_system")
|
| | | @Table("yeshi_ec_user_msg_system")
|
| | | public class UserSystemMsg {
|
| | | public final static int TIME_TAG_COMMON = 0;// 普通
|
| | | public final static int TIME_TAG_EMERGENT = 1;// 紧急
|
| | |
| | | private String videoCover;
|
| | | @Column(name = "cg_video_url")
|
| | | private String videoUrl;
|
| | | @Column(name = "cg_material_lib_type")
|
| | | private Integer materialLibType;// 物料库类型 1-营销商品库 0-非营销商品库
|
| | | @Column(name = "cg_createtime")
|
| | | private Date createTime;
|
| | | @Column(name = "cg_updatetime")
|
| | |
| | | this.goodsId = goodsId;
|
| | | }
|
| | |
|
| | | public Integer getMaterialLibType() {
|
| | | return materialLibType;
|
| | | }
|
| | |
|
| | | public void setMaterialLibType(Integer materialLibType) {
|
| | | this.materialLibType = materialLibType;
|
| | | }
|
| | |
|
| | | public Integer getGoodsType() {
|
| | | return goodsType;
|
| | | }
|
| | |
| | | public final static int STATE_JS = 2;
|
| | | public final static int STATE_WQ = 3;
|
| | | public final static int STATE_SX = 4;
|
| | | |
| | | // 整个订单状态 1-有效 2-部分有效/失效 3-失效
|
| | |
|
| | | // 整个订单状态 1-有效 2-部分有效/失效 3-失效
|
| | | public final static int STATE_WHOLE_ORDER_YOUXIAO = 1;
|
| | | public final static int STATE_WHOLE_ORDER_BUFENYOUXIAO = 2;
|
| | | public final static int STATE_WHOLE_ORDER_SHIXIAO = 3;
|
| | | |
| | | |
| | |
|
| | | // 订单红包类型图片
|
| | | public final static String TYPE_FANLI = "http://ec-1255749512.file.myqcloud.com/resource/order/icon_fanli.png";
|
| | | public final static String TYPE_INVITE = "http://ec-1255749512.file.myqcloud.com/resource/order/icon_invite.png";
|
| | |
| | | @Column(name = "co_state")
|
| | | private Integer state;
|
| | |
|
| | | // 整个订单状态:有效 、 部分有效/失效 、 失效
|
| | | // 整个订单状态:有效 、 部分有效/失效 、 失效
|
| | | @Expose
|
| | | @Column(name = "co_state_whole_order")
|
| | | private Integer stateWholeOrder;
|
| | | |
| | |
|
| | | // 效果预估
|
| | | @Column(name = "co_estimate")
|
| | | private BigDecimal estimate;
|
| | |
| | |
|
| | | @Column(name = "co_order_by")
|
| | | private Integer orderBy;// 子订单的排序值
|
| | |
|
| | | @Column(name = "co_trade_id")
|
| | | private String tradeId;
|
| | |
|
| | | // 创建时间
|
| | | @Column(name = "co_create_time")
|
| | |
| | | this.stateWholeOrder = stateWholeOrder;
|
| | | }
|
| | |
|
| | | public String getTradeId() {
|
| | | return tradeId;
|
| | | }
|
| | |
|
| | | public void setTradeId(String tradeId) {
|
| | | this.tradeId = tradeId;
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | @Column
|
| | | private Integer state;// 0-正常 1-商品下架
|
| | |
|
| | | @org.yeshi.utils.mybatis.Column(name = "material_lib_type")
|
| | | @Transient
|
| | | private Integer materialLibType;//物料库类型
|
| | |
|
New file |
| | |
| | | package com.yeshi.fanli.entity.taobao;
|
| | |
|
| | | import java.util.Date;
|
| | |
|
| | | import org.yeshi.utils.mybatis.Column;
|
| | | import org.yeshi.utils.mybatis.Table;
|
| | |
|
| | | /**
|
| | | * 淘宝订单交易ID映射
|
| | | * |
| | | * @author hexiaohui
|
| | | *
|
| | | */
|
| | | @Table("yeshi_ec_taobao_order_trade_map")
|
| | | public class TaoBaoOrderTradeMap {
|
| | | @Column(name = "totm_id")
|
| | | private Long id;
|
| | | @Column(name = "totm_order_id")
|
| | | private TaoBaoOrder taoBaoOrder;
|
| | | @Column(name = "totm_trade_id")
|
| | | private String tradeId;
|
| | | @Column(name = "totm_create_time")
|
| | | private Date createTime;
|
| | |
|
| | | public Long getId() {
|
| | | return id;
|
| | | }
|
| | |
|
| | | public void setId(Long id) {
|
| | | this.id = id;
|
| | | }
|
| | |
|
| | | public TaoBaoOrder getTaoBaoOrder() {
|
| | | return taoBaoOrder;
|
| | | }
|
| | |
|
| | | public void setTaoBaoOrder(TaoBaoOrder taoBaoOrder) {
|
| | | this.taoBaoOrder = taoBaoOrder;
|
| | | }
|
| | |
|
| | | public String getTradeId() {
|
| | | return tradeId;
|
| | | }
|
| | |
|
| | | public void setTradeId(String tradeId) {
|
| | | this.tradeId = tradeId;
|
| | | }
|
| | |
|
| | | public Date getCreateTime() {
|
| | | return createTime;
|
| | | }
|
| | |
|
| | | public void setCreateTime(Date createTime) {
|
| | | this.createTime = createTime;
|
| | | }
|
| | | }
|
| | |
| | | |
| | | public class TaoBaoWeiQuanException extends Exception { |
| | | |
| | | /** |
| | | * 需要更新订单的内容 |
| | | */ |
| | | public final static int CODE_NEDD_UPDATE_ORDER=1001; |
| | | |
| | | /** |
| | | * |
| | |
| | |
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderMapper;
|
| | | import com.yeshi.fanli.entity.bus.user.Order;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | |
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoWeiQuanOrderService;
|
| | | import com.yeshi.fanli.util.BeanUtil;
|
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeOrderApiUtil;
|
| | |
| | | @Resource
|
| | | private OrderService orderService;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoOrderMapper taoBaoOrderMapper;
|
| | |
|
| | | /**
|
| | | * 新版获取普通订单
|
| | | *
|
| | |
| | | int page = 1;
|
| | | String startTimeStr = TimeUtil.getGernalTime(startTime, "yyyy-MM-dd HH:mm:ss");
|
| | | List<TaoBaoOrder> orderList = TaoKeOrderApiUtil.getTaoBaoAllOrder(startTimeStr, span, page,
|
| | | Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET);
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | while (orderList.size() == 100 * page) {
|
| | | page++;
|
| | | List<TaoBaoOrder> tempOrderList = TaoKeOrderApiUtil.getTaoBaoAllOrder(startTimeStr, span, page,
|
| | | Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET);
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | if (tempOrderList != null && tempOrderList.size() > 0)
|
| | | orderList.addAll(tempOrderList);
|
| | | }
|
| | |
| | | addOrderNew(orderList);
|
| | | }
|
| | |
|
| | | // 每晚10点执行漏单
|
| | | @Scheduled(cron = "0 0 22 * * ? ")
|
| | | public void doJob3() {
|
| | | List<TaoBaoOrder> orderList = taoBaoOrderMapper.listLongTimeNoUpdateOrders(0, 10);
|
| | | List<TaoBaoOrder> updateOrderList = new ArrayList<>();
|
| | | for (TaoBaoOrder order : orderList) {
|
| | | List<TaoBaoOrder> newList = TaoKeOrderApiUtil.getTaoBaoAllOrder(order.getCreateTime(), 60, 1,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | for (TaoBaoOrder o : newList) {
|
| | | if (o.getOrderId().equalsIgnoreCase(order.getOrderId()))
|
| | | updateOrderList.add(o);
|
| | | }
|
| | | }
|
| | | addOrderNew(updateOrderList);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoOrderUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeOrderApiUtil;
|
| | |
| | | int page = 1;
|
| | | String startTimeStr = TimeUtil.getGernalTime(startTime, "yyyy-MM-dd HH:mm:ss");
|
| | | List<TaoBaoOrder> orderList = TaoKeOrderApiUtil.getTaoBaoAllOrder(startTimeStr, span, page,
|
| | | Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET);
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | while (orderList.size() == 100 * page) {
|
| | | page++;
|
| | | List<TaoBaoOrder> tempOrderList = TaoKeOrderApiUtil.getTaoBaoAllOrder(startTimeStr, span, page,
|
| | | Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET);
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | if (tempOrderList != null && tempOrderList.size() > 0)
|
| | | orderList.addAll(tempOrderList);
|
| | | }
|
| | |
| | | int page = 1;
|
| | | String startTimeStr = TimeUtil.getGernalTime(startTime, "yyyy-MM-dd HH:mm:ss");
|
| | | List<TaoBaoOrder> orderList = TaoKeOrderApiUtil.getTaoBaoThirdAllOrder(startTimeStr, span, page,
|
| | | Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET);
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | while (orderList.size() == 100 * page) {
|
| | | page++;
|
| | | List<TaoBaoOrder> tempOrderList = TaoKeOrderApiUtil.getTaoBaoThirdAllOrder(startTimeStr, span, page,
|
| | | Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET);
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | if (tempOrderList != null && tempOrderList.size() > 0)
|
| | | orderList.addAll(tempOrderList);
|
| | | }
|
| | |
| | | * @param toPage
|
| | | * 结束页码(每页100条数据)
|
| | | */
|
| | | private void updateRelationAndSpecialOrder(long startTime, long endTime) {
|
| | | public void updateRelationAndSpecialOrder(long startTime, long endTime) {
|
| | | List<TaoBaoOrder> list = TaoKeOrderApiUtil.getSpecialOrder(startTime, endTime);
|
| | | List<TaoBaoOrder> list1 = TaoKeOrderApiUtil.getThirdSpecialOrder(startTime, endTime);
|
| | | List<TaoBaoOrder> list2 = TaoKeOrderApiUtil.getRelationOrder(startTime, endTime);
|
| | |
| | | <select id="computeCompensateByUid" resultType="java.math.BigDecimal"
|
| | | parameterType="java.lang.Long">
|
| | | select
|
| | | ecc_money
|
| | | sum(ecc_money)
|
| | | from yeshi_ec_extract_check_compensate
|
| | | where ecc_uid=#{0}
|
| | | </select>
|
| | |
| | | <delete id="deleteExpireRecord" parameterType="java.lang.Long"> |
| | | DELETE FROM |
| | | yeshi_ec_threesale |
| | | WHERE expire = 1 AND boss_id = #{bossId} AND worker_id = #{workerId} |
| | | WHERE expire = 1 AND boss_id = #{bossId} AND |
| | | worker_id = #{workerId} |
| | | </delete> |
| | | |
| | | <!-- 查询一度队员集合 --> |
| | |
| | | |
| | | |
| | | <select id="listFirstTeam" resultMap="AllResultMap"> |
| | | SELECT * FROM |
| | | `yeshi_ec_threesale` ts |
| | | SELECT * FROM `yeshi_ec_threesale` ts |
| | | LEFT JOIN `yeshi_ec_threesale_extra_info` ff |
| | | ON ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id`=ff.`tf_worker_id` |
| | | ON |
| | | ts.`boss_id` = ff.`tf_boss_id` AND ts.`worker_id`=ff.`tf_worker_id` |
| | | WHERE ts.`boss_id` = #{uid} |
| | | <if test="state != null"> |
| | | AND ts.`state` = #{state} |
| | | </if> |
| | | ORDER BY ts.state DESC, ts.expire, |
| | | ts.createTime DESC |
| | | ORDER BY ts.state DESC, ts.expire, ts.createTime DESC |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countFirstTeam" resultType="java.lang.Long"> |
| | | SELECT IFNULL(count(id),0) FROM `yeshi_ec_threesale` |
| | | WHERE `boss_id` = |
| | | #{uid} |
| | | WHERE `boss_id` = #{uid} |
| | | <if test="state != null"> |
| | | AND `state` = #{state} |
| | | </if> |
| | |
| | | |
| | | <select id="listSecondTeam" resultMap="AllResultMap"> |
| | | SELECT yet.* FROM ( |
| | | SELECT DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts |
| | | LEFT JOIN yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id` |
| | | WHERE tf.`boss_id` = #{uid})A |
| | | SELECT |
| | | DISTINCT(ts.`id`) AS id FROM `yeshi_ec_threesale` ts |
| | | LEFT JOIN |
| | | yeshi_ec_threesale tf ON ts.`boss_id`=tf.`worker_id` |
| | | WHERE tf.`boss_id` |
| | | = #{uid})A |
| | | LEFT JOIN yeshi_ec_threesale yet ON yet.id = |
| | | A.id |
| | | LEFT JOIN `yeshi_ec_threesale_extra_info` ff |
| | | ON yet.`boss_id` = |
| | | ff.`tf_boss_id` AND yet.`worker_id` =ff.`tf_worker_id` |
| | | WHERE |
| | | LEFT JOIN |
| | | `yeshi_ec_threesale_extra_info` ff ON yet.`boss_id` = ff.`tf_boss_id` |
| | | |
| | | WHERE yet.`worker_id` =ff.`tf_worker_id` |
| | | <if test="state != null"> |
| | | AND yet.`state` = #{state} |
| | | </if> |
| | | ORDER BY |
| | | yet.state DESC, yet.expire, yet.createTime DESC |
| | | yet.state DESC, |
| | | yet.expire, yet.createTime DESC |
| | | LIMIT ${start},${count} |
| | | </select> |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="getSuccessRelationshipNum" resultType="java.lang.Integer"> |
| | | SELECT IFNULL (COUNT(*),0) FROM `yeshi_ec_threesale` t |
| | | WHERE t.`state` = 1 AND (t.`worker_id` =${uid} OR t.`boss_id` = ${uid}) |
| | | SELECT IFNULL |
| | | (COUNT(*),0) FROM `yeshi_ec_threesale` t |
| | | WHERE t.`state` = 1 AND |
| | | (t.`worker_id` =${uid} OR t.`boss_id` = ${uid}) |
| | | </select> |
| | | |
| | | <select id="getRelationshipByBossIdAndWorkerId" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_ec_threesale` t |
| | | WHERE t.`boss_id` = ${bossId} AND t.`worker_id` = ${workerId} |
| | | AND t.`state` = 0 AND (t.`expire` = 0 OR t.`expire`IS NULL) |
| | | WHERE t.`boss_id` = ${bossId} AND |
| | | t.`worker_id` = ${workerId} |
| | | AND t.`state` = 0 AND (t.`expire` = 0 OR |
| | | t.`expire`IS NULL) |
| | | LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="getExpireRecord" resultMap="BaseResultMap"> |
| | | SELECT * FROM `yeshi_ec_threesale` |
| | | WHERE expire = 1 AND boss_id = #{bossId} AND worker_id = #{workerId} |
| | | SELECT * FROM |
| | | `yeshi_ec_threesale` |
| | | WHERE expire = 1 AND boss_id = #{bossId} AND |
| | | worker_id = #{workerId} |
| | | </select> |
| | | |
| | | <select id="selectSuccessByWorkerId" resultMap="BaseResultMap" parameterType="java.lang.Long"> |
| | | SELECT * FROM `yeshi_ec_threesale` |
| | | WHERE `state` = 1 AND worker_id = #{0} order by id desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="cg_sales" property="sales" jdbcType="INTEGER" /> |
| | | <result column="cg_rate" property="rate" jdbcType="DECIMAL" /> |
| | | <result column="cg_picture" property="picture" jdbcType="VARCHAR" /> |
| | | <result column="cg_picture_white" property="pictureWhite" jdbcType="VARCHAR" /> |
| | | <result column="cg_picture_white" property="pictureWhite" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="cg_state" property="state" jdbcType="INTEGER" /> |
| | | <result column="cg_price" property="price" jdbcType="DECIMAL" /> |
| | | <result column="cg_coupon_info" property="couponInfo" jdbcType="VARCHAR" /> |
| | |
| | | <result column="cg_video_url" property="videoUrl" jdbcType="VARCHAR" /> |
| | | <result column="cg_createtime" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="cg_updatetime" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | <result column="cg_material_lib_type" property="materialLibType" |
| | | jdbcType="INTEGER" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">cg_id,cg_title,cg_goods_id,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_picture_white,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_createtime,cg_updatetime |
| | | <sql id="Base_Column_List">cg_id,cg_title,cg_goods_id,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_picture_white,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_createtime,cg_updatetime,cg_material_lib_type |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_common_goods where cg_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="selectByGoodsIdAndGoodsType" resultMap="BaseResultMap"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_common_goods where cg_goods_id = #{goodsId} and |
| | | cg_goods_type=#{goodsType} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_common_goods where cg_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | yeshi_ec_common_goods where cg_id = #{id,jdbcType=BIGINT}</delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.goods.CommonGoods" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_goods |
| | | (cg_id,cg_title,cg_goods_id,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_picture_white,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_createtime,cg_updatetime) |
| | | (cg_id,cg_title,cg_goods_id,cg_goods_type,cg_shop_type,cg_seller_id,cg_seller_name,cg_sales,cg_rate,cg_picture,cg_picture_white,cg_state,cg_price,cg_coupon_info,cg_coupon_startprice,cg_coupon_amount,cg_coupon_left_count,cg_coupon_total_count,cg_video_cover,cg_video_url,cg_createtime,cg_updatetime,cg_material_lib_type) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{goodsId,jdbcType=BIGINT},#{goodsType,jdbcType=INTEGER},#{shopType,jdbcType=INTEGER},#{sellerId,jdbcType=BIGINT},#{sellerName,jdbcType=VARCHAR},#{sales,jdbcType=INTEGER},#{rate,jdbcType=DECIMAL},#{picture,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{price,jdbcType=DECIMAL},#{couponInfo,jdbcType=VARCHAR},#{couponStartPrice,jdbcType=DECIMAL},#{couponAmount,jdbcType=DECIMAL},#{couponLeftCount,jdbcType=INTEGER},#{couponTotalCount,jdbcType=INTEGER},#{videoCover,jdbcType=VARCHAR},#{videoUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | (#{id,jdbcType=BIGINT},#{title,jdbcType=VARCHAR},#{goodsId,jdbcType=BIGINT},#{goodsType,jdbcType=INTEGER},#{shopType,jdbcType=INTEGER},#{sellerId,jdbcType=BIGINT},#{sellerName,jdbcType=VARCHAR},#{sales,jdbcType=INTEGER},#{rate,jdbcType=DECIMAL},#{picture,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{price,jdbcType=DECIMAL},#{couponInfo,jdbcType=VARCHAR},#{couponStartPrice,jdbcType=DECIMAL},#{couponAmount,jdbcType=DECIMAL},#{couponLeftCount,jdbcType=INTEGER},#{couponTotalCount,jdbcType=INTEGER},#{videoCover,jdbcType=VARCHAR},#{videoUrl,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{materialLibType,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.goods.CommonGoods" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="videoUrl != null">cg_video_url,</if> |
| | | <if test="createTime != null">cg_createtime,</if> |
| | | <if test="updateTime != null">cg_updatetime,</if> |
| | | <if test="materialLibType != null">cg_material_lib_type,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="videoUrl != null">#{videoUrl,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="materialLibType != null">#{materialLibType,jdbcType=INTEGER}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.goods.CommonGoods">update |
| | |
| | | #{videoCover,jdbcType=VARCHAR},cg_video_url = |
| | | #{videoUrl,jdbcType=VARCHAR},cg_createtime = |
| | | #{createTime,jdbcType=TIMESTAMP},cg_updatetime = |
| | | #{updateTime,jdbcType=TIMESTAMP} where cg_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | #{updateTime,jdbcType=TIMESTAMP} ,cg_material_lib_type |
| | | =#{materialLibType,jdbcType=INTEGER} where cg_id = |
| | | #{id,jdbcType=BIGINT}</update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.goods.CommonGoods"> |
| | | update yeshi_ec_common_goods |
| | | <set> |
| | |
| | | <if test="videoUrl != null">cg_video_url=#{videoUrl,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">cg_createtime=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">cg_updatetime=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="id !=null">cg_id =#{id,jdbcType=BIGINT},</if> |
| | | <if test="materialLibType !=null">cg_material_lib_type |
| | | =#{materialLibType,jdbcType=INTEGER},</if> |
| | | </set> |
| | | where cg_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | jdbcType="VARCHAR" /> |
| | | <result column="co_count" property="count" jdbcType="INTEGER" /> |
| | | <result column="co_state" property="state" jdbcType="INTEGER" /> |
| | | <result column="co_state_whole_order" property="stateWholeOrder" jdbcType="INTEGER" /> |
| | | <result column="co_state_whole_order" property="stateWholeOrder" |
| | | jdbcType="INTEGER" /> |
| | | <result column="co_estimate" property="estimate" jdbcType="DECIMAL" /> |
| | | <result column="co_eIncome" property="eIncome" jdbcType="DECIMAL" /> |
| | | <result column="co_payment" property="payment" jdbcType="DECIMAL" /> |
| | |
| | | <result column="co_order_by" property="orderBy" jdbcType="INTEGER" /> |
| | | <result column="co_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="co_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | |
| | | <result column="co_trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | <association property="userInfo" column="co_uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="co_uid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | <association property="commonOrderGoods" column="co_order_goods_id" |
| | | javaType="com.yeshi.fanli.entity.order.CommonOrderGoods"> |
| | | <id column="co_order_goods_id" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | </resultMap> |
| | | |
| | | |
| | | <resultMap id="BaseDetailResultMap" type="com.yeshi.fanli.entity.order.CommonOrder"> |
| | | <id column="co_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="co_order_no" property="orderNo" jdbcType="VARCHAR" /> |
| | |
| | | jdbcType="VARCHAR" /> |
| | | <result column="co_count" property="count" jdbcType="INTEGER" /> |
| | | <result column="co_state" property="state" jdbcType="INTEGER" /> |
| | | <result column="co_state_whole_order" property="stateWholeOrder" jdbcType="INTEGER" /> |
| | | <result column="co_state_whole_order" property="stateWholeOrder" |
| | | jdbcType="INTEGER" /> |
| | | <result column="co_estimate" property="estimate" jdbcType="DECIMAL" /> |
| | | <result column="co_eIncome" property="eIncome" jdbcType="DECIMAL" /> |
| | | <result column="co_payment" property="payment" jdbcType="DECIMAL" /> |
| | |
| | | <result column="co_order_by" property="orderBy" jdbcType="INTEGER" /> |
| | | <result column="co_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="co_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | |
| | | <result column="co_trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | <association property="userInfo" column="co_uid" |
| | | javaType="com.yeshi.fanli.entity.bus.user.UserInfo"> |
| | | <id column="co_uid" property="id" jdbcType="BIGINT" /> |
| | | </association> |
| | | |
| | | <association property="commonOrderGoods" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper.BaseResultMap"> |
| | | |
| | | </association> |
| | | resultMap="com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper.BaseResultMap" /> |
| | | </resultMap> |
| | | |
| | | <resultMap id="ResultMap" type="com.yeshi.fanli.vo.order.CommonOrderVO"> |
| | | <id column="co_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="co_order_no" property="orderNo" jdbcType="VARCHAR" /> |
| | |
| | | jdbcType="VARCHAR" /> |
| | | <result column="co_count" property="count" jdbcType="INTEGER" /> |
| | | <result column="co_state" property="state" jdbcType="INTEGER" /> |
| | | <result column="co_state_whole_order" property="stateWholeOrder" jdbcType="INTEGER" /> |
| | | <result column="co_state_whole_order" property="stateWholeOrder" |
| | | jdbcType="INTEGER" /> |
| | | <result column="co_estimate" property="estimate" jdbcType="DECIMAL" /> |
| | | <result column="co_eIncome" property="eIncome" jdbcType="DECIMAL" /> |
| | | <result column="co_payment" property="payment" jdbcType="DECIMAL" /> |
| | |
| | | <result column="co_order_by" property="orderBy" jdbcType="INTEGER" /> |
| | | <result column="co_create_time" property="createTime" jdbcType="TIMESTAMP" /> |
| | | <result column="co_update_time" property="updateTime" jdbcType="TIMESTAMP" /> |
| | | |
| | | <result column="totalMoney" property="hongBao" jdbcType="DECIMAL" /> |
| | | <result column="couponMoney" property="couponMoney" jdbcType="DECIMAL" /> |
| | | |
| | | <result column="hongBaoState" property="hongBaoState" jdbcType="INTEGER" /> |
| | | <result column="hongBaoType" property="hongBaoType" jdbcType="INTEGER" /> |
| | | <result column="accountTime" property="accountTime" jdbcType="TIMESTAMP" /> |
| | | <result column="preAccountTime" property="preAccountTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | |
| | | <result column="totalCount" property="totalCount" jdbcType="INTEGER" /> |
| | | <result column="totalSettlement" property="totalSettlement" jdbcType="DECIMAL" /> |
| | | <result column="totalSettlement" property="totalSettlement" |
| | | jdbcType="DECIMAL" /> |
| | | <result column="totalPayment" property="totalPayment" jdbcType="DECIMAL" /> |
| | | |
| | | |
| | | <result column="userId" property="userId" jdbcType="VARCHAR" /> |
| | | <result column="userName" property="userName" jdbcType="VARCHAR" /> |
| | | <result column="userPortrait" property="userPortrait" jdbcType="VARCHAR" /> |
| | | |
| | | <result column="levelOneId" property="levelOneId" jdbcType="VARCHAR" /> |
| | | <result column="levelOneMoney" property="levelOneMoney" jdbcType="VARCHAR" /> |
| | | <result column="levelOneMoney" property="levelOneMoney" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="levelTwoId" property="levelTwoId" jdbcType="VARCHAR" /> |
| | | <result column="levelTwoMoney" property="levelTwoMoney" jdbcType="VARCHAR" /> |
| | | |
| | | <result column="levelTwoMoney" property="levelTwoMoney" |
| | | jdbcType="VARCHAR" /> |
| | | <result column="co_trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | <association property="userInfo" column="co_uid" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap"> |
| | | </association> |
| | | |
| | | resultMap="com.yeshi.fanli.dao.mybatis.UserInfoMapper.BaseResultMap" /> |
| | | <association property="commonOrderGoods" column="co_order_goods_id" |
| | | resultMap="com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper.BaseResultMap"> |
| | | </association> |
| | | |
| | | resultMap="com.yeshi.fanli.dao.mybatis.order.CommonOrderGoodsMapper.BaseResultMap" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <sql id="Base_Column_List">co_id,co_uid,co_order_no,co_source_type,co_source_position,co_order_goods_id,co_count,co_state,co_state_whole_order,co_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,co_order_by,co_create_time,co_update_time |
| | | <sql id="Base_Column_List">co_id,co_uid,co_order_no,co_source_type,co_source_position,co_order_goods_id,co_count,co_state,co_state_whole_order,co_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,co_order_by,co_create_time,co_update_time,co_trade_id |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_common_order where co_id = #{id,jdbcType=BIGINT} |
| | | </select> |
| | | <select id="countByOrderNOAndOrderType" resultType="java.lang.Integer"> |
| | | select |
| | | <select id="countByOrderNOAndOrderType" resultType="java.lang.Integer">select |
| | | count(co_id) from yeshi_ec_common_order where co_order_no=#{orderNO} |
| | | and co_source_type=#{orderType} |
| | | </select> |
| | | |
| | | <select id="selectByOrderNoAndOrderTypeAndOrderBy" resultMap="BaseResultMap"> |
| | | select |
| | | * from yeshi_ec_common_order where co_order_no=#{orderNo} |
| | | and |
| | | <select id="selectByOrderNoAndOrderTypeAndOrderBy" resultMap="BaseResultMap">select |
| | | * from yeshi_ec_common_order where co_order_no=#{orderNo} and |
| | | co_source_type=#{orderType} and co_order_by=#{orderBy} |
| | | </select> |
| | | |
| | | <select id="countByUidAndOrderStateWithOrderBalanceTime" |
| | | resultType="java.lang.Long"> |
| | | SELECT COUNT(*) FROM yeshi_ec_common_order co WHERE |
| | | resultType="java.lang.Long">SELECT COUNT(*) FROM yeshi_ec_common_order co WHERE |
| | | co.`co_state`=#{state} and co.`co_uid`=#{uid} and co.`co_settle_time` |
| | | is not null and co.`co_settle_time`>=#{minDate} and |
| | | #{maxDate}>co.`co_settle_time` |
| | | is not null and co.`co_settle_time`>=#{minDate} and |
| | | #{maxDate}>co.`co_settle_time`</select> |
| | | <select id="listBySourceTypeAndOrderNo" resultMap="BaseResultMap">SELECT * FROM |
| | | yeshi_ec_common_order co WHERE co.co_source_type=#{sourceType} and |
| | | co_order_no=#{orderNo} |
| | | </select> |
| | | |
| | | |
| | | <select id="listBySourceTypeAndOrderNo" |
| | | resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_common_order co WHERE |
| | | co.co_source_type=#{sourceType} and co_order_no=#{orderNo} |
| | | </select> |
| | | |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_common_order where co_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.order.CommonOrder" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_order |
| | | (co_id,co_uid,co_order_no,co_source_type,co_source_position,co_order_goods_id,co_count,co_state,co_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,co_create_time,co_update_time) |
| | | (co_id,co_uid,co_order_no,co_source_type,co_source_position,co_order_goods_id,co_count,co_state,co_estimate,co_eIncome,co_payment,co_settlement,co_third_create_time,co_settle_time,co_create_time,co_update_time,co_state_whole_order,co_order_by,co_trade_id) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{sourcePosition,jdbcType=VARCHAR},#{commonOrderGoods.id,jdbcType=BIGINT},#{count,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{estimate,jdbcType=DECIMAL},#{eIncome,jdbcType=DECIMAL},#{payment,jdbcType=DECIMAL},#{settlement,jdbcType=DECIMAL},#{thirdCreateTime,jdbcType=TIMESTAMP},#{settleTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP}) |
| | | (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{orderNo,jdbcType=VARCHAR},#{sourceType,jdbcType=INTEGER},#{sourcePosition,jdbcType=VARCHAR},#{commonOrderGoods.id,jdbcType=BIGINT},#{count,jdbcType=INTEGER},#{state,jdbcType=INTEGER},#{estimate,jdbcType=DECIMAL},#{eIncome,jdbcType=DECIMAL},#{payment,jdbcType=DECIMAL},#{settlement,jdbcType=DECIMAL},#{thirdCreateTime,jdbcType=TIMESTAMP},#{settleTime,jdbcType=TIMESTAMP},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{stateWholeOrder,jdbcType=INTEGER},#{orderBy,jdbcType=INTEGER},#{tradeId,jdbcType=VARCHAR}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.CommonOrder" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="orderBy != null">co_order_by,</if> |
| | | <if test="createTime != null">co_create_time,</if> |
| | | <if test="updateTime != null">co_update_time,</if> |
| | | <if test="tradeId != null">co_trade_id,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="orderBy != null">#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="tradeId != null">#{tradeId,jdbcType=VARCHAR}</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.CommonOrder">update |
| | |
| | | #{settleTime,jdbcType=TIMESTAMP},co_order_by = |
| | | #{orderBy,jdbcType=INTEGER},co_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP},co_update_time = |
| | | #{updateTime,jdbcType=TIMESTAMP} where co_id = #{id,jdbcType=BIGINT} |
| | | #{updateTime,jdbcType=TIMESTAMP} ,co_trade_id |
| | | =#{tradeId,jdbcType=VARCHAR} where co_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.CommonOrder"> |
| | | update yeshi_ec_common_order |
| | |
| | | </if> |
| | | <if test="count != null">co_count=#{count,jdbcType=INTEGER},</if> |
| | | <if test="state != null">co_state=#{state,jdbcType=INTEGER},</if> |
| | | <if test="stateWholeOrder != null">co_state_whole_order=#{stateWholeOrder,jdbcType=INTEGER},</if> |
| | | <if test="stateWholeOrder != null">co_state_whole_order=#{stateWholeOrder,jdbcType=INTEGER}, |
| | | </if> |
| | | <if test="estimate != null">co_estimate=#{estimate,jdbcType=DECIMAL},</if> |
| | | <if test="eIncome != null">co_eIncome=#{eIncome,jdbcType=DECIMAL},</if> |
| | | <if test="payment != null">co_payment=#{payment,jdbcType=DECIMAL},</if> |
| | |
| | | <if test="orderBy != null">co_order_by=#{orderBy,jdbcType=INTEGER},</if> |
| | | <if test="createTime != null">co_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="updateTime != null">co_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> |
| | | <if test="id !=null">co_id =#{id,jdbcType=BIGINT},</if> |
| | | <if test="tradeId !=null">co_trade_id =#{tradeId,jdbcType=VARCHAR},</if> |
| | | </set> |
| | | where co_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | |
| | | |
| | | |
| | | <sql id="SELECT_PARAM_ORDER_STATE"> |
| | | <if test="orderState != null and orderState == 1"> |
| | | <!-- 有效订单: 整个订单有效 --> |
| | | AND <![CDATA[co.`co_state` <> 3]]> AND (co.co_state_whole_order = 1 or co.co_state_whole_order = 2) |
| | | AND <![CDATA[co.`co_state` <> 3]]> |
| | | AND (co.co_state_whole_order = 1 or co.co_state_whole_order = 2) |
| | | </if> |
| | | <if test="orderState != null and orderState == 2"> |
| | | AND co.co_state = 3 <!-- 维权订单 --> |
| | | AND co.co_state = 3 |
| | | <!-- 维权订单 --> |
| | | </if> |
| | | <if test="orderState != null and orderState == 3"> |
| | | <!-- 整个订单失效 --> |
| | | AND co.co_state_whole_order = 3 |
| | | AND co.co_state_whole_order = 3 |
| | | </if> |
| | | <if test="orderState != null and orderState == 4"> |
| | | <!-- 已收货订单 --> |
| | | AND co.co_state = 2 |
| | | </if> |
| | | </sql> |
| | | |
| | | <sql id="SELECT_PARAM_ORDER_CREATE_TIME"> |
| | | <if test="startTime != null and startTime != '' "> |
| | | AND <![CDATA[co.co_third_create_time >= #{startTime}]]> |
| | | <if test="startTime != null and startTime != '' ">AND <![CDATA[co.co_third_create_time >= #{startTime}]]> |
| | | </if> |
| | | <if test="endTime != null and endTime != '' "> |
| | | AND <![CDATA[co.co_third_create_time <= #{endTime}]]> |
| | | <if test="endTime != null and endTime != '' ">AND <![CDATA[co.co_third_create_time <= #{endTime}]]> |
| | | </if> |
| | | <if test="day != null and day == 1"> <!-- 今天 --> |
| | | <if test="day != null and day == 1"> |
| | | <!-- 今天 --> |
| | | AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW()) |
| | | </if> |
| | | <if test="day != null and day == 2"> <!-- 昨天 --> |
| | | <if test="day != null and day == 2"> |
| | | <!-- 昨天 --> |
| | | AND TO_DAYS(NOW()) - TO_DAYS(co.`co_third_create_time`) = 1 |
| | | </if> |
| | | <if test="day != null and day == 3"> <!-- 本月 --> |
| | | <if test="day != null and day == 3"> |
| | | <!-- 本月 --> |
| | | AND DATE_FORMAT(co.`co_third_create_time`,'%Y%m') = |
| | | DATE_FORMAT(CURDATE(),'%Y%m') |
| | | </if> |
| | | <if test="day != null and day == 4"> <!-- 上月 --> |
| | | <if test="day != null and day == 4"> |
| | | <!-- 上月 --> |
| | | AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), |
| | | DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1 |
| | | </if> |
| | | </sql> |
| | | |
| | | <sql id="SELECT_PARAM_HONGBAO_TYPE"> |
| | | <if test="type != null and type == 1"> <!-- 自购订单 --> |
| | | <if test="type != null and type == 1"> |
| | | <!-- 自购订单 --> |
| | | AND (v2.hb_type =1 or v2.hb_type =2) |
| | | </if> |
| | | <if test="type != null and type == 2"> <!-- 分享订单 --> |
| | | <if test="type != null and type == 2"> |
| | | <!-- 分享订单 --> |
| | | AND v2.`hb_type` = 20 |
| | | </if> |
| | | <if test="type != null and type == 3"> <!-- 邀请订单 --> |
| | | AND (v2.`hb_type` = 5 OR v2.`hb_type` = 6 OR v2.`hb_type` = 7 OR v2.`hb_type` = 21 OR v2.`hb_type` = 22) |
| | | <if test="type != null and type == 3"> |
| | | <!-- 邀请订单 --> |
| | | AND (v2.`hb_type` = 5 OR v2.`hb_type` = 6 OR v2.`hb_type` = 7 OR |
| | | v2.`hb_type` = 21 OR v2.`hb_type` = 22) |
| | | </if> |
| | | </sql> |
| | | |
| | | <sql id="SELECT_PARAM_HONGBAO_STATE"> |
| | | <if test="state != null and state == 1"> <!-- 未到账 --> |
| | | <if test="state != null and state == 1"> |
| | | <!-- 未到账 --> |
| | | AND (hb.hb_state = 1 or hb.hb_state = 2) |
| | | </if> |
| | | <if test="state != null and state == 2"> <!-- 已到账 --> |
| | | <if test="state != null and state == 2"> |
| | | <!-- 已到账 --> |
| | | AND hb.hb_state = 3 |
| | | </if> |
| | | <if test="state != null and state == 3"> <!-- 红包已失效、整个订单失效 --> |
| | | AND hb.hb_state =4 AND co.co_state_whole_order = 3 |
| | | <if test="state != null and state == 3"> |
| | | <!-- 红包已失效、整个订单失效 --> |
| | | AND hb.hb_state =4 AND co.co_state_whole_order = 3 |
| | | </if> |
| | | </sql> |
| | | |
| | | <sql id="Hongbao_Column_List"> |
| | | hb_id,hb_uid,hb_urank,hb_pid,hb_type,hb_state,hb_pre_get_time,hb_get_time,hb_version, |
| | | <sql id="Hongbao_Column_List">hb_id,hb_uid,hb_urank,hb_pid,hb_type,hb_state,hb_pre_get_time,hb_get_time,hb_version, |
| | | IF(v2.`hb_state` = 4, 0, v2.hb_money)AS hb_money |
| | | </sql> |
| | | |
| | | <sql id="Order_Column_List"> |
| | | co_id,co_uid,co_order_no,co_source_type,co_source_position, |
| | | <sql id="Order_Column_List">co_id,co_uid,co_order_no,co_source_type,co_source_position, |
| | | co_order_goods_id,co_count,co_state,co_state_whole_order, |
| | | co_estimate,co_eIncome,co_payment,co_settlement, |
| | | co_third_create_time, |
| | | MAX(co_settle_time) AS co_settle_time, |
| | | co_order_by, |
| | | co_create_time, |
| | | co_estimate,co_eIncome,co_payment,co_settlement, co_third_create_time, |
| | | MAX(co_settle_time) AS co_settle_time, co_order_by, co_create_time, |
| | | co_update_time |
| | | </sql> |
| | | |
| | | |
| | | <select id="listUserOrder" resultMap="ResultMap"> |
| | | <!-- 查询用户订单 --> |
| | | SELECT COALESCE(SUM(hb.`hb_money`),0)AS totalMoney, |
| | | hb.hb_state AS hongBaoState, |
| | | hb.`hb_type` AS hongBaoType, |
| | | MAX(hb.`hb_get_time`) AS accountTime, |
| | | MAX(hb.`hb_pre_get_time`) AS preAccountTime, |
| | | <include refid="Order_Column_List"/> |
| | | FROM yeshi_ec_hongbao_order ho |
| | | |
| | | LEFT JOIN (SELECT <include refid="Hongbao_Column_List"/> FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<> 10 ]]> |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> <!-- 红包类型 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | <select id="listUserOrder" resultMap="ResultMap"> |
| | | <!-- 查询用户订单 --> |
| | | SELECT COALESCE(SUM(hb.`hb_money`),0)AS totalMoney, hb.hb_state AS |
| | | hongBaoState, hb.`hb_type` AS hongBaoType, MAX(hb.`hb_get_time`) AS |
| | | accountTime, MAX(hb.`hb_pre_get_time`) AS preAccountTime, |
| | | <include refid="Order_Column_List" /> |
| | | FROM yeshi_ec_hongbao_order ho LEFT JOIN (SELECT |
| | | <include refid="Hongbao_Column_List" /> |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<> 10 ]]> |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | <!-- 红包类型 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE"/> <!-- 订单状态 --> |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME"/> <!-- 订单时间 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | <if test="orderNo != null and orderNo !='' "> |
| | | AND co.co_order_no = #{orderNo} |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` |
| | | ORDER BY co.co_third_create_time DESC |
| | | LIMIT ${start},${count} |
| | | <include refid="SELECT_PARAM_ORDER_STATE" /> |
| | | <!-- 订单状态 --> |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <!-- 订单时间 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE" /> |
| | | <!-- 红包状态 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` ORDER BY |
| | | co.co_third_create_time DESC LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countUserOrder" resultType="java.lang.Long"> |
| | | <!-- 统计用户订单数量 --> |
| | | SELECT IFNULL(COUNT(ho_id),0) FROM |
| | | (SELECT ho.ho_id FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN (SELECT <include refid="Hongbao_Column_List"/> FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<> 10 ]]> |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> <!-- 红包类型 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE"/> <!-- 订单状态 --> |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME"/> <!-- 订单时间 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | <if test="orderNo != null and orderNo !='' "> |
| | | AND co.co_order_no = #{orderNo} |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` |
| | | )A |
| | | <select id="countUserOrder" resultType="java.lang.Long"> |
| | | <!-- 统计用户订单数量 --> |
| | | SELECT IFNULL(COUNT(ho_id),0) FROM (SELECT ho.ho_id FROM |
| | | yeshi_ec_hongbao_order ho LEFT JOIN (SELECT |
| | | <include refid="Hongbao_Column_List" /> |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<> 10 ]]> |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | <!-- 红包类型 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE" /> |
| | | <!-- 订单状态 --> |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <!-- 订单时间 --> |
| | | <include refid="SELECT_PARAM_HONGBAO_STATE" /> |
| | | <!-- 红包状态 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A |
| | | </select> |
| | | |
| | | <select id="listOrderGoodsInfo" resultMap="ResultMap" parameterType="java.util.List"> |
| | | <!-- 查询用户订单商品信息 --> |
| | | SELECT COALESCE(SUM(tc.`co_payment`),0)AS totalPayment,COALESCE(SUM(tc.`co_settlement`),0)AS totalSettlement, |
| | | COALESCE(SUM(tc.`co_count`),0)AS totalCount,tc.`co_source_type`,tc.`co_order_no`,tg.*,tc.co_id |
| | | FROM |
| | | yeshi_ec_common_order_goods tg |
| | | LEFT JOIN yeshi_ec_common_order tc ON tc.`co_order_goods_id` = tg.`cog_id` |
| | | WHERE |
| | | <foreach collection="list" item="item" separator=" OR "> |
| | | (tc.`co_source_type` = #{item.sourceType,jdbcType=INTEGER} AND |
| | | tc.`co_order_no` = #{item.orderNo,jdbcType=VARCHAR}) |
| | | <select id="listOrderGoodsInfo" resultMap="ResultMap" |
| | | parameterType="java.util.List"> |
| | | <!-- 查询用户订单商品信息 --> |
| | | SELECT COALESCE(SUM(tc.`co_payment`),0)AS |
| | | totalPayment,COALESCE(SUM(tc.`co_settlement`),0)AS totalSettlement, |
| | | COALESCE(SUM(tc.`co_count`),0)AS |
| | | totalCount,tc.`co_source_type`,tc.`co_order_no`,tg.*,tc.co_id FROM |
| | | yeshi_ec_common_order_goods tg LEFT JOIN yeshi_ec_common_order tc ON |
| | | tc.`co_order_goods_id` = tg.`cog_id` WHERE |
| | | <foreach collection="list" item="item" separator=" OR ">(tc.`co_source_type` |
| | | = #{item.sourceType,jdbcType=INTEGER} AND tc.`co_order_no` = |
| | | #{item.orderNo,jdbcType=VARCHAR}) |
| | | </foreach> |
| | | GROUP BY tc.`co_order_no`,tc.`co_order_goods_id` |
| | | </select> |
| | | |
| | | |
| | | <select id="countHistoryOrder" resultType="java.util.HashMap"> |
| | | <!-- 统计历史订单数量 --> |
| | | SELECT SUM(A.self)AS totalSelf,SUM(A.shared)AS totalShared,SUM(A.invite)AS totalInvite |
| | | FROM ( |
| | | <!-- 返利订单 --> |
| | | SELECT IFNULL(COUNT(ho_id),0) AS self,0 AS shared,0 AS invite |
| | | FROM (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN ( |
| | | SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`= ${uid} AND (v2.`hb_type` = 1 OR v2.`hb_type` = 2) |
| | | ) hb ON hb.hb_id=ho.`ho_hongbao_id` <!-- 自购订单 --> |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <if test="day != null and day == 1"> <!-- 今天 --> |
| | | AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW()) |
| | | </if> |
| | | <if test="day != null and day == 2"> <!-- 昨天 --> |
| | | AND TO_DAYS(NOW()) - TO_DAYS(co.co_third_create_time) = 1 |
| | | </if> |
| | | <if test="day != null and day == 3"> <!-- 本月 --> |
| | | AND DATE_FORMAT(co.`co_third_create_time`,'%Y%m') = |
| | | DATE_FORMAT(CURDATE(),'%Y%m') |
| | | </if> |
| | | <if test="day != null and day == 4"> <!-- 上月 --> |
| | | AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), |
| | | DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1 |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)YX |
| | | |
| | | UNION ALL |
| | | <!-- 分享订单 --> |
| | | SELECT 0 AS self,IFNULL(COUNT(ho_id),0) AS shared,0 AS invite |
| | | FROM (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN ( |
| | | SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`= ${uid} AND v2.`hb_type` = 20 |
| | | ) hb ON hb.hb_id=ho.`ho_hongbao_id` <!-- 分享订单 --> |
| | | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <if test="day != null and day == 1"> <!-- 今天 --> |
| | | AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW()) |
| | | </if> |
| | | <if test="day != null and day == 2"> <!-- 昨天 --> |
| | | AND TO_DAYS(NOW()) - TO_DAYS(co.`co_third_create_time`) = 1 |
| | | </if> |
| | | <if test="day != null and day == 3"> <!-- 本月 --> |
| | | AND DATE_FORMAT(co.`co_third_create_time`,'%Y%m') = |
| | | DATE_FORMAT(CURDATE(),'%Y%m') |
| | | </if> |
| | | <if test="day != null and day == 4"> <!-- 上月 --> |
| | | AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), |
| | | DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1 |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)WQ |
| | | |
| | | UNION ALL |
| | | <!-- 邀请订单 --> |
| | | SELECT 0 AS self,0 AS shared,IFNULL(COUNT(ho_id),0) AS invite |
| | | FROM (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN ( |
| | | SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`= ${uid} |
| | | AND (v2.`hb_type` = 5 OR v2.`hb_type` = 6 OR v2.`hb_type` = 7 |
| | | OR v2.`hb_type` = 21 OR v2.`hb_type` = 22 ) |
| | | ) hbp ON hbp.hb_pid=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hbp.hb_id IS NOT NULL |
| | | <if test="day != null and day == 1"> <!-- 今天 --> |
| | | AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW()) |
| | | </if> |
| | | <if test="day != null and day == 2"> <!-- 昨天 --> |
| | | AND TO_DAYS(NOW()) - TO_DAYS(co.`co_third_create_time`) = 1 |
| | | </if> |
| | | <if test="day != null and day == 3"> <!-- 本月 --> |
| | | AND DATE_FORMAT(co.`co_third_create_time`,'%Y%m') = |
| | | DATE_FORMAT(CURDATE(),'%Y%m') |
| | | </if> |
| | | <if test="day != null and day == 4"> <!-- 上月 --> |
| | | AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), |
| | | DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1 |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)SX |
| | | )A |
| | | SELECT SUM(A.self)AS totalSelf,SUM(A.shared)AS |
| | | totalShared,SUM(A.invite)AS totalInvite FROM ( |
| | | <!-- 返利订单 --> |
| | | SELECT IFNULL(COUNT(ho_id),0) AS self,0 AS shared,0 AS invite FROM |
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT * |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= ${uid} AND |
| | | (v2.`hb_type` = 1 OR v2.`hb_type` = 2) ) hb ON |
| | | hb.hb_id=ho.`ho_hongbao_id` |
| | | <!-- 自购订单 --> |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <if test="day != null and day == 1"> |
| | | <!-- 今天 --> |
| | | AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW()) |
| | | </if> |
| | | <if test="day != null and day == 2"> |
| | | <!-- 昨天 --> |
| | | AND TO_DAYS(NOW()) - TO_DAYS(co.co_third_create_time) = 1 |
| | | </if> |
| | | <if test="day != null and day == 3"> |
| | | <!-- 本月 --> |
| | | AND DATE_FORMAT(co.`co_third_create_time`,'%Y%m') = |
| | | DATE_FORMAT(CURDATE(),'%Y%m') |
| | | </if> |
| | | <if test="day != null and day == 4"> |
| | | <!-- 上月 --> |
| | | AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), |
| | | DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1 |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)YX UNION ALL |
| | | <!-- 分享订单 --> |
| | | SELECT 0 AS self,IFNULL(COUNT(ho_id),0) AS shared,0 AS invite FROM |
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT * |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= ${uid} AND v2.`hb_type` |
| | | = 20 ) hb ON hb.hb_id=ho.`ho_hongbao_id` |
| | | <!-- 分享订单 --> |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <if test="day != null and day == 1"> |
| | | <!-- 今天 --> |
| | | AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW()) |
| | | </if> |
| | | <if test="day != null and day == 2"> |
| | | <!-- 昨天 --> |
| | | AND TO_DAYS(NOW()) - TO_DAYS(co.`co_third_create_time`) = 1 |
| | | </if> |
| | | <if test="day != null and day == 3"> |
| | | <!-- 本月 --> |
| | | AND DATE_FORMAT(co.`co_third_create_time`,'%Y%m') = |
| | | DATE_FORMAT(CURDATE(),'%Y%m') |
| | | </if> |
| | | <if test="day != null and day == 4"> |
| | | <!-- 上月 --> |
| | | AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), |
| | | DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1 |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)WQ UNION ALL |
| | | <!-- 邀请订单 --> |
| | | SELECT 0 AS self,0 AS shared,IFNULL(COUNT(ho_id),0) AS invite FROM |
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT * |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= ${uid} AND |
| | | (v2.`hb_type` = 5 OR v2.`hb_type` = 6 OR v2.`hb_type` = 7 OR |
| | | v2.`hb_type` = 21 OR v2.`hb_type` = 22 ) ) hbp ON |
| | | hbp.hb_pid=ho.`ho_hongbao_id` LEFT JOIN yeshi_ec_common_order co ON |
| | | co.`co_id`=ho.`ho_order_id` WHERE hbp.hb_id IS NOT NULL |
| | | <if test="day != null and day == 1"> |
| | | <!-- 今天 --> |
| | | AND TO_DAYS(co.`co_third_create_time`) = TO_DAYS(NOW()) |
| | | </if> |
| | | <if test="day != null and day == 2"> |
| | | <!-- 昨天 --> |
| | | AND TO_DAYS(NOW()) - TO_DAYS(co.`co_third_create_time`) = 1 |
| | | </if> |
| | | <if test="day != null and day == 3"> |
| | | <!-- 本月 --> |
| | | AND DATE_FORMAT(co.`co_third_create_time`,'%Y%m') = |
| | | DATE_FORMAT(CURDATE(),'%Y%m') |
| | | </if> |
| | | <if test="day != null and day == 4"> |
| | | <!-- 上月 --> |
| | | AND PERIOD_DIFF(DATE_FORMAT(NOW(), '%Y%m'), |
| | | DATE_FORMAT(co.`co_settle_time`, '%Y%m')) = 1 |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)SX )A |
| | | </select> |
| | | |
| | | |
| | | <select id="countByUidAndOrderState" resultType="java.util.HashMap"> |
| | | SELECT SUM(A.valid)AS totalValid, SUM(A.proces)AS totalProces,SUM(A.Invalid)AS totalInvite |
| | | FROM ( |
| | | <!-- 有效订单 --> |
| | | SELECT IFNULL(COUNT(ho_id),0) AS valid,0 AS proces,0 AS Invalid |
| | | FROM (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN ( |
| | | SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`=${uid} <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | ) hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <![CDATA[AND co.`co_state` <> 3]]> |
| | | AND (co.`co_state_whole_order` =1 OR co.`co_state_whole_order` = 2) |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)YX |
| | | |
| | | UNION ALL |
| | | <!-- 维权订单 --> |
| | | SELECT 0 AS valid,IFNULL(COUNT(ho_id),0) AS proces,0 AS Invalid |
| | | FROM (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN ( |
| | | SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`=${uid} <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | ) hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | AND co.`co_state` = 3 |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)WQ |
| | | |
| | | UNION ALL |
| | | <!-- 失效订单 --> |
| | | SELECT 0 AS valid,0 AS proces,IFNULL(COUNT(ho_id),0) AS Invalid |
| | | FROM (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN ( |
| | | SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`=${uid} <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | ) hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | AND co.`co_state_whole_order` = 3 |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)SX |
| | | )A |
| | | |
| | | SELECT SUM(A.valid)AS totalValid, SUM(A.proces)AS |
| | | totalProces,SUM(A.Invalid)AS totalInvite FROM ( |
| | | <!-- 有效订单 --> |
| | | SELECT IFNULL(COUNT(ho_id),0) AS valid,0 AS proces,0 AS Invalid FROM |
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT * |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`=${uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | ) hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL <![CDATA[AND co.`co_state` <> 3]]> |
| | | AND (co.`co_state_whole_order` =1 OR co.`co_state_whole_order` = 2) |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)YX UNION ALL |
| | | <!-- 维权订单 --> |
| | | SELECT 0 AS valid,IFNULL(COUNT(ho_id),0) AS proces,0 AS Invalid FROM |
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT * |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`=${uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | ) hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL AND co.`co_state` = 3 |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)WQ UNION ALL |
| | | <!-- 失效订单 --> |
| | | SELECT 0 AS valid,0 AS proces,IFNULL(COUNT(ho_id),0) AS Invalid FROM |
| | | (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT * |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`=${uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | ) hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL AND co.`co_state_whole_order` = 3 |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type`)SX )A |
| | | </select> |
| | | |
| | | |
| | | <select id="countBonusOrderNumber" resultType="java.lang.Long"> |
| | | <!-- 奖金统计:订单数量 --> |
| | | SELECT IFNULL(COUNT(ho_id),0) |
| | | FROM (SELECT ho.`ho_id` FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN ( |
| | | SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`=${uid} <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | ) hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` |
| | | )A |
| | | SELECT IFNULL(COUNT(ho_id),0) FROM (SELECT ho.`ho_id` FROM |
| | | yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT * FROM |
| | | yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`=${uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | ) hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A |
| | | </select> |
| | | |
| | | <select id="countBonusOrderMoney" resultType="java.math.BigDecimal"> |
| | | <!-- 奖金统计:订单总返利金额 去掉已失效 --> |
| | | SELECT COALESCE(SUM(hb.`hb_money`),0)AS totalmoney |
| | | FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN ( |
| | | SELECT <include refid="Hongbao_Column_List"/> FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`=${uid} <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2 or v2.hb_state = 3) |
| | | ) hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <if test="day != null and day == 4"> |
| | | AND co.`co_state` = 2 <!-- 上月 :统计已收货 --> |
| | | </if> |
| | | SELECT COALESCE(SUM(hb.`hb_money`),0)AS totalmoney FROM |
| | | yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT |
| | | <include refid="Hongbao_Column_List" /> |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`=${uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2 or v2.hb_state = 3) ) hb ON |
| | | IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` LEFT JOIN |
| | | yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` WHERE hb.hb_id |
| | | IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <if test="day != null and day == 4"> |
| | | AND co.`co_state` = 2 |
| | | <!-- 上月 :统计已收货 --> |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="countBonusOrderMoneyAndNumber" resultType="java.util.HashMap"> |
| | | SELECT COUNT(*) AS totalNum, CAST(SUM(moneys) AS DECIMAL(19,2)) AS totalmoney FROM |
| | | (SELECT CAST(SUM(hb.`hb_money`) AS DECIMAL(19,2))AS moneys |
| | | FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN ( |
| | | SELECT <include refid="Hongbao_Column_List"/> FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`=${uid} <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2 or v2.hb_state = 3) |
| | | ) hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <if test="day != null and day == 4"> |
| | | AND co.`co_state` = 2 <!-- 上月 :统计已收货 --> |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` |
| | | )A |
| | | SELECT COUNT(*) AS totalNum, CAST(SUM(moneys) AS DECIMAL(19,2)) AS |
| | | totalmoney FROM (SELECT CAST(SUM(hb.`hb_money`) AS DECIMAL(19,2))AS |
| | | moneys FROM yeshi_ec_hongbao_order ho LEFT JOIN ( SELECT |
| | | <include refid="Hongbao_Column_List" /> |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`=${uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2 or v2.hb_state = 3) ) hb ON |
| | | IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` LEFT JOIN |
| | | yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` WHERE hb.hb_id |
| | | IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <if test="day != null and day == 4"> |
| | | AND co.`co_state` = 2 |
| | | <!-- 上月 :统计已收货 --> |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` )A |
| | | </select> |
| | | |
| | | |
| | | |
| | | <sql id="SELECT_HONGBAO_STATE"> |
| | | <if test="state != null and state == 1"> <!-- 未到账 --> |
| | | <if test="state != null and state == 1"> |
| | | <!-- 未到账 --> |
| | | AND (v2.hb_state = 1 or v2.hb_state = 2) |
| | | </if> |
| | | <if test="state != null and state == 2"> <!-- 已到账 --> |
| | | <if test="state != null and state == 2"> |
| | | <!-- 已到账 --> |
| | | AND v2.hb_state = 3 |
| | | </if> |
| | | <if test="state != null and state == 3"> <!-- 红包已失效 --> |
| | | AND v2.hb_state =4 |
| | | <if test="state != null and state == 3"> |
| | | <!-- 红包已失效 --> |
| | | AND v2.hb_state =4 |
| | | </if> |
| | | </sql> |
| | | |
| | | <select id="listQueryByUid" resultMap="ResultMap"> |
| | | <!-- 查询用户订单 --> |
| | | SELECT hb.`hb_money` AS totalMoney, |
| | | hb.hb_state AS hongBaoState, |
| | | hb.`hb_type` AS hongBaoType, |
| | | hb.`hb_get_time` AS accountTime, |
| | | hb.`hb_pre_get_time` AS preAccountTime, |
| | | co.*,cog.* |
| | | FROM yeshi_ec_hongbao_order ho |
| | | |
| | | LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`= #{uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> <!-- 红包类型 --> |
| | | <include refid="SELECT_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_common_order_goods cog ON cog.`cog_id`= co.`co_order_goods_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE"/> <!-- 订单状态 --> |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME"/> <!-- 订单时间 --> |
| | | <if test="orderNo != null and orderNo !='' "> |
| | | AND co.co_order_no = #{orderNo} |
| | | </if> |
| | | ORDER BY co.co_third_create_time DESC |
| | | LIMIT ${start},${count} |
| | | <select id="listQueryByUid" resultMap="ResultMap"> |
| | | <!-- 查询用户订单 --> |
| | | SELECT hb.`hb_money` AS totalMoney, hb.hb_state AS hongBaoState, |
| | | hb.`hb_type` AS hongBaoType, hb.`hb_get_time` AS accountTime, |
| | | hb.`hb_pre_get_time` AS preAccountTime, co.*,cog.* FROM |
| | | yeshi_ec_hongbao_order ho LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 |
| | | v2 WHERE v2.`hb_uid`= #{uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | <!-- 红包类型 --> |
| | | <include refid="SELECT_HONGBAO_STATE" /> |
| | | <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` LEFT |
| | | JOIN yeshi_ec_common_order_goods cog ON cog.`cog_id`= |
| | | co.`co_order_goods_id` WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE" /> |
| | | <!-- 订单状态 --> |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <!-- 订单时间 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | ORDER BY co.co_third_create_time DESC LIMIT ${start},${count} |
| | | </select> |
| | | |
| | | <select id="countQueryByUid" resultType="java.lang.Long"> |
| | | <!-- 统计用户订单数量 --> |
| | | SELECT IFNULL(COUNT(ho_id),0) FROM |
| | | (SELECT ho.ho_id FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`= #{uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> <!-- 红包类型 --> |
| | | <include refid="SELECT_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE"/> <!-- 订单状态 --> |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME"/> <!-- 订单时间 --> |
| | | <if test="orderNo != null and orderNo !='' "> |
| | | AND co.co_order_no = #{orderNo} |
| | | </if> |
| | | <select id="countQueryByUid" resultType="java.lang.Long"> |
| | | <!-- 统计用户订单数量 --> |
| | | SELECT IFNULL(COUNT(ho_id),0) FROM (SELECT ho.ho_id FROM |
| | | yeshi_ec_hongbao_order ho LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 |
| | | v2 WHERE v2.`hb_uid`= #{uid} |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | <!-- 红包类型 --> |
| | | <include refid="SELECT_HONGBAO_STATE" /> |
| | | <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE" /> |
| | | <!-- 订单状态 --> |
| | | <include refid="SELECT_PARAM_ORDER_CREATE_TIME" /> |
| | | <!-- 订单时间 --> |
| | | <if test="orderNo != null and orderNo !='' ">AND co.co_order_no = #{orderNo}</if> |
| | | )A |
| | | </select> |
| | | |
| | | <select id="getBuFenOrderState" resultMap="ResultMap"> |
| | | SELECT co.co_state,v2.`hb_state` AS hongBaoState FROM `yeshi_ec_common_order` co |
| | | LEFT JOIN yeshi_ec_hongbao_order ho ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 v2 ON IF(v2.hb_pid IS NULL,v2.hb_id,v2.hb_pid)=ho.`ho_hongbao_id` |
| | | WHERE co.`co_order_no` = #{orderNo} AND co.co_state<![CDATA[<>]]> 4 AND v2.hb_uid = #{uid} |
| | | ORDER BY co.`co_state` DESC |
| | | LIMIT 1 |
| | | <select id="getBuFenOrderState" resultMap="ResultMap">SELECT |
| | | co.co_state,v2.`hb_state` AS hongBaoState FROM `yeshi_ec_common_order` |
| | | co LEFT JOIN yeshi_ec_hongbao_order ho ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_hongbao_v2 v2 ON IF(v2.hb_pid IS |
| | | NULL,v2.hb_id,v2.hb_pid)=ho.`ho_hongbao_id` WHERE co.`co_order_no` = |
| | | #{orderNo} AND co.co_state<![CDATA[<>]]> |
| | | 4 AND v2.hb_uid = #{uid} ORDER BY co.`co_state` DESC LIMIT 1 |
| | | </select> |
| | | |
| | | <select id="listQuery" resultMap="ResultMap"> |
| | | |
| | | SELECT A.*,u.id AS userId,u.`nick_name` AS userName,u.`portrait` AS userPortrait, |
| | | pv2.`hb_uid` AS levelOneId,pv2.`hb_money` AS levelOneMoney, |
| | | ppv2.`hb_uid` AS levelTwoId,ppv2.`hb_money` AS levelTwoMoney |
| | | |
| | | FROM (SELECT hb.hb_id,hb.hb_uid,hb.`hb_money` AS totalMoney, |
| | | hb.hb_state AS hongBaoState, |
| | | hb.`hb_type` AS hongBaoType, |
| | | hb.`hb_get_time` AS accountTime, |
| | | hb.`hb_pre_get_time` AS preAccountTime, |
| | | co.*,cog.* |
| | | FROM yeshi_ec_hongbao_order ho |
| | | |
| | | LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE 1=1 |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> <!-- 红包类型 --> |
| | | <include refid="SELECT_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_common_order_goods cog ON cog.`cog_id`= co.`co_order_goods_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE"/> <!-- 订单状态 --> |
| | | <if test="startTime != null and startTime != '' "> |
| | | AND <![CDATA[co.co_third_create_time >= #{startTime}]]> |
| | | </if> |
| | | <if test="endTime != null and endTime != '' "> |
| | | AND <![CDATA[co.co_third_create_time <= #{endTime}]]> |
| | | </if> |
| | | |
| | | <if test="key != null and key != '' "> |
| | | <if test="keyType == 1 "> |
| | | AND co.co_order_no = ${key} |
| | | </if> |
| | | <if test="keyType == 2 "> |
| | | AND hb.hb_uid = ${key} |
| | | </if> |
| | | </if> |
| | | |
| | | ORDER BY co.co_third_create_time DESC |
| | | LIMIT ${start},${count} |
| | | ) A |
| | | LEFT JOIN yeshi_ec_user u ON u.id = A.hb_uid |
| | | LEFT JOIN yeshi_ec_hongbao_v2 pv2 ON pv2.`hb_pid` = A.hb_id |
| | | LEFT JOIN yeshi_ec_hongbao_v2 ppv2 ON ppv2.`hb_pid` = A.hb_id |
| | | |
| | | <select id="listQuery" resultMap="ResultMap"> |
| | | SELECT A.*,u.id AS userId,u.`nick_name` AS userName,u.`portrait` AS |
| | | userPortrait, pv2.`hb_uid` AS levelOneId,pv2.`hb_money` AS |
| | | levelOneMoney, ppv2.`hb_uid` AS levelTwoId,ppv2.`hb_money` AS |
| | | levelTwoMoney FROM (SELECT hb.hb_id,hb.hb_uid,hb.`hb_money` AS |
| | | totalMoney, hb.hb_state AS hongBaoState, hb.`hb_type` AS hongBaoType, |
| | | hb.`hb_get_time` AS accountTime, hb.`hb_pre_get_time` AS |
| | | preAccountTime, co.*,cog.* FROM yeshi_ec_hongbao_order ho LEFT JOIN |
| | | (SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1 |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | <!-- 红包类型 --> |
| | | <include refid="SELECT_HONGBAO_STATE" /> |
| | | <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` LEFT |
| | | JOIN yeshi_ec_common_order_goods cog ON cog.`cog_id`= |
| | | co.`co_order_goods_id` WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE" /> |
| | | <!-- 订单状态 --> |
| | | <if test="startTime != null and startTime != '' ">AND <![CDATA[co.co_third_create_time >= #{startTime}]]> |
| | | </if> |
| | | <if test="endTime != null and endTime != '' ">AND <![CDATA[co.co_third_create_time <= #{endTime}]]> |
| | | </if> |
| | | <if test="key != null and key != '' "> |
| | | <if test="keyType == 1 ">AND co.co_order_no = ${key}</if> |
| | | <if test="keyType == 2 ">AND hb.hb_uid = ${key}</if> |
| | | </if> |
| | | ORDER BY co.co_third_create_time DESC LIMIT ${start},${count} ) A LEFT |
| | | JOIN yeshi_ec_user u ON u.id = A.hb_uid LEFT JOIN yeshi_ec_hongbao_v2 |
| | | pv2 ON pv2.`hb_pid` = A.hb_id LEFT JOIN yeshi_ec_hongbao_v2 ppv2 ON |
| | | ppv2.`hb_pid` = A.hb_id |
| | | </select> |
| | | |
| | | <select id="countQuery" resultType="java.lang.Long"> |
| | | SELECT count(ho.ho_id) |
| | | FROM yeshi_ec_hongbao_order ho |
| | | |
| | | LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE 1=1 |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE"/> <!-- 红包类型 --> |
| | | <include refid="SELECT_HONGBAO_STATE"/> <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | LEFT JOIN yeshi_ec_common_order_goods cog ON cog.`cog_id`= co.`co_order_goods_id` |
| | | WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE"/> <!-- 订单状态 --> |
| | | <if test="startTime != null and startTime != '' "> |
| | | AND <![CDATA[co.co_third_create_time >= #{startTime}]]> |
| | | </if> |
| | | <if test="endTime != null and endTime != '' "> |
| | | AND <![CDATA[co.co_third_create_time <= #{endTime}]]> |
| | | </if> |
| | | |
| | | <if test="key != null and key != '' "> |
| | | <if test="keyType == 1 "> |
| | | AND co.co_order_no = ${key} |
| | | </if> |
| | | <if test="keyType == 2 "> |
| | | AND hb.hb_uid = ${key} |
| | | </if> |
| | | </if> |
| | | <select id="countQuery" resultType="java.lang.Long"> |
| | | SELECT count(ho.ho_id) FROM yeshi_ec_hongbao_order ho LEFT JOIN |
| | | (SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE 1=1 |
| | | <include refid="SELECT_PARAM_HONGBAO_TYPE" /> |
| | | <!-- 红包类型 --> |
| | | <include refid="SELECT_HONGBAO_STATE" /> |
| | | <!-- 红包状态 --> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` LEFT |
| | | JOIN yeshi_ec_common_order_goods cog ON cog.`cog_id`= |
| | | co.`co_order_goods_id` WHERE hb.hb_id IS NOT NULL |
| | | <include refid="SELECT_PARAM_ORDER_STATE" /> |
| | | <!-- 订单状态 --> |
| | | <if test="startTime != null and startTime != '' ">AND <![CDATA[co.co_third_create_time >= #{startTime}]]> |
| | | </if> |
| | | <if test="endTime != null and endTime != '' ">AND <![CDATA[co.co_third_create_time <= #{endTime}]]> |
| | | </if> |
| | | <if test="key != null and key != '' "> |
| | | <if test="keyType == 1 ">AND co.co_order_no = ${key}</if> |
| | | <if test="keyType == 2 ">AND hb.hb_uid = ${key}</if> |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="getCouponHongbaoByOrderNo" resultMap="ResultMap"> |
| | | SELECT COALESCE(SUM(IF(hb.hb_type=1,hb.`hb_money`,0)),0)AS totalMoney, |
| | | COALESCE(SUM(IF(hb.hb_type=10,hb.`hb_money`,0)),0)AS couponMoney, |
| | | hb.`hb_type` AS hongBaoType, |
| | | MAX(hb.`hb_get_time`) AS accountTime, |
| | | MAX(hb.`hb_pre_get_time`) AS preAccountTime, |
| | | hb.hb_state AS hongBaoState, |
| | | <include refid="Order_Column_List"/> |
| | | FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN (SELECT * FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= #{uid} |
| | | <if test="hongBaoState != null"> |
| | | AND v2.`hb_state` = #{hongBaoState} |
| | | </if> |
| | | )hb ON hb.hb_id = ho.`ho_hongbao_id` |
| | | SELECT COALESCE(SUM(IF(hb.hb_type=1,hb.`hb_money`,0)),0)AS totalMoney, |
| | | COALESCE(SUM(IF(hb.hb_type=10,hb.`hb_money`,0)),0)AS couponMoney, |
| | | hb.`hb_type` AS hongBaoType, MAX(hb.`hb_get_time`) AS accountTime, |
| | | MAX(hb.`hb_pre_get_time`) AS preAccountTime, hb.hb_state AS |
| | | hongBaoState, |
| | | <include refid="Order_Column_List" /> |
| | | FROM yeshi_ec_hongbao_order ho LEFT JOIN (SELECT * FROM |
| | | yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= #{uid} |
| | | <if test="hongBaoState != null">AND v2.`hb_state` = #{hongBaoState}</if> |
| | | )hb ON hb.hb_id = ho.`ho_hongbao_id` LEFT JOIN yeshi_ec_common_order |
| | | co ON co.`co_id`=ho.`ho_order_id` WHERE hb.hb_id IS NOT NULL AND |
| | | co.co_order_no = #{orderNo} |
| | | </select> |
| | | <select id="getCommonOrderByOrderNo" resultMap="ResultMap"> |
| | | <!-- 查询用户订单 --> |
| | | SELECT COALESCE(SUM(hb.`hb_money`),0)AS totalMoney, |
| | | COALESCE(SUM(co.`co_payment`),0)AS totalPayment, hb.hb_state AS |
| | | hongBaoState, hb.`hb_type` AS hongBaoType, |
| | | <include refid="Order_Column_List" /> |
| | | FROM yeshi_ec_hongbao_order ho LEFT JOIN (SELECT |
| | | <include refid="Hongbao_Column_List" /> |
| | | FROM yeshi_ec_hongbao_v2 v2 WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<> 10 ]]> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL AND co.co_order_no = #{orderNo} |
| | | </select> |
| | | |
| | | <select id="getCommonOrderByOrderNo" resultMap="ResultMap"> |
| | | <!-- 查询用户订单 --> |
| | | SELECT COALESCE(SUM(hb.`hb_money`),0)AS totalMoney, COALESCE(SUM(co.`co_payment`),0)AS totalPayment, |
| | | hb.hb_state AS hongBaoState, |
| | | hb.`hb_type` AS hongBaoType, |
| | | <include refid="Order_Column_List"/> |
| | | FROM yeshi_ec_hongbao_order ho |
| | | LEFT JOIN (SELECT <include refid="Hongbao_Column_List"/> FROM yeshi_ec_hongbao_v2 v2 |
| | | WHERE v2.`hb_uid`= #{uid} AND <![CDATA[v2.`hb_type`<> 10 ]]> |
| | | )hb ON IF(hb.hb_pid IS NULL,hb.hb_id,hb.hb_pid)=ho.`ho_hongbao_id` |
| | | LEFT JOIN yeshi_ec_common_order co ON co.`co_id`=ho.`ho_order_id` |
| | | WHERE hb.hb_id IS NOT NULL AND co.co_order_no = #{orderNo} |
| | | <if test="orderState != null"> |
| | | AND co.co_state = #{orderState} <!-- 已收货 --> |
| | | </if> |
| | | <if test="orderState != null"> |
| | | AND co.co_state = #{orderState} |
| | | <!-- 已收货 --> |
| | | </if> |
| | | GROUP BY co.`co_order_no`, co.`co_source_type` |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result column="updatetime" property="updatetime" jdbcType="TIMESTAMP" /> |
| | | <result column="state" property="state" jdbcType="INTEGER" /> |
| | | <result column="totalSales" property="totalSales" jdbcType="INTEGER" /> |
| | | <result column="material_lib_type" property="materialLibType" |
| | | jdbcType="INTEGER" /> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">id,rootCatId,eventCreatorId,leafCatId,debugInfo,rootCatScore,sellerId,userType,shopTitle,pictUrl,pictUrlWhite,title,auctionId,couponLink,couponLinkTaoToken,couponActivityId,biz30day,tkRate,nick,includeDxjh,reservePrice,tkCommFee,totalFee,totalNum,zkPrice,dayLeft,tk3rdRate,auctionUrl,rlRate,hasRecommended,hasSame,sameItemPid,couponTotalCount,couponLeftCount,couponAmount,eventRate,couponShortLink,couponInfo,couponStartFee,couponEffectiveStartTime,couponEffectiveEndTime,hasUmpBonus,isBizActivity,umpBonus,rootCategoryName,couponOriLink,userTypeName,createtime,tkMktStatus,updatetime,state,totalSales |
| | | <sql id="Base_Column_List">id,rootCatId,eventCreatorId,leafCatId,debugInfo,rootCatScore,sellerId,userType,shopTitle,pictUrl,pictUrlWhite,title,auctionId,couponLink,couponLinkTaoToken,couponActivityId,biz30day,tkRate,nick,includeDxjh,reservePrice,tkCommFee,totalFee,totalNum,zkPrice,dayLeft,tk3rdRate,auctionUrl,rlRate,hasRecommended,hasSame,sameItemPid,couponTotalCount,couponLeftCount,couponAmount,eventRate,couponShortLink,couponInfo,couponStartFee,couponEffectiveStartTime,couponEffectiveEndTime,hasUmpBonus,isBizActivity,umpBonus,rootCategoryName,couponOriLink,userTypeName,createtime,tkMktStatus,updatetime,state,totalSales,material_lib_type |
| | | </sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | |
| | | </delete> |
| | | |
| | | |
| | | |
| | | |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief" |
| | | useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_taobao_goods |
| | | (id,rootCatId,eventCreatorId,leafCatId,debugInfo,rootCatScore,sellerId,userType,shopTitle,pictUrl,pictUrlWhite,title,auctionId,couponLink,couponLinkTaoToken,couponActivityId,biz30day,tkRate,nick,includeDxjh,reservePrice,tkCommFee,totalFee,totalNum,zkPrice,dayLeft,tk3rdRate,auctionUrl,rlRate,hasRecommended,hasSame,sameItemPid,couponTotalCount,couponLeftCount,couponAmount,eventRate,couponShortLink,couponInfo,couponStartFee,couponEffectiveStartTime,couponEffectiveEndTime,hasUmpBonus,isBizActivity,umpBonus,rootCategoryName,couponOriLink,userTypeName,createtime,tkMktStatus,updatetime,state,totalSales) |
| | | (id,rootCatId,eventCreatorId,leafCatId,debugInfo,rootCatScore,sellerId,userType,shopTitle,pictUrl,pictUrlWhite,title,auctionId,couponLink,couponLinkTaoToken,couponActivityId,biz30day,tkRate,nick,includeDxjh,reservePrice,tkCommFee,totalFee,totalNum,zkPrice,dayLeft,tk3rdRate,auctionUrl,rlRate,hasRecommended,hasSame,sameItemPid,couponTotalCount,couponLeftCount,couponAmount,eventRate,couponShortLink,couponInfo,couponStartFee,couponEffectiveStartTime,couponEffectiveEndTime,hasUmpBonus,isBizActivity,umpBonus,rootCategoryName,couponOriLink,userTypeName,createtime,tkMktStatus,updatetime,state,totalSales,material_lib_type) |
| | | values |
| | | (#{id,jdbcType=BIGINT},#{rootCatId,jdbcType=INTEGER},#{eventCreatorId,jdbcType=INTEGER},#{leafCatId,jdbcType=INTEGER},#{debugInfo,jdbcType=VARCHAR},#{rootCatScore,jdbcType=INTEGER},#{sellerId,jdbcType=BIGINT},#{userType,jdbcType=INTEGER},#{shopTitle,jdbcType=VARCHAR},#{pictUrl,jdbcType=VARCHAR},#{pictUrlWhite,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{auctionId,jdbcType=BIGINT},#{couponLink,jdbcType=VARCHAR},#{couponLinkTaoToken,jdbcType=VARCHAR},#{couponActivityId,jdbcType=VARCHAR},#{biz30day,jdbcType=INTEGER},#{tkRate,jdbcType=DECIMAL},#{nick,jdbcType=VARCHAR},#{includeDxjh,jdbcType=INTEGER},#{reservePrice,jdbcType=DECIMAL},#{tkCommFee,jdbcType=DECIMAL},#{totalFee,jdbcType=DECIMAL},#{totalNum,jdbcType=INTEGER},#{zkPrice,jdbcType=DECIMAL},#{dayLeft,jdbcType=INTEGER},#{tk3rdRate,jdbcType=VARCHAR},#{auctionUrl,jdbcType=VARCHAR},#{rlRate,jdbcType=DECIMAL},#{hasRecommended,jdbcType=INTEGER},#{hasSame,jdbcType=INTEGER},#{sameItemPid,jdbcType=BIGINT},#{couponTotalCount,jdbcType=INTEGER},#{couponLeftCount,jdbcType=INTEGER},#{couponAmount,jdbcType=DECIMAL},#{eventRate,jdbcType=VARCHAR},#{couponShortLink,jdbcType=VARCHAR},#{couponInfo,jdbcType=VARCHAR},#{couponStartFee,jdbcType=DECIMAL},#{couponEffectiveStartTime,jdbcType=VARCHAR},#{couponEffectiveEndTime,jdbcType=VARCHAR},#{hasUmpBonus,jdbcType=VARCHAR},#{isBizActivity,jdbcType=VARCHAR},#{umpBonus,jdbcType=VARCHAR},#{rootCategoryName,jdbcType=VARCHAR},#{couponOriLink,jdbcType=VARCHAR},#{userTypeName,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{tkMktStatus,jdbcType=VARCHAR},#{updatetime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{totalSales,jdbcType=INTEGER}) |
| | | (#{id,jdbcType=BIGINT},#{rootCatId,jdbcType=INTEGER},#{eventCreatorId,jdbcType=INTEGER},#{leafCatId,jdbcType=INTEGER},#{debugInfo,jdbcType=VARCHAR},#{rootCatScore,jdbcType=INTEGER},#{sellerId,jdbcType=BIGINT},#{userType,jdbcType=INTEGER},#{shopTitle,jdbcType=VARCHAR},#{pictUrl,jdbcType=VARCHAR},#{pictUrlWhite,jdbcType=VARCHAR},#{title,jdbcType=VARCHAR},#{auctionId,jdbcType=BIGINT},#{couponLink,jdbcType=VARCHAR},#{couponLinkTaoToken,jdbcType=VARCHAR},#{couponActivityId,jdbcType=VARCHAR},#{biz30day,jdbcType=INTEGER},#{tkRate,jdbcType=DECIMAL},#{nick,jdbcType=VARCHAR},#{includeDxjh,jdbcType=INTEGER},#{reservePrice,jdbcType=DECIMAL},#{tkCommFee,jdbcType=DECIMAL},#{totalFee,jdbcType=DECIMAL},#{totalNum,jdbcType=INTEGER},#{zkPrice,jdbcType=DECIMAL},#{dayLeft,jdbcType=INTEGER},#{tk3rdRate,jdbcType=VARCHAR},#{auctionUrl,jdbcType=VARCHAR},#{rlRate,jdbcType=DECIMAL},#{hasRecommended,jdbcType=INTEGER},#{hasSame,jdbcType=INTEGER},#{sameItemPid,jdbcType=BIGINT},#{couponTotalCount,jdbcType=INTEGER},#{couponLeftCount,jdbcType=INTEGER},#{couponAmount,jdbcType=DECIMAL},#{eventRate,jdbcType=VARCHAR},#{couponShortLink,jdbcType=VARCHAR},#{couponInfo,jdbcType=VARCHAR},#{couponStartFee,jdbcType=DECIMAL},#{couponEffectiveStartTime,jdbcType=VARCHAR},#{couponEffectiveEndTime,jdbcType=VARCHAR},#{hasUmpBonus,jdbcType=VARCHAR},#{isBizActivity,jdbcType=VARCHAR},#{umpBonus,jdbcType=VARCHAR},#{rootCategoryName,jdbcType=VARCHAR},#{couponOriLink,jdbcType=VARCHAR},#{userTypeName,jdbcType=VARCHAR},#{createtime,jdbcType=TIMESTAMP},#{tkMktStatus,jdbcType=VARCHAR},#{updatetime,jdbcType=TIMESTAMP},#{state,jdbcType=INTEGER},#{totalSales,jdbcType=INTEGER},#{materialLibType,jdbcType=INTEGER}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | |
| | | <if test="updatetime != null">updatetime,</if> |
| | | <if test="state != null">state,</if> |
| | | <if test="totalSales != null">totalSales,</if> |
| | | <if test="materialLibType != null">material_lib_type,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | |
| | | <if test="updatetime != null">#{updatetime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state != null">#{state,jdbcType=INTEGER}</if> |
| | | <if test="totalSales != null">#{totalSales,jdbcType=INTEGER}</if> |
| | | <if test="materialLibType != null">#{materialLibType,jdbcType=INTEGER}</if> |
| | | |
| | | |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief">update |
| | | yeshi_ec_taobao_goods set |
| | | rootCatId = #{rootCatId,jdbcType=INTEGER}, |
| | | eventCreatorId = #{eventCreatorId,jdbcType=INTEGER}, |
| | | leafCatId = #{leafCatId,jdbcType=INTEGER}, |
| | | debugInfo = #{debugInfo,jdbcType=VARCHAR}, |
| | | rootCatScore = #{rootCatScore,jdbcType=INTEGER}, |
| | | sellerId = #{sellerId,jdbcType=BIGINT}, |
| | | yeshi_ec_taobao_goods set |
| | | rootCatId = #{rootCatId,jdbcType=INTEGER}, |
| | | eventCreatorId = |
| | | #{eventCreatorId,jdbcType=INTEGER}, |
| | | leafCatId = |
| | | #{leafCatId,jdbcType=INTEGER}, |
| | | debugInfo = |
| | | #{debugInfo,jdbcType=VARCHAR}, |
| | | rootCatScore = |
| | | #{rootCatScore,jdbcType=INTEGER}, |
| | | sellerId = |
| | | #{sellerId,jdbcType=BIGINT}, |
| | | userType = #{userType,jdbcType=INTEGER}, |
| | | shopTitle = #{shopTitle,jdbcType=VARCHAR}, |
| | | pictUrl = #{pictUrl,jdbcType=VARCHAR}, |
| | | pictUrlWhite = #{pictUrlWhite,jdbcType=VARCHAR}, |
| | | title = #{title,jdbcType=VARCHAR}, |
| | | auctionId = #{auctionId,jdbcType=BIGINT}, |
| | | couponLink = #{couponLink,jdbcType=VARCHAR}, |
| | | couponLinkTaoToken = #{couponLinkTaoToken,jdbcType=VARCHAR}, |
| | | couponActivityId = #{couponActivityId,jdbcType=VARCHAR}, |
| | | biz30day = #{biz30day,jdbcType=INTEGER}, |
| | | pictUrl = |
| | | #{pictUrl,jdbcType=VARCHAR}, |
| | | pictUrlWhite = |
| | | #{pictUrlWhite,jdbcType=VARCHAR}, |
| | | title = #{title,jdbcType=VARCHAR}, |
| | | auctionId = #{auctionId,jdbcType=BIGINT}, |
| | | couponLink = |
| | | #{couponLink,jdbcType=VARCHAR}, |
| | | couponLinkTaoToken = |
| | | #{couponLinkTaoToken,jdbcType=VARCHAR}, |
| | | couponActivityId = |
| | | #{couponActivityId,jdbcType=VARCHAR}, |
| | | biz30day = |
| | | #{biz30day,jdbcType=INTEGER}, |
| | | tkRate = #{tkRate,jdbcType=DECIMAL}, |
| | | nick = #{nick,jdbcType=VARCHAR}, |
| | | includeDxjh = #{includeDxjh,jdbcType=INTEGER}, |
| | | reservePrice = #{reservePrice,jdbcType=DECIMAL}, |
| | | tkCommFee = #{tkCommFee,jdbcType=DECIMAL}, |
| | | nick |
| | | = #{nick,jdbcType=VARCHAR}, |
| | | includeDxjh = |
| | | #{includeDxjh,jdbcType=INTEGER}, |
| | | reservePrice = |
| | | #{reservePrice,jdbcType=DECIMAL}, |
| | | tkCommFee = |
| | | #{tkCommFee,jdbcType=DECIMAL}, |
| | | totalFee = #{totalFee,jdbcType=DECIMAL}, |
| | | totalNum = #{totalNum,jdbcType=INTEGER}, |
| | | zkPrice = #{zkPrice,jdbcType=DECIMAL}, |
| | | zkPrice = |
| | | #{zkPrice,jdbcType=DECIMAL}, |
| | | dayLeft = #{dayLeft,jdbcType=INTEGER}, |
| | | tk3rdRate = #{tk3rdRate,jdbcType=VARCHAR}, |
| | | auctionUrl = #{auctionUrl,jdbcType=VARCHAR}, |
| | | auctionUrl = |
| | | #{auctionUrl,jdbcType=VARCHAR}, |
| | | rlRate = #{rlRate,jdbcType=DECIMAL}, |
| | | hasRecommended = #{hasRecommended,jdbcType=INTEGER}, |
| | | hasSame = #{hasSame,jdbcType=INTEGER}, |
| | | sameItemPid = #{sameItemPid,jdbcType=BIGINT}, |
| | | couponTotalCount = #{couponTotalCount,jdbcType=INTEGER}, |
| | | couponLeftCount = #{couponLeftCount,jdbcType=INTEGER}, |
| | | couponAmount = #{couponAmount,jdbcType=DECIMAL}, |
| | | eventRate = #{eventRate,jdbcType=VARCHAR}, |
| | | couponShortLink = #{couponShortLink,jdbcType=VARCHAR}, |
| | | couponInfo = #{couponInfo,jdbcType=VARCHAR}, |
| | | couponStartFee = #{couponStartFee,jdbcType=DECIMAL}, |
| | | couponEffectiveStartTime = #{couponEffectiveStartTime,jdbcType=VARCHAR}, |
| | | couponEffectiveEndTime = #{couponEffectiveEndTime,jdbcType=VARCHAR}, |
| | | hasUmpBonus = #{hasUmpBonus,jdbcType=VARCHAR}, |
| | | isBizActivity = #{isBizActivity,jdbcType=VARCHAR}, |
| | | umpBonus = #{umpBonus,jdbcType=VARCHAR}, |
| | | rootCategoryName = #{rootCategoryName,jdbcType=VARCHAR}, |
| | | ]couponOriLink = #{couponOriLink,jdbcType=VARCHAR}, |
| | | userTypeName = #{userTypeName,jdbcType=VARCHAR}, |
| | | createtime = #{createtime,jdbcType=TIMESTAMP}, |
| | | tkMktStatus = #{tkMktStatus,jdbcType=VARCHAR} , |
| | | updatetime = #{updatetime,jdbcType=TIMESTAMP}, |
| | | hasSame = |
| | | #{hasSame,jdbcType=INTEGER}, |
| | | sameItemPid = |
| | | #{sameItemPid,jdbcType=BIGINT}, |
| | | couponTotalCount = |
| | | #{couponTotalCount,jdbcType=INTEGER}, |
| | | couponLeftCount = |
| | | #{couponLeftCount,jdbcType=INTEGER}, |
| | | couponAmount = |
| | | #{couponAmount,jdbcType=DECIMAL}, |
| | | eventRate = |
| | | #{eventRate,jdbcType=VARCHAR}, |
| | | couponShortLink = |
| | | #{couponShortLink,jdbcType=VARCHAR}, |
| | | couponInfo = |
| | | #{couponInfo,jdbcType=VARCHAR}, |
| | | couponStartFee = |
| | | #{couponStartFee,jdbcType=DECIMAL}, |
| | | couponEffectiveStartTime = |
| | | #{couponEffectiveStartTime,jdbcType=VARCHAR}, |
| | | couponEffectiveEndTime = |
| | | #{couponEffectiveEndTime,jdbcType=VARCHAR}, |
| | | hasUmpBonus = |
| | | #{hasUmpBonus,jdbcType=VARCHAR}, |
| | | isBizActivity = |
| | | #{isBizActivity,jdbcType=VARCHAR}, |
| | | umpBonus = |
| | | #{umpBonus,jdbcType=VARCHAR}, |
| | | rootCategoryName = |
| | | #{rootCategoryName,jdbcType=VARCHAR}, |
| | | ]couponOriLink = |
| | | #{couponOriLink,jdbcType=VARCHAR}, |
| | | userTypeName = |
| | | #{userTypeName,jdbcType=VARCHAR}, |
| | | createtime = |
| | | #{createtime,jdbcType=TIMESTAMP}, |
| | | tkMktStatus = |
| | | #{tkMktStatus,jdbcType=VARCHAR} , |
| | | updatetime = |
| | | #{updatetime,jdbcType=TIMESTAMP}, |
| | | state =#{state,jdbcType=INTEGER}, |
| | | totalSales =#{totalSales,jdbcType=INTEGER} |
| | | where id = #{id,jdbcType=BIGINT} |
| | | totalSales =#{totalSales,jdbcType=INTEGER}, |
| | | material_lib_type =#{materialLibType,jdbcType=INTEGER} |
| | | where id = |
| | | #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief"> |
| | | update yeshi_ec_taobao_goods |
| | |
| | | <if test="updatetime !=null">updatetime =#{updatetime,jdbcType=TIMESTAMP},</if> |
| | | <if test="state !=null">state =#{state,jdbcType=INTEGER},</if> |
| | | <if test="totalSales !=null">totalSales =#{totalSales,jdbcType=INTEGER},</if> |
| | | <if test="materialLibType !=null">material_lib_type =#{materialLibType,jdbcType=INTEGER},</if> |
| | | </set> |
| | | where id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | |
| | | #{item.tkMktStatus,jdbcType=VARCHAR}, |
| | | #{item.updatetime,jdbcType=TIMESTAMP}, |
| | | #{item.state,jdbcType=INTEGER}, |
| | | #{item.totalSales,jdbcType=INTEGER} |
| | | #{item.totalSales,jdbcType=INTEGER}, |
| | | #{item.materialLibType,jdbcType=INTEGER} |
| | | ) |
| | | </foreach> |
| | | </insert> |
| | |
| | | </if> |
| | | </foreach> |
| | | </trim> |
| | | |
| | | |
| | | <trim prefix="totalSales =case" suffix="end,"> |
| | | <foreach collection="list" item="item" index="index"> |
| | | <if test="item.totalSales !=null"> |
| | |
| | | </if> |
| | | </foreach> |
| | | </trim> |
| | | |
| | | |
| | | <trim prefix="material_lib_type =case" suffix="end,"> |
| | | <foreach collection="list" item="item" index="index"> |
| | | <if test="item.materialLibType !=null"> |
| | | when id=#{item.id} then #{item.materialLibType} |
| | | </if> |
| | | </foreach> |
| | | </trim> |
| | | |
| | | <trim prefix="createtime =case" suffix="end,"> |
| | | <foreach collection="list" item="item" index="index"> |
| | |
| | | from yeshi_ec_taobao_order where to_trade_id = #{0} |
| | | </select> |
| | | |
| | | |
| | | <select id="listLongTimeNoUpdateOrders" resultMap="BaseResultMap"> |
| | | SELECT * FROM yeshi_ec_taobao_order t WHERE t.`to_order_state`='订单付款' AND UNIX_TIMESTAMP(t.`to_create_time`) <![CDATA[ < ]]> UNIX_TIMESTAMP()-60*60*24*15 AND (t.`to_latest_updatetime` IS NULL OR UNIX_TIMESTAMP(t.`to_latest_updatetime`)<![CDATA[ < ]]> UNIX_TIMESTAMP()-60*60*24*2) ORDER BY t.`to_create_time` DESC limit #{start},#{count} |
| | | </select> |
| | | |
| | | <select id="listByTradeId" resultMap="BaseResultMap" parameterType="java.lang.String"> |
| | | select * from yeshi_ec_taobao_order where to_trade_id=#{0} |
| | | </select> |
| | | |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_taobao_order where to_id = #{id,jdbcType=BIGINT}</delete> |
| | | <delete id="deleteByOrderId" parameterType="java.lang.String">delete from |
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.taobao.TaoBaoOrderTradeMapMapper"> |
| | | <resultMap id="BaseResultMap" |
| | | type="com.yeshi.fanli.entity.taobao.TaoBaoOrderTradeMap"> |
| | | <id column="totm_id" property="id" jdbcType="BIGINT" /> |
| | | <result column="totm_trade_id" property="tradeId" jdbcType="VARCHAR" /> |
| | | <result column="totm_create_time" property="createTime" |
| | | jdbcType="TIMESTAMP" /> |
| | | <association property="taoBaoOrder" |
| | | javaType="com.yeshi.fanli.entity.taobao.TaoBaoOrder"> |
| | | <id property="id" column="totm_order_id" /> |
| | | </association> |
| | | </resultMap> |
| | | <sql id="Base_Column_List">totm_id,totm_order_id,totm_trade_id,totm_create_time</sql> |
| | | <select id="selectByPrimaryKey" resultMap="BaseResultMap" |
| | | parameterType="java.lang.Long"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_order_trade_map where totm_id = |
| | | #{id,jdbcType=BIGINT} |
| | | </select> |
| | | |
| | | <select id="selectByTradeId" resultMap="BaseResultMap" |
| | | parameterType="java.lang.String"> |
| | | select |
| | | <include refid="Base_Column_List" /> |
| | | from yeshi_ec_taobao_order_trade_map where totm_trade_id = |
| | | #{0} |
| | | </select> |
| | | |
| | | <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from |
| | | yeshi_ec_taobao_order_trade_map where totm_id = #{id,jdbcType=BIGINT} |
| | | </delete> |
| | | <insert id="insert" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrderTradeMap" |
| | | useGeneratedKeys="true" keyProperty="id">insert into |
| | | yeshi_ec_taobao_order_trade_map |
| | | (totm_id,totm_order_id,totm_trade_id,totm_create_time) values |
| | | (#{id,jdbcType=BIGINT},#{taoBaoOrder.id,jdbcType=BIGINT},#{tradeId,jdbcType=VARCHAR},#{createTime,jdbcType=TIMESTAMP}) |
| | | </insert> |
| | | <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrderTradeMap" |
| | | useGeneratedKeys="true" keyProperty="id"> |
| | | insert into yeshi_ec_taobao_order_trade_map |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">totm_id,</if> |
| | | <if test="taoBaoOrder != null">totm_order_id,</if> |
| | | <if test="tradeId != null">totm_trade_id,</if> |
| | | <if test="createTime != null">totm_create_time,</if> |
| | | </trim> |
| | | values |
| | | <trim prefix="(" suffix=")" suffixOverrides=","> |
| | | <if test="id != null">#{id,jdbcType=BIGINT},</if> |
| | | <if test="taoBaoOrder != null">#{taoBaoOrder.id,jdbcType=BIGINT},</if> |
| | | <if test="tradeId != null">#{tradeId,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </trim> |
| | | </insert> |
| | | <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrderTradeMap">update |
| | | yeshi_ec_taobao_order_trade_map set totm_order_id = |
| | | #{taoBaoOrder.id,jdbcType=BIGINT},totm_trade_id = |
| | | #{tradeId,jdbcType=VARCHAR},totm_create_time = |
| | | #{createTime,jdbcType=TIMESTAMP} where totm_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.taobao.TaoBaoOrderTradeMap"> |
| | | update yeshi_ec_taobao_order_trade_map |
| | | <set> |
| | | <if test="taoBaoOrder != null">totm_order_id=#{taoBaoOrder.id,jdbcType=BIGINT},</if> |
| | | <if test="tradeId != null">totm_trade_id=#{tradeId,jdbcType=VARCHAR},</if> |
| | | <if test="createTime != null">totm_create_time=#{createTime,jdbcType=TIMESTAMP},</if> |
| | | </set> |
| | | where totm_id = #{id,jdbcType=BIGINT} |
| | | </update> |
| | | </mapper> |
| | |
| | | import com.yeshi.fanli.util.ImageUtil;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | |
|
| | |
| | | TaoKeAppInfo info = new TaoKeAppInfo();
|
| | |
|
| | | if (!StringUtil.isNullOrEmpty(relationId)) {
|
| | | String pid = Constant.TAOBAO_RELATION_PID_DEFAULT;
|
| | | String pid = TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT;
|
| | | String appId = pid.split("_")[2];
|
| | | String adzoneId = pid.split("_")[3];
|
| | | TaoBaoUnionConfig taoBaoUnionConfig = taoBaoUnionConfigService.getConfigByAppIdCache(appId);
|
| | |
| | | }
|
| | |
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAppKey(Constant.TAOBAO_AUTH_APPKEY);
|
| | | app.setAppSecret(Constant.TAOBAO_AUTH_APPSECRET);
|
| | | app.setPid(Constant.TAOBAO_SPECIAL_PID_DEFAULT);
|
| | | app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
|
| | | app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | app.setPid(TaoBaoConstant.TAOBAO_SPECIAL_PID_DEFAULT);
|
| | | TaoBaoGoodsBrief goods = TaoKeApiUtil.specialConvertCoupon(auctionId, app);
|
| | | if (goods == null) {
|
| | | throw new ShareGoodsException(1, "");
|
| | |
| | | import com.yeshi.fanli.dto.HongBaoDTO;
|
| | | import com.yeshi.fanli.entity.bus.msg.MsgOrderDetail;
|
| | | import com.yeshi.fanli.entity.bus.user.HongBaoV2;
|
| | | import com.yeshi.fanli.entity.bus.user.ThreeSale;
|
| | | import com.yeshi.fanli.entity.bus.user.UserExtraTaoBaoInfo;
|
| | | import com.yeshi.fanli.entity.bus.user.UserInfo;
|
| | | import com.yeshi.fanli.entity.order.CommonOrder;
|
| | |
| | |
|
| | | // 获取子红包
|
| | | List<HongBaoV2> children = hongBaoV2Mapper.listChildrenById(hongBao.getId());
|
| | | if (children != null)
|
| | | if (children != null && children.size() > 0)
|
| | | for (HongBaoV2 child : children) {
|
| | | HongBaoV2 childUpdate = new HongBaoV2(child.getId());
|
| | | childUpdate.setState(hongBao.getState());
|
| | |
| | | }
|
| | |
|
| | | }
|
| | | else {// 修复之前二级,三级订单未统计到的情况
|
| | | if (!mianDan) {
|
| | | ThreeSale threeSale = threeSaleSerivce.selectByWorkerId(commonOrder.getUserInfo().getId());
|
| | | if (threeSale != null && threeSale.getSucceedTime() != null
|
| | | && threeSale.getSucceedTime() <= commonOrder.getThirdCreateTime().getTime()) {
|
| | | UserInfo boss = threeSaleSerivce.getBoss(commonOrder.getUserInfo().getId());
|
| | | // 插入一级子红包
|
| | | BigDecimal firstRate = hongBaoManageService
|
| | | .getFirstInviteRate(boss.getRank() == null ? 0 : boss.getRank());
|
| | | if (firstRate.compareTo(new BigDecimal(0)) <= 0)
|
| | | return;
|
| | | HongBaoV2 firstHongbao = new HongBaoV2();
|
| | | firstHongbao.setUserInfo(boss);
|
| | | firstHongbao.setUrank(boss.getRank());
|
| | | firstHongbao.setParent(hongBao);
|
| | | firstHongbao.setCreateTime(new Date());
|
| | | firstHongbao.setType(HongBaoV2.TYPE_YIJI);
|
| | | firstHongbao.setVersion(2);
|
| | | firstHongbao.setState(hongBao.getState());
|
| | |
|
| | | if (hongBao.getState() == HongBaoV2.STATE_KELINGQU) {
|
| | | firstHongbao.setMoney(
|
| | | MoneyBigDecimalUtil.mul(hongBao.getMoney(), firstRate.divide(new BigDecimal(100))));
|
| | | Calendar calendar = Calendar.getInstance();
|
| | | calendar.setTime(commonOrder.getSettleTime());
|
| | | calendar.add(Calendar.MONTH, 1);
|
| | | firstHongbao.setPreGetTime(new Date(TimeUtil.convertToTimeTemp(
|
| | | calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1) + "-25",
|
| | | "yyyy-M-dd")));
|
| | | } else if (hongBao.getState() == HongBaoV2.STATE_BUKELINGQU) {
|
| | | firstHongbao.setMoney(
|
| | | MoneyBigDecimalUtil.mul(hongBao.getMoney(), firstRate.divide(new BigDecimal(100))));
|
| | | }
|
| | | hongBaoV2Mapper.insertSelective(firstHongbao);
|
| | | // 用户通知
|
| | | if (notificationMap.get(HongBaoV2.TYPE_YIJI) == null) {
|
| | | HongBaoV2 tempHongBao = new HongBaoV2(firstHongbao.getId());
|
| | | tempHongBao.setUserInfo(firstHongbao.getUserInfo());
|
| | | tempHongBao.setMoney(firstHongbao.getMoney());
|
| | | CommonOrder tempCommonOrder = new CommonOrder(commonOrder.getId());
|
| | | tempCommonOrder.setPayment(commonOrder.getPayment());
|
| | | notificationMap.put(HongBaoV2.TYPE_YIJI, new HongBaoOrder(tempCommonOrder, tempHongBao));
|
| | | } else {
|
| | | // 增加付款金额与资金
|
| | | HongBaoOrder tempHongBaoOrder = notificationMap.get(HongBaoV2.TYPE_YIJI);
|
| | | tempHongBaoOrder.getCommonOrder().setPayment(
|
| | | tempHongBaoOrder.getCommonOrder().getPayment().add(commonOrder.getPayment()));
|
| | | tempHongBaoOrder.getHongBaoV2()
|
| | | .setMoney(tempHongBaoOrder.getHongBaoV2().getMoney().add(firstHongbao.getMoney()));
|
| | | notificationMap.put(HongBaoV2.TYPE_YIJI, tempHongBaoOrder);
|
| | | }
|
| | |
|
| | | // 插入二级子红包
|
| | | boss = threeSaleSerivce.getBoss(boss.getId());
|
| | | if (boss != null) {// 二级BOSS存在
|
| | | BigDecimal secondRate = hongBaoManageService
|
| | | .getSecondInviteRate(boss.getRank() == null ? 0 : boss.getRank());
|
| | | if (secondRate.compareTo(new BigDecimal(0)) <= 0)
|
| | | return;
|
| | | HongBaoV2 secondHongbao = new HongBaoV2();
|
| | | secondHongbao.setUserInfo(boss);
|
| | | secondHongbao.setUrank(boss.getRank());
|
| | | secondHongbao.setParent(hongBao);
|
| | | secondHongbao.setCreateTime(new Date());
|
| | | secondHongbao.setType(HongBaoV2.TYPE_ERJI);
|
| | | secondHongbao.setVersion(2);
|
| | | secondHongbao.setState(hongBao.getState());
|
| | | if (hongBao.getState() == HongBaoV2.STATE_KELINGQU) {
|
| | | secondHongbao.setMoney(MoneyBigDecimalUtil.mul(hongBao.getMoney(),
|
| | | secondRate.divide(new BigDecimal(100))));
|
| | | Calendar calendar = Calendar.getInstance();
|
| | | calendar.setTime(commonOrder.getSettleTime());
|
| | | calendar.add(Calendar.MONTH, 1);
|
| | | secondHongbao.setPreGetTime(new Date(TimeUtil.convertToTimeTemp(
|
| | | calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH) + 1) + "-25",
|
| | | "yyyy-M-dd")));
|
| | | } else if (hongBao.getState() == HongBaoV2.STATE_BUKELINGQU) {
|
| | | secondHongbao.setMoney(MoneyBigDecimalUtil.mul(hongBao.getMoney(),
|
| | | secondRate.divide(new BigDecimal(100))));
|
| | | }
|
| | | hongBaoV2Mapper.insertSelective(secondHongbao);
|
| | |
|
| | | // 用户通知
|
| | | if (notificationMap.get(HongBaoV2.TYPE_ERJI) == null) {
|
| | | HongBaoV2 tempHongBao = new HongBaoV2(secondHongbao.getId());
|
| | | tempHongBao.setUserInfo(secondHongbao.getUserInfo());
|
| | | tempHongBao.setMoney(secondHongbao.getMoney());
|
| | | CommonOrder tempCommonOrder = new CommonOrder(commonOrder.getId());
|
| | | tempCommonOrder.setPayment(commonOrder.getPayment());
|
| | | notificationMap.put(HongBaoV2.TYPE_ERJI,
|
| | | new HongBaoOrder(tempCommonOrder, tempHongBao));
|
| | | } else {
|
| | | // 增加付款金额与资金
|
| | | HongBaoOrder tempHongBaoOrder = notificationMap.get(HongBaoV2.TYPE_ERJI);
|
| | | tempHongBaoOrder.getCommonOrder().setPayment(
|
| | | tempHongBaoOrder.getCommonOrder().getPayment().add(commonOrder.getPayment()));
|
| | | tempHongBaoOrder.getHongBaoV2().setMoney(
|
| | | tempHongBaoOrder.getHongBaoV2().getMoney().add(secondHongbao.getMoney()));
|
| | | notificationMap.put(HongBaoV2.TYPE_ERJI, tempHongBaoOrder);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } else if (type == HongBaoV2.TYPE_SHARE_GOODS) {
|
| | | BigDecimal fanliRate = hongBaoManageService.getShareRate(commonOrder.getCreateTime().getTime());
|
| | | List<ShareGoodsActivityOrder> list = shareGoodsActivityOrderService
|
| | |
| | | return threeSaleMapper.countFirstTeam(uid, 1);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public ThreeSale selectByWorkerId(Long workerId) {
|
| | | return threeSaleMapper.selectSuccessByWorkerId(workerId);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | public void updateMsgOrderDetail(MsgOrderDetail detail) throws MsgOrderDetailException {
|
| | | public void updateMsgOrderDetail(MsgOrderDetail detail, boolean needNotify) throws MsgOrderDetailException {
|
| | | if (detail == null)
|
| | | throw new MsgOrderDetailException(1, "消息为空");
|
| | | if (detail.getOrderId() == null || detail.getState() == null || detail.getUser() == null)
|
| | |
| | | if (detail.getState().intValue() != msg.getState()) {
|
| | | update.setState(detail.getState());
|
| | | update.setUpdateTime(new Date());
|
| | | userMsgReadStateService.addOrderMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | if (needNotify)
|
| | | userMsgReadStateService.addOrderMsgUnReadCount(detail.getUser().getId(), 1);
|
| | | }
|
| | | msgOrderDetailMapper.updateByPrimaryKeySelective(update);
|
| | | }
|
| | |
| | | int orderState) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createFanLiOrder(uid, orderId, 0, orderState, payMoney, money,
|
| | | null);
|
| | | //暂时不推送
|
| | | // try {
|
| | | // msgOrderDetailService.updateMsgOrderDetail(detail);
|
| | | // } catch (MsgOrderDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | // 暂时不推送
|
| | | try {
|
| | | msgOrderDetailService.updateMsgOrderDetail(detail, false);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | int orderState) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createShareOrder(uid, orderId, 0, orderState, payMoney, money,
|
| | | null);
|
| | | //暂时不推送
|
| | | // try {
|
| | | // msgOrderDetailService.updateMsgOrderDetail(detail);
|
| | | // } catch (MsgOrderDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | // 暂时不推送
|
| | | try {
|
| | | msgOrderDetailService.updateMsgOrderDetail(detail, false);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | int orderState) {
|
| | | MsgOrderDetail detail = MsgOrderDetailFactory.createInviteOrder(uid, orderId, 0, orderState, payMoney, money,
|
| | | null);
|
| | | //暂时不推送
|
| | | // try {
|
| | | // msgOrderDetailService.updateMsgOrderDetail(detail);
|
| | | // } catch (MsgOrderDetailException e) {
|
| | | // e.printStackTrace();
|
| | | // }
|
| | | // 暂时不推送
|
| | | try {
|
| | | msgOrderDetailService.updateMsgOrderDetail(detail, false);
|
| | | } catch (MsgOrderDetailException e) {
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.util.CMQManager;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | | import com.yeshi.fanli.util.factory.UserMoneyDetailFactory;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeOrderApiUtil;
|
| | |
|
| | | @Service
|
| | | public class OrderProcessServiceImpl implements OrderProcessService {
|
| | |
| | | Map<String, List<TaoBaoOrder>> shareOrderMap = new HashMap<>();
|
| | | while (its.hasNext()) {
|
| | | String orderId = its.next();
|
| | |
|
| | | if (orders.get(orderId) != null && orders.get(orderId).size() > 0) {
|
| | | List<TaoBaoOrder> list = orders.get(orderId);
|
| | |
|
| | | LogHelper.test(String.format("订单处理:订单号-%s 订单数量-%s", orderId, list.size() + ""));
|
| | | if (!StringUtil.isNullOrEmpty(list.get(0).getRelationId())) {
|
| | | shareOrderMap.put(orderId, list);
|
| | | } else if (!StringUtil.isNullOrEmpty(list.get(0).getSpecialId())) {
|
| | |
| | | UserMoneyDetail userMoneyDetail = null;
|
| | | // 插入新版资金明细
|
| | | try {
|
| | | // 此处不用订单号做唯一性索引
|
| | | userMoneyDetail = UserMoneyDetailFactory.createFanLi(uid, hongBaoOrder.getCommonOrder().getOrderNo(),
|
| | | hongBaoOrder.getCommonOrder().getSourceType(), null, money);
|
| | |
|
| | | } catch (UserMoneyDetailException e1) {
|
| | | try {
|
| | | LogHelper.errorDetailInfo(e1, "订单号:" + hongBaoOrder.getCommonOrder().getOrderNo(), "");
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | userMoneyDetailMapper.insert(userMoneyDetail);
|
| | | userMoneyDetailMapper.insertSelective(userMoneyDetail);
|
| | | // 添加资金明细与红包的映射关系
|
| | | for (HongBaoV2 v2 : userHongBao.get(uid)) {
|
| | | accountDetailsHongBaoMapService.saveAccountDetailsHongBaoMap(v2.getId(), userMoneyDetail.getId());
|
| | |
| | | // 维权扣款(2018-08-05后开始实行)
|
| | | if (hongBaoOrder.getCommonOrder().getSettleTime() != null && hongBaoOrder.getCommonOrder().getSettleTime()
|
| | | .getTime() >= TimeUtil.convertToTimeTemp("2018-08-05", "yyyy-MM-dd")) {
|
| | | taoBaoWeiQuanDrawBackService.doWeiQuanFanli(hongBaoOrder.getCommonOrder().getOrderNo());
|
| | | try {
|
| | |
|
| | | taoBaoWeiQuanDrawBackService.doWeiQuanFanli(hongBaoOrder.getCommonOrder().getOrderNo());
|
| | |
|
| | | } catch (TaoBaoWeiQuanException e) {
|
| | | if (e.getCode() == TaoBaoWeiQuanException.CODE_NEDD_UPDATE_ORDER) {
|
| | | List<TaoBaoOrder> olist = taoBaoOrderService
|
| | | .getTaoBaoOrderByOrderId(hongBaoOrder.getCommonOrder().getOrderNo());
|
| | |
|
| | | if (olist != null && olist.size() > 0) {
|
| | | long time = TimeUtil.convertToTimeTemp(olist.get(0).getCreateTime(), "yyyy-MM-dd HH:mm:ss");
|
| | | olist = TaoKeOrderApiUtil.getTaoBaoAllOrder(TimeUtil.getGernalTime(time, "yyyy-MM-dd HH:mm:ss"),
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | List<TaoBaoOrder> thirdOList = TaoKeOrderApiUtil.getTaoBaoThirdAllOrder(
|
| | | TimeUtil.getGernalTime(time, "yyyy-MM-dd HH:mm:ss"), 30, 1,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | if (thirdOList != null && thirdOList.size() > 0)
|
| | | olist.addAll(thirdOList);
|
| | |
|
| | | if (olist != null && olist.size() > 0) {
|
| | | for (int i = 0; i < olist.size(); i++) {
|
| | | if (!olist.get(i).getOrderId()
|
| | | .equalsIgnoreCase(hongBaoOrder.getCommonOrder().getOrderNo())) {// 删除无关订单
|
| | | olist.remove(i);
|
| | | i--;
|
| | | }
|
| | | }
|
| | |
|
| | | taoBaoOrderService.addTaoBaoOrderList(olist);
|
| | | }
|
| | | }
|
| | | } else
|
| | | throw new TaoBaoWeiQuanException(e.getCode(), e.getMsg());
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | updateGoods.setRootCategoryName(goods.getRootCategoryName());
|
| | | updateGoods.setLeafCatId(goods.getLeafCatId());
|
| | | updateGoods.setLeafName(goods.getLeafName());
|
| | | updateGoods.setMaterialLibType(goods.getMaterialLibType());
|
| | |
|
| | | return updateGoods;
|
| | | }
|
| | |
| | | import org.springframework.transaction.annotation.Transactional;
|
| | |
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderMapper;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoOrderTradeMapMapper;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrderTradeMap;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | |
| | |
|
| | | @Resource
|
| | | private RedisManager redisManager;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoOrderTradeMapMapper taoBaoOrderTradeMapMapper;
|
| | |
|
| | | @Override
|
| | | public void addTaoBaoOrderList(List<TaoBaoOrder> list) {
|
| | |
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | | |
| | |
|
| | | addTaoBaoOrder(orderId, map.get(orderId));
|
| | | try {
|
| | | // 6小时内不再处理
|
| | |
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | @Transactional
|
| | | private void addTaoBaoOrderTradeMap(TaoBaoOrder order) {
|
| | | if (order == null || StringUtil.isNullOrEmpty(order.getTradeId()))
|
| | | return;
|
| | | TaoBaoOrderTradeMap map = new TaoBaoOrderTradeMap();
|
| | | map.setCreateTime(new Date());
|
| | | map.setTaoBaoOrder(order);
|
| | | map.setTradeId(order.getTradeId());
|
| | | TaoBaoOrderTradeMap oldMap = taoBaoOrderTradeMapMapper.selectByTradeId(order.getTradeId());
|
| | | if (oldMap == null)
|
| | | taoBaoOrderTradeMapMapper.insertSelective(map);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | |
| | | for (TaoBaoOrder taoBaoOrder : list) {
|
| | | taoBaoOrder.setLatestUpdateTime(new Date());
|
| | | taoBaoOrderMapper.insertSelective(taoBaoOrder);
|
| | | addTaoBaoOrderTradeMap(taoBaoOrder);
|
| | | }
|
| | | } else {
|
| | | if (StringUtil.isNullOrEmpty(oldOrderList.get(0).getTradeId())) {
|
| | |
| | | for (TaoBaoOrder taoBaoOrder : list) {
|
| | | taoBaoOrder.setLatestUpdateTime(new Date());
|
| | | taoBaoOrderMapper.insertSelective(taoBaoOrder);
|
| | | addTaoBaoOrderTradeMap(taoBaoOrder);
|
| | | }
|
| | | } else {
|
| | | // 按tradeId更新
|
| | |
| | | if (order == null) {
|
| | | taoBaoOrder.setLatestUpdateTime(new Date());
|
| | | taoBaoOrderMapper.insertSelective(taoBaoOrder);
|
| | | addTaoBaoOrderTradeMap(taoBaoOrder);
|
| | | } else {
|
| | | taoBaoOrder.setId(order.getId());
|
| | | taoBaoOrder.setRelationId(order.getRelationId());
|
| | | taoBaoOrder.setSpecialId(order.getSpecialId());
|
| | | if (!StringUtil.isNullOrEmpty(order.getRelationId()))
|
| | | taoBaoOrder.setRelationId(order.getRelationId());
|
| | | if (!StringUtil.isNullOrEmpty(order.getSpecialId()))
|
| | | taoBaoOrder.setSpecialId(order.getSpecialId());
|
| | | taoBaoOrder.setLatestUpdateTime(new Date());
|
| | | taoBaoOrderMapper.updateByPrimaryKeySelective(taoBaoOrder);
|
| | | addTaoBaoOrderTradeMap(taoBaoOrder);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | @Resource
|
| | | private UserMoneyDetailMapper userMoneyDetailMapper;
|
| | |
|
| | |
|
| | | @Resource
|
| | | private UserNotificationService userNotificationService;
|
| | |
|
| | |
| | | for (TaoBaoOrder order : orderList)
|
| | | if (order.getOrderState().equalsIgnoreCase("订单结算"))
|
| | | sumFee = sumFee.add(order.geteIncome());
|
| | | if (new BigDecimal(0).compareTo(sumFee) == 0)
|
| | | throw new TaoBaoWeiQuanException(TaoBaoWeiQuanException.CODE_NEDD_UPDATE_ORDER, "需要更新订单");
|
| | |
|
| | | // 获取和该订单号有关联的用户
|
| | | // 获取主红包(同一个订单号的单只会对应同一个用户)
|
| | | List<CommonOrderVO> typeList = new ArrayList<>();
|
| | |
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.service.inter.user.TBPidService;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | |
|
| | | import net.sf.json.JSONObject;
|
| | |
|
| | |
| | |
|
| | | @Override
|
| | | public ClientTBPid getSharePid() {
|
| | | String pid = Constant.TAOBAO_RELATION_PID_DEFAULT;
|
| | | ClientTBPid clientTBPid = new ClientTBPid(Constant.TAOBAO_AUTH_APPKEY, pid, pid.split("_")[2],
|
| | | String pid = TaoBaoConstant.TAOBAO_RELATION_PID_DEFAULT;
|
| | | ClientTBPid clientTBPid = new ClientTBPid(TaoBaoConstant.TAOBAO_AUTH_APPKEY, pid, pid.split("_")[2],
|
| | | pid.split("_")[3]);
|
| | | return clientTBPid;
|
| | | }
|
| | |
| | |
|
| | | /**
|
| | | * 邀请关系生效
|
| | | * |
| | | * @param worker
|
| | | */
|
| | | void effective(UserInfo worker);
|
| | |
| | | * @return
|
| | | */
|
| | | public List<ThreeSale> listByWorkerId(Long workerId);
|
| | | |
| | | |
| | |
|
| | | /**
|
| | | * 获取成功邀请关系数量
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | |
| | |
|
| | | /**
|
| | | * 邀请码生成上下级关系
|
| | | * |
| | | * @param invitee
|
| | | * @param inviter
|
| | | * @throws ThreeSaleException
|
| | |
| | |
|
| | | /**
|
| | | * 统计邀请成功队员数量
|
| | | * |
| | | * @param uid
|
| | | * @return
|
| | | */
|
| | |
| | | * @throws ThreeSaleException
|
| | | */
|
| | | public void bindRelationshipByWX(UserInfo invitee, Long inviterId, ThreeSale threeSaleOld) throws ThreeSaleException;
|
| | | |
| | | /**
|
| | | * 根据下级查找对象
|
| | | * @param workerId
|
| | | * @return
|
| | | */
|
| | | public ThreeSale selectByWorkerId(Long workerId);
|
| | |
|
| | | }
|
| | |
| | | * 根据订单号用户ID更新数据
|
| | | *
|
| | | * @param detail
|
| | | * @param needNotify-是否需要通知
|
| | | * @throws MsgOrderDetailException
|
| | | */
|
| | | public void updateMsgOrderDetail(MsgOrderDetail detail) throws MsgOrderDetailException;
|
| | | public void updateMsgOrderDetail(MsgOrderDetail detail,boolean needNotify) throws MsgOrderDetailException;
|
| | |
|
| | | /**
|
| | | * 订单消息列表
|
| | |
| | | // 外网环境
|
| | | public static boolean IS_OUTNET = true;
|
| | |
|
| | | public static boolean IS_TEST = true;
|
| | | public static boolean IS_TEST = false;
|
| | |
|
| | | public static int PAGE_SIZE = 20;
|
| | | public static int[] TASK_TYPE = { 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008// 微信任务类型编号
|
| | |
| | | import com.yeshi.fanli.service.inter.lable.QualityFactoryService;
|
| | | import com.yeshi.fanli.service.inter.order.OrderProcessService;
|
| | | import com.yeshi.fanli.service.inter.push.IOSPushService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoOrderService;
|
| | | import com.yeshi.fanli.service.inter.user.ExtractService;
|
| | | import com.yeshi.fanli.service.inter.user.UserInfoService;
|
| | | import com.yeshi.fanli.service.inter.user.UserSystemCouponService;
|
| | |
| | | @Resource
|
| | | private ThreeSaleSerivce threeSaleSerivce;
|
| | |
|
| | | @Resource
|
| | | private TaoBaoOrderService taoBaoOrderService;
|
| | |
|
| | | private static boolean isInited = false;
|
| | |
|
| | | public void onApplicationEvent(ContextRefreshedEvent arg0) {
|
| | |
| | | doWeiQuanOrder();// 处理维权订单
|
| | | doPushIOS();// 处理发送IOS消息
|
| | | doThreeSaleUserCouponJob();// 处理邀请队列
|
| | | doUpdateGoodsJob();
|
| | | } else if (!Constant.IS_TEST) {
|
| | | initScheduler();// 启动定时任务
|
| | | // doUpdateGoodsJob();
|
| | | //
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | */
|
| | | public void doTaoBaoOrders() {
|
| | | // 同时开启3个线程处理
|
| | | for (int i = 0; i < 3; i++) {
|
| | | for (int i = 0; i < 1; i++) {
|
| | | executor.execute(new Runnable() {
|
| | | @Override
|
| | | public void run() {
|
| | |
| | | // 取16个订单
|
| | | Map<String, List<TaoBaoOrder>> map = CMQManager.getInstance().consumeTaoBaoOrderMsg(16);
|
| | | if (map != null) {
|
| | | // 从库里面查询
|
| | | Iterator<String> its = map.keySet().iterator();
|
| | | while (its.hasNext()) {
|
| | | String orderId = its.next();
|
| | | List<TaoBaoOrder> orderList = taoBaoOrderService.getTaoBaoOrderByOrderId(orderId);
|
| | | map.put(orderId, orderList);
|
| | | }
|
| | | orderProcessService.processOrder(map);
|
| | | }
|
| | | } catch (Exception e) {
|
New file |
| | |
| | | package com.yeshi.fanli.util;
|
| | |
|
| | | public class TaoBaoConstant {
|
| | | // 淘宝第三方授权
|
| | | public static final String TAOBAO_AUTH_APPKEY = "24980167";
|
| | | public static final String TAOBAO_AUTH_APPSECRET = "e0a2e05deabf5ce039b52e5b492d5382";
|
| | | public static final String TAOBAO_RELATION_PID_DEFAULT = "mm_124933865_56750082_87140050199";
|
| | | public static final String TAOBAO_SPECIAL_PID_DEFAULT = "mm_124933865_56750082_89555600043";
|
| | |
|
| | | // 淘宝常用查询的媒体信息
|
| | | public static final String TAOBAO_COMMON_APPKEY = "24838852";
|
| | | public static final String TAOBAO_COMMON_APPSECRET = "bc8265e2bf8d8115329d652f9d3d4cd8";
|
| | | public static final String TAOBAO_COMMON_PID = "mm_124933865_43788020_437192946";
|
| | |
|
| | | }
|
| | |
| | | cg.setVideoCover(null);
|
| | | cg.setVideoUrl(null);
|
| | | cg.setState(goods.getState());
|
| | | cg.setMaterialLibType(goods.getMaterialLibType());
|
| | | return cg;
|
| | | }
|
| | |
|
| | |
| | | * @param hongBaoList
|
| | | * @return
|
| | | */
|
| | | public static UserMoneyDetail createFanLi(Long uid, String orderId, int orderType, Long hbId, BigDecimal money)
|
| | | public static UserMoneyDetail createFanLi(Long uid, String orderId, int orderType, String hbIds, BigDecimal money)
|
| | | throws UserMoneyDetailException {
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(orderId))
|
| | |
| | | UserMoneyDetail detail = new UserMoneyDetail();
|
| | | detail.setCreateTime(new Date());
|
| | | detail.setIdentifyCode(StringUtil
|
| | | .Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId + "-" + hbId));
|
| | | .Md5(UserMoneyDetailTypeEnum.fanli.name() + "-" + uid + "-" + orderType + "-" + orderId + "-" + hbIds));
|
| | | detail.setMoney(money);
|
| | | detail.setTitle(UserMoneyDetailTypeEnum.fanli.getDesc());
|
| | | detail.setType(UserMoneyDetailTypeEnum.fanli);
|
| | |
| | | commonOrder.setThirdCreateTime(
|
| | | new Date(TimeUtil.convertToTimeTemp(taoBaoOrder.getCreateTime(), "yyyy-MM-dd HH:mm:ss")));
|
| | | commonOrder.setUpdateTime(new Date());
|
| | | commonOrder.setTradeId(taoBaoOrder.getTradeId());
|
| | |
|
| | | return commonOrder;
|
| | |
|
| | |
| | | * 用户再次分成比例(0-100)
|
| | | * @return
|
| | | */
|
| | | public static String getGoodsHongBaoInfo(TaoBaoGoodsBrief goodsBrief, BigDecimal rate) {
|
| | | return "¥" + getGoodsHongBaoMoney(goodsBrief, rate).toString();
|
| | | public static String getGoodsHongBaoInfo(TaoBaoGoodsBrief goodsBrief, BigDecimal rate) { |
| | | if (goodsBrief != null && goodsBrief.getMaterialLibType() != null && goodsBrief.getMaterialLibType() == 0)
|
| | | return "¥0.00";
|
| | | else |
| | | return "¥" + getGoodsHongBaoMoney(goodsBrief, rate).toString(); |
| | | }
|
| | |
|
| | | /**
|
| | |
| | | public static BigDecimal getGoodsHongBaoMoney(TaoBaoGoodsBrief goodsBrief, BigDecimal rate) {
|
| | | if (StringUtil.isNullOrEmpty(goodsBrief.getCouponInfo())
|
| | | || goodsBrief.getCouponInfo().trim().equalsIgnoreCase("无")) {
|
| | | return goodsBrief.getZkPrice().multiply(goodsBrief.getTkRate()).divide(new BigDecimal(10000)).multiply(rate)
|
| | | .setScale(2, BigDecimal.ROUND_DOWN);
|
| | | return MoneyBigDecimalUtil.mul(
|
| | | MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(goodsBrief.getZkPrice(), goodsBrief.getTkRate()),
|
| | | new BigDecimal("0.01")),
|
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
|
| | | } else// 有券
|
| | | {
|
| | | List<BigDecimal> list = TaoBaoCouponUtil.getCouponInfo(goodsBrief.getCouponInfo());
|
| | |
| | | if (startFee.compareTo(goodsBrief.getZkPrice()) <= 0
|
| | | && goodsBrief.getZkPrice().compareTo(couponAccount) > 0) {
|
| | | BigDecimal finalPrice = goodsBrief.getZkPrice().subtract(couponAccount);
|
| | | return finalPrice.multiply(goodsBrief.getTkRate()).divide(new BigDecimal(10000)).multiply(rate)
|
| | | .setScale(2, BigDecimal.ROUND_DOWN);
|
| | | return MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil
|
| | | .mul(MoneyBigDecimalUtil.mul(finalPrice, goodsBrief.getTkRate()), new BigDecimal("0.01")),
|
| | | MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
|
| | |
|
| | | } else {// 不能用券
|
| | | return goodsBrief.getZkPrice().multiply(goodsBrief.getTkRate()).divide(new BigDecimal(10000))
|
| | | .multiply(rate).setScale(2, BigDecimal.ROUND_DOWN);
|
| | | return MoneyBigDecimalUtil.mul(MoneyBigDecimalUtil.mul(
|
| | | MoneyBigDecimalUtil.mul(goodsBrief.getZkPrice(), goodsBrief.getTkRate()),
|
| | | new BigDecimal("0.01")), MoneyBigDecimalUtil.div(rate, new BigDecimal(100)));
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | if (!StringUtil.isNullOrEmpty(item.optString("material_lib_type")))
|
| | | goods.setMaterialLibType(item.optInt("material_lib_type"));
|
| | | else
|
| | | goods.setMaterialLibType(0);
|
| | |
|
| | | return goods;
|
| | | }
|
| | |
| | | goods.setFreeShipment(1);
|
| | |
|
| | | if ("1".equalsIgnoreCase(item.optString("material_lib_type")))
|
| | | ;
|
| | | goods.setMaterialLibType(1);
|
| | | else
|
| | | goods.setMaterialLibType(0);
|
| | |
|
| | | goodsList.add(goods);
|
| | | }
|
| | |
| | | g.setCouponStartFee(new BigDecimal(0));
|
| | | }
|
| | | g.setCreatetime(new Date());
|
| | | g.setMaterialLibType(goods.getMaterialLibType());
|
| | | return g;
|
| | | }
|
| | | }
|
| | |
| | | g.setCouponStartFee(new BigDecimal(0));
|
| | | }
|
| | | g.setCreatetime(new Date());
|
| | | g.setMaterialLibType(goods.getMaterialLibType());
|
| | | return g;
|
| | | }
|
| | | }
|
| | |
| | | }
|
| | | goods.setReservePrice(new BigDecimal(0));
|
| | | goods.setTotalFee(new BigDecimal("0"));
|
| | | goods.setPictUrlWhite(item.optString("white_image"));
|
| | | return goods;
|
| | | }
|
| | |
|
| | |
| | | import com.yeshi.fanli.entity.taobao.TaoKeAppInfo;
|
| | | import com.yeshi.fanli.exception.taobao.TaoKeApiException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.util.Constant;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.TaoBaoConstant;
|
| | | import com.yeshi.fanli.util.TimeUtil;
|
| | |
|
| | | import net.sf.json.JSONArray;
|
| | |
| | | map.put("start_time", "2019-01-01 00:00:00");
|
| | | // map.put("start_time", "2019-01-01 00:00:00");
|
| | | TaoKeAppInfo app = new TaoKeAppInfo();
|
| | | app.setAppKey(Constant.TAOBAO_AUTH_APPKEY);
|
| | | app.setAppSecret(Constant.TAOBAO_AUTH_APPSECRET);
|
| | | app.setAppKey(TaoBaoConstant.TAOBAO_AUTH_APPKEY);
|
| | | app.setAppSecret(TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | try {
|
| | | JSONObject json = TaoKeBaseUtil.baseRequest(map, app);
|
| | | } catch (TaoKeApiException e) {
|
| | |
| | | private static List<TaoBaoOrder> getSpecialOrder(long startTime, int span) {
|
| | | int page = 1;
|
| | | String startTimeStr = TimeUtil.getGernalTime(startTime, "yyyy-MM-dd HH:mm:ss");
|
| | | List<TaoBaoOrder> orderList = getTaoBaoSpecialOrder(startTimeStr, span, page, Constant.TAOBAO_AUTH_APPKEY,
|
| | | Constant.TAOBAO_AUTH_APPSECRET);
|
| | | List<TaoBaoOrder> orderList = getTaoBaoSpecialOrder(startTimeStr, span, page, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | while (orderList.size() == 100 * page) {
|
| | | page++;
|
| | | List<TaoBaoOrder> tempOrderList = getTaoBaoSpecialOrder(startTimeStr, span, page,
|
| | | Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET);
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | if (tempOrderList != null && tempOrderList.size() > 0)
|
| | | orderList.addAll(tempOrderList);
|
| | | }
|
| | |
| | | private static List<TaoBaoOrder> getThirdTSpecialOrder(long startTime, int span) {
|
| | | int page = 1;
|
| | | String startTimeStr = TimeUtil.getGernalTime(startTime, "yyyy-MM-dd HH:mm:ss");
|
| | | List<TaoBaoOrder> orderList = getTaoBaoSpecialThirdOrder(startTimeStr, span, page, Constant.TAOBAO_AUTH_APPKEY,
|
| | | Constant.TAOBAO_AUTH_APPSECRET);
|
| | | List<TaoBaoOrder> orderList = getTaoBaoSpecialThirdOrder(startTimeStr, span, page, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | while (orderList.size() == 100 * page) {
|
| | | page++;
|
| | | List<TaoBaoOrder> tempOrderList = getTaoBaoSpecialThirdOrder(startTimeStr, span, page,
|
| | | Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET);
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | if (tempOrderList != null && tempOrderList.size() > 0)
|
| | | orderList.addAll(tempOrderList);
|
| | | }
|
| | |
| | | private static List<TaoBaoOrder> getRelationOrder(long startTime, int span) {
|
| | | int page = 1;
|
| | | String startTimeStr = TimeUtil.getGernalTime(startTime, "yyyy-MM-dd HH:mm:ss");
|
| | | List<TaoBaoOrder> orderList = getTaoBaoRelationOrder(startTimeStr, span, page, Constant.TAOBAO_AUTH_APPKEY,
|
| | | Constant.TAOBAO_AUTH_APPSECRET);
|
| | | List<TaoBaoOrder> orderList = getTaoBaoRelationOrder(startTimeStr, span, page, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | while (orderList.size() == 100 * page) {
|
| | | page++;
|
| | | List<TaoBaoOrder> tempOrderList = getTaoBaoRelationOrder(startTimeStr, span, page,
|
| | | Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET);
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | if (tempOrderList != null && tempOrderList.size() > 0)
|
| | | orderList.addAll(tempOrderList);
|
| | | }
|
| | |
| | | private static List<TaoBaoOrder> getThirdRelationOrder(long startTime, int span) {
|
| | | int page = 1;
|
| | | String startTimeStr = TimeUtil.getGernalTime(startTime, "yyyy-MM-dd HH:mm:ss");
|
| | | List<TaoBaoOrder> orderList = getTaoBaoRelationThirdOrder(startTimeStr, span, page, Constant.TAOBAO_AUTH_APPKEY,
|
| | | Constant.TAOBAO_AUTH_APPSECRET);
|
| | | List<TaoBaoOrder> orderList = getTaoBaoRelationThirdOrder(startTimeStr, span, page, TaoBaoConstant.TAOBAO_AUTH_APPKEY,
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | while (orderList.size() == 100 * page) {
|
| | | page++;
|
| | | List<TaoBaoOrder> tempOrderList = getTaoBaoRelationThirdOrder(startTimeStr, span, page,
|
| | | Constant.TAOBAO_AUTH_APPKEY, Constant.TAOBAO_AUTH_APPSECRET);
|
| | | TaoBaoConstant.TAOBAO_AUTH_APPKEY, TaoBaoConstant.TAOBAO_AUTH_APPSECRET);
|
| | | if (tempOrderList != null && tempOrderList.size() > 0)
|
| | | orderList.addAll(tempOrderList);
|
| | | }
|
| | |
| | |
|
| | |
|
| | | #外网正式
|
| | | #druid.url=jdbc:mysql://172.16.16.17:3306/ec_quan
|
| | | #druid.username=root
|
| | | #druid.password=Yeshi2016@
|
| | |
|
| | | #外网本地测试
|
| | | druid.url=jdbc:mysql://gz-cdb-r13d0yi9.sql.tencentcdb.com:62929/ec_quan
|
| | | druid.url=jdbc:mysql://172.16.16.17:3306/ec_quan
|
| | | druid.username=root
|
| | | druid.password=Yeshi2016@
|
| | |
|
| | | #外网本地测试
|
| | | #druid.url=jdbc:mysql://gz-cdb-r13d0yi9.sql.tencentcdb.com:62929/ec_quan
|
| | | #druid.username=root
|
| | | #druid.password=Yeshi2016@
|
| | |
|
| | | druid.initialSize=10
|
| | | druid.minIdle=6
|
| | | druid.maxActive=100
|
| | |
| | | import com.yeshi.fanli.entity.bus.invite.SpreadUserImg;
|
| | | import com.yeshi.fanli.entity.bus.user.LostOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrder;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoOrderTradeMap;
|
| | |
|
| | | //@Ignore
|
| | | public class MyBatisProduce {
|
| | |
| | | @Test
|
| | | public void test3() {
|
| | | |
| | | MyBatisMapperUtil.createMapper(LostOrder.class);
|
| | | MyBatisMapperUtil.createMapper(TaoBaoOrderTradeMap.class);
|
| | | // MyBatisMapperUtil.createMapper(TaoBaoUnionAuthRecord.class);
|
| | | }
|
| | |
|
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| | | xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | <groupId>com.yeshi</groupId> |
| | | <artifactId>FanLiMain</artifactId> |
| | |
| | | <modules> |
| | | <module>utils</module> |
| | | <module>fanli</module> |
| | | </modules> |
| | | <module>test1</module> |
| | | <module>test12</module> |
| | | </modules> |
| | | </project> |
| | |
| | | <attribute name="org.eclipse.jst.component.nondependency" value=""/>
|
| | | </attributes>
|
| | | </classpathentry>
|
| | | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
|
| | | <attributes>
|
| | | <attribute name="owner.project.facets" value="java"/>
|
| | | </attributes>
|
| | | </classpathentry>
|
| | | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk1.8.0_181"/>
|
| | | <classpathentry kind="output" path="target/classes"/>
|
| | | </classpath>
|
| | |
| | | </arguments>
|
| | | </buildCommand>
|
| | | <buildCommand>
|
| | | <name>org.eclipse.m2e.core.maven2Builder</name>
|
| | | <name>org.eclipse.wst.validation.validationbuilder</name>
|
| | | <arguments>
|
| | | </arguments>
|
| | | </buildCommand>
|
| | | <buildCommand>
|
| | | <name>org.eclipse.wst.validation.validationbuilder</name>
|
| | | <name>org.eclipse.m2e.core.maven2Builder</name>
|
| | | <arguments>
|
| | | </arguments>
|
| | | </buildCommand>
|