Commit 338bafcd by kk

初始化

parents
HELP.md
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
.mvn/
mvnw
mvnw.cmd
.mvn/wrapper/maven-wrapper.jar
.gitattributes
### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/
!**/src/main/**/build/
!**/src/test/**/build/
### VS Code ###
.vscode/
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.12.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>cn.kk</groupId>
<artifactId>spring-simple-operation</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>spring-simple-operation</name>
<description>spring-simple-operation</description>
<url/>
<properties>
<java.version>8</java.version>
<mp.version>3.5.1</mp.version>
<freemarker.version>2.3.31</freemarker.version>
<mysql.connect.version>8.0.32</mysql.connect.version>
<druid-version>1.2.8</druid-version>
<fastjson.version>1.2.22</fastjson.version>
<lombok.version>1.18.30</lombok.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
<version>${mp.version}</version>
</dependency>
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>${mp.version}</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>${freemarker.version}</version>
</dependency>
<dependency>
<groupId>com.mysql</groupId>
<artifactId>mysql-connector-j</artifactId>
<version>${mysql.connect.version}</version>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.1.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>${mysql.connect.version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>${druid-version}</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>${fastjson.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
package cn.kk.spring_simple_operation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.config.converts.SelfMySqlTypeConvert;
import com.baomidou.mybatisplus.generator.config.querys.MySqlQuery;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;
import com.baomidou.mybatisplus.generator.keywords.MySqlKeyWordsHandler;
import java.util.Collections;
/**
* @author guokunkun
* @date 2023/4/24
*/
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://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";
public static final String DIR = System.getProperty("user.dir");
private static DataSourceConfig.Builder getDataConfigBuilder() {
return new DataSourceConfig.Builder(DB_URL, DB_USERNAME, DB_PASSWORD).
dbQuery(new MySqlQuery()).
keyWordsHandler(new MySqlKeyWordsHandler()).
schema("Mybatis-Plus").
typeConvert(new SelfMySqlTypeConvert());
}
public static void generate() {
FastAutoGenerator.create(getDataConfigBuilder())
.globalConfig(builder -> {
builder.author("guokunkun") // 设置作者
.enableSwagger() // 开启 swagger 模式
.fileOverride() // 覆盖已经存在的文件
.outputDir(DIR + "/src/main/java") // 指定输出目录
.disableOpenDir(); //禁止打开输出目录
})
.packageConfig(builder -> {
builder.parent("cn.kk") // 设置父包名
.moduleName("spring_simple_operation") // 设置父包模块名
.pathInfo(Collections.singletonMap(OutputFile.mapperXml, DIR + "/src/main/resources/mapper")); // 设置mapperXml生成路径
})
// 策略配置
.strategyConfig(builder -> {
builder
// 设置需要生成的表名
.addInclude("photo_progress", "photo_progress_person", "video_product", "visual_video_plan", "sync_product_publish", "sync_solar_term_info")
//entity策略配置
.entityBuilder()
.enableLombok()
.logicDeleteColumnName("is_delete") //设置逻辑删除字段名
.enableTableFieldAnnotation() // 开启字段注解:@TableField("return_sample_way")
.enableChainModel() //开启链式模型
// mapper 配置
.mapperBuilder()
.superClass(BaseMapper.class) // 设置父类
.formatMapperFileName("%sMapper") // 格式化mapper文件名称
.enableMapperAnnotation() //开启 @Mapper注解
.formatXmlFileName("%sMapper") // 格式化Xml文件名称
// service 配置
.serviceBuilder()
.formatServiceFileName("%sService") //格式化service名称:UserService
.formatServiceImplFileName("%sServiceImpl") //
// controller 配置
.controllerBuilder()
.formatFileName("%sController") // 格式化controller名称
.enableRestStyle(); // 开启生成 @RestController 控制器
})
.templateEngine(new FreemarkerTemplateEngine()) // 使用Freemarker引擎模板,默认的是Velocity引擎模板
.execute();
}
public static void main(String[] args) {
generate();
}
}
package cn.kk.spring_simple_operation;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@MapperScan("cn.kk.spring_simple_operation.mapper")
@SpringBootApplication
public class SpringSimpleOperationApplication {
public static void main(String[] args) {
SpringApplication.run(SpringSimpleOperationApplication.class, args);
}
}
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 2024-12-25
*/
@RestController
@RequestMapping("/spring_simple_operation/photo-progress")
public class PhotoProgressController {
}
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 2024-12-25
*/
@RestController
@RequestMapping("/spring_simple_operation/photo-progress-person")
public class PhotoProgressPersonController {
}
package cn.kk.spring_simple_operation.controller;
import cn.kk.spring_simple_operation.entity.SyncProductPublish;
import cn.kk.spring_simple_operation.mapper.SyncProductPublishMapper;
import cn.kk.spring_simple_operation.mapper.VideoProductMapper;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
* <p>
* sku销量详情 前端控制器
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@RestController
@RequestMapping("/productPublish")
public class SyncProductPublishController {
private static final BigDecimal TWENTY = new BigDecimal("20");
private static final BigDecimal FORTY = new BigDecimal("40");
@Resource
private SyncProductPublishMapper syncProductPublishMapper;
@Resource
private VideoProductMapper videoProductMapper;
@RequestMapping("/syncProductPublish")
public String syncProductPublish() {
Map<String, Integer> salesMap = new HashMap<>();
salesMap.put("<20", 0);
salesMap.put("20~40", 0);
salesMap.put(">40", 0);
Set<String> haveSkuSet = new HashSet<>();
// 母体sku
List<SyncProductPublish> syncProductPublishes = syncProductPublishMapper.selectMotherSku();
syncProductPublishes.forEach(item -> {
List<SyncProductPublish> subList = syncProductPublishMapper.selectList(Wrappers.<SyncProductPublish>lambdaQuery().eq(SyncProductPublish::getParentAsin, item.getRelationKey()).select(SyncProductPublish::getSku, SyncProductPublish::getThirtyDaySales));
subList.add(item);
String s = checkPriceAndSales(subList, item.getLowestPrice());
if (StringUtils.isBlank(s)) {
return;
}
salesMap.put(s, salesMap.get(s) + 1);
haveSkuSet.addAll(subList.stream().map(SyncProductPublish::getSku).collect(Collectors.toList()));
});
System.out.println(JSONObject.toJSONString(salesMap));
return JSONObject.toJSONString(salesMap);
}
private String checkPriceAndSales(List<SyncProductPublish> subList, BigDecimal lowestPrice) {
if (CollectionUtils.isEmpty(subList) || lowestPrice.compareTo(BigDecimal.ZERO) < 0) {
return null;
}
int sum = subList.stream().map(SyncProductPublish::getThirtyDaySales).reduce(Integer::sum).get();
if (lowestPrice.compareTo(TWENTY) <= 0 && sum >= 100) {
return "<20";
}
else if (lowestPrice.compareTo(TWENTY) > 0 && lowestPrice.compareTo(FORTY) <= 0 && sum >= 80) {
return "20~40";
}
else if (lowestPrice.compareTo(FORTY) > 0 && sum >= 50) {
return ">40";
}
return null;
}
}
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 2024-12-25
*/
@RestController
@RequestMapping("/spring_simple_operation/sync-solar-term-info")
public class SyncSolarTermInfoController {
}
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 2024-12-25
*/
@RestController
@RequestMapping("/spring_simple_operation/video-product")
public class VideoProductController {
}
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 2024-12-25
*/
@RestController
@RequestMapping("/spring_simple_operation/visual-video-plan")
public class VisualVideoPlanController {
}
package cn.kk.spring_simple_operation.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
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 2024-12-25
*/
@Getter
@Setter
@Accessors(chain = true)
@TableName("photo_progress")
@ApiModel(value = "PhotoProgress对象", description = "图片协同系统")
public class PhotoProgress implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键id")
@TableId("id")
private Long id;
@ApiModelProperty("审核产品id")
@TableField("product_id")
private Integer productId;
@TableField("sku")
private String sku;
@ApiModelProperty("创建时间")
@TableField("create_at")
private Integer createAt;
@ApiModelProperty("更新时间")
@TableField("update_at")
private Integer updateAt;
@ApiModelProperty("0-未发送,1-已发送,默认未发送")
@TableField("is_send")
private Integer isSend;
@ApiModelProperty("1-新产品,2-老产品优化。默认1")
@TableField("pic_product_type")
private Integer picProductType;
@ApiModelProperty("加急申请,0未加急,1-加急,默认加急")
@TableField("is_urgent")
private Integer isUrgent;
@ApiModelProperty("加急申请通过状态,1-加急通过,0加急未通过,默认0")
@TableField("urgent_is_pass")
private Integer urgentIsPass;
@ApiModelProperty("文档上传时间")
@TableField("upload_time")
private Integer uploadTime;
@ApiModelProperty("样品状态,0-未接,1-已接。")
@TableField("sample_status")
private Integer sampleStatus;
@ApiModelProperty("加急申请理由")
@TableField("urgent_reason")
private String urgentReason;
@ApiModelProperty("加急申请发送,0-未发送,1-已发送, ")
@TableField("is_send_urgent")
private Integer isSendUrgent;
@ApiModelProperty("审批内容")
@TableField("audit_content")
private String auditContent;
@ApiModelProperty("文档是否上传,0-未上传,1-已上传")
@TableField("is_upload_doc")
private Integer isUploadDoc;
@ApiModelProperty("文档")
@TableField("project_file")
private String projectFile;
@ApiModelProperty("销售上传的文档")
@TableField("project_sale_file")
private String projectSaleFile;
@ApiModelProperty("销售上传的文档审核状态:0-销售未传图需,1-等待开发审核,2-审核通过,3-审核不通过")
@TableField("project_sale_file_status")
private Integer projectSaleFileStatus;
@ApiModelProperty("销售上传的文档审核时间")
@TableField("project_sale_file_audit_time")
private Integer projectSaleFileAuditTime;
@ApiModelProperty("销售上传的文档审核不通过的原因")
@TableField("project_sale_file_reason")
private String projectSaleFileReason;
@ApiModelProperty("文档是否下载,0-未下载,1-已下载")
@TableField("is_download_doc")
private Integer isDownloadDoc;
@ApiModelProperty("文档下载时间")
@TableField("download_time")
private Integer downloadTime;
@ApiModelProperty("开发发送图片给摄影的时间")
@TableField("pic_send_time")
private Integer picSendTime;
@ApiModelProperty(" 样品接收时间")
@TableField("recieve_time")
private Integer recieveTime;
@ApiModelProperty("申请修改平面的理由")
@TableField("apply_modify_plane_reason")
private String applyModifyPlaneReason;
@ApiModelProperty("平面申请审核内容")
@TableField("plane_audit_content")
private String planeAuditContent;
@ApiModelProperty("0默认,1通过,2未通过")
@TableField("plane_is_pass")
private Integer planeIsPass;
@ApiModelProperty("是否申请修改平面设计,1是,0否")
@TableField("is_apply_modify_plane")
private Integer isApplyModifyPlane;
@ApiModelProperty("文件名")
@TableField("file_name")
private String fileName;
@ApiModelProperty("开售时间")
@TableField("sale_time")
private Integer saleTime;
@ApiModelProperty("重拍次数")
@TableField("re_take_times")
private Integer reTakeTimes;
@ApiModelProperty("发货时间")
@TableField("shipment_time")
private Integer shipmentTime;
@ApiModelProperty("入正品仓时间")
@TableField("stock_in_time")
private Integer stockInTime;
@ApiModelProperty("质检时间")
@TableField("check_time")
private Integer checkTime;
@ApiModelProperty("验收时间")
@TableField("accept_time")
private Integer acceptTime;
@ApiModelProperty("采购时间")
@TableField("purchase_time")
private Integer purchaseTime;
@ApiModelProperty("重拍备注")
@TableField("re_take_remark")
private String reTakeRemark;
@ApiModelProperty("重拍时间")
@TableField("re_take_at")
private Integer reTakeAt;
@ApiModelProperty("上传文档备注")
@TableField("doc_remark")
private String docRemark;
@ApiModelProperty("asin")
@TableField("asin")
private String asin;
@ApiModelProperty("关键词")
@TableField("keywords")
private String keywords;
@ApiModelProperty("链接")
@TableField("reference_link")
private String referenceLink;
@ApiModelProperty("1-已提交 0-未提交")
@TableField("is_submit_visual")
private Integer isSubmitVisual;
@ApiModelProperty("提交时间")
@TableField("submit_visual_time")
private Integer submitVisualTime;
@ApiModelProperty("1-已保存草稿 0-未保存")
@TableField("is_save_draft")
private Integer isSaveDraft;
@ApiModelProperty("保存草稿时间")
@TableField("save_draft_time")
private Integer saveDraftTime;
@ApiModelProperty("风险检测")
@TableField("risk_detection")
private String riskDetection;
@TableField("ctr")
private BigDecimal ctr;
@ApiModelProperty("简易视频上传状态-0为未上传,1为已上传,2-其他,3-暂未上传 5-已删除")
@TableField("simple_video_upload_status")
private Integer simpleVideoUploadStatus;
@ApiModelProperty("简易视频上传时间")
@TableField("simple_video_upload_time")
private Integer simpleVideoUploadTime;
@ApiModelProperty("简易视频备注")
@TableField("simple_video_remark")
private String simpleVideoRemark;
@ApiModelProperty("是否创建SBV")
@TableField("is_create_sbv")
private Integer isCreateSbv;
@ApiModelProperty("未创建sbv备注")
@TableField("sbv_remark")
private String sbvRemark;
@ApiModelProperty("备注类型枚举")
@TableField("sbv_remark_type")
private Integer sbvRemarkType;
@ApiModelProperty("前台是否有视频")
@TableField("is_video_in_amazon")
private Integer isVideoInAmazon;
@ApiModelProperty("发货方式0默认空,1空运,2海运,3空运和海运")
@TableField("transport_mode")
private Integer transportMode;
@ApiModelProperty("是否需要拍图 (0-否,1-是,2-请选择)")
@TableField("is_photo")
private Integer isPhoto;
@ApiModelProperty("简易视频地址")
@TableField("simple_video_url")
private String simpleVideoUrl;
@ApiModelProperty("同步sku")
@TableField("sync_sku")
private String syncSku;
@ApiModelProperty("图片开发备注")
@TableField("photo_dev_remark")
private String photoDevRemark;
@ApiModelProperty("是否上传后台备注")
@TableField("upload_remark")
private String uploadRemark;
@ApiModelProperty("简易视频上传人")
@TableField("simple_video_upload_name")
private String simpleVideoUploadName;
@ApiModelProperty("首次接收时间")
@TableField("first_receive_time")
private Integer firstReceiveTime;
}
package cn.kk.spring_simple_operation.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
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 2024-12-25
*/
@Getter
@Setter
@Accessors(chain = true)
@TableName("photo_progress_person")
@ApiModel(value = "PhotoProgressPerson对象", description = "")
public class PhotoProgressPerson implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("主键id(photo_progress主键id)")
@TableId("id")
private Long id;
@ApiModelProperty("审核产品id")
@TableField("product_id")
private Integer productId;
@ApiModelProperty("创建时间")
@TableField("create_at")
private Integer createAt;
@ApiModelProperty("平面设计1名字")
@TableField("plane_design_1_name")
private String planeDesign1Name;
@ApiModelProperty("平面设计1编号")
@TableField("plane_design_1_num")
private String planeDesign1Num;
@ApiModelProperty("平面设计1完成时间")
@TableField("plane_design_1_time")
private Integer planeDesign1Time;
@ApiModelProperty("平面设计2名字")
@TableField("plane_design_2_name")
private String planeDesign2Name;
@ApiModelProperty("平面设计2编号")
@TableField("plane_design_2_num")
private String planeDesign2Num;
@ApiModelProperty("平面设计2完成时间")
@TableField("plane_design_2_time")
private Integer planeDesign2Time;
@ApiModelProperty("摄影完成状态,0- 未完成,1-进行中,2-完成,默认未完成")
@TableField("photo_progress")
private Integer photoProgress;
@ApiModelProperty("摄影人员名字")
@TableField("photographer_name")
private String photographerName;
@ApiModelProperty("摄影人员编号")
@TableField("photographer_num")
private String photographerNum;
@ApiModelProperty("摄影完成时间")
@TableField("photo_finish_time")
private Integer photoFinishTime;
@ApiModelProperty("平面设计1完成状态,0- 未完成,1-进行中,2-完成,默认未完成")
@TableField("plane_design_1_progress")
private Integer planeDesign1Progress;
@ApiModelProperty("平面设计2完成状态,0- 未完成,1-进行中,2-完成,默认未完成")
@TableField("plane_design_2_progress")
private Integer planeDesign2Progress;
@ApiModelProperty("交接前最初的平面设计1名字")
@TableField("original_plane_design_1_name")
private String originalPlaneDesign1Name;
@ApiModelProperty("交接前最初的平面设计1编号")
@TableField("original_plane_design_1_num")
private String originalPlaneDesign1Num;
@ApiModelProperty("交接前最初的平面设计2名字")
@TableField("original_plane_design_2_name")
private String originalPlaneDesign2Name;
@ApiModelProperty("交接前最初的平面设计1编号")
@TableField("original_plane_design_2_num")
private String originalPlaneDesign2Num;
@ApiModelProperty("简易视频摄影名字")
@TableField("simple_video_photographer_name")
private String simpleVideoPhotographerName;
@ApiModelProperty("简易视频摄影编号")
@TableField("simple_video_photographer_num")
private String simpleVideoPhotographerNum;
@ApiModelProperty("简易视频摄影状态-0为未完成,1为进行中,2为已完成,3为不需要处理")
@TableField("simple_video_status")
private Integer simpleVideoStatus;
@ApiModelProperty("简易视频完成时间")
@TableField("simple_video_complete_time")
private Integer simpleVideoCompleteTime;
@ApiModelProperty("摄影完成是否推送开发消息,0否1是")
@TableField("is_push_dev")
private Integer isPushDev;
@ApiModelProperty("是否上传后台备注")
@TableField("plane_design_1_remark")
private String planeDesign1Remark;
@ApiModelProperty("视频是否侵权:0-否,1-是")
@TableField("video_is_tort")
private Integer videoIsTort;
@ApiModelProperty("视频侵权意见")
@TableField("video_tort_reason")
private String videoTortReason;
}
package cn.kk.spring_simple_operation.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
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 2024-12-25
*/
@Getter
@Setter
@Accessors(chain = true)
@TableName("sync_solar_term_info")
@ApiModel(value = "SyncSolarTermInfo对象", description = "")
public class SyncSolarTermInfo implements Serializable {
private static final long serialVersionUID = 1L;
@TableId("id")
private Long id;
@ApiModelProperty("节气ID")
@TableField("solar_term_id")
private Integer solarTermId;
@ApiModelProperty("节气名")
@TableField("solar_term_name")
private String solarTermName;
@ApiModelProperty("开始时间")
@TableField("start_time")
private Integer startTime;
@ApiModelProperty("结束时间")
@TableField("end_time")
private Integer endTime;
@ApiModelProperty("是否已经过了热卖期 是:否")
@TableField("is_end")
private Integer isEnd;
@ApiModelProperty("季度")
@TableField("`quarter`")
private String quarter;
@ApiModelProperty("月份")
@TableField("`month`")
private Integer month;
}
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 2024-12-25
*/
@Getter
@Setter
@Accessors(chain = true)
@TableName("video_product")
@ApiModel(value = "VideoProduct对象", description = "视频产品")
public class VideoProduct implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id")
@TableId("id")
private Long id;
@ApiModelProperty("站点")
@TableField("site")
private String site;
@ApiModelProperty("sku")
@TableField("sku")
private String sku;
@ApiModelProperty("关联sku")
@TableField("relation_sku")
private String relationSku;
@ApiModelProperty("关联sku站点")
@TableField("relation_sku_site")
private String relationSkuSite;
@ApiModelProperty("添加时备注")
@TableField("add_remark")
private String addRemark;
@ApiModelProperty("视频等级")
@TableField("video_level")
private String videoLevel;
@ApiModelProperty("是否共享视频,0-否,1-是")
@TableField("is_share_video")
private Integer isShareVideo;
@ApiModelProperty("视频上传后台状态,0-默认值,1-未完成,2-完成,3-不需要处理")
@TableField("video_is_upload_backstage")
private Integer videoIsUploadBackstage;
@ApiModelProperty("视频上传备注")
@TableField("video_upload_remark")
private String videoUploadRemark;
@ApiModelProperty("开发视频审核状态,0-待审核,1-通过,2-不通过")
@TableField("video_audit_status")
private Integer videoAuditStatus;
@ApiModelProperty("开发视频审核备注")
@TableField("video_audit_remark")
private String videoAuditRemark;
@ApiModelProperty("开发视频审核文件url")
@TableField("video_audit_url")
private String videoAuditUrl;
@ApiModelProperty("视频上传后台30天销量")
@TableField("video_sale_30")
private Long videoSale30;
@ApiModelProperty("添加地区")
@TableField("add_region")
private String addRegion;
@ApiModelProperty("视频策划进度,本表中该字段已弃用")
@TableField("video_plan_progress")
private Integer videoPlanProgress;
@ApiModelProperty("摄影视频进度,本表中该字段已弃用")
@TableField("photo_video_progress")
private Integer photoVideoProgress;
@ApiModelProperty("[优化视频]是否需要视频策划,0-否,1-是")
@TableField("is_video_plan")
private Integer isVideoPlan;
@ApiModelProperty("[优化视频]视频优化类型:1-重拍视频,2-产品未拍视频")
@TableField("video_optimize_type")
private Integer videoOptimizeType;
@ApiModelProperty("是否删除,0-否,1-是")
@TableField("is_delete")
@TableLogic
private Integer isDelete;
@ApiModelProperty("视频是否合格,0-不合格 ,1-合格")
@TableField("video_is_qualified")
private Integer videoIsQualified;
@ApiModelProperty("视频合格备注")
@TableField("video_qualified_remark")
private String videoQualifiedRemark;
@ApiModelProperty("优化类型:0-原始任务(默认),1-优化任务")
@TableField("optimize_type")
private Integer optimizeType;
@ApiModelProperty("优化备注")
@TableField("optimize_remark")
private String optimizeRemark;
@ApiModelProperty("传达设计表id(visual_communication_design的id)")
@TableField("communication_design_id")
private Long communicationDesignId;
@ApiModelProperty("创建人")
@TableField("create_name")
private String createName;
@ApiModelProperty("创建人id")
@TableField("create_id")
private Integer createId;
@ApiModelProperty("视频开发审核人id")
@TableField("video_audit_id")
private Integer videoAuditId;
@ApiModelProperty("视频开发审核人")
@TableField("video_audit_name")
private String videoAuditName;
@ApiModelProperty("视频开发审核时间")
@TableField("video_audit_time")
private Integer videoAuditTime;
@ApiModelProperty("视频策划编号,本表中该字段已弃用")
@TableField("video_plan_number")
private String videoPlanNumber;
@ApiModelProperty("视频策划,本表中该字段已弃用")
@TableField("video_plan_name")
private String videoPlanName;
@ApiModelProperty("视频策划完成时间,本表中该字段已弃用")
@TableField("video_plan_finish_time")
private Integer videoPlanFinishTime;
@ApiModelProperty("摄影视频编号,本表中该字段已弃用")
@TableField("photo_video_number")
private String photoVideoNumber;
@ApiModelProperty("摄影视频,本表中该字段已弃用")
@TableField("photo_video_name")
private String photoVideoName;
@ApiModelProperty("摄影视频完成时间,本表中该字段已弃用")
@TableField("photo_video_finish_time")
private Integer photoVideoFinishTime;
@ApiModelProperty("视频上传后台时间")
@TableField("video_upload_backstage_time")
private Integer videoUploadBackstageTime;
@ApiModelProperty("视频上传后台人id")
@TableField("video_upload_backstage_id")
private Long videoUploadBackstageId;
@ApiModelProperty("创建时间")
@TableField("create_time")
private Integer createTime;
@ApiModelProperty("相关SKU是否同步,-1-暂无,0-否,1-是")
@TableField("is_sync")
private Integer isSync;
@ApiModelProperty("视频策划ID[visual_video_plan表id]")
@TableField("video_plan_id")
private Long videoPlanId;
@ApiModelProperty("摄影视频ID[visual_photographer表id]")
@TableField("photographer_id")
private Long photographerId;
@ApiModelProperty("视频备注")
@TableField("video_remark")
private String videoRemark;
@ApiModelProperty("剪辑编号,本表中该字段已弃用")
@TableField("editors_number")
private String editorsNumber;
@ApiModelProperty("剪辑师,本表中该字段已弃用")
@TableField("editors_name")
private String editorsName;
@ApiModelProperty("剪辑进度,本表中该字段已弃用")
@TableField("editor_progress")
private Integer editorProgress;
@ApiModelProperty("剪辑完成时间,本表中该字段已弃用")
@TableField("editor_finish_time")
private Integer editorFinishTime;
@ApiModelProperty("创建人类型,0-系统,1-销售,2-策划")
@TableField("create_type")
private Integer createType;
@ApiModelProperty("是否已做优化 0-否 1-是")
@TableField("is_optimize")
private Integer isOptimize;
@ApiModelProperty("商标审核人")
@TableField("trademark_audit_user")
private String trademarkAuditUser;
@ApiModelProperty("商标审核人id")
@TableField("trademark_audit_user_id")
private Integer trademarkAuditUserId;
@ApiModelProperty("商标审核状态 0待审核 1已审核 2商标问题 3拼写问题 4商标+拼写 5无问题")
@TableField("trademark_audit_status")
private Integer trademarkAuditStatus;
@ApiModelProperty("商标审核时间")
@TableField("trademark_audit_time")
private Integer trademarkAuditTime;
@ApiModelProperty("是否周期性产品")
@TableField("is_period_product")
private Integer isPeriodProduct;
@ApiModelProperty("商标审核备注")
@TableField("trademark_audit_memo")
private String trademarkAuditMemo;
}
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 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 2024-12-25
*/
@Getter
@Setter
@Accessors(chain = true)
@TableName("visual_video_plan")
@ApiModel(value = "VisualVideoPlan对象", description = "视觉设计协同系统-视频策划")
public class VisualVideoPlan implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("id")
@TableId("id")
private Long id;
@ApiModelProperty("标题")
@TableField("title")
private String title;
@ApiModelProperty("执行者")
@TableField("executor_name")
private String executorName;
@ApiModelProperty("执行者编号")
@TableField("executor_number")
private String executorNumber;
@ApiModelProperty("状态,0-未完成,1-进行中,2-完成,3-不需要处理")
@TableField("`status`")
private Integer status;
@ApiModelProperty("状态为不需要处理时的原因:1-过季,2-断货无样品,3-开发要求不做,4-其他原因")
@TableField("no_handle_reason")
private Integer noHandleReason;
@ApiModelProperty("是否有样品,0-否,1-是")
@TableField("is_have_sample")
private Integer isHaveSample;
@ApiModelProperty("有样品时间(对应invt的delivery_time)")
@TableField("have_sample_time")
private Integer haveSampleTime;
@ApiModelProperty("备注")
@TableField("remark")
private String remark;
@ApiModelProperty("优先级")
@TableField("priority")
private String priority;
@ApiModelProperty("标签id(visual_design_tag的id)")
@TableField("vdt_id")
private String vdtId;
@ApiModelProperty("风险检测")
@TableField("risk_check_area")
private String riskCheckArea;
@ApiModelProperty("风险检测状态,0-否,1-是[对应inv的is_submit]")
@TableField("risk_check_status")
private Integer riskCheckStatus;
@ApiModelProperty("创建人id")
@TableField("create_id")
private Integer createId;
@ApiModelProperty("创建人")
@TableField("create_name")
private String createName;
@ApiModelProperty("创建时间")
@TableField("create_time")
private Integer createTime;
@ApiModelProperty("文件url")
@TableField("file_url")
private String fileUrl;
@ApiModelProperty("sku")
@TableField("sku")
private String sku;
@ApiModelProperty("站点")
@TableField("site")
private String site;
@ApiModelProperty("地区")
@TableField("region")
private String region;
@ApiModelProperty("是否删除,0-否1-是")
@TableField("is_delete")
@TableLogic
private Integer isDelete;
@ApiModelProperty("完成时间")
@TableField("finish_time")
private Integer finishTime;
@ApiModelProperty("暂停时间")
@TableField("pause_time")
private Integer pauseTime;
@ApiModelProperty("visual_communication_design表id")
@TableField("communication_design_id")
private Long communicationDesignId;
@ApiModelProperty("是否需要翻译")
@TableField("is_translate")
private Integer isTranslate;
@ApiModelProperty("翻译语种")
@TableField("languages")
private String languages;
@ApiModelProperty("首个发起申请的sku")
@TableField("apply_sku")
private String applySku;
@ApiModelProperty("样品状态::1-正,2-次")
@TableField("sample_status")
private Integer sampleStatus;
@ApiModelProperty("样品备注")
@TableField("sample_status_remark")
private String sampleStatusRemark;
@ApiModelProperty("长视频地址")
@TableField("long_video_url")
private String longVideoUrl;
@ApiModelProperty("短视频地址")
@TableField("short_video_url")
private String shortVideoUrl;
@ApiModelProperty("封面图")
@TableField("cover_image_url")
private String coverImageUrl;
@ApiModelProperty("样品全部到货时间")
@TableField("sample_arrive_time")
private Integer sampleArriveTime;
@ApiModelProperty("前台是否有视频")
@TableField("is_video_in_amazon")
private Integer isVideoInAmazon;
@ApiModelProperty("是否为精品产品,0-否,1-是")
@TableField("is_boutique_product")
private Integer isBoutiqueProduct;
@ApiModelProperty("权重")
@TableField("weight")
private BigDecimal weight;
@ApiModelProperty("是否走流程,0-否,1-是")
@TableField("follow_the_process")
private Integer followTheProcess;
@ApiModelProperty("是否是销量评优,0-否,1-是")
@TableField("sale_appraising_flag")
private Integer saleAppraisingFlag;
@ApiModelProperty("取样人员")
@TableField("take_sample_person")
private String takeSamplePerson;
@ApiModelProperty("摄影是否取样,0-否,1-是")
@TableField("is_give_sample")
private Integer isGiveSample;
@ApiModelProperty("取样时间,摄影是否取样为是时,需要有值")
@TableField("give_sample_time")
private Integer giveSampleTime;
@ApiModelProperty("视频是否侵权:0-否,1-是")
@TableField("video_is_tort")
private Integer videoIsTort;
@ApiModelProperty("视频侵权意见")
@TableField("video_tort_reason")
private String videoTortReason;
}
package cn.kk.spring_simple_operation.mapper;
import cn.kk.spring_simple_operation.entity.PhotoProgress;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 图片协同系统 Mapper 接口
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@Mapper
public interface PhotoProgressMapper extends BaseMapper<PhotoProgress> {
}
package cn.kk.spring_simple_operation.mapper;
import cn.kk.spring_simple_operation.entity.PhotoProgressPerson;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@Mapper
public interface PhotoProgressPersonMapper extends BaseMapper<PhotoProgressPerson> {
}
package cn.kk.spring_simple_operation.mapper;
import cn.kk.spring_simple_operation.entity.SyncProductPublish;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* <p>
* sku销量详情 Mapper 接口
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@Mapper
public interface SyncProductPublishMapper extends BaseMapper<SyncProductPublish> {
List<SyncProductPublish> selectMotherSku();
}
package cn.kk.spring_simple_operation.mapper;
import cn.kk.spring_simple_operation.entity.SyncSolarTermInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@Mapper
public interface SyncSolarTermInfoMapper extends BaseMapper<SyncSolarTermInfo> {
}
package cn.kk.spring_simple_operation.mapper;
import cn.kk.spring_simple_operation.entity.VideoProduct;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* <p>
* 视频产品 Mapper 接口
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@Mapper
public interface VideoProductMapper extends BaseMapper<VideoProduct> {
List<String> selectHaveTask();
}
package cn.kk.spring_simple_operation.mapper;
import cn.kk.spring_simple_operation.entity.VisualVideoPlan;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* <p>
* 视觉设计协同系统-视频策划 Mapper 接口
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@Mapper
public interface VisualVideoPlanMapper extends BaseMapper<VisualVideoPlan> {
}
package cn.kk.spring_simple_operation.service;
import cn.kk.spring_simple_operation.entity.PhotoProgressPerson;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
public interface PhotoProgressPersonService extends IService<PhotoProgressPerson> {
}
package cn.kk.spring_simple_operation.service;
import cn.kk.spring_simple_operation.entity.PhotoProgress;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 图片协同系统 服务类
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
public interface PhotoProgressService extends IService<PhotoProgress> {
}
package cn.kk.spring_simple_operation.service;
import cn.kk.spring_simple_operation.entity.SyncProductPublish;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* sku销量详情 服务类
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
public interface SyncProductPublishService extends IService<SyncProductPublish> {
}
package cn.kk.spring_simple_operation.service;
import cn.kk.spring_simple_operation.entity.SyncSolarTermInfo;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 服务类
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
public interface SyncSolarTermInfoService extends IService<SyncSolarTermInfo> {
}
package cn.kk.spring_simple_operation.service;
import cn.kk.spring_simple_operation.entity.VideoProduct;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 视频产品 服务类
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
public interface VideoProductService extends IService<VideoProduct> {
}
package cn.kk.spring_simple_operation.service;
import cn.kk.spring_simple_operation.entity.VisualVideoPlan;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* <p>
* 视觉设计协同系统-视频策划 服务类
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
public interface VisualVideoPlanService extends IService<VisualVideoPlan> {
}
package cn.kk.spring_simple_operation.service.impl;
import cn.kk.spring_simple_operation.entity.PhotoProgressPerson;
import cn.kk.spring_simple_operation.mapper.PhotoProgressPersonMapper;
import cn.kk.spring_simple_operation.service.PhotoProgressPersonService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@Service
public class PhotoProgressPersonServiceImpl extends ServiceImpl<PhotoProgressPersonMapper, PhotoProgressPerson> implements PhotoProgressPersonService {
}
package cn.kk.spring_simple_operation.service.impl;
import cn.kk.spring_simple_operation.entity.PhotoProgress;
import cn.kk.spring_simple_operation.mapper.PhotoProgressMapper;
import cn.kk.spring_simple_operation.service.PhotoProgressService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 图片协同系统 服务实现类
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@Service
public class PhotoProgressServiceImpl extends ServiceImpl<PhotoProgressMapper, PhotoProgress> implements PhotoProgressService {
}
package cn.kk.spring_simple_operation.service.impl;
import cn.kk.spring_simple_operation.entity.SyncProductPublish;
import cn.kk.spring_simple_operation.mapper.SyncProductPublishMapper;
import cn.kk.spring_simple_operation.service.SyncProductPublishService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* sku销量详情 服务实现类
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@Service
public class SyncProductPublishServiceImpl extends ServiceImpl<SyncProductPublishMapper, SyncProductPublish> implements SyncProductPublishService {
}
package cn.kk.spring_simple_operation.service.impl;
import cn.kk.spring_simple_operation.entity.SyncSolarTermInfo;
import cn.kk.spring_simple_operation.mapper.SyncSolarTermInfoMapper;
import cn.kk.spring_simple_operation.service.SyncSolarTermInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 服务实现类
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@Service
public class SyncSolarTermInfoServiceImpl extends ServiceImpl<SyncSolarTermInfoMapper, SyncSolarTermInfo> implements SyncSolarTermInfoService {
}
package cn.kk.spring_simple_operation.service.impl;
import cn.kk.spring_simple_operation.entity.VideoProduct;
import cn.kk.spring_simple_operation.mapper.VideoProductMapper;
import cn.kk.spring_simple_operation.service.VideoProductService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 视频产品 服务实现类
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@Service
public class VideoProductServiceImpl extends ServiceImpl<VideoProductMapper, VideoProduct> implements VideoProductService {
}
package cn.kk.spring_simple_operation.service.impl;
import cn.kk.spring_simple_operation.entity.VisualVideoPlan;
import cn.kk.spring_simple_operation.mapper.VisualVideoPlanMapper;
import cn.kk.spring_simple_operation.service.VisualVideoPlanService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
/**
* <p>
* 视觉设计协同系统-视频策划 服务实现类
* </p>
*
* @author guokunkun
* @since 2024-12-25
*/
@Service
public class VisualVideoPlanServiceImpl extends ServiceImpl<VisualVideoPlanMapper, VisualVideoPlan> implements VisualVideoPlanService {
}
package com.baomidou.mybatisplus.generator.config.converts;
import com.baomidou.mybatisplus.generator.config.GlobalConfig;
import com.baomidou.mybatisplus.generator.config.ITypeConvert;
import com.baomidou.mybatisplus.generator.config.rules.DbColumnType;
import com.baomidou.mybatisplus.generator.config.rules.IColumnType;
/**
* @author guokunkun
* @date 2023/4/24
*/
public class SelfMySqlTypeConvert extends MySqlTypeConvert implements ITypeConvert {
@Override
public IColumnType processTypeConvert(GlobalConfig config, String fieldType) {
IColumnType columnType = TypeConverts.use(fieldType)
.test(TypeConverts.containsAny(new CharSequence[]{"char", "text", "json", "enum"}).then(DbColumnType.STRING))
.test(TypeConverts.contains("bigint").then(DbColumnType.LONG))
.test(TypeConverts.containsAny(new CharSequence[]{"tinyint(1)", "bit(1)"}).then(DbColumnType.INTEGER))
.test(TypeConverts.contains("bit").then(DbColumnType.BYTE))
.test(TypeConverts.containsAny("int").then(DbColumnType.INTEGER))
.test(TypeConverts.contains("decimal").then(DbColumnType.BIG_DECIMAL))
.test(TypeConverts.contains("clob").then(DbColumnType.CLOB))
.test(TypeConverts.contains("blob").then(DbColumnType.BLOB))
.test(TypeConverts.contains("binary").then(DbColumnType.BYTE_ARRAY))
.test(TypeConverts.contains("float").then(DbColumnType.FLOAT))
.test(TypeConverts.contains("double").then(DbColumnType.DOUBLE))
.test(TypeConverts.containsAny(new CharSequence[]{"date", "time", "year"}).then((t) -> toDateType(config, t)))
.or(DbColumnType.STRING);
// System.out.println("字段类型:::" + fieldType + ",属性类型是:" + columnType.getType());
return columnType;
}
}
server:
port: 9010
logging:
level:
root: INFO
spring:
application:
name: spring-simple-operation
datasource:
type: com.alibaba.druid.pool.DruidDataSource
# url: jdbc:mysql://192.168.0.59:3309/visual_1214?useUnicode=true&characterEncoding=utf8&useSSL=true
# username: root
# password: root
# url: jdbc:mysql://192.168.0.59:3309/visual_1228?useUnicode=true&characterEncoding=utf8&useSSL=true
# username: root
# password: root
# url: jdbc:mysql://120.77.232.73:3306/java_visual?useUnicode=true&characterEncoding=utf8&useSSL=true
# username: yswg_it_java
# password: Yswg@inv-java241011427
url: jdbc:mysql://mydb.com:3306/visual_1218?useUnicode=true&characterEncoding=utf8&useSSL=true
username: root
password: root
druid:
initial-size: 5
min-idle: 5
maxActive: 20
maxWait: 60000
timeBetweenEvictionRunsMillis: 60000
minEvictableIdleTimeMillis: 300000
validationQuery: SELECT 1
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxPoolPreparedStatementPerConnectionSize: 20
filters: stat,wall,slf4j
connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000
web-stat-filter:
enabled: true
url-pattern: "/*"
exclusions: "*.js,*.gif,*.jpg,*.bmp,*.png,*.css,*.ico,/druid/*"
stat-view-servlet:
url-pattern: "/druid/*"
allow: 192.168.1.76
deny:
reset-enable: false
login-username: admin
login-password: 123456
mybatis-plus:
mapper-locations: com/yswg/visual/mapper/**/*.xml
global-config:
db-config:
id-type: auto
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.kk.spring_simple_operation.mapper.PhotoProgressMapper">
</mapper>
<?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.PhotoProgressPersonMapper">
</mapper>
<?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.SyncProductPublishMapper">
<select id="selectMotherSku" resultType="cn.kk.spring_simple_operation.entity.SyncProductPublish">
with shortVideo as (select vp.sku
from video_product vp
INNER JOIN visual_video_plan vvp on vvp.id = vp.video_plan_id
where vp.is_delete = 0
and vvp.is_delete = 0
and vp.site = 'Amazon.com')
select spp.sku,
spp.relation_key,
spp.lowest_price,
spp.thirty_day_sales
from sync_product_publish spp
LEFT JOIN photo_progress pp on pp.sku = spp.sku
LEFT JOIN shortVideo on shortVideo.sku = spp.sku
where spp.open_date BETWEEN 1 AND 1732291200
and spp.sale_status IN ('正常销售')
and spp.site = 'Amazon.com'
and spp.is_delete = 0
and spp.parent_asin = ''
and spp.solar_term = 1
and shortVideo.sku is null
and pp.id is null
and spp.lowest_price > 0
and spp.thirty_day_sales > 0
</select>
</mapper>
<?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.SyncSolarTermInfoMapper">
</mapper>
<?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.VideoProductMapper">
<select id="selectHaveTask" resultType="java.lang.String">
SELECT
vp.sku
FROM
video_product vp
INNER JOIN visual_video_plan vvp ON vvp.id = vp.video_plan_id
WHERE
vp.is_delete = 0
AND vvp.is_delete = 0
AND vp.site = 'Amazon.com'
</select>
</mapper>
<?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.VisualVideoPlanMapper">
</mapper>
package cn.kk.spring_simple_operation;
import cn.kk.spring_simple_operation.entity.SyncProductPublish;
import cn.kk.spring_simple_operation.mapper.SyncProductPublishMapper;
import cn.kk.spring_simple_operation.mapper.VideoProductMapper;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@SpringBootTest
class SpringSimpleOperationApplicationTests {
private static final BigDecimal TWENTY = new BigDecimal("20");
private static final BigDecimal FORTY = new BigDecimal("40");
@Resource
private SyncProductPublishMapper syncProductPublishMapper;
@Resource
private VideoProductMapper videoProductMapper;
@Test
void contextLoads() {
}
@Test
void testSyncProductPublish() {
//List<String> shortUrlSkuList = videoProductMapper.selectHaveTask();
Map<String, Integer> salesMap = new HashMap<>();
salesMap.put("<20", 0);
salesMap.put("20~40", 0);
salesMap.put(">40", 0);
Set<String> haveSkuSet = new HashSet<>();
// 母体sku
List<SyncProductPublish> syncProductPublishes = syncProductPublishMapper.selectMotherSku();
syncProductPublishes.forEach(item -> {
List<SyncProductPublish> subList = syncProductPublishMapper.selectList(Wrappers.<SyncProductPublish>lambdaQuery().eq(SyncProductPublish::getParentAsin, item.getRelationKey()).select(SyncProductPublish::getSku, SyncProductPublish::getThirtyDaySales));
subList.add(item);
String s = checkPriceAndSales(subList, item.getLowestPrice());
if (StringUtils.isBlank(s)) {
return;
}
salesMap.put(s, salesMap.get(s) + 1);
haveSkuSet.addAll(subList.stream().map(SyncProductPublish::getSku).collect(Collectors.toList()));
});
System.out.println(JSONObject.toJSONString(salesMap));
}
private String checkPriceAndSales(List<SyncProductPublish> subList, BigDecimal lowestPrice) {
if (CollectionUtils.isEmpty(subList) || lowestPrice.compareTo(BigDecimal.ZERO) < 0) {
return null;
}
int sum = subList.stream().map(SyncProductPublish::getThirtyDaySales).reduce(Integer::sum).get();
if (lowestPrice.compareTo(TWENTY) <= 0 && sum >= 100) {
return "<20";
}
else if (lowestPrice.compareTo(TWENTY) > 0 && lowestPrice.compareTo(FORTY) <= 0 && sum >= 80) {
return "20~40";
}
else if (lowestPrice.compareTo(FORTY) > 0 && sum >= 50) {
return ">40";
}
return null;
}
}
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