This commit is contained in:
高久奇 2021-12-08 18:23:11 +08:00
parent 8a288e9e78
commit be77b74c9f
23 changed files with 429 additions and 144 deletions

View File

@ -424,11 +424,20 @@ public class ContentController extends BaseController {
User loginUser = getLoginUser(); User loginUser = getLoginUser();
User user = userService.selectByUsername(loginUser.getUsername()); User user = userService.selectByUsername(loginUser.getUsername());
application.setUserId(Long.parseLong(user.getId().toString())); application.setUserId(Long.parseLong(user.getId().toString()));
//根据userId获取微信用户信息 List<Check> checks;
WxUser wxUser = service.getQyWxUser(user.getUsername()); if(!loginUser.getUserId().equals("admin")){
//根据部门id获取用户领导 //根据userId获取微信用户信息
List<Check> checks = service.getUserLeader(wxUser.getDepartment()); WxUser wxUser = service.getQyWxUser(user.getUsername());
//根据部门id获取用户领导
checks = service.getUserLeader(wxUser.getDepartment());
}else {
checks = new ArrayList<>();
Check check = new Check();
check.setCheckId(1L);
checks.add(check);
}
application.setChecks(checks); application.setChecks(checks);
//添加审核申请单 //添加审核申请单
service.saveApplication(application); service.saveApplication(application);
return Result.success(); return Result.success();

View File

@ -1,15 +1,21 @@
package com.nbclass.activity.controller.casesfirst; package com.nbclass.activity.controller.casesfirst;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.nbclass.activity.model.*; import com.nbclass.activity.model.*;
import com.nbclass.activity.service.CaseTypeService; import com.nbclass.activity.service.CaseTypeService;
import com.nbclass.activity.service.ElasticSearchService;
import com.nbclass.vo.base.Result; import com.nbclass.vo.base.Result;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 案例web前台 * 案例web前台
@ -23,6 +29,9 @@ public class CaseTypeController {
@Autowired @Autowired
private CaseTypeService caseTypeService; private CaseTypeService caseTypeService;
@Autowired
private ElasticSearchService elasticSearchService;
/** /**
* 数据字典(案例类型案例用途创意形式节日事件)列表查询 * 数据字典(案例类型案例用途创意形式节日事件)列表查询
* @return * @return
@ -43,28 +52,24 @@ public class CaseTypeController {
return Result.success(list); return Result.success(list);
} }
/**
* 案例库列表
* @param page
* @param pageSize
* @return
*/
@GetMapping("/getListCase")
public Result getListCase(Integer page,Integer pageSize){
PageInfo<Content> list = caseTypeService.getListCase(page,pageSize);
return Result.success(list);
}
/** /**
* 案例搜索框 * 案例列表
* @param parameter 任意参数案例标签案例标题案例编号 * @param keyWord 任意参数案例标签案例标题案例编号
* @param dictItemId 案例类型id * @param tagIds 标签id
* @return * @return
*/ */
@GetMapping("/getSearchCase") @GetMapping("/getSearchCase")
public Result getSearchCase(String parameter,Integer dictItemId,Integer page,Integer pageSize){ public Result getSearchCase(String keyWord,String tagIds,Integer page,Integer pageSize){
PageInfo<Content> list = caseTypeService.getSearchCase(parameter,dictItemId,page,pageSize); Map<String, Object> map = elasticSearchService.getList(page,pageSize,"",keyWord,tagIds,"");
return Result.success(list); List<Content> list = (List<Content>) map.get("rows");
for (Content content : list) {
Content listCase = caseTypeService.getListCase(content.getId());
content.setUserTotal(listCase.getUserTotal());
content.setTotalScore(listCase.getTotalScore());
}
map.put("rows",list);
return Result.success(map);
} }
/** /**

View File

@ -16,6 +16,8 @@ import com.nbclass.exception.ParameterException;
import com.nbclass.system.controller.BaseController; import com.nbclass.system.controller.BaseController;
import com.nbclass.vo.base.Result; import com.nbclass.vo.base.Result;
import java.util.Map;
/** /**
* i前端获取案例查询 * i前端获取案例查询
* @author Leon * @author Leon
@ -24,10 +26,10 @@ import com.nbclass.vo.base.Result;
@RestController @RestController
@RequestMapping("/front/api/content") @RequestMapping("/front/api/content")
public class FrontContentController extends BaseController { public class FrontContentController extends BaseController {
// @Resource // @Resource
// private ContentService service; // private ContentService service;
@Resource @Resource
private ElasticSearchService esService; private ElasticSearchService esService;
@ -39,14 +41,14 @@ public class FrontContentController extends BaseController {
* @return * @return
*/ */
@RequestMapping("/list") @RequestMapping("/list")
public Result getList(String type, HttpServletResponse response, public Result getList(String type, HttpServletResponse response,
@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize,
String keyWord, String tagIds, String sourceIds){ String keyWord, String tagIds, String sourceIds){
response.setHeader("Access-Control-Allow-Origin", "*"); response.setHeader("Access-Control-Allow-Origin", "*");
if(StringUtils.isNotBlank(type)){ if(StringUtils.isNotBlank(type)){
type = type.trim().toLowerCase(); type = type.trim().toLowerCase();
if(!ContentType.ppqa.key().equals(type) && !ContentType.ggqa.key().equals(type) && if(!ContentType.ppqa.key().equals(type) && !ContentType.ggqa.key().equals(type) &&
!ContentType.design.key().equals(type) && !ContentType.video.key().equals(type) && !ContentType.design.key().equals(type) && !ContentType.video.key().equals(type) &&
!ContentType.h5.key().equals(type) && !ContentType.ldhd.key().equals(type) !ContentType.h5.key().equals(type) && !ContentType.ldhd.key().equals(type)
&& !ContentType.others.key().equals(type)){ && !ContentType.others.key().equals(type)){
throw new ParameterException("参数[type]不是有效的数据!"); throw new ParameterException("参数[type]不是有效的数据!");
@ -54,10 +56,10 @@ public class FrontContentController extends BaseController {
} }
// List<Integer> tagIdList = CommonUtils.toIntList(tagIds); // List<Integer> tagIdList = CommonUtils.toIntList(tagIds);
// List<Integer> sourceIdList = CommonUtils.toIntList(sourceIds); // List<Integer> sourceIdList = CommonUtils.toIntList(sourceIds);
JSONObject resultObj = esService.getList(pageNum, pageSize, type, keyWord, tagIds, sourceIds); Map resultObj = esService.getList(pageNum, pageSize, type, keyWord, tagIds, sourceIds);
return Result.success(resultObj); return Result.success(resultObj);
} }
/** /**
* 根据id查找单条记录 * 根据id查找单条记录
* @param id * @param id
@ -71,8 +73,8 @@ public class FrontContentController extends BaseController {
throw new ParameterException("参数[type]不能为空!"); throw new ParameterException("参数[type]不能为空!");
} }
type=type.trim().toLowerCase(); type=type.trim().toLowerCase();
if(!ContentType.ppqa.key().equals(type) && !ContentType.ggqa.key().equals(type) && if(!ContentType.ppqa.key().equals(type) && !ContentType.ggqa.key().equals(type) &&
!ContentType.design.key().equals(type) && !ContentType.video.key().equals(type) && !ContentType.design.key().equals(type) && !ContentType.video.key().equals(type) &&
!ContentType.h5.key().equals(type) && !ContentType.ldhd.key().equals(type) !ContentType.h5.key().equals(type) && !ContentType.ldhd.key().equals(type)
&& !ContentType.others.key().equals(type)){ && !ContentType.others.key().equals(type)){
throw new ParameterException("参数[type]不是有效的数据!"); throw new ParameterException("参数[type]不是有效的数据!");
@ -84,5 +86,5 @@ public class FrontContentController extends BaseController {
Content content = esService.findById(id); Content content = esService.findById(id);
return Result.success(content); return Result.success(content);
} }
} }

View File

@ -25,19 +25,12 @@ public interface CaseTypeMapper {
*/ */
List<DataDict> getDictionariesType(); List<DataDict> getDictionariesType();
/**
* 案例搜索框
* @param dictItemId 案例类型id
* @return
*/
List<Content> getSearchCase(@Param("parameter") String parameter,
@Param("dictItemId") Integer dictItemId);
/** /**
* 案例库列表 * 案例评分总人数总评分
* @return * @return
*/ */
List<Content> getListCase(); Content getListCase(Long contentId);
/** /**
* 获取案例标签 * 获取案例标签

View File

@ -56,4 +56,10 @@ public interface DataDictItemMapper extends MyMapper<DataDictItem> {
* @return * @return
*/ */
String[] getTagId(String name); String[] getTagId(String name);
/**
* 查询案例关联字典值tid
* @return
*/
List<Long> getContentDict();
} }

View File

@ -10,34 +10,34 @@ import com.nbclass.activity.model.DataDictItem;
import com.nbclass.util.MyMapper; import com.nbclass.util.MyMapper;
public interface DataDictMapper extends MyMapper<DataDict> { public interface DataDictMapper extends MyMapper<DataDict> {
/** /**
* 根据条件查询列表 * 根据条件查询列表
* @param entity * @param entity
* @return * @return
*/ */
public List<DataDict> getList(DataDict entity); public List<DataDict> getList(DataDict entity);
/** /**
* 删除前验证 * 删除前验证
* @param list * @param list
* @return * @return
*/ */
public Long delCheck(List<Long> list); public Long delCheck(List<Long> list);
/** /**
* 根据id批量删除记录 * 根据id批量删除记录
* @param list * @param list
*/ */
public void deleteByIds(List<Long> list); public void deleteByIds(List<Long> list);
/** /**
* 通过字典Key获取子集 * 通过字典Key获取子集
* @param datakey * @param datakey
* @return * @return
*/ */
public List<DataDictItem> getItemsByKey(@Param(value="datakey")String datakey); public List<DataDictItem> getItemsByKey(@Param(value="datakey")String datakey);
/** /**
* 根据字典名获取列表 * 根据字典名获取列表
* @param datakey * @param datakey
@ -45,7 +45,7 @@ public interface DataDictMapper extends MyMapper<DataDict> {
* @return * @return
*/ */
public List<DataDictItem> getItemsByNames(@Param(value="datakey")String datakey, @Param("tagNames")List<String> tagNames); public List<DataDictItem> getItemsByNames(@Param(value="datakey")String datakey, @Param("tagNames")List<String> tagNames);
/** /**
* 保存字典item * 保存字典item
* @param entity * @param entity
@ -60,10 +60,10 @@ public interface DataDictMapper extends MyMapper<DataDict> {
List<DataDictItem> getDataDictTemName(@Param("tagNames")ArrayList<String> postTagList); List<DataDictItem> getDataDictTemName(@Param("tagNames")ArrayList<String> postTagList);
/** /**
* 获取自定义标签id * 获取所有标签
* @return * @return
*/ */
Long getDataDictID(); List<Long> getDataDictID();
/** /**
* 查询字典值是否重复 * 查询字典值是否重复
@ -72,4 +72,10 @@ public interface DataDictMapper extends MyMapper<DataDict> {
*/ */
int getDataDicName(String name); int getDataDicName(String name);
} /**
* 获取自定义标签id
* @return
*/
Long getDataDictIDLabels();
}

View File

@ -27,11 +27,21 @@ public class Content implements Serializable {
*/ */
private Date createtime; private Date createtime;
/**
* 创建时间区间
*/
private Date createtimeSection;
/** /**
* 修改时间 * 修改时间
*/ */
private Date updatetime; private Date updatetime;
/**
* 创建时间区间
*/
private Date updatetimeSection;
/** /**
* 案例类型[ppqa:品牌全案, ggqa:公关全案, design:创意设计, video:视频动画, h5:技术开发, ldhd:落地活动, others:其他案例] * 案例类型[ppqa:品牌全案, ggqa:公关全案, design:创意设计, video:视频动画, h5:技术开发, ldhd:落地活动, others:其他案例]
*/ */
@ -133,6 +143,11 @@ public class Content implements Serializable {
*/ */
private Date onlineTime; private Date onlineTime;
/**
* 上线时间区间
*/
private Date onlineTimeSection;
/** /**
* 可见性 * 可见性
*/ */

View File

@ -27,20 +27,12 @@ public interface CaseTypeService {
*/ */
List<DataDict> getDictionariesType(); List<DataDict> getDictionariesType();
/**
* 案例搜索框
* @param dictItemId 案例类型id
* @return
*/
PageInfo<Content> getSearchCase(String parameter, Integer dictItemId,Integer page, Integer pageSize);
/** /**
* 案例库列表 * 案例评分总人数总评分
* @param page
* @param pageSize
* @return * @return
*/ */
PageInfo<Content> getListCase(Integer page, Integer pageSize); Content getListCase(Long contentId);
/** /**
* 获取案例标签 * 获取案例标签

View File

@ -1,6 +1,7 @@
package com.nbclass.activity.service; package com.nbclass.activity.service;
import java.util.List; import java.util.List;
import java.util.Map;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.nbclass.activity.model.Content; import com.nbclass.activity.model.Content;
@ -23,27 +24,27 @@ public interface ElasticSearchService {
* @param ids * @param ids
*/ */
public void deleteDocByIds(List<Long> ids); public void deleteDocByIds(List<Long> ids);
/** /**
* 根据条件删除 * 根据条件删除
* @param entity * @param entity
*/ */
public void deleteDocByQuery(Content entity); public void deleteDocByQuery(Content entity);
/** /**
* 判断一个文档是否存在 * 判断一个文档是否存在
* @param id * @param id
* @return * @return
*/ */
public boolean existDoc(Long id); public boolean existDoc(Long id);
/** /**
* 根据id查询 * 根据id查询
* @param id * @param id
* @return entity * @return entity
*/ */
public Content findById(Long id); public Content findById(Long id);
/** /**
* 根据条件查询列表 * 根据条件查询列表
* @param pageNum * @param pageNum
@ -54,7 +55,7 @@ public interface ElasticSearchService {
* @param sourceIds 案例来源ID, 多个英文逗号分隔 * @param sourceIds 案例来源ID, 多个英文逗号分隔
* @return * @return
*/ */
public JSONObject getList(Integer pageNum, Integer pageSize, String type, String keyWord, String tagIds, String sourceIds); public Map<String, Object> getList(Integer pageNum, Integer pageSize, String type, String keyWord, String tagIds, String sourceIds);
} }

View File

@ -30,17 +30,8 @@ public class CaseTypeServiceImpl implements CaseTypeService {
} }
@Override @Override
public PageInfo<Content> getSearchCase(String parameter, Integer dictItemId,Integer page, Integer pageSize) { public Content getListCase(Long contentId) {
PageHelper.startPage(page,pageSize); return caseTypeMapper.getListCase(contentId);
List<Content> list = caseTypeMapper.getSearchCase(parameter,dictItemId);
return new PageInfo<>(list);
}
@Override
public PageInfo<Content> getListCase(Integer page, Integer pageSize) {
PageHelper.startPage(page,pageSize);
List<Content> list = caseTypeMapper.getListCase();
return new PageInfo<>(list);
} }
@Override @Override

View File

@ -158,7 +158,7 @@ public class ContentServiceImpl implements ContentService {
if(StringUtils.isNotBlank(o.getTags())){ if(StringUtils.isNotBlank(o.getTags())){
ArrayList<String> postTagList = CommonUtils.str2List(o.getTags()); ArrayList<String> postTagList = CommonUtils.str2List(o.getTags());
// 查询自定义标签的dictid // 查询自定义标签的dictid
Long dictId = dataDictMapper2.getDataDictID(); Long dictId = dataDictMapper2.getDataDictIDLabels();
//根据标签名称查询标签信息 //根据标签名称查询标签信息
List<DataDictItem> tagList = dataDictMapper2.getDataDictTemName(postTagList); List<DataDictItem> tagList = dataDictMapper2.getDataDictTemName(postTagList);
@ -225,6 +225,7 @@ public class ContentServiceImpl implements ContentService {
entity.setType(null); entity.setType(null);
mapper.insertSelective(entity); mapper.insertSelective(entity);
updateLabelAndImages(entity); updateLabelAndImages(entity);
entity.setVisibility(2);
// 提交到ElasticSearch // 提交到ElasticSearch
entity = findById(entity.getId()); entity = findById(entity.getId());
@ -390,6 +391,10 @@ public class ContentServiceImpl implements ContentService {
} }
//更新案例状态(审核可能是下架重新申请的) //更新案例状态(审核可能是下架重新申请的)
mapper.updateContentRelease(application.getContentId(),1,2); mapper.updateContentRelease(application.getContentId(),1,2);
//更新es的状态
Content entity=mapper.findById(application.getContentId());
entity.setVisibility(2);
esService.merge(entity);
} }
@Override @Override
@ -400,10 +405,16 @@ public class ContentServiceImpl implements ContentService {
@Override @Override
@Transactional @Transactional
public void deleteApplication(Long applicationId) { public void deleteApplication(Long applicationId) {
//查询案例id
Long contentId = mapper.getContentId(applicationId);
//删除案例审核申请 //删除案例审核申请
mapper.deleteApplication(applicationId); mapper.deleteApplication(applicationId);
//删除审核人信息 //删除审核人信息
mapper.deleteCheck(applicationId); mapper.deleteCheck(applicationId);
//更新es的状态
Content entity=mapper.findById(contentId);
entity.setVisibility(2);
esService.merge(entity);
} }
@Override @Override
@ -438,6 +449,10 @@ public class ContentServiceImpl implements ContentService {
Long contentId = mapper.getContentId(check.getApplicationId()); Long contentId = mapper.getContentId(check.getApplicationId());
//更新案例状态 //更新案例状态
mapper.updateContentRelease(contentId,2,1); mapper.updateContentRelease(contentId,2,1);
//更新es的状态
Content entity=mapper.findById(contentId);
entity.setVisibility(1);
esService.merge(entity);
}else { }else {
//审核驳回 //审核驳回
application.setStatus(3); application.setStatus(3);
@ -467,6 +482,10 @@ public class ContentServiceImpl implements ContentService {
mapper.deleteCheck(application.getId()); mapper.deleteCheck(application.getId());
//案例表状态修改为已下线 //案例表状态修改为已下线
mapper.updateContentRelease(contentId,4,2); mapper.updateContentRelease(contentId,4,2);
//更新es的状态
Content entity=mapper.findById(contentId);
entity.setVisibility(2);
esService.merge(entity);
} }
@Override @Override

View File

@ -54,10 +54,18 @@ public class DataDictServiceImpl implements DataDictService {
if(cnt!=null && cnt>0) { if(cnt!=null && cnt>0) {
throw new ParameterException("请先删除子项再删除字典!"); throw new ParameterException("请先删除子项再删除字典!");
} }
Long dataDictID = mapper.getDataDictID(); List<Long> dataDictID = mapper.getDataDictID();
for (Long id : ids) { for (Long id : ids) {
if(dataDictID.equals(id)) throw new ParameterException("该字典不可删除!"); if(dataDictID.equals(id)) throw new ParameterException("该字典不可删除!");
} }
List<Long> tids = dataDictItemMapper.getContentDict();
for (Long id : ids) {
for (Long tid : tids) {
if(id.equals(tid)){
throw new ParameterException("该字典已被案例引用!");
}
}
}
mapper.deleteByIds(ids); mapper.deleteByIds(ids);
} }

View File

@ -1,9 +1,7 @@
package com.nbclass.activity.service.impl; package com.nbclass.activity.service.impl;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.*;
import java.util.Arrays;
import java.util.List;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -259,9 +257,9 @@ public class ElasticSearchServiceImpl implements ElasticSearchService {
} }
@Override @Override
public JSONObject getList(Integer pageNum, Integer pageSize, String type, String keyWord, String tagIds, String sourceIds) { public Map<String, Object> getList(Integer pageNum, Integer pageSize, String type, String keyWord, String tagIds, String sourceIds) {
// 封装Map参数返回 // 封装Map参数返回
JSONObject result = new JSONObject(); Map<String, Object> result = new HashMap<>();
try { try {
// 选择标签或来源过滤时从数据库查询记录 // 选择标签或来源过滤时从数据库查询记录
/*if(StringUtils.isNotBlank(tagIds) || StringUtils.isNotBlank(sourceIds)) { /*if(StringUtils.isNotBlank(tagIds) || StringUtils.isNotBlank(sourceIds)) {
@ -280,7 +278,8 @@ public class ElasticSearchServiceImpl implements ElasticSearchService {
} }
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery(); BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
if(StringUtils.isNotBlank(type)) { // 案例类型 boolQueryBuilder.must(QueryBuilders.termQuery("visibility", 1));
/*if(StringUtils.isNotBlank(type)) { // 案例类型
boolQueryBuilder.must(QueryBuilders.termQuery("type", type)); boolQueryBuilder.must(QueryBuilders.termQuery("type", type));
if (StringUtils.isNoneBlank(keyWord)){ if (StringUtils.isNoneBlank(keyWord)){
BoolQueryBuilder keywordQuery = QueryBuilders.boolQuery(); BoolQueryBuilder keywordQuery = QueryBuilders.boolQuery();
@ -300,20 +299,29 @@ public class ElasticSearchServiceImpl implements ElasticSearchService {
boolQueryBuilder.should(QueryBuilders.matchQuery("content_text", keyWord)); boolQueryBuilder.should(QueryBuilders.matchQuery("content_text", keyWord));
boolQueryBuilder.minimumShouldMatch(1); // 至少一个should条件满足 boolQueryBuilder.minimumShouldMatch(1); // 至少一个should条件满足
} }
} }*/
if (StringUtils.isNoneBlank(keyWord)){
BoolQueryBuilder keywordQuery = QueryBuilders.boolQuery();
keywordQuery.should(QueryBuilders.matchQuery("title", keyWord));
keywordQuery.should(QueryBuilders.matchQuery("desct", keyWord));
//keywordQuery.should(QueryBuilders.matchQuery("fromName", keyWord));
keywordQuery.should(QueryBuilders.matchQuery("tags", keyWord));
keywordQuery.should(QueryBuilders.matchQuery("content_text", keyWord));
boolQueryBuilder.must(keywordQuery);
}
//选择标签或来源过滤 //选择标签或来源过滤
if(StringUtils.isNotBlank(tagIds)){ if(StringUtils.isNotBlank(tagIds)){
List<String> tagIdList = Arrays.asList(tagIds.split(",")); List<String> tagIdList = Arrays.asList(tagIds.split(","));
for(String tagId:tagIdList) { for(String tagId:tagIdList) {
boolQueryBuilder.must(QueryBuilders.termQuery("tagList.id", tagId)); boolQueryBuilder.must(QueryBuilders.termQuery("tagList.tid", tagId));
} }
} }
if(StringUtils.isNotBlank(sourceIds)){ /*if(StringUtils.isNotBlank(sourceIds)){
List<String> sourIdList = Arrays.asList(sourceIds.split(",")); List<String> sourIdList = Arrays.asList(sourceIds.split(","));
for(String sourId:sourIdList) { for(String sourId:sourIdList) {
boolQueryBuilder.must(QueryBuilders.termQuery("fromid", sourId)); boolQueryBuilder.must(QueryBuilders.termQuery("fromid", sourId));
} }
} }*/
searchSourceBuilder.query(boolQueryBuilder); searchSourceBuilder.query(boolQueryBuilder);

View File

@ -12,7 +12,9 @@ public class DateConverter implements Converter<String, Date> {
@Override @Override
public Date convert(String source) { public Date convert(String source) {
try { try {
return sdf.parse(source); if(!source.equals("")){
return sdf.parse(source);
}
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -34,7 +34,7 @@ spring:
enabled: true # 开启 Elasticsearch仓库(默认值:true) enabled: true # 开启 Elasticsearch仓库(默认值:true)
client: client:
reactive: reactive:
endpoints: 172.24.133.129:9200 endpoints: 39.108.110.167:9200
connection-timeout: 5000 connection-timeout: 5000
socket-timeout: 5000 socket-timeout: 5000

View File

@ -11,10 +11,10 @@
<result column="userTotal" property="userTotal"/> <result column="userTotal" property="userTotal"/>
<result column="TotalScore" property="TotalScore"/> <result column="TotalScore" property="TotalScore"/>
<collection property="tagList" ofType="com.nbclass.activity.model.ContentTags" column="id" select="getTagList"> <!--<collection property="tagList" ofType="com.nbclass.activity.model.ContentTags" column="id" select="getTagList">
<id column="id" property="id"/> <id column="id" property="id"/>
<result column="tagName" property="tagName"/> <result column="tagName" property="tagName"/>
</collection> </collection>-->
</resultMap> </resultMap>
@ -36,7 +36,7 @@
select id,name from data_dict select id,name from data_dict
</select> </select>
<select id="getSearchCase" resultType="com.nbclass.activity.model.Content"> <!-- <select id="getSearchCase" resultType="com.nbclass.activity.model.Content">
SELECT SELECT
c.id, c.id,
c.title, c.title,
@ -55,22 +55,17 @@
and item.id = #{dictItemId} and item.id = #{dictItemId}
</if> </if>
order by c.createtime desc order by c.createtime desc
</select> </select>-->
<select id="getListCase" resultMap="BaseResultMap"> <select id="getListCase" resultMap="BaseResultMap">
SELECT SELECT
c.id,
c.title,
c.praiseno,
c.listicon,
c.comments,
COUNT(s.content_id) as userTotal, COUNT(s.content_id) as userTotal,
IFNULL(SUM(s.score),0) AS TotalScore IFNULL(SUM(s.score),0) AS TotalScore
FROM FROM
content c content c
LEFT JOIN scoring_table s ON c.id = s.content_id LEFT JOIN scoring_table s ON c.id = s.content_id
WHERE WHERE
c.RELEASE = 2 c.RELEASE = 2 and c.id = #{contentId}
ORDER BY ORDER BY
c.createtime DESC c.createtime DESC
</select> </select>
@ -100,4 +95,4 @@
ts.cid = #{contentId} ts.cid = #{contentId}
</select> </select>
</mapper> </mapper>

View File

@ -128,6 +128,24 @@
<if test="quantity!=null and quantity == 1"> <if test="quantity!=null and quantity == 1">
and c.label_feedback > 0 and c.label_feedback > 0
</if> </if>
<if test="createtime!=null">
and DATE_FORMAT(c.createtime, '%Y-%m-%d')>= DATE_FORMAT(#{createtime}, '%Y-%m-%d')
</if>
<if test="createtimeSection!=null">
and DATE_FORMAT(c.createtime, '%Y-%m-%d') &lt;= DATE_FORMAT(#{createtimeSection}, '%Y-%m-%d')
</if>
<if test="updatetime!=null">
and DATE_FORMAT(c.updatetime, '%Y-%m-%d')>= DATE_FORMAT(#{updatetime}, '%Y-%m-%d')
</if>
<if test="updatetimeSection!=null">
and DATE_FORMAT(c.updatetime, '%Y-%m-%d') &lt;= DATE_FORMAT(#{updatetimeSection}, '%Y-%m-%d')
</if>
<if test="onlineTime!=null">
and DATE_FORMAT(c.online_time, '%Y-%m-%d')>= DATE_FORMAT(#{onlineTime}, '%Y-%m-%d')
</if>
<if test="onlineTimeSection!=null">
and DATE_FORMAT(c.online_time, '%Y-%m-%d') &lt;= DATE_FORMAT(#{onlineTimeSection}, '%Y-%m-%d')
</if>
<if test="tagLists!=null and tagLists!=''"> <if test="tagLists!=null and tagLists!=''">
and item.id in and item.id in
<foreach collection="tagLists" open="(" separator="," item="id" close=")"> <foreach collection="tagLists" open="(" separator="," item="id" close=")">

View File

@ -45,4 +45,12 @@
where item.name like concat('%',#{name},'%') where item.name like concat('%',#{name},'%')
</select> </select>
<select id="getContentDict" resultType="java.lang.Long">
SELECT DISTINCT
tags.tid
FROM
content c
INNER JOIN content_tags tags ON c.id = tags.cid
</select>
</mapper> </mapper>

View File

@ -13,24 +13,24 @@
<result column="isvalid" jdbcType="TINYINT" property="isvalid" /> <result column="isvalid" jdbcType="TINYINT" property="isvalid" />
<result column="description" jdbcType="VARCHAR" property="description" /> <result column="description" jdbcType="VARCHAR" property="description" />
</resultMap> </resultMap>
<select id="delCheck" parameterType="java.util.List" resultType="java.lang.Long"> <select id="delCheck" parameterType="java.util.List" resultType="java.lang.Long">
select count(*) from data_dict_item select count(*) from data_dict_item
where dictid in where dictid in
<foreach item="item" collection="list" open="(" separator="," close=")"> <foreach item="item" collection="list" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</select> </select>
<delete id="deleteByIds" parameterType="java.util.List"> <delete id="deleteByIds" parameterType="java.util.List">
delete from data_dict where id in delete from data_dict where id in
<foreach item="item" collection="list" open="(" separator="," close=")"> <foreach item="item" collection="list" open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</delete> </delete>
<select id="getList" resultType="com.nbclass.activity.model.DataDict" parameterType="com.nbclass.activity.model.DataDict"> <select id="getList" resultType="com.nbclass.activity.model.DataDict" parameterType="com.nbclass.activity.model.DataDict">
SELECT * FROM data_dict where 1=1 SELECT * FROM data_dict where 1=1
<if test="isvalid != null and isvalid >= 0"> <if test="isvalid != null and isvalid >= 0">
AND data_dict.isvalid = #{isvalid} AND data_dict.isvalid = #{isvalid}
</if> </if>
@ -39,20 +39,20 @@
</if> </if>
order by data_dict.id desc order by data_dict.id desc
</select> </select>
<select id="getItemsByKey" resultType="com.nbclass.activity.model.DataDictItem" parameterType="com.nbclass.activity.model.DataDictItem"> <select id="getItemsByKey" resultType="com.nbclass.activity.model.DataDictItem" parameterType="com.nbclass.activity.model.DataDictItem">
select t.* from data_dict_item t select t.* from data_dict_item t
left join data_dict on t.dictid = data_dict.id left join data_dict on t.dictid = data_dict.id
where data_dict.isvalid = 1 and data_dict.datakey = #{datakey} where data_dict.isvalid = 1 and data_dict.datakey = #{datakey}
order by t.sort order by t.sort
</select> </select>
<select id="getItemsByNames" parameterType="java.util.List" resultType="com.nbclass.activity.model.DataDictItem"> <select id="getItemsByNames" parameterType="java.util.List" resultType="com.nbclass.activity.model.DataDictItem">
select data_dict_item.* from data_dict_item select data_dict_item.* from data_dict_item
left join data_dict on data_dict_item.dictid = data_dict.id left join data_dict on data_dict_item.dictid = data_dict.id
where data_dict.datakey = #{datakey} where data_dict.datakey = #{datakey}
<if test="tagNames != null"> <if test="tagNames != null">
and data_dict_item.name in and data_dict_item.name in
<foreach item="tag_name" collection="tagNames" open="(" separator="," close=")"> <foreach item="tag_name" collection="tagNames" open="(" separator="," close=")">
#{tag_name} #{tag_name}
</foreach> </foreach>
@ -73,17 +73,30 @@
</foreach> </foreach>
</if> </if>
</select> </select>
<insert id="insertDataDictItem" parameterType="com.nbclass.activity.model.DataDictItem" useGeneratedKeys="true" keyProperty="id"> <insert id="insertDataDictItem" parameterType="com.nbclass.activity.model.DataDictItem" useGeneratedKeys="true" keyProperty="id">
INSERT ignore INTO data_dict_item(dictid, `value`, `name`) VALUES (#{dictid}, #{value}, #{name} ) INSERT ignore INTO data_dict_item(dictid, `value`, `name`) VALUES (#{dictid}, #{value}, #{name} )
</insert> </insert>
<select id="getDataDictID" resultType="java.lang.Long"> <select id="getDataDictID" resultType="java.lang.Long">
select id from data_dict where name = '标签' select
id
from data_dict
where name = '标签' or name = '案例类型'
or name = '案例用途' or name = '创意形式'
or name = '节日事件' or name = '品牌公司'
or name = '广告公司' or name = '关联部门'
</select> </select>
<select id="getDataDicName" resultType="int"> <select id="getDataDicName" resultType="int">
select count(*) from data_dict where name = #{name} select count(*) from data_dict where name = #{name}
</select> </select>
</mapper> <select id="getDataDictIDLabels" resultType="java.lang.Long">
select
id
from data_dict
where name = '标签'
</select>
</mapper>

View File

@ -76,6 +76,73 @@
</select> </select>
</div> </div>
<div class="form-group">
<label>创建时间:</label>
<!--指定 date标记-->
<div class='input-group date' id='createTime'>
<input type='text' class="form-control" readonly="readonly" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<label></label>
<!--指定 date标记-->
<div class='input-group date' id='createTimeSection'>
<input type='text' class="form-control" readonly="readonly" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<label>修改时间:</label>
<!--指定 date标记-->
<div class='input-group date' id='updateTime'>
<input type='text' class="form-control" readonly="readonly" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<label></label>
<!--指定 date标记-->
<div class='input-group date' id='updateTimeSection'>
<input type='text' class="form-control" readonly="readonly" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<label>上线时间:</label>
<!--指定 date标记-->
<div class='input-group date' id='onlineTime'>
<input type='text' class="form-control" readonly="readonly" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<label></label>
<!--指定 date标记-->
<div class='input-group date' id='onlineTimeSection'>
<input type='text' class="form-control" readonly="readonly" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-md-1 col-sm-3" style="text-align:left;"> <div class="col-md-1 col-sm-3" style="text-align:left;">
<button type="button" id="btn_query" class="btn btn-info">查 询</button> <button type="button" id="btn_query" class="btn btn-info">查 询</button>
@ -147,7 +214,6 @@
{field: 'labelFeedback', title: '索引标签反馈次数', align : "center", width: "50"}, {field: 'labelFeedback', title: '索引标签反馈次数', align : "center", width: "50"},
{field: 'purposeCase', title: '案例用途', align : "center", width: "60", formatter:function(value,row, index){ {field: 'purposeCase', title: '案例用途', align : "center", width: "60", formatter:function(value,row, index){
for(var i = 0; i < row.tagList.length;i++){ for(var i = 0; i < row.tagList.length;i++){
console.log(row.tagList[i].id+row.tagList[i].tagName)
if(row.tagList[i].id === 19){ if(row.tagList[i].id === 19){
return row.tagList[i].tagName; return row.tagList[i].tagName;
} }
@ -156,7 +222,6 @@
}}, }},
{field: 'formCreative', title: '创意形式', align : "center", width: "60", formatter:function(value,row, index){ {field: 'formCreative', title: '创意形式', align : "center", width: "60", formatter:function(value,row, index){
for(var i = 0; i < row.tagList.length;i++){ for(var i = 0; i < row.tagList.length;i++){
console.log(row.tagList[i].id+row.tagList[i].tagName)
if(row.tagList[i].id === 20){ if(row.tagList[i].id === 20){
return row.tagList[i].tagName; return row.tagList[i].tagName;
} }
@ -200,7 +265,14 @@
{field: 'createtime', title: '创建时间', align : "center", width: "50"}, {field: 'createtime', title: '创建时间', align : "center", width: "50"},
{field: 'updatetime', title: '修改时间', align : "center", width: "50"}, {field: 'updatetime', title: '修改时间', align : "center", width: "50"},
{field: 'onlineTime', title: '上线时间', align : "center", width: "50"}, {field: 'onlineTime', title: '上线时间', align : "center", width: "50"},
{field: 'position', title: '关联部门', align : "center", width: "50"}, {field: 'position', title: '关联部门', align : "center", width: "50", formatter:function(value,row, index){
for(var i = 0; i < row.tagList.length;i++){
if(row.tagList[i].id === 26){
return row.tagList[i].tagName;
}
}
return "";
}},
{field: 'userName', title: '创建者', align : "center", width: "50"}, {field: 'userName', title: '创建者', align : "center", width: "50"},
/* {field: 'title', title: '标题', align : "left", width: "25%", formatter: function(value, row, index) { /* {field: 'title', title: '标题', align : "left", width: "25%", formatter: function(value, row, index) {
if(value!=null && $.trim(value)!='' && value.length>25){ if(value!=null && $.trim(value)!='' && value.length>25){
@ -256,6 +328,12 @@
status: $("#status").val(), status: $("#status").val(),
quantity: $("#count").val(), quantity: $("#count").val(),
type:$("#typeCase").val(), type:$("#typeCase").val(),
createtime:$("#createTime").find("input").val(),
createtimeSection:$("#createTimeSection").find("input").val(),
updatetime:$("#updateTime").find("input").val(),
updatetimeSection:$("#updateTimeSection").find("input").val(),
onlineTime:$("#onlineTime").find("input").val(),
onlineTimeSection:$("#onlineTimeSection").find("input").val(),
tagLists: tagLists:
"" ""
+$("#brandCompany").val()+"," +$("#brandCompany").val()+","
@ -360,29 +438,22 @@
function getDropDownBox(){ function getDropDownBox(){
//初始化下拉框 //初始化下拉框
$.getJSON("/cases/console/datadict/getDropDownBox",function (data){ $.getJSON("/cases/console/datadict/getDropDownBox",function (data){
console.log(data)
$.each(data.data, function(i, item){ $.each(data.data, function(i, item){
if(item.dictId === 18 ){ if(item.dictId === 18 ){
console.log(item.dictId)
$("#typeCase").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n"); $("#typeCase").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
}else if(item.dictId === 19 ){ }else if(item.dictId === 19 ){
console.log(item.dictId)
$("#purposeCase").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n"); $("#purposeCase").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
}else if(item.dictId === 20 ){ }else if(item.dictId === 20 ){
console.log(item.dictId)
$("#formCreative").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n"); $("#formCreative").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
}else if(item.dictId === 21 ){ }else if(item.dictId === 21 ){
console.log(item.dictId)
$("#eventsFestival").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n"); $("#eventsFestival").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
}else if(item.dictId === 23 ){ }else if(item.dictId === 23 ){
console.log(item.dictId)
$("#brandCompany").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n"); $("#brandCompany").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
}else if(item.dictId === 24 ){ }else if(item.dictId === 24 ){
console.log(item.dictId)
$("#advertisingAgency").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n"); $("#advertisingAgency").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
}else if(item.dictId === 25){ }else if(item.dictId === 25){
$("#tags").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n"); $("#tags").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
@ -453,5 +524,14 @@
}, 2); }, 2);
} }
$('.date').datetimepicker({
language: 'zh-CN',//显示中文
format: 'yyyy-mm-dd',//显示格式
minView: "month",//设置只显示到月份
initialDate: new Date(),//初始化当前日期
autoclose: true,//选中自动关闭
todayBtn: true//显示今日按钮
})
</script> </script>

View File

@ -36,6 +36,7 @@
<label class="col-sm-2 control-label">案例类型:</label> <label class="col-sm-2 control-label">案例类型:</label>
<div class="col-sm-2"> <div class="col-sm-2">
<select id="contentType18" name="tagLists" class="selectpicker"> <select id="contentType18" name="tagLists" class="selectpicker">
<option value="">请选择</option>
</select> </select>
</div> </div>
<label class="col-sm-2 control-label">案例用途:</label> <label class="col-sm-2 control-label">案例用途:</label>
@ -535,25 +536,37 @@ var caseType = [[${caseType}]];
// 提交保存 // 提交保存
$("#btn_save").on('click', function () { $("#btn_save").on('click', function () {
if($("#contentType26").val() === null){ if($("#contentType26").val() === null){
layer.msg('关联部门不能为空!'); alert('关联部门不能为空!');
return;
} }
if($("#contentType18").val() === null){ if($("#contentType18").val() === null){
layer.msg('案例类型不能为空!'); alert('案例类型不能为空!');
return;
} }
if($("#contentType19").val() === null){ if($("#contentType19").val() === null){
layer.msg('案例用途不能为空!'); alert('案例用途不能为空!');
return;
} }
if($("#contentType20").val() === null){ if($("#contentType20").val() === null){
layer.msg('创意形式不能为空!'); alert('创意形式不能为空!');
return;
} }
if($("#contentType21").val() === null){ if($("#contentType21").val() === null){
layer.msg('节日事件不能为空!'); alert('节日事件不能为空!');
return;
} }
if($("#contentType23").val() === null){ if($("#contentType23").val() === null){
layer.msg('品牌公司不能为空!'); alert('品牌公司不能为空!');
return;
} }
if($("#contentType24").val() === null){ if($("#contentType24").val() === null){
layer.msg('广告公司不能为空!'); alert('广告公司不能为空!');
return;
}
console.log($("#tagNames").val())
if($("#tagNames").val() === ''){
alert('标签不能为空!');
return;
} }
// editor.sync(); // 同步editor数据 // editor.sync(); // 同步editor数据
if(caseType == 'design' || caseType == 'video' || caseType == 'h5'){ if(caseType == 'design' || caseType == 'video' || caseType == 'h5'){
@ -566,7 +579,7 @@ var caseType = [[${caseType}]];
// 替换所有的换行符和所有所有的空格 // 替换所有的换行符和所有所有的空格
textValue = textValue.trim().replace(/\r\n/g, "").replace(/\n/g, "").replace(/\s/g,""); textValue = textValue.trim().replace(/\r\n/g, "").replace(/\n/g, "").replace(/\s/g,"");
$('#content_text').val(textValue); $('#content_text').val(textValue);
if (doValidForm(newsForm)) { if (doValidForm(newsForm)) {
// $('#type').removeAttr('disabled'); // disabled的表单form.serialize取不到值 // $('#type').removeAttr('disabled'); // disabled的表单form.serialize取不到值
Core.mask("#btn_save"); Core.mask("#btn_save");

View File

@ -77,6 +77,73 @@
</select> </select>
</div> </div>
<div class="form-group">
<label>创建时间:</label>
<!--指定 date标记-->
<div class='input-group date' id='createTime'>
<input type='text' class="form-control" readonly="readonly" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<label></label>
<!--指定 date标记-->
<div class='input-group date' id='createTimeSection'>
<input type='text' class="form-control" readonly="readonly" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<label>修改时间:</label>
<!--指定 date标记-->
<div class='input-group date' id='updateTime'>
<input type='text' class="form-control" readonly="readonly" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<label></label>
<!--指定 date标记-->
<div class='input-group date' id='updateTimeSection'>
<input type='text' class="form-control" readonly="readonly" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<label>上线时间:</label>
<!--指定 date标记-->
<div class='input-group date' id='onlineTime'>
<input type='text' class="form-control" readonly="readonly" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group">
<label></label>
<!--指定 date标记-->
<div class='input-group date' id='onlineTimeSection'>
<input type='text' class="form-control" readonly="readonly" />
<span class="input-group-addon">
<span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="form-group"> <div class="form-group">
<div class="col-md-1 col-sm-3" style="text-align:left;"> <div class="col-md-1 col-sm-3" style="text-align:left;">
<button type="button" id="btn_query" class="btn btn-info">查 询</button> <button type="button" id="btn_query" class="btn btn-info">查 询</button>
@ -247,7 +314,7 @@
let seeHtml= ""; let seeHtml= "";
let delHtml = ""; let delHtml = "";
if(row.status === 5 || row.status === 4){ if(row.status === 5 || row.status === 4){
if($("#name").val() !== 'admin'){ /*if($("#name").val() !== 'admin'){
submitHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="submitApplication('+row.id+')">提交</a>'; submitHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="submitApplication('+row.id+')">提交</a>';
editHtml = '&nbsp;<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="editPage('+row.id+')">修改</a>'; editHtml = '&nbsp;<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="editPage('+row.id+')">修改</a>';
delHtml = '&nbsp;<a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>'; delHtml = '&nbsp;<a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>';
@ -255,25 +322,31 @@
//这里的1标记为查看状态 //这里的1标记为查看状态
seeHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="seeApplication('+row.id+',1)">查看</a>'; seeHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="seeApplication('+row.id+',1)">查看</a>';
delHtml = '&nbsp;<a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>'; delHtml = '&nbsp;<a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>';
} }*/
submitHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="submitApplication('+row.id+')">提交</a>';
editHtml = '&nbsp;<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="editPage('+row.id+')">修改</a>';
delHtml = '&nbsp;<a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>';
}else if(row.status === 1){ }else if(row.status === 1){
if($("#name").val() !== 'admin'){ /*if($("#name").val() !== 'admin'){
submitHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="withdrawApplication('+row.applicationId+')">撤回</a>'; submitHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="withdrawApplication('+row.applicationId+')">撤回</a>';
} }*/
//这里的1标记为查看状态 //这里的1标记为查看状态
seeHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="seeApplication('+row.id+',1)">查看</a>'; seeHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="seeApplication('+row.id+',1)">查看</a>';
delHtml = '&nbsp;<a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>'; delHtml = '&nbsp;<a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>';
submitHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="withdrawApplication('+row.applicationId+')">撤回</a>';
}else if(row.status === 2 || row.status === 3){ }else if(row.status === 2 || row.status === 3){
if($("#name").val() !== 'admin'){ /*if($("#name").val() !== 'admin'){
submitHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="updateApplication('+row.id+','+row.applicationId+')">更新</a>'; submitHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="updateApplication('+row.id+','+row.applicationId+')">更新</a>';
} }*/
submitHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="updateApplication('+row.id+','+row.applicationId+')">更新</a>';
seeHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="seeApplication('+row.id+',1)">查看</a>'; seeHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="seeApplication('+row.id+',1)">查看</a>';
delHtml = '&nbsp;<a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>'; delHtml = '&nbsp;<a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>';
} }
if(row.status === 2){ if(row.status === 2){
if($("#name").val() !== 'admin'){ /*if($("#name").val() !== 'admin'){
offlineHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="offlineApplication('+row.id+')">下线</a>'; offlineHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="offlineApplication('+row.id+')">下线</a>';
} }*/
offlineHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="offlineApplication('+row.id+')">下线</a>';
seeHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="seeApplication('+row.id+',1)">查看</a>'; seeHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="seeApplication('+row.id+',1)">查看</a>';
delHtml = '&nbsp;<a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>'; delHtml = '&nbsp;<a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>';
} }
@ -304,6 +377,12 @@
status: $("#status").val(), status: $("#status").val(),
quantity: $("#count").val(), quantity: $("#count").val(),
type:$("#typeCase").val(), type:$("#typeCase").val(),
createtime:$("#createTime").find("input").val(),
createtimeSection:$("#createTimeSection").find("input").val(),
updatetime:$("#updateTime").find("input").val(),
updatetimeSection:$("#updateTimeSection").find("input").val(),
onlineTime:$("#onlineTime").find("input").val(),
onlineTimeSection:$("#onlineTimeSection").find("input").val(),
tagLists: tagLists:
"" ""
+$("#brandCompany").val()+"," +$("#brandCompany").val()+","
@ -400,6 +479,12 @@
$("#case_number").val(""); $("#case_number").val("");
$("#title").val(""); $("#title").val("");
$(".form-control").find("option:selected").attr("selected",false); $(".form-control").find("option:selected").attr("selected",false);
$("#createTime").find("input").val("");
$("#createTimeSection").find("input").val("");
$("#updateTime").find("input").val("");
$("#updateTimeSection").find("input").val("");
$("#onlineTime").find("input").val("");
$("#onlineTimeSection").find("input").val("");
}); });
}); });
@ -498,4 +583,17 @@
}, 2); }, 2);
} }
$('.date').datetimepicker({
language: 'zh-CN',//显示中文
format: 'yyyy-mm-dd',//显示格式
minView: "month",//设置只显示到月份
initialDate: new Date(),//初始化当前日期
autoclose: true,//选中自动关闭
todayBtn: true//显示今日按钮
})
</script> </script>

View File

@ -7,6 +7,7 @@
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<link rel="stylesheet" th:href="@{/libs/bootstrap/bootstrap.min.css}"/> <link rel="stylesheet" th:href="@{/libs/bootstrap/bootstrap.min.css}"/>
<link rel="stylesheet" th:href="@{/libs/bootstrap/bootstrap-select.min.css}"/> <link rel="stylesheet" th:href="@{/libs/bootstrap/bootstrap-select.min.css}"/>
<link rel="stylesheet" th:href="@{/libs/bootstrap-datetimepicker/css/bootstrap-datetimepicker.css}"/>
<link rel="stylesheet" th:href="@{/libs/font-awesome/font-awesome.min.css}"/> <link rel="stylesheet" th:href="@{/libs/font-awesome/font-awesome.min.css}"/>
<link rel="stylesheet" th:href="@{/libs/adminlte/css/AdminLTE.min.css}"/> <link rel="stylesheet" th:href="@{/libs/adminlte/css/AdminLTE.min.css}"/>
<link rel="stylesheet" th:href="@{/libs/adminlte/css/all-skins.min.css}"/> <link rel="stylesheet" th:href="@{/libs/adminlte/css/all-skins.min.css}"/>
@ -23,6 +24,8 @@
<script th:src="@{/libs/jquery/jquery.min.js}"></script> <script th:src="@{/libs/jquery/jquery.min.js}"></script>
<script th:src="@{/libs/bootstrap/bootstrap.min.js}"></script> <script th:src="@{/libs/bootstrap/bootstrap.min.js}"></script>
<script th:src="@{/libs/bootstrap/bootstrap-select.js}"></script> <script th:src="@{/libs/bootstrap/bootstrap-select.js}"></script>
<script th:src="@{/libs/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js}"></script>
<script th:src="@{/libs/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js}"></script>
<!-- <script th:src="@{/libs/pace/pace.js}"></script> 进度插件 --> <!-- <script th:src="@{/libs/pace/pace.js}"></script> 进度插件 -->
<script th:src="@{/libs/jquery/jquery.slimscroll.min.js}"></script> <script th:src="@{/libs/jquery/jquery.slimscroll.min.js}"></script>
<script th:src="@{/libs/jquery/fastclick.min.js}"></script> <script th:src="@{/libs/jquery/fastclick.min.js}"></script>