Commit 21063854 authored by 赵啸非's avatar 赵啸非

更新资源部署

parent 7e6da6ac
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
<Field :span="20" label="上传文件"><fileUpload v-model="form.filePath" prePath="/file/uploadfile"/></Field> <Field :span="20" label="上传文件"><fileUpload v-model="form.filePath" prePath="/file/uploadfile"/></Field>
<!--
<Field :span="20" label="默认选择" prop="imageResolution" v-model="form.selected" :enumData="dict.selected" type="radio" placeholder="默认选择"/>
-->
<Field :span="20" label="版本号" prop="version" v-model="form.version" placeholder="请输入版本号"/> <Field :span="20" label="版本号" prop="version" v-model="form.version" placeholder="请输入版本号"/>
......
...@@ -72,6 +72,31 @@ export default { ...@@ -72,6 +72,31 @@ export default {
}); });
}, },
handleSwitch(row){
if(row.selected==1){
this.$post("/device/module/distribute/selected", {id:row.id,selected:0})
.then(res => {
if(res.code==1){
row.selected=0;
}
})
.catch(error => {
this.$message.error(error.message);
})
}else{
this.$post("/device/module/distribute/selected", {id:row.id,selected:1})
.then(res => {
if(res.code==1){
row.selected=1;
}
})
.catch(error => {
this.$message.error(error.message);
})
}
this.getData();
},
distribute(row) { distribute(row) {
this.$post("/device/module/distribute/active", row) this.$post("/device/module/distribute/active", row)
.then((res) => { .then((res) => {
...@@ -114,7 +139,26 @@ export default { ...@@ -114,7 +139,26 @@ export default {
}, },
{ label: "版本号", align: "center", prop: "version" }, { label: "版本号", align: "center", prop: "version" },
{
label: "是否默认选择",
align: "center",
prop: "selected",
formatter: row => {
return (
<el-switch
value={row.selected+""}
active-color="#13ce66"
inactive-color="#ff4949"
active-value='1'
inactive-value='0'
onChange={() => {
this.handleSwitch(row);
}}
>
</el-switch>
);
}
},
{ {
label: "是否部署", label: "是否部署",
align: "center", align: "center",
......
...@@ -10,14 +10,32 @@ ...@@ -10,14 +10,32 @@
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import drawerShow from "./drawershow"; import drawerShow from "./drawershow";
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
import session from "@/assets/utils/session";
export default { export default {
name: "ProductList", name: "ProductList",
components: { components: {
drawerShow, drawerShow,
}, },
mixins: [table], mixins: [table],
created() {}, created() { const siteid = session.getSession("siteid");
this.query["siteId"]=siteid?siteid:1;
},
methods: { methods: {
cloneAppBySite(row) {
this.$post("/device/module/distribute/cloneAppBySite", {
sourceSiteId: 1,
targetSiteId: session.getSession("siteid"),
})
.then((res) => {
if (res.code == 1) {
this.$message.success("复制资源应用成功!");
this.getData();
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
/** 重写新增方法 */ /** 重写新增方法 */
toAdd(row) { toAdd(row) {
this.$refs.drawerform.add(row); this.$refs.drawerform.add(row);
......
...@@ -66,6 +66,4 @@ ALTER TABLE mortals_xhx_product_version ADD COLUMN `siteName` varchar(256) de ...@@ -66,6 +66,4 @@ ALTER TABLE mortals_xhx_product_version ADD COLUMN `siteName` varchar(256) de
-- ---------------------------- -- ----------------------------
2023-08-21 2023-08-21
-- ---------------------------- -- ----------------------------
ALTER TABLE mortals_xhx_product ADD COLUMN `siteId` bigint(20) COMMENT '站点Id,来源基础服务平台'; ALTER TABLE mortals_xhx_device_module_distribute ADD COLUMN `selected` tinyint(2) NOT NULL default '0' COMMENT '是否默认选择分辨率(0.否,1.是)';
ALTER TABLE mortals_xhx_product ADD COLUMN `siteCode` varchar(256) default '' COMMENT '站点编号,来源基础服务平台';
ALTER TABLE mortals_xhx_product ADD COLUMN `siteName` varchar(256) default '' COMMENT '站点名称';
...@@ -7,7 +7,7 @@ import lombok.Data; ...@@ -7,7 +7,7 @@ import lombok.Data;
* 设备前端模块部署实体对象 * 设备前端模块部署实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-08-18 * @date 2023-08-21
*/ */
@Data @Data
public class DeviceModuleDistributeEntity extends DeviceModuleDistributeVo { public class DeviceModuleDistributeEntity extends DeviceModuleDistributeVo {
...@@ -66,6 +66,11 @@ public class DeviceModuleDistributeEntity extends DeviceModuleDistributeVo { ...@@ -66,6 +66,11 @@ public class DeviceModuleDistributeEntity extends DeviceModuleDistributeVo {
* 站点名称 * 站点名称
*/ */
private String siteName; private String siteName;
/**
* 是否默认选择分辨率(0.否,1.是)
*/
@Excel(name = "是否默认选择分辨率", readConverterExp = "0=否,1=是")
private Integer selected;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -83,7 +88,7 @@ public class DeviceModuleDistributeEntity extends DeviceModuleDistributeVo { ...@@ -83,7 +88,7 @@ public class DeviceModuleDistributeEntity extends DeviceModuleDistributeVo {
} }
public void initAttrValue(){ public void initAttrValue(){
this.productId = null; this.productId = 0L;
this.productCode = ""; this.productCode = "";
this.productName = ""; this.productName = "";
this.imageResolution = ""; this.imageResolution = "";
...@@ -95,5 +100,6 @@ public class DeviceModuleDistributeEntity extends DeviceModuleDistributeVo { ...@@ -95,5 +100,6 @@ public class DeviceModuleDistributeEntity extends DeviceModuleDistributeVo {
this.siteId = 0L; this.siteId = 0L;
this.siteCode = ""; this.siteCode = "";
this.siteName = ""; this.siteName = "";
this.selected = 0;
} }
} }
\ No newline at end of file
...@@ -5,7 +5,7 @@ import java.util.List; ...@@ -5,7 +5,7 @@ import java.util.List;
* 设备前端模块部署查询对象 * 设备前端模块部署查询对象
* *
* @author zxfei * @author zxfei
* @date 2023-08-18 * @date 2023-08-21
*/ */
public class DeviceModuleDistributeQuery extends DeviceModuleDistributeEntity { public class DeviceModuleDistributeQuery extends DeviceModuleDistributeEntity {
/** 开始 主键ID,主键,自增长 */ /** 开始 主键ID,主键,自增长 */
...@@ -140,6 +140,21 @@ public class DeviceModuleDistributeQuery extends DeviceModuleDistributeEntity { ...@@ -140,6 +140,21 @@ public class DeviceModuleDistributeQuery extends DeviceModuleDistributeEntity {
/** 站点名称排除列表 */ /** 站点名称排除列表 */
private List <String> siteNameNotList; private List <String> siteNameNotList;
/** 开始 是否默认选择分辨率(0.否,1.是) */
private Integer selectedStart;
/** 结束 是否默认选择分辨率(0.否,1.是) */
private Integer selectedEnd;
/** 增加 是否默认选择分辨率(0.否,1.是) */
private Integer selectedIncrement;
/** 是否默认选择分辨率(0.否,1.是)列表 */
private List <Integer> selectedList;
/** 是否默认选择分辨率(0.否,1.是)排除列表 */
private List <Integer> selectedNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<DeviceModuleDistributeQuery> orConditionList; private List<DeviceModuleDistributeQuery> orConditionList;
...@@ -905,6 +920,87 @@ public class DeviceModuleDistributeQuery extends DeviceModuleDistributeEntity { ...@@ -905,6 +920,87 @@ public class DeviceModuleDistributeQuery extends DeviceModuleDistributeEntity {
this.siteNameNotList = siteNameNotList; this.siteNameNotList = siteNameNotList;
} }
/**
* 获取 开始 是否默认选择分辨率(0.否,1.是)
* @return selectedStart
*/
public Integer getSelectedStart(){
return this.selectedStart;
}
/**
* 设置 开始 是否默认选择分辨率(0.否,1.是)
* @param selectedStart
*/
public void setSelectedStart(Integer selectedStart){
this.selectedStart = selectedStart;
}
/**
* 获取 结束 是否默认选择分辨率(0.否,1.是)
* @return $selectedEnd
*/
public Integer getSelectedEnd(){
return this.selectedEnd;
}
/**
* 设置 结束 是否默认选择分辨率(0.否,1.是)
* @param selectedEnd
*/
public void setSelectedEnd(Integer selectedEnd){
this.selectedEnd = selectedEnd;
}
/**
* 获取 增加 是否默认选择分辨率(0.否,1.是)
* @return selectedIncrement
*/
public Integer getSelectedIncrement(){
return this.selectedIncrement;
}
/**
* 设置 增加 是否默认选择分辨率(0.否,1.是)
* @param selectedIncrement
*/
public void setSelectedIncrement(Integer selectedIncrement){
this.selectedIncrement = selectedIncrement;
}
/**
* 获取 是否默认选择分辨率(0.否,1.是)
* @return selectedList
*/
public List<Integer> getSelectedList(){
return this.selectedList;
}
/**
* 设置 是否默认选择分辨率(0.否,1.是)
* @param selectedList
*/
public void setSelectedList(List<Integer> selectedList){
this.selectedList = selectedList;
}
/**
* 获取 是否默认选择分辨率(0.否,1.是)
* @return selectedNotList
*/
public List<Integer> getSelectedNotList(){
return this.selectedNotList;
}
/**
* 设置 是否默认选择分辨率(0.否,1.是)
* @param selectedNotList
*/
public void setSelectedNotList(List<Integer> selectedNotList){
this.selectedNotList = selectedNotList;
}
/** /**
* 设置 主键ID,主键,自增长 * 设置 主键ID,主键,自增长
* @param id * @param id
...@@ -1348,6 +1444,60 @@ public class DeviceModuleDistributeQuery extends DeviceModuleDistributeEntity { ...@@ -1348,6 +1444,60 @@ public class DeviceModuleDistributeQuery extends DeviceModuleDistributeEntity {
return this; return this;
} }
/**
* 设置 是否默认选择分辨率(0.否,1.是)
* @param selected
*/
public DeviceModuleDistributeQuery selected(Integer selected){
setSelected(selected);
return this;
}
/**
* 设置 开始 是否默认选择分辨率(0.否,1.是)
* @param selectedStart
*/
public DeviceModuleDistributeQuery selectedStart(Integer selectedStart){
this.selectedStart = selectedStart;
return this;
}
/**
* 设置 结束 是否默认选择分辨率(0.否,1.是)
* @param selectedEnd
*/
public DeviceModuleDistributeQuery selectedEnd(Integer selectedEnd){
this.selectedEnd = selectedEnd;
return this;
}
/**
* 设置 增加 是否默认选择分辨率(0.否,1.是)
* @param selectedIncrement
*/
public DeviceModuleDistributeQuery selectedIncrement(Integer selectedIncrement){
this.selectedIncrement = selectedIncrement;
return this;
}
/**
* 设置 是否默认选择分辨率(0.否,1.是)
* @param selectedList
*/
public DeviceModuleDistributeQuery selectedList(List<Integer> selectedList){
this.selectedList = selectedList;
return this;
}
/**
* 设置 是否默认选择分辨率(0.否,1.是)
* @param selectedNotList
*/
public DeviceModuleDistributeQuery selectedNotList(List<Integer> selectedNotList){
this.selectedNotList = selectedNotList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList * @return orConditionList
......
...@@ -16,6 +16,8 @@ public interface DeviceModuleDistributeService extends ICRUDService<DeviceModule ...@@ -16,6 +16,8 @@ public interface DeviceModuleDistributeService extends ICRUDService<DeviceModule
void active(DeviceModuleDistributeEntity distributeEntity, Context context); void active(DeviceModuleDistributeEntity distributeEntity, Context context);
Rest<String> selected(DeviceModuleDistributeEntity distributeEntity, Context context);
Rest<String> cloneAppBySite(DeviceModuleDistributeEntity deviceModuleDistributeEntity, Context context); Rest<String> cloneAppBySite(DeviceModuleDistributeEntity deviceModuleDistributeEntity, Context context);
} }
\ No newline at end of file
...@@ -22,11 +22,13 @@ import com.mortals.xhx.module.product.service.ProductService; ...@@ -22,11 +22,13 @@ import com.mortals.xhx.module.product.service.ProductService;
import com.mortals.xhx.utils.EncodeUtil; import com.mortals.xhx.utils.EncodeUtil;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.io.File; import java.io.File;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
/** /**
* DeviceModuleDistributeService * DeviceModuleDistributeService
...@@ -46,11 +48,8 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D ...@@ -46,11 +48,8 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D
@Override @Override
protected void saveBefore(DeviceModuleDistributeEntity entity, Context context) throws AppException { protected void saveBefore(DeviceModuleDistributeEntity entity, Context context) throws AppException {
ProductEntity productEntity = productService.get(entity.getProductId(), context);
entity.setProductCode(productEntity.getProductCode());
entity.setProductName(productEntity.getProductName());
entity.setImageResolutionValue(ImageReEnum.getByValue(Integer.parseInt(entity.getImageResolution())).getDesc());
super.saveBefore(entity, context);
} }
...@@ -75,7 +74,6 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D ...@@ -75,7 +74,6 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D
if (!FileUtil.getSuffix(distributeEntity.getFilePath()).equals("zip")) { if (!FileUtil.getSuffix(distributeEntity.getFilePath()).equals("zip")) {
throw new AppException("部署只支持zip文件!"); throw new AppException("部署只支持zip文件!");
} }
//RuntimeUtil //RuntimeUtil
//部署路径是否存在 如果不存在 创建目录, //部署路径是否存在 如果不存在 创建目录,
String path = GlobalSysInfo.getParamValue(Constant.DISTRIBUTE_PATH, "/home/publish/app/homeDeviceUrl"); String path = GlobalSysInfo.getParamValue(Constant.DISTRIBUTE_PATH, "/home/publish/app/homeDeviceUrl");
...@@ -104,6 +102,35 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D ...@@ -104,6 +102,35 @@ public class DeviceModuleDistributeServiceImpl extends AbstractCRUDServiceImpl<D
this.update(distributeEntity, context); this.update(distributeEntity, context);
} }
@Override
public Rest<String> selected(DeviceModuleDistributeEntity distributeEntity, Context context) {
//选择默认资源默认分辨率
//如果选择的资源未部署,则提示先部署后才能选择
DeviceModuleDistributeEntity deviceModuleDistributeEntity = this.get(distributeEntity.getId(), context);
if (!ObjectUtils.isEmpty(deviceModuleDistributeEntity) && deviceModuleDistributeEntity.getDistribute() == YesNoEnum.NO.getValue()) {
throw new AppException("选择的默认资源需先部署后才能选择!");
}
//查询同类资源,变更为非默认值后 再更新
DeviceModuleDistributeQuery query = new DeviceModuleDistributeQuery();
query.setProductId(deviceModuleDistributeEntity.getProductId());
List<Long> idList = this.find(query, context).stream().map(i -> i.getId()).collect(Collectors.toList());
DeviceModuleDistributeQuery condition = new DeviceModuleDistributeQuery();
condition.setIdList(idList);
DeviceModuleDistributeEntity entity = new DeviceModuleDistributeEntity();
entity.setSelected(YesNoEnum.NO.getValue());
this.updateBatch(entity, condition, context);
distributeEntity.setSelected(YesNoEnum.YES.getValue());
distributeEntity.setUpdateTime(new Date());
distributeEntity.setUpdateUserId(this.getContextUserId(context));
return Rest.ok();
}
@Override @Override
public Rest<String> cloneAppBySite(DeviceModuleDistributeEntity deviceModuleDistributeEntity, Context context) { public Rest<String> cloneAppBySite(DeviceModuleDistributeEntity deviceModuleDistributeEntity, Context context) {
......
...@@ -13,6 +13,7 @@ import com.mortals.xhx.base.system.param.service.ParamService; ...@@ -13,6 +13,7 @@ import com.mortals.xhx.base.system.param.service.ParamService;
import com.mortals.xhx.common.code.ImageReEnum; import com.mortals.xhx.common.code.ImageReEnum;
import com.mortals.xhx.common.code.YesNoEnum; import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.module.device.model.DeviceModuleDistributeEntity; import com.mortals.xhx.module.device.model.DeviceModuleDistributeEntity;
import com.mortals.xhx.module.device.model.DeviceModuleDistributeQuery;
import com.mortals.xhx.module.device.service.DeviceModuleDistributeService; import com.mortals.xhx.module.device.service.DeviceModuleDistributeService;
import com.mortals.xhx.module.product.model.ProductEntity; import com.mortals.xhx.module.product.model.ProductEntity;
import com.mortals.xhx.module.product.service.ProductService; import com.mortals.xhx.module.product.service.ProductService;
...@@ -30,7 +31,6 @@ import java.util.stream.Collectors; ...@@ -30,7 +31,6 @@ import java.util.stream.Collectors;
import static com.mortals.xhx.common.key.Constant.PARAM_SERVER_HTTP_URL; import static com.mortals.xhx.common.key.Constant.PARAM_SERVER_HTTP_URL;
/** /**
*
* 设备前端模块部署 * 设备前端模块部署
* *
* @author zxfei * @author zxfei
...@@ -38,15 +38,15 @@ import static com.mortals.xhx.common.key.Constant.PARAM_SERVER_HTTP_URL; ...@@ -38,15 +38,15 @@ import static com.mortals.xhx.common.key.Constant.PARAM_SERVER_HTTP_URL;
*/ */
@RestController @RestController
@RequestMapping("device/module/distribute") @RequestMapping("device/module/distribute")
public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingController<DeviceModuleDistributeService,DeviceModuleDistributeEntity,Long> { public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingController<DeviceModuleDistributeService, DeviceModuleDistributeEntity, Long> {
@Autowired @Autowired
private ParamService paramService; private ParamService paramService;
@Autowired @Autowired
private ProductService productService; private ProductService productService;
public DeviceModuleDistributeController(){ public DeviceModuleDistributeController() {
super.setModuleDesc( "设备前端模块部署"); super.setModuleDesc("设备前端模块部署");
} }
@Override @Override
...@@ -60,6 +60,8 @@ public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingCon ...@@ -60,6 +60,8 @@ public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingCon
this.addDict(model, "imageResolution", skinProductCodeMap); this.addDict(model, "imageResolution", skinProductCodeMap);
}*/ }*/
this.addDict(model, "selected", YesNoEnum.getEnumMap());
this.addDict(model, "imageResolution", ImageReEnum.getEnumMap()); this.addDict(model, "imageResolution", ImageReEnum.getEnumMap());
super.init(model, context); super.init(model, context);
} }
...@@ -103,25 +105,61 @@ public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingCon ...@@ -103,25 +105,61 @@ public class DeviceModuleDistributeController extends BaseCRUDJsonBodyMappingCon
} }
/**
* 默认选择
*/
@PostMapping(value = "selected")
public Rest<Void> selected(@RequestBody DeviceModuleDistributeEntity moduleDistributeEntity) {
String busiDesc = this.getModuleDesc() + "资源默认选择";
Rest<Void> rest = Rest.ok(busiDesc + " 【成功】");
try {
this.service.selected(moduleDistributeEntity, getContext());
recordSysLog(request, busiDesc + " 【成功】");
} catch (Exception e) {
log.error("设备模块部署", e);
rest = Rest.fail(super.convertException(e));
}
return rest;
}
@Override @Override
protected int viewAfter(Long id, Map<String, Object> model, DeviceModuleDistributeEntity entity, Context context) throws AppException { protected void saveBefore(DeviceModuleDistributeEntity entity, Map<String, Object> model, Context context) throws AppException {
ProductEntity productEntity = productService.get(entity.getProductId(), context);
entity.setProductCode(productEntity.getProductCode());
entity.setProductName(productEntity.getProductName());
entity.setImageResolutionValue(ImageReEnum.getByValue(Integer.parseInt(entity.getImageResolution())).getDesc());
//查询新增的是否存在,如果存在 则更新,标准为分辨率+产品
DeviceModuleDistributeQuery query = new DeviceModuleDistributeQuery();
query.setSiteId(entity.getSiteId());
query.setProductId(entity.getProductId());
query.setImageResolution(entity.getImageResolution());
DeviceModuleDistributeEntity deviceModuleDistributeEntity = this.service.selectOne(query, context);
if (!ObjectUtils.isEmpty(deviceModuleDistributeEntity)) {
entity.setId(deviceModuleDistributeEntity.getId());
}
}
@Override
protected int viewAfter(Long id, Map<String, Object> model, DeviceModuleDistributeEntity entity, Context context) throws AppException {
String serverName = request.getHeader("server-name"); String serverName = request.getHeader("server-name");
Integer serverPort = DataUtil.converStr2Int(request.getHeader("server-port"),0); Integer serverPort = DataUtil.converStr2Int(request.getHeader("server-port"), 0);
String homeUrl=""; String homeUrl = "";
ProductEntity productEntity = productService.get(entity.getProductId(), context); ProductEntity productEntity = productService.get(entity.getProductId(), context);
if(!ObjectUtils.isEmpty(productEntity.getHomeUrl())){ if (!ObjectUtils.isEmpty(productEntity.getHomeUrl())) {
homeUrl= productEntity.getHomeUrl(); homeUrl = productEntity.getHomeUrl();
} }
String domain = GlobalSysInfo.getParamValue(PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11078"); String domain = GlobalSysInfo.getParamValue(PARAM_SERVER_HTTP_URL, "http://192.168.0.98:11078");
if(!ObjectUtils.isEmpty(serverName)&& Validator.isIpv4(serverName)){ if (!ObjectUtils.isEmpty(serverName) && Validator.isIpv4(serverName)) {
String str = UrlBuilder.ofHttp(serverName).setPort(serverPort>0?serverPort:11078).addPath(homeUrl).build(); String str = UrlBuilder.ofHttp(serverName).setPort(serverPort > 0 ? serverPort : 11078).addPath(homeUrl).build();
String decodeStr = URLDecoder.decode(str, Charset.defaultCharset()); String decodeStr = URLDecoder.decode(str, Charset.defaultCharset());
entity.setFilePath(decodeStr); entity.setFilePath(decodeStr);
}else{ } else {
String str = UrlBuilder.of(domain.trim()).addPath(homeUrl).build(); String str = UrlBuilder.of(domain.trim()).addPath(homeUrl).build();
String decodeStr = URLDecoder.decode(str, Charset.defaultCharset()); String decodeStr = URLDecoder.decode(str, Charset.defaultCharset());
entity.setFilePath(decodeStr); entity.setFilePath(decodeStr);
......
...@@ -2,14 +2,13 @@ package com.mortals.xhx.module.product.model; ...@@ -2,14 +2,13 @@ package com.mortals.xhx.module.product.model;
import com.mortals.framework.annotation.Excel; import com.mortals.framework.annotation.Excel;
import com.mortals.xhx.module.product.model.vo.ProductVo; import com.mortals.xhx.module.product.model.vo.ProductVo;
import lombok.Data;
/** /**
* 产品实体对象 * 产品实体对象
* *
* @author zxfei * @author zxfei
* @date 2023-08-21 * @date 2022-11-09
*/ */
@Data
public class ProductEntity extends ProductVo { public class ProductEntity extends ProductVo {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -47,18 +46,126 @@ public class ProductEntity extends ProductVo { ...@@ -47,18 +46,126 @@ public class ProductEntity extends ProductVo {
* 备注 * 备注
*/ */
private String productRemark; private String productRemark;
public ProductEntity(){}
/**
* 获取 关联平台
* @return Long
*/
public Long getPlatformId(){
return platformId;
}
/**
* 设置 关联平台
* @param platformId
*/
public void setPlatformId(Long platformId){
this.platformId = platformId;
}
/**
* 获取 产品名称,名称唯一
* @return String
*/
public String getProductName(){
return productName;
}
/**
* 设置 产品名称,名称唯一
* @param productName
*/
public void setProductName(String productName){
this.productName = productName;
}
/**
* 获取 产品编码
* @return String
*/
public String getProductCode(){
return productCode;
}
/**
* 设置 产品编码
* @param productCode
*/
public void setProductCode(String productCode){
this.productCode = productCode;
}
/**
* 获取 皮肤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;
}
/** /**
* 站点Id,来源基础服务平台 * 获取 首页地址
* @return String
*/ */
private Long siteId; public String getHomeUrl(){
return homeUrl;
}
/**
* 设置 首页地址
* @param homeUrl
*/
public void setHomeUrl(String homeUrl){
this.homeUrl = homeUrl;
}
/** /**
* 站点编号,来源基础服务平台 * 获取 事件地址,评价器使用
* @return String
*/ */
private String siteCode; public String getEventUrl(){
return eventUrl;
}
/**
* 设置 事件地址,评价器使用
* @param eventUrl
*/
public void setEventUrl(String eventUrl){
this.eventUrl = eventUrl;
}
/**
* 获取 备注
* @return String
*/
public String getProductRemark(){
return productRemark;
}
/** /**
* 站点名称 * 设置 备注
* @param productRemark
*/ */
private String siteName; public void setProductRemark(String productRemark){
this.productRemark = productRemark;
}
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -75,17 +182,35 @@ public class ProductEntity extends ProductVo { ...@@ -75,17 +182,35 @@ public class ProductEntity extends ProductVo {
return false; return false;
} }
public String toString(){
StringBuilder sb = new StringBuilder("");
sb.append(",platformId:").append(getPlatformId());
sb.append(",productName:").append(getProductName());
sb.append(",productCode:").append(getProductCode());
sb.append(",skinId:").append(getSkinId());
sb.append(",skinName:").append(getSkinName());
sb.append(",homeUrl:").append(getHomeUrl());
sb.append(",eventUrl:").append(getEventUrl());
sb.append(",productRemark:").append(getProductRemark());
return sb.toString();
}
public void initAttrValue(){ public void initAttrValue(){
this.platformId = 0L;
this.platformId = null;
this.productName = ""; this.productName = "";
this.productCode = ""; this.productCode = "";
this.skinId = 0L;
this.skinId = null;
this.skinName = ""; this.skinName = "";
this.homeUrl = ""; this.homeUrl = "";
this.eventUrl = ""; this.eventUrl = "";
this.productRemark = ""; this.productRemark = "";
this.siteId = 0L;
this.siteCode = "";
this.siteName = "";
} }
} }
\ No newline at end of file
...@@ -5,7 +5,7 @@ import java.util.List; ...@@ -5,7 +5,7 @@ import java.util.List;
* 产品查询对象 * 产品查询对象
* *
* @author zxfei * @author zxfei
* @date 2023-08-21 * @date 2022-11-09
*/ */
public class ProductQuery extends ProductEntity { public class ProductQuery extends ProductEntity {
/** 开始 主键ID,主键,自增长 */ /** 开始 主键ID,主键,自增长 */
...@@ -20,9 +20,6 @@ public class ProductQuery extends ProductEntity { ...@@ -20,9 +20,6 @@ public class ProductQuery extends ProductEntity {
/** 主键ID,主键,自增长列表 */ /** 主键ID,主键,自增长列表 */
private List <Long> idList; private List <Long> idList;
/** 主键ID,主键,自增长排除列表 */
private List <Long> idNotList;
/** 开始 关联平台 */ /** 开始 关联平台 */
private Long platformIdStart; private Long platformIdStart;
...@@ -35,19 +32,12 @@ public class ProductQuery extends ProductEntity { ...@@ -35,19 +32,12 @@ public class ProductQuery extends ProductEntity {
/** 关联平台列表 */ /** 关联平台列表 */
private List <Long> platformIdList; private List <Long> platformIdList;
/** 关联平台排除列表 */
private List <Long> platformIdNotList;
/** 产品名称,名称唯一 */ /** 产品名称,名称唯一 */
private List<String> productNameList; private List<String> productNameList;
/** 产品名称,名称唯一排除列表 */
private List <String> productNameNotList;
/** 产品编码 */ /** 产品编码 */
private List<String> productCodeList; private List<String> productCodeList;
/** 产品编码排除列表 */
private List <String> productCodeNotList;
/** 开始 皮肤id */ /** 开始 皮肤id */
private Long skinIdStart; private Long skinIdStart;
...@@ -60,29 +50,18 @@ public class ProductQuery extends ProductEntity { ...@@ -60,29 +50,18 @@ public class ProductQuery extends ProductEntity {
/** 皮肤id列表 */ /** 皮肤id列表 */
private List <Long> skinIdList; private List <Long> skinIdList;
/** 皮肤id排除列表 */
private List <Long> skinIdNotList;
/** 皮肤名称 */ /** 皮肤名称 */
private List<String> skinNameList; private List<String> skinNameList;
/** 皮肤名称排除列表 */
private List <String> skinNameNotList;
/** 首页地址 */ /** 首页地址 */
private List<String> homeUrlList; private List<String> homeUrlList;
/** 首页地址排除列表 */
private List <String> homeUrlNotList;
/** 事件地址,评价器使用 */ /** 事件地址,评价器使用 */
private List<String> eventUrlList; private List<String> eventUrlList;
/** 事件地址,评价器使用排除列表 */
private List <String> eventUrlNotList;
/** 备注 */ /** 备注 */
private List<String> productRemarkList; private List<String> productRemarkList;
/** 备注排除列表 */
private List <String> productRemarkNotList;
/** 开始 创建用户 */ /** 开始 创建用户 */
private Long createUserIdStart; private Long createUserIdStart;
...@@ -95,9 +74,6 @@ public class ProductQuery extends ProductEntity { ...@@ -95,9 +74,6 @@ public class ProductQuery extends ProductEntity {
/** 创建用户列表 */ /** 创建用户列表 */
private List <Long> createUserIdList; private List <Long> createUserIdList;
/** 创建用户排除列表 */
private List <Long> createUserIdNotList;
/** 开始 创建时间 */ /** 开始 创建时间 */
private String createTimeStart; private String createTimeStart;
...@@ -116,40 +92,12 @@ public class ProductQuery extends ProductEntity { ...@@ -116,40 +92,12 @@ public class ProductQuery extends ProductEntity {
/** 更新用户列表 */ /** 更新用户列表 */
private List <Long> updateUserIdList; private List <Long> updateUserIdList;
/** 更新用户排除列表 */
private List <Long> updateUserIdNotList;
/** 开始 更新时间 */ /** 开始 更新时间 */
private String updateTimeStart; private String updateTimeStart;
/** 结束 更新时间 */ /** 结束 更新时间 */
private String updateTimeEnd; private String updateTimeEnd;
/** 开始 站点Id,来源基础服务平台 */
private Long siteIdStart;
/** 结束 站点Id,来源基础服务平台 */
private Long siteIdEnd;
/** 增加 站点Id,来源基础服务平台 */
private Long siteIdIncrement;
/** 站点Id,来源基础服务平台列表 */
private List <Long> siteIdList;
/** 站点Id,来源基础服务平台排除列表 */
private List <Long> siteIdNotList;
/** 站点编号,来源基础服务平台 */
private List<String> siteCodeList;
/** 站点编号,来源基础服务平台排除列表 */
private List <String> siteCodeNotList;
/** 站点名称 */
private List<String> siteNameList;
/** 站点名称排除列表 */
private List <String> siteNameNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */ /** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<ProductQuery> orConditionList; private List<ProductQuery> orConditionList;
...@@ -222,23 +170,6 @@ public class ProductQuery extends ProductEntity { ...@@ -222,23 +170,6 @@ public class ProductQuery extends ProductEntity {
this.idList = idList; this.idList = idList;
} }
/**
* 获取 主键ID,主键,自增长
* @return idNotList
*/
public List<Long> getIdNotList(){
return this.idNotList;
}
/**
* 设置 主键ID,主键,自增长
* @param idNotList
*/
public void setIdNotList(List<Long> idNotList){
this.idNotList = idNotList;
}
/** /**
* 获取 开始 关联平台 * 获取 开始 关联平台
* @return platformIdStart * @return platformIdStart
...@@ -303,23 +234,6 @@ public class ProductQuery extends ProductEntity { ...@@ -303,23 +234,6 @@ public class ProductQuery extends ProductEntity {
this.platformIdList = platformIdList; this.platformIdList = platformIdList;
} }
/**
* 获取 关联平台
* @return platformIdNotList
*/
public List<Long> getPlatformIdNotList(){
return this.platformIdNotList;
}
/**
* 设置 关联平台
* @param platformIdNotList
*/
public void setPlatformIdNotList(List<Long> platformIdNotList){
this.platformIdNotList = platformIdNotList;
}
/** /**
* 获取 产品名称,名称唯一 * 获取 产品名称,名称唯一
* @return productNameList * @return productNameList
...@@ -335,23 +249,6 @@ public class ProductQuery extends ProductEntity { ...@@ -335,23 +249,6 @@ public class ProductQuery extends ProductEntity {
public void setProductNameList(List<String> productNameList){ public void setProductNameList(List<String> productNameList){
this.productNameList = productNameList; this.productNameList = productNameList;
} }
/**
* 获取 产品名称,名称唯一
* @return productNameNotList
*/
public List<String> getProductNameNotList(){
return this.productNameNotList;
}
/**
* 设置 产品名称,名称唯一
* @param productNameNotList
*/
public void setProductNameNotList(List<String> productNameNotList){
this.productNameNotList = productNameNotList;
}
/** /**
* 获取 产品编码 * 获取 产品编码
* @return productCodeList * @return productCodeList
...@@ -367,23 +264,6 @@ public class ProductQuery extends ProductEntity { ...@@ -367,23 +264,6 @@ public class ProductQuery extends ProductEntity {
public void setProductCodeList(List<String> productCodeList){ public void setProductCodeList(List<String> productCodeList){
this.productCodeList = productCodeList; this.productCodeList = productCodeList;
} }
/**
* 获取 产品编码
* @return productCodeNotList
*/
public List<String> getProductCodeNotList(){
return this.productCodeNotList;
}
/**
* 设置 产品编码
* @param productCodeNotList
*/
public void setProductCodeNotList(List<String> productCodeNotList){
this.productCodeNotList = productCodeNotList;
}
/** /**
* 获取 开始 皮肤id * 获取 开始 皮肤id
* @return skinIdStart * @return skinIdStart
...@@ -448,23 +328,6 @@ public class ProductQuery extends ProductEntity { ...@@ -448,23 +328,6 @@ public class ProductQuery extends ProductEntity {
this.skinIdList = skinIdList; this.skinIdList = skinIdList;
} }
/**
* 获取 皮肤id
* @return skinIdNotList
*/
public List<Long> getSkinIdNotList(){
return this.skinIdNotList;
}
/**
* 设置 皮肤id
* @param skinIdNotList
*/
public void setSkinIdNotList(List<Long> skinIdNotList){
this.skinIdNotList = skinIdNotList;
}
/** /**
* 获取 皮肤名称 * 获取 皮肤名称
* @return skinNameList * @return skinNameList
...@@ -480,23 +343,6 @@ public class ProductQuery extends ProductEntity { ...@@ -480,23 +343,6 @@ public class ProductQuery extends ProductEntity {
public void setSkinNameList(List<String> skinNameList){ public void setSkinNameList(List<String> skinNameList){
this.skinNameList = skinNameList; this.skinNameList = skinNameList;
} }
/**
* 获取 皮肤名称
* @return skinNameNotList
*/
public List<String> getSkinNameNotList(){
return this.skinNameNotList;
}
/**
* 设置 皮肤名称
* @param skinNameNotList
*/
public void setSkinNameNotList(List<String> skinNameNotList){
this.skinNameNotList = skinNameNotList;
}
/** /**
* 获取 首页地址 * 获取 首页地址
* @return homeUrlList * @return homeUrlList
...@@ -512,23 +358,6 @@ public class ProductQuery extends ProductEntity { ...@@ -512,23 +358,6 @@ public class ProductQuery extends ProductEntity {
public void setHomeUrlList(List<String> homeUrlList){ public void setHomeUrlList(List<String> homeUrlList){
this.homeUrlList = homeUrlList; this.homeUrlList = homeUrlList;
} }
/**
* 获取 首页地址
* @return homeUrlNotList
*/
public List<String> getHomeUrlNotList(){
return this.homeUrlNotList;
}
/**
* 设置 首页地址
* @param homeUrlNotList
*/
public void setHomeUrlNotList(List<String> homeUrlNotList){
this.homeUrlNotList = homeUrlNotList;
}
/** /**
* 获取 事件地址,评价器使用 * 获取 事件地址,评价器使用
* @return eventUrlList * @return eventUrlList
...@@ -544,23 +373,6 @@ public class ProductQuery extends ProductEntity { ...@@ -544,23 +373,6 @@ public class ProductQuery extends ProductEntity {
public void setEventUrlList(List<String> eventUrlList){ public void setEventUrlList(List<String> eventUrlList){
this.eventUrlList = eventUrlList; this.eventUrlList = eventUrlList;
} }
/**
* 获取 事件地址,评价器使用
* @return eventUrlNotList
*/
public List<String> getEventUrlNotList(){
return this.eventUrlNotList;
}
/**
* 设置 事件地址,评价器使用
* @param eventUrlNotList
*/
public void setEventUrlNotList(List<String> eventUrlNotList){
this.eventUrlNotList = eventUrlNotList;
}
/** /**
* 获取 备注 * 获取 备注
* @return productRemarkList * @return productRemarkList
...@@ -576,23 +388,6 @@ public class ProductQuery extends ProductEntity { ...@@ -576,23 +388,6 @@ public class ProductQuery extends ProductEntity {
public void setProductRemarkList(List<String> productRemarkList){ public void setProductRemarkList(List<String> productRemarkList){
this.productRemarkList = productRemarkList; this.productRemarkList = productRemarkList;
} }
/**
* 获取 备注
* @return productRemarkNotList
*/
public List<String> getProductRemarkNotList(){
return this.productRemarkNotList;
}
/**
* 设置 备注
* @param productRemarkNotList
*/
public void setProductRemarkNotList(List<String> productRemarkNotList){
this.productRemarkNotList = productRemarkNotList;
}
/** /**
* 获取 开始 创建用户 * 获取 开始 创建用户
* @return createUserIdStart * @return createUserIdStart
...@@ -657,23 +452,6 @@ public class ProductQuery extends ProductEntity { ...@@ -657,23 +452,6 @@ public class ProductQuery extends ProductEntity {
this.createUserIdList = createUserIdList; this.createUserIdList = createUserIdList;
} }
/**
* 获取 创建用户
* @return createUserIdNotList
*/
public List<Long> getCreateUserIdNotList(){
return this.createUserIdNotList;
}
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public void setCreateUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
}
/** /**
* 获取 开始 创建时间 * 获取 开始 创建时间
* @return createTimeStart * @return createTimeStart
...@@ -770,23 +548,6 @@ public class ProductQuery extends ProductEntity { ...@@ -770,23 +548,6 @@ public class ProductQuery extends ProductEntity {
this.updateUserIdList = updateUserIdList; this.updateUserIdList = updateUserIdList;
} }
/**
* 获取 更新用户
* @return updateUserIdNotList
*/
public List<Long> getUpdateUserIdNotList(){
return this.updateUserIdNotList;
}
/**
* 设置 更新用户
* @param updateUserIdNotList
*/
public void setUpdateUserIdNotList(List<Long> updateUserIdNotList){
this.updateUserIdNotList = updateUserIdNotList;
}
/** /**
* 获取 开始 更新时间 * 获取 开始 更新时间
* @return updateTimeStart * @return updateTimeStart
...@@ -819,151 +580,6 @@ public class ProductQuery extends ProductEntity { ...@@ -819,151 +580,6 @@ public class ProductQuery extends ProductEntity {
this.updateTimeEnd = updateTimeEnd; this.updateTimeEnd = updateTimeEnd;
} }
/**
* 获取 开始 站点Id,来源基础服务平台
* @return siteIdStart
*/
public Long getSiteIdStart(){
return this.siteIdStart;
}
/**
* 设置 开始 站点Id,来源基础服务平台
* @param siteIdStart
*/
public void setSiteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
}
/**
* 获取 结束 站点Id,来源基础服务平台
* @return $siteIdEnd
*/
public Long getSiteIdEnd(){
return this.siteIdEnd;
}
/**
* 设置 结束 站点Id,来源基础服务平台
* @param siteIdEnd
*/
public void setSiteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
}
/**
* 获取 增加 站点Id,来源基础服务平台
* @return siteIdIncrement
*/
public Long getSiteIdIncrement(){
return this.siteIdIncrement;
}
/**
* 设置 增加 站点Id,来源基础服务平台
* @param siteIdIncrement
*/
public void setSiteIdIncrement(Long siteIdIncrement){
this.siteIdIncrement = siteIdIncrement;
}
/**
* 获取 站点Id,来源基础服务平台
* @return siteIdList
*/
public List<Long> getSiteIdList(){
return this.siteIdList;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteIdList
*/
public void setSiteIdList(List<Long> siteIdList){
this.siteIdList = siteIdList;
}
/**
* 获取 站点Id,来源基础服务平台
* @return siteIdNotList
*/
public List<Long> getSiteIdNotList(){
return this.siteIdNotList;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteIdNotList
*/
public void setSiteIdNotList(List<Long> siteIdNotList){
this.siteIdNotList = siteIdNotList;
}
/**
* 获取 站点编号,来源基础服务平台
* @return siteCodeList
*/
public List<String> getSiteCodeList(){
return this.siteCodeList;
}
/**
* 设置 站点编号,来源基础服务平台
* @param siteCodeList
*/
public void setSiteCodeList(List<String> siteCodeList){
this.siteCodeList = siteCodeList;
}
/**
* 获取 站点编号,来源基础服务平台
* @return siteCodeNotList
*/
public List<String> getSiteCodeNotList(){
return this.siteCodeNotList;
}
/**
* 设置 站点编号,来源基础服务平台
* @param siteCodeNotList
*/
public void setSiteCodeNotList(List<String> siteCodeNotList){
this.siteCodeNotList = siteCodeNotList;
}
/**
* 获取 站点名称
* @return siteNameList
*/
public List<String> getSiteNameList(){
return this.siteNameList;
}
/**
* 设置 站点名称
* @param siteNameList
*/
public void setSiteNameList(List<String> siteNameList){
this.siteNameList = siteNameList;
}
/**
* 获取 站点名称
* @return siteNameNotList
*/
public List<String> getSiteNameNotList(){
return this.siteNameNotList;
}
/**
* 设置 站点名称
* @param siteNameNotList
*/
public void setSiteNameNotList(List<String> siteNameNotList){
this.siteNameNotList = siteNameNotList;
}
/** /**
* 设置 主键ID,主键,自增长 * 设置 主键ID,主键,自增长
* @param id * @param id
...@@ -1009,15 +625,6 @@ public class ProductQuery extends ProductEntity { ...@@ -1009,15 +625,6 @@ public class ProductQuery extends ProductEntity {
return this; return this;
} }
/**
* 设置 主键ID,主键,自增长
* @param idNotList
*/
public ProductQuery idNotList(List<Long> idNotList){
this.idNotList = idNotList;
return this;
}
/** /**
* 设置 关联平台 * 设置 关联平台
* @param platformId * @param platformId
...@@ -1063,15 +670,6 @@ public class ProductQuery extends ProductEntity { ...@@ -1063,15 +670,6 @@ public class ProductQuery extends ProductEntity {
return this; return this;
} }
/**
* 设置 关联平台
* @param platformIdNotList
*/
public ProductQuery platformIdNotList(List<Long> platformIdNotList){
this.platformIdNotList = platformIdNotList;
return this;
}
/** /**
* 设置 产品名称,名称唯一 * 设置 产品名称,名称唯一
...@@ -1155,15 +753,6 @@ public class ProductQuery extends ProductEntity { ...@@ -1155,15 +753,6 @@ public class ProductQuery extends ProductEntity {
return this; return this;
} }
/**
* 设置 皮肤id
* @param skinIdNotList
*/
public ProductQuery skinIdNotList(List<Long> skinIdNotList){
this.skinIdNotList = skinIdNotList;
return this;
}
/** /**
* 设置 皮肤名称 * 设置 皮肤名称
...@@ -1285,15 +874,6 @@ public class ProductQuery extends ProductEntity { ...@@ -1285,15 +874,6 @@ public class ProductQuery extends ProductEntity {
return this; return this;
} }
/**
* 设置 创建用户
* @param createUserIdNotList
*/
public ProductQuery createUserIdNotList(List<Long> createUserIdNotList){
this.createUserIdNotList = createUserIdNotList;
return this;
}
/** /**
* 设置 更新用户 * 设置 更新用户
...@@ -1340,107 +920,6 @@ public class ProductQuery extends ProductEntity { ...@@ -1340,107 +920,6 @@ public class ProductQuery extends ProductEntity {
return this; return this;
} }
/**
* 设置 更新用户
* @param updateUserIdNotList
*/
public ProductQuery updateUserIdNotList(List<Long> updateUserIdNotList){
this.updateUserIdNotList = updateUserIdNotList;
return this;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteId
*/
public ProductQuery siteId(Long siteId){
setSiteId(siteId);
return this;
}
/**
* 设置 开始 站点Id,来源基础服务平台
* @param siteIdStart
*/
public ProductQuery siteIdStart(Long siteIdStart){
this.siteIdStart = siteIdStart;
return this;
}
/**
* 设置 结束 站点Id,来源基础服务平台
* @param siteIdEnd
*/
public ProductQuery siteIdEnd(Long siteIdEnd){
this.siteIdEnd = siteIdEnd;
return this;
}
/**
* 设置 增加 站点Id,来源基础服务平台
* @param siteIdIncrement
*/
public ProductQuery siteIdIncrement(Long siteIdIncrement){
this.siteIdIncrement = siteIdIncrement;
return this;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteIdList
*/
public ProductQuery siteIdList(List<Long> siteIdList){
this.siteIdList = siteIdList;
return this;
}
/**
* 设置 站点Id,来源基础服务平台
* @param siteIdNotList
*/
public ProductQuery siteIdNotList(List<Long> siteIdNotList){
this.siteIdNotList = siteIdNotList;
return this;
}
/**
* 设置 站点编号,来源基础服务平台
* @param siteCode
*/
public ProductQuery siteCode(String siteCode){
setSiteCode(siteCode);
return this;
}
/**
* 设置 站点编号,来源基础服务平台
* @param siteCodeList
*/
public ProductQuery siteCodeList(List<String> siteCodeList){
this.siteCodeList = siteCodeList;
return this;
}
/**
* 设置 站点名称
* @param siteName
*/
public ProductQuery siteName(String siteName){
setSiteName(siteName);
return this;
}
/**
* 设置 站点名称
* @param siteNameList
*/
public ProductQuery siteNameList(List<String> siteNameList){
this.siteNameList = siteNameList;
return this;
}
/** /**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) * 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
......
package com.mortals.xhx.module.product.model.vo; package com.mortals.xhx.module.product.model.vo;
import com.mortals.framework.model.BaseEntityLong; import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.product.model.ProductEntity; import lombok.Data;
import java.util.ArrayList;
import java.util.List;
/** /**
* 产品视图对象 * 产品视图对象
* *
* @author zxfei * @author zxfei
* @date 2022-07-01 * @date 2022-07-01
*/ */
@Data
public class ProductVo extends BaseEntityLong { public class ProductVo extends BaseEntityLong {
} }
\ No newline at end of file
package com.mortals.xhx.module.product.service; package com.mortals.xhx.module.product.service;
import com.mortals.framework.common.Rest;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.service.ICRUDCacheService; import com.mortals.framework.service.ICRUDCacheService;
import com.mortals.xhx.module.product.model.ProductEntity; import com.mortals.xhx.module.product.model.ProductEntity;
...@@ -17,5 +18,7 @@ public interface ProductService extends ICRUDCacheService<ProductEntity,Long>{ ...@@ -17,5 +18,7 @@ public interface ProductService extends ICRUDCacheService<ProductEntity,Long>{
void upGrade(Long productId, Context context); void upGrade(Long productId, Context context);
Rest<String> cloneProductBySite(ProductEntity productEntity, Context context);
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ import cn.hutool.core.net.url.UrlPath; ...@@ -5,6 +5,7 @@ import cn.hutool.core.net.url.UrlPath;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.mortals.framework.ap.GlobalSysInfo; import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context; import com.mortals.framework.model.Context;
import com.mortals.framework.model.OrderCol; import com.mortals.framework.model.OrderCol;
...@@ -13,14 +14,15 @@ import com.mortals.framework.util.DateUtils; ...@@ -13,14 +14,15 @@ import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.base.system.message.impl.MessageProducer; import com.mortals.xhx.base.system.message.impl.MessageProducer;
import com.mortals.xhx.busiz.rsp.ProductVersionInfo; import com.mortals.xhx.busiz.rsp.ProductVersionInfo;
import com.mortals.xhx.common.code.LogTypeEnum; import com.mortals.xhx.common.code.LogTypeEnum;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.common.key.Constant; import com.mortals.xhx.common.key.Constant;
import com.mortals.xhx.common.key.QueueKey; import com.mortals.xhx.common.key.QueueKey;
import com.mortals.xhx.common.model.DefaultTbQueueMsgHeaders; import com.mortals.xhx.common.model.DefaultTbQueueMsgHeaders;
import com.mortals.xhx.common.model.MessageHeader; import com.mortals.xhx.common.model.MessageHeader;
import com.mortals.xhx.common.pdu.site.SitePdu;
import com.mortals.xhx.common.utils.BeanUtil; import com.mortals.xhx.common.utils.BeanUtil;
import com.mortals.xhx.module.device.model.DeviceEntity; import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.module.device.model.DeviceLogEntity; import com.mortals.xhx.module.device.model.*;
import com.mortals.xhx.module.device.model.DeviceQuery;
import com.mortals.xhx.module.device.service.DeviceLogService; import com.mortals.xhx.module.device.service.DeviceLogService;
import com.mortals.xhx.module.device.service.DeviceService; import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.platform.model.PlatformEntity; import com.mortals.xhx.module.platform.model.PlatformEntity;
...@@ -73,7 +75,8 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao, ...@@ -73,7 +75,8 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
private DeviceLogService deviceLogService; private DeviceLogService deviceLogService;
@Autowired @Autowired
private MessageProducer messageProducer; private MessageProducer messageProducer;
@Autowired
private ISiteFeign siteFeign;
@Override @Override
...@@ -129,8 +132,6 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao, ...@@ -129,8 +132,6 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
throw new AppException("当前设备未配置所属系统平台,请在后台配置后再激活!"); throw new AppException("当前设备未配置所属系统平台,请在后台配置后再激活!");
} }
String exchangeName = platformEntity.getPlatformSn() + Constant.EXCHANGE_SPLIT + productEntity.getProductCode();
List<DeviceEntity> deviceList = deviceService.find(new DeviceQuery().productId(productId)); List<DeviceEntity> deviceList = deviceService.find(new DeviceQuery().productId(productId));
deviceList.forEach(deviceEntity -> { deviceList.forEach(deviceEntity -> {
//TopicPartitionInfo info = TopicPartitionInfo.builder().exchangeName(exchangeName).topic(Constant.DOWN_TOPIC + deviceEntity.getDeviceCode()).build(); //TopicPartitionInfo info = TopicPartitionInfo.builder().exchangeName(exchangeName).topic(Constant.DOWN_TOPIC + deviceEntity.getDeviceCode()).build();
...@@ -145,7 +146,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao, ...@@ -145,7 +146,7 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
header.put(MessageHeader.TIMESTAMP, DateUtils.getCurrStrDateTime()); header.put(MessageHeader.TIMESTAMP, DateUtils.getCurrStrDateTime());
header.put(MessageHeader.MESSAGESIGN, "abcd1234"); header.put(MessageHeader.MESSAGESIGN, "abcd1234");
TbQueueMsg queueMsg = new DefaultTbQueueMsg(IdUtil.fastUUID(), Base64.getEncoder().encodeToString(JSON.toJSONString(productVersionInfo).getBytes()), header); TbQueueMsg queueMsg = new DefaultTbQueueMsg(IdUtil.fastUUID(), Base64.getEncoder().encodeToString(JSON.toJSONString(productVersionInfo).getBytes()), header);
messageProducer.sendMsg(QueueKey.DEFAULT_EXCHANGE,Constant.DOWN_TOPIC + deviceEntity.getDeviceCode(),JSON.toJSONString(queueMsg)); messageProducer.sendMsg(QueueKey.DEFAULT_EXCHANGE, Constant.DOWN_TOPIC + deviceEntity.getDeviceCode(), JSON.toJSONString(queueMsg));
DeviceLogEntity deviceLogEntity = new DeviceLogEntity(); DeviceLogEntity deviceLogEntity = new DeviceLogEntity();
deviceLogEntity.initAttrValue(); deviceLogEntity.initAttrValue();
...@@ -159,14 +160,51 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao, ...@@ -159,14 +160,51 @@ public class ProductServiceImpl extends AbstractCRUDCacheServiceImpl<ProductDao,
deviceLogEntity.setLogType(LogTypeEnum.下发服务.getValue()); deviceLogEntity.setLogType(LogTypeEnum.下发服务.getValue());
deviceLogEntity.setCreateUserId(1L); deviceLogEntity.setCreateUserId(1L);
deviceLogEntity.setCreateTime(new Date()); deviceLogEntity.setCreateTime(new Date());
deviceLogService.save(deviceLogEntity,context); deviceLogService.save(deviceLogEntity, context);
log.info("【发送中】发送升级版本信息,设备编码:{}",deviceEntity.getDeviceCode()); log.info("【发送中】发送升级版本信息,设备编码:{}", deviceEntity.getDeviceCode());
// deviceService.sendDeviceMessage(deviceEntity, info, header, Base64.getEncoder().encodeToString(JSON.toJSONString(productVersionInfo).getBytes()), callback, null); // deviceService.sendDeviceMessage(deviceEntity, info, header, Base64.getEncoder().encodeToString(JSON.toJSONString(productVersionInfo).getBytes()), callback, null);
}); });
} }
@Override
public Rest<String> cloneProductBySite(ProductEntity productEntity, Context context) {
//拷贝应用
Long targetSiteId = productEntity.getTargetSiteId();
Long sourceSiteId = productEntity.getSourceSiteId();
Rest<SitePdu> sitePduRest = siteFeign.info(targetSiteId);
if (YesNoEnum.NO.getValue() == sitePduRest.getCode()) {
throw new AppException("未查询到当前站点!");
}
SitePdu sitePdu = sitePduRest.getData();
ProductQuery query = new ProductQuery();
query.setSiteId(sourceSiteId);
List<ProductEntity> productEntityList = this.find(query);
//如果已存在 则不复制
for (ProductEntity product : productEntityList) {
ProductQuery productQuery = new ProductQuery();
productQuery.setSiteId(targetSiteId);
productQuery.setProductCode(product.getProductCode());
int count = this.count(query, context);
if (count == 0) {
productEntity.setId(null);
productEntity.setSiteId(sitePdu.getId());
productEntity.setSiteName(sitePdu.getSiteName());
productEntity.setSiteCode(sitePdu.getSiteCode());
this.save(productEntity, context);
}
}
return Rest.ok();
}
private void buildDownloadUrl(ProductVersionEntity productVersionEntity, ProductVersionInfo productVersionInfo) { private void buildDownloadUrl(ProductVersionEntity productVersionEntity, ProductVersionInfo productVersionInfo) {
String download = ""; String download = "";
if (!ObjectUtils.isEmpty(productVersionEntity.getFilePath())) { if (!ObjectUtils.isEmpty(productVersionEntity.getFilePath())) {
......
...@@ -57,6 +57,8 @@ public class ProductController extends BaseCRUDJsonBodyMappingController<Product ...@@ -57,6 +57,8 @@ public class ProductController extends BaseCRUDJsonBodyMappingController<Product
super.init(model, context); super.init(model, context);
} }
/** /**
* 产品升级版本 * 产品升级版本
*/ */
......
...@@ -58,6 +58,7 @@ public class ProductVersionController extends BaseCRUDJsonBodyMappingController< ...@@ -58,6 +58,7 @@ public class ProductVersionController extends BaseCRUDJsonBodyMappingController<
} }
/** /**
* 发布 * 发布
*/ */
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<result property="siteId" column="siteId" /> <result property="siteId" column="siteId" />
<result property="siteCode" column="siteCode" /> <result property="siteCode" column="siteCode" />
<result property="siteName" column="siteName" /> <result property="siteName" column="siteName" />
<result property="selected" column="selected" />
</resultMap> </resultMap>
...@@ -76,23 +77,26 @@ ...@@ -76,23 +77,26 @@
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteName') or colPickMode == 1 and data.containsKey('siteName')))"> <if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('siteName') or colPickMode == 1 and data.containsKey('siteName')))">
a.siteName, a.siteName,
</if> </if>
<if test="(data == null) or (data != null and ( colPickMode == 0 and !data.containsKey('selected') or colPickMode == 1 and data.containsKey('selected')))">
a.selected,
</if>
</trim> </trim>
</sql> </sql>
<!-- 新增 区分主键自增加还是业务插入 --> <!-- 新增 区分主键自增加还是业务插入 -->
<insert id="insert" parameterType="DeviceModuleDistributeEntity" useGeneratedKeys="true" keyProperty="id"> <insert id="insert" parameterType="DeviceModuleDistributeEntity" useGeneratedKeys="true" keyProperty="id">
insert into mortals_xhx_device_module_distribute insert into mortals_xhx_device_module_distribute
(productId,productCode,productName,imageResolution,imageResolutionValue,filePath,distributeFilePath,version,distribute,createTime,updateUserId,updateTime,siteId,siteCode,siteName) (productId,productCode,productName,imageResolution,imageResolutionValue,filePath,distributeFilePath,version,distribute,createTime,updateUserId,updateTime,siteId,siteCode,siteName,selected)
VALUES VALUES
(#{productId},#{productCode},#{productName},#{imageResolution},#{imageResolutionValue},#{filePath},#{distributeFilePath},#{version},#{distribute},#{createTime},#{updateUserId},#{updateTime},#{siteId},#{siteCode},#{siteName}) (#{productId},#{productCode},#{productName},#{imageResolution},#{imageResolutionValue},#{filePath},#{distributeFilePath},#{version},#{distribute},#{createTime},#{updateUserId},#{updateTime},#{siteId},#{siteCode},#{siteName},#{selected})
</insert> </insert>
<!-- 批量新增 --> <!-- 批量新增 -->
<insert id="insertBatch" parameterType="paramDto"> <insert id="insertBatch" parameterType="paramDto">
insert into mortals_xhx_device_module_distribute insert into mortals_xhx_device_module_distribute
(productId,productCode,productName,imageResolution,imageResolutionValue,filePath,distributeFilePath,version,distribute,createTime,updateUserId,updateTime,siteId,siteCode,siteName) (productId,productCode,productName,imageResolution,imageResolutionValue,filePath,distributeFilePath,version,distribute,createTime,updateUserId,updateTime,siteId,siteCode,siteName,selected)
VALUES VALUES
<foreach collection="data.dataList" item="item" index="index" separator="," > <foreach collection="data.dataList" item="item" index="index" separator="," >
(#{item.productId},#{item.productCode},#{item.productName},#{item.imageResolution},#{item.imageResolutionValue},#{item.filePath},#{item.distributeFilePath},#{item.version},#{item.distribute},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.siteId},#{item.siteCode},#{item.siteName}) (#{item.productId},#{item.productCode},#{item.productName},#{item.imageResolution},#{item.imageResolutionValue},#{item.filePath},#{item.distributeFilePath},#{item.version},#{item.distribute},#{item.createTime},#{item.updateUserId},#{item.updateTime},#{item.siteId},#{item.siteCode},#{item.siteName},#{item.selected})
</foreach> </foreach>
</insert> </insert>
...@@ -159,6 +163,12 @@ ...@@ -159,6 +163,12 @@
<if test="(colPickMode==0 and data.containsKey('siteName')) or (colPickMode==1 and !data.containsKey('siteName'))"> <if test="(colPickMode==0 and data.containsKey('siteName')) or (colPickMode==1 and !data.containsKey('siteName'))">
a.siteName=#{data.siteName}, a.siteName=#{data.siteName},
</if> </if>
<if test="(colPickMode==0 and data.containsKey('selected')) or (colPickMode==1 and !data.containsKey('selected'))">
a.selected=#{data.selected},
</if>
<if test="(colPickMode==0 and data.containsKey('selectedIncrement')) or (colPickMode==1 and !data.containsKey('selectedIncrement'))">
a.selected=ifnull(a.selected,0) + #{data.selectedIncrement},
</if>
</trim> </trim>
<trim suffixOverrides="where" suffix=""> <trim suffixOverrides="where" suffix="">
where where
...@@ -296,6 +306,18 @@ ...@@ -296,6 +306,18 @@
</if> </if>
</foreach> </foreach>
</trim> </trim>
<trim prefix="selected=(case" suffix="ELSE selected end),">
<foreach collection="data.dataList" item="item" index="index" separator="" >
<choose>
<when test="(colPickMode==0 and item.containsKey('selected')) or (colPickMode==1 and !item.containsKey('selected'))">
when a.id=#{item.id} then #{item.selected}
</when>
<when test="(colPickMode==0 and item.containsKey('selectedIncrement')) or (colPickMode==1 and !item.containsKey('selectedIncrement'))">
when a.id=#{item.id} then ifnull(a.selected,0) + #{item.selectedIncrement}
</when>
</choose>
</foreach>
</trim>
</trim> </trim>
where id in where id in
<foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")"> <foreach collection="data.dataList" item="item" index="index" open="(" separator="," close=")">
...@@ -766,6 +788,33 @@ ...@@ -766,6 +788,33 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="conditionParamRef.containsKey('selected')">
<if test="conditionParamRef.selected != null ">
${_conditionType_} a.selected = #{${_conditionParam_}.selected}
</if>
<if test="conditionParamRef.selected == null">
${_conditionType_} a.selected is null
</if>
</if>
<if test="conditionParamRef.containsKey('selectedList') and conditionParamRef.selectedList.size() > 0">
${_conditionType_} a.selected in
<foreach collection="conditionParamRef.selectedList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('selectedNotList') and conditionParamRef.selectedNotList.size() > 0">
${_conditionType_} a.selected not in
<foreach collection="conditionParamRef.selectedNotList" open="(" close=")" index="index" item="item" separator=",">
#{item}
</foreach>
</if>
<if test="conditionParamRef.containsKey('selectedStart') and conditionParamRef.selectedStart != null">
${_conditionType_} a.selected <![CDATA[ >= ]]> #{${_conditionParam_}.selectedStart}
</if>
<if test="conditionParamRef.containsKey('selectedEnd') and conditionParamRef.selectedEnd != null">
${_conditionType_} a.selected <![CDATA[ <= ]]> #{${_conditionParam_}.selectedEnd}
</if>
</sql> </sql>
<sql id="_orderCols_"> <sql id="_orderCols_">
<if test="orderColList != null and !orderColList.isEmpty()"> <if test="orderColList != null and !orderColList.isEmpty()">
...@@ -859,6 +908,11 @@ ...@@ -859,6 +908,11 @@
<if test='orderCol.siteName != null and "DESC".equalsIgnoreCase(orderCol.siteName)'>DESC</if> <if test='orderCol.siteName != null and "DESC".equalsIgnoreCase(orderCol.siteName)'>DESC</if>
, ,
</if> </if>
<if test="orderCol.containsKey('selected')">
a.selected
<if test='orderCol.selected != null and "DESC".equalsIgnoreCase(orderCol.selected)'>DESC</if>
,
</if>
</trim> </trim>
</if> </if>
</sql> </sql>
......
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