Commit f5f46dc1 authored by duanruiming's avatar duanruiming

[add] 绿波诱导查询30天内的历史;

parent 681a0346
......@@ -10,10 +10,12 @@ import net.wanji.common.framework.i18n.I18nResourceBundle;
import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.common.framework.rest.Page;
import net.wanji.common.framework.rest.ValidationGroups;
import net.wanji.common.utils.tool.DateUtil;
import net.wanji.common.utils.tool.StringUtils;
import net.wanji.opt.dto.induce.InduceDTO;
import net.wanji.opt.entity.InduceHist;
import net.wanji.opt.service.induce.InduceHistService;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
......@@ -79,8 +81,19 @@ public class InduceHistController {
// Map params = JSONObject.parseObject(JSONObject.toJSONString(InduceHist), Map.class);
Map<String, Object> params = new HashMap<>();
JSONObject.parseObject(JSONObject.toJSONString(induceHist), Map.class).forEach((k,v) -> params.put(StringUtils.camelToCapital(k.toString()).toLowerCase(), v));
List list = this.induceHistService.listByMap(params);
jsonView.success(list);
List<InduceHist> list = this.induceHistService.listByMap(params);
List<InduceHist> result = new ArrayList<>();
if (!CollectionUtils.isEmpty(list)) {
for (InduceHist hist : list) {
Date createTime = hist.getCreateTime();
Date date = DateUtil.addDay(DateUtil.StringToDate(new Date()), -30);
if (createTime.before(date)) {
continue;
}
result.add(hist);
}
}
jsonView.success(result);
} catch (Exception e) {
jsonView.fail(I18nResourceBundle.getConstants("GET_FAILED_MSG"));
log.error("{} getByWhere error,jsonStr:{}", this.getClass().getSimpleName(), jsonStr, e);
......
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