Commit 337fb4ec authored by 赵啸非's avatar 赵啸非

修改热门词汇

parent 7d14d3bf
Pipeline #2427 canceled with stages
......@@ -12,4 +12,6 @@ public class HomeQueryPdu {
private Integer type;
private String title;
}
......@@ -198,6 +198,7 @@ public class HomeController extends BaseJsonBodyController {
try {
Map<String, String> params = new HashMap<>();
params.put("siteid", queryPdu.getSiteId().toString());
params.put("title", queryPdu.getTitle());
params.put("type", queryPdu.getType().toString());
params.put("page", queryPdu.getPage().toString());
params.put("size", queryPdu.getSize().toString());
......
package com.mortals.xhx.module.matter.web;
import cn.hutool.core.util.StrUtil;
import com.mortals.framework.common.IBaseEnum;
import com.mortals.framework.common.Rest;
......@@ -22,8 +23,10 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.matter.model.MatterEntity;
import com.mortals.xhx.module.matter.service.MatterService;
......@@ -31,20 +34,22 @@ import org.apache.commons.lang3.ArrayUtils;
import java.util.*;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
/**
*
* 事项申请材料
*
* @author zxfei
* @date 2022-09-27
*/
* 事项申请材料
*
* @author zxfei
* @date 2022-09-27
*/
@RestController
@RequestMapping("matter")
public class MatterController extends BaseCRUDJsonBodyMappingController<MatterService,MatterEntity,Long> {
public class MatterController extends BaseCRUDJsonBodyMappingController<MatterService, MatterEntity, Long> {
@Autowired
private ParamService paramService;
......@@ -54,13 +59,13 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
@Autowired
private MatterDatumService matterDatumService;
public MatterController(){
super.setModuleDesc( "事项");
public MatterController() {
super.setModuleDesc("事项");
}
@Override
protected void init(Map<String, Object> model, Context context) {
this.addDict(model, "isRecommend", paramService.getParamBySecondOrganize("Matter","isRecommend"));
this.addDict(model, "isRecommend", paramService.getParamBySecondOrganize("Matter", "isRecommend"));
this.addDict(model, "source", IBaseEnum.getEnumMap(MatterSourceEnum.class));
super.init(model, context);
}
......@@ -75,24 +80,27 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
query.setMatterFullName("%".concat(query.getMatterFullName()).concat("%"));
}
List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("isRecommend",OrderCol.DESCENDING));
orderColList.add(new OrderCol("createTime",OrderCol.DESCENDING));
orderColList.add(new OrderCol("isRecommend", OrderCol.DESCENDING));
orderColList.add(new OrderCol("createTime", OrderCol.DESCENDING));
query.setOrderColList(orderColList);
if ("%%".equals(query.getMatterFullName()) || "%null%".equals(query.getMatterFullName())) {
return;
}
//添加更新热门词汇
HotwordEntity hotwordEntity = hotwordService.selectOne(new HotwordQuery().siteId(query.getSiteId()).hotwords(query.getMatterFullName()), context);
if (ObjectUtils.isEmpty(hotwordEntity)) {
//新增
hotwordEntity = new HotwordEntity();
hotwordEntity.initAttrValue();
hotwordEntity.setHotwords(StrUtil.subBetween(query.getMatterFullName(),"%"));
hotwordEntity.setHotwords(StrUtil.subBetween(query.getMatterFullName(), "%"));
hotwordEntity.setSearchCount(1);
hotwordEntity.setSiteId(query.getSiteId());
hotwordService.save(hotwordEntity, context);
} else {
//更新
hotwordEntity.setSearchCount(1+hotwordEntity.getSearchCount());
hotwordService.update(hotwordEntity,context);
hotwordEntity.setSearchCount(1 + hotwordEntity.getSearchCount());
hotwordService.update(hotwordEntity, context);
}
super.doListBefore(query, model, context);
}
......@@ -112,8 +120,8 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
return super.doListAfter(query, model, context);
}
@RequestMapping(value = {"createMatter"},method = {RequestMethod.POST, RequestMethod.GET})
public String createMatter(Long[] ids,Long siteId) {
@RequestMapping(value = {"createMatter"}, method = {RequestMethod.POST, RequestMethod.GET})
public String createMatter(Long[] ids, Long siteId) {
Map<String, Object> model = new HashMap();
int code = VALUE_RESULT_SUCCESS;
String busiDesc = "站点事项转事项";
......@@ -135,7 +143,7 @@ public class MatterController extends BaseCRUDJsonBodyMappingController<MatterSe
}
@RequestMapping(value = {"recommend"},method = {RequestMethod.POST, RequestMethod.GET})
@RequestMapping(value = {"recommend"}, method = {RequestMethod.POST, RequestMethod.GET})
public String recommend(Long id) {
Map<String, Object> model = new HashMap();
int code = VALUE_RESULT_SUCCESS;
......
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