facade-goods/src/main/java/com/yeshi/goods/facade/utils/taobao/DaTaoKeApiUtil.java
@@ -516,6 +516,31 @@ return daTaoKeGoodsResult; } public static JSONArray tbSearch(String key) { TaoKeAppInfo app = getRandomApp(); Map<String, String> params = new TreeMap<>(); params.put("version", "v2.1.0"); params.put("appKey", app.getAppKey()); params.put("pageSize", 20 + ""); params.put("pageNo", 1 + ""); if (StringUtil.isNullOrEmpty(key)) key = ""; params.put("keyWords", key); params.put("sign", getSign(params, app.getAppSecret())); String result = requestGet("https://openapi.dataoke.com/api/tb-service/get-tb-service", params); JSONObject json = JSONObject.fromObject(result); if (json.optInt("code") != 0) { return null; } JSONArray array = json.optJSONArray("data"); return array; } /** * 商品列表 * @@ -891,7 +916,7 @@ params.put("version", "v4.0.0"); params.put("appKey", app.getAppKey()); params.put("pageSize", pageSize + ""); if(topic!=null) { if (topic != null) { params.put("topic", topic + ""); } params.put("selectTime", System.currentTimeMillis() / 1000 + ""); @@ -926,8 +951,6 @@ List<DaTaoKeListTopOffDTO> resultList = gsonBuilder.create().fromJson(array.toString(), type); return new DaTaoKeResult(data.optLong("totalNum"), data.optString("pageId"), resultList); } /** @@ -980,11 +1003,11 @@ /** * @author hxh * @return java.lang.String * @author hxh * @description 解析口令中的商品ID * @date 10:01 2022/9/26 * @param: content * @return java.lang.String **/ public static String parseGoodsIdFromToken(String content) { try { @@ -997,10 +1020,10 @@ String result = baseGet("https://openapi.dataoke.com/api/tb-service/parse-taokouling", params); System.out.println(result); JSONObject resultObj = JSONObject.fromObject(result); if(resultObj.optInt("code")!=0){ if (resultObj.optInt("code") != 0) { return null; } if(resultObj.optJSONObject("data")==null){ if (resultObj.optJSONObject("data") == null) { return null; } return resultObj.optJSONObject("data").optString("goodsId"); @@ -1012,5 +1035,6 @@ public static void main(String[] args) { tbSearch("飘柔铃兰蓬香持久留香柔顺洗发水/露控油蓬松300g女官方正品"); } } fanli/src/main/java/com/yeshi/fanli/controller/admin/TaoBaoGoodsBriefAdminController.java
@@ -281,7 +281,7 @@ return; } List<TaoBaoGoodsBrief> listAddGoods = new ArrayList<TaoBaoGoodsBrief>(); List<TaoBaoGoodsBrief> listAddGoods = new ArrayList<>(); for (TaoBaoGoodsBrief taoBaoGoodsBrief : listTaoBaoGoods) { String auctionId = taoBaoGoodsBrief.getAuctionId(); if (listTaoBaoId.contains(auctionId)) { fanli/src/main/java/com/yeshi/fanli/controller/client/v1/h5/AppH5CouponController.java
@@ -88,7 +88,11 @@ if (taoBaoGoodsBrief == null) { continue; } listGid.add(taoBaoGoodsBrief.getAuctionId()); if (!"0".equalsIgnoreCase(taoBaoGoodsBrief.getAuctionId())) { listGid.add(taoBaoGoodsBrief.getAuctionId()); } else { listGid.add(taoBaoGoodsBrief.getId() + ""); } } // API网络接口验证是否在售 @@ -123,7 +127,7 @@ String goodsId = taoBaoGoodsBrief.getAuctionId(); for (TaoBaoGoodsBrief taoKeGoods : listTaoKeGoods) { String auctionId = taoKeGoods.getAuctionId(); if (TaoBaoUtil.isEqual( goodsId , auctionId) ) { if (TaoBaoUtil.isEqual(goodsId, auctionId)) { stateSale = true; // 在售 break; } fanli/src/main/java/com/yeshi/fanli/controller/client/v2/SearchControllerV2.java
@@ -85,6 +85,8 @@ import com.yeshi.goods.facade.utils.taobao.DaTaoKeApiUtil; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.task.TaskExecutor; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @@ -105,6 +107,8 @@ @Controller @RequestMapping("api/v2/search") public class SearchControllerV2 { Logger logger = LoggerFactory.getLogger(SearchControllerV2.class); @Resource private ConfigService configService; @@ -867,9 +871,27 @@ } // 淘宝api搜索商品 //TODO 测试注释 TaoBaoSearchResult result = taoBaoGoodsCacheUtil.getSearchResult(sf); // TaoBaoUtil.search(sf, specialId, null); if (result == null) { result = TaoBaoUtil.search(sf, specialId, null); if (result != null && result.getTaoBaoGoodsBriefs() != null && result.getTaoBaoGoodsBriefs().size() > 1) { for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { if (StringUtil.isNullOrEmpty(g.getAuctionId())) { logger.error("搜索结果有空ID的情况 关键字{}", key); } } } //如果是单个商品,且里面的商品ID为空,就需要借助大淘客搜索 if (result.getTaoBaoGoodsBriefs() != null && result.getTaoBaoGoodsBriefs().size() == 1 && StringUtil.isNullOrEmpty(result.getTaoBaoGoodsBriefs().get(0).getAuctionId())) { //有一个商品且里面的商品ID为空的情况 JSONArray darray = DaTaoKeApiUtil.tbSearch(key); if (darray != null && darray.size() > 0) { String auctionId = darray.optJSONObject(0).optString("item_id"); result.getTaoBaoGoodsBriefs().set(0, TaoKeApiUtil.searchGoodsDetail(auctionId)); } } taoBaoGoodsCacheUtil.saveSearchResult(sf, result); } TaoBaoSearchResult finalResult = result; fanli/src/main/java/com/yeshi/fanli/controller/client/v2/UserAccountControllerV2.java
@@ -960,7 +960,7 @@ redisManager.clearSMSVCode(phone, SMSHistory.TYPE_REMVOE); } userAccountService.forbiddenUserAll(uid, "用户主动注销账户"); userAccountService.unRegisterUser(uid, "用户主动注销账户"); JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("注销成功")); } fanli/src/main/java/com/yeshi/fanli/dao/mybatis/money/AccountDetailHongBaoMapMapper.java
@@ -3,6 +3,8 @@ import com.yeshi.fanli.dao.BaseMapper; import com.yeshi.fanli.entity.money.AccountDetailHongBaoMap; import java.util.List; public interface AccountDetailHongBaoMapMapper extends BaseMapper<AccountDetailHongBaoMap> { /** @@ -13,4 +15,6 @@ */ AccountDetailHongBaoMap selectByHongBaoId(Long hongBaoId); List<AccountDetailHongBaoMap> listByAccountDetailID(Long aid); } fanli/src/main/java/com/yeshi/fanli/dao/mybatis/order/CommonOrderGoodsMapper.java
@@ -2,6 +2,7 @@ import java.util.List; import com.ks.lijin.query.BaseDaoQuery; import org.apache.ibatis.annotations.Param; import com.yeshi.fanli.dao.BaseMapper; @@ -10,43 +11,51 @@ public interface CommonOrderGoodsMapper extends BaseMapper<CommonOrderGoods> { /** * 根据订单号、订单类型查询商品 * * @param list * 订单对象 * @return */ List<CommonOrderGoods> listByOrderNoAndType(List<CommonOrder> list); /** * 根据商品ID与商品类型查询商品 * * @param goodsId * @param goodsType * @return */ List<CommonOrderGoods> listByGoodsIdAndGoodsType(@Param("goodsId") String goodsId, @Param("goodsType") int goodsType); List<CommonOrderGoods> list(@Param("query") DaoQuery daoQuery); /** * 没有标题的列表 * * @param start * @param count * @return */ List<CommonOrderGoods> listNoTitle(@Param("start") long start, @Param("count") int count); /** * 根据ID列表查询 * @Title: listByByPrimaryKeys * @Description: * @param ids * @return * List<CommonOrderGoods> 返回类型 * @throws */ List<CommonOrderGoods> listByByPrimaryKeys(@Param("ids") List<Long> ids); /** * 根据订单号、订单类型查询商品 * * @param list 订单对象 * @return */ List<CommonOrderGoods> listByOrderNoAndType(List<CommonOrder> list); /** * 根据商品ID与商品类型查询商品 * * @param goodsId * @param goodsType * @return */ List<CommonOrderGoods> listByGoodsIdAndGoodsType(@Param("goodsId") String goodsId, @Param("goodsType") int goodsType); /** * 没有标题的列表 * * @param start * @param count * @return */ List<CommonOrderGoods> listNoTitle(@Param("start") long start, @Param("count") int count); /** * 根据ID列表查询 * * @param ids * @return List<CommonOrderGoods> 返回类型 * @throws * @Title: listByByPrimaryKeys * @Description: */ List<CommonOrderGoods> listByByPrimaryKeys(@Param("ids") List<Long> ids); class DaoQuery extends BaseDaoQuery { public String goodsId; public Integer goodsType; } } fanli/src/main/java/com/yeshi/fanli/dao/user/msg/MsgOverViewsDao.java
@@ -3,7 +3,9 @@ import com.ks.lijin.query.BaseDaoQuery; import com.yeshi.common.MongodbBaseDao; import com.yeshi.fanli.entity.bus.msg.MsgOverViews; import com.yeshi.fanli.entity.bus.msg.MsgTypeEnum; import org.springframework.data.domain.Sort; import org.springframework.data.mongodb.core.mapping.Field; import org.springframework.data.mongodb.core.query.Criteria; import org.springframework.data.mongodb.core.query.Query; import org.springframework.stereotype.Repository; @@ -21,6 +23,14 @@ if (daoQuery.uid != null) { whereList.add(Criteria.where("uid").is(daoQuery.uid)); } if (daoQuery.identityCode != null) { whereList.add(Criteria.where("identityCode").is(daoQuery.identityCode)); } if (daoQuery.msgType != null) { whereList.add(Criteria.where("msgType").is(daoQuery.msgType)); } Criteria[] wheres = new Criteria[whereList.size()]; whereList.toArray(wheres); return wheres; @@ -44,5 +54,7 @@ public static class DaoQuery extends BaseDaoQuery { public Long uid; public MsgTypeEnum msgType; public Long identityCode; } } fanli/src/main/java/com/yeshi/fanli/job/order/OrderShareIncomeJob.java
@@ -11,33 +11,43 @@ import com.yeshi.fanli.service.inter.order.OrderProcessService; import com.yeshi.fanli.service.inter.order.dividents.TeamDividentsSourceUserService; import com.yeshi.fanli.service.manger.order.TeamDividentsManager; import org.yeshi.utils.StringUtil; import org.yeshi.utils.TimeUtil; //分享赚到账 @Component public class OrderShareIncomeJob { @Resource private TeamDividentsManager teamDividentsManager; @Resource private TeamDividentsManager teamDividentsManager; @Resource private TeamDividentsSourceUserService teamDividentsSourceUserService; @Resource private TeamDividentsSourceUserService teamDividentsSourceUserService; @Resource private OrderProcessService orderProcessService; @Resource private OrderProcessService orderProcessService; public OrderShareIncomeJob() { public OrderShareIncomeJob() { } } // 分享赚到账 @XxlJob("startOrderShareIncomeHandler") public ReturnT<String> startPreOrderTeamIncome(String param) throws Exception { String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25"; Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd")); orderProcessService.fanliShare(preSendTime); return ReturnT.SUCCESS; } // 分享赚到账 @XxlJob("startOrderShareIncomeHandler") public ReturnT<String> startPreOrderTeamIncome(String param) throws Exception { String day = TimeUtil.getGernalTime(System.currentTimeMillis(), "yyyy-MM") + "-25"; if (!StringUtil.isNullOrEmpty(param)) { day = param; } //25号之前不能到账本月的 long times = TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd"); if (times > System.currentTimeMillis()) { throw new Exception("25号之前不能到账本月的"); } Date preSendTime = new Date(TimeUtil.convertToTimeTemp(day, "yyyy-MM-dd")); orderProcessService.fanliShare(preSendTime); return ReturnT.SUCCESS; } } fanli/src/main/java/com/yeshi/fanli/job/order/dy/UpdateDYOrderJob.java
@@ -118,10 +118,11 @@ return ReturnT.SUCCESS; } private void updateOrder(DYOrderFilter filter) { public void updateOrder(DYOrderFilter filter) { if (filter.getSize() == null) { filter.setSize(50); } filter.setTime_type("update"); DYOrderResult result = CSJCPSApiUtil.orderList(filter); if (result != null && result.getOrders() != null) { saveDYOrders(result.getOrders()); fanli/src/main/java/com/yeshi/fanli/service/impl/order/CommonOrderServiceImpl.java
@@ -1002,6 +1002,7 @@ } else { cog.setGoodsId(taoBaoOrder.getAuctionId() + ""); cog.setGoodsType(Constant.SOURCE_TYPE_TAOBAO); cog.setTitle(taoBaoOrder.getTitle()); newCommonOrder.setCommonOrderGoods(cog); } newCommonOrder.setStateWholeOrder(wholeOrderState); @@ -1036,6 +1037,8 @@ } cog.setCreateTime(new Date()); cog.setUpdateTime(new Date()); //覆盖原来的商品ID cog.setGoodsId(newCommonOrder.getCommonOrderGoods().getGoodsId()); commonOrderGoodsMapper.insertSelective(cog); } newCommonOrder.setUserInfo(new UserInfo(uid)); fanli/src/main/java/com/yeshi/fanli/service/impl/order/dy/DYOrderServiceImpl.java
@@ -46,7 +46,7 @@ } dyOrderDao.save(order); } else {// 更新 order.setOrder_id(old.getId()); order.setId(old.getId()); order.setUpdateTime(new Date()); dyOrderDao.updateByPrimaryKey(order); } fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserAccountServiceImpl.java
@@ -1821,6 +1821,24 @@ } @Override public void unRegisterUser(Long uid,String reason) { UserInfo currentInfo = userInfoService.selectByPKey(uid); if (currentInfo == null) { return; } if (currentInfo.getState() != UserInfo.STATE_NORMAL) { return; } currentInfo.setState(UserInfo.STATE_FORBIDDEN); currentInfo.setStateDesc(reason); userInfoService.updateByPrimaryKeySelective(currentInfo); // 插入记录 userInfoDeleteRecordService.addDeleteRecord(uid, UserInfo.STATE_DELETE, reason); } @Override public void forbiddenUser(Long uid, String reason) { UserInfo currentInfo = userInfoService.selectByPKey(uid); if (currentInfo == null) { fanli/src/main/java/com/yeshi/fanli/service/inter/user/UserAccountService.java
@@ -253,6 +253,14 @@ */ public void forbiddenUserAll(Long uid, String reason); /** * 注销账户 * * @param uid */ public void unRegisterUser(Long uid,String reason); /** * 删除账户 * fanli/src/main/java/com/yeshi/fanli/util/factory/goods/CommonOrderFactory.java
@@ -258,7 +258,7 @@ commonOrder.setCount(1); commonOrder.setCreateTime(new Date()); if (order.getFlow_point().equalsIgnoreCase(DYOrder.FLOW_POINT_SETTLE)) { commonOrder.seteIncome(new BigDecimal(order.getEstimated_commission()).divide(new BigDecimal(100), 2, RoundingMode.DOWN)); commonOrder.seteIncome(new BigDecimal(order.getEstimated_commission()).add(new BigDecimal(order.getEstimated_tech_service_fee())).divide(new BigDecimal(100), 2, RoundingMode.DOWN)); commonOrder.setSettlement(new BigDecimal(order.getPay_goods_amount()).divide(new BigDecimal(100), 2, RoundingMode.FLOOR)); commonOrder.setSettleTime( new Date(TimeUtil.convertToTimeTemp(order.getSettle_time(), "yyyy-MM-dd HH:mm:ss"))); @@ -290,7 +290,7 @@ new Date(TimeUtil.convertToTimeTemp(order.getPay_success_time(), "yyyy-MM-dd HH:mm:ss"))); commonOrder.setUpdateTime(new Date()); commonOrder.setTradeId(order.getOrder_id()); commonOrder.setEstimate(new BigDecimal(order.getEstimated_commission()).divide(new BigDecimal(100), 2, RoundingMode.DOWN)); commonOrder.setEstimate(new BigDecimal(order.getEstimated_commission()).add(new BigDecimal(order.getEstimated_tech_service_fee())).divide(new BigDecimal(100), 2, RoundingMode.DOWN)); commonOrder.setChildSourceType("抖音"); return commonOrder; } fanli/src/main/java/com/yeshi/fanli/util/goods/douyin/CSJCPSApiUtil.java
@@ -11,6 +11,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.yeshi.utils.StringUtil; import org.yeshi.utils.TimeUtil; import java.io.IOException; import java.lang.reflect.Type; @@ -385,8 +386,18 @@ public static void main(String[] args) { goodsDetails(Arrays.asList(new Long[]{3549871967593209780L})); getOrderDetail("4984015762658606759", 1); DYOrderFilter filter=new DYOrderFilter(); filter.setTime_type("update"); filter.setOrder_type(1); filter.setSize(50); filter.setCursor("0"); filter.setStart_time(TimeUtil.convertToTimeTemp("2022-12-18","yyyy-MM-dd")/1000); filter.setEnd_time(TimeUtil.convertToTimeTemp("2022-12-19","yyyy-MM-dd")/1000); DYOrderResult result = orderList(filter); System.out.println(result); // goodsDetails(Arrays.asList(new Long[]{3549871967593209780L})); // DYOrder order = getOrderDetail("5005828634543277401", 1); } fanli/src/main/java/com/yeshi/fanli/util/goods/douyin/vo/DYOrderFilter.java
@@ -50,6 +50,16 @@ **/ private Integer order_type; /** * pay-按照⽀付时 * 间查询特定时间范 * 围内的订单 * update-按照订单 * 更新时间查询特定 * 时间范围内的订单 **/ private String time_type; public Integer getSize() { return size; } @@ -97,4 +107,12 @@ public void setOrder_type(Integer order_type) { this.order_type = order_type; } public String getTime_type() { return time_type; } public void setTime_type(String time_type) { this.time_type = time_type; } } fanli/src/main/java/com/yeshi/fanli/util/mq/cmq/order/TeamOrderCMQManager.java
@@ -29,8 +29,6 @@ static { TDMQUtil.getInstance().init(secretId, secretKey, Constant.TDMQ_PUBLIC); TEAM_DIVIDENTS_PRE += "-" + Constant.systemCommonConfig.getProjectName(); FANLI_TEAM_INCOME_ORDER_PRE += "-" + Constant.systemCommonConfig.getProjectName(); TEAM_DIVIDENTS += "-" + Constant.systemCommonConfig.getProjectName(); fanli/src/main/java/com/yeshi/fanli/util/taobao/TaoKeApiUtil.java
@@ -21,6 +21,7 @@ import com.yeshi.goods.facade.dto.taobao.TaoBaoShopInfoDTO; import com.yeshi.goods.facade.entity.taobao.TaoBaoGoodsBrief; import com.yeshi.goods.facade.entity.taobao.TaoBaoHead; import com.yeshi.goods.facade.utils.taobao.DaTaoKeApiUtil; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.yeshi.utils.JsonUtil; @@ -117,7 +118,7 @@ Map<String, String> map = new HashMap<>(); //TODO 临时接口 taobao.tbk.item.info.get map.put("method", "taobao.tbk.item.info.get"); //map.put("biz_scene_id", 2 + ""); // map.put("biz_scene_id", 2 + ""); map.put("num_iids", id + ""); String resultStr = TaoKeBaseUtil.baseRequestForThreeTimes(map, true); System.out.println(resultStr); @@ -135,7 +136,11 @@ .optJSONArray("n_tbk_item"); if (array != null && array.size() > 0) { JSONObject item = array.optJSONObject(0); return parseSimpleGoodsInfo(item); TaoBaoGoodsBrief goods = parseSimpleGoodsInfo(item); if(goods!=null){ goods.setAuctionId(id); } return goods; } return null; } @@ -368,7 +373,7 @@ if (result != null && result.getTaoBaoGoodsBriefs() != null) for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { System.out.println(goods.getAuctionId() + ":" + g.getAuctionId()); if (TaoBaoUtil.isEqual(goods.getAuctionId(),g.getAuctionId())) { if (TaoBaoUtil.isEqual(goods.getAuctionId(), g.getAuctionId())) { g.setAuctionId(goods.getAuctionId()); g.setCreatetime(new Date()); g.setMaterialLibType(goods.getMaterialLibType()); @@ -433,7 +438,7 @@ goods.getUserType(), app, null, null); if (result != null && result.getTaoBaoGoodsBriefs() != null) for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { if (TaoBaoUtil.isEqual( goods.getAuctionId() , g.getAuctionId())) { if (TaoBaoUtil.isEqual(goods.getAuctionId(), g.getAuctionId())) { g.setAuctionId(goods.getAuctionId()); // 判断是否有优惠券 if (!StringUtil.isNullOrEmpty(g.getCouponActivityId())) { @@ -513,7 +518,7 @@ goods.getUserType(), app, specialId, relationId); if (result != null && result.getTaoBaoGoodsBriefs() != null) for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { if (TaoBaoUtil.isEqual( goods.getAuctionId(), g.getAuctionId())) { if (TaoBaoUtil.isEqual(goods.getAuctionId(), g.getAuctionId())) { g.setAuctionId(goods.getAuctionId()); g.setCreatetime(new Date()); return g; @@ -554,7 +559,7 @@ goods.getUserType(), null, null); if (result != null && result.getTaoBaoGoodsBriefs() != null) for (TaoBaoGoodsBrief g : result.getTaoBaoGoodsBriefs()) { if ( TaoBaoUtil.isEqual(goods.getAuctionId(),g.getAuctionId())) { if (TaoBaoUtil.isEqual(goods.getAuctionId(), g.getAuctionId())) { g.setAuctionId(goods.getAuctionId()); g.setAuctionUrl(goods.getAuctionUrl()); g.setShopTitle(goods.getShopTitle()); @@ -591,7 +596,7 @@ if (searchResult != null && searchResult.getTaoBaoGoodsBriefs() != null && searchResult.getTaoBaoGoodsBriefs().size() > 0) { for (TaoBaoGoodsBrief g : searchResult.getTaoBaoGoodsBriefs()) { if (TaoBaoUtil.isEqual( g.getAuctionId(), goods.getAuctionId())) { if (TaoBaoUtil.isEqual(g.getAuctionId(), goods.getAuctionId())) { g.setImgList(goods.getImgList()); g.setAuctionId(goods.getAuctionId()); g.setAuctionUrl(goods.getAuctionUrl()); @@ -646,6 +651,10 @@ map.put("method", "taobao.tbk.dg.material.optional"); map.put("page_size", filter.getPageSize() == 0 ? "20" : filter.getPageSize() + ""); map.put("page_no", (filter.getPage() <= 0 ? 1 : filter.getPage()) + ""); //1-动态ID转链场景,2-消费者比价场景(不填默认为1) // map.put("biz_scene_id","2"); // map.put("promotion_type","1"); if (!StringUtil.isNullOrEmpty(specialId) && !StringUtil.isNullOrEmpty(relationId)) { map.put("special_id", specialId); } else if (!StringUtil.isNullOrEmpty(specialId)) { @@ -757,7 +766,7 @@ } String resultStr = TaoKeBaseUtil.baseRequestForThreeTimes(map, true); System.out.println("resultStr"+ resultStr); System.out.println("resultStr" + resultStr); JSONObject data = JSONObject.fromObject(resultStr); //TODO 临时接口tbk_dg_material_optional_response if (data.optJSONObject("tbk_dg_material_optional_response") != null @@ -957,7 +966,7 @@ } // 解析物料 private static TaoBaoGoodsBrief parseWuLiaoItem(JSONObject item) { public static TaoBaoGoodsBrief parseWuLiaoItem(JSONObject item) { TaoBaoGoodsBrief goods = new TaoBaoGoodsBrief(); goods.setPictUrl(item.optString("pict_url")); @@ -1942,8 +1951,6 @@ } // 淘礼金创建 //{"result":{"msg_code":"FAIL_CHECK_ITEM_DAILY_SEND_NUM_CHECK_ERROR","msg_info":"今日该商品淘礼金创建数已超上限,请您明日再试","success":false},"request_id":"10p30v02qadkq"} //{"result":{"msg_code":"ASSET_ACCOUNT_BALANCE_NOT_ENOUGH","msg_info":"账户预算不足","success":false},"request_id":"5caz9izr7jqp"} @@ -2011,13 +2018,13 @@ } /** * @return com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport * @author hxh * @description 淘礼金报告 接口文档:https://open.taobao.com/api.htm?source=search&docId=58736&docType=2 * @date 10:57 2022/1/11 * @param: rightsId * @return com.yeshi.fanli.entity.bus.tlj.UserTaoLiJinReport **/ public static UserTaoLiJinReport getTaoLiJinEffective(String rightsId,String pid) { public static UserTaoLiJinReport getTaoLiJinEffective(String rightsId, String pid) { Map<String, String> map = new HashMap<>(); map.put("method", "taobao.tbk.dg.vegas.tlj.report"); map.put("rights_id", rightsId); @@ -2035,21 +2042,21 @@ JSONObject root = json.optJSONObject("tbk_dg_vegas_tlj_report_response"); if (root != null && root.optBoolean("result_success")) { JSONObject modelJson = root.optJSONObject("model").optJSONObject("extra"); if (modelJson != null && modelJson.size() > 0) { UserTaoLiJinReport report = new UserTaoLiJinReport(); report.setId(rightsId); report.setWinAmount(new BigDecimal(modelJson.optString("win_sum_amt"))); report.setWinNum(modelJson.optInt("win_pv")); report.setRefundAmount(new BigDecimal(modelJson.optString("refund_sum_amt"))); report.setRefundNum(modelJson.optInt("refund_num")); report.setAlipayAmount(new BigDecimal(modelJson.optString("alipay_amt"))); report.setUseAmount(new BigDecimal(modelJson.optString("use_sum_amt"))); report.setUseNum(modelJson.optInt("use_num")); report.setUnfreezeAmount(new BigDecimal(modelJson.optString("remaining_amt"))); report.setUnfreezeNum(modelJson.optInt("remaining_num")); report.setPreCommissionAmount(new BigDecimal(modelJson.optString("pre_pub_share_fee_for_disp"))); return report; JSONObject modelJson = root.optJSONObject("model").optJSONObject("extra"); if (modelJson != null && modelJson.size() > 0) { UserTaoLiJinReport report = new UserTaoLiJinReport(); report.setId(rightsId); report.setWinAmount(new BigDecimal(modelJson.optString("win_sum_amt"))); report.setWinNum(modelJson.optInt("win_pv")); report.setRefundAmount(new BigDecimal(modelJson.optString("refund_sum_amt"))); report.setRefundNum(modelJson.optInt("refund_num")); report.setAlipayAmount(new BigDecimal(modelJson.optString("alipay_amt"))); report.setUseAmount(new BigDecimal(modelJson.optString("use_sum_amt"))); report.setUseNum(modelJson.optInt("use_num")); report.setUnfreezeAmount(new BigDecimal(modelJson.optString("remaining_amt"))); report.setUnfreezeNum(modelJson.optInt("remaining_num")); report.setPreCommissionAmount(new BigDecimal(modelJson.optString("pre_pub_share_fee_for_disp"))); return report; } } } catch (Exception e) { @@ -2286,16 +2293,9 @@ } } public static void main(String[] args) throws TaoBaoTokenParseException, TaobaoGoodsDownException { String token="【淘宝】https://m.tb.cn/h.Ud07Ald?tk=NIWE2xNaOzs CZ0001 「超细高分子细滑牙线棒一次性牙签牙线便携牙线盒牙线签6盒300支」\n" + "点击链接直接打开 或者 淘宝搜索直接打开"; TokenConvertResult convertResult=tokenConvert(token); getSimpleGoodsInfo(convertResult.getNum_iid()); public static void main(String[] args) throws TaoBaoTokenParseException, TaobaoGoodsDownException { TaoBaoGoodsBrief goods = getSimpleGoodsInfo("qYtrU8tgk7CWt0-GmgDAKHqqGm3XDwHZj"); System.out.println(goods.getAuctionId()); } } fanli/src/main/resource/mapping/money/AccountDetailHongBaoMapMapper.xml
@@ -37,6 +37,15 @@ from yeshi_ec_account_details_hongbao_map where ahm_hongbao_id =#{0} </select> <select id="listByAccountDetailID" resultMap="BaseResultMap" parameterType="java.lang.Long"> select <include refid="Base_Column_List" /> from yeshi_ec_account_details_hongbao_map where ahm_account_details_id =#{0} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_account_details_hongbao_map where ahm_id = fanli/src/main/resource/mapping/order/CommonOrderGoodsMapper.xml
@@ -2,101 +2,123 @@ <!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.order.CommonOrderGoodsMapper"> <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.order.CommonOrderGoods"> <id column="cog_id" property="id" jdbcType="BIGINT" /> <result column="cog_goods_id" property="goodsId" jdbcType="VARCHAR" /> <result column="cog_goods_type" property="goodsType" jdbcType="INTEGER" /> <result column="cog_title" property="title" jdbcType="VARCHAR" /> <result column="cog_picture" property="picture" jdbcType="VARCHAR" /> <result column="cog_price" property="price" jdbcType="DECIMAL" /> <result column="cog_shop_id" property="shopId" jdbcType="BIGINT" /> <result column="cog_shop_name" property="shopName" jdbcType="VARCHAR" /> <result column="cog_shop_type" property="shopType" jdbcType="VARCHAR" /> <result column="cog_state" property="state" jdbcType="INTEGER" /> <result column="cog_create_time" property="createTime" jdbcType="TIMESTAMP" /> <result column="cog_update_time" property="updateTime" jdbcType="TIMESTAMP" /> <result column="cog_actual_price" property="actualPrice" jdbcType="DECIMAL" /> </resultMap> <sql id="Base_Column_List">cog_id,cog_goods_id,cog_goods_type,cog_title,cog_picture,cog_price,cog_shop_id,cog_shop_name,cog_shop_type,cog_state,cog_create_time,cog_update_time,cog_actual_price <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.order.CommonOrderGoods"> <id column="cog_id" property="id" jdbcType="BIGINT"/> <result column="cog_goods_id" property="goodsId" jdbcType="VARCHAR"/> <result column="cog_goods_type" property="goodsType" jdbcType="INTEGER"/> <result column="cog_title" property="title" jdbcType="VARCHAR"/> <result column="cog_picture" property="picture" jdbcType="VARCHAR"/> <result column="cog_price" property="price" jdbcType="DECIMAL"/> <result column="cog_shop_id" property="shopId" jdbcType="BIGINT"/> <result column="cog_shop_name" property="shopName" jdbcType="VARCHAR"/> <result column="cog_shop_type" property="shopType" jdbcType="VARCHAR"/> <result column="cog_state" property="state" jdbcType="INTEGER"/> <result column="cog_create_time" property="createTime" jdbcType="TIMESTAMP"/> <result column="cog_update_time" property="updateTime" jdbcType="TIMESTAMP"/> <result column="cog_actual_price" property="actualPrice" jdbcType="DECIMAL"/> </resultMap> <sql id="Base_Column_List">cog_id,cog_goods_id,cog_goods_type,cog_title,cog_picture,cog_price,cog_shop_id,cog_shop_name,cog_shop_type,cog_state,cog_create_time,cog_update_time,cog_actual_price </sql> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long"> select <include refid="Base_Column_List" /> from yeshi_ec_common_order_goods where cog_id = #{id,jdbcType=BIGINT} </select> <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long"> select <include refid="Base_Column_List"/> from yeshi_ec_common_order_goods where cog_id = #{id,jdbcType=BIGINT} </select> <select id="listByByPrimaryKeys" resultMap="BaseResultMap"> select <include refid="Base_Column_List" /> from yeshi_ec_common_order_goods where <foreach collection="ids" item="id" open="(" close=")" separator=" or "> cog_id=#{id} </foreach> </select> <select id="listByByPrimaryKeys" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> from yeshi_ec_common_order_goods where <foreach collection="ids" item="id" open="(" close=")" separator=" or "> cog_id=#{id} </foreach> </select> <select id="listByGoodsIdAndGoodsType" resultMap="BaseResultMap"> select <include refid="Base_Column_List" /> from yeshi_ec_common_order_goods where cog_goods_id = #{goodsId} and cog_goods_type=#{goodsType} </select> <select id="listNoTitle" resultMap="BaseResultMap"> select <include refid="Base_Column_List" /> from yeshi_ec_common_order_goods where cog_title is null limit #{start},#{count} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from <select id="listByGoodsIdAndGoodsType" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> from yeshi_ec_common_order_goods where cog_goods_id = #{goodsId} and cog_goods_type=#{goodsType} </select> <select id="list" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> from yeshi_ec_common_order_goods where 1=1 <if test="query.goodsId!=null"> and cog_goods_id=#{query.goodsId} </if> <if test="query.goodsType!=null"> and cog_goods_type=#{query.goodsType} </if> <if test="query.sortList!=null"> <foreach collection="query.sortList" item="item" open=" order by " separator=","> ${item} </foreach> </if> limit #{query.start},#{query.count} </select> <select id="listNoTitle" resultMap="BaseResultMap"> select <include refid="Base_Column_List"/> from yeshi_ec_common_order_goods where cog_title is null limit #{start},#{count} </select> <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from yeshi_ec_common_order_goods where cog_id = #{id,jdbcType=BIGINT} </delete> <insert id="insert" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods" useGeneratedKeys="true" keyProperty="id">insert into <insert id="insert" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods" useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_common_order_goods (cog_id,cog_goods_id,cog_goods_type,cog_title,cog_picture,cog_price,cog_shop_id,cog_shop_name,cog_shop_type,cog_state,cog_create_time,cog_update_time,cog_actual_price) values (#{id,jdbcType=BIGINT},#{goodsId,jdbcType=VARCHAR},#{goodsType,jdbcType=INTEGER},#{title,jdbcType=VARCHAR},#{picture,jdbcType=VARCHAR},#{price,jdbcType=DECIMAL},#{shopId,jdbcType=BIGINT},#{shopName,jdbcType=VARCHAR},#{shopType,jdbcType=VARCHAR},#{state,jdbcType=INTEGER},#{createTime,jdbcType=TIMESTAMP},#{updateTime,jdbcType=TIMESTAMP},#{actualPrice,jdbcType=DECIMAL}) </insert> <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods" useGeneratedKeys="true" keyProperty="id"> insert into yeshi_ec_common_order_goods <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">cog_id,</if> <if test="goodsId != null">cog_goods_id,</if> <if test="goodsType != null">cog_goods_type,</if> <if test="title != null">cog_title,</if> <if test="picture != null">cog_picture,</if> <if test="price != null">cog_price,</if> <if test="shopId != null">cog_shop_id,</if> <if test="shopName != null">cog_shop_name,</if> <if test="shopType != null">cog_shop_type,</if> <if test="state != null">cog_state,</if> <if test="createTime != null">cog_create_time,</if> <if test="updateTime != null">cog_update_time,</if> <if test="actualPrice != null">cog_actual_price</if> </trim> values <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">#{id,jdbcType=BIGINT},</if> <if test="goodsId != null">#{goodsId,jdbcType=VARCHAR},</if> <if test="goodsType != null">#{goodsType,jdbcType=INTEGER},</if> <if test="title != null">#{title,jdbcType=VARCHAR},</if> <if test="picture != null">#{picture,jdbcType=VARCHAR},</if> <if test="price != null">#{price,jdbcType=DECIMAL},</if> <if test="shopId != null">#{shopId,jdbcType=BIGINT},</if> <if test="shopName != null">#{shopName,jdbcType=VARCHAR},</if> <if test="shopType != null">#{shopType,jdbcType=VARCHAR},</if> <if test="state != null">#{state,jdbcType=INTEGER},</if> <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> <if test="actualPrice != null">#{actualPrice,jdbcType=DECIMAL}</if> </trim> </insert> <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods">update <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods" useGeneratedKeys="true" keyProperty="id"> insert into yeshi_ec_common_order_goods <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">cog_id,</if> <if test="goodsId != null">cog_goods_id,</if> <if test="goodsType != null">cog_goods_type,</if> <if test="title != null">cog_title,</if> <if test="picture != null">cog_picture,</if> <if test="price != null">cog_price,</if> <if test="shopId != null">cog_shop_id,</if> <if test="shopName != null">cog_shop_name,</if> <if test="shopType != null">cog_shop_type,</if> <if test="state != null">cog_state,</if> <if test="createTime != null">cog_create_time,</if> <if test="updateTime != null">cog_update_time,</if> <if test="actualPrice != null">cog_actual_price</if> </trim> values <trim prefix="(" suffix=")" suffixOverrides=","> <if test="id != null">#{id,jdbcType=BIGINT},</if> <if test="goodsId != null">#{goodsId,jdbcType=VARCHAR},</if> <if test="goodsType != null">#{goodsType,jdbcType=INTEGER},</if> <if test="title != null">#{title,jdbcType=VARCHAR},</if> <if test="picture != null">#{picture,jdbcType=VARCHAR},</if> <if test="price != null">#{price,jdbcType=DECIMAL},</if> <if test="shopId != null">#{shopId,jdbcType=BIGINT},</if> <if test="shopName != null">#{shopName,jdbcType=VARCHAR},</if> <if test="shopType != null">#{shopType,jdbcType=VARCHAR},</if> <if test="state != null">#{state,jdbcType=INTEGER},</if> <if test="createTime != null">#{createTime,jdbcType=TIMESTAMP},</if> <if test="updateTime != null">#{updateTime,jdbcType=TIMESTAMP},</if> <if test="actualPrice != null">#{actualPrice,jdbcType=DECIMAL}</if> </trim> </insert> <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods">update yeshi_ec_common_order_goods set cog_goods_id = #{goodsId,jdbcType=VARCHAR},cog_goods_type = #{goodsType,jdbcType=INTEGER}cog_title = @@ -111,22 +133,22 @@ #{updateTime,jdbcType=TIMESTAMP} ,cog_actual_price =#{actualPrice,jdbcType=DECIMAL} where cog_id = #{id,jdbcType=BIGINT} </update> <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods"> update yeshi_ec_common_order_goods <set> <if test="goodsId != null">cog_goods_id=#{goodsId,jdbcType=VARCHAR},</if> <if test="goodsType != null">cog_goods_type=#{goodsType,jdbcType=INTEGER},</if> <if test="title != null">cog_title=#{title,jdbcType=VARCHAR},</if> <if test="picture != null">cog_picture=#{picture,jdbcType=VARCHAR},</if> <if test="price != null">cog_price=#{price,jdbcType=DECIMAL},</if> <if test="shopId != null">cog_shop_id=#{shopId,jdbcType=BIGINT},</if> <if test="shopName != null">cog_shop_name=#{shopName,jdbcType=VARCHAR},</if> <if test="shopType != null">cog_shop_type=#{shopType,jdbcType=VARCHAR},</if> <if test="state != null">cog_state=#{state,jdbcType=INTEGER},</if> <if test="createTime != null">cog_create_time=#{createTime,jdbcType=TIMESTAMP},</if> <if test="updateTime != null">cog_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> <if test="actualPrice !=null">cog_actual_price =#{actualPrice,jdbcType=DECIMAL}</if> </set> where cog_id = #{id,jdbcType=BIGINT} </update> <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.order.CommonOrderGoods"> update yeshi_ec_common_order_goods <set> <if test="goodsId != null">cog_goods_id=#{goodsId,jdbcType=VARCHAR},</if> <if test="goodsType != null">cog_goods_type=#{goodsType,jdbcType=INTEGER},</if> <if test="title != null">cog_title=#{title,jdbcType=VARCHAR},</if> <if test="picture != null">cog_picture=#{picture,jdbcType=VARCHAR},</if> <if test="price != null">cog_price=#{price,jdbcType=DECIMAL},</if> <if test="shopId != null">cog_shop_id=#{shopId,jdbcType=BIGINT},</if> <if test="shopName != null">cog_shop_name=#{shopName,jdbcType=VARCHAR},</if> <if test="shopType != null">cog_shop_type=#{shopType,jdbcType=VARCHAR},</if> <if test="state != null">cog_state=#{state,jdbcType=INTEGER},</if> <if test="createTime != null">cog_create_time=#{createTime,jdbcType=TIMESTAMP},</if> <if test="updateTime != null">cog_update_time=#{updateTime,jdbcType=TIMESTAMP},</if> <if test="actualPrice !=null">cog_actual_price =#{actualPrice,jdbcType=DECIMAL}</if> </set> where cog_id = #{id,jdbcType=BIGINT} </update> </mapper>