服务指令计划获取及存储优化调整
This commit is contained in:
parent
596271d0a0
commit
165bd7c53f
|
|
@ -66,6 +66,7 @@ public class NuBizNuCustomerElderTag implements Serializable {
|
|||
/**图标*/
|
||||
@Excel(name = "图标", width = 15)
|
||||
@ApiModelProperty(value = "图标")
|
||||
@TableField(exist = false)
|
||||
private java.lang.String pic;
|
||||
/**图标*/
|
||||
@Excel(name = "图标", width = 15)
|
||||
|
|
@ -75,6 +76,7 @@ public class NuBizNuCustomerElderTag implements Serializable {
|
|||
/**焦点图标*/
|
||||
@Excel(name = "焦点图标", width = 15)
|
||||
@ApiModelProperty(value = "焦点图标")
|
||||
@TableField(exist = false)
|
||||
private java.lang.String picFocus;
|
||||
/**图标*/
|
||||
@Excel(name = "图标", width = 15)
|
||||
|
|
|
|||
|
|
@ -46,6 +46,8 @@ public class NuBizNuCustomerServerServiceImpl extends ServiceImpl<NuBizNuCustome
|
|||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
|
||||
private String serverNetUrl;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> getNclist(NuBizNuCustomerServer nuBizNuCustomerServer) {
|
||||
Map<String,Object> resMap = new HashMap<>();
|
||||
|
|
@ -54,14 +56,14 @@ public class NuBizNuCustomerServerServiceImpl extends ServiceImpl<NuBizNuCustome
|
|||
nuBizNuCustomerServerQueryWrapper.eq(StringUtils.isNotEmpty(nuBizNuCustomerServer.getNuId()),"nu_id",nuBizNuCustomerServer.getNuId());
|
||||
nuBizNuCustomerServerQueryWrapper.eq(StringUtils.isNotEmpty(nuBizNuCustomerServer.getCustomerId()),"customer_id",nuBizNuCustomerServer.getCustomerId());
|
||||
List<NuBizNuCustomerServer> groupList = baseMapper.selectList(nuBizNuCustomerServerQueryWrapper);
|
||||
String groupPositioning[] = {"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23"};
|
||||
List<Map<String,Object>> allList = new ArrayList<>();
|
||||
for(String groupPositioning1 : groupPositioning){
|
||||
Map<String,Object> posMap = new HashMap<>();
|
||||
posMap.put("positioning",groupPositioning1);
|
||||
List<Map<String,Object>> childrenList = new ArrayList<>();
|
||||
// String groupPositioning[] = {"0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23"};
|
||||
// List<Map<String,Object>> allList = new ArrayList<>();
|
||||
// for(String groupPositioning1 : groupPositioning){
|
||||
// Map<String,Object> posMap = new HashMap<>();
|
||||
// posMap.put("positioning",groupPositioning1);
|
||||
// List<Map<String,Object>> childrenList = new ArrayList<>();
|
||||
for(NuBizNuCustomerServer par : groupList){
|
||||
if(StringUtils.equals(groupPositioning1,par.getPositioning())){
|
||||
// if(StringUtils.equals(groupPositioning1,par.getPositioning())){
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put("nuId",nuBizNuCustomerServer.getNuId());
|
||||
map.put("customerId",nuBizNuCustomerServer.getCustomerId());
|
||||
|
|
@ -80,45 +82,46 @@ public class NuBizNuCustomerServerServiceImpl extends ServiceImpl<NuBizNuCustome
|
|||
map.put("positioningLong",par.getPositioningLong());
|
||||
map.put("positioning",par.getPositioning());
|
||||
map.put("izPackage",par.getIzPackage());
|
||||
if(nuBizNuCustomerServer.getImmediateFile()!=null){
|
||||
String immediateFile = getImageNetUrl(nuBizNuCustomerServer.getImmediateFile());
|
||||
map.put("immediateFile",nuBizNuCustomerServer.getImmediateFile());
|
||||
if(par.getImmediateFile()!=null&&!par.getImmediateFile().equals("")){
|
||||
String immediateFile = getImageNetUrl(par.getImmediateFile());
|
||||
map.put("immediateFile",par.getImmediateFile());
|
||||
map.put("netImmediateFile",immediateFile);
|
||||
}else{
|
||||
map.put("immediateFile","");
|
||||
map.put("netImmediateFile","");
|
||||
}
|
||||
if(nuBizNuCustomerServer.getImmediateFileFocus()!=null){
|
||||
String immediateFileFocus = getImageNetUrl(nuBizNuCustomerServer.getImmediateFileFocus());
|
||||
map.put("immediateFileFocus",nuBizNuCustomerServer.getImmediateFileFocus());
|
||||
if(par.getImmediateFileFocus()!=null&&!par.getImmediateFile().equals("")){
|
||||
String immediateFileFocus = getImageNetUrl(par.getImmediateFileFocus());
|
||||
map.put("immediateFileFocus",par.getImmediateFileFocus());
|
||||
map.put("netImmediateFileFocus",immediateFileFocus);
|
||||
}else{
|
||||
map.put("immediateFileFocus","");
|
||||
map.put("netImmediateFileFocus","");
|
||||
}
|
||||
if(nuBizNuCustomerServer.getPreviewFile()!=null){
|
||||
String previewFile = getImageNetUrl(nuBizNuCustomerServer.getPreviewFile());
|
||||
map.put("previewFile",nuBizNuCustomerServer.getPreviewFile());
|
||||
if(par.getPreviewFile()!=null&&!par.getImmediateFile().equals("")){
|
||||
String previewFile = getImageNetUrl(par.getPreviewFile());
|
||||
map.put("previewFile",par.getPreviewFile());
|
||||
map.put("netPreviewFile",previewFile);
|
||||
}else{
|
||||
map.put("previewFile","");
|
||||
map.put("netPreviewFile","");
|
||||
}
|
||||
if(nuBizNuCustomerServer.getPreviewFileSmall()!=null){
|
||||
String previewFileSmall = getImageNetUrl(nuBizNuCustomerServer.getPreviewFileSmall());
|
||||
map.put("previewFileSmall",nuBizNuCustomerServer.getPreviewFileSmall());
|
||||
if(par.getPreviewFileSmall()!=null&&!par.getImmediateFile().equals("")){
|
||||
String previewFileSmall = getImageNetUrl(par.getPreviewFileSmall());
|
||||
map.put("previewFileSmall",par.getPreviewFileSmall());
|
||||
map.put("netPreviewFileSmall",previewFileSmall);
|
||||
}else{
|
||||
map.put("previewFileSmall","");
|
||||
map.put("netPreviewFileSmall","");
|
||||
}
|
||||
childrenList.add(map);
|
||||
}
|
||||
// childrenList.add(map);
|
||||
// }
|
||||
}
|
||||
posMap.put("children",childrenList);
|
||||
allList.add(posMap);
|
||||
}
|
||||
resMap.put("serviceList",allList);//服务指令计划
|
||||
// posMap.put("children",childrenList);
|
||||
// allList.add(posMap);
|
||||
// }
|
||||
// resMap.put("serviceList",allList);//服务指令计划
|
||||
resMap.put("serviceList",groupList);//服务指令计划
|
||||
//即时指令
|
||||
QueryWrapper<NuBizNuCustomerServerInstant> instantQueryWrapper = new QueryWrapper<>();
|
||||
instantQueryWrapper.eq(StringUtils.isNotEmpty(nuBizNuCustomerServer.getNuId()),"nu_id",nuBizNuCustomerServer.getNuId());
|
||||
|
|
@ -241,12 +244,13 @@ public class NuBizNuCustomerServerServiceImpl extends ServiceImpl<NuBizNuCustome
|
|||
List<NuBizNuCustomerServer> serverList = nuBizNuCustomerServer.getServerList();
|
||||
if(serverList.size()>0){
|
||||
for(NuBizNuCustomerServer par : serverList){
|
||||
par.setNuId(nuBizNuCustomerServer.getNuId());
|
||||
par.setNuId(nuId);
|
||||
par.setNuName(nuBizNuCustomerServer.getNuName());
|
||||
par.setCustomerId(nuBizNuCustomerServer.getCustomerId());
|
||||
par.setCustomerId(customerId);
|
||||
par.setCustomerName(nuBizNuCustomerServer.getCustomerName());
|
||||
baseMapper.insert(par);
|
||||
}
|
||||
|
||||
this.saveBatch(serverList);
|
||||
}
|
||||
QueryWrapper<NuBizNuCustomerServerInstant> instantQueryWrapper = new QueryWrapper<>();
|
||||
instantQueryWrapper.eq("nu_id",nuId);
|
||||
|
|
@ -255,12 +259,13 @@ public class NuBizNuCustomerServerServiceImpl extends ServiceImpl<NuBizNuCustome
|
|||
List<NuBizNuCustomerServerInstant> instantList = nuBizNuCustomerServer.getInstantList();
|
||||
if(instantList.size()>0){
|
||||
for(NuBizNuCustomerServerInstant pari : instantList){
|
||||
pari.setNuId(nuBizNuCustomerServer.getNuId());
|
||||
pari.setNuId(nuId);
|
||||
pari.setNuName(nuBizNuCustomerServer.getNuName());
|
||||
pari.setCustomerId(nuBizNuCustomerServer.getCustomerId());
|
||||
pari.setCustomerId(customerId);
|
||||
pari.setCustomerName(nuBizNuCustomerServer.getCustomerName());
|
||||
nuBizNuCustomerServerInstantService.save(pari);
|
||||
|
||||
}
|
||||
nuBizNuCustomerServerInstantService.saveBatch(instantList);
|
||||
}
|
||||
|
||||
QueryWrapper<NuBizNuCustomerElderTag> tagQueryWrapper = new QueryWrapper<>();
|
||||
|
|
@ -270,12 +275,12 @@ public class NuBizNuCustomerServerServiceImpl extends ServiceImpl<NuBizNuCustome
|
|||
List<NuBizNuCustomerElderTag> tagList = nuBizNuCustomerServer.getTagList();
|
||||
if(tagList.size()>0){
|
||||
for(NuBizNuCustomerElderTag tg : tagList){
|
||||
tg.setNuId(nuBizNuCustomerServer.getNuId());
|
||||
tg.setNuId(nuId);
|
||||
tg.setNuName(nuBizNuCustomerServer.getNuName());
|
||||
tg.setCustomerId(nuBizNuCustomerServer.getCustomerId());
|
||||
tg.setCustomerId(customerId);
|
||||
tg.setCustomerName(nuBizNuCustomerServer.getCustomerName());
|
||||
nuBizNuCustomerElderTagService.save(tg);
|
||||
}
|
||||
nuBizNuCustomerElderTagService.saveBatch(tagList);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -284,24 +289,21 @@ public class NuBizNuCustomerServerServiceImpl extends ServiceImpl<NuBizNuCustome
|
|||
* 获取管理平台静态资源路径
|
||||
* @return
|
||||
*/
|
||||
private String getOpeMediaAddress(){
|
||||
JSONObject json = sysConfigApi.getByKey("ope_media_address");
|
||||
if(json!=null){
|
||||
String configValue = json.getString("configValue");
|
||||
if(!configValue.endsWith("/")){
|
||||
configValue += "/";
|
||||
private void getOpeMediaAddress(){
|
||||
if(serverNetUrl==null||serverNetUrl.equals("")){
|
||||
JSONObject json = sysConfigApi.getByKey("ope_media_address");
|
||||
if(json!=null){
|
||||
String configValue = json.getString("configValue");
|
||||
if(!configValue.endsWith("/")){
|
||||
configValue += "/";
|
||||
}
|
||||
serverNetUrl = configValue;
|
||||
}
|
||||
return configValue;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
private String getImageNetUrl(String imageUrl){
|
||||
String netUrl = "";
|
||||
String configValue = getOpeMediaAddress();
|
||||
if(!configValue.equals("")){
|
||||
netUrl = configValue + imageUrl;
|
||||
}
|
||||
return netUrl;
|
||||
getOpeMediaAddress();
|
||||
return serverNetUrl + imageUrl;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue