Commit f40fd0cd by kk

刷数据:16319-图案设计数据导出:2. 指定账号+品牌刷brand id 根据附件提供的数据刷brand id字段

parent 4ba9028d
......@@ -18,13 +18,13 @@ import java.util.Collections;
*/
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_USERNAME = "yswg_it_java";
private static final String DB_PASSWORD = "Yswg@inv-java241011427";
//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_PASSWORD = "Yswg@inv-java241011427";
// private static final String DB_URL = "jdbc:mysql://192.168.0.59:3309/visual_0516?useUnicode=true&characterEncoding=utf8&useSSL=true";
// private static final String DB_USERNAME = "root";
// private static final String DB_PASSWORD = "root";
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_PASSWORD = "root";
public static final String DIR = System.getProperty("user.dir");
......@@ -54,7 +54,7 @@ public class CodeGenerator {
.strategyConfig(builder -> {
builder
// 设置需要生成的表名
.addInclude("visual_communication_design")
.addInclude("brand_record_tool")
//entity策略配置
.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 2025-04-01
*/
@RestController
@RequestMapping("/spring_simple_operation/brand-record-tool")
public class BrandRecordToolController {
}
package cn.kk.spring_simple_operation.entity;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
/**
* <p>
* 品牌备案工具
* </p>
*
* @author guokunkun
* @since 2025-04-01
*/
@Getter
@Setter
@Accessors(chain = true)
@TableName("brand_record_tool")
@ApiModel(value = "BrandRecordTool对象", description = "品牌备案工具")
public class BrandRecordTool implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id")
@TableId("id")
private Long id;
@ApiModelProperty("账号")
@TableField("`account`")
private String account;
@ApiModelProperty("账号logo是否完成,0-否,1-是")
@TableField("is_finish_logo")
private Integer isFinishLogo;
@ApiModelProperty("账号LOGO图")
@TableField("account_logo_url")
private String accountLogoUrl;
@ApiModelProperty("是否需设计:0-请选择,1-是,2-否")
@TableField("is_need_design")
private Integer isNeedDesign;
@ApiModelProperty("备案品牌")
@TableField("record_brand")
private String recordBrand;
@ApiModelProperty("UK站点备案情况: 1-自备案,2-被授权,3-备案中,4-备案失败,5-授权失败")
@TableField("record_status_uk")
private Integer recordStatusUk;
@ApiModelProperty("US站点备案情况: 1-自备案,2-被授权,3-备案中,4-备案失败,5-授权失败")
@TableField("record_status_us")
private Integer recordStatusUs;
@ApiModelProperty("US是否可以做A+,0-否,1-是")
@TableField("is_can_a_plus_us")
private Integer isCanAPlusUs;
@ApiModelProperty("UK是否可以做A+,0-否,1-是")
@TableField("is_can_a_plus_uk")
private Integer isCanAPlusUk;
@ApiModelProperty("US是否可以添加视频,0-否,1-是")
@TableField("is_add_video_us")
private Integer isAddVideoUs;
@ApiModelProperty("UK是否可以添加视频,0-否,1-是")
@TableField("is_add_video_uk")
private Integer isAddVideoUk;
@ApiModelProperty("US注册号 ")
@TableField("register_number_us")
private String registerNumberUs;
@ApiModelProperty("UK注册号")
@TableField("register_number_uk")
private String registerNumberUk;
@ApiModelProperty("备注")
@TableField("record_remark")
private String recordRemark;
@ApiModelProperty("创建用户id")
@TableField("create_id")
private Integer createId;
@ApiModelProperty("创建用户")
@TableField("create_name")
private String createName;
@ApiModelProperty("创建时间")
@TableField("create_time")
private Integer createTime;
@ApiModelProperty("是否删除,0-否,1-是")
@TableField("is_delete")
@TableLogic
private Integer isDelete;
@ApiModelProperty("设计编号(原系统未设置值,可考虑去掉)")
@TableField("design_number")
private String designNumber;
@ApiModelProperty("设计人(原系统未设置值,可考虑去掉)")
@TableField("design_name")
private String designName;
@ApiModelProperty("分配设计时间(原系统未设置值,可考虑去掉)")
@TableField("design_time")
private Integer designTime;
@ApiModelProperty("设计上传文档时间")
@TableField("design_upload_file_time")
private Integer designUploadFileTime;
@ApiModelProperty("设计上传文档")
@TableField("design_upload_url")
private String designUploadUrl;
@ApiModelProperty("初审状态,0-待审核,1-审核中,2-通过,3-不通过,")
@TableField("first_audit_status")
private Integer firstAuditStatus;
@ApiModelProperty("初审时间")
@TableField("first_audit_time")
private Integer firstAuditTime;
@ApiModelProperty("初审人员")
@TableField("first_audit_name")
private String firstAuditName;
@ApiModelProperty("初审人员id")
@TableField("first_audit_id")
private Integer firstAuditId;
@ApiModelProperty("初审图片")
@TableField("first_audit_url")
private String firstAuditUrl;
@ApiModelProperty("初审备注")
@TableField("first_audit_remark")
private String firstAuditRemark;
@ApiModelProperty("复审状态,0-待审核,1-审核中,2-通过,3-不通过")
@TableField("second_audit_status")
private Integer secondAuditStatus;
@ApiModelProperty("复审时间")
@TableField("second_audit_time")
private Integer secondAuditTime;
@ApiModelProperty("复审人员id")
@TableField("second_audit_id")
private Integer secondAuditId;
@ApiModelProperty("复审人员")
@TableField("second_audit_name")
private String secondAuditName;
@ApiModelProperty("复审备注")
@TableField("second_audit_remark")
private String secondAuditRemark;
@ApiModelProperty("US品牌权限角色0-Administrator,1-Rights Owner,2-Registered Agent,3-Administrator, Rights Owner,4-Administrator, Registered Agent")
@TableField("us_brand_permission_role")
private Integer usBrandPermissionRole;
@ApiModelProperty("UK品牌权限角色,0-Administrator,1-Rights Owner,2-Registered Agent,3-Administrator, Rights Owner,4-Administrator, Registered Agent")
@TableField("uk_brand_permission_role")
private Integer ukBrandPermissionRole;
@ApiModelProperty("商标类别")
@TableField("trademark_category")
private String trademarkCategory;
@ApiModelProperty("设计申请原因:1-新账号品牌备案,2-解除上新报错,3-公共开发者官网域名logo设计,4-品牌申诉,5-其他(需备注具体原因)")
@TableField("design_reason")
private Integer designReason;
@ApiModelProperty("设计紧急程度,可填 1 2 3")
@TableField("design_urgency")
private Integer designUrgency;
@ApiModelProperty("设计申请备注")
@TableField("design_remark")
private String designRemark;
@ApiModelProperty("官网文档编辑id")
@TableField("official_document_editor_id")
private Long officialDocumentEditorId;
@ApiModelProperty("官网文档url")
@TableField("official_document_url")
private String officialDocumentUrl;
@ApiModelProperty("官网文档申请原因:1-新账号品牌备案,2-解除上新报错,3-品牌申诉,4-申请汽配类权限,5-其他(需备注具体原因)")
@TableField("official_document_reason")
private Integer officialDocumentReason;
@ApiModelProperty("官网文档紧急程度,可填 1 2 3")
@TableField("official_document_urgency")
private Integer officialDocumentUrgency;
@ApiModelProperty("官网文档申请备注")
@TableField("official_document_remark")
private String officialDocumentRemark;
@ApiModelProperty("官网做任务次数(优化的时候取)")
@TableField("official_times")
private Integer officialTimes;
@ApiModelProperty("官网文档压缩包")
@TableField("official_document_zip")
private String officialDocumentZip;
@ApiModelProperty("传达设计的id,为了让跟随安审通过的也能查到日志")
@TableField("communication_id")
private Long communicationId;
@ApiModelProperty("商标类别备注")
@TableField("trademark_category_remark")
private String trademarkCategoryRemark;
@ApiModelProperty("官网设计师编号")
@TableField("official_designer_number")
private String officialDesignerNumber;
@ApiModelProperty("官网设计师名称")
@TableField("official_designer_name")
private String officialDesignerName;
@ApiModelProperty("官网设计状态")
@TableField("official_designer_status")
private Integer officialDesignerStatus;
@ApiModelProperty("官网设计完成时间")
@TableField("official_designer_finish_time")
private Integer officialDesignerFinishTime;
@ApiModelProperty("logo压缩包链接")
@TableField("logo_zip_url")
private String logoZipUrl;
@ApiModelProperty("US后台状态: 1-正常,2-已撤销,3-已丢失,4-已恢复")
@TableField("backstage_status_us")
private Integer backstageStatusUs;
@ApiModelProperty("UK后台状态: 1-正常,2-已撤销,3-已丢失,4-已恢复")
@TableField("backstage_status_uk")
private Integer backstageStatusUk;
@ApiModelProperty("US广告系统是否有抓取:0-否,1-是")
@TableField("capture_advertisements_us")
private Integer captureAdvertisementsUs;
@ApiModelProperty("UK广告系统是否有抓取:0-否,1-是")
@TableField("capture_advertisements_uk")
private Integer captureAdvertisementsUk;
@ApiModelProperty("US序列号")
@TableField("serial_number_us")
private String serialNumberUs;
@ApiModelProperty("brand id")
@TableField("brand_id")
private String brandId;
@ApiModelProperty("US被授权账号")
@TableField("empower_account_us")
private String empowerAccountUs;
@ApiModelProperty("UK被授权账号")
@TableField("empower_account_uk")
private String empowerAccountUk;
@ApiModelProperty("传达设计官网任务的id,共享官网任务")
@TableField("communication_official_id")
private Long communicationOfficialId;
@ApiModelProperty("旗舰店项目文档编辑id")
@TableField("flagship_project_editor_id")
private Long flagshipProjectEditorId;
@ApiModelProperty("旗舰店项目文档url")
@TableField("flagship_project_url")
private String flagshipProjectUrl;
@ApiModelProperty("旗舰店网址")
@TableField("flagship_project_website")
private String flagshipProjectWebsite;
@ApiModelProperty("旗舰店项目申请原因:1-新账号品牌备案,2-解除上新报错,3-品牌申诉,4-申请汽配类权限,5-其他(需备注具体原因)")
@TableField("flagship_project_reason")
private Integer flagshipProjectReason;
@ApiModelProperty("旗舰店项目紧急程度:可填 1 2 3")
@TableField("flagship_project_urgency")
private Integer flagshipProjectUrgency;
@ApiModelProperty("旗舰店项目申请备注")
@TableField("flagship_project_remark")
private String flagshipProjectRemark;
@ApiModelProperty("旗舰店做任务次数(优化的时候取)")
@TableField("flagship_times")
private Integer flagshipTimes;
@ApiModelProperty("旗舰店压缩包")
@TableField("flagship_project_zip")
private String flagshipProjectZip;
@ApiModelProperty("传达设计旗舰店项目的id,共享官网任务")
@TableField("communication_flagship_id")
private Long communicationFlagshipId;
@ApiModelProperty("旗舰店项目设计师编号")
@TableField("flagship_designer_number")
private String flagshipDesignerNumber;
@ApiModelProperty("旗舰店项目设计师名称")
@TableField("flagship_designer_name")
private String flagshipDesignerName;
@ApiModelProperty("旗舰店项目设计状态")
@TableField("flagship_designer_status")
private Integer flagshipDesignerStatus;
@ApiModelProperty("旗舰店项目设计完成时间")
@TableField("flagship_designer_finish_time")
private Integer flagshipDesignerFinishTime;
@ApiModelProperty("筹备组申请人")
@TableField("copyright_applicant")
private String copyrightApplicant;
@ApiModelProperty("筹备组申请人id")
@TableField("copyright_applicant_id")
private Long copyrightApplicantId;
@ApiModelProperty("申请版权状态:0=未申请,1=申请中,2=申请成功,3=申请失败,4=重复")
@TableField("copyright_applicant_status")
private Integer copyrightApplicantStatus;
@ApiModelProperty("申请版权时间")
@TableField("copyright_applicant_time")
private Integer copyrightApplicantTime;
@ApiModelProperty("版权完成时间")
@TableField("copyright_applicant_finish_time")
private Integer copyrightApplicantFinishTime;
@ApiModelProperty("版权号")
@TableField("copyright_number")
private String copyrightNumber;
@ApiModelProperty("版权证书")
@TableField("copyright_certificate")
private String copyrightCertificate;
@ApiModelProperty("申请公司")
@TableField("apply_company")
private String applyCompany;
@ApiModelProperty("官网同步账号")
@TableField("official_sync_account")
private String officialSyncAccount;
@ApiModelProperty("旗舰店同步账号")
@TableField("flagship_sync_account")
private String flagshipSyncAccount;
@ApiModelProperty("US销售授权账号")
@TableField("sale_account_us")
private String saleAccountUs;
@ApiModelProperty("US销售角色:0=请选择,1=Brand Representative,2=Reseller")
@TableField("sale_role_us")
private Integer saleRoleUs;
@ApiModelProperty("UK销售授权账号")
@TableField("sale_account_uk")
private String saleAccountUk;
@ApiModelProperty("UK销售角色:0=请选择,1=Brand Representative,2=Reseller")
@TableField("sale_role_uk")
private Integer saleRoleUk;
@ApiModelProperty("版权名称")
@TableField("copyright_name")
private String copyrightName;
@ApiModelProperty("US品牌丢失时间")
@TableField("backstage_status_us_loss_time")
private Integer backstageStatusUsLossTime;
@ApiModelProperty("US品牌恢复时间")
@TableField("backstage_status_us_restore_time")
private Integer backstageStatusUsRestoreTime;
@ApiModelProperty("Uk品牌丢失时间")
@TableField("backstage_status_uk_loss_time")
private Integer backstageStatusUkLossTime;
@ApiModelProperty("Uk品牌恢复时间")
@TableField("backstage_status_uk_restore_time")
private Integer backstageStatusUkRestoreTime;
@ApiModelProperty("UK序列号")
@TableField("serial_number_uk")
private String serialNumberUk;
@ApiModelProperty("US是否可以做高级A+,0-否,1-是")
@TableField("is_can_a_plus_senior_us")
private Integer isCanAPlusSeniorUs;
@ApiModelProperty("UK是否可以做高级A+,0-否,1-是")
@TableField("is_can_a_plus_senior_uk")
private Integer isCanAPlusSeniorUk;
}
package cn.kk.spring_simple_operation.mapper;
import cn.kk.spring_simple_operation.entity.BrandRecordTool;
import cn.kk.spring_simple_operation.model.dto.BrandAccountDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* 品牌备案工具 Mapper 接口
* </p>
*
* @author guokunkun
* @since 2025-04-01
*/
@Mapper
public interface BrandRecordToolMapper extends BaseMapper<BrandRecordTool> {
List<BrandRecordTool> getByBrandAndAccount(@Param("list") List<BrandAccountDto> list);
}
package cn.kk.spring_simple_operation.model.dto;
import cn.kk.spring_simple_operation.utils.Excel;
import lombok.Data;
/**
* @author kk
* @date 2025/4/1
*/
@Data
public class BrandAccountDto {
@Excel(name = "备案品牌")
private String brand;
@Excel(name = "账号")
private String account;
@Excel(name = "brand id")
private String brandId;
}
package cn.kk.spring_simple_operation.service;
import cn.kk.spring_simple_operation.entity.BrandRecordTool;
import cn.kk.spring_simple_operation.model.dto.BrandAccountDto;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* <p>
* 品牌备案工具 服务类
* </p>
*
* @author guokunkun
* @since 2025-04-01
*/
public interface BrandRecordToolService extends IService<BrandRecordTool> {
void updateBrandId(List<BrandAccountDto> list);
}
package cn.kk.spring_simple_operation.service.impl;
import cn.kk.spring_simple_operation.entity.BrandRecordTool;
import cn.kk.spring_simple_operation.mapper.BrandRecordToolMapper;
import cn.kk.spring_simple_operation.model.dto.BrandAccountDto;
import cn.kk.spring_simple_operation.service.BrandRecordToolService;
import cn.kk.spring_simple_operation.service.VisualDesignLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* <p>
* 品牌备案工具 服务实现类
* </p>
*
* @author guokunkun
* @since 2025-04-01
*/
@Service
public class BrandRecordToolServiceImpl extends ServiceImpl<BrandRecordToolMapper, BrandRecordTool> implements BrandRecordToolService {
@Resource
private VisualDesignLogService visualDesignLogService;
@Override
public void updateBrandId(List<BrandAccountDto> list) {
List<BrandRecordTool> recordTools = baseMapper.getByBrandAndAccount(list);
Map<String, BrandRecordTool> recordToolMap = recordTools.stream().collect(Collectors.toMap(t -> t.getAccount() + "-" + t.getRecordBrand(), Function.identity(), (a, b) -> b));
AtomicInteger count = new AtomicInteger(0);
list.forEach(dto -> {
BrandRecordTool brandRecordTool = recordToolMap.get(dto.getAccount() + "-" + dto.getBrand());
if (Objects.isNull(brandRecordTool) || StringUtils.isBlank(dto.getBrandId())) return;
if (dto.getBrandId().equals(brandRecordTool.getBrandId())) return;
visualDesignLogService.addLog("brand_record_tool", String.format("brand id 由 [%s] 更新为 [%s] (刷数据)", brandRecordTool.getBrandId(), dto.getBrandId()), brandRecordTool.getId());
brandRecordTool.setBrandId(dto.getBrandId());
this.updateById(brandRecordTool);
count.incrementAndGet();
});
System.out.printf("更新 %d 条品牌备案工具的品牌 ID%n", count.get());
}
}
<?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.BrandRecordToolMapper">
<select id="getByBrandAndAccount" resultType="cn.kk.spring_simple_operation.entity.BrandRecordTool">
select id, account, record_brand, brand_id
from brand_record_tool
where is_delete = 0
and ( account, record_brand) in
<foreach collection="list" item="item" open="(" separator="," close=")">
(#{item.account}, #{item.brand})
</foreach>
</select>
</mapper>
package cn.kk.spring_simple_operation;
import cn.kk.spring_simple_operation.mapper.VisualVideoPlanMapper;
import cn.kk.spring_simple_operation.model.dto.BrandAccountDto;
import cn.kk.spring_simple_operation.model.dto.SkuPeopleNameDto;
import cn.kk.spring_simple_operation.model.dto.SkuSiteDTO;
import cn.kk.spring_simple_operation.service.*;
import cn.kk.spring_simple_operation.utils.ExcelUtil;
import org.junit.jupiter.api.Test;
......@@ -10,11 +9,7 @@ import org.springframework.boot.test.context.SpringBootTest;
import javax.annotation.Resource;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.Files;
import java.util.LinkedList;
import java.util.List;
/**
......@@ -36,30 +31,42 @@ public class ApplicationTest {
@Resource
private APlusProductService aPlusProductService;
@Resource
private BrandRecordToolService brandRecordToolService;
@Test
void contextLoads() throws Exception {
//visualPhotographerAPlusService.brushDataForExecutor();
//setUploadStatusIsDeleted();
setAPlusProductUploadInfo();
}
//setAPlusProductUploadInfo();
private void setUploadStatusIsDeleted() throws Exception {
File file = new File("已删除页面直接调整视频状态.xlsx");
ExcelUtil<SkuSiteDTO> util = new ExcelUtil<SkuSiteDTO>(SkuSiteDTO.class);
List<SkuSiteDTO> list = util.importExcel("精细视频", Files.newInputStream(file.toPath()));
videoProductService.setUploadStatusIsDeleted(list);
list = util.importExcel("简易视频", Files.newInputStream(file.toPath()));
photoProgressService.setUploadStatusIsDeleted(list);
updateBrandId();
}
private void setAPlusProductUploadInfo() throws Exception {
File file = new File("简版A+ AB测试.xlsx");
ExcelUtil<SkuPeopleNameDto> util = new ExcelUtil<>(SkuPeopleNameDto.class);
List<SkuPeopleNameDto> list = util.importExcel(Files.newInputStream(file.toPath()));
aPlusProductService.setAPlusProductUploadInfo(list);
}
//private void setUploadStatusIsDeleted() throws Exception {
// File file = new File("已删除页面直接调整视频状态.xlsx");
// ExcelUtil<SkuSiteDTO> util = new ExcelUtil<SkuSiteDTO>(SkuSiteDTO.class);
// List<SkuSiteDTO> list = util.importExcel("精细视频", Files.newInputStream(file.toPath()));
// videoProductService.setUploadStatusIsDeleted(list);
// list = util.importExcel("简易视频", Files.newInputStream(file.toPath()));
// photoProgressService.setUploadStatusIsDeleted(list);
//}
//private void setAPlusProductUploadInfo() throws Exception {
// File file = new File("简版A+ AB测试.xlsx");
// ExcelUtil<SkuPeopleNameDto> util = new ExcelUtil<>(SkuPeopleNameDto.class);
// List<SkuPeopleNameDto> list = util.importExcel(Files.newInputStream(file.toPath()));
// aPlusProductService.setAPlusProductUploadInfo(list);
//}
private void updateBrandId() throws Exception {
File file = new File("2025-04-01_vpq0_品牌Brand ID核对.xlsx");
ExcelUtil<BrandAccountDto> util = new ExcelUtil<>(BrandAccountDto.class);
List<BrandAccountDto> list = util.importExcel(Files.newInputStream(file.toPath()));
brandRecordToolService.updateBrandId(list);
}
}
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