1) 数据库修改:

/*DROP TABLE IF EXISTS `flashing_light`;

CREATE TABLE `flashing_light` (
  `id` INT(10) NOT NULL AUTO_INCREMENT,
  `strategy_name` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '策略名称',
  `target_execution` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '执行对象',
  `light_time` VARCHAR(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '闪灯时长',
  `light_cololr` VARCHAR(10) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '闪灯颜色',
  `operater` VARCHAR(30) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '操作人',
  `creat_time` DATETIME DEFAULT NULL COMMENT '创建时间',
  `update_time` DATETIME DEFAULT NULL COMMENT '更新时间',
  `del_time` DATETIME DEFAULT NULL COMMENT '删除时间',
  `excute_time` DATETIME DEFAULT NULL COMMENT '上次下发时间',
  `operation` VARCHAR(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '操作执行',
  `store_id` BIGINT(11) NOT NULL COMMENT '门店id',
  `is_flag` TINYINT(4) DEFAULT '1' COMMENT '是否删除:0:删除,1:未删除',
  PRIMARY KEY (`id`)
) ENGINE=INNODB AUTO_INCREMENT=169 DEFAULT CHARSET=utf8 COMMENT='闪灯策略表'; */

/*Table structure for table `item_ext` */

CREATE TABLE `attr_category` (
	`id` INT (11) NOT NULL AUTO_INCREMENT,
	`category_name` VARCHAR (360) CHARACTER SET utf8mb4 DEFAULT NULL,
	`agency_id` BIGINT (20) DEFAULT NULL,
	`merchant_id` BIGINT (20) DEFAULT NULL,
	`store_id` BIGINT (20) DEFAULT NULL,
	`add_time` TIMESTAMP DEFAULT NULL,
	`del_time` TIMESTAMP DEFAULT NULL,
	`update_time` TIMESTAMP DEFAULT NULL,
	`operate_user` VARCHAR (540) CHARACTER SET utf8mb4 DEFAULT NULL,
	`flag` TINYINT (4) DEFAULT NULL,
	PRIMARY KEY (`id`)
) ENGINE=INNODB DEFAULT CHARSET=utf8;



ALTER TABLE flashing_light ADD COLUMN (store_id BIGINT(11) NOT NULL COMMENT '门店id');

DROP TABLE IF EXISTS `item_ext`;

CREATE TABLE `item_ext` (
  `id` INT(10) NOT NULL AUTO_INCREMENT,
  `store_id` BIGINT(20) NOT NULL COMMENT '门店id',
  `cust_feature1` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '扩展字段1',
  `cust_feature2` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  `cust_feature3` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  `cust_feature4` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  `cust_feature5` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  `cust_feature6` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  `cust_feature7` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  `cust_feature8` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  `cust_feature9` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  `cust_feature10` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  `cust_feature11` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  `cust_feature12` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  `cust_feature13` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  `cust_feature14` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  `cust_feature15` VARCHAR(60) CHARACTER SET utf8mb4 DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='商品扩张子弹别名表';


DROP TABLE IF EXISTS `tb_picture`;

CREATE TABLE `tb_picture` (
  `id` BIGINT(20) NOT NULL AUTO_INCREMENT,
  `item_id` INT(11) NOT NULL COMMENT '商品id',
  `model_color` VARCHAR(100) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'model颜色',
  `pic_size` VARCHAR(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '图片分辨率',
  `model_size` VARCHAR(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '价签型号',
  `pic_url` VARCHAR(200) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '图片地址',
  `creater` VARCHAR(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '创建人',
  `modifier` VARCHAR(20) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '修改人',
  `create_time` DATETIME DEFAULT NULL COMMENT '创建时间',
  `modify_time` DATETIME DEFAULT NULL COMMENT '修改时间',
  `del_time` DATETIME DEFAULT NULL COMMENT '删除时间',
  `del_flag` TINYINT(4) DEFAULT NULL COMMENT '是否删除0:删除1:未删除',
  `models` VARCHAR(200) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT '价签型号集合',
  PRIMARY KEY (`id`)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='图片表';

ALTER TABLE template_base ADD COLUMN(
attr_category VARCHAR(60) COMMENT '模板属性分类',
is_enable TINYINT(4) COMMENT '是否可用(1:启用状态 0:禁用状态)'
);


ALTER TABLE item ADD COLUMN(
attr_category VARCHAR(60) COMMENT '模板属性分类',
update_time TIMESTAMP COMMENT '更新时间',
del_time TIMESTAMP COMMENT '删除时间',
is_flag TINYINT(4) COMMENT '是否删除标志:0-删除;1-未删除'
);

ALTER TABLE item DROP categoryName;
ALTER TABLE item DROP shelfNum;

ALTER TABLE item CHANGE custFeatureA custFeature1 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureB custFeature2 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureC custFeature3 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureD custFeature4 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureE custFeature5 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureF custFeature6 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureG custFeature7 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureH custFeature8 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureI custFeature9 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureJ custFeature10 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureK custFeature11 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureL custFeature12 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureM custFeature13 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureN custFeature14 VARCHAR(60);
ALTER TABLE item CHANGE custFeatureO custFeature15 VARCHAR(60);

ALTER TABLE template_attr ADD COLUMN(
category_id INT(11) COMMENT '属性分类id',
category_name VARCHAR(40) COMMENT '属性分类名称'
);

ALTER TABLE item_pricetag ADD COLUMN(
template_id INT(11) COMMENT '使用模板id'
);

ALTER TABLE pricetag ADD COLUMN(
shelf_num VARCHAR(60) COMMENT '货架编号',
add_time TIMESTAMP COMMENT '入库时间'
);

ALTER TABLE pricetag CHANGE APMac apMac VARCHAR(60);

ALTER TABLE operation_log ADD COLUMN(
esl_shelf_num VARCHAR(60) COMMENT '价签货架编号'
);


ALTER TABLE ap_station ADD COLUMN(
sn VARCHAR(30) COMMENT 'SN号',
ap_name VARCHAR(60) COMMENT 'AP名称',
add_time TIMESTAMP COMMENT '添加时间',
del_time TIMESTAMP COMMENT '删除时间'
);

ALTER TABLE template_fix ADD COLUMN(
vertical_space INT(11) COMMENT '文本行间距'
);

ALTER TABLE template_dynamic ADD COLUMN(
vertical_space INT(11) COMMENT '文本行间距',
min_font_size INT(11) COMMENT '最小弹性字号',
is_elastic_size TINYINT(1) COMMENT '是否允许弹性字号(1:允许 0:不允许)'
);

ALTER TABLE template_dynamic DROP overlaytemplateNumber;
ALTER TABLE template_dynamic DROP setFieldType;
ALTER TABLE template_dynamic DROP isAdaptiveFont;

ALTER TABLE store ADD COLUMN(
address VARCHAR(200) COMMENT '地址',
mailbox VARCHAR(60) COMMENT '邮箱',
phone VARCHAR(40) COMMENT '联系人电话',
contacts VARCHAR(40) COMMENT '联系人'
);


ALTER TABLE item_import_log ADD(
merchantId BIGINT(20) COMMENT '商家id',
storeId BIGINT(20) COMMENT '门店id'
);

UPDATE item_import_log l SET l.merchantId = (SELECT u.merchantId FROM USER u WHERE u.account = l.uploadUser AND u.flag = 1),l.storeId = (SELECT u.storeId FROM USER u WHERE u.account = l.uploadUser AND u.flag = 1)


ALTER TABLE agency_alarm_config CHANGE sendServer sendServer VARCHAR(40);
ALTER TABLE agency_alarm_config CHANGE PASSWORD PASSWORD VARCHAR(40);
ALTER TABLE alarm_job_config CHANGE sendTo sendTo VARCHAR(1000);


ALTER TABLE field_name ADD COLUMN(operate_type TINYINT(4) NULL COMMENT '1:绑定(item) 2:解绑(esl)',
display_type VARCHAR(40) NULL COMMENT '组件类型(1:文本 2:条码 3:二维码 4:时间)');

ALTER TABLE alarm ADD COLUMN(ap_name VARCHAR(60) NULL COMMENT 'AP名称(如果是AP报警的话)');


INSERT INTO `fault_type` (`faultTypeCode`, `faultType`) VALUES('1','基站离线');
INSERT INTO `fault_type` (`faultTypeCode`, `faultType`) VALUES('2','更新失败-价签疑似离线');
INSERT INTO `fault_type` (`faultTypeCode`, `faultType`) VALUES('3','更新失败-价签离线');
INSERT INTO `fault_type` (`faultTypeCode`, `faultType`) VALUES('4','更新失败-基站离线');
INSERT INTO `fault_type` (`faultTypeCode`, `faultType`) VALUES('5','更新失败-未知原因');
INSERT INTO `fault_type` (`faultTypeCode`, `faultType`) VALUES('6','模板未找到');

INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getItemTitle','商品名称','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getShortTitle','商品简称','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getProductCode','商品编码','1','1,2');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getBarCode','商品条码','1','1,2');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getMerchantId','所属商家','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getStoreId','所属门店','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getBrandName','品牌','1','5');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCategoryName','品类','1','5');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getPrice_1','售价整数','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getPrice_2','售价小数','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getOriginalPrice','原价','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getMemberPrice','会员价','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getProductArea','产地','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getSpec','规格','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getClassLevel','等级','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getSourceCode','溯源码URL','1','5');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getQrCode','二维码URL','1','1,3');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getProStartTime','促销开始时间','1','4');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getProEndTime','促销结束时间','1','4');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getPromotionText','促销文案','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getNumber','数量','1','5');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getUnit','销售单位','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getProductSku','商品SKU/自编码','1','1,2');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getPrice','售价','1','5');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getSuggestPrice','建议零售价','1','5');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature1','自定义扩展属性A','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature2','自定义扩展属性B','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature3','自定义扩展属性C','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature4','自定义扩展属性D','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature5','自定义扩展属性E','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature6','自定义扩展属性F','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature7','自定义扩展属性G','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature8','自定义扩展属性H','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature9','自定义扩展属性I','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature10','自定义扩展属性J','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature11','自定义扩展属性K','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature12','自定义扩展属性L','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature13','自定义扩展属性M','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature14','自定义扩展属性N','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getCustFeature15','自定义扩展属性O','1','1');
INSERT INTO `field_name` (`fieldCode`, `fieldName`, `operate_type`, `display_type`) VALUES('getBarCode_esl','价签条码','2','1,2');

INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('1','Microsoft YaHei','1,2,4','Microsoft YaHei');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('2','Oswald','2','Oswald');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('3','Zfull-GB','1,2,5','Zfull-GB');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('4','Arial','2,3','Arial');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('5','Verdana','2,3','Verdana');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('6','Calibri','2,3','Calibri');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('7','Times New Roman','2,3','Times New Roman');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('8','Helvetica','2,3','Helvetica');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('9','Franklin Gothic Book','2,3','Franklin Gothic Book');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('10','Perestroika','4','Perestroika');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('12','宋体','1','宋体');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('13','黑体','1','黑体');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('14','M+ 1c medium','5','M + FONTS');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('15','IPAMincho','5','IPAゴシック\n');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('16','07LogoTypeGothic7','5','ロゴたいぷゴシック');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('17','Mochiy Pop E','5','モッチーポップ');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('18','Satsuki Gendai Mincho','5','さつき源代明朝');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('19','GenSenMaruGothic TW TTF Regular','555','GenSenMaruGothicTW');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('20','GenSenMaruGothic JP TTF Regular','555','GenSenMaruGothicJP');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('21','IPAGothic','5','ipag');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('22','Jiyucho','5','Jiyucho');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('23','Mochiy Pop E P','5','MochiyPop-EP');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('24','Satsuki Gendai Mincho','555','SatsukiGendaiMincho-M');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('25','SoukouMincho','5','SoukouMincho');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('26','Source Han Sans Regular','1,2','思源黑体');
INSERT INTO `font_type` (`fontTypeCode`, `fontTypeName`, `supported_language`, `font_alias`) VALUES('27','Source Han Sans Bold','1,2','思源黑体-加粗');

INSERT INTO `hardware_type` (`hardwareTypeCode`, `hardwareTypeName`) VALUES('0','黑白');
INSERT INTO `hardware_type` (`hardwareTypeCode`, `hardwareTypeName`) VALUES('1','黑白红');
INSERT INTO `hardware_type` (`hardwareTypeCode`, `hardwareTypeName`) VALUES('2','黑白黄');

INSERT INTO `operate_status` (`statusCode`, `statusName`) VALUES('1','新建');
INSERT INTO `operate_status` (`statusCode`, `statusName`) VALUES('2','成功');
INSERT INTO `operate_status` (`statusCode`, `statusName`) VALUES('3','失败');
INSERT INTO `operate_status` (`statusCode`, `statusName`) VALUES('4','超时未反馈重试中');
INSERT INTO `operate_status` (`statusCode`, `statusName`) VALUES('5','被终止');
INSERT INTO `operate_status` (`statusCode`, `statusName`) VALUES('6','消息处理失败重试');
INSERT INTO `operate_status` (`statusCode`, `statusName`) VALUES('7','手动重试');

INSERT INTO `operation_type` (`operationTypeCode`, `operationType`) VALUES('1','绑定');
INSERT INTO `operation_type` (`operationTypeCode`, `operationType`) VALUES('2','解绑');
INSERT INTO `operation_type` (`operationTypeCode`, `operationType`) VALUES('3','强制更新');
INSERT INTO `operation_type` (`operationTypeCode`, `operationType`) VALUES('4','商品变更更新');
INSERT INTO `operation_type` (`operationTypeCode`, `operationType`) VALUES('5','模板变更更新');

INSERT INTO `pricetag_model` (`size`, `model`, `oem_model`, `resolution`, `width`, `height`, `color`, `modelSpec`, `temperature`, `weight`, `battery`, `hardversion`, `isHighResolution`, `img_path`, `createdTime`, `flag`) VALUES('2.9','ZKC29S','ZKC29S','296*128','296','128','1',NULL,'1',NULL,NULL,'V1.0',NULL,'201906272155423084.img','2019-03-15 14:49:09','1');
INSERT INTO `pricetag_model` (`size`, `model`, `oem_model`, `resolution`, `width`, `height`, `color`, `modelSpec`, `temperature`, `weight`, `battery`, `hardversion`, `isHighResolution`, `img_path`, `createdTime`, `flag`) VALUES('7.5','ZKC75S','ZKC75S','528*880','528','880','1',NULL,'1',NULL,NULL,'v1.0',NULL,'201906272155423084.img','2019-03-15 20:59:16','1');
INSERT INTO `pricetag_model` (`size`, `model`, `oem_model`, `resolution`, `width`, `height`, `color`, `modelSpec`, `temperature`, `weight`, `battery`, `hardversion`, `isHighResolution`, `img_path`, `createdTime`, `flag`) VALUES('4.2','ZKC42S','ZKC42S','300*400','300','400','1',NULL,'1',NULL,NULL,'V1.0',NULL,'201906272155423084.img','2019-04-25 17:56:48','1');
INSERT INTO `pricetag_model` (`size`, `model`, `oem_model`, `resolution`, `width`, `height`, `color`, `modelSpec`, `temperature`, `weight`, `battery`, `hardversion`, `isHighResolution`, `img_path`, `createdTime`, `flag`) VALUES('2.13','ZKC21S','ZKC21S','250*122','250','122','1',NULL,'1',NULL,NULL,'V1.0',NULL,'201907021035446115.img','2019-04-25 19:25:55','1');
INSERT INTO `pricetag_model` (`size`, `model`, `oem_model`, `resolution`, `width`, `height`, `color`, `modelSpec`, `temperature`, `weight`, `battery`, `hardversion`, `isHighResolution`, `img_path`, `createdTime`, `flag`) VALUES('1.54','ZKC15S','ZKC15S','152*152','152','152','1',NULL,'1',NULL,NULL,'1.0',NULL,'201906272155423084.img','2019-05-12 10:33:12','1');
INSERT INTO `pricetag_model` (`size`, `model`, `oem_model`, `resolution`, `width`, `height`, `color`, `modelSpec`, `temperature`, `weight`, `battery`, `hardversion`, `isHighResolution`, `img_path`, `createdTime`, `flag`) VALUES('2.7','ZKC27S','ZKC27S','264*176','264','176','1',NULL,'1',NULL,NULL,'1.0',NULL,'201906272155423084.img','2019-05-12 10:33:43','1');
INSERT INTO `pricetag_model` (`size`, `model`, `oem_model`, `resolution`, `width`, `height`, `color`, `modelSpec`, `temperature`, `weight`, `battery`, `hardversion`, `isHighResolution`, `img_path`, `createdTime`, `flag`) VALUES('5.8','ZKC58S','ZKC58S','480*648','480','648','1',NULL,'2',NULL,NULL,'1.56',NULL,NULL,'2019-05-12 10:34:15','1');
INSERT INTO `pricetag_model` (`size`, `model`, `oem_model`, `resolution`, `width`, `height`, `color`, `modelSpec`, `temperature`, `weight`, `battery`, `hardversion`, `isHighResolution`, `img_path`, `createdTime`, `flag`) VALUES('2.13','ZK21SF','ZK21SF','212*104','212','104','0',NULL,'2',NULL,NULL,'2.2.20',NULL,NULL,'2019-07-05 09:47:00','0');
INSERT INTO `pricetag_model` (`size`, `model`, `oem_model`, `resolution`, `width`, `height`, `color`, `modelSpec`, `temperature`, `weight`, `battery`, `hardversion`, `isHighResolution`, `img_path`, `createdTime`, `flag`) VALUES('1.54','zk59s','41','152*152','152','152','1',NULL,'1',NULL,NULL,'1.0',NULL,NULL,'2019-07-11 20:49:44','0');
INSERT INTO `pricetag_model` (`size`, `model`, `oem_model`, `resolution`, `width`, `height`, `color`, `modelSpec`, `temperature`, `weight`, `battery`, `hardversion`, `isHighResolution`, `img_path`, `createdTime`, `flag`) VALUES('2.13','2.13','是','200*100','200','100','0',NULL,'1',NULL,NULL,'十大',NULL,NULL,'2019-07-16 15:48:35','0');
INSERT INTO `pricetag_model` (`size`, `model`, `oem_model`, `resolution`, `width`, `height`, `color`, `modelSpec`, `temperature`, `weight`, `battery`, `hardversion`, `isHighResolution`, `img_path`, `createdTime`, `flag`) VALUES('1.54','ZKC15ST','12','152*152','152','152','1',NULL,'1',NULL,NULL,'313',NULL,NULL,'2019-07-23 11:30:12','1');

INSERT INTO attr_category (category_name, agency_id, merchant_id, store_id, add_time, flag) VALUES('default', <real-agency-id>, <real-merchat-id>, <real-store-id>, '2019-07-24 00:00:00', 1);

UPDATE template_attr SET category_id = 1 AND category_name='default';

UPDATE item SET is_flag=1;
UPDATE item SET attr_category='default' WHERE TYPE=1 AND is_flag=1;

UPDATE template_base SET attr_category='default';

2) 在azure服务器上通过docker安装FastDFS: https://my.oschina.net/u/4042451/blog/3079232

3) 转移图片数据到FastDFS:

package com.zk.controller;

import com.alibaba.fastjson.JSON;
import com.zk.common.ResponseResult;
import com.zk.common.ResultCode;
import com.zk.dao.ItemRepository;
import com.zk.dao.PictureRepository;
import com.zk.model.Item;
import com.zk.model.Picture;
import com.zk.util.FastDFSClient;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

@RestController
@RequestMapping("/dataUpgrade")
@ApiIgnore
@Slf4j
public class DataUpgradeController {

    @Autowired
    PictureRepository pictureRepository;

    @Autowired
    ItemRepository itemRepository;

    @Autowired
    FastDFSClient fastDFSClient;

    @RequestMapping(value = "/updatePic", method = RequestMethod.POST)
    public ResponseResult<String> uploadFile() {

        List<Item> itemList = itemRepository.findByType(2);
        if (!CollectionUtils.isEmpty(itemList)) {
            for (Item item : itemList) {
                byte[] coverPic = item.getCoverPic();
                if (ArrayUtils.isNotEmpty(coverPic)) {
                    String picSize = item.getCustFeature1();

                    log.info("updatePic for item: " + JSON.toJSONString(item));

                    List<Picture> pictureList = pictureRepository.findByItemIdAndPicSize(item.getId(), picSize);
                    if (!CollectionUtils.isEmpty(pictureList)) {
                        log.info("updatePic pic already exit for item " + item.getId());
                        continue;
                    }

                    String url = fastDFSClient.uploadBytes(coverPic);
                    Picture picture = new Picture();
                    picture.setPicUrl(url);
                    picture.setItemId(item.getId());
                    picture.setModelColor("Black and white and red");
                    picture.setPicSize(picSize);
                    picture.setDelFlag(1);
                    getESLModel(picSize, picture);
                    pictureRepository.save(picture);
                }
            }
        }

        return ResponseResult.buildSucc(ResultCode.SUCCESS);
    }


    private void getESLModel(String picSize, Picture picture) {
        if ("152*152".equalsIgnoreCase(picSize)) {
            picture.setModels("ZKC15S");
            picture.setModelSize("1.54");
        } else if ("250*122".equalsIgnoreCase(picSize) || "122*250".equalsIgnoreCase(picSize)) {
            picture.setModels("ZKC21S");
            picture.setModelSize("2.13");
        } else if ("296*128".equalsIgnoreCase(picSize) || "128*296".equalsIgnoreCase(picSize)) {
            picture.setModels("ZKC29S");
            picture.setModelSize("2.9");
        } else if ("212*104".equalsIgnoreCase(picSize) || "104*212".equalsIgnoreCase(picSize)) {
            picture.setModels("ZKC21F");
            picture.setModelSize("2.13");
        } else if ("300*400".equalsIgnoreCase(picSize) || "400*300".equalsIgnoreCase(picSize)) {
            picture.setModels("ZKC42S");
            picture.setModelSize("4.2");
        } else if ("480*648".equalsIgnoreCase(picSize) || "648*480".equalsIgnoreCase(picSize)) {
            picture.setModels("ZKC58S");
            picture.setModelSize("5.8");
        } else if ("528*880".equalsIgnoreCase(picSize) || "880*528".equalsIgnoreCase(picSize)) {
            picture.setModels("ZKC75S");
            picture.setModelSize("7.5");
        }
    }
}

通过Postman执行该方法过程中save picture出现的问题,及解决的方法:https://blog.csdn.net/weixin_43888133/article/details/90638302

07-26 03:39