Commit 1294a4a5 by 墨竹

Merge remote-tracking branch 'origin/developer' into developer

# Conflicts:
#	haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
parents 65eb6e1e 67075f14
......@@ -3,24 +3,28 @@ package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
public class CommonMQDTO implements Serializable {
/**
* @Fields serialVersionUID : TODO(用一句话描述这个变量表示什么)
*/
private static final long serialVersionUID = -5681421708810402425L;
private int type ;
private String params ;
private int type;
private Object params;
public int getType() {
return type;
}
public String getParams() {
return params;
}
public void setType(int type) {
this.type = type;
}
public void setParams(String params) {
public Object getParams() {
return params;
}
public void setParams(Object params) {
this.params = params;
}
}
......@@ -11,7 +11,9 @@ import com.gic.haoban.manage.api.dto.CommonMQDTO;
*
*/
public interface HaobanCommonMQApiService {
public void commonHandler(CommonMQDTO dto) ;
public void putCommonMessage(CommonMQDTO dto);
public void commonHandler(String message);
}
......@@ -81,15 +81,4 @@ public interface StaffDepartmentRelatedApiService {
*/
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);
}
......@@ -232,5 +232,9 @@ public interface WxEnterpriseApiService {
* @throws
*/
void stopHaoban(String enterpriseId) ;
public boolean haobanIsStop(String eid) ;
public String getEndDate(String enterpriseId) ;
}
......@@ -165,5 +165,7 @@ public interface WxEnterpriseRelatedApiService {
* @return
*/
com.gic.api.base.commons.ServiceResponse<EnterpriseDetailDTO> queryEnterpriseDetail(String wxEnterpriseId, String enterpriseId);
public int getRelationCount(String enterpriseId) ;
}
......@@ -22,6 +22,8 @@ public interface PendingTaskApiService {
* @param qdto
*/
public ServiceResponse<Boolean> addPendingTask(PendingTaskQDTO qdto);
public ServiceResponse<Boolean> insertPendingTaskBatch(List<PendingTaskQDTO> qdto);
/**
......
......@@ -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.enums.NoticeMessageTypeEnum;
import com.gic.mq.sdk.GicMQClient;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import static org.slf4j.LoggerFactory.getLogger;
......@@ -55,54 +52,13 @@ public class NoticeMessageUtil {
logger.info("发送消息:{}", ret);
GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try {
// com.gic.haoban.manage.api.service.notify.NoticeMessageApiService.run
clientInstance.sendMessage(NOTICE_MESSAGE, ret);
} catch (Exception 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发送
*
......
......@@ -10,31 +10,20 @@ import java.util.Set;
@Mapper
public interface PendingTaskMapper {
/**
*/
int deleteByPrimaryKey(Integer id);
/**
*/
int insert(TabPendingTask record);
/**
*/
int insertSelective(TabPendingTask record);
/**
*/
TabPendingTask selectByPrimaryKey(Integer id);
/**
*/
int updateByPrimaryKeySelective(TabPendingTask record);
/**
*/
int updateByPrimaryKey(TabPendingTask record);
/**
* 根据关联id 查询单条
*/
TabPendingTask getByRelationId(String relationId);
......
......@@ -35,4 +35,6 @@ public interface WxEnterpriseRelatedService {
* @return
*/
void setClerkEdit(String id, int clerkEditFlag);
int getRelationCount(String enterpriseId) ;
}
......@@ -68,6 +68,11 @@ public class WxEnterpriseRelatedServiceImpl implements WxEnterpriseRelatedServic
record.setWxEnterpriseRelatedId(id);
record.setUpdateTime(new Date());
mapper.updateByPrimaryKeySelective(record);
}
@Override
public int getRelationCount(String enterpriseId) {
List<TabHaobanWxEnterpriseRelated> list = this.mapper.listByEnterpriseId(enterpriseId) ;
return list.size();
}
}
......@@ -140,7 +140,7 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
@Override
public void stopHaoban(String enterpriseId) {
List<TabHaobanWxEnterpriseRelated> list = this.wxEnterpriseRelatedMapper.listByEnterpriseId(enterpriseId) ;
logger.info("停用好办={},list={}",enterpriseId,JSON.toJSONString(list));
logger.info("停用好办={},商户list={}",enterpriseId,JSON.toJSONString(list));
if(CollectionUtils.isEmpty(list)){
return ;
}
......@@ -151,7 +151,7 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
}
this.wxEnterpriseRelatedMapper.deleteByEnterpriseId(enterpriseId) ;
Map<String,Object> enMap = new HashMap<>();
enMap.put("enterpriseId", enterpriseId) ;
enMap.put("enterpriseId", enterpriseId + list.get(0).getEnterpriseName()) ;
alert("删除商户企微关联告警", enMap);
for(String wxEnterpriseId : wxEnterpriseIdList) {
List<TabHaobanWxEnterpriseRelated> relationList = this.wxEnterpriseRelatedMapper.listByWxenterpriseId(wxEnterpriseId) ;
......@@ -234,6 +234,6 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
private void alert(String title, Map<String, Object> map) {
String msg = title + JSON.toJSONString(map);
String dingUrl = "https://oapi.dingtalk.com/robot/send?access_token=c38fdc53d26e9a019640755bdada1ce07ebd44a2555d1c8acc299de7a7b5b857";
DingUtils.send(msg, dingUrl, true);
DingUtils.send(msg, dingUrl, false);
}
}
......@@ -95,5 +95,7 @@ public interface PendingTaskService {
*/
public boolean changeByRelationId(PendingTaskBO task);
public void insertPendingTaskBatch(List<PendingTaskBO> list);
}
......@@ -142,4 +142,26 @@ public class PendingTaskServiceImpl implements PendingTaskService {
pendingTaskMapper.updateByPrimaryKeySelective(tabPendingTask);
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 {
pendingTaskService.addOrUpdateBatchPendingTask(list);
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
public ServiceResponse<Page<PendingTaskDetailDTO>> pagePendingTask(PendingListQDTO listQDTO, BasePageInfo pageInfo) {
......
package com.gic.haoban.manage.service.service.out.impl;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.manage.api.dto.CommonMQDTO;
import com.gic.haoban.manage.api.service.HaobanCommonMQApiService;
import com.gic.mq.sdk.GicMQClient;
import com.gic.quartz.api.dto.QuartzTaskDTO;
import com.gic.quartz.api.service.QuartzService;
@Service("haobanCommonMQApiService")
public class HaobanCommonMQApiServiceImpl implements HaobanCommonMQApiService {
private final Logger log = LogManager.getLogger(HaobanCommonMQApiService.class);
private static GicMQClient mqClient = GICMQClientUtil.getClientInstance();
@Autowired
private QuartzService quartzService ;
@Override
public void commonHandler(CommonMQDTO dto) {
public void putCommonMessage(CommonMQDTO dto) {
String message = JSONObject.toJSONString(dto);
log.info("加入好办通用队列params={}",message);
try {
mqClient.sendCommonMessage("haobanCommonRouter", message,
"com.gic.haoban.manage.api.service.HaobanCommonMQApiService", "commonHandler");
} catch (Exception e) {
log.error("发送MQ异常");
e.printStackTrace();
}
}
@Override
public void commonHandler(String message) {
log.info("接收好办通用队列params={}",message);
CommonMQDTO dto = JSON.parseObject(message, CommonMQDTO.class);
// 好办停用,删除定时
if(dto.getType()==1) {
Map<String,String> map = (Map<String, String>) dto.getParams() ;
String enterpriseId = map.get("enterpriseId") ;
this.deleteQuartz(enterpriseId);
}
}
}
private void deleteQuartz(String enterpriseId) {
if(StringUtils.isBlank(enterpriseId)) {
return ;
}
log.info("删除好办定时eid={}",enterpriseId);
// 日报
QuartzTaskDTO task = new QuartzTaskDTO();
task.setTaskService("com.gic.haoban.app.daily.api.service.DailyReportTaskApiService");
task.setTaskMethod("run");
task.setReferId(enterpriseId);
this.quartzService.delQuartzTask(task);
}
}
......@@ -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.dao.mapper.StaffDepartmentRelatedMapper;
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.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
......@@ -49,8 +48,6 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
@Autowired
private QywxSuiteApiService qywxSuiteApiService;
@Autowired
private WxEnterpriseMapper wxEnterpriseMapper;
@Autowired
private Config config;
@Autowired
private TabHaobanStaffClerkRelationMapper tabHaobanStaffClerkRelationMapper;
......@@ -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);
}
}
}
......@@ -92,6 +92,9 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
@Override
public EnterpriseDetailDTO getByEnterpriseId(String wxEnterpriseId, String enterpriseId) {
TabHaobanWxEnterpriseRelated entity = wxEnterpriseRelatedService.getByEnterpriseId(wxEnterpriseId, enterpriseId);
if(null == entity) {
return null ;
}
EnterpriseDetailDTO dto = EntityUtil.changeEntityByJSON(EnterpriseDetailDTO.class, entity);
return dto;
}
......@@ -698,4 +701,9 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
enterpriseDetailDTO.setCustomerPhone(enterprise.getCustomerPhone());
return com.gic.api.base.commons.ServiceResponse.success(enterpriseDetailDTO);
}
@Override
public int getRelationCount(String enterpriseId) {
return this.wxEnterpriseRelatedService.getRelationCount(enterpriseId);
}
}
......@@ -131,7 +131,7 @@
timeout="10000"/>
<dubbo:service interface="com.gic.haoban.manage.api.service.ValidationCodeApiService" ref="validationCodeApiServiceImpl"/>
<dubbo:reference interface="com.gic.enterprise.api.service.EnterpriseUseForbidService" id="enterpriseUseForbidService"/>
<dubbo:reference interface="com.gic.enterprise.api.service.DepartmentService" id="gicDepartmentService"/>
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxDepartmentApiService"
id="qywxDepartmentApiService"/>
......
......@@ -26,16 +26,8 @@
overdue_time, invalid_time, store_id, clerk_id, finish_time, finish_flag, overdue_flag,
delete_flag, create_time, update_time
</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 into tab_haoban_pending_task (id, enterprise_id, relation_id,
task_type, title, description,
......@@ -50,6 +42,7 @@
#{finishFlag,jdbcType=INTEGER}, #{overdueFlag,jdbcType=INTEGER}, #{deleteFlag,jdbcType=INTEGER},
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabPendingTask">
insert into tab_haoban_pending_task
<trim prefix="(" suffix=")" suffixOverrides=",">
......@@ -222,27 +215,7 @@
</set>
where id = #{id,jdbcType=INTEGER}
</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
......
......@@ -11,6 +11,7 @@ import com.gic.haoban.manage.api.dto.qdto.hm.HmPageQDTO;
import com.gic.haoban.manage.api.dto.qdto.hm.HmPageRelationQDTO;
import com.gic.haoban.manage.api.dto.welcome.qdto.QueryWelcomeRelationQDTO;
import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.api.service.hm.HmGroupApiService;
import com.gic.haoban.manage.api.service.hm.HmPageApiService;
......@@ -42,12 +43,17 @@ public class HmPageServiceTest {
@Autowired
private HmWelcomeRelationApiService welcomeRelationApiService;
@Autowired
private WxEnterpriseApiService wxEnterpriseApiService ;
@Test
public void test(){
HmPageQDTO pageQDTO = new HmPageQDTO();
this.wxEnterpriseApiService.stopHaoban("ff8080815dacd3a2015dacd3ef5c0000");
/* HmPageQDTO pageQDTO = new HmPageQDTO();
pageQDTO.setPageSearchText("MB01419872763172380673");
ServiceResponse<Page<HmPageDTO>> pageServiceResponse = pageService.queryPageList(pageQDTO);
ServiceResponse<Page<HmPageDTO>> pageServiceResponse = pageService.queryPageList(pageQDTO);*/
}
......
......@@ -471,6 +471,11 @@ public class LoginController extends WebBaseController {
logger.info("切换商户失败,gic账号不存在,eid={},phone={}", enterpriseId, phoneNumber);
return this.fail("切换商户失败,gic账号不存在");
}
String endMessage = wxEnterpriseApiService.getEndDate(enterpriseId);
if (StringUtils.isNotBlank(endMessage)) {
logger.info("切换商户失败,商户已过期,eid={},phone={}", enterpriseId, phoneNumber);
return this.fail(endMessage);
}
loginUser.setEnterpriseId(enterpriseId);
loginUser.setClerkId(clerk.getClerkId());
loginUser.setClerkName(clerk.getClerkName());
......@@ -482,11 +487,6 @@ public class LoginController extends WebBaseController {
loginUser.setClerkPhone(clerk.getPhoneNumber()) ;
AuthWebRequestUtil.setSessionUser(loginUser);
AuthWebRequestUtil.setAppLoginUser(token, loginUser);
boolean flag = wxEnterpriseApiService.enterpriseIsOver(enterpriseId);
if (flag) {
logger.info("切换商户失败,商户已过期,eid={},phone={}", enterpriseId, phoneNumber);
return this.fail("切换商户失败,商户已过期");
}
return resultResponse(HaoBanErrCode.ERR_1, false);
}
......
......@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.dubbo.common.utils.CollectionUtils;
import com.alibaba.fastjson.JSON;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.EntityUtil;
......@@ -105,49 +106,35 @@ public class StoreController extends WebBaseController {
logger.info("没有关联任何商户:{}", wxEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_1);
}
List<String> enterpriseIdList = enterpriseList.stream().filter(dto->{
String enterpriseId = dto.getEnterpriseId() ;
return !this.wxEnterpriseApiService.haobanIsStop(enterpriseId);
}).map(EnterpriseDetailDTO::getEnterpriseId).collect(Collectors.toList());
if (CollectionUtils.isEmpty(enterpriseIdList)) {
logger.info("没有关联任何商户或商户都已停用:{}", wxEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_1);
}
Map<String, EnterpriseDetailDTO> enterpriseTypeMap = enterpriseList.stream().collect(Collectors.toMap(dto -> dto.getEnterpriseId(), dto -> dto));
List<String> enterpriseIdList = enterpriseList.stream().map(EnterpriseDetailDTO::getEnterpriseId).collect(Collectors.toList());
List<StaffClerkRelationDTO> bindRelationList = staffClerkRelationApiService.listBindCodeByStaffId(enterpriseIdList, staffId);
if (CollectionUtils.isEmpty(bindRelationList)) {
logger.info("没有关联任何商户导购:{}", wxEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_1);
}
Map<String,Boolean> map = new HashMap<>();
logger.info("成员绑定导购数据={}",JSON.toJSONString(bindRelationList));
for (StaffClerkRelationDTO staffClerkRelationDTO : bindRelationList) {
String storeId = staffClerkRelationDTO.getStoreId() ;
StoreDTO store = storeService.getStore(storeId);
if (store == null) {
continue;
}
String enterprsieId = store.getEnterpriseId() ;
if(StringUtils.isNotBlank(gicEnterpriseId) && !gicEnterpriseId.equals(enterprsieId)) {
logger.info("非当前商户,直接跳过={},{}",gicEnterpriseId,enterprsieId);
String enterpriseId = store.getEnterpriseId();
if(StringUtils.isNotBlank(gicEnterpriseId) && !gicEnterpriseId.equals(enterpriseId)) {
logger.info("非当前商户,直接跳过={},{}",gicEnterpriseId,enterpriseId);
continue ;
}
if(null != map.get(enterprsieId)) {
if(Boolean.FALSE.equals(map.get(enterprsieId))) {
logger.info("该企业过期,{}", enterprsieId);
continue ;
}
}else {
boolean enterpriseOver = isEnterpriseOver(enterprsieId);
if (enterpriseOver) {
logger.info("该企业过期,{}", staffId, enterprsieId);
map.put(enterprsieId, false) ;
continue;
}
/* Integer code = this.enterpriseUseForbidService.selectPermissionStatus(enterprsieId, "haoban-3") ;
logger.info("是否停用={},{}",enterprsieId,code);
// 不能用
if(!(code ==0 || code==1)) {
logger.info("该企业过期,{}", staffId, enterprsieId);
map.put(enterprsieId, false) ;
continue;
}*/
}
map.put(enterprsieId, true) ;
ClerkDTO clerk = clerkService.getClerkByClerkCode(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getClerkCode());
ClerkDTO clerk = clerkService.getClerkByClerkCode(enterpriseId, staffClerkRelationDTO.getClerkCode());
if (clerk == null) {
continue;
}
......@@ -159,7 +146,6 @@ public class StoreController extends WebBaseController {
if (wxEnterpriseDTO == null) {
continue;
}
String enterpriseId = clerk.getEnterpriseId();
EnterpriseDTO enterpriseDTO = enterpriseService.getEnterpriseById(enterpriseId);
if (enterpriseDTO == null) {
continue;
......@@ -321,7 +307,7 @@ public class StoreController extends WebBaseController {
AuditDTO auditDTO = auditApiService.findByStoreIdAndChangeField(storeId, changeField);
if (auditDTO == null) {
//为空,可继续提交审核
int i = auditApiService.save(1, wxEnterpriseId, enterpriseId, staffId, storeId, changeField, oldValue, newValue);
auditApiService.save(1, wxEnterpriseId, enterpriseId, staffId, storeId, changeField, oldValue, newValue);
} else {
return resultResponse(HaoBanErrCode.ERR_400018);
}
......@@ -380,23 +366,4 @@ public class StoreController extends WebBaseController {
}
return resultResponse(HaoBanErrCode.ERR_1, vo);
}
public boolean isEnterpriseOver(String enterpriseId) {
EnterpriseDTO enterprise = enterpriseService.getEnterpriseById(enterpriseId);
if (enterprise == null || enterprise.getStatus() != 1) {
return true;
}
if (enterprise.getExpireTime() == null) {
if (enterprise.getEnabledState() == null) {
return false;
} else {
return enterprise.getEnabledState() != 1;
}
} else {
return enterprise.getExpireTime().getTime() <= System.currentTimeMillis() || enterprise.getEnabledState() != 1;
}
}
}
package com.gic.haoban.manage.web.controller;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.clerk.api.dto.ClerkDTO;
import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.webapi.reponse.RestResponse;
......@@ -12,7 +32,11 @@ import com.gic.dict.api.service.ManagerDictService;
import com.gic.enterprise.api.dto.EnterpriseDTO;
import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.EnterpriseService;
import com.gic.haoban.app.customer.dto.*;
import com.gic.haoban.app.customer.dto.ChildDTO;
import com.gic.haoban.app.customer.dto.CustomerDTO;
import com.gic.haoban.app.customer.dto.FilterListDTO;
import com.gic.haoban.app.customer.dto.MemberInfoListParamsDTO;
import com.gic.haoban.app.customer.dto.StaffOpenRelatedDTO;
import com.gic.haoban.app.customer.service.api.service.CustomerApiService;
import com.gic.haoban.app.customer.service.api.service.StaffMemberRelationApiService;
import com.gic.haoban.common.anno.HttpLimit;
......@@ -21,9 +45,29 @@ import com.gic.haoban.common.utils.AuthRequestWellDoneUtil;
import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.common.utils.JwtUtil;
import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.dto.ClerkMainStoreRelatedDTO;
import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO;
import com.gic.haoban.manage.api.dto.ExternalUserDTO;
import com.gic.haoban.manage.api.dto.MemberStoreDTO;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.api.dto.MiniprogramSettingDTO;
import com.gic.haoban.manage.api.dto.SecretSettingDTO;
import com.gic.haoban.manage.api.dto.StaffClerkInfoDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffPrivacyUseLogDTO;
import com.gic.haoban.manage.api.dto.UserLoginLogDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseRelationDetailDTO;
import com.gic.haoban.manage.api.dto.YwWxEnterpriseDTO;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.*;
import com.gic.haoban.manage.api.service.ClerkMainStoreRelatedApiService;
import com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService;
import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffClerkRelationApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.web.config.Config;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.qo.GetUserByMemberCodeQo;
......@@ -38,21 +82,9 @@ import com.gic.member.api.service.MemberOpenCardBusinessService;
import com.gic.wechat.api.dto.qywx.UserDTO;
import com.gic.wechat.api.service.qywx.QywxCorpApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;
import java.util.*;
import java.util.stream.Collectors;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert;
@RestController
public class WxEnterpriseInfoController extends WebBaseController {
......@@ -90,8 +122,6 @@ public class WxEnterpriseInfoController extends WebBaseController {
@Autowired
private Config config;
@Autowired
private WxApplicationApiService wxApplicationApiService;
@Autowired
private ClerkMainStoreRelatedApiService clerkMainStoreRelatedApiService;
@Autowired
private CustomerApiService customerApiService;
......@@ -117,6 +147,14 @@ public class WxEnterpriseInfoController extends WebBaseController {
}
String userId = user.getUserid();
String corpId = user.getCorpid();
// 判断好办是否到期
ServiceResponse<Boolean> resp = this.wxEnterpriseApiService.isStopHaoban(corpId);
if (!resp.isSuccess()) {
HaobanResponse response = new HaobanResponse();
response.setErrorCode(-888);
response.setMessage(resp.getMessage());
return response;
}
WxEnterpriseDTO enterprise = wxEnterpriseApiService.getEnterpriseBycorpId(corpId);
StaffDTO loginStaff = null;
if (enterprise != null) {
......
......@@ -13,7 +13,7 @@
<!-- 应用名称 -->
<dubbo:application name="haoban-manage3-wx"/>
<dubbo:protocol name="dubbo" port="30010"/>
<dubbo:reference interface="com.gic.enterprise.api.service.EnterpriseUseForbidService" id="enterpriseUseForbidService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService"
id="staffDepartmentRelatedApiService"/>
<dubbo:reference interface="com.gic.clerk.api.service.ClerkService" id="clerkService"/>
......
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