Commit d0bc77c5 by 徐高华

Merge branch 'master-xgh-好办停用' into 'developer'

Master xgh 好办停用

See merge request !230
parents 936ad273 6d5b7de5
...@@ -81,15 +81,4 @@ public interface StaffDepartmentRelatedApiService { ...@@ -81,15 +81,4 @@ public interface StaffDepartmentRelatedApiService {
*/ */
void sendBindAuditMessage(String auditId, String staffId, String clerkId, String reason, boolean isRefuse); void sendBindAuditMessage(String auditId, String staffId, String clerkId, String reason, boolean isRefuse);
/**
* 新增导购
*
* @param auditId
* @param staffId
* @param clerkId
* @param reason
* @param isRefuse
*/
void sendClerkAddAuditMessage(String auditId, String staffId, String clerkId, String reason, boolean isRefuse);
} }
...@@ -22,6 +22,8 @@ public interface PendingTaskApiService { ...@@ -22,6 +22,8 @@ public interface PendingTaskApiService {
* @param qdto * @param qdto
*/ */
public ServiceResponse<Boolean> addPendingTask(PendingTaskQDTO qdto); public ServiceResponse<Boolean> addPendingTask(PendingTaskQDTO qdto);
public ServiceResponse<Boolean> insertPendingTaskBatch(List<PendingTaskQDTO> qdto);
/** /**
......
...@@ -5,12 +5,9 @@ import com.gic.commons.util.GICMQClientUtil; ...@@ -5,12 +5,9 @@ import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.manage.api.dto.notify.qdto.NoticeMessageQDTO; import com.gic.haoban.manage.api.dto.notify.qdto.NoticeMessageQDTO;
import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum; import com.gic.haoban.manage.api.enums.NoticeMessageTypeEnum;
import com.gic.mq.sdk.GicMQClient; import com.gic.mq.sdk.GicMQClient;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import java.util.ArrayList;
import java.util.List;
import java.util.Map; import java.util.Map;
import static org.slf4j.LoggerFactory.getLogger; import static org.slf4j.LoggerFactory.getLogger;
...@@ -55,54 +52,13 @@ public class NoticeMessageUtil { ...@@ -55,54 +52,13 @@ public class NoticeMessageUtil {
logger.info("发送消息:{}", ret); logger.info("发送消息:{}", ret);
GicMQClient clientInstance = GICMQClientUtil.getClientInstance(); GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try { try {
// com.gic.haoban.manage.api.service.notify.NoticeMessageApiService.run
clientInstance.sendMessage(NOTICE_MESSAGE, ret); clientInstance.sendMessage(NOTICE_MESSAGE, ret);
} catch (Exception e) { } catch (Exception e) {
logger.info("发送消息异常:{}", e); logger.info("发送消息异常:{}", e);
} }
} }
/**
* 发送消息 对象里面的字段 解析
* enterpriseId 企业id
* clerkId 执行人导购
* messageType 消息类型 NoticeMessageTypeEnum
* optTargetId 操作对象
* fieldMap 解析模板的字段
* extendField 拓展字段给前端使用 没有可以为null
* @param list
*/
public static void sendNoticeMessageBatch(List<NoticeMessageQDTO> list) {
if (CollectionUtils.isEmpty(list)) {
logger.info("没有哦需要发送的消息");
return;
}
List<String> ret = new ArrayList<String>();
for (NoticeMessageQDTO noticeMessageQDTO : list) {
String retStr = JSONObject.toJSONString(noticeMessageQDTO);
if (StringUtils.isAnyBlank(noticeMessageQDTO.getEnterpriseId(), noticeMessageQDTO.getClerkId())) {
logger.info("参数不存在:{}", retStr);
throw new RuntimeException("必传参数没传:" + noticeMessageQDTO.getClerkId());
}
NoticeMessageTypeEnum messageTypeEnum = NoticeMessageTypeEnum.getByType(noticeMessageQDTO.getMessageType());
if (messageTypeEnum == null) {
logger.info("类型不存在:{}", retStr);
throw new RuntimeException("消息类型不存在");
}
ret.add(retStr);
logger.info("发送消息单条:{}", retStr);
}
logger.info("批量发送消息:{}", ret.size());
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
clientInstance.sendBatchMessages(NOTICE_MESSAGE, ret);
} catch (Exception e) {
logger.info("发送消息异常:{}", e);
}
}
/** /**
* 发送消息 使用staffId发送 * 发送消息 使用staffId发送
* *
......
...@@ -10,31 +10,20 @@ import java.util.Set; ...@@ -10,31 +10,20 @@ import java.util.Set;
@Mapper @Mapper
public interface PendingTaskMapper { public interface PendingTaskMapper {
/**
*/
int deleteByPrimaryKey(Integer id);
/** /**
*/ */
int insert(TabPendingTask record); int insert(TabPendingTask record);
/** /**
*/ */
int insertSelective(TabPendingTask record); int insertSelective(TabPendingTask record);
/** /**
*/ */
TabPendingTask selectByPrimaryKey(Integer id);
/**
*/
int updateByPrimaryKeySelective(TabPendingTask record); int updateByPrimaryKeySelective(TabPendingTask record);
/** /**
*/
int updateByPrimaryKey(TabPendingTask record);
/**
* 根据关联id 查询单条 * 根据关联id 查询单条
*/ */
TabPendingTask getByRelationId(String relationId); TabPendingTask getByRelationId(String relationId);
......
...@@ -95,5 +95,7 @@ public interface PendingTaskService { ...@@ -95,5 +95,7 @@ public interface PendingTaskService {
*/ */
public boolean changeByRelationId(PendingTaskBO task); public boolean changeByRelationId(PendingTaskBO task);
public void insertPendingTaskBatch(List<PendingTaskBO> list);
} }
...@@ -142,4 +142,26 @@ public class PendingTaskServiceImpl implements PendingTaskService { ...@@ -142,4 +142,26 @@ public class PendingTaskServiceImpl implements PendingTaskService {
pendingTaskMapper.updateByPrimaryKeySelective(tabPendingTask); pendingTaskMapper.updateByPrimaryKeySelective(tabPendingTask);
return true; return true;
} }
@Override
public void insertPendingTaskBatch(List<PendingTaskBO> tasks) {
if (CollectionUtils.isEmpty(tasks)) {
return ;
}
List<TabPendingTask> pendingTasks = EntityUtil.changeEntityListByJSON(TabPendingTask.class, tasks);
if(pendingTasks.size()>1000) {
int size=1000;
int len = pendingTasks.size();
int yu = len % size;
int nu = len / size+(yu>0?1:0);
for (int i=0;i<nu;i++) {
int start=i*size;
int end=(start+size)>len?(start+yu):(start+size);
List<TabPendingTask> midTask = pendingTasks.subList(start, end);
pendingTaskMapper.insertBatch(midTask);
}
}else {
pendingTaskMapper.insertBatch(pendingTasks);
}
}
} }
...@@ -55,6 +55,16 @@ public class PendingTaskApiServiceImpl implements PendingTaskApiService { ...@@ -55,6 +55,16 @@ public class PendingTaskApiServiceImpl implements PendingTaskApiService {
pendingTaskService.addOrUpdateBatchPendingTask(list); pendingTaskService.addOrUpdateBatchPendingTask(list);
return ServiceResponse.success(true); return ServiceResponse.success(true);
} }
@Override
public ServiceResponse<Boolean> insertPendingTaskBatch(List<PendingTaskQDTO> qdto) {
if (CollectionUtils.isEmpty(qdto)) {
return ServiceResponse.success(true);
}
List<PendingTaskBO> list = EntityUtil.changeEntityListByJSON(PendingTaskBO.class, qdto);
pendingTaskService.insertPendingTaskBatch(list);
return ServiceResponse.success(true);
}
@Override @Override
public ServiceResponse<Page<PendingTaskDetailDTO>> pagePendingTask(PendingListQDTO listQDTO, BasePageInfo pageInfo) { public ServiceResponse<Page<PendingTaskDetailDTO>> pagePendingTask(PendingListQDTO listQDTO, BasePageInfo pageInfo) {
......
...@@ -16,7 +16,6 @@ import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil; ...@@ -16,7 +16,6 @@ import com.gic.haoban.manage.api.util.notify.NoticeMessageUtil;
import com.gic.haoban.manage.service.config.Config; import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper; import com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper;
import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper; import com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper;
import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation; import com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated; import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService; import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
...@@ -49,8 +48,6 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -49,8 +48,6 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
@Autowired @Autowired
private QywxSuiteApiService qywxSuiteApiService; private QywxSuiteApiService qywxSuiteApiService;
@Autowired @Autowired
private WxEnterpriseMapper wxEnterpriseMapper;
@Autowired
private Config config; private Config config;
@Autowired @Autowired
private TabHaobanStaffClerkRelationMapper tabHaobanStaffClerkRelationMapper; private TabHaobanStaffClerkRelationMapper tabHaobanStaffClerkRelationMapper;
...@@ -519,27 +516,4 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -519,27 +516,4 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
} }
} }
@Override
public void sendClerkAddAuditMessage(String auditId, String staffId, String clerkId, String reason, boolean isRefuse) {
ClerkDTO clerkDTO = clerkService.getClerkByClerkId(clerkId);
if (clerkDTO == null) {
return;
}
StaffDTO staffDTO = staffApiService.selectById(staffId);
//字段
Map<String, String> params = new HashMap<String, String>();
params.put("staffName", staffDTO.getStaffName());
params.put("clerkCode", clerkDTO.getClerkCode());
params.put("reason", reason);
//参数
JSONObject jsonObject = new JSONObject();
jsonObject.put("storeId", clerkDTO.getStoreId());
//发送消息
if (isRefuse) {
NoticeMessageUtil.sendNoticeMessageByStaff(clerkDTO.getEnterpriseId(), staffId, clerkId, NoticeMessageTypeEnum.STORE_ACCOUNT_REFUSE.getType(), auditId, params, jsonObject);
} else {
NoticeMessageUtil.sendNoticeMessageByStaff(clerkDTO.getEnterpriseId(), staffId, clerkId, NoticeMessageTypeEnum.STORE_ACCOUNT_AGREE.getType(), auditId, params, jsonObject);
}
}
} }
...@@ -26,16 +26,8 @@ ...@@ -26,16 +26,8 @@
overdue_time, invalid_time, store_id, clerk_id, finish_time, finish_flag, overdue_flag, overdue_time, invalid_time, store_id, clerk_id, finish_time, finish_flag, overdue_flag,
delete_flag, create_time, update_time delete_flag, create_time, update_time
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List"/>
from tab_haoban_pending_task
where id = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from tab_haoban_pending_task
where id = #{id,jdbcType=INTEGER}
</delete>
<insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabPendingTask"> <insert id="insert" parameterType="com.gic.haoban.manage.service.entity.TabPendingTask">
insert into tab_haoban_pending_task (id, enterprise_id, relation_id, insert into tab_haoban_pending_task (id, enterprise_id, relation_id,
task_type, title, description, task_type, title, description,
...@@ -50,6 +42,7 @@ ...@@ -50,6 +42,7 @@
#{finishFlag,jdbcType=INTEGER}, #{overdueFlag,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER}, #{finishFlag,jdbcType=INTEGER}, #{overdueFlag,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}) #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert> </insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabPendingTask"> <insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabPendingTask">
insert into tab_haoban_pending_task insert into tab_haoban_pending_task
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
...@@ -222,27 +215,7 @@ ...@@ -222,27 +215,7 @@
</set> </set>
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.gic.haoban.manage.service.entity.TabPendingTask">
update tab_haoban_pending_task
set enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
relation_id = #{relationId,jdbcType=VARCHAR},
business_id = #{businessId,jdbcType=VARCHAR},
task_type = #{taskType,jdbcType=INTEGER},
title = #{title,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
task_status_flag = #{taskStatusFlag,jdbcType=INTEGER},
overdue_time = #{overdueTime,jdbcType=TIMESTAMP},
invalid_time = #{invalidTime,jdbcType=TIMESTAMP},
store_id = #{storeId,jdbcType=VARCHAR},
clerk_id = #{clerkId,jdbcType=VARCHAR},
finish_time = #{finishTime,jdbcType=TIMESTAMP},
finish_flag = #{finishFlag,jdbcType=INTEGER},
overdue_flag = #{overdueFlag,jdbcType=INTEGER},
delete_flag = #{deleteFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
where id = #{id,jdbcType=INTEGER}
</update>
<select id="getByRelationId" resultMap="BaseResultMap"> <select id="getByRelationId" resultMap="BaseResultMap">
select select
......
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