diff --git a/com/api/aiyh_pcn/patentWall/service/PatentWallService.java b/com/api/aiyh_pcn/patentWall/service/PatentWallService.java index 2e6caea..5207d2b 100644 --- a/com/api/aiyh_pcn/patentWall/service/PatentWallService.java +++ b/com/api/aiyh_pcn/patentWall/service/PatentWallService.java @@ -298,6 +298,26 @@ public class PatentWallService { args.add(filterWhere.getValue()); continue; } + if (filterWhere.getSearchType() == 7) { +// 日期等于 + whereBuilder.append(" DATE_FORMAT(") + .append(filterWhere.getDbField()) + .append(",'%y-%m-%d') = ") + .append("DATE_FORMAT(?,'%y-%m-%d')"); + args.add(filterWhere.getValue()); + continue; + } + if (filterWhere.getSearchType() == 8) { +// 日期范围 + whereBuilder.append(" DATE_FORMAT(") + .append(filterWhere.getDbField()) + .append(",'%y-%m-%d') between ") + .append("DATE_FORMAT(?,'%y-%m-%d')") + .append(" and DATE_FORMAT(?,'%y-%m-%d')"); + args.add(filterWhere.getValue().split("&")[0]); + args.add(filterWhere.getValue().split("&")[1]); + continue; + } } return patentWallMapping.getListByFilterWhere(whereBuilder, args, tableName); } diff --git a/customization/test/NewUtilTest.java b/customization/test/NewUtilTest.java index 6ba52e6..435002b 100644 --- a/customization/test/NewUtilTest.java +++ b/customization/test/NewUtilTest.java @@ -2,11 +2,13 @@ package customization.test; import aiyh.utils.Util; import aiyh.utils.fileUtil.ProperUtil; -import cn.hutool.core.util.URLUtil; import com.alibaba.fastjson.JSON; import com.api.aiyh_pcn.patentWall.service.PatentWallService; import com.api.aiyh_pcn.patentWall.vo.PatentVO; import com.api.aiyh_pcn.patentWall.vo.SearchInputVO; +import com.cloudstore.dev.api.bean.MessageBean; +import com.cloudstore.dev.api.bean.MessageType; +import com.cloudstore.dev.api.util.Util_Message; import org.junit.AfterClass; import org.junit.Before; import org.junit.Test; @@ -15,7 +17,6 @@ import weaver.general.GCONST; import java.io.*; import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -339,7 +340,7 @@ public class NewUtilTest { @Test - public void testSplic(){ + public void testSplic() { List list = new ArrayList<>(); list.add(0); list.add(1); @@ -349,8 +350,8 @@ public class NewUtilTest { list.add(5); list.add(6); System.out.println(list); - System.out.println(list.subList(0,2)); - list.removeAll(list.subList(0,2)); + System.out.println(list.subList(0, 2)); + list.removeAll(list.subList(0, 2)); System.out.println(list); } @@ -363,7 +364,7 @@ public class NewUtilTest { @Test - public void testReg(){ + public void testReg() { String var15 = " \n" + " \n" + " \n" + @@ -384,4 +385,27 @@ public class NewUtilTest { System.out.println(var17.size()); System.out.println(var17); } + + + @Test + public void testMessage() { + MessageType messageType = MessageType.newInstance(1146); //消息来源(见文档第四点补充) + Set userIdList = new HashSet<>(); //接收人id + userIdList.add("22"); + userIdList.add("23"); + userIdList.add("24"); + String title = "标题"; //标题 + String context = "内容"; //内容 + String linkUrl = ""; //PC端链接 纯文本就传空字符串 + String linkMobileUrl = ""; //移动端链接 纯文本就传空字符串 + try { + MessageBean messageBean = Util_Message.createMessage(messageType, userIdList, title, context, linkUrl, linkMobileUrl); + messageBean.setCreater(1);//创建人id +//message.setBizState("0");需要修改消息状态时传入,表示消息最初状态为待处理 + // messageBean.setTargetId("121|22"); //消息来源code +“|”+业务id 需要修改消息状态时传入,这个字段是自定义的,和修改消息状态的时候传入相同的值,可做更新。 + Util_Message.store(messageBean); + } catch (IOException e) { + e.printStackTrace(); + } + } }