Commit 2659fb20 authored by tangwei's avatar tangwei

新增接口

parent a7b57110
......@@ -98,7 +98,13 @@ public class MsgController extends AbstractBaseController {
@ApiParam(value = "查询条件", required = false) @RequestBody(required = false) MsgInfoPageParam param,
@ApiParam(value = "分页参数", required = true, defaultValue = "pageNumber=0&pageSize=10") CommonPageable commonPageable) {
try {
// ReginParams reginParams = getSelectedOrgInfo();
// String loginOrgCode = getOrgCode(reginParams);
// String roleTypeName = getRoleTypeName(reginParams);
// HashMap<String, Object> paramMap = buildMybatisCriterias(loginOrgCode, roleTypeName);
// if(XJConstant.ROLE_NAME_DEPTADMIN.equals(roleTypeName)||XJConstant.ROLE_NAME_PERSON.equals(roleTypeName))
// paramMap.put("userId",getUserId());
// MsgInfoPageParam param = MsgParamUtils.fillMsgInfoParam(queryRequests, commonPageable, paramMap);
Page<MsgVo> dataList = iMsgService.queryMsgInfoList(param);
return CommonResponseUtil.success(dataList);
} catch (Exception e) {
......@@ -120,6 +126,9 @@ public class MsgController extends AbstractBaseController {
msg.setUserName(user.getRealName());
String loginOrgCode = getOrgCode(reginParams);
msg.setOrgCode(loginOrgCode);
List<Msg> msgList = iMsgService.publishNotice(getToken(),getProduct(),getAppKey(),msg);
msgList.forEach(m->{
jobService.msgAddJob(m);
......@@ -133,6 +142,30 @@ public class MsgController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value="APP获取消息类型", notes="APP获取消息类型")
@GetMapping(value="/MsgTypeNew",produces = "application/json;charset=UTF-8")
public CommonResponse getMsgTypeNew() {
try {
List<Map<String,String>> list = new ArrayList<>();
for(MsgTypeEnum e : MsgTypeEnum.values()) {
Map<String,String> msgType = new HashMap<>();
msgType.put("name",e.getName());
msgType.put("value",e.getCode());
list.add(msgType);
}
return CommonResponseUtil.success(list);
} catch (Exception e) {
return CommonResponseUtil.failure("获取消息类型失败");
}
}
/**
* 新接口
*
......
......@@ -2,6 +2,8 @@ package com.yeejoin.amos.patrol.business.vo;
import java.util.Date;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.patrol.common.enums.MsgTypeEnum;
public class MsgVo {
......@@ -29,6 +31,7 @@ public class MsgVo {
/**
* 发送时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date sendTime;
/**
......@@ -39,6 +42,7 @@ public class MsgVo {
/**
* 定点发送时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date fixedTime;
public long getId() {
......
......@@ -209,11 +209,11 @@
<where>
<if test="orgCode!=null"> and (org_Code like concat (#{orgCode},"-%")or org_Code= #{orgCode})</if>
<if test="userId != null">AND m.user_id = #{userId}</if>
<if test="userName != null">AND m.`reciver_name` LIKE concat('%', #{userName}, '%')</if>
<if test="userName != null and userName != '' ">AND m.`reciver_name` LIKE concat('%', #{userName}, '%')</if>
<if test="msgType != null">AND m.msg_type = #{msgType}</if>
<if test="beginDate != null">AND m.create_date <![CDATA[>=]]> #{beginDate}</if>
<if test="endDate != null">AND m.create_date <![CDATA[<=]]> #{endDate}</if>
<if test="bizOrgCode != null">AND m.biz_org_code = #{bizOrgCode}</if>
<if test="beginDate != null and beginDate != '' ">AND m.create_date <![CDATA[>=]]> #{beginDate}</if>
<if test="endDate != null and endDate != '' ">AND m.create_date <![CDATA[<=]]> #{endDate}</if>
<if test="bizOrgCode != null and bizOrgCode != '' ">AND m.biz_org_code = #{bizOrgCode}</if>
</where>
</select>
......@@ -237,11 +237,11 @@
<where>
<if test="orgCode!=null"> and (org_Code like concat (#{orgCode},"-%")or org_Code= #{orgCode})</if>
<if test="userId != null">AND m.user_id = #{userId}</if>
<if test="userName != null">AND m.`reciver_name` LIKE concat('%', #{userName}, '%')</if>
<if test="userName != null and userName != '' ">AND m.`reciver_name` LIKE concat('%', #{userName}, '%')</if>
<if test="msgType != null">AND m.msg_type = #{msgType}</if>
<if test="beginDate != null">AND m.create_date <![CDATA[>=]]> #{beginDate}</if>
<if test="endDate != null">AND m.create_date <![CDATA[<=]]> #{endDate}</if>
<if test="bizOrgCode != null">AND m.biz_org_code = #{bizOrgCode}</if>
<if test="beginDate != null and beginDate != '' ">AND m.create_date <![CDATA[>=]]> #{beginDate}</if>
<if test="endDate != null and endDate != '' ">AND m.create_date <![CDATA[<=]]> #{endDate}</if>
<if test="bizOrgCode != null and bizOrgCode != '' ">AND m.biz_org_code = #{bizOrgCode}</if>
</where>
ORDER BY m.id DESC
<choose>
......
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