Commit 1c5344bf by kk

存储在

parent b9e304fd
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 59, sales_growth = 2819 where id = 200;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 49, sales_growth = 3656 where id = 201;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 55, sales_growth = 3286 where id = 202;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 34, sales_growth = 6460 where id = 203;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = -1, sales_growth = 316 where id = 204;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 62, sales_growth = 2703 where id = 205;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 47, sales_growth = 3825 where id = 206;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 42, sales_growth = 4872 where id = 207;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 40, sales_growth = 5007 where id = 208;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 32, sales_growth = 6820 where id = 209;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 48, sales_growth = 3715 where id = 210;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 57, sales_growth = 3268 where id = 211;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 37, sales_growth = 5436 where id = 212;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 9, sales_growth = 14305 where id = 213;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 23, sales_growth = 9215 where id = 214;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 26, sales_growth = 9011 where id = 215;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 35, sales_growth = 6051 where id = 216;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 66, sales_growth = 2209 where id = 217;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 54, sales_growth = 3296 where id = 218;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 28, sales_growth = 8730 where id = 219;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 58, sales_growth = 2845 where id = 220;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 68, sales_growth = 2177 where id = 221;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 52, sales_growth = 3502 where id = 222;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 15, sales_growth = 11266 where id = 223;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 24, sales_growth = 9197 where id = 224;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 27, sales_growth = 8977 where id = 225;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 36, sales_growth = 5843 where id = 226;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 51, sales_growth = 3571 where id = 227;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 41, sales_growth = 4877 where id = 228;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 44, sales_growth = 4044 where id = 229;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 61, sales_growth = 2735 where id = 230;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 56, sales_growth = 3270 where id = 231;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 43, sales_growth = 4141 where id = 232;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 67, sales_growth = 2199 where id = 233;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 53, sales_growth = 3492 where id = 234;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 4, sales_growth = 16767 where id = 235;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 63, sales_growth = 2614 where id = 236;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 64, sales_growth = 2603 where id = 237;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = -1, sales_growth = 0 where id = 238;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 60, sales_growth = 2809 where id = 239;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 2, sales_growth = 18756 where id = 240;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 8, sales_growth = 14615 where id = 241;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 45, sales_growth = 3955 where id = 242;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 50, sales_growth = 3596 where id = 243;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 20, sales_growth = 9380 where id = 244;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 5, sales_growth = 16671 where id = 245;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 46, sales_growth = 3838 where id = 246;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 18, sales_growth = 9434 where id = 247;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 22, sales_growth = 9249 where id = 248;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 29, sales_growth = 8694 where id = 249;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 33, sales_growth = 6665 where id = 250;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 16, sales_growth = 10642 where id = 251;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = -1, sales_growth = 9211 where id = 252;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 3, sales_growth = 16781 where id = 253;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 17, sales_growth = 10553 where id = 254;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 31, sales_growth = 6963 where id = 255;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 12, sales_growth = 12075 where id = 256;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 38, sales_growth = 5272 where id = 257;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 21, sales_growth = 9368 where id = 258;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 25, sales_growth = 9068 where id = 259;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 6, sales_growth = 16667 where id = 260;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 19, sales_growth = 9408 where id = 261;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 10, sales_growth = 13799 where id = 262;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 7, sales_growth = 14668 where id = 263;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 30, sales_growth = 8161 where id = 264;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 1, sales_growth = 24768 where id = 265;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 14, sales_growth = 11339 where id = 266;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 39, sales_growth = 5263 where id = 267;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 11, sales_growth = 13765 where id = 268;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 65, sales_growth = 2226 where id = 269;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 13, sales_growth = 11730 where id = 270;
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
UPDATE brand_record_tool SET account_logo_url = 'https://soundasia.oss-cn-shenzhen.aliyuncs.com/amazon/139e813cbb842abc3aaf7ac61780e4fc_small.png', first_audit_status = 2, first_audit_time = 1684912984, first_audit_name = '刘婉荣', first_audit_id = 4115, first_audit_url = '', first_audit_remark = '无明确指向', second_audit_status = 2, second_audit_time = 1684912991, second_audit_id = 4115, second_audit_name = '刘婉荣', second_audit_remark = '无明确指向', communication_id = 12306, logo_zip_url = '', copyright_applicant = '', copyright_applicant_id = 0, copyright_applicant_status = 2, copyright_applicant_time = 1697731200, copyright_applicant_finish_time = 1698336000, copyright_number = '黔作登字-2023-F-00912382', copyright_certificate = 'https://soundasia.oss-cn-shenzhen.aliyuncs.com/microservice/product/2023-11-08/other/other/Panelee.pdf', apply_company = '深圳市世津网络科技有限公司', copyright_name = '' WHERE id = 2039625980590428161;
INSERT INTO visual_design_log(id, operation_key, create_time, create_id, create_name, operation_content, relation_id, file_url, operation_type) VALUES (2039660168456613890, 'brand_record_tool', 1775127853, 0, '系统', '同步IO-Panelee的logo、审核、版权等信息', 2039625980590428161, '', 'job');
...@@ -20,7 +20,7 @@ public class CodeGenerator { ...@@ -20,7 +20,7 @@ public class CodeGenerator {
private static final String DB_URL = "jdbc:mysql://120.77.232.73:3306/java_visual?useUnicode=true&characterEncoding=utf8&useSSL=true"; private static final String DB_URL = "jdbc:mysql://120.77.232.73:3306/java_visual?useUnicode=true&characterEncoding=utf8&useSSL=true";
private static final String DB_USERNAME = "yswg_it_java"; private static final String DB_USERNAME = "yswg_it_java";
private static final String DB_PASSWORD = "Yswg@inv-java256239134"; private static final String DB_PASSWORD = "Yswg@inv-java264109357";
//private static final String DB_URL = "jdbc:mysql://mydb.com:3306/visual_0102?useUnicode=true&characterEncoding=utf8&useSSL=true"; //private static final String DB_URL = "jdbc:mysql://mydb.com:3306/visual_0102?useUnicode=true&characterEncoding=utf8&useSSL=true";
//private static final String DB_USERNAME = "root"; //private static final String DB_USERNAME = "root";
...@@ -54,7 +54,7 @@ public class CodeGenerator { ...@@ -54,7 +54,7 @@ public class CodeGenerator {
.strategyConfig(builder -> { .strategyConfig(builder -> {
builder builder
// 设置需要生成的表名 // 设置需要生成的表名
.addInclude("visual_plan_executor_task_record") .addInclude("visual_task_weight")
//entity策略配置 //entity策略配置
.entityBuilder() .entityBuilder()
......
package cn.kk.spring_simple_operation.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* <p>
* 视觉任务权重表 前端控制器
* </p>
*
* @author guokunkun
* @since 2026-05-06
*/
@RestController
@RequestMapping("/spring_simple_operation/visual-task-weight")
public class VisualTaskWeightController {
}
package cn.kk.spring_simple_operation.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
/**
* <p>
* 视觉任务权重表
* </p>
*
* @author guokunkun
* @since 2026-05-06
*/
@Getter
@Setter
@Accessors(chain = true)
@TableName("visual_task_weight")
@ApiModel(value = "VisualTaskWeight对象", description = "视觉任务权重表")
public class VisualTaskWeight implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty("任务id")
@TableField("task_id")
private Long taskId;
@ApiModelProperty("任务类型:1-A+策划,2-视频策划")
@TableField("task_type")
private Integer taskType;
@ApiModelProperty("权重")
@TableField("weight")
private BigDecimal weight;
@ApiModelProperty("任务时间")
@TableField("task_time")
private Integer taskTime;
@ApiModelProperty("是否删除,0-否,1-是")
@TableField("is_delete")
@TableLogic
private Integer isDelete;
@ApiModelProperty("创建用户id")
@TableField("create_id")
private Integer createId;
@ApiModelProperty("创建时间")
@TableField("create_time")
private Integer createTime;
}
package cn.kk.spring_simple_operation.mapper;
import cn.kk.spring_simple_operation.entity.VisualTaskWeight;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 视觉任务权重表 Mapper 接口
* </p>
*
* @author guokunkun
* @since 2026-05-06
*/
@Mapper
public interface VisualTaskWeightMapper extends BaseMapper<VisualTaskWeight> {
}
package cn.kk.spring_simple_operation.model.vo;
import cn.kk.spring_simple_operation.utils.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author kk
* @date 2026/4/27
*/
@Data
public class SkuAPlusImageAndVideoVO {
@Excel(name = "sku")
@ApiModelProperty("sku")
private String sku;
@Excel(name = "审核产品ID")
@ApiModelProperty("审核产品ID")
private Long productId;
@Excel(name = "站点")
@ApiModelProperty("站点")
private String site;
@Excel(name = "前台图片")
@ApiModelProperty("前台图片")
private String frontImage;
@Excel(name = "A+图片")
@ApiModelProperty("A+图片")
private String aPlusImage;
@Excel(name = "视频地址")
@ApiModelProperty("视频地址")
private String videoUrl;
}
package cn.kk.spring_simple_operation.service;
import cn.kk.spring_simple_operation.entity.VisualTaskWeight;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 视觉任务权重表 服务类
* </p>
*
* @author guokunkun
* @since 2026-05-06
*/
public interface VisualTaskWeightService extends IService<VisualTaskWeight> {
}
package cn.kk.spring_simple_operation.service.impl;
import cn.kk.spring_simple_operation.entity.VisualTaskWeight;
import cn.kk.spring_simple_operation.mapper.VisualTaskWeightMapper;
import cn.kk.spring_simple_operation.service.VisualTaskWeightService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 视觉任务权重表 服务实现类
* </p>
*
* @author guokunkun
* @since 2026-05-06
*/
@Service
public class VisualTaskWeightServiceImpl extends ServiceImpl<VisualTaskWeightMapper, VisualTaskWeight> implements VisualTaskWeightService {
}
...@@ -17,13 +17,16 @@ spring: ...@@ -17,13 +17,16 @@ spring:
# url: jdbc:mysql://192.168.0.59:3309/visual_1228?useUnicode=true&characterEncoding=utf8&useSSL=true # url: jdbc:mysql://192.168.0.59:3309/visual_1228?useUnicode=true&characterEncoding=utf8&useSSL=true
# username: root # username: root
# password: root # password: root
# url: jdbc:mysql://120.77.232.73:3306/java_visual?useUnicode=true&characterEncoding=utf8&useSSL=true # url: jdbc:mysql://120.77.232.73:3306/java_visual?useUnicode=true&characterEncoding=utf8&useSSL=true
# username: yswg_it_java # username: yswg_it_java
# password: Yswg@inv-java241011427 # password: Yswg@inv-java256239134
url: jdbc:mysql://rm-wz9m4k931n87m9721oo.mysql.rds.aliyuncs.com:3306/visual?useUnicode=true&characterEncoding=utf8&useSSL=true
username: guokunkun
password: uklssd@sdkAWF++gkk
url: jdbc:mysql://mydb.com:3306/visual_0102?useUnicode=true&characterEncoding=utf8&useSSL=true # url: jdbc:mysql://mydb.com:3306/visual_0102?useUnicode=true&characterEncoding=utf8&useSSL=true
username: root # username: root
password: root # password: root
# url: jdbc:mysql://rm-wz9m4k931n87m9721oo.mysql.rds.aliyuncs.com:3306/visual?useUnicode=true&characterEncoding=utf8&useSSL=true # url: jdbc:mysql://rm-wz9m4k931n87m9721oo.mysql.rds.aliyuncs.com:3306/visual?useUnicode=true&characterEncoding=utf8&useSSL=true
# username: guokunkun # username: guokunkun
......
<?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="cn.kk.spring_simple_operation.mapper.VisualTaskWeightMapper">
</mapper>
...@@ -294,27 +294,34 @@ public class MyTest { ...@@ -294,27 +294,34 @@ public class MyTest {
@Test @Test
public void syncBrandRecordToolLogoData() throws Exception { public void syncBrandRecordToolLogoData() throws Exception {
ExcelUtil<BrandRecordTool> util = new ExcelUtil<>(BrandRecordTool.class); //ExcelUtil<BrandRecordTool> util = new ExcelUtil<>(BrandRecordTool.class);
List<BrandRecordTool> list = util.importExcel(Files.newInputStream(new File("品牌工具logo.xlsx").toPath())); //List<BrandRecordTool> list = util.importExcel(Files.newInputStream(new File("品牌工具logo.xlsx").toPath()));
//
Set<String> setFront = new HashSet<>(); //Set<String> setFront = new HashSet<>();
Set<String> setBack = new HashSet<>(); //Set<String> setBack = new HashSet<>();
list.forEach(t -> { //list.forEach(t -> {
if (setFront.contains(t.getAccount() + "-" + t.getRecordBrand())) { // if (setFront.contains(t.getAccount() + "-" + t.getRecordBrand())) {
log.error("品牌工具logo重复1:{}-{}", t.getAccount(), t.getRecordBrand()); // log.error("品牌工具logo重复1:{}-{}", t.getAccount(), t.getRecordBrand());
} // }
else { // else {
setFront.add(t.getAccount() + "-" + t.getRecordBrand()); // setFront.add(t.getAccount() + "-" + t.getRecordBrand());
} // }
//
if (setBack.contains(t.getEmpowerAccountUk() + "-" + t.getRecordBrand())) { // if (setBack.contains(t.getEmpowerAccountUk() + "-" + t.getRecordBrand())) {
log.error("品牌工具logo重复2:{}-{}", t.getEmpowerAccountUk(), t.getRecordBrand()); // log.error("品牌工具logo重复2:{}-{}", t.getEmpowerAccountUk(), t.getRecordBrand());
} // }
else { // else {
setBack.add(t.getEmpowerAccountUk() + "-" + t.getRecordBrand()); // setBack.add(t.getEmpowerAccountUk() + "-" + t.getRecordBrand());
} // }
//
}); //});
List<BrandRecordTool> list = new LinkedList<>();
BrandRecordTool one = new BrandRecordTool();
one.setAccount("TR");
one.setRecordBrand("Panelee");
one.setEmpowerAccountUk("IO");
list.add(one);
Integer currentTimeSecond = DateUtils.getCurrentTimeSecond(); Integer currentTimeSecond = DateUtils.getCurrentTimeSecond();
List<BrandRecordTool> updateList = new ArrayList<>(); List<BrandRecordTool> updateList = new ArrayList<>();
...@@ -382,7 +389,7 @@ public class MyTest { ...@@ -382,7 +389,7 @@ public class MyTest {
Map<Long, VisualDesignLog> logMap = logList.stream().collect(Collectors.toMap(VisualDesignLog::getRelationId, Function.identity())); Map<Long, VisualDesignLog> logMap = logList.stream().collect(Collectors.toMap(VisualDesignLog::getRelationId, Function.identity()));
try (BufferedWriter writer = new BufferedWriter(new FileWriter("brand_record_tool_logo_data.sql"))) { try (BufferedWriter writer = new BufferedWriter(new FileWriter("brand_record_tool_logo_data_tr.sql"))) {
for (BrandRecordTool brandRecordTool : updateList) { for (BrandRecordTool brandRecordTool : updateList) {
String updateSql = SqlGenerator.generateUpdateSql(brandRecordTool); String updateSql = SqlGenerator.generateUpdateSql(brandRecordTool);
VisualDesignLog visualDesignLog = logMap.get(brandRecordTool.getId()); VisualDesignLog visualDesignLog = logMap.get(brandRecordTool.getId());
......
package cn.kk.spring_simple_operation;
import cn.kk.spring_simple_operation.entity.*;
import cn.kk.spring_simple_operation.mapper.*;
import cn.kk.spring_simple_operation.model.vo.BrandRecordStatisticsVo;
import cn.kk.spring_simple_operation.model.vo.SkuAPlusImageAndVideoVO;
import cn.kk.spring_simple_operation.utils.DateUtils;
import cn.kk.spring_simple_operation.utils.ExcelUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.io.File;
import java.nio.file.Files;
import java.util.*;
import java.util.stream.Collectors;
/**
* @author kk
* @date 2026/4/27
*/
@SpringBootTest
public class MyTest2 {
private static final Logger log = LoggerFactory.getLogger(MyTest2.class);
@Resource
private APlusProductMapper aPlusProductMapper;
@Resource
private VisualCommunicationDesignSecondMapper visualCommunicationDesignSecondMapper;
@Resource
private VideoProductMapper videoProductMapper;
@Resource
private VisualVideoPlanMapper visualVideoPlanMapper;
@Resource
private VisualAPlusPlanMapper visualAPlusPlanMapper;
@Resource
private VisualTaskWeightMapper visualTaskWeightMapper;
@Test
public void dealSimpleAPlusPlanTime() {
ArrayList<String> skuList = Lists.newArrayList("STY0089", "IFS2835", "DF1061", "IF2216", "VEA0926", "BV4469", "STY1329", "TAY0257", "LOO2703", "XEU1036", "LOM0105", "XUL0975", "UR1221", "ISI0782", "LIC9145", "HOD5141", "LEM6389", "DF4494", "WAR1487", "PIR5107", "QUN2115", "ANB2765", "JY1066", "RY3111", "SIG0377", "TEA2739", "XEU1563", "YOG1732", "NEV2980", "IG2159", "FLO3335", "ZHI0065", "MZ2724", "JUU0439", "HOD2404", "DF2869", "MM0881", "DUN3755", "HAI6132", "JYY2734", "GUR0168", "HUM1645", "GUU2335", "QUQ1018", "GUR3956", "CAS3083", "GOR2056", "QUN3648", "XIN2813", "FS2247", "HUI2255", "YUN2250", "XAO3558", "YOF1784", "JIA0971", "GUI0229", "GOO2940");
List<VisualAPlusPlan> visualAPlusPlans = visualAPlusPlanMapper.selectList(Wrappers.<VisualAPlusPlan>lambdaQuery().in(VisualAPlusPlan::getSku, skuList).select(VisualAPlusPlan::getId, VisualAPlusPlan::getSku));
List<String> weightIds = new ArrayList<>();
List<String> planIds = new ArrayList<>();
visualAPlusPlans.forEach(item -> {
VisualTaskWeight weight = visualTaskWeightMapper.selectOne(Wrappers.<VisualTaskWeight>lambdaQuery().eq(VisualTaskWeight::getTaskId, item.getId()).eq(VisualTaskWeight::getTaskType, 1).orderByAsc(VisualTaskWeight::getCreateTime).last("limit 1"));
if (Objects.isNull(weight)) return;
planIds.add(String.valueOf(item.getId()));
weightIds.add(String.valueOf(weight.getId()));
});
log.info("update visual_a_plus_plan set finish_time = 1774101255 where id in ({});", String.join(",", planIds));
log.info("update visual_task_weight set weight = 1.5, task_time = 1774101255 where id in ({});", String.join(",", weightIds));
}
@Test
public void exportSkuImage() throws Exception {
ExcelUtil<SkuAPlusImageAndVideoVO> util = new ExcelUtil<>(SkuAPlusImageAndVideoVO.class);
List<SkuAPlusImageAndVideoVO> list = util.importExcel(Files.newInputStream(new File("21716-珠宝首饰产品前台图片、A+和视频导出(1).xlsx").toPath()));
//list = list.stream().filter(t -> "ST2177".equals(t.getSku())).collect(Collectors.toList());
Lists.partition(list, 1000)
.forEach(ll -> {
List<String> skuList = ll.stream().map(SkuAPlusImageAndVideoVO::getSku).collect(Collectors.toList());
List<APlusProduct> aPlusProducts = aPlusProductMapper.selectList(Wrappers.<APlusProduct>lambdaQuery().in(APlusProduct::getSku, skuList).select(APlusProduct::getSku, APlusProduct::getSite, APlusProduct::getCommunicationDesignId, APlusProduct::getIsUploadBackstage, APlusProduct::getCreateTime));
Set<Long> cIds = aPlusProducts.stream().map(APlusProduct::getCommunicationDesignId).collect(Collectors.toSet());
Map<Long, String> imageMap = visualCommunicationDesignSecondMapper.selectList(Wrappers.<VisualCommunicationDesign>lambdaQuery().in(VisualCommunicationDesign::getId, cIds).select(VisualCommunicationDesign::getId, VisualCommunicationDesign::getFileUrl))
.stream().collect(Collectors.toMap(VisualCommunicationDesign::getId, VisualCommunicationDesign::getFileUrl));
Map<String, List<APlusProduct>> skuSiteAPlusMap = aPlusProducts.stream().collect(Collectors.groupingBy(t -> t.getSku() + "-" + t.getSite()));
for (SkuAPlusImageAndVideoVO dto : ll) {
List<APlusProduct> plusProducts = skuSiteAPlusMap.get(dto.getSku() + "-" + dto.getSite());
if (CollectionUtils.isEmpty(plusProducts)) continue;
plusProducts.sort((o1, o2) -> o2.getCreateTime().compareTo(o1.getCreateTime()));
for (APlusProduct plusProduct : plusProducts) {
String image = imageMap.get(plusProduct.getCommunicationDesignId());
if (!StringUtils.isEmpty(image)) {
dto.setAPlusImage(image);
break;
}
}
}
List<VideoProduct> videoProducts = videoProductMapper.selectList(Wrappers.<VideoProduct>lambdaQuery().in(VideoProduct::getSku, skuList).in(VideoProduct::getOptimizeType, 0, 1).select(VideoProduct::getSku, VideoProduct::getSite, VideoProduct::getVideoPlanId, VideoProduct::getVideoIsUploadBackstage, VideoProduct::getCreateTime));
Set<Long> planIds = videoProducts.stream().map(VideoProduct::getVideoPlanId).collect(Collectors.toSet());
Map<Long, String> videoMap = visualVideoPlanMapper.selectList(Wrappers.<VisualVideoPlan>lambdaQuery().in(VisualVideoPlan::getId, planIds).select(VisualVideoPlan::getId, VisualVideoPlan::getLongVideoUrl))
.stream().collect(Collectors.toMap(VisualVideoPlan::getId, VisualVideoPlan::getLongVideoUrl));
Map<String, List<VideoProduct>> skuSiteVideoMap = videoProducts.stream().collect(Collectors.groupingBy(t -> t.getSku() + "-" + t.getSite()));
for (SkuAPlusImageAndVideoVO dto : ll) {
List<VideoProduct> videoProductList = skuSiteVideoMap.get(dto.getSku() + "-" + dto.getSite());
if (CollectionUtils.isEmpty(videoProductList)) continue;
videoProductList.sort((o1, o2) -> o2.getCreateTime().compareTo(o1.getCreateTime()));
for (VideoProduct videoProduct : videoProductList) {
String video = videoMap.get(videoProduct.getVideoPlanId());
if (!StringUtils.isEmpty(video)) {
dto.setVideoUrl(video);
break;
}
}
}
});
util = new ExcelUtil<SkuAPlusImageAndVideoVO>(SkuAPlusImageAndVideoVO.class);
util.exportExcelFile(list, "21716-珠宝首饰产品前台图片、A+和视频导出-.xlsx");
}
}
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 1, sales_growth = 2949 where id = 200;
update visual_plan_executor_task_record set appraising_num = 4, sales_growth_rank = 2, sales_growth = 3774 where id = 201;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 3, sales_growth = 3378 where id = 202;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 4, sales_growth = 6482 where id = 203;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = -1, sales_growth = 317 where id = 204;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 5, sales_growth = 2699 where id = 205;
update visual_plan_executor_task_record set appraising_num = 3, sales_growth_rank = 6, sales_growth = 3803 where id = 206;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 7, sales_growth = 4837 where id = 207;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 8, sales_growth = 5196 where id = 208;
update visual_plan_executor_task_record set appraising_num = 5, sales_growth_rank = 9, sales_growth = 6975 where id = 209;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 10, sales_growth = 4025 where id = 210;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 11, sales_growth = 3345 where id = 211;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 12, sales_growth = 5416 where id = 212;
update visual_plan_executor_task_record set appraising_num = 7, sales_growth_rank = 13, sales_growth = 14200 where id = 213;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 14, sales_growth = 9640 where id = 214;
update visual_plan_executor_task_record set appraising_num = 5, sales_growth_rank = 15, sales_growth = 7377 where id = 215;
update visual_plan_executor_task_record set appraising_num = 3, sales_growth_rank = 16, sales_growth = 6339 where id = 216;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 17, sales_growth = 2336 where id = 217;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 18, sales_growth = 3294 where id = 218;
update visual_plan_executor_task_record set appraising_num = 4, sales_growth_rank = 19, sales_growth = 8660 where id = 219;
update visual_plan_executor_task_record set appraising_num = 3, sales_growth_rank = 20, sales_growth = 2850 where id = 220;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 21, sales_growth = 2080 where id = 221;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 22, sales_growth = 3454 where id = 222;
update visual_plan_executor_task_record set appraising_num = 3, sales_growth_rank = 23, sales_growth = 11472 where id = 223;
update visual_plan_executor_task_record set appraising_num = 3, sales_growth_rank = 24, sales_growth = 9646 where id = 224;
update visual_plan_executor_task_record set appraising_num = 5, sales_growth_rank = 25, sales_growth = 9334 where id = 225;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 26, sales_growth = 5942 where id = 226;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 27, sales_growth = 3620 where id = 227;
update visual_plan_executor_task_record set appraising_num = 4, sales_growth_rank = 28, sales_growth = 5199 where id = 228;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 29, sales_growth = 3802 where id = 229;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 30, sales_growth = 2918 where id = 230;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 31, sales_growth = 3280 where id = 231;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 32, sales_growth = 4152 where id = 232;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 33, sales_growth = 2196 where id = 233;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 34, sales_growth = 3679 where id = 234;
update visual_plan_executor_task_record set appraising_num = 3, sales_growth_rank = 35, sales_growth = 17219 where id = 235;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 36, sales_growth = 1980 where id = 236;
update visual_plan_executor_task_record set appraising_num = 3, sales_growth_rank = 37, sales_growth = 2540 where id = 237;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = -1, sales_growth = 0 where id = 238;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 38, sales_growth = 2902 where id = 239;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 39, sales_growth = 17849 where id = 240;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 40, sales_growth = 14455 where id = 241;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 41, sales_growth = 3850 where id = 242;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 42, sales_growth = 3697 where id = 243;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 43, sales_growth = 10372 where id = 244;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 44, sales_growth = 17325 where id = 245;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 45, sales_growth = 3739 where id = 246;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 46, sales_growth = 10098 where id = 247;
update visual_plan_executor_task_record set appraising_num = 3, sales_growth_rank = 47, sales_growth = 9855 where id = 248;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 48, sales_growth = 7877 where id = 249;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 49, sales_growth = 6297 where id = 250;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 50, sales_growth = 10346 where id = 251;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = -1, sales_growth = 9856 where id = 252;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 51, sales_growth = 16604 where id = 253;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 52, sales_growth = 9777 where id = 254;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 53, sales_growth = 6622 where id = 255;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 54, sales_growth = 12344 where id = 256;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 55, sales_growth = 5371 where id = 257;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 56, sales_growth = 10411 where id = 258;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 57, sales_growth = 8690 where id = 259;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 58, sales_growth = 16600 where id = 260;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 59, sales_growth = 9674 where id = 261;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 60, sales_growth = 13495 where id = 262;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 61, sales_growth = 13746 where id = 263;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 62, sales_growth = 8039 where id = 264;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 63, sales_growth = 23805 where id = 265;
update visual_plan_executor_task_record set appraising_num = 1, sales_growth_rank = 64, sales_growth = 10919 where id = 266;
update visual_plan_executor_task_record set appraising_num = 3, sales_growth_rank = 65, sales_growth = 4409 where id = 267;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 66, sales_growth = 13404 where id = 268;
update visual_plan_executor_task_record set appraising_num = 0, sales_growth_rank = 67, sales_growth = 2063 where id = 269;
update visual_plan_executor_task_record set appraising_num = 2, sales_growth_rank = 68, sales_growth = 11389 where id = 270;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment