Commit 24e0834c authored by 赵啸非's avatar 赵啸非

添加产品匹配

parent bacae242
package com.mortals.xhx.common.pdu.skin;
import java.util.Date;
import java.util.List;
import com.mortals.framework.model.BaseEntityLong;
/**
* 系统基础皮肤Pdu对象
*
* @author zxfei
* @date 2022-08-01
*/
public class SkinBasePdu extends BaseEntityLong {
private static final long serialVersionUID = 1L;
/**
* 所属种类,来源种类
*/
private Long categoryId;
/**
* 产品id
*/
private Long productId;
/**
* 产品编码
*/
private String productCode;
/**
* 产品名称
*/
private String productName;
/**
* css模板合成后文件地址
*/
private String cssFilePath;
/**
* 排序编号
*/
private Integer sortNum;
/**
* 产品皮肤名称,唯一且不为空
*/
private String name;
/**
* 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
*/
private String imageResolution;
private String imageResolutionValue;
/**
* 预览图片
*/
private String previewImagePath;
/**
* 开始 序号,主键,自增长
*/
private Long idStart;
/**
* 结束 序号,主键,自增长
*/
private Long idEnd;
/**
* 增加 序号,主键,自增长
*/
private Long idIncrement;
/**
* 序号,主键,自增长列表
*/
private List<Long> idList;
/**
* 开始 所属种类,来源种类
*/
private Long categoryIdStart;
/**
* 结束 所属种类,来源种类
*/
private Long categoryIdEnd;
/**
* 增加 所属种类,来源种类
*/
private Long categoryIdIncrement;
/**
* 所属种类,来源种类列表
*/
private List<Long> categoryIdList;
/**
* 开始 产品id
*/
private Long productIdStart;
/**
* 结束 产品id
*/
private Long productIdEnd;
/**
* 增加 产品id
*/
private Long productIdIncrement;
/**
* 产品id列表
*/
private List<Long> productIdList;
/**
* 产品名称
*/
private List<String> productNameList;
/**
* css模板合成后文件地址
*/
private List<String> cssFilePathList;
/**
* 开始 排序编号
*/
private Integer sortNumStart;
/**
* 结束 排序编号
*/
private Integer sortNumEnd;
/**
* 增加 排序编号
*/
private Integer sortNumIncrement;
/**
* 排序编号列表
*/
private List<Integer> sortNumList;
/**
* 开始 创建时间
*/
private String createTimeStart;
/**
* 结束 创建时间
*/
private String createTimeEnd;
/**
* 开始 创建用户
*/
private Long createUserIdStart;
/**
* 结束 创建用户
*/
private Long createUserIdEnd;
/**
* 增加 创建用户
*/
private Long createUserIdIncrement;
/**
* 创建用户列表
*/
private List<Long> createUserIdList;
/**
* 开始 修改时间
*/
private String updateTimeStart;
/**
* 结束 修改时间
*/
private String updateTimeEnd;
/**
* 产品皮肤名称,唯一且不为空
*/
private List<String> nameList;
/**
* 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
*/
private List<String> imageResolutionList;
/**
* 预览图片
*/
private List<String> previewImagePathList;
/**
* OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
*/
private List<SkinBasePdu> orConditionList;
/**
* AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
*/
private List<SkinBasePdu> andConditionList;
public SkinBasePdu() {
}
public String getImageResolutionValue() {
return imageResolutionValue;
}
public void setImageResolutionValue(String imageResolutionValue) {
this.imageResolutionValue = imageResolutionValue;
}
/**
* 获取 所属种类,来源种类
*
* @return Long
*/
public Long getCategoryId() {
return categoryId;
}
/**
* 设置 所属种类,来源种类
*
* @param categoryId
*/
public void setCategoryId(Long categoryId) {
this.categoryId = categoryId;
}
/**
* 获取 产品id
*
* @return Long
*/
public Long getProductId() {
return productId;
}
/**
* 设置 产品id
*
* @param productId
*/
public void setProductId(Long productId) {
this.productId = productId;
}
/**
* 获取 产品名称
*
* @return String
*/
public String getProductName() {
return productName;
}
/**
* 设置 产品名称
*
* @param productName
*/
public void setProductName(String productName) {
this.productName = productName;
}
/**
* 获取 css模板合成后文件地址
*
* @return String
*/
public String getCssFilePath() {
return cssFilePath;
}
/**
* 设置 css模板合成后文件地址
*
* @param cssFilePath
*/
public void setCssFilePath(String cssFilePath) {
this.cssFilePath = cssFilePath;
}
/**
* 获取 排序编号
*
* @return Integer
*/
public Integer getSortNum() {
return sortNum;
}
/**
* 设置 排序编号
*
* @param sortNum
*/
public void setSortNum(Integer sortNum) {
this.sortNum = sortNum;
}
/**
* 获取 产品皮肤名称,唯一且不为空
*
* @return String
*/
public String getName() {
return name;
}
/**
* 设置 产品皮肤名称,唯一且不为空
*
* @param name
*/
public void setName(String name) {
this.name = name;
}
/**
* 获取 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
*
* @return String
*/
public String getImageResolution() {
return imageResolution;
}
/**
* 设置 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
*
* @param imageResolution
*/
public void setImageResolution(String imageResolution) {
this.imageResolution = imageResolution;
}
/**
* 获取 预览图片
*
* @return String
*/
public String getPreviewImagePath() {
return previewImagePath;
}
/**
* 设置 预览图片
*
* @param previewImagePath
*/
public void setPreviewImagePath(String previewImagePath) {
this.previewImagePath = previewImagePath;
}
/**
* 获取 开始 序号,主键,自增长
*
* @return idStart
*/
public Long getIdStart() {
return this.idStart;
}
/**
* 设置 开始 序号,主键,自增长
*
* @param idStart
*/
public void setIdStart(Long idStart) {
this.idStart = idStart;
}
/**
* 获取 结束 序号,主键,自增长
*
* @return $idEnd
*/
public Long getIdEnd() {
return this.idEnd;
}
/**
* 设置 结束 序号,主键,自增长
*
* @param idEnd
*/
public void setIdEnd(Long idEnd) {
this.idEnd = idEnd;
}
/**
* 获取 增加 序号,主键,自增长
*
* @return idIncrement
*/
public Long getIdIncrement() {
return this.idIncrement;
}
/**
* 设置 增加 序号,主键,自增长
*
* @param idIncrement
*/
public void setIdIncrement(Long idIncrement) {
this.idIncrement = idIncrement;
}
/**
* 获取 序号,主键,自增长
*
* @return idList
*/
public List<Long> getIdList() {
return this.idList;
}
/**
* 设置 序号,主键,自增长
*
* @param idList
*/
public void setIdList(List<Long> idList) {
this.idList = idList;
}
/**
* 获取 开始 所属种类,来源种类
*
* @return categoryIdStart
*/
public Long getCategoryIdStart() {
return this.categoryIdStart;
}
/**
* 设置 开始 所属种类,来源种类
*
* @param categoryIdStart
*/
public void setCategoryIdStart(Long categoryIdStart) {
this.categoryIdStart = categoryIdStart;
}
/**
* 获取 结束 所属种类,来源种类
*
* @return $categoryIdEnd
*/
public Long getCategoryIdEnd() {
return this.categoryIdEnd;
}
/**
* 设置 结束 所属种类,来源种类
*
* @param categoryIdEnd
*/
public void setCategoryIdEnd(Long categoryIdEnd) {
this.categoryIdEnd = categoryIdEnd;
}
/**
* 获取 增加 所属种类,来源种类
*
* @return categoryIdIncrement
*/
public Long getCategoryIdIncrement() {
return this.categoryIdIncrement;
}
/**
* 设置 增加 所属种类,来源种类
*
* @param categoryIdIncrement
*/
public void setCategoryIdIncrement(Long categoryIdIncrement) {
this.categoryIdIncrement = categoryIdIncrement;
}
/**
* 获取 所属种类,来源种类
*
* @return categoryIdList
*/
public List<Long> getCategoryIdList() {
return this.categoryIdList;
}
/**
* 设置 所属种类,来源种类
*
* @param categoryIdList
*/
public void setCategoryIdList(List<Long> categoryIdList) {
this.categoryIdList = categoryIdList;
}
/**
* 获取 开始 产品id
*
* @return productIdStart
*/
public Long getProductIdStart() {
return this.productIdStart;
}
/**
* 设置 开始 产品id
*
* @param productIdStart
*/
public void setProductIdStart(Long productIdStart) {
this.productIdStart = productIdStart;
}
/**
* 获取 结束 产品id
*
* @return $productIdEnd
*/
public Long getProductIdEnd() {
return this.productIdEnd;
}
/**
* 设置 结束 产品id
*
* @param productIdEnd
*/
public void setProductIdEnd(Long productIdEnd) {
this.productIdEnd = productIdEnd;
}
/**
* 获取 增加 产品id
*
* @return productIdIncrement
*/
public Long getProductIdIncrement() {
return this.productIdIncrement;
}
/**
* 设置 增加 产品id
*
* @param productIdIncrement
*/
public void setProductIdIncrement(Long productIdIncrement) {
this.productIdIncrement = productIdIncrement;
}
/**
* 获取 产品id
*
* @return productIdList
*/
public List<Long> getProductIdList() {
return this.productIdList;
}
/**
* 设置 产品id
*
* @param productIdList
*/
public void setProductIdList(List<Long> productIdList) {
this.productIdList = productIdList;
}
/**
* 获取 产品名称
*
* @return productNameList
*/
public List<String> getProductNameList() {
return this.productNameList;
}
/**
* 设置 产品名称
*
* @param productNameList
*/
public void setProductNameList(List<String> productNameList) {
this.productNameList = productNameList;
}
/**
* 获取 css模板合成后文件地址
*
* @return cssFilePathList
*/
public List<String> getCssFilePathList() {
return this.cssFilePathList;
}
/**
* 设置 css模板合成后文件地址
*
* @param cssFilePathList
*/
public void setCssFilePathList(List<String> cssFilePathList) {
this.cssFilePathList = cssFilePathList;
}
/**
* 获取 开始 排序编号
*
* @return sortNumStart
*/
public Integer getSortNumStart() {
return this.sortNumStart;
}
/**
* 设置 开始 排序编号
*
* @param sortNumStart
*/
public void setSortNumStart(Integer sortNumStart) {
this.sortNumStart = sortNumStart;
}
/**
* 获取 结束 排序编号
*
* @return $sortNumEnd
*/
public Integer getSortNumEnd() {
return this.sortNumEnd;
}
/**
* 设置 结束 排序编号
*
* @param sortNumEnd
*/
public void setSortNumEnd(Integer sortNumEnd) {
this.sortNumEnd = sortNumEnd;
}
/**
* 获取 增加 排序编号
*
* @return sortNumIncrement
*/
public Integer getSortNumIncrement() {
return this.sortNumIncrement;
}
/**
* 设置 增加 排序编号
*
* @param sortNumIncrement
*/
public void setSortNumIncrement(Integer sortNumIncrement) {
this.sortNumIncrement = sortNumIncrement;
}
/**
* 获取 排序编号
*
* @return sortNumList
*/
public List<Integer> getSortNumList() {
return this.sortNumList;
}
/**
* 设置 排序编号
*
* @param sortNumList
*/
public void setSortNumList(List<Integer> sortNumList) {
this.sortNumList = sortNumList;
}
/**
* 获取 开始 创建时间
*
* @return createTimeStart
*/
public String getCreateTimeStart() {
return this.createTimeStart;
}
/**
* 设置 开始 创建时间
*
* @param createTimeStart
*/
public void setCreateTimeStart(String createTimeStart) {
this.createTimeStart = createTimeStart;
}
/**
* 获取 结束 创建时间
*
* @return createTimeEnd
*/
public String getCreateTimeEnd() {
return this.createTimeEnd;
}
/**
* 设置 结束 创建时间
*
* @param createTimeEnd
*/
public void setCreateTimeEnd(String createTimeEnd) {
this.createTimeEnd = createTimeEnd;
}
/**
* 获取 开始 创建用户
*
* @return createUserIdStart
*/
public Long getCreateUserIdStart() {
return this.createUserIdStart;
}
/**
* 设置 开始 创建用户
*
* @param createUserIdStart
*/
public void setCreateUserIdStart(Long createUserIdStart) {
this.createUserIdStart = createUserIdStart;
}
/**
* 获取 结束 创建用户
*
* @return $createUserIdEnd
*/
public Long getCreateUserIdEnd() {
return this.createUserIdEnd;
}
/**
* 设置 结束 创建用户
*
* @param createUserIdEnd
*/
public void setCreateUserIdEnd(Long createUserIdEnd) {
this.createUserIdEnd = createUserIdEnd;
}
/**
* 获取 增加 创建用户
*
* @return createUserIdIncrement
*/
public Long getCreateUserIdIncrement() {
return this.createUserIdIncrement;
}
/**
* 设置 增加 创建用户
*
* @param createUserIdIncrement
*/
public void setCreateUserIdIncrement(Long createUserIdIncrement) {
this.createUserIdIncrement = createUserIdIncrement;
}
/**
* 获取 创建用户
*
* @return createUserIdList
*/
public List<Long> getCreateUserIdList() {
return this.createUserIdList;
}
/**
* 设置 创建用户
*
* @param createUserIdList
*/
public void setCreateUserIdList(List<Long> createUserIdList) {
this.createUserIdList = createUserIdList;
}
/**
* 获取 开始 修改时间
*
* @return updateTimeStart
*/
public String getUpdateTimeStart() {
return this.updateTimeStart;
}
/**
* 设置 开始 修改时间
*
* @param updateTimeStart
*/
public void setUpdateTimeStart(String updateTimeStart) {
this.updateTimeStart = updateTimeStart;
}
/**
* 获取 结束 修改时间
*
* @return updateTimeEnd
*/
public String getUpdateTimeEnd() {
return this.updateTimeEnd;
}
/**
* 设置 结束 修改时间
*
* @param updateTimeEnd
*/
public void setUpdateTimeEnd(String updateTimeEnd) {
this.updateTimeEnd = updateTimeEnd;
}
/**
* 获取 产品皮肤名称,唯一且不为空
*
* @return nameList
*/
public List<String> getNameList() {
return this.nameList;
}
/**
* 设置 产品皮肤名称,唯一且不为空
*
* @param nameList
*/
public void setNameList(List<String> nameList) {
this.nameList = nameList;
}
/**
* 获取 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
*
* @return imageResolutionList
*/
public List<String> getImageResolutionList() {
return this.imageResolutionList;
}
/**
* 设置 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
*
* @param imageResolutionList
*/
public void setImageResolutionList(List<String> imageResolutionList) {
this.imageResolutionList = imageResolutionList;
}
/**
* 获取 预览图片
*
* @return previewImagePathList
*/
public List<String> getPreviewImagePathList() {
return this.previewImagePathList;
}
/**
* 设置 预览图片
*
* @param previewImagePathList
*/
public void setPreviewImagePathList(List<String> previewImagePathList) {
this.previewImagePathList = previewImagePathList;
}
/**
* 设置 序号,主键,自增长
*
* @param id
*/
public SkinBasePdu id(Long id) {
setId(id);
return this;
}
/**
* 设置 开始 序号,主键,自增长
*
* @param idStart
*/
public SkinBasePdu idStart(Long idStart) {
this.idStart = idStart;
return this;
}
/**
* 设置 结束 序号,主键,自增长
*
* @param idEnd
*/
public SkinBasePdu idEnd(Long idEnd) {
this.idEnd = idEnd;
return this;
}
/**
* 设置 增加 序号,主键,自增长
*
* @param idIncrement
*/
public SkinBasePdu idIncrement(Long idIncrement) {
this.idIncrement = idIncrement;
return this;
}
/**
* 设置 序号,主键,自增长
*
* @param idList
*/
public SkinBasePdu idList(List<Long> idList) {
this.idList = idList;
return this;
}
/**
* 设置 所属种类,来源种类
*
* @param categoryId
*/
public SkinBasePdu categoryId(Long categoryId) {
setCategoryId(categoryId);
return this;
}
/**
* 设置 开始 所属种类,来源种类
*
* @param categoryIdStart
*/
public SkinBasePdu categoryIdStart(Long categoryIdStart) {
this.categoryIdStart = categoryIdStart;
return this;
}
/**
* 设置 结束 所属种类,来源种类
*
* @param categoryIdEnd
*/
public SkinBasePdu categoryIdEnd(Long categoryIdEnd) {
this.categoryIdEnd = categoryIdEnd;
return this;
}
/**
* 设置 增加 所属种类,来源种类
*
* @param categoryIdIncrement
*/
public SkinBasePdu categoryIdIncrement(Long categoryIdIncrement) {
this.categoryIdIncrement = categoryIdIncrement;
return this;
}
/**
* 设置 所属种类,来源种类
*
* @param categoryIdList
*/
public SkinBasePdu categoryIdList(List<Long> categoryIdList) {
this.categoryIdList = categoryIdList;
return this;
}
/**
* 设置 产品id
*
* @param productId
*/
public SkinBasePdu productId(Long productId) {
setProductId(productId);
return this;
}
/**
* 设置 开始 产品id
*
* @param productIdStart
*/
public SkinBasePdu productIdStart(Long productIdStart) {
this.productIdStart = productIdStart;
return this;
}
/**
* 设置 结束 产品id
*
* @param productIdEnd
*/
public SkinBasePdu productIdEnd(Long productIdEnd) {
this.productIdEnd = productIdEnd;
return this;
}
/**
* 设置 增加 产品id
*
* @param productIdIncrement
*/
public SkinBasePdu productIdIncrement(Long productIdIncrement) {
this.productIdIncrement = productIdIncrement;
return this;
}
/**
* 设置 产品id
*
* @param productIdList
*/
public SkinBasePdu productIdList(List<Long> productIdList) {
this.productIdList = productIdList;
return this;
}
/**
* 设置 产品名称
*
* @param productName
*/
public SkinBasePdu productName(String productName) {
setProductName(productName);
return this;
}
/**
* 设置 产品名称
*
* @param productNameList
*/
public SkinBasePdu productNameList(List<String> productNameList) {
this.productNameList = productNameList;
return this;
}
/**
* 设置 css模板合成后文件地址
*
* @param cssFilePath
*/
public SkinBasePdu cssFilePath(String cssFilePath) {
setCssFilePath(cssFilePath);
return this;
}
/**
* 设置 css模板合成后文件地址
*
* @param cssFilePathList
*/
public SkinBasePdu cssFilePathList(List<String> cssFilePathList) {
this.cssFilePathList = cssFilePathList;
return this;
}
/**
* 设置 排序编号
*
* @param sortNum
*/
public SkinBasePdu sortNum(Integer sortNum) {
setSortNum(sortNum);
return this;
}
/**
* 设置 开始 排序编号
*
* @param sortNumStart
*/
public SkinBasePdu sortNumStart(Integer sortNumStart) {
this.sortNumStart = sortNumStart;
return this;
}
/**
* 设置 结束 排序编号
*
* @param sortNumEnd
*/
public SkinBasePdu sortNumEnd(Integer sortNumEnd) {
this.sortNumEnd = sortNumEnd;
return this;
}
/**
* 设置 增加 排序编号
*
* @param sortNumIncrement
*/
public SkinBasePdu sortNumIncrement(Integer sortNumIncrement) {
this.sortNumIncrement = sortNumIncrement;
return this;
}
/**
* 设置 排序编号
*
* @param sortNumList
*/
public SkinBasePdu sortNumList(List<Integer> sortNumList) {
this.sortNumList = sortNumList;
return this;
}
/**
* 设置 创建用户
*
* @param createUserId
*/
public SkinBasePdu createUserId(Long createUserId) {
setCreateUserId(createUserId);
return this;
}
/**
* 设置 开始 创建用户
*
* @param createUserIdStart
*/
public SkinBasePdu createUserIdStart(Long createUserIdStart) {
this.createUserIdStart = createUserIdStart;
return this;
}
/**
* 设置 结束 创建用户
*
* @param createUserIdEnd
*/
public SkinBasePdu createUserIdEnd(Long createUserIdEnd) {
this.createUserIdEnd = createUserIdEnd;
return this;
}
/**
* 设置 增加 创建用户
*
* @param createUserIdIncrement
*/
public SkinBasePdu createUserIdIncrement(Long createUserIdIncrement) {
this.createUserIdIncrement = createUserIdIncrement;
return this;
}
/**
* 设置 创建用户
*
* @param createUserIdList
*/
public SkinBasePdu createUserIdList(List<Long> createUserIdList) {
this.createUserIdList = createUserIdList;
return this;
}
/**
* 设置 产品皮肤名称,唯一且不为空
*
* @param name
*/
public SkinBasePdu name(String name) {
setName(name);
return this;
}
/**
* 设置 产品皮肤名称,唯一且不为空
*
* @param nameList
*/
public SkinBasePdu nameList(List<String> nameList) {
this.nameList = nameList;
return this;
}
/**
* 设置 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
*
* @param imageResolution
*/
public SkinBasePdu imageResolution(String imageResolution) {
setImageResolution(imageResolution);
return this;
}
/**
* 设置 分辨率 (1.1920*1080,2.1080*1920,3.1280*1280)
*
* @param imageResolutionList
*/
public SkinBasePdu imageResolutionList(List<String> imageResolutionList) {
this.imageResolutionList = imageResolutionList;
return this;
}
public String getProductCode() {
return productCode;
}
public void setProductCode(String productCode) {
this.productCode = productCode;
}
/**
* 设置 预览图片
*
* @param previewImagePath
*/
public SkinBasePdu previewImagePath(String previewImagePath) {
setPreviewImagePath(previewImagePath);
return this;
}
/**
* 设置 预览图片
*
* @param previewImagePathList
*/
public SkinBasePdu previewImagePathList(List<String> previewImagePathList) {
this.previewImagePathList = previewImagePathList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
*
* @return orConditionList
*/
public List<SkinBasePdu> getOrConditionList() {
return this.orConditionList;
}
/**
* 设置 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
*
* @param orConditionList
*/
public void setOrConditionList(List<SkinBasePdu> orConditionList) {
this.orConditionList = orConditionList;
}
/**
* 获取 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
*
* @return andConditionList
*/
public List<SkinBasePdu> getAndConditionList() {
return this.andConditionList;
}
/**
* 设置 AND条件集合,列表项之间是AND,项内容之间是OR,如:(list[0].1 or list[0].2) and (list[1].3 or list[1].4)
*
* @param andConditionList
*/
public void setAndConditionList(List<SkinBasePdu> andConditionList) {
this.andConditionList = andConditionList;
}
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof SkinBasePdu) {
SkinBasePdu tmp = (SkinBasePdu) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue() {
this.categoryId = null;
this.productId = null;
this.productName = "";
this.cssFilePath = "";
this.sortNum = null;
this.name = "";
this.imageResolution = "1";
this.previewImagePath = "";
}
}
\ No newline at end of file
package com.mortals.xhx.feign.skin;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.skin.SkinBasePdu;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.common.Rest;
import com.mortals.xhx.feign.IFeign;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 系统基础皮肤 Feign接口
* @author zxfei
* @date 2022-08-01
*/
@FeignClient(name = "base-manager", path = "/base", fallbackFactory = SkinBaseFeignFallbackFactory.class)
public interface ISkinBaseFeign extends IFeign {
/**
* 查看系统基础皮肤列表
*
* @param skinBasePdu
* @return
*/
@PostMapping(value = "/skin/base/list")
Rest<RespData<List<SkinBasePdu>>> list(@RequestBody SkinBasePdu skinBasePdu);
/**
* 查看系统基础皮肤
*
* @param id
* @return
*/
@GetMapping(value = "/skin/base/info")
Rest<SkinBasePdu> info(@RequestParam(value = "id") Long id);
/**
* 删除系统基础皮肤
*
* @param ids
* @return
*/
@GetMapping(value = "/skin/base/delete")
Rest<Void> delete(Long[] ids,@RequestHeader("Authorization") String authorization);
/**
* 系统基础皮肤保存更新
*
* @param skinBasePdu
* @return
*/
@PostMapping(value = "/skin/base/save")
Rest<RespData<SkinBasePdu>> save(@RequestBody SkinBasePdu skinBasePdu,@RequestHeader("Authorization") String authorization);
}
@Slf4j
@Component
class SkinBaseFeignFallbackFactory implements FallbackFactory<ISkinBaseFeign> {
@Override
public ISkinBaseFeign create(Throwable t) {
return new ISkinBaseFeign() {
@Override
public Rest<RespData<List<SkinBasePdu>>> list(SkinBasePdu skinBasePdu) {
return Rest.fail("暂时无法获取系统基础皮肤列表,请稍后再试!");
}
@Override
public Rest<SkinBasePdu> info(Long id) {
return Rest.fail("暂时无法获取系统基础皮肤详细,请稍后再试!");
}
@Override
public Rest<Void> delete(Long[] ids, String authorization) {
return Rest.fail("暂时无法删除系统基础皮肤,请稍后再试!");
}
@Override
public Rest<RespData<SkinBasePdu>> save(SkinBasePdu skinBasePdu, String authorization) {
return Rest.fail("暂时无法保存系统基础皮肤,请稍后再试!");
}
};
}
}
ALTER TABLE mortals_xhx_device ADD COLUMN `skinId` bigint (20) COMMENT '皮肤id' AFTER productName;
ALTER TABLE mortals_xhx_device ADD COLUMN `skinName` varchar (512) COMMENT '皮肤名称' AFTER skinId;
ALTER TABLE mortals_xhx_device ADD COLUMN `homeUrl` varchar (512) COMMENT '首页地址' AFTER skinName;
ALTER TABLE mortals_xhx_product ADD COLUMN `skinId` bigint (20) COMMENT '皮肤id' AFTER productCode;
ALTER TABLE mortals_xhx_product ADD COLUMN `skinName` varchar (512) COMMENT '皮肤名称' AFTER skinId;
\ No newline at end of file
......@@ -202,6 +202,10 @@ ins,a {
}
}
.is-active{
background-color: red;
}
.mobile-table-card{
margin: 10px auto;
padding: 10px;
......
......@@ -56,6 +56,7 @@
<div class="layout-submenu">
<ul class="submenu-list flex">
<li v-for='item in submenu.children' :key='item.id'>
<a :href="item.path" target="blank" v-if='item.isOut'>{{item.name}}</a>
<router-link :to="item.path" :active='group === item.path' v-else>{{item.name}}</router-link>
</li>
......
......@@ -42,8 +42,6 @@ const router = new Router({
builder('sitestat/maplist', 'sitestat/maplist'),//地图站点
builder('sitestat/mapDetail', 'sitestat/mapDetail'),//地图设备
...restBuilder('platform', 'platform'),//平台
...restBuilder('product', 'product'),//产品
...restBuilder('device', 'device'),//设备
......@@ -154,4 +152,4 @@ router.beforeEach((to, from, next) => {
})
export default router;
\ No newline at end of file
export default router;
......@@ -71,6 +71,16 @@
v-model="form.lati"
placeholder="请输入纬度"
/> -->
<Field
label="默认首页"
prop="skinId"
v-model="form.skinId"
@change="skinSelect"
:enumData="dict.skinProductCodeMap[form.productCode]"
type="select"
placeholder="选择首页"
/>
<Field
label="所属楼栋"
prop="deviceInBuilding"
......@@ -112,7 +122,7 @@
placeholder="请选择是否接收异常短信"
/>
<Field
<Field
label="利旧设备"
prop="source"
v-model="form.source"
......@@ -184,7 +194,8 @@ export default {
"deviceStatus",
"enabled",
"deviceFirmId",
"source",
"source",
"skinId",
],
toDate: ["defectsLiabilityPeriod"],
......@@ -206,12 +217,16 @@ export default {
},
methods: {
skinSelect(val) {
this.form.skinName =
this.dict.skinProductCodeMap[this.form.productCode][val];
},
/** 编辑 */
edit(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = this.pageInfo.editUrl;
this.siteName = row.siteName;
this.siteName = row.siteName;
this.siteCode = row.siteCode;
this.getData();
this.pageInfo.type = "edit";
......@@ -225,7 +240,7 @@ export default {
this.form.siteId = row.siteId;
this.siteName = row.siteName;
this.siteCode = row.siteCode;
console.log("row",row)
console.log("row", row);
this.getData();
this.title = "新增设备";
},
......@@ -246,12 +261,11 @@ export default {
afterRender(data) {
this.open = true;
if (this.pageInfo.type == "add"||this.pageInfo.type == "edit") {
if (this.pageInfo.type == "add" || this.pageInfo.type == "edit") {
this.form.siteName = this.siteName;
this.form.siteCode = this.siteCode;
}
console.log("form:", this.form);
console.log("form:", this.form);
},
afterSubmit(data) {
......
......@@ -12,7 +12,10 @@
<Field :span="22" label="产品名称" prop="productName" v-model="form.productName" placeholder="请输入产品名称,名称唯一"/>
<Field :span="22" label="产品编码" prop="productCode" v-model="form.productCode" placeholder="请输入产品编码"/>
<Field :span="22" label="首页地址" prop="homeUrl" v-model="form.homeUrl" placeholder="请输入首页地址"/>
<Field :span="22" label="默认首页" prop="skinId" v-model="form.skinId" @change="skinSelect" :enumData="dict.skinProductCodeMap[form.productCode]" type="select" placeholder="请输入产品名称,名称唯一"/>
<!-- <Field :span="22" label="首页地址" prop="homeUrl" v-model="form.homeUrl" placeholder="请输入首页地址"/> -->
<Field :span="22" label="备注" prop="productRemark" v-model="form.productRemark" type="textarea" placeholder="请输入备注"/>
</el-row>
......@@ -43,7 +46,7 @@
// 是否显示弹出层
open: false,
direction:"rtl",
toString:['platformId'
toString:['platformId','skinId'
],
toDate:[
],
......@@ -62,10 +65,16 @@
{max: 512,message: "最多只能录入512个字符",trigger: "blur",},
]
}
};
};
},
methods: {
skinSelect(val){
console.log("val:"+val)
console.log("label:"+this.dict.skinProductCodeMap[this.form.productCode][val])
this.form.skinName=this.dict.skinProductCodeMap[this.form.productCode][val]
},
/** 编辑 */
edit(row) {
this.reset()
......
<template>
<div class="page">
<LayoutTable :data="tableData" notDel notSearch :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
<div class="page">
<LayoutTable :data="tableData" notDel notSearch :config="tableConfig">
</LayoutTable>
<drawer-show ref="drawerform" @ok="getData" />
</div>
</template>
<script>
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "ProductList",
components: {
drawerShow
},
mixins: [table],
created() {
},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
/** 表单弹出框模式需引入 */
import drawerShow from "./drawershow";
import table from "@/assets/mixins/table";
export default {
name: "ProductList",
components: {
drawerShow,
},
mixins: [table],
created() {},
methods: {
/** 重写新增方法 */
toAdd(row) {
this.$refs.drawerform.add(row);
},
/** 重写编辑方法 */
toEdit(row) {
this.$refs.drawerform.edit(row);
},
/** 重写查看方法 */
toView(row) {
this.$refs.drawerform.view(row);
},
},
// beforeRouteEnter(to, from, next) {next(vm => {
// // 通过 `vm` 访问组件实例
// console.log(vm)
// })},
data() {
return {
config: {
search: [],
columns: [
// {type: "selection", width: 60},
{ type: "index", label: "序号", width: 50 },
},
data() {
return {
config: {
search: [
],
columns: [
// {type: "selection", width: 60},
{type: "index",label: "序号",width: 50},
{ label: "关联平台", prop: "platformId", formatter: this.formatter },
{label: "关联平台", prop: "platformId", formatter: this.formatter},
{ label: "产品名称", prop: "productName" },
{label: "产品名称", prop: "productName"},
{ label: "产品编码", prop: "productCode" },
{label: "产品编码", prop: "productCode"},
{label: "备注", prop: "productRemark"},
{
label: "操作",
width: 240,
formatter: row => {
return (
<table-buttons noAdd row={row} onEdit={this.toEdit} onView={this.toView} onDel={this.toDel} />
);
}
}
]
}
};
}
{ label: "备注", prop: "productRemark" },
{
label: "操作",
width: 240,
formatter: (row) => {
return (
<table-buttons
noAdd
row={row}
onEdit={this.toEdit}
onView={this.toView}
onDel={this.toDel}
/>
);
},
},
],
},
};
},
};
</script>
\ No newline at end of file
......@@ -2,6 +2,7 @@ package com.mortals.xhx.busiz.web;
import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.net.url.UrlBuilder;
import cn.hutool.core.util.IdUtil;
import cn.hutool.extra.servlet.ServletUtil;
import com.alibaba.fastjson.JSON;
......@@ -65,8 +66,7 @@ import java.util.List;
import java.util.stream.Collectors;
import static com.mortals.framework.ap.SysConstains.PROP_PLATFORM_MARK;
import static com.mortals.xhx.common.key.Constant.DES_STR;
import static com.mortals.xhx.common.key.Constant.ENCRYPT_STR;
import static com.mortals.xhx.common.key.Constant.*;
import static com.mortals.xhx.common.key.ErrorCode.*;
import static com.mortals.xhx.common.key.RedisKey.KEY_TOKEN_API_CACHE;
......@@ -165,7 +165,9 @@ public class DeviceApiController {
RegisterResp registerResp = new RegisterResp();
registerResp.setRabbmitInfo(authInfo);
ServerInfo serverInfo = new ServerInfo();
serverInfo.setHomeUrl(productEntity.getHomeUrl() == null ? "" : productEntity.getHomeUrl());
//判断设备是否设置了url 如果设置了,则用设备的 否则用产品的
buildHomeUrl(deviceEntity, productEntity, serverInfo);
serverInfo.setServerUrl(platformEntity.getSendUrl());
registerResp.setServiceInfo(serverInfo);
DeviceInfo deviceInfo = new DeviceInfo();
......@@ -200,6 +202,20 @@ public class DeviceApiController {
return JSON.toJSONString(rsp);
}
private void buildHomeUrl(DeviceEntity deviceEntity, ProductEntity productEntity, ServerInfo serverInfo) {
String homeUrl="";
if(!ObjectUtils.isEmpty(productEntity.getHomeUrl())){
homeUrl= productEntity.getHomeUrl();
}
if(!ObjectUtils.isEmpty(deviceEntity.getHomeUrl())){
homeUrl= deviceEntity.getHomeUrl();
}
String domain = GlobalSysInfo.getParamValue(PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11091");
serverInfo.setHomeUrl(UrlBuilder.of(domain).addPath(homeUrl).toString());
}
/**
* 获取Token
*
......@@ -370,7 +386,7 @@ public class DeviceApiController {
registerResp.setRabbmitInfo(authInfo);
ServerInfo serverInfo = new ServerInfo();
serverInfo.setHomeUrl(productEntity.getHomeUrl());
buildHomeUrl(deviceEntity, productEntity, serverInfo);
serverInfo.setServerUrl(platformEntity.getSendUrl());
registerResp.setServiceInfo(serverInfo);
......
......@@ -52,6 +52,12 @@ public final class Constant {
public static final String HEARTBEAT_TIMEOUT = "heartbeat_timeout";
/**
* 设备首页基础path
*/
public static final String DEVICE_BASEHOME_PATH = "/homeDeviceUrl";
/**
* 基础服务平台鉴权token
*/
......@@ -75,8 +81,6 @@ public final class Constant {
*/
public final static String PARAM_SERVER_HTTP_URL = "server_http_url";
/**
* rabbmit exchange分隔符
*/
......
......@@ -165,6 +165,19 @@ public class DeviceEntity extends DeviceVo {
*/
private Integer source;
/**
* 皮肤id
*/
private Long skinId;
/**
* 皮肤名称
*/
private String skinName;
/**
* 首页地址
*/
private String homeUrl;
public DeviceEntity(){}
......@@ -660,7 +673,29 @@ public class DeviceEntity extends DeviceVo {
}
public Long getSkinId() {
return skinId;
}
public void setSkinId(Long skinId) {
this.skinId = skinId;
}
public String getSkinName() {
return skinName;
}
public void setSkinName(String skinName) {
this.skinName = skinName;
}
public String getHomeUrl() {
return homeUrl;
}
public void setHomeUrl(String homeUrl) {
this.homeUrl = homeUrl;
}
@Override
public int hashCode() {
......@@ -789,5 +824,11 @@ public class DeviceEntity extends DeviceVo {
this.deleted = 0;
this.source = 1;
this.skinId = null;
this.skinName = "";
this.homeUrl = "";
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ import com.mortals.xhx.module.device.model.DeviceEntity;
* 设备查询对象
*
* @author zxfei
* @date 2022-07-11
* @date 2022-08-01
*/
public class DeviceQuery extends DeviceEntity {
/** 开始 主键ID,主键,自增长 */
......@@ -241,16 +241,16 @@ public class DeviceQuery extends DeviceEntity {
/** 是否删除(0.否,1.是)列表 */
private List <Integer> deletedList;
/** 开始 收不来源(0.旧设备,1.新设备) */
/** 开始 设备来源(0.旧设备,1.新设备) */
private Integer sourceStart;
/** 结束 收不来源(0.旧设备,1.新设备) */
/** 结束 设备来源(0.旧设备,1.新设备) */
private Integer sourceEnd;
/** 增加 收不来源(0.旧设备,1.新设备) */
/** 增加 设备来源(0.旧设备,1.新设备) */
private Integer sourceIncrement;
/** 收不来源(0.旧设备,1.新设备)列表 */
/** 设备来源(0.旧设备,1.新设备)列表 */
private List <Integer> sourceList;
/** 开始 创建用户 */
......@@ -289,6 +289,24 @@ public class DeviceQuery extends DeviceEntity {
/** 结束 更新时间 */
private String updateTimeEnd;
/** 开始 皮肤id */
private Long skinIdStart;
/** 结束 皮肤id */
private Long skinIdEnd;
/** 增加 皮肤id */
private Long skinIdIncrement;
/** 皮肤id列表 */
private List <Long> skinIdList;
/** 皮肤名称 */
private List<String> skinNameList;
/** 首页地址 */
private List<String> homeUrlList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<DeviceQuery> orConditionList;
......@@ -1511,7 +1529,7 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 获取 开始 收不来源(0.旧设备,1.新设备)
* 获取 开始 设备来源(0.旧设备,1.新设备)
* @return sourceStart
*/
public Integer getSourceStart(){
......@@ -1519,7 +1537,7 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 设置 开始 收不来源(0.旧设备,1.新设备)
* 设置 开始 设备来源(0.旧设备,1.新设备)
* @param sourceStart
*/
public void setSourceStart(Integer sourceStart){
......@@ -1527,7 +1545,7 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 获取 结束 收不来源(0.旧设备,1.新设备)
* 获取 结束 设备来源(0.旧设备,1.新设备)
* @return $sourceEnd
*/
public Integer getSourceEnd(){
......@@ -1535,7 +1553,7 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 设置 结束 收不来源(0.旧设备,1.新设备)
* 设置 结束 设备来源(0.旧设备,1.新设备)
* @param sourceEnd
*/
public void setSourceEnd(Integer sourceEnd){
......@@ -1543,7 +1561,7 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 获取 增加 收不来源(0.旧设备,1.新设备)
* 获取 增加 设备来源(0.旧设备,1.新设备)
* @return sourceIncrement
*/
public Integer getSourceIncrement(){
......@@ -1551,7 +1569,7 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 设置 增加 收不来源(0.旧设备,1.新设备)
* 设置 增加 设备来源(0.旧设备,1.新设备)
* @param sourceIncrement
*/
public void setSourceIncrement(Integer sourceIncrement){
......@@ -1559,7 +1577,7 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 获取 收不来源(0.旧设备,1.新设备)
* 获取 设备来源(0.旧设备,1.新设备)
* @return sourceList
*/
public List<Integer> getSourceList(){
......@@ -1567,7 +1585,7 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 设置 收不来源(0.旧设备,1.新设备)
* 设置 设备来源(0.旧设备,1.新设备)
* @param sourceList
*/
public void setSourceList(List<Integer> sourceList){
......@@ -1766,6 +1784,100 @@ public class DeviceQuery extends DeviceEntity {
this.updateTimeEnd = updateTimeEnd;
}
/**
* 获取 开始 皮肤id
* @return skinIdStart
*/
public Long getSkinIdStart(){
return this.skinIdStart;
}
/**
* 设置 开始 皮肤id
* @param skinIdStart
*/
public void setSkinIdStart(Long skinIdStart){
this.skinIdStart = skinIdStart;
}
/**
* 获取 结束 皮肤id
* @return $skinIdEnd
*/
public Long getSkinIdEnd(){
return this.skinIdEnd;
}
/**
* 设置 结束 皮肤id
* @param skinIdEnd
*/
public void setSkinIdEnd(Long skinIdEnd){
this.skinIdEnd = skinIdEnd;
}
/**
* 获取 增加 皮肤id
* @return skinIdIncrement
*/
public Long getSkinIdIncrement(){
return this.skinIdIncrement;
}
/**
* 设置 增加 皮肤id
* @param skinIdIncrement
*/
public void setSkinIdIncrement(Long skinIdIncrement){
this.skinIdIncrement = skinIdIncrement;
}
/**
* 获取 皮肤id
* @return skinIdList
*/
public List<Long> getSkinIdList(){
return this.skinIdList;
}
/**
* 设置 皮肤id
* @param skinIdList
*/
public void setSkinIdList(List<Long> skinIdList){
this.skinIdList = skinIdList;
}
/**
* 获取 皮肤名称
* @return skinNameList
*/
public List<String> getSkinNameList(){
return this.skinNameList;
}
/**
* 设置 皮肤名称
* @param skinNameList
*/
public void setSkinNameList(List<String> skinNameList){
this.skinNameList = skinNameList;
}
/**
* 获取 首页地址
* @return homeUrlList
*/
public List<String> getHomeUrlList(){
return this.homeUrlList;
}
/**
* 设置 首页地址
* @param homeUrlList
*/
public void setHomeUrlList(List<String> homeUrlList){
this.homeUrlList = homeUrlList;
}
/**
* 设置 主键ID,主键,自增长
* @param id
......@@ -2716,7 +2828,7 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 设置 收不来源(0.旧设备,1.新设备)
* 设置 设备来源(0.旧设备,1.新设备)
* @param source
*/
public DeviceQuery source(Integer source){
......@@ -2725,7 +2837,7 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 设置 开始 收不来源(0.旧设备,1.新设备)
* 设置 开始 设备来源(0.旧设备,1.新设备)
* @param sourceStart
*/
public DeviceQuery sourceStart(Integer sourceStart){
......@@ -2734,7 +2846,7 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 设置 结束 收不来源(0.旧设备,1.新设备)
* 设置 结束 设备来源(0.旧设备,1.新设备)
* @param sourceEnd
*/
public DeviceQuery sourceEnd(Integer sourceEnd){
......@@ -2743,7 +2855,7 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 设置 增加 收不来源(0.旧设备,1.新设备)
* 设置 增加 设备来源(0.旧设备,1.新设备)
* @param sourceIncrement
*/
public DeviceQuery sourceIncrement(Integer sourceIncrement){
......@@ -2752,7 +2864,7 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 设置 收不来源(0.旧设备,1.新设备)
* 设置 设备来源(0.旧设备,1.新设备)
* @param sourceList
*/
public DeviceQuery sourceList(List<Integer> sourceList){
......@@ -2852,6 +2964,89 @@ public class DeviceQuery extends DeviceEntity {
}
/**
* 设置 皮肤id
* @param skinId
*/
public DeviceQuery skinId(Long skinId){
setSkinId(skinId);
return this;
}
/**
* 设置 开始 皮肤id
* @param skinIdStart
*/
public DeviceQuery skinIdStart(Long skinIdStart){
this.skinIdStart = skinIdStart;
return this;
}
/**
* 设置 结束 皮肤id
* @param skinIdEnd
*/
public DeviceQuery skinIdEnd(Long skinIdEnd){
this.skinIdEnd = skinIdEnd;
return this;
}
/**
* 设置 增加 皮肤id
* @param skinIdIncrement
*/
public DeviceQuery skinIdIncrement(Long skinIdIncrement){
this.skinIdIncrement = skinIdIncrement;
return this;
}
/**
* 设置 皮肤id
* @param skinIdList
*/
public DeviceQuery skinIdList(List<Long> skinIdList){
this.skinIdList = skinIdList;
return this;
}
/**
* 设置 皮肤名称
* @param skinName
*/
public DeviceQuery skinName(String skinName){
setSkinName(skinName);
return this;
}
/**
* 设置 皮肤名称
* @param skinNameList
*/
public DeviceQuery skinNameList(List<String> skinNameList){
this.skinNameList = skinNameList;
return this;
}
/**
* 设置 首页地址
* @param homeUrl
*/
public DeviceQuery homeUrl(String homeUrl){
setHomeUrl(homeUrl);
return this;
}
/**
* 设置 首页地址
* @param homeUrlList
*/
public DeviceQuery homeUrlList(List<String> homeUrlList){
this.homeUrlList = homeUrlList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
......@@ -2,9 +2,12 @@ package com.mortals.xhx.module.device.service.impl;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.PatternPool;
import cn.hutool.core.net.url.UrlBuilder;
import cn.hutool.core.net.url.UrlPath;
import cn.hutool.core.util.StrUtil;
import cn.hutool.core.util.URLUtil;
import com.alibaba.fastjson.JSON;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
......@@ -36,6 +39,7 @@ import com.mortals.xhx.module.product.model.ProductEntity;
import com.mortals.xhx.module.product.model.ProductQuery;
import com.mortals.xhx.module.product.service.ProductService;
import com.mortals.xhx.queue.*;
import com.sun.javafx.fxml.builder.URLBuilder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -45,6 +49,7 @@ import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.nio.charset.Charset;
import java.util.*;
import java.util.stream.Collectors;
......@@ -304,7 +309,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
&& entity.getSwitchSend()) {
//http://192.168.0.98:8090/inter/device/deviceIn
if (PatternPool.URL_HTTP.matcher(platformEntity.getSendUrl()).find()) {
ApiResp<String> resp = messageService.sendThirdParty(URLUtil.completeUrl(platformEntity.getSendUrl(), thirdPartyPath), deviceReq);
ApiResp<String> resp = messageService.sendThirdParty(UrlBuilder.of(platformEntity.getSendUrl()).addPath(thirdPartyPath).build(), deviceReq);
log.info("sendThirtyis resp ==>{}", JSON.toJSONString(resp));
} else {
throw new AppException("http send url 不合法!" + platformEntity.getSendUrl());
......@@ -439,7 +444,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
DeviceMapEntity deviceMapEntity = new DeviceMapEntity();
deviceMapEntity.setProductId(item.getKey());
ProductEntity productEntity = productService.get(item.getKey());
deviceMapEntity.setProductCode(productEntity==null?"":productEntity.getProductCode());
deviceMapEntity.setProductCode(productEntity == null ? "" : productEntity.getProductCode());
if (ObjectUtils.isEmpty(item.getValue())) {
deviceMapEntity.setDeviceList(Collections.EMPTY_LIST);
} else {
......@@ -465,7 +470,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
curLati = centerlati.add(latiStep.multiply(new BigDecimal(i)));
}
for (int j = 1; j <= collect.get(i-1).getDeviceList().size(); j++) {
for (int j = 1; j <= collect.get(i - 1).getDeviceList().size(); j++) {
//偶数加,奇数减
BigDecimal curLng = new BigDecimal(longitude);
if (j % 2 == 1) {
......@@ -473,7 +478,7 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
} else {
curLng = centerLng.add(lngStep.multiply(new BigDecimal(j)));
}
DeviceEntity deviceEntity = collect.get(i-1).getDeviceList().get(j-1);
DeviceEntity deviceEntity = collect.get(i - 1).getDeviceList().get(j - 1);
deviceEntity.setLon(curLng.setScale(6, RoundingMode.HALF_UP).toString());
deviceEntity.setLati(curLati.setScale(6, RoundingMode.HALF_UP).toString());
}
......@@ -603,10 +608,38 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
}
}
//默认时,需拼接homeUrl
// if(!ObjectUtils.isEmpty(entity.getSkinName())){
//
// if (!ObjectUtils.isEmpty(entity.getProductCode())) {
//
// entity.setHomeUrl(entity.getProductCode().);
// }
// }
updateDeviceHomeUrl(entity);
super.saveBefore(entity, context);
}
@Override
protected void updateBefore(DeviceEntity entity, Context context) throws AppException {
updateDeviceHomeUrl(entity);
super.updateBefore(entity, context);
}
private void updateDeviceHomeUrl(DeviceEntity entity) {
if (!ObjectUtils.isEmpty(entity.getSkinName())) {
String path = UrlPath.of(Constant.DEVICE_BASEHOME_PATH, Charset.defaultCharset())
.add(entity.getProductCode())
.add(entity.getSkinName())
.toString();
entity.setHomeUrl(path);
}
}
public static void main(String[] args) {
BigDecimal bigDecimal = new BigDecimal("104.22241");
BigDecimal add = bigDecimal.add(new BigDecimal("0.01"));
......
......@@ -27,7 +27,9 @@ import com.mortals.xhx.common.model.DefaultTbQueueMsgHeaders;
import com.mortals.xhx.common.model.MessageHeader;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.common.pdu.skin.SkinBasePdu;
import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.feign.skin.ISkinBaseFeign;
import com.mortals.xhx.module.device.model.DeviceEntity;
import com.mortals.xhx.module.device.model.DeviceMapEntity;
import com.mortals.xhx.module.device.model.DeviceQuery;
......@@ -80,6 +82,8 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
private MessageService messageService;
@Autowired
private UploadService uploadService;
@Autowired
private ISkinBaseFeign skinBaseFeign;
public DeviceController() {
super.setModuleDesc("设备");
......@@ -101,7 +105,11 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
//返回产品列表及其样式
//productService.find(new ProductEntity()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getProductName())).
Rest<RespData<List<SkinBasePdu>>> resp = skinBaseFeign.list(new SkinBasePdu());
if (resp.getCode() == YesNoEnum.YES.getValue()) {
Map<String, Map<String, String>> skinProductCodeMap = resp.getData().getData().stream().collect(Collectors.groupingBy(x -> x.getProductCode(), Collectors.toMap(a -> a.getImageResolution(), b -> b.getImageResolutionValue(),(o,n)->n)));
this.addDict(model, "skinProductCodeMap", skinProductCodeMap);
}
super.init(model, context);
}
......@@ -264,4 +272,12 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
}
@Override
protected int editAfter(Long id, Map<String, Object> model, DeviceEntity entity, Context context) throws AppException {
if(!ObjectUtils.isEmpty(entity.getProductId())){
ProductEntity productEntity = productService.get(entity.getProductId());
entity.setProductCode(productEntity.getProductCode());
}
return super.editAfter(id, model, entity, context);
}
}
\ No newline at end of file
package com.mortals.xhx.module.product.model;
import java.util.List;
import java.util.ArrayList;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.product.model.vo.ProductVo;
/**
* 产品实体对象
*
* @author zxfei
* @date 2022-07-14
* @date 2022-08-01
*/
public class ProductEntity extends ProductVo {
......@@ -33,6 +37,15 @@ public class ProductEntity extends ProductVo {
* 备注
*/
private String productRemark;
/**
* 皮肤id
*/
private Long skinId;
/**
* 皮肤名称
*/
@Excel(name = "皮肤名称")
private String skinName;
......@@ -107,6 +120,34 @@ public class ProductEntity extends ProductVo {
public void setProductRemark(String productRemark){
this.productRemark = productRemark;
}
/**
* 获取 皮肤id
* @return Long
*/
public Long getSkinId(){
return skinId;
}
/**
* 设置 皮肤id
* @param skinId
*/
public void setSkinId(Long skinId){
this.skinId = skinId;
}
/**
* 获取 皮肤名称
* @return String
*/
public String getSkinName(){
return skinName;
}
/**
* 设置 皮肤名称
* @param skinName
*/
public void setSkinName(String skinName){
this.skinName = skinName;
}
......@@ -134,6 +175,8 @@ public class ProductEntity extends ProductVo {
sb.append(",productCode:").append(getProductCode());
sb.append(",homeUrl:").append(getHomeUrl());
sb.append(",productRemark:").append(getProductRemark());
sb.append(",skinId:").append(getSkinId());
sb.append(",skinName:").append(getSkinName());
return sb.toString();
}
......@@ -148,5 +191,9 @@ public class ProductEntity extends ProductVo {
this.homeUrl = "";
this.productRemark = "";
this.skinId = null;
this.skinName = "";
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@ import com.mortals.xhx.module.product.model.ProductEntity;
* 产品查询对象
*
* @author zxfei
* @date 2022-07-14
* @date 2022-08-01
*/
public class ProductQuery extends ProductEntity {
/** 开始 主键ID,主键,自增长 */
......@@ -81,6 +81,21 @@ public class ProductQuery extends ProductEntity {
/** 结束 更新时间 */
private String updateTimeEnd;
/** 开始 皮肤id */
private Long skinIdStart;
/** 结束 皮肤id */
private Long skinIdEnd;
/** 增加 皮肤id */
private Long skinIdIncrement;
/** 皮肤id列表 */
private List <Long> skinIdList;
/** 皮肤名称 */
private List<String> skinNameList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<ProductQuery> orConditionList;
......@@ -469,6 +484,85 @@ public class ProductQuery extends ProductEntity {
this.updateTimeEnd = updateTimeEnd;
}
/**
* 获取 开始 皮肤id
* @return skinIdStart
*/
public Long getSkinIdStart(){
return this.skinIdStart;
}
/**
* 设置 开始 皮肤id
* @param skinIdStart
*/
public void setSkinIdStart(Long skinIdStart){
this.skinIdStart = skinIdStart;
}
/**
* 获取 结束 皮肤id
* @return $skinIdEnd
*/
public Long getSkinIdEnd(){
return this.skinIdEnd;
}
/**
* 设置 结束 皮肤id
* @param skinIdEnd
*/
public void setSkinIdEnd(Long skinIdEnd){
this.skinIdEnd = skinIdEnd;
}
/**
* 获取 增加 皮肤id
* @return skinIdIncrement
*/
public Long getSkinIdIncrement(){
return this.skinIdIncrement;
}
/**
* 设置 增加 皮肤id
* @param skinIdIncrement
*/
public void setSkinIdIncrement(Long skinIdIncrement){
this.skinIdIncrement = skinIdIncrement;
}
/**
* 获取 皮肤id
* @return skinIdList
*/
public List<Long> getSkinIdList(){
return this.skinIdList;
}
/**
* 设置 皮肤id
* @param skinIdList
*/
public void setSkinIdList(List<Long> skinIdList){
this.skinIdList = skinIdList;
}
/**
* 获取 皮肤名称
* @return skinNameList
*/
public List<String> getSkinNameList(){
return this.skinNameList;
}
/**
* 设置 皮肤名称
* @param skinNameList
*/
public void setSkinNameList(List<String> skinNameList){
this.skinNameList = skinNameList;
}
/**
* 设置 主键ID,主键,自增长
* @param id
......@@ -727,6 +821,70 @@ public class ProductQuery extends ProductEntity {
}
/**
* 设置 皮肤id
* @param skinId
*/
public ProductQuery skinId(Long skinId){
setSkinId(skinId);
return this;
}
/**
* 设置 开始 皮肤id
* @param skinIdStart
*/
public ProductQuery skinIdStart(Long skinIdStart){
this.skinIdStart = skinIdStart;
return this;
}
/**
* 设置 结束 皮肤id
* @param skinIdEnd
*/
public ProductQuery skinIdEnd(Long skinIdEnd){
this.skinIdEnd = skinIdEnd;
return this;
}
/**
* 设置 增加 皮肤id
* @param skinIdIncrement
*/
public ProductQuery skinIdIncrement(Long skinIdIncrement){
this.skinIdIncrement = skinIdIncrement;
return this;
}
/**
* 设置 皮肤id
* @param skinIdList
*/
public ProductQuery skinIdList(List<Long> skinIdList){
this.skinIdList = skinIdList;
return this;
}
/**
* 设置 皮肤名称
* @param skinName
*/
public ProductQuery skinName(String skinName){
setSkinName(skinName);
return this;
}
/**
* 设置 皮肤名称
* @param skinNameList
*/
public ProductQuery skinNameList(List<String> skinNameList){
this.skinNameList = skinNameList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
package com.mortals.xhx.module.product.service.impl;
import cn.hutool.core.net.url.UrlBuilder;
import cn.hutool.core.net.url.UrlPath;
import cn.hutool.core.util.URLUtil;
import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.module.product.model.ProductQuery;
import com.sun.jndi.toolkit.url.UrlUtil;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.xhx.module.product.dao.ProductDao;
......@@ -9,6 +15,8 @@ import com.mortals.xhx.module.product.model.ProductEntity;
import com.mortals.xhx.module.product.service.ProductService;
import org.springframework.util.ObjectUtils;
import java.nio.charset.Charset;
/**
* ProductService
* 产品 service实现
......@@ -25,10 +33,13 @@ public class ProductServiceImpl extends AbstractCRUDServiceImpl<ProductDao, Prod
//新增产品编码不能重复
ProductEntity productEntity = this.selectOne(new ProductQuery().productCode(entity.getProductCode()));
if(!ObjectUtils.isEmpty(productEntity))throw new AppException("当前产品编码已存在!");
//默认时,需拼接homeUrl
updateDeviceHomeUrl(entity);
super.saveBefore(entity, context);
}
@Override
protected void updateBefore(ProductEntity entity, Context context) throws AppException {
ProductEntity productEntity = this.get(entity.getId());
......@@ -36,6 +47,34 @@ public class ProductServiceImpl extends AbstractCRUDServiceImpl<ProductDao, Prod
ProductEntity productEntity1 = this.selectOne(new ProductQuery().productCode(entity.getProductCode()));
if(!ObjectUtils.isEmpty(productEntity1))throw new AppException("当前产品编码已存在!");
}
updateDeviceHomeUrl(entity);
super.updateBefore(entity, context);
}
private void updateDeviceHomeUrl(ProductEntity entity) {
if (!ObjectUtils.isEmpty(entity.getSkinName())) {
String path = UrlPath.of(Constant.DEVICE_BASEHOME_PATH,Charset.defaultCharset())
.add(entity.getProductCode())
.add(entity.getSkinName())
.toString();
entity.setHomeUrl(path);
}
}
public static void main(String[] args) {
//String path = URLUtil.completeUrl("http://192.168.0.98:11091/homeDeviceUrl", "pdj");
//System.out.println("path:"+path);
String path =UrlBuilder.create().setHost("http").setHost("192.168.0.98").setPort(11091).addPath("pdj").build();
path = UrlPath.of("homeDeviceUrl", Charset.defaultCharset()).add("pdj").toString();
System.out.println("path:"+path);
}
}
\ No newline at end of file
package com.mortals.xhx.module.product.web;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.pdu.RespData;
import com.mortals.xhx.common.pdu.skin.SkinBasePdu;
import com.mortals.xhx.feign.skin.ISkinBaseFeign;
import com.mortals.xhx.module.platform.model.PlatformQuery;
import com.mortals.xhx.module.platform.service.PlatformService;
import com.mortals.xhx.module.product.model.ProductEntity;
......@@ -11,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
......@@ -26,6 +33,8 @@ public class ProductController extends BaseCRUDJsonBodyMappingController<Product
@Autowired
private PlatformService platformService;
@Autowired
private ISkinBaseFeign skinBaseFeign;
public ProductController() {
super.setModuleDesc("产品");
......@@ -33,6 +42,14 @@ public class ProductController extends BaseCRUDJsonBodyMappingController<Product
@Override
protected void init(Map<String, Object> model, Context context) {
//获取所有产品皮肤 分组显示
Rest<RespData<List<SkinBasePdu>>> resp = skinBaseFeign.list(new SkinBasePdu());
if (resp.getCode() == YesNoEnum.YES.getValue()) {
Map<String, Map<String, String>> skinProductCodeMap = resp.getData().getData().stream().collect(Collectors.groupingBy(x -> x.getProductCode(), Collectors.toMap(a -> a.getImageResolution(), b -> b.getImageResolutionValue(),(o,n)->n)));
this.addDict(model, "skinProductCodeMap", skinProductCodeMap);
}
this.addDict(model, "platformId", platformService.find(new PlatformQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getPlatformName())));
super.init(model, context);
}
......
......@@ -43,7 +43,7 @@
</rollingPolicy>
</appender>
<root level="INFO">
<root level="info">
<appender-ref ref="console"/>
<appender-ref ref="fileInfo"/>
<appender-ref ref="fileError"/>
......@@ -57,7 +57,7 @@
<!-- level 用来设置打印级别,大小写无关:TRACE, DEBUG, INFO, WARN, ERROR, ALL 和 OFF,还有一个特俗值INHERITED或者同义词NULL,代表强制执行上级的级别。如果未设置此属性,那么当前logger将会继承上级的级别-->
<!-- additivity 是否向上级logger传递打印信息。默认是true。false:表示只用当前logger的appender-ref。true:表示当前logger的appender-ref和rootLogger的appender-ref都有效。-->
<logger name="com.mortals" level="${logLevel}" additivity="false">
<logger name="com.mortals.xhx.module" level="${logLevel}" additivity="false">
<appender-ref ref="console"/>
<appender-ref ref="fileInfo"/>
<appender-ref ref="fileError"/>
......
......@@ -16,6 +16,9 @@
<result property="platformName" column="platformName" />
<result property="productId" column="productId" />
<result property="productName" column="productName" />
<result property="skinId" column="skinId" />
<result property="skinName" column="skinName" />
<result property="homeUrl" column="homeUrl" />
<result property="deviceFirmId" column="deviceFirmId" />
<result property="deviceFirmname" column="deviceFirmname" />
<result property="deviceSrc" column="deviceSrc" />
......@@ -85,6 +88,15 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('productName') or colPickMode == 1 and data.containsKey('productName')))">
a.productName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('skinId') or colPickMode == 1 and data.containsKey('skinId')))">
a.skinId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('skinName') or colPickMode == 1 and data.containsKey('skinName')))">
a.skinName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('homeUrl') or colPickMode == 1 and data.containsKey('homeUrl')))">
a.homeUrl,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('deviceFirmId') or colPickMode == 1 and data.containsKey('deviceFirmId')))">
a.deviceFirmId,
</if>
......@@ -177,18 +189,18 @@
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DeviceEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_device
(deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime)
(deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,skinId,skinName,homeUrl,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime)
VALUES
(#{deviceName},#{deviceCode},#{deviceMac},#{siteId},#{siteCode},#{siteName},#{platformId},#{platformName},#{productId},#{productName},#{deviceFirmId},#{deviceFirmname},#{deviceSrc},#{deviceDataSourceWay},#{lon},#{lati},#{deviceInBuilding},#{deviceInFloor},#{defectsLiabilityPeriod},#{leadingOfficial},#{leadingOfficialTelephone},#{isReceiveMess},#{devicePhotoPath},#{ip},#{centernum},#{port},#{deviceTopic},#{deviceStatus},#{enabled},#{deviceAuthCode},#{deviceRemark},#{onlineTime},#{offlineTime},#{deleted},#{source},#{createUserId},#{createTime},#{updateUserId},#{updateTime})
(#{deviceName},#{deviceCode},#{deviceMac},#{siteId},#{siteCode},#{siteName},#{platformId},#{platformName},#{productId},#{productName},#{skinId},#{skinName},#{homeUrl},#{deviceFirmId},#{deviceFirmname},#{deviceSrc},#{deviceDataSourceWay},#{lon},#{lati},#{deviceInBuilding},#{deviceInFloor},#{defectsLiabilityPeriod},#{leadingOfficial},#{leadingOfficialTelephone},#{isReceiveMess},#{devicePhotoPath},#{ip},#{centernum},#{port},#{deviceTopic},#{deviceStatus},#{enabled},#{deviceAuthCode},#{deviceRemark},#{onlineTime},#{offlineTime},#{deleted},#{source},#{createUserId},#{createTime},#{updateUserId},#{updateTime})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_device
(deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime)
(deviceName,deviceCode,deviceMac,siteId,siteCode,siteName,platformId,platformName,productId,productName,skinId,skinName,homeUrl,deviceFirmId,deviceFirmname,deviceSrc,deviceDataSourceWay,lon,lati,deviceInBuilding,deviceInFloor,defectsLiabilityPeriod,leadingOfficial,leadingOfficialTelephone,isReceiveMess,devicePhotoPath,ip,centernum,port,deviceTopic,deviceStatus,enabled,deviceAuthCode,deviceRemark,onlineTime,offlineTime,deleted,source,createUserId,createTime,updateUserId,updateTime)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.deviceName},#{item.deviceCode},#{item.deviceMac},#{item.siteId},#{item.siteCode},#{item.siteName},#{item.platformId},#{item.platformName},#{item.productId},#{item.productName},#{item.deviceFirmId},#{item.deviceFirmname},#{item.deviceSrc},#{item.deviceDataSourceWay},#{item.lon},#{item.lati},#{item.deviceInBuilding},#{item.deviceInFloor},#{item.defectsLiabilityPeriod},#{item.leadingOfficial},#{item.leadingOfficialTelephone},#{item.isReceiveMess},#{item.devicePhotoPath},#{item.ip},#{item.centernum},#{item.port},#{item.deviceTopic},#{item.deviceStatus},#{item.enabled},#{item.deviceAuthCode},#{item.deviceRemark},#{item.onlineTime},#{item.offlineTime},#{item.deleted},#{item.source},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime})
(#{item.deviceName},#{item.deviceCode},#{item.deviceMac},#{item.siteId},#{item.siteCode},#{item.siteName},#{item.platformId},#{item.platformName},#{item.productId},#{item.productName},#{item.skinId},#{item.skinName},#{item.homeUrl},#{item.deviceFirmId},#{item.deviceFirmname},#{item.deviceSrc},#{item.deviceDataSourceWay},#{item.lon},#{item.lati},#{item.deviceInBuilding},#{item.deviceInFloor},#{item.defectsLiabilityPeriod},#{item.leadingOfficial},#{item.leadingOfficialTelephone},#{item.isReceiveMess},#{item.devicePhotoPath},#{item.ip},#{item.centernum},#{item.port},#{item.deviceTopic},#{item.deviceStatus},#{item.enabled},#{item.deviceAuthCode},#{item.deviceRemark},#{item.onlineTime},#{item.offlineTime},#{item.deleted},#{item.source},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime})
</foreach>
</insert>
......@@ -237,6 +249,18 @@
<if test="(colPickMode==0 and data.containsKey('productName')) or (colPickMode==1 and !data.containsKey('productName'))">
a.productName=#{data.productName},
</if>
<if test="(colPickMode==0 and data.containsKey('skinId')) or (colPickMode==1 and !data.containsKey('skinId'))">
a.skinId=#{data.skinId},
</if>
<if test="(colPickMode==0 and data.containsKey('skinIdIncrement')) or (colPickMode==1 and !data.containsKey('skinIdIncrement'))">
a.skinId=ifnull(a.skinId,0) + #{data.skinIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('skinName')) or (colPickMode==1 and !data.containsKey('skinName'))">
a.skinName=#{data.skinName},
</if>
<if test="(colPickMode==0 and data.containsKey('homeUrl')) or (colPickMode==1 and !data.containsKey('homeUrl'))">
a.homeUrl=#{data.homeUrl},
</if>
<if test="(colPickMode==0 and data.containsKey('deviceFirmId')) or (colPickMode==1 and !data.containsKey('deviceFirmId'))">
a.deviceFirmId=#{data.deviceFirmId},
</if>
......@@ -457,6 +481,32 @@
</if>
</foreach>
</trim>
<trim prefix="skinId=(case" suffix="ELSE skinId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('skinId')) or (colPickMode==1 and !item.containsKey('skinId'))">
when a.id=#{item.id} then #{item.skinId}
</when>
<when test="(colPickMode==0 and item.containsKey('skinIdIncrement')) or (colPickMode==1 and !item.containsKey('skinIdIncrement'))">
when a.id=#{item.id} then ifnull(a.skinId,0) + #{item.skinIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="skinName=(case" suffix="ELSE skinName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('skinName')) or (colPickMode==1 and !item.containsKey('skinName'))">
when a.id=#{item.id} then #{item.skinName}
</if>
</foreach>
</trim>
<trim prefix="homeUrl=(case" suffix="ELSE homeUrl end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('homeUrl')) or (colPickMode==1 and !item.containsKey('homeUrl'))">
when a.id=#{item.id} then #{item.homeUrl}
</if>
</foreach>
</trim>
<trim prefix="deviceFirmId=(case" suffix="ELSE deviceFirmId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
......@@ -1010,6 +1060,57 @@
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('skinId')">
<if test="conditionParamRef.skinId != null ">
${_conditionType_} a.skinId = #{${_conditionParam_}.skinId}
</if>
<if test="conditionParamRef.skinId == null">
${_conditionType_} a.skinId is null
</if>
</if>
<if test="conditionParamRef.containsKey('skinIdList')">
${_conditionType_} a.skinId in
<foreach collection="conditionParamRef.skinIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('skinIdStart') and conditionParamRef.skinIdStart != null">
${_conditionType_} a.skinId <![CDATA[ >= ]]> #{${_conditionParam_}.skinIdStart}
</if>
<if test="conditionParamRef.containsKey('skinIdEnd') and conditionParamRef.skinIdEnd != null">
${_conditionType_} a.skinId <![CDATA[ <= ]]> #{${_conditionParam_}.skinIdEnd}
</if>
<if test="conditionParamRef.containsKey('skinName')">
<if test="conditionParamRef.skinName != null and conditionParamRef.skinName != ''">
${_conditionType_} a.skinName like #{${_conditionParam_}.skinName}
</if>
<if test="conditionParamRef.skinName == null">
${_conditionType_} a.skinName is null
</if>
</if>
<if test="conditionParamRef.containsKey('skinNameList')">
${_conditionType_} a.skinName in
<foreach collection="conditionParamRef.skinNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('homeUrl')">
<if test="conditionParamRef.homeUrl != null and conditionParamRef.homeUrl != ''">
${_conditionType_} a.homeUrl like #{${_conditionParam_}.homeUrl}
</if>
<if test="conditionParamRef.homeUrl == null">
${_conditionType_} a.homeUrl is null
</if>
</if>
<if test="conditionParamRef.containsKey('homeUrlList')">
${_conditionType_} a.homeUrl in
<foreach collection="conditionParamRef.homeUrlList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('deviceFirmId')">
<if test="conditionParamRef.deviceFirmId != null ">
${_conditionType_} a.deviceFirmId = #{${_conditionParam_}.deviceFirmId}
......@@ -1585,6 +1686,21 @@
<if test='orderCol.productName != null and "DESC".equalsIgnoreCase(orderCol.productName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('skinId')">
a.skinId
<if test='orderCol.skinId != null and "DESC".equalsIgnoreCase(orderCol.skinId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('skinName')">
a.skinName
<if test='orderCol.skinName != null and "DESC".equalsIgnoreCase(orderCol.skinName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('homeUrl')">
a.homeUrl
<if test='orderCol.homeUrl != null and "DESC".equalsIgnoreCase(orderCol.homeUrl)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('deviceFirmId')">
a.deviceFirmId
<if test='orderCol.deviceFirmId != null and "DESC".equalsIgnoreCase(orderCol.deviceFirmId)'>DESC</if>
......
......@@ -9,6 +9,8 @@
<id property="platformId" column="platformId" />
<result property="productName" column="productName" />
<result property="productCode" column="productCode" />
<result property="skinId" column="skinId" />
<result property="skinName" column="skinName" />
<result property="homeUrl" column="homeUrl" />
<result property="productRemark" column="productRemark" />
<result property="createUserId" column="createUserId" />
......@@ -34,6 +36,12 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('productCode') or colPickMode == 1 and data.containsKey('productCode')))">
a.productCode,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('skinId') or colPickMode == 1 and data.containsKey('skinId')))">
a.skinId,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('skinName') or colPickMode == 1 and data.containsKey('skinName')))">
a.skinName,
</if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('homeUrl') or colPickMode == 1 and data.containsKey('homeUrl')))">
a.homeUrl,
</if>
......@@ -57,18 +65,18 @@
<!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="ProductEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_product
(platformId,productName,productCode,homeUrl,productRemark,createUserId,createTime,updateUserId,updateTime)
(platformId,productName,productCode,skinId,skinName,homeUrl,productRemark,createUserId,createTime,updateUserId,updateTime)
VALUES
(#{platformId},#{productName},#{productCode},#{homeUrl},#{productRemark},#{createUserId},#{createTime},#{updateUserId},#{updateTime})
(#{platformId},#{productName},#{productCode},#{skinId},#{skinName},#{homeUrl},#{productRemark},#{createUserId},#{createTime},#{updateUserId},#{updateTime})
</insert>
<!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_product
(platformId,productName,productCode,homeUrl,productRemark,createUserId,createTime,updateUserId,updateTime)
(platformId,productName,productCode,skinId,skinName,homeUrl,productRemark,createUserId,createTime,updateUserId,updateTime)
VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.platformId},#{item.productName},#{item.productCode},#{item.homeUrl},#{item.productRemark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime})
(#{item.platformId},#{item.productName},#{item.productCode},#{item.skinId},#{item.skinName},#{item.homeUrl},#{item.productRemark},#{item.createUserId},#{item.createTime},#{item.updateUserId},#{item.updateTime})
</foreach>
</insert>
......@@ -90,6 +98,15 @@
<if test="(colPickMode==0 and data.containsKey('productCode')) or (colPickMode==1 and !data.containsKey('productCode'))">
a.productCode=#{data.productCode},
</if>
<if test="(colPickMode==0 and data.containsKey('skinId')) or (colPickMode==1 and !data.containsKey('skinId'))">
a.skinId=#{data.skinId},
</if>
<if test="(colPickMode==0 and data.containsKey('skinIdIncrement')) or (colPickMode==1 and !data.containsKey('skinIdIncrement'))">
a.skinId=ifnull(a.skinId,0) + #{data.skinIdIncrement},
</if>
<if test="(colPickMode==0 and data.containsKey('skinName')) or (colPickMode==1 and !data.containsKey('skinName'))">
a.skinName=#{data.skinName},
</if>
<if test="(colPickMode==0 and data.containsKey('homeUrl')) or (colPickMode==1 and !data.containsKey('homeUrl'))">
a.homeUrl=#{data.homeUrl},
</if>
......@@ -152,6 +169,25 @@
</if>
</foreach>
</trim>
<trim prefix="skinId=(case" suffix="ELSE skinId end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('skinId')) or (colPickMode==1 and !item.containsKey('skinId'))">
when a.id=#{item.id} then #{item.skinId}
</when>
<when test="(colPickMode==0 and item.containsKey('skinIdIncrement')) or (colPickMode==1 and !item.containsKey('skinIdIncrement'))">
when a.id=#{item.id} then ifnull(a.skinId,0) + #{item.skinIdIncrement}
</when>
</choose>
</foreach>
</trim>
<trim prefix="skinName=(case" suffix="ELSE skinName end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('skinName')) or (colPickMode==1 and !item.containsKey('skinName'))">
when a.id=#{item.id} then #{item.skinName}
</if>
</foreach>
</trim>
<trim prefix="homeUrl=(case" suffix="ELSE homeUrl end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<if test="(colPickMode==0 and item.containsKey('homeUrl')) or (colPickMode==1 and !item.containsKey('homeUrl'))">
......@@ -377,6 +413,42 @@
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('skinId')">
<if test="conditionParamRef.skinId != null ">
${_conditionType_} a.skinId = #{${_conditionParam_}.skinId}
</if>
<if test="conditionParamRef.skinId == null">
${_conditionType_} a.skinId is null
</if>
</if>
<if test="conditionParamRef.containsKey('skinIdList')">
${_conditionType_} a.skinId in
<foreach collection="conditionParamRef.skinIdList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('skinIdStart') and conditionParamRef.skinIdStart != null">
${_conditionType_} a.skinId <![CDATA[ >= ]]> #{${_conditionParam_}.skinIdStart}
</if>
<if test="conditionParamRef.containsKey('skinIdEnd') and conditionParamRef.skinIdEnd != null">
${_conditionType_} a.skinId <![CDATA[ <= ]]> #{${_conditionParam_}.skinIdEnd}
</if>
<if test="conditionParamRef.containsKey('skinName')">
<if test="conditionParamRef.skinName != null and conditionParamRef.skinName != ''">
${_conditionType_} a.skinName like #{${_conditionParam_}.skinName}
</if>
<if test="conditionParamRef.skinName == null">
${_conditionType_} a.skinName is null
</if>
</if>
<if test="conditionParamRef.containsKey('skinNameList')">
${_conditionType_} a.skinName in
<foreach collection="conditionParamRef.skinNameList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('homeUrl')">
<if test="conditionParamRef.homeUrl != null and conditionParamRef.homeUrl != ''">
......@@ -512,6 +584,16 @@
<if test='orderCol.productCode != null and "DESC".equalsIgnoreCase(orderCol.productCode)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('skinId')">
a.skinId
<if test='orderCol.skinId != null and "DESC".equalsIgnoreCase(orderCol.skinId)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('skinName')">
a.skinName
<if test='orderCol.skinName != null and "DESC".equalsIgnoreCase(orderCol.skinName)'>DESC</if>
,
</if>
<if test="orderCol.containsKey('homeUrl')">
a.homeUrl
<if test='orderCol.homeUrl != null and "DESC".equalsIgnoreCase(orderCol.homeUrl)'>DESC</if>
......
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