...
This commit is contained in:
parent
8a288e9e78
commit
be77b74c9f
@ -424,11 +424,20 @@ public class ContentController extends BaseController {
|
||||
User loginUser = getLoginUser();
|
||||
User user = userService.selectByUsername(loginUser.getUsername());
|
||||
application.setUserId(Long.parseLong(user.getId().toString()));
|
||||
//根据userId获取微信用户信息
|
||||
WxUser wxUser = service.getQyWxUser(user.getUsername());
|
||||
//根据部门id获取用户领导
|
||||
List<Check> checks = service.getUserLeader(wxUser.getDepartment());
|
||||
List<Check> checks;
|
||||
if(!loginUser.getUserId().equals("admin")){
|
||||
//根据userId获取微信用户信息
|
||||
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);
|
||||
|
||||
//添加审核申请单
|
||||
service.saveApplication(application);
|
||||
return Result.success();
|
||||
|
||||
@ -1,15 +1,21 @@
|
||||
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.nbclass.activity.model.*;
|
||||
import com.nbclass.activity.service.CaseTypeService;
|
||||
import com.nbclass.activity.service.ElasticSearchService;
|
||||
import com.nbclass.vo.base.Result;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 案例web前台
|
||||
@ -23,6 +29,9 @@ public class CaseTypeController {
|
||||
@Autowired
|
||||
private CaseTypeService caseTypeService;
|
||||
|
||||
@Autowired
|
||||
private ElasticSearchService elasticSearchService;
|
||||
|
||||
/**
|
||||
* 数据字典(案例类型、案例用途、创意形式、节日事件)列表查询
|
||||
* @return
|
||||
@ -43,28 +52,24 @@ public class CaseTypeController {
|
||||
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 dictItemId 案例类型id
|
||||
* 案例列表
|
||||
* @param keyWord 任意参数(案例标签,案例标题,案例编号)
|
||||
* @param tagIds 标签id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getSearchCase")
|
||||
public Result getSearchCase(String parameter,Integer dictItemId,Integer page,Integer pageSize){
|
||||
PageInfo<Content> list = caseTypeService.getSearchCase(parameter,dictItemId,page,pageSize);
|
||||
return Result.success(list);
|
||||
public Result getSearchCase(String keyWord,String tagIds,Integer page,Integer pageSize){
|
||||
Map<String, Object> map = elasticSearchService.getList(page,pageSize,"",keyWord,tagIds,"");
|
||||
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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -16,6 +16,8 @@ import com.nbclass.exception.ParameterException;
|
||||
import com.nbclass.system.controller.BaseController;
|
||||
import com.nbclass.vo.base.Result;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* i前端获取案例查询
|
||||
* @author Leon
|
||||
@ -54,7 +56,7 @@ public class FrontContentController extends BaseController {
|
||||
}
|
||||
// List<Integer> tagIdList = CommonUtils.toIntList(tagIds);
|
||||
// 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);
|
||||
}
|
||||
|
||||
|
||||
@ -25,19 +25,12 @@ public interface CaseTypeMapper {
|
||||
*/
|
||||
List<DataDict> getDictionariesType();
|
||||
|
||||
/**
|
||||
* 案例搜索框
|
||||
* @param dictItemId 案例类型id
|
||||
* @return
|
||||
*/
|
||||
List<Content> getSearchCase(@Param("parameter") String parameter,
|
||||
@Param("dictItemId") Integer dictItemId);
|
||||
|
||||
/**
|
||||
* 案例库列表
|
||||
* 案例(评分总人数、总评分)
|
||||
* @return
|
||||
*/
|
||||
List<Content> getListCase();
|
||||
Content getListCase(Long contentId);
|
||||
|
||||
/**
|
||||
* 获取案例标签
|
||||
|
||||
@ -56,4 +56,10 @@ public interface DataDictItemMapper extends MyMapper<DataDictItem> {
|
||||
* @return
|
||||
*/
|
||||
String[] getTagId(String name);
|
||||
|
||||
/**
|
||||
* 查询案例关联字典值tid
|
||||
* @return
|
||||
*/
|
||||
List<Long> getContentDict();
|
||||
}
|
||||
|
||||
@ -60,10 +60,10 @@ public interface DataDictMapper extends MyMapper<DataDict> {
|
||||
List<DataDictItem> getDataDictTemName(@Param("tagNames")ArrayList<String> postTagList);
|
||||
|
||||
/**
|
||||
* 获取自定义标签id
|
||||
* 获取所有标签
|
||||
* @return
|
||||
*/
|
||||
Long getDataDictID();
|
||||
List<Long> getDataDictID();
|
||||
|
||||
/**
|
||||
* 查询字典值是否重复
|
||||
@ -72,4 +72,10 @@ public interface DataDictMapper extends MyMapper<DataDict> {
|
||||
*/
|
||||
int getDataDicName(String name);
|
||||
|
||||
/**
|
||||
* 获取自定义标签id
|
||||
* @return
|
||||
*/
|
||||
Long getDataDictIDLabels();
|
||||
|
||||
}
|
||||
@ -27,11 +27,21 @@ public class Content implements Serializable {
|
||||
*/
|
||||
private Date createtime;
|
||||
|
||||
/**
|
||||
* 创建时间区间
|
||||
*/
|
||||
private Date createtimeSection;
|
||||
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
private Date updatetime;
|
||||
|
||||
/**
|
||||
* 创建时间区间
|
||||
*/
|
||||
private Date updatetimeSection;
|
||||
|
||||
/**
|
||||
* 案例类型[ppqa:品牌全案, ggqa:公关全案, design:创意设计, video:视频动画, h5:技术开发, ldhd:落地活动, others:其他案例]
|
||||
*/
|
||||
@ -133,6 +143,11 @@ public class Content implements Serializable {
|
||||
*/
|
||||
private Date onlineTime;
|
||||
|
||||
/**
|
||||
* 上线时间区间
|
||||
*/
|
||||
private Date onlineTimeSection;
|
||||
|
||||
/**
|
||||
* 可见性
|
||||
*/
|
||||
|
||||
@ -27,20 +27,12 @@ public interface CaseTypeService {
|
||||
*/
|
||||
List<DataDict> getDictionariesType();
|
||||
|
||||
/**
|
||||
* 案例搜索框
|
||||
* @param dictItemId 案例类型id
|
||||
* @return
|
||||
*/
|
||||
PageInfo<Content> getSearchCase(String parameter, Integer dictItemId,Integer page, Integer pageSize);
|
||||
|
||||
/**
|
||||
* 案例库列表
|
||||
* @param page
|
||||
* @param pageSize
|
||||
* 案例(评分总人数、总评分)
|
||||
* @return
|
||||
*/
|
||||
PageInfo<Content> getListCase(Integer page, Integer pageSize);
|
||||
Content getListCase(Long contentId);
|
||||
|
||||
/**
|
||||
* 获取案例标签
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.nbclass.activity.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.nbclass.activity.model.Content;
|
||||
@ -54,7 +55,7 @@ public interface ElasticSearchService {
|
||||
* @param sourceIds 案例来源ID, 多个英文逗号分隔
|
||||
* @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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -30,17 +30,8 @@ public class CaseTypeServiceImpl implements CaseTypeService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<Content> getSearchCase(String parameter, Integer dictItemId,Integer page, Integer pageSize) {
|
||||
PageHelper.startPage(page,pageSize);
|
||||
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);
|
||||
public Content getListCase(Long contentId) {
|
||||
return caseTypeMapper.getListCase(contentId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -158,7 +158,7 @@ public class ContentServiceImpl implements ContentService {
|
||||
if(StringUtils.isNotBlank(o.getTags())){
|
||||
ArrayList<String> postTagList = CommonUtils.str2List(o.getTags());
|
||||
// 查询自定义标签的dictid
|
||||
Long dictId = dataDictMapper2.getDataDictID();
|
||||
Long dictId = dataDictMapper2.getDataDictIDLabels();
|
||||
|
||||
//根据标签名称查询标签信息
|
||||
List<DataDictItem> tagList = dataDictMapper2.getDataDictTemName(postTagList);
|
||||
@ -225,6 +225,7 @@ public class ContentServiceImpl implements ContentService {
|
||||
entity.setType(null);
|
||||
mapper.insertSelective(entity);
|
||||
updateLabelAndImages(entity);
|
||||
entity.setVisibility(2);
|
||||
|
||||
// 提交到ElasticSearch
|
||||
entity = findById(entity.getId());
|
||||
@ -390,6 +391,10 @@ public class ContentServiceImpl implements ContentService {
|
||||
}
|
||||
//更新案例状态(审核可能是下架重新申请的)
|
||||
mapper.updateContentRelease(application.getContentId(),1,2);
|
||||
//更新es的状态
|
||||
Content entity=mapper.findById(application.getContentId());
|
||||
entity.setVisibility(2);
|
||||
esService.merge(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -400,10 +405,16 @@ public class ContentServiceImpl implements ContentService {
|
||||
@Override
|
||||
@Transactional
|
||||
public void deleteApplication(Long applicationId) {
|
||||
//查询案例id
|
||||
Long contentId = mapper.getContentId(applicationId);
|
||||
//删除案例审核申请
|
||||
mapper.deleteApplication(applicationId);
|
||||
//删除审核人信息
|
||||
mapper.deleteCheck(applicationId);
|
||||
//更新es的状态
|
||||
Content entity=mapper.findById(contentId);
|
||||
entity.setVisibility(2);
|
||||
esService.merge(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -438,6 +449,10 @@ public class ContentServiceImpl implements ContentService {
|
||||
Long contentId = mapper.getContentId(check.getApplicationId());
|
||||
//更新案例状态
|
||||
mapper.updateContentRelease(contentId,2,1);
|
||||
//更新es的状态
|
||||
Content entity=mapper.findById(contentId);
|
||||
entity.setVisibility(1);
|
||||
esService.merge(entity);
|
||||
}else {
|
||||
//审核驳回
|
||||
application.setStatus(3);
|
||||
@ -467,6 +482,10 @@ public class ContentServiceImpl implements ContentService {
|
||||
mapper.deleteCheck(application.getId());
|
||||
//案例表状态修改为已下线
|
||||
mapper.updateContentRelease(contentId,4,2);
|
||||
//更新es的状态
|
||||
Content entity=mapper.findById(contentId);
|
||||
entity.setVisibility(2);
|
||||
esService.merge(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -54,10 +54,18 @@ public class DataDictServiceImpl implements DataDictService {
|
||||
if(cnt!=null && cnt>0) {
|
||||
throw new ParameterException("请先删除子项再删除字典!");
|
||||
}
|
||||
Long dataDictID = mapper.getDataDictID();
|
||||
List<Long> dataDictID = mapper.getDataDictID();
|
||||
for (Long id : ids) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
package com.nbclass.activity.service.impl;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
@ -259,9 +257,9 @@ public class ElasticSearchServiceImpl implements ElasticSearchService {
|
||||
}
|
||||
|
||||
@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参数返回
|
||||
JSONObject result = new JSONObject();
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
try {
|
||||
// 选择标签或来源过滤时,从数据库查询记录
|
||||
/*if(StringUtils.isNotBlank(tagIds) || StringUtils.isNotBlank(sourceIds)) {
|
||||
@ -280,7 +278,8 @@ public class ElasticSearchServiceImpl implements ElasticSearchService {
|
||||
}
|
||||
|
||||
BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
|
||||
if(StringUtils.isNotBlank(type)) { // 案例类型
|
||||
boolQueryBuilder.must(QueryBuilders.termQuery("visibility", 1));
|
||||
/*if(StringUtils.isNotBlank(type)) { // 案例类型
|
||||
boolQueryBuilder.must(QueryBuilders.termQuery("type", type));
|
||||
if (StringUtils.isNoneBlank(keyWord)){
|
||||
BoolQueryBuilder keywordQuery = QueryBuilders.boolQuery();
|
||||
@ -300,20 +299,29 @@ public class ElasticSearchServiceImpl implements ElasticSearchService {
|
||||
boolQueryBuilder.should(QueryBuilders.matchQuery("content_text", keyWord));
|
||||
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)){
|
||||
List<String> tagIdList = Arrays.asList(tagIds.split(","));
|
||||
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(","));
|
||||
for(String sourId:sourIdList) {
|
||||
boolQueryBuilder.must(QueryBuilders.termQuery("fromid", sourId));
|
||||
}
|
||||
}
|
||||
}*/
|
||||
searchSourceBuilder.query(boolQueryBuilder);
|
||||
|
||||
|
||||
|
||||
@ -12,7 +12,9 @@ public class DateConverter implements Converter<String, Date> {
|
||||
@Override
|
||||
public Date convert(String source) {
|
||||
try {
|
||||
return sdf.parse(source);
|
||||
if(!source.equals("")){
|
||||
return sdf.parse(source);
|
||||
}
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ spring:
|
||||
enabled: true # 开启 Elasticsearch仓库(默认值:true)
|
||||
client:
|
||||
reactive:
|
||||
endpoints: 172.24.133.129:9200
|
||||
endpoints: 39.108.110.167:9200
|
||||
connection-timeout: 5000
|
||||
socket-timeout: 5000
|
||||
|
||||
|
||||
@ -11,10 +11,10 @@
|
||||
<result column="userTotal" property="userTotal"/>
|
||||
<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"/>
|
||||
<result column="tagName" property="tagName"/>
|
||||
</collection>
|
||||
</collection>-->
|
||||
|
||||
</resultMap>
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
select id,name from data_dict
|
||||
</select>
|
||||
|
||||
<select id="getSearchCase" resultType="com.nbclass.activity.model.Content">
|
||||
<!-- <select id="getSearchCase" resultType="com.nbclass.activity.model.Content">
|
||||
SELECT
|
||||
c.id,
|
||||
c.title,
|
||||
@ -55,22 +55,17 @@
|
||||
and item.id = #{dictItemId}
|
||||
</if>
|
||||
order by c.createtime desc
|
||||
</select>
|
||||
</select>-->
|
||||
|
||||
<select id="getListCase" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
c.id,
|
||||
c.title,
|
||||
c.praiseno,
|
||||
c.listicon,
|
||||
c.comments,
|
||||
COUNT(s.content_id) as userTotal,
|
||||
IFNULL(SUM(s.score),0) AS TotalScore
|
||||
FROM
|
||||
content c
|
||||
LEFT JOIN scoring_table s ON c.id = s.content_id
|
||||
WHERE
|
||||
c.RELEASE = 2
|
||||
c.RELEASE = 2 and c.id = #{contentId}
|
||||
ORDER BY
|
||||
c.createtime DESC
|
||||
</select>
|
||||
|
||||
@ -128,6 +128,24 @@
|
||||
<if test="quantity!=null and quantity == 1">
|
||||
and c.label_feedback > 0
|
||||
</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') <= 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') <= 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') <= DATE_FORMAT(#{onlineTimeSection}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="tagLists!=null and tagLists!=''">
|
||||
and item.id in
|
||||
<foreach collection="tagLists" open="(" separator="," item="id" close=")">
|
||||
|
||||
@ -45,4 +45,12 @@
|
||||
where item.name like concat('%',#{name},'%')
|
||||
</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>
|
||||
|
||||
@ -79,11 +79,24 @@
|
||||
</insert>
|
||||
|
||||
<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 id="getDataDicName" resultType="int">
|
||||
select count(*) from data_dict where name = #{name}
|
||||
</select>
|
||||
|
||||
<select id="getDataDictIDLabels" resultType="java.lang.Long">
|
||||
select
|
||||
id
|
||||
from data_dict
|
||||
where name = '标签'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -76,6 +76,73 @@
|
||||
</select>
|
||||
</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="col-md-1 col-sm-3" style="text-align:left;">
|
||||
<button type="button" id="btn_query" class="btn btn-info">查 询</button>
|
||||
@ -147,7 +214,6 @@
|
||||
{field: 'labelFeedback', title: '索引标签反馈次数', align : "center", width: "50"},
|
||||
{field: 'purposeCase', title: '案例用途', align : "center", width: "60", formatter:function(value,row, index){
|
||||
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){
|
||||
return row.tagList[i].tagName;
|
||||
}
|
||||
@ -156,7 +222,6 @@
|
||||
}},
|
||||
{field: 'formCreative', title: '创意形式', align : "center", width: "60", formatter:function(value,row, index){
|
||||
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){
|
||||
return row.tagList[i].tagName;
|
||||
}
|
||||
@ -200,7 +265,14 @@
|
||||
{field: 'createtime', title: '创建时间', align : "center", width: "50"},
|
||||
{field: 'updatetime', 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: 'title', title: '标题', align : "left", width: "25%", formatter: function(value, row, index) {
|
||||
if(value!=null && $.trim(value)!='' && value.length>25){
|
||||
@ -256,6 +328,12 @@
|
||||
status: $("#status").val(),
|
||||
quantity: $("#count").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:
|
||||
""
|
||||
+$("#brandCompany").val()+","
|
||||
@ -360,29 +438,22 @@
|
||||
function getDropDownBox(){
|
||||
//初始化下拉框
|
||||
$.getJSON("/cases/console/datadict/getDropDownBox",function (data){
|
||||
console.log(data)
|
||||
$.each(data.data, function(i, item){
|
||||
if(item.dictId === 18 ){
|
||||
console.log(item.dictId)
|
||||
$("#typeCase").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
|
||||
}else if(item.dictId === 19 ){
|
||||
console.log(item.dictId)
|
||||
$("#purposeCase").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
|
||||
|
||||
}else if(item.dictId === 20 ){
|
||||
console.log(item.dictId)
|
||||
$("#formCreative").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
|
||||
|
||||
}else if(item.dictId === 21 ){
|
||||
console.log(item.dictId)
|
||||
$("#eventsFestival").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
|
||||
|
||||
}else if(item.dictId === 23 ){
|
||||
console.log(item.dictId)
|
||||
$("#brandCompany").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
|
||||
|
||||
}else if(item.dictId === 24 ){
|
||||
console.log(item.dictId)
|
||||
$("#advertisingAgency").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
|
||||
}else if(item.dictId === 25){
|
||||
$("#tags").append("<option value='"+item.tid+"'>"+item.tagName+"</option>\n");
|
||||
@ -453,5 +524,14 @@
|
||||
}, 2);
|
||||
}
|
||||
|
||||
$('.date').datetimepicker({
|
||||
language: 'zh-CN',//显示中文
|
||||
format: 'yyyy-mm-dd',//显示格式
|
||||
minView: "month",//设置只显示到月份
|
||||
initialDate: new Date(),//初始化当前日期
|
||||
autoclose: true,//选中自动关闭
|
||||
todayBtn: true//显示今日按钮
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@ -36,6 +36,7 @@
|
||||
<label class="col-sm-2 control-label">案例类型:</label>
|
||||
<div class="col-sm-2">
|
||||
<select id="contentType18" name="tagLists" class="selectpicker">
|
||||
<option value="">请选择</option>
|
||||
</select>
|
||||
</div>
|
||||
<label class="col-sm-2 control-label">案例用途:</label>
|
||||
@ -535,25 +536,37 @@ var caseType = [[${caseType}]];
|
||||
// 提交保存
|
||||
$("#btn_save").on('click', function () {
|
||||
if($("#contentType26").val() === null){
|
||||
layer.msg('关联部门不能为空!');
|
||||
alert('关联部门不能为空!');
|
||||
return;
|
||||
}
|
||||
if($("#contentType18").val() === null){
|
||||
layer.msg('案例类型不能为空!');
|
||||
alert('案例类型不能为空!');
|
||||
return;
|
||||
}
|
||||
if($("#contentType19").val() === null){
|
||||
layer.msg('案例用途不能为空!');
|
||||
alert('案例用途不能为空!');
|
||||
return;
|
||||
}
|
||||
if($("#contentType20").val() === null){
|
||||
layer.msg('创意形式不能为空!');
|
||||
alert('创意形式不能为空!');
|
||||
return;
|
||||
}
|
||||
if($("#contentType21").val() === null){
|
||||
layer.msg('节日事件不能为空!');
|
||||
alert('节日事件不能为空!');
|
||||
return;
|
||||
}
|
||||
if($("#contentType23").val() === null){
|
||||
layer.msg('品牌公司不能为空!');
|
||||
alert('品牌公司不能为空!');
|
||||
return;
|
||||
}
|
||||
if($("#contentType24").val() === null){
|
||||
layer.msg('广告公司不能为空!');
|
||||
alert('广告公司不能为空!');
|
||||
return;
|
||||
}
|
||||
console.log($("#tagNames").val())
|
||||
if($("#tagNames").val() === ''){
|
||||
alert('标签不能为空!');
|
||||
return;
|
||||
}
|
||||
// editor.sync(); // 同步editor数据
|
||||
if(caseType == 'design' || caseType == 'video' || caseType == 'h5'){
|
||||
|
||||
@ -77,6 +77,73 @@
|
||||
</select>
|
||||
</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="col-md-1 col-sm-3" style="text-align:left;">
|
||||
<button type="button" id="btn_query" class="btn btn-info">查 询</button>
|
||||
@ -247,7 +314,7 @@
|
||||
let seeHtml= "";
|
||||
let delHtml = "";
|
||||
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>';
|
||||
editHtml = ' <a class="table-btn table-btn-info" href="javascript:void(0)" onclick="editPage('+row.id+')">修改</a>';
|
||||
delHtml = ' <a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>';
|
||||
@ -255,25 +322,31 @@
|
||||
//这里的1标记为查看状态
|
||||
seeHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="seeApplication('+row.id+',1)">查看</a>';
|
||||
delHtml = ' <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 = ' <a class="table-btn table-btn-info" href="javascript:void(0)" onclick="editPage('+row.id+')">修改</a>';
|
||||
delHtml = ' <a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>';
|
||||
}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>';
|
||||
}
|
||||
}*/
|
||||
//这里的1标记为查看状态
|
||||
seeHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="seeApplication('+row.id+',1)">查看</a>';
|
||||
delHtml = ' <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){
|
||||
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>';
|
||||
seeHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="seeApplication('+row.id+',1)">查看</a>';
|
||||
delHtml = ' <a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>';
|
||||
}
|
||||
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>';
|
||||
seeHtml = '<a class="table-btn table-btn-info" href="javascript:void(0)" onclick="seeApplication('+row.id+',1)">查看</a>';
|
||||
delHtml = ' <a class="table-btn table-btn-danger" href="javascript:void(0)" onclick="deleteAction('+row.id+',1)">删除</a>';
|
||||
}
|
||||
@ -304,6 +377,12 @@
|
||||
status: $("#status").val(),
|
||||
quantity: $("#count").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:
|
||||
""
|
||||
+$("#brandCompany").val()+","
|
||||
@ -400,6 +479,12 @@
|
||||
$("#case_number").val("");
|
||||
$("#title").val("");
|
||||
$(".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);
|
||||
}
|
||||
|
||||
$('.date').datetimepicker({
|
||||
language: 'zh-CN',//显示中文
|
||||
format: 'yyyy-mm-dd',//显示格式
|
||||
minView: "month",//设置只显示到月份
|
||||
initialDate: new Date(),//初始化当前日期
|
||||
autoclose: true,//选中自动关闭
|
||||
todayBtn: true//显示今日按钮
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
<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-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/adminlte/css/AdminLTE.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/bootstrap/bootstrap.min.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/jquery/jquery.slimscroll.min.js}"></script>
|
||||
<script th:src="@{/libs/jquery/fastclick.min.js}"></script>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user