Commit 0a3f566f authored by wangyihao's avatar wangyihao

添加 跳链接

parent 5cd3b049
......@@ -58,6 +58,7 @@ public class IndexController {
map.put("advertPicUrl", list.getAdvertPicUrl());
map.put("advertContent", list.getAdvertContent());
map.put("advertTitle", list.getAdvertTitle());
map.put("linkUrl", list.getLinkUrl());
listQuery.add(map);
}
resultInfo.setData(listQuery);
......
......@@ -63,42 +63,20 @@ public class AdvertController extends BaseController{
advert.setAdvertContent(advertContent);
}
if (advert!=null&&advert.getAdvertId()!=null&&!"".equals(advert.getAdvertId())) {
Advert advertQuery = advertService.getAdvertQuery(advert.getUsageSubclass());//判断使用指南子类是否已存在
if(advertQuery != null &&!advertQuery.getAdvertId().equals(advert.getAdvertId())) {
result.setCode("0");
result.setMsg("该子类已存在,请重新添加");
return result;
}
String html = "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><meta content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\" name=\"viewport\"><title>"+advert.getAdvertTitle()+"</title></head><body>" + advert.getAdvertContent() + "</body></html>";
ECFileUtil.uploadFile(html.getBytes("UTF-8"), storeFilePath, advert.getAdvertId()+".html");
advert.setLinkUrl(fileServer+advert.getAdvertId()+".html");
// advert.setLinkUrl(fileServer+advert.getAdvertId()+".html");
result = advertService.updateAdvert(advert, getOperator());
}else {
if (advert.getAdvertType()==4||advert.getAdvertType()==6) {
Advert advertQuery = new Advert();
advertQuery.setAdvertType(advert.getAdvertType());
List<Advert> advertList = advertService.getAdvertList(new Query(advertQuery));
if (advertList.size()>=1) {
result.setCode("0");
return result;
}
}
if(advert.getUsageSubclass() != null && !"".equals(advert.getUsageSubclass())) {
Advert advertQuery = advertService.getAdvertQuery(advert.getUsageSubclass());//判断使用指南子类是否已存在
if(advertQuery !=null) {
result.setCode("0");
result.setMsg("该子类已存在,请重新添加");
return result;
}
}
advert.setAdvertId(advertService.generatePK());
if (advert!=null&&advert.getAdvertContent()!=null&&!"".equals(advert.getAdvertContent())) {
String html = "<!DOCTYPE html><html><head><meta charset=\"UTF-8\"><meta content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0\" name=\"viewport\"><title>"+advert.getAdvertTitle()+"</title></head><body>" + advert.getAdvertContent() + "</body></html>";
ECFileUtil.uploadFile(html.getBytes("UTF-8"), storeFilePath, advert.getAdvertId()+".html");
}
advert.setLinkUrl(fileServer+advert.getAdvertId()+".html");
// advert.setLinkUrl(fileServer+advert.getAdvertId()+".html");
result = advertService.addAdvert(advert, getOperator());
}
return result;
......
......@@ -80,10 +80,10 @@ ADVERT_PIC_URL,CREATE_TIME,UPDATE_TIME,OPERATOR_ID,OPERATOR_TYPE,USAGE_SUBCLASS
<if test="advertSubTitle!=null and advertSubTitle!=''">
ADVERT_SUB_TITLE=#{advertSubTitle,jdbcType = VARCHAR},
</if>
<if test="advertContent!=null and advertContent!=''">
<if test="advertContent!=null">
ADVERT_CONTENT=#{advertContent,jdbcType = VARCHAR},
</if>
<if test="linkUrl!=null and linkUrl!=''">
<if test="linkUrl!=null">
LINK_URL=#{linkUrl,jdbcType = VARCHAR},
</if>
<if test="isAvailable!=null ">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment