Commit 1d46510a authored by chenzhao's avatar chenzhao

Merge branch 'develop_dl_plan6_temp' of…

Merge branch 'develop_dl_plan6_temp' of http://39.98.45.134:8090/moa/amos-boot-biz into develop_dl_plan6_temp # Conflicts: # amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/controller/InputItemController.java
parents c5b79747 2659fb20
...@@ -111,6 +111,36 @@ public class Msg extends BasicEntity{ ...@@ -111,6 +111,36 @@ public class Msg extends BasicEntity{
@Column(name="create_by") @Column(name="create_by")
private Long createBy; private Long createBy;
//单位code
@Column(name = "biz_org_code")
private String bizOrgCode;
public String getBizOrgCode() {
return bizOrgCode;
}
public void setBizOrgCode(String bizOrgCode) {
this.bizOrgCode = bizOrgCode;
}
public String getBizOrgName() {
return bizOrgName;
}
public void setBizOrgName(String bizOrgName) {
this.bizOrgName = bizOrgName;
}
//单位名称
@Column(name = "biz_org_name")
private String bizOrgName;
public String getTitle() { public String getTitle() {
return title; return title;
} }
......
...@@ -436,24 +436,5 @@ public class InputItemController extends AbstractBaseController { ...@@ -436,24 +436,5 @@ public class InputItemController extends AbstractBaseController {
} }
} }
/*******新增接口************/
/**
* 查询巡检项详情
*
* @param itemID
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "检查项ID新", notes = "检查项详情新")
@RequestMapping(value = "/queryItemNew", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
public CommonResponse queryItemDetailNew(@ApiParam(value = "巡检项ID") @RequestParam(required = true) Long itemID) {
InputItem bo = inputItemService.queryInputItemDetail(itemID);
InputItemParam inputItemVo = new InputItemParam();
BeanUtils.copyProperties(bo,inputItemVo);
inputItemVo.setDataJson(bo.getDataJson() != null?JSONObject.parse(bo.getDataJson()):null);
inputItemVo.setPictureJson(bo.getPictureJson()!=null?JSONObject.parse(bo.getPictureJson()):null);
return CommonResponseUtil.success(inputItemVo);
}
/*******新增接口************/
} }
...@@ -85,6 +85,102 @@ public class MsgController extends AbstractBaseController { ...@@ -85,6 +85,102 @@ public class MsgController extends AbstractBaseController {
/*@Autowired /*@Autowired
private IUserService iUserService; private IUserService iUserService;
*/ */
/**
* 新接口
*
* **/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据条件获取消息列表", notes = "APP 根据条件获取消息列表")
@PostMapping(value = "/listNew", produces = "application/json;charset=UTF-8")
public CommonResponse querylistNew(
@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) {
log.error(e.getMessage(),e);
return CommonResponseUtil.failure("件获取消息列表失败");
}
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "通知发布", notes = "通知发布")
@PostMapping(value = "/noticePublishNew", produces = "application/json;charset=UTF-8")
public CommonResponse noticePublishNew(@ApiParam(value = "通知信息", required = true) @RequestBody NoticePublishParam msg) {
try {
AgencyUserModel user = getUserInfo();
msg.setCreateBy(user.getUserId());
ReginParams reginParams = getSelectedOrgInfo();
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);
});
return CommonResponseUtil.success();
} catch (Exception e) {
return CommonResponseUtil.failure("通知发布失败!");
}
}
@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("获取消息类型失败");
}
}
/**
* 新接口
*
* **/
/** /**
* 获取用户当前所选择公司的消息订阅信息 * 获取用户当前所选择公司的消息订阅信息
...@@ -358,7 +454,7 @@ public class MsgController extends AbstractBaseController { ...@@ -358,7 +454,7 @@ public class MsgController extends AbstractBaseController {
* @param commonPageable * @param commonPageable
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "根据条件获取消息列表", notes = "APP 根据条件获取消息列表") @ApiOperation(value = "根据条件获取消息列表", notes = "APP 根据条件获取消息列表")
@PostMapping(value = "/list", produces = "application/json;charset=UTF-8") @PostMapping(value = "/list", produces = "application/json;charset=UTF-8")
public CommonResponse querylist( public CommonResponse querylist(
...@@ -404,7 +500,7 @@ public class MsgController extends AbstractBaseController { ...@@ -404,7 +500,7 @@ public class MsgController extends AbstractBaseController {
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "通知发布", notes = "通知发布") @ApiOperation(value = "通知发布", notes = "通知发布")
@PostMapping(value = "/noticePublish", produces = "application/json;charset=UTF-8") @PostMapping(value = "/noticePublish", produces = "application/json;charset=UTF-8")
public CommonResponse noticePublish(@ApiParam(value = "通知信息", required = true) @RequestBody NoticePublishParam msg) { public CommonResponse noticePublish(@ApiParam(value = "通知信息", required = true) @RequestBody NoticePublishParam msg) {
......
...@@ -35,6 +35,30 @@ public class MsgInfoPageParam extends CommonPageable{ ...@@ -35,6 +35,30 @@ public class MsgInfoPageParam extends CommonPageable{
*/ */
private String userId; private String userId;
/**
* biz_org_code
*/
private String bizOrgCode;
private String bizOrgName;
public String getBizOrgName() {
return bizOrgName;
}
public void setBizOrgName(String bizOrgName) {
this.bizOrgName = bizOrgName;
}
public String getBizOrgCode() {
return bizOrgCode;
}
public void setBizOrgCode(String bizOrgCode) {
this.bizOrgCode = bizOrgCode;
}
public String getUserId() { public String getUserId() {
return userId; return userId;
} }
......
...@@ -2,6 +2,8 @@ package com.yeejoin.amos.patrol.business.vo; ...@@ -2,6 +2,8 @@ package com.yeejoin.amos.patrol.business.vo;
import java.util.Date; import java.util.Date;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yeejoin.amos.patrol.common.enums.MsgTypeEnum; import com.yeejoin.amos.patrol.common.enums.MsgTypeEnum;
public class MsgVo { public class MsgVo {
...@@ -29,6 +31,7 @@ public class MsgVo { ...@@ -29,6 +31,7 @@ public class MsgVo {
/** /**
* 发送时间 * 发送时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date sendTime; private Date sendTime;
/** /**
...@@ -39,6 +42,7 @@ public class MsgVo { ...@@ -39,6 +42,7 @@ public class MsgVo {
/** /**
* 定点发送时间 * 定点发送时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date fixedTime; private Date fixedTime;
public long getId() { public long getId() {
......
...@@ -209,10 +209,12 @@ ...@@ -209,10 +209,12 @@
<where> <where>
<if test="orgCode!=null"> and (org_Code like concat (#{orgCode},"-%")or org_Code= #{orgCode})</if> <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="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="msgType != null">AND m.msg_type = #{msgType}</if>
<if test="beginDate != null">AND m.create_date <![CDATA[>=]]> #{beginDate}</if> <if test="beginDate != null and beginDate != '' ">AND m.create_date <![CDATA[>=]]> #{beginDate}</if>
<if test="endDate != null">AND m.create_date <![CDATA[<=]]> #{endDate}</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> </where>
</select> </select>
...@@ -235,10 +237,11 @@ ...@@ -235,10 +237,11 @@
<where> <where>
<if test="orgCode!=null"> and (org_Code like concat (#{orgCode},"-%")or org_Code= #{orgCode})</if> <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="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="msgType != null">AND m.msg_type = #{msgType}</if>
<if test="beginDate != null">AND m.create_date <![CDATA[>=]]> #{beginDate}</if> <if test="beginDate != null and beginDate != '' ">AND m.create_date <![CDATA[>=]]> #{beginDate}</if>
<if test="endDate != null">AND m.create_date <![CDATA[<=]]> #{endDate}</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> </where>
ORDER BY m.id DESC ORDER BY m.id DESC
<choose> <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