| | |
| | | import javax.annotation.Resource;
|
| | |
|
| | | import com.yeshi.fanli.entity.SystemEnum;
|
| | | import com.yeshi.fanli.entity.SystemFunction;
|
| | | import com.yeshi.fanli.util.SystemInfoUtil;
|
| | | import org.apache.commons.lang.StringEscapeUtils;
|
| | | import org.springframework.scheduling.annotation.Scheduled;
|
| | | import org.springframework.stereotype.Component;
|
| | |
| | | */
|
| | | @XxlJob("dynamic-insertEvaluate")
|
| | | public ReturnT<String> insertEvaluate(String param) throws Exception {
|
| | |
|
| | | for (SystemEnum system : SystemEnum.values()) {
|
| | | if (!SystemInfoUtil.hasFunctions(system, SystemFunction.faQuan))
|
| | | continue;
|
| | | // 好单库
|
| | | boolean addResult = addHDKListSelected();
|
| | | boolean addResult = addHDKListSelected(system);
|
| | | // 大淘客备用
|
| | | if (!addResult) {
|
| | | addDTKFriendsFircleList();
|
| | | addDTKFriendsFircleList(system);
|
| | | }
|
| | | }
|
| | | return ReturnT.SUCCESS;
|
| | | }
|
| | |
| | | *
|
| | | * @return
|
| | | */
|
| | | private boolean addHDKListSelected() {
|
| | | private boolean addHDKListSelected(SystemEnum system) {
|
| | | boolean addResult = false;
|
| | | Integer minId = 1;
|
| | | while (minId != null) {
|
| | |
| | | List<ActivityRuleUser> ruleList = activityUserService.listByRuleCode(ActivityRuleUser.RULE_HAOHUO, 1, 20);
|
| | | ActivityUser user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
|
| | |
|
| | | int addProcess = goodsEvaluateService.addGoodsEvaluate(TaoBaoGoodsFactory.create(hdkGoods), pics, user, showtitle, SystemEnum.blks);
|
| | | int addProcess = goodsEvaluateService.addGoodsEvaluate(TaoBaoGoodsFactory.create(hdkGoods), pics, user, showtitle, system);
|
| | | if (addProcess == 0) {
|
| | | addResult = true;
|
| | | break;
|
| | |
| | | *
|
| | | * @return
|
| | | */
|
| | | private boolean addDTKFriendsFircleList() {
|
| | | private boolean addDTKFriendsFircleList(SystemEnum system) {
|
| | | boolean addResult = false;
|
| | | try {
|
| | | DaTaoKeGoodsResult result = DaTaoKeApiUtil.getFriendsFircleList("1", 100);
|
| | |
| | | user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
|
| | | }
|
| | |
|
| | | int addProcess = goodsEvaluateService.addGoodsEvaluate(TaoBaoUtil.convert(tkGoods), null, user, showtitle, SystemEnum.blks);
|
| | | int addProcess = goodsEvaluateService.addGoodsEvaluate(TaoBaoUtil.convert(tkGoods), null, user, showtitle, system);
|
| | | if (addProcess == 0) {
|
| | | addResult = true;
|
| | | break;
|