Commit 1c7a301e by fudahua

Merge branch 'feature-daiban-12-14' into developer

# Conflicts:
#	haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
#	haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/NotifyController.java
parents f14acd83 b63e78b6
......@@ -12,6 +12,7 @@ public class NoticeMessageQDTO implements Serializable {
private String enterpriseId;
private String clerkId;
private String storeId;
private String optTargetId;
private int messageType;
private String templateCode;
private Map<String, String> contentMap;
......@@ -20,6 +21,14 @@ public class NoticeMessageQDTO implements Serializable {
*/
private Map<String, Object> extendContent;
public String getOptTargetId() {
return optTargetId;
}
public void setOptTargetId(String optTargetId) {
this.optTargetId = optTargetId;
}
public Map<String, Object> getExtendContent() {
return extendContent;
}
......
......@@ -53,4 +53,13 @@ public enum NoticeMessageTypeEnum {
public void setCategory(int category) {
this.category = category;
}
public static NoticeMessageTypeEnum getByType(int type) {
for (NoticeMessageTypeEnum messageTypeEnum : values()) {
if (messageTypeEnum.getType() == type) {
return messageTypeEnum;
}
}
return null;
}
}
package com.gic.haoban.manage.service.dao.mapper;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.service.entity.TabPendingTask;
import com.gic.haoban.manage.service.pojo.BO.PendingTaskBO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......
package com.gic.haoban.manage.service.pojo.BO;
package com.gic.haoban.manage.service.pojo.bo;
import java.io.Serializable;
import java.util.Date;
......
package com.gic.haoban.manage.service.pojo.BO;
package com.gic.haoban.manage.service.pojo.bo;
import java.io.Serializable;
import java.util.Date;
......
package com.gic.haoban.manage.service.pojo.DO;
package com.gic.haoban.manage.service.pojo.entitydo;
import java.io.Serializable;
import java.util.Date;
......
package com.gic.haoban.manage.service.pojo.DO;
package com.gic.haoban.manage.service.pojo.entitydo;
import java.io.Serializable;
import java.util.Date;
......
package com.gic.haoban.manage.service.service.notify;
import com.gic.haoban.manage.service.pojo.BO.PendingTaskBO;
import com.gic.haoban.manage.service.pojo.bo.NoticeMessageBO;
import com.gic.haoban.manage.service.pojo.bo.PendingTaskBO;
/**
* Created 2021/12/15.
......@@ -12,10 +13,10 @@ public interface NoticeMessageService {
/**
* 新增或创建消息
*
* @param pendingTask
* @param messageBO
* @return
*/
public boolean addOrCreateNoticeMessage(PendingTaskBO pendingTask);
public boolean addOrCreateNoticeMessage(NoticeMessageBO messageBO);
}
......@@ -2,7 +2,7 @@ package com.gic.haoban.manage.service.service.notify;
import com.gic.api.base.commons.BasePageInfo;
import com.gic.api.base.commons.Page;
import com.gic.haoban.manage.service.pojo.BO.PendingTaskBO;
import com.gic.haoban.manage.service.pojo.bo.PendingTaskBO;
import java.util.List;
......
package com.gic.haoban.manage.service.service.notify.impl;
import com.gic.commons.util.UniqueIdUtils;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.manage.service.dao.mapper.NoticeMessageMapper;
import com.gic.haoban.manage.service.entity.TabNoticeMessage;
import com.gic.haoban.manage.service.pojo.bo.NoticeMessageBO;
import com.gic.haoban.manage.service.pojo.bo.PendingTaskBO;
import com.gic.haoban.manage.service.service.notify.NoticeMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
/**
* Created 2021/12/17.
*
* @author hua
*/
@Service
public class NoticeMessageServiceImpl implements NoticeMessageService {
@Autowired
private NoticeMessageMapper noticeMessageMapper;
@Override
public boolean addOrCreateNoticeMessage(NoticeMessageBO messageBO) {
TabNoticeMessage tabNoticeMessage = EntityUtil.changeEntityByOrika(TabNoticeMessage.class, messageBO);
tabNoticeMessage.setUpdateTime(new Date());
if (tabNoticeMessage.getNoticeMessageId() == null) {
tabNoticeMessage.setCreateTime(new Date());
tabNoticeMessage.setNoticeMessageId(UniqueIdUtils.uniqueLong());
noticeMessageMapper.insertSelective(tabNoticeMessage);
return true;
}
noticeMessageMapper.updateByPrimaryKeySelective(tabNoticeMessage);
return true;
}
}
......@@ -6,7 +6,7 @@ import com.gic.commons.util.PageHelperUtils;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.manage.service.dao.mapper.PendingTaskMapper;
import com.gic.haoban.manage.service.entity.TabPendingTask;
import com.gic.haoban.manage.service.pojo.BO.PendingTaskBO;
import com.gic.haoban.manage.service.pojo.bo.PendingTaskBO;
import com.gic.haoban.manage.service.service.notify.PendingTaskService;
import com.github.pagehelper.PageHelper;
import org.apache.commons.collections.CollectionUtils;
......
package com.gic.haoban.manage.service.service.notify.out;
import com.alibaba.fastjson.JSONObject;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.haoban.manage.api.dto.notify.qdto.NoticeMessageQDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.haoban.manage.api.service.notify.NoticeMessageApiService;
import com.gic.haoban.manage.service.pojo.bo.NoticeMessageBO;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import static org.slf4j.LoggerFactory.getLogger;
......@@ -16,8 +23,18 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
private static final Logger logger = getLogger(NoticeMessageApiServiceImpl.class);
@Autowired
private ClerkService clerkService;
@Override
public void noticeMessageMq(String json) {
logger.info("Notice message");
logger.info("通知消息:{}", json);
NoticeMessageQDTO messageQDTO = JSONObject.parseObject(json, NoticeMessageQDTO.class);
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(messageQDTO.getClerkId());
NoticeMessageBO noticeMessageBO = new NoticeMessageBO();
noticeMessageBO.setCategoryType(NoticeMessageTypeEnum.getByType(messageQDTO.getMessageType()).getType());
noticeMessageBO.setMessageType(messageQDTO.getMessageType());
noticeMessageBO.setClerkId(messageQDTO.getClerkId());
}
}
......@@ -5,14 +5,13 @@ import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.PageHelperUtils;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.manage.api.dto.notify.dto.PendingTaskDTO;
import com.gic.haoban.manage.api.dto.notify.dto.PendingTaskDetailDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.PendingListQDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.PendingTaskQDTO;
import com.gic.haoban.manage.api.enums.PendingStatusFlagEnum;
import com.gic.haoban.manage.api.enums.PendingTaskTypeEnum;
import com.gic.haoban.manage.api.service.notify.PendingTaskApiService;
import com.gic.haoban.manage.service.pojo.BO.PendingTaskBO;
import com.gic.haoban.manage.service.pojo.bo.PendingTaskBO;
import com.gic.haoban.manage.service.service.notify.PendingTaskService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.time.DateFormatUtils;
......
......@@ -690,28 +690,28 @@ public class ClerkController extends WebBaseController {
StaffDTO staffDTO = staffApiService.selectById(staffId);
if (staffDTO != null) {
List<ClerkDTO> clerkList = clerkNewService.listClerkByEnterpriseIdAndSearch(enterpriseIdList, storeIdList, staffDTO.getPhoneNumber());
if (CollectionUtils.isNotEmpty(clerkList)) {
ret.addAll(clerkList);
if (CollectionUtils.isNotEmpty(clerkList)) {
ret.addAll(clerkList);
}
}
List<StaffClerkInfoDTO> staffClerkInfoDTOS = staffClerkRelationApiService.listBindDetailByStaffId(staffId);
if (CollectionUtils.isNotEmpty(staffClerkInfoDTOS)) {
return ret;
if (CollectionUtils.isNotEmpty(staffClerkInfoDTOS)) {
return ret;
}
Set<String> clerkIds = staffClerkInfoDTOS.stream().map(mid -> mid.getClerkId()).collect(Collectors.toSet());
List<ClerkDTO> clerkDTOS = clerkService.getClerkByClerkIds(clerkIds);
for (ClerkDTO clerkDTO : clerkDTOS) {
List<ClerkDTO> clerkList = clerkNewService.listClerkByEnterpriseIdAndSearch(enterpriseIdList, storeIdList, clerkDTO.getPhoneNumber());
if (CollectionUtils.isNotEmpty(clerkList)) {
ret.addAll(clerkList);
if (CollectionUtils.isNotEmpty(clerkList)) {
ret.addAll(clerkList);
}
}
} else {
List<ClerkDTO> clerkList = clerkNewService.listClerkByEnterpriseIdAndSearch(enterpriseIdList, storeIdList, search);
if (CollectionUtils.isNotEmpty(clerkList)) {
ret.addAll(clerkList);
if (CollectionUtils.isNotEmpty(clerkList)) {
ret.addAll(clerkList);
}
}
return ret;
......
......@@ -2,19 +2,16 @@ package com.gic.haoban.manage.web.controller;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.StaffClerkRelationDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.notify.dto.PendingTaskDetailDTO;
import com.gic.haoban.manage.api.dto.notify.qdto.PendingListQDTO;
import com.gic.haoban.manage.api.enums.PendingTaskTypeEnum;
import com.gic.haoban.manage.api.service.notify.PendingTaskApiService;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.CommonQO;
import com.gic.haoban.manage.web.qo.PendingListQO;
import org.apache.commons.lang3.StringUtils;
import com.gic.haoban.manage.web.vo.notify.PairValVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
......@@ -22,9 +19,9 @@ import org.springframework.web.bind.annotation.RestController;
import javax.validation.Valid;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* Created 2021/12/16.
......@@ -67,4 +64,41 @@ public class NotifyController extends WebBaseController {
}
/**
* 今日待办列表 最多20条
*
* @return
*/
@RequestMapping("/commission/filter-info")
public HaobanResponse filterInfo(@RequestBody @Valid CommonQO qo) {
Map<String, Object> ret = new HashMap<String, Object>();
List<PairValVO> taskTypes = new ArrayList<PairValVO>();
List<PairValVO> filter = new ArrayList<PairValVO>();
PendingTaskTypeEnum[] values = PendingTaskTypeEnum.values();
for (PendingTaskTypeEnum val : values) {
PairValVO vo = new PairValVO();
vo.setKey(String.valueOf(val.getType()));
vo.setName(val.getName());
taskTypes.add(vo);
}
{
PairValVO vo = new PairValVO();
vo.setKey("0");
vo.setName("未完成");
filter.add(vo);
}
{
PairValVO vo = new PairValVO();
vo.setKey("1");
vo.setName("已逾期");
filter.add(vo);
}
ret.put("taskTypes", taskTypes);
ret.put("filter", filter);
return resultResponse(HaoBanErrCode.ERR_1, ret);
}
}
package com.gic.haoban.manage.web.vo.notify;
import java.io.Serializable;
/**
* Created 2021/12/17.
*
* @author hua
*/
public class PairValVO implements Serializable {
private String key;
private String name;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
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