Commit ee4aeda8 authored by 赵啸非's avatar 赵啸非

添加材料数量统计

parent 2e334160
...@@ -30,4 +30,6 @@ public final class Constant { ...@@ -30,4 +30,6 @@ public final class Constant {
public final static String PARAMS_BLANK_COUNT = "blank_count"; public final static String PARAMS_BLANK_COUNT = "blank_count";
public final static String PARAMS_HOTWORDS_DEFAULT_NUM = "hotwords_default_num";
} }
...@@ -7,6 +7,8 @@ import com.mortals.framework.annotation.UnAuth; ...@@ -7,6 +7,8 @@ import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.ap.GlobalSysInfo; import com.mortals.framework.ap.GlobalSysInfo;
import com.mortals.framework.common.Rest; import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException; import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.service.IUser; import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DataUtil; import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.StringUtils; import com.mortals.framework.util.StringUtils;
...@@ -19,6 +21,9 @@ import com.mortals.xhx.feign.base.pdu.DeptPdu; ...@@ -19,6 +21,9 @@ import com.mortals.xhx.feign.base.pdu.DeptPdu;
import com.mortals.xhx.feign.base.pdu.SitePdu; import com.mortals.xhx.feign.base.pdu.SitePdu;
import com.mortals.xhx.feign.rsp.ApiResp; import com.mortals.xhx.feign.rsp.ApiResp;
import com.mortals.xhx.feign.site.ISiteFeign; import com.mortals.xhx.feign.site.ISiteFeign;
import com.mortals.xhx.module.baseset.model.BasesetEntity;
import com.mortals.xhx.module.baseset.model.BasesetQuery;
import com.mortals.xhx.module.baseset.service.BasesetService;
import com.mortals.xhx.module.home.pdu.HomeQueryPdu; import com.mortals.xhx.module.home.pdu.HomeQueryPdu;
import com.mortals.xhx.module.hotword.model.HotwordEntity; import com.mortals.xhx.module.hotword.model.HotwordEntity;
import com.mortals.xhx.module.hotword.model.HotwordQuery; import com.mortals.xhx.module.hotword.model.HotwordQuery;
...@@ -54,6 +59,8 @@ public class HomeController extends BaseJsonBodyController { ...@@ -54,6 +59,8 @@ public class HomeController extends BaseJsonBodyController {
private ParamService paramService; private ParamService paramService;
@Autowired @Autowired
private ISiteFeign siteFeign; private ISiteFeign siteFeign;
@Autowired
private BasesetService basesetService;
@PostMapping({"site/list"}) @PostMapping({"site/list"})
public Rest<Object> list() { public Rest<Object> list() {
...@@ -148,21 +155,34 @@ public class HomeController extends BaseJsonBodyController { ...@@ -148,21 +155,34 @@ public class HomeController extends BaseJsonBodyController {
} }
@PostMapping({"info"}) @PostMapping({"info"})
@UnAuth @UnAuth
public Rest<Object> homePageInfo(@RequestBody HomeQueryPdu homeQueryPdu) { public Rest<Object> homePageInfo(@RequestBody HomeQueryPdu homeQueryPdu) {
Rest<Object> ret = new Rest(); Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap(); Map<String, Object> model = new HashMap();
String busiDesc = "获取首页数据"; String busiDesc = "获取首页数据";
int code = VALUE_RESULT_SUCCESS; int code = VALUE_RESULT_SUCCESS;
try { try {
List<String> hotwordEntities = hotwordService.find(new HotwordQuery().siteId(homeQueryPdu.getSiteId())).stream() HotwordQuery hotwordQuery = new HotwordQuery();
hotwordQuery.siteId(homeQueryPdu.getSiteId());
List<OrderCol> orderColList = new ArrayList<>();
orderColList.add(new OrderCol("searchCount", OrderCol.DESCENDING));
orderColList.add(new OrderCol("wordsSource", OrderCol.ASCENDING));
hotwordQuery.setOrderColList(orderColList);
PageInfo pageInfo = new PageInfo();
int nums = GlobalSysInfo.getParamIntValue(Constant.PARAMS_HOTWORDS_DEFAULT_NUM, 10);
pageInfo.setPrePageResult(nums);
List<HotwordEntity> hotwordEntities = hotwordService.find(hotwordQuery, pageInfo, null).getList();
/* List<String> hotwordEntities = hotwordService.find(hotwordQuery, new PageInfo(), null).getList().stream()
.map(HotwordEntity::getHotwords) .map(HotwordEntity::getHotwords)
.flatMap(item-> StrUtil.split(item,",".charAt(0)).stream()) .flatMap(item -> StrUtil.split(item, ",".charAt(0)).stream())
.collect(Collectors.toList()); .collect(Collectors.toList());*/
model.put("hotWords", hotwordEntities); model.put("hotWords", hotwordEntities);
MatterQuery matterQuery = new MatterQuery(); MatterQuery matterQuery = new MatterQuery();
matterQuery.setSiteId(homeQueryPdu.getSiteId()); matterQuery.setSiteId(homeQueryPdu.getSiteId());
int matterCont = matterService.count(matterQuery, this.getContext()); int matterCont = matterService.count(matterQuery, this.getContext());
...@@ -179,15 +199,20 @@ public class HomeController extends BaseJsonBodyController { ...@@ -179,15 +199,20 @@ public class HomeController extends BaseJsonBodyController {
model.put("datumCont", datumCont); //入驻表单数量 model.put("datumCont", datumCont); //入驻表单数量
model.put("localPrint", 20); //本地打印数量 model.put("localPrint", 20); //本地打印数量
model.put("onlineSubmit", 20); //在线提交数量 model.put("onlineSubmit", 0); //在线提交数量
model.put("dayThrift", 66); //今日节约 model.put("dayThrift", 66); //今日节约
model.put("totalThrift", 996); //累计节约 model.put("totalThrift", 996); //累计节约
model.put("message_info", busiDesc + "成功");
Rest<com.mortals.xhx.common.pdu.site.SitePdu> info = siteFeign.info(homeQueryPdu.getSiteId()); Rest<com.mortals.xhx.common.pdu.site.SitePdu> info = siteFeign.info(homeQueryPdu.getSiteId());
model.put("title", info==null?"":info.getData().getSiteName()); //标题 model.put("title", info == null ? "" : info.getData().getSiteName()); //标题
HotwordEntity hotwordEntity = hotwordService.selectOne(new HotwordQuery().siteId(homeQueryPdu.getSiteId()));
model.put("blankCount", hotwordEntity==null?20:hotwordEntity.getPrintDisplay()); //空白样表数量 //HotwordEntity hotwordEntity = hotwordService.selectOne(hotwordQuery.siteId(homeQueryPdu.getSiteId()));
BasesetEntity basesetEntity = basesetService.selectOne(new BasesetQuery().siteId(homeQueryPdu.getSiteId()));
model.put("blankCount", basesetEntity == null ? 20 : basesetEntity.getPrintDisplay()); //空白样表数量
model.put("newsSource", basesetEntity == null ? 1 : basesetEntity.getNewsSource()); //新闻来源
model.put("message_info", busiDesc + "成功");
// this.addDict(model, "newsSource", NewsSourceEnum.getEnumMap());
this.recordSysLog(this.request, busiDesc + " 【成功】"); this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) { } catch (Exception var9) {
code = VALUE_RESULT_FAILURE; code = VALUE_RESULT_FAILURE;
......
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