Commit 690bf483 by qwmqiuwenmin

Merge branch 'developer_repair_contact20200408' into 'master'

Developer repair contact20200408

See merge request !39
parents 0188aa4a 72814d98
package com.gic.haoban.manage.api.dto;
import java.io.Serializable;
import java.util.Date;
public class MemberStoreDTO implements Serializable {
private String memberId;
private String storeId;
private static final long serialVersionUID = 1L;
public String getMemberId() {
return memberId;
}
public void setMemberId(String memberId) {
this.memberId = memberId;
}
public String getStoreId() {
return storeId;
}
public void setStoreId(String storeId) {
this.storeId = storeId;
}
}
...@@ -16,6 +16,8 @@ public class MemberUnionidRelatedDTO implements Serializable{ ...@@ -16,6 +16,8 @@ public class MemberUnionidRelatedDTO implements Serializable{
private String unionid; private String unionid;
private String wxEnterpriseId; private String wxEnterpriseId;
private String enterpriseId;
private Integer statusFlag; private Integer statusFlag;
...@@ -147,5 +149,13 @@ public class MemberUnionidRelatedDTO implements Serializable{ ...@@ -147,5 +149,13 @@ public class MemberUnionidRelatedDTO implements Serializable{
this.addCreateTime = addCreateTime; this.addCreateTime = addCreateTime;
} }
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
} }
...@@ -60,6 +60,8 @@ public class WxEnterpriseDTO implements Serializable { ...@@ -60,6 +60,8 @@ public class WxEnterpriseDTO implements Serializable {
private String wxSecretKey; private String wxSecretKey;
private String memberSecret; private String memberSecret;
private String contactSecret;
private Date createTime; private Date createTime;
...@@ -317,6 +319,15 @@ public class WxEnterpriseDTO implements Serializable { ...@@ -317,6 +319,15 @@ public class WxEnterpriseDTO implements Serializable {
this.wxSecretKey = wxSecretKey; this.wxSecretKey = wxSecretKey;
} }
public String getContactSecret() {
return contactSecret;
}
public void setContactSecret(String contactSecret) {
this.contactSecret = contactSecret;
}
} }
...@@ -120,7 +120,7 @@ public interface DepartmentApiService { ...@@ -120,7 +120,7 @@ public interface DepartmentApiService {
List<DepartmentDTO> listByChainId(String chainId,String wxEnterpriseId); List<DepartmentDTO> listByChainId(String chainId,String wxEnterpriseId);
void initwxDepartment(String corpid, String suiteid, String wxEnterpriseId); void initwxDepartment(String corpid, String contactSecret, String wxEnterpriseId);
/** /**
* 回收站的数量 * 回收站的数量
* @param wxEnterpriseId * @param wxEnterpriseId
......
...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.service; ...@@ -2,6 +2,7 @@ package com.gic.haoban.manage.api.service;
import java.util.List; import java.util.List;
import com.gic.haoban.manage.api.dto.MemberStoreDTO;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO; import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
public interface MemberUnionidRelatedApiService { public interface MemberUnionidRelatedApiService {
...@@ -15,5 +16,7 @@ public interface MemberUnionidRelatedApiService { ...@@ -15,5 +16,7 @@ public interface MemberUnionidRelatedApiService {
MemberUnionidRelatedDTO getByMemberId(String staffId, String memberId); MemberUnionidRelatedDTO getByMemberId(String staffId, String memberId);
List<MemberUnionidRelatedDTO> getByWxUserIdAndWxEnterpriseId(String wxUserId, String wxEnterpriseId); List<MemberUnionidRelatedDTO> getByWxUserIdAndWxEnterpriseId(String wxUserId, String wxEnterpriseId);
List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId);
} }
...@@ -47,7 +47,7 @@ public interface StaffApiService { ...@@ -47,7 +47,7 @@ public interface StaffApiService {
StaffDepartmentRelatedDTO getDepartmentIdAndCode(String departmentId, String code); StaffDepartmentRelatedDTO getDepartmentIdAndCode(String departmentId, String code);
void initWxUser(String corpid, String suiteid, String wxEnterpriseId, Integer wxDepartmentId); void initWxUser(String corpid, String contactSecret, String wxEnterpriseId, Integer wxDepartmentId);
public List<String> listUnBindClerk(String storeId); public List<String> listUnBindClerk(String storeId);
......
...@@ -105,6 +105,12 @@ ...@@ -105,6 +105,12 @@
<dependency> <dependency>
<groupId>com.gic</groupId> <groupId>com.gic</groupId>
<artifactId>gic-search-engine-api</artifactId>
<version>${gic-search-engine-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-member-api</artifactId> <artifactId>gic-member-api</artifactId>
<version>3.0-SNAPSHOT</version> <version>3.0-SNAPSHOT</version>
<scope>compile</scope> <scope>compile</scope>
......
...@@ -26,6 +26,8 @@ public interface MemberUnionidRelatedMapper { ...@@ -26,6 +26,8 @@ public interface MemberUnionidRelatedMapper {
List<MemberUnionidRelated> getByWxUserIdAndWxEnterpriseId(@Param("wxUserId")String wxUserId, @Param("wxEnterpriseId")String wxEnterpriseId); List<MemberUnionidRelated> getByWxUserIdAndWxEnterpriseId(@Param("wxUserId")String wxUserId, @Param("wxEnterpriseId")String wxEnterpriseId);
MemberUnionidRelated getByParams(@Param("wxUserId")String wxUserId, @Param("wxEnterpriseId")String wxEnterpriseId, MemberUnionidRelated getByParams(@Param("wxUserId")String wxUserId, @Param("enterpriseId")String enterpriseId,
@Param("externalName")String name, @Param("addCreateTime")String createTime); @Param("externalName")String name, @Param("addCreateTime")String createTime);
List<MemberUnionidRelated> listByExTernalUseridAndWxUserId(@Param("externalUserid")String externalUserid, @Param("wxUserId")String wxUserId);
} }
\ No newline at end of file
...@@ -43,5 +43,7 @@ public interface StaffDepartmentRelatedMapper { ...@@ -43,5 +43,7 @@ public interface StaffDepartmentRelatedMapper {
List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByKeyword(@Param("departmentId")String departmentId, @Param("keyword")String keyword); List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByKeyword(@Param("departmentId")String departmentId, @Param("keyword")String keyword);
int countByDepartmentIds(@Param("departmentIds")List<String> departmentIds); int countByDepartmentIds(@Param("departmentIds")List<String> departmentIds);
List<TabHaobanStaffDepartmentRelated> listByWxUserId(@Param("wxUserId")String wxUserId);
} }
\ No newline at end of file
...@@ -11,6 +11,8 @@ public class MemberUnionidRelated implements Serializable { ...@@ -11,6 +11,8 @@ public class MemberUnionidRelated implements Serializable {
private String unionid; private String unionid;
private String wxEnterpriseId; private String wxEnterpriseId;
private String enterpriseId;
private Integer statusFlag; private Integer statusFlag;
...@@ -126,6 +128,14 @@ public class MemberUnionidRelated implements Serializable { ...@@ -126,6 +128,14 @@ public class MemberUnionidRelated implements Serializable {
this.addCreateTime = addCreateTime; this.addCreateTime = addCreateTime;
} }
public String getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(String enterpriseId) {
this.enterpriseId = enterpriseId;
}
} }
\ No newline at end of file
...@@ -59,6 +59,8 @@ public class TabHaobanWxEnterprise implements Serializable { ...@@ -59,6 +59,8 @@ public class TabHaobanWxEnterprise implements Serializable {
private String wxSecretKey; private String wxSecretKey;
private String memberSecret; private String memberSecret;
private String contactSecret;
private Date createTime; private Date createTime;
...@@ -306,6 +308,15 @@ public class TabHaobanWxEnterprise implements Serializable { ...@@ -306,6 +308,15 @@ public class TabHaobanWxEnterprise implements Serializable {
this.wxSecretKey = wxSecretKey; this.wxSecretKey = wxSecretKey;
} }
public String getContactSecret() {
return contactSecret;
}
public void setContactSecret(String contactSecret) {
this.contactSecret = contactSecret;
}
} }
\ No newline at end of file
...@@ -14,7 +14,7 @@ public interface MemberUnionRelatedService { ...@@ -14,7 +14,7 @@ public interface MemberUnionRelatedService {
List<MemberUnionidRelatedDTO> getByWxUserIdAndWxEnterpriseId(String wxUserId, String wxEnterpriseId); List<MemberUnionidRelatedDTO> getByWxUserIdAndWxEnterpriseId(String wxUserId, String wxEnterpriseId);
MemberUnionidRelatedDTO getByParams(String wxUserId, String wxEnterpriseId, String name, String createTime); MemberUnionidRelatedDTO getByParams(String wxUserId, String enterpriseId, String name, String createTime);
void update(MemberUnionidRelatedDTO exsitDTO); void update(MemberUnionidRelatedDTO exsitDTO);
......
...@@ -25,4 +25,7 @@ public interface StaffDepartmentRelatedService { ...@@ -25,4 +25,7 @@ public interface StaffDepartmentRelatedService {
int countByDepartmentId(String departmentId); int countByDepartmentId(String departmentId);
List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByKeyword(String departmentId, String keyword); List<TabHaobanStaffDepartmentRelated> listByDepartmentIdByKeyword(String departmentId, String keyword);
List<TabHaobanStaffDepartmentRelated> listByWxUserId(String wxUserId);
} }
...@@ -46,8 +46,8 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService ...@@ -46,8 +46,8 @@ public class MemberUnionRelatedServiceImpl implements MemberUnionRelatedService
} }
@Override @Override
public MemberUnionidRelatedDTO getByParams(String wxUserId, String wxEnterpriseId, String name, String createTime) { public MemberUnionidRelatedDTO getByParams(String wxUserId, String enterpriseId, String name, String createTime) {
return EntityUtil.changeEntityByJSON(MemberUnionidRelatedDTO.class,mapper.getByParams(wxUserId,wxEnterpriseId,name,createTime)); return EntityUtil.changeEntityByJSON(MemberUnionidRelatedDTO.class,mapper.getByParams(wxUserId,enterpriseId,name,createTime));
} }
@Override @Override
......
...@@ -20,7 +20,12 @@ public class StaffDepartmentRelatedServiceImpl implements StaffDepartmentRelated ...@@ -20,7 +20,12 @@ public class StaffDepartmentRelatedServiceImpl implements StaffDepartmentRelated
@Autowired @Autowired
private StaffDepartmentRelatedMapper mapper; private StaffDepartmentRelatedMapper mapper;
@Override
public List<TabHaobanStaffDepartmentRelated> listByWxUserId(String wxUserId){
List<TabHaobanStaffDepartmentRelated> list = mapper.listByWxUserId(wxUserId);
return list;
}
@Override @Override
public List<TabHaobanStaffDepartmentRelated> listByDepartmentId(String departmentId) { public List<TabHaobanStaffDepartmentRelated> listByDepartmentId(String departmentId) {
......
...@@ -40,11 +40,9 @@ import com.gic.haoban.manage.api.service.DepartmentApiService; ...@@ -40,11 +40,9 @@ import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.service.dao.mapper.DepartmentMapper; import com.gic.haoban.manage.service.dao.mapper.DepartmentMapper;
import com.gic.haoban.manage.service.entity.TabHaobanDepartment; import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated; import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.entity.TabHaobanWxApplication;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
import com.gic.haoban.manage.service.service.DepartmentService; import com.gic.haoban.manage.service.service.DepartmentService;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService; import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.haoban.manage.service.service.WxApplicationService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.wechat.api.service.qywx.QywxDepartmentApiService; import com.gic.wechat.api.service.qywx.QywxDepartmentApiService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
...@@ -66,8 +64,6 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -66,8 +64,6 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
@Autowired @Autowired
private WxEnterpriseService wxEnterpriseService; private WxEnterpriseService wxEnterpriseService;
@Autowired @Autowired
private WxApplicationService wxApplicationService;
@Autowired
private StoreService storeService; private StoreService storeService;
@Autowired @Autowired
private StoreGroupService storeGroupService; private StoreGroupService storeGroupService;
...@@ -98,39 +94,36 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -98,39 +94,36 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
//调微信的新增接口 //调微信的新增接口
String wxDepartmentId = ""; String wxDepartmentId = "";
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(department.getWxEnterpriseId()); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(department.getWxEnterpriseId());
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(department.getWxEnterpriseId(),1);
logger.info("【部门新增】enterpriseDTO = {}",JSON.toJSONString(enterpriseDTO)); logger.info("【部门新增】enterpriseDTO = {}",JSON.toJSONString(enterpriseDTO));
if(enterpriseDTO != null) { if(enterpriseDTO != null) {
if(application != null) { Integer sort = department.getSort();
Integer sort = department.getSort(); if(sort == null) {
if(sort == null) { int maxSort = departmentMapper.selectMaxSort(department.getParentDepartmentId());
int maxSort = departmentMapper.selectMaxSort(department.getParentDepartmentId()); department.setSort(maxSort + 1);
department.setSort(maxSort + 1);
}
com.gic.wechat.api.dto.qywx.DepartmentDTO dto = new com.gic.wechat.api.dto.qywx.DepartmentDTO();
dto.setCorpid(enterpriseDTO.getCorpid());
dto.setName(department.getDepartmentName());
dto.setOrder(department.getSort());
TabHaobanDepartment parent = departmentService.selectById(department.getParentDepartmentId());
dto.setParentid(Integer.valueOf(parent.getWxDepartmentId()));
logger.info("【部门新增】corpid() = {},siteId={},dto={}",enterpriseDTO.getCorpid(),application.getSiteId(),JSON.toJSONString(dto));
JSONResponse jp = qywxDepartmentApiService.createDepartment(enterpriseDTO.getCorpid(), application.getSiteId(), dto);
logger.info("【部门新增】jp = {}",JSON.toJSONString(jp));
if(jp.getErrorCode() != 0) {
hr.setCode(0);
hr.setMessage("微信新增部门失败");
return hr;
}
wxDepartmentId = jp.getResult().toString();
logger.info("【部门新增】wxDepartmentId = {}",wxDepartmentId);
department.setWxDepartmentId(wxDepartmentId);
department.setLevel(parent.getLevel() + 1);
setGicEnterpriseId(department);
String departmentId = departmentService.add(department);
department.setDepartmentId(departmentId);
hr.setResult(department);
} }
com.gic.wechat.api.dto.qywx.DepartmentDTO dto = new com.gic.wechat.api.dto.qywx.DepartmentDTO();
dto.setCorpid(enterpriseDTO.getCorpid());
dto.setName(department.getDepartmentName());
dto.setOrder(department.getSort());
TabHaobanDepartment parent = departmentService.selectById(department.getParentDepartmentId());
dto.setParentid(Integer.valueOf(parent.getWxDepartmentId()));
logger.info("【部门新增】corpid() = {},siteId={},dto={}",enterpriseDTO.getCorpid(),enterpriseDTO.getContactSecret(),JSON.toJSONString(dto));
JSONResponse jp = qywxDepartmentApiService.createSelfDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), dto);
logger.info("【部门新增】jp = {}",JSON.toJSONString(jp));
if(jp.getErrorCode() != 0) {
hr.setCode(0);
hr.setMessage("微信新增部门失败");
return hr;
}
wxDepartmentId = jp.getResult().toString();
logger.info("【部门新增】wxDepartmentId = {}",wxDepartmentId);
department.setWxDepartmentId(wxDepartmentId);
department.setLevel(parent.getLevel() + 1);
setGicEnterpriseId(department);
String departmentId = departmentService.add(department);
department.setDepartmentId(departmentId);
hr.setResult(department);
} }
return hr; return hr;
...@@ -172,23 +165,20 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -172,23 +165,20 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
} }
logger.info("【部门修改】tab={}",JSON.toJSONString(tab)); logger.info("【部门修改】tab={}",JSON.toJSONString(tab));
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(tab.getWxEnterpriseId()); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(tab.getWxEnterpriseId());
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(tab.getWxEnterpriseId(),1);
if(enterpriseDTO != null) { if(enterpriseDTO != null) {
if(application != null) { com.gic.wechat.api.dto.qywx.DepartmentDTO dto = new com.gic.wechat.api.dto.qywx.DepartmentDTO();
com.gic.wechat.api.dto.qywx.DepartmentDTO dto = new com.gic.wechat.api.dto.qywx.DepartmentDTO(); dto.setCorpid(enterpriseDTO.getCorpid());
dto.setCorpid(enterpriseDTO.getCorpid()); dto.setName(department.getDepartmentName());
dto.setName(department.getDepartmentName()); dto.setOrder(department.getSort());
dto.setOrder(department.getSort()); TabHaobanDepartment parent = departmentService.selectById(department.getParentDepartmentId());
TabHaobanDepartment parent = departmentService.selectById(department.getParentDepartmentId()); dto.setParentid(Integer.valueOf(parent.getWxDepartmentId()));
dto.setParentid(Integer.valueOf(parent.getWxDepartmentId())); dto.setId(Integer.valueOf(tab.getWxDepartmentId()));
dto.setId(Integer.valueOf(tab.getWxDepartmentId())); JSONResponse jp = qywxDepartmentApiService.updateSelfDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), dto);
JSONResponse jp = qywxDepartmentApiService.updateDepartment(enterpriseDTO.getCorpid(), application.getSiteId(), dto); logger.info("【部门修改】jp={}",JSON.toJSONString(jp));
logger.info("【部门修改】jp={}",JSON.toJSONString(jp)); if(jp.getErrorCode() != 0) {
if(jp.getErrorCode() != 0) { hr.setCode(0);
hr.setCode(0); hr.setMessage("微信修改部门失败");
hr.setMessage("微信修改部门失败"); return hr;
return hr;
}
} }
} }
...@@ -224,15 +214,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -224,15 +214,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
return hr; return hr;
} }
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(department.getWxEnterpriseId()); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(department.getWxEnterpriseId());
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(department.getWxEnterpriseId(),1);
if(enterpriseDTO != null) { if(enterpriseDTO != null) {
if(application != null) { JSONResponse jp = qywxDepartmentApiService.deleteSelfDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), Integer.parseInt(department.getWxDepartmentId()));
JSONResponse jp = qywxDepartmentApiService.deleteDepartment(enterpriseDTO.getCorpid(), application.getSiteId(), Integer.parseInt(department.getWxDepartmentId())); if(jp.getErrorCode() != 0) {
if(jp.getErrorCode() != 0) { hr.setCode(0);
hr.setCode(0); hr.setMessage("微信删除部门失败");
hr.setMessage("微信删除部门失败"); return hr;
return hr;
}
} }
} }
...@@ -293,15 +280,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -293,15 +280,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
//调微信的新增接口 //调微信的新增接口
TabHaobanDepartment department = departmentService.selectById(departmentId); TabHaobanDepartment department = departmentService.selectById(departmentId);
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(department.getWxEnterpriseId()); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(department.getWxEnterpriseId());
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(department.getWxEnterpriseId(),1);
if(enterpriseDTO != null) { if(enterpriseDTO != null) {
if(application != null) { JSONResponse jp = qywxDepartmentApiService.deleteSelfDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), Integer.parseInt(department.getWxDepartmentId()));
JSONResponse jp = qywxDepartmentApiService.deleteDepartment(enterpriseDTO.getCorpid(), application.getSiteId(), Integer.parseInt(department.getWxDepartmentId())); if(jp.getErrorCode() != 0) {
if(jp.getErrorCode() != 0) { hr.setCode(0);
hr.setCode(0); hr.setMessage("微信删除部门失败");
hr.setMessage("微信删除部门失败"); return hr;
return hr;
}
} }
} }
...@@ -349,29 +333,26 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -349,29 +333,26 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
//调微信的新增接口 //调微信的新增接口
String wxDepartmentId = ""; String wxDepartmentId = "";
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(tab.getWxEnterpriseId()); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(tab.getWxEnterpriseId());
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(tab.getWxEnterpriseId(),1);
logger.info("【部门新增】enterpriseDTO = {}",JSON.toJSONString(enterpriseDTO)); logger.info("【部门新增】enterpriseDTO = {}",JSON.toJSONString(enterpriseDTO));
if(enterpriseDTO != null) { if(enterpriseDTO != null) {
if(application != null) { com.gic.wechat.api.dto.qywx.DepartmentDTO dto = new com.gic.wechat.api.dto.qywx.DepartmentDTO();
com.gic.wechat.api.dto.qywx.DepartmentDTO dto = new com.gic.wechat.api.dto.qywx.DepartmentDTO(); dto.setCorpid(enterpriseDTO.getCorpid());
dto.setCorpid(enterpriseDTO.getCorpid()); dto.setName(tab.getDepartmentName());
dto.setName(tab.getDepartmentName()); dto.setOrder(tab.getSort());
dto.setOrder(tab.getSort()); TabHaobanDepartment parent = departmentService.selectById(parentId);
TabHaobanDepartment parent = departmentService.selectById(parentId); dto.setParentid(Integer.valueOf(parent.getWxDepartmentId()));
dto.setParentid(Integer.valueOf(parent.getWxDepartmentId())); logger.info("【部门新增】corpid() = {},siteId={},dto={}",enterpriseDTO.getCorpid(),enterpriseDTO.getContactSecret(),JSON.toJSONString(dto));
logger.info("【部门新增】corpid() = {},siteId={},dto={}",enterpriseDTO.getCorpid(),application.getSiteId(),JSON.toJSONString(dto)); JSONResponse jp = qywxDepartmentApiService.createSelfDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), dto);
JSONResponse jp = qywxDepartmentApiService.createDepartment(enterpriseDTO.getCorpid(), application.getSiteId(), dto); logger.info("【部门新增】jp = {}",JSON.toJSONString(jp));
logger.info("【部门新增】jp = {}",JSON.toJSONString(jp)); if(jp.getErrorCode() != 0) {
if(jp.getErrorCode() != 0) { hr.setCode(0);
hr.setCode(0); hr.setMessage("微信新增部门失败");
hr.setMessage("微信新增部门失败"); return hr;
return hr;
}
wxDepartmentId = jp.getResult().toString();
tab.setWxDepartmentId(wxDepartmentId);
tab.setParentDepartmentId(parentId);
logger.info("【部门新增】wxDepartmentId = {}",wxDepartmentId);
} }
wxDepartmentId = jp.getResult().toString();
tab.setWxDepartmentId(wxDepartmentId);
tab.setParentDepartmentId(parentId);
logger.info("【部门新增】wxDepartmentId = {}",wxDepartmentId);
} }
departmentService.repairRecycle(tab); departmentService.repairRecycle(tab);
...@@ -495,7 +476,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -495,7 +476,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
} }
@Override @Override
public void initwxDepartment(String corpid, String suiteid, String wxEnterpriseId) { public void initwxDepartment(String corpid, String contactSecret, String wxEnterpriseId) {
// List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listDepartment(corpid, suiteid, null); // List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listDepartment(corpid, suiteid, null);
// logger.info("企业所有部门数据:{}", JSON.toJSONString(list)); // logger.info("企业所有部门数据:{}", JSON.toJSONString(list));
// //
...@@ -517,56 +498,17 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -517,56 +498,17 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
// //
// DepartmentDTO parent = EntityUtil.changeEntityByJSON(DepartmentDTO.class,departmentService.selectById(parentId)); // DepartmentDTO parent = EntityUtil.changeEntityByJSON(DepartmentDTO.class,departmentService.selectById(parentId));
// this.addSon(subList, wxEnterpriseId, parent,corpid,suiteid); // this.addSon(subList, wxEnterpriseId, parent,corpid,suiteid);
List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listDepartment(corpid, suiteid, null); List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listSelfDepartment(corpid, contactSecret, null);
logger.info("企业所有部门数据:{}", JSON.toJSONString(list)); logger.info("企业所有部门数据:{}", JSON.toJSONString(list));
if(CollectionUtils.isNotEmpty(list)){ if(CollectionUtils.isNotEmpty(list)){
this.addAllDepartment(list, 0, wxEnterpriseId, corpid, suiteid); this.addAllDepartment(list, 0, wxEnterpriseId, corpid, contactSecret);
}
}
public void addSon(List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list ,String wxEnterpriseId,DepartmentDTO parent,String corpid, String suiteid){
for (com.gic.wechat.api.dto.qywx.DepartmentDTO departmentDTO : list) {
String parentId = addDepartment(departmentDTO, wxEnterpriseId, parent,corpid,suiteid);
DepartmentDTO parent2 = EntityUtil.changeEntityByJSON(DepartmentDTO.class,departmentService.selectById(parentId));
List<com.gic.wechat.api.dto.qywx.DepartmentDTO> subList2 = new ArrayList<>();
for (com.gic.wechat.api.dto.qywx.DepartmentDTO departmentDTO2 : list) {
if(departmentDTO.getId().equals(departmentDTO2.getParentid())){
subList2.add(departmentDTO);
}
}
while(!subList2.isEmpty()){
addSon(subList2, wxEnterpriseId, parent2,corpid,suiteid);
}
} }
} }
private String addDepartment(com.gic.wechat.api.dto.qywx.DepartmentDTO departmentDTO,String wxEnterpriseId,DepartmentDTO parent,String corpid,String suiteid ){
String parentId = "";
TabHaobanDepartment exist = this.departmentService.getByWxId(departmentDTO.getId() + "", wxEnterpriseId);
logger.info("分组是否存在:{}", JSON.toJSONString(exist));
if(exist == null){
com.gic.haoban.manage.api.dto.DepartmentDTO dto = new com.gic.haoban.manage.api.dto.DepartmentDTO();
dto.setDepartmentName(departmentDTO.getName());
dto.setLevel(parent.getLevel() + 1);
dto.setWxEnterpriseId(wxEnterpriseId);
dto.setWxDepartmentId(departmentDTO.getId()+"");
dto.setParentDepartmentId(parent.getDepartmentId());
dto.setChainId(parent.getChainId() + Constant.ID_SEPARATOR + parent.getDepartmentId());
dto.setChainName(parent.getChainName() + Constant.NAME_SEPARATOR + parent.getDepartmentName());
dto.setSort(departmentDTO.getOrder());
dto.setIsStore(0);
parentId = this.departmentService.add(dto);
this.staffApiService.initWxUser(corpid, suiteid, wxEnterpriseId, departmentDTO.getId());
}else{
parentId = exist.getDepartmentId();
}
return parentId;
}
private void addAllDepartment(List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list, Integer parentId, private void addAllDepartment(List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list, Integer parentId,
String wxEnterpriseId, String corpid, String suiteid){ String wxEnterpriseId, String corpid, String contactSecret){
int level = 1; int level = 1;
String chainId = "0"; String chainId = "0";
String chainName = "0"; String chainName = "0";
...@@ -597,8 +539,8 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -597,8 +539,8 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
dto.setIsStore(0); dto.setIsStore(0);
this.departmentService.add(dto); this.departmentService.add(dto);
} }
this.addAllDepartment(list, departmentDTO.getId(), wxEnterpriseId, corpid, suiteid); this.addAllDepartment(list, departmentDTO.getId(), wxEnterpriseId, corpid, contactSecret);
this.staffApiService.initWxUser(corpid, suiteid, wxEnterpriseId, departmentDTO.getId()); this.staffApiService.initWxUser(corpid, contactSecret, wxEnterpriseId, departmentDTO.getId());
} }
} }
} }
...@@ -650,15 +592,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -650,15 +592,12 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
//调微信的删除接口 //调微信的删除接口
TabHaobanDepartment department = departmentService.selectById(departmentId); TabHaobanDepartment department = departmentService.selectById(departmentId);
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(department.getWxEnterpriseId()); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(department.getWxEnterpriseId());
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(department.getWxEnterpriseId(),1);
if(enterpriseDTO != null) { if(enterpriseDTO != null) {
if(application != null) { JSONResponse jp = qywxDepartmentApiService.deleteSelfDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), Integer.parseInt(department.getWxDepartmentId()));
JSONResponse jp = qywxDepartmentApiService.deleteDepartment(enterpriseDTO.getCorpid(), application.getSiteId(), Integer.parseInt(department.getWxDepartmentId())); if(jp.getErrorCode() != 0) {
if(jp.getErrorCode() != 0) { hr.setCode(0);
hr.setCode(0); hr.setMessage("微信删除部门失败");
hr.setMessage("微信删除部门失败"); return hr;
return hr;
}
} }
} }
......
package com.gic.haoban.manage.service.service.out.impl; package com.gic.haoban.manage.service.service.out.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
...@@ -20,17 +24,23 @@ import com.gic.clerk.api.service.ClerkService; ...@@ -20,17 +24,23 @@ import com.gic.clerk.api.service.ClerkService;
import com.gic.commons.util.MD5Utils; import com.gic.commons.util.MD5Utils;
import com.gic.commons.util.Md5Util; import com.gic.commons.util.Md5Util;
import com.gic.commons.util.StringUtil; import com.gic.commons.util.StringUtil;
import com.gic.haoban.contacts.manage.api.dto.SearchDataDTO;
import com.gic.haoban.manage.api.dto.DepartmentDTO; import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.MemberStoreDTO;
import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO; import com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO; import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
import com.gic.haoban.manage.api.service.DepartmentApiService; import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService; import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService; import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService; import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper;
import com.gic.haoban.manage.service.entity.MemberUnionidRelated;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise;
import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated; import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
import com.gic.haoban.manage.service.service.MemberUnionRelatedService; import com.gic.haoban.manage.service.service.MemberUnionRelatedService;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.haoban.manage.service.service.StaffService; import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService; import com.gic.haoban.manage.service.service.WxEnterpriseRelatedService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
...@@ -40,6 +50,13 @@ import com.gic.member.api.service.MemberOpenCardBusinessService; ...@@ -40,6 +50,13 @@ import com.gic.member.api.service.MemberOpenCardBusinessService;
import com.gic.member.api.service.MemberService; import com.gic.member.api.service.MemberService;
import com.gic.redis.data.anno.RedisLock; import com.gic.redis.data.anno.RedisLock;
import com.gic.redis.data.util.RedisUtil; import com.gic.redis.data.util.RedisUtil;
import com.gic.search.engine.api.constant.MemberDataEnum;
import com.gic.search.engine.api.constant.OperateEnum;
import com.gic.search.engine.api.dto.ESResponseQueryBatch;
import com.gic.search.engine.api.dto.ESResponseQuerySingle;
import com.gic.search.engine.api.dto.dynamic.DynamicSearchDTO;
import com.gic.search.engine.api.filter.NewNodeAddUtil;
import com.gic.search.engine.api.service.dynamic.ESDataDynamicOperationApiService;
@Service @Service
public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedApiService{ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedApiService{
...@@ -71,7 +88,91 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -71,7 +88,91 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
@Autowired @Autowired
private DepartmentApiService departmentApiService; private DepartmentApiService departmentApiService;
@Autowired
private MemberUnionidRelatedMapper memberUnionidRelatedMapper;
@Autowired
private StaffDepartmentRelatedService staffDepartmentRelatedService;
@Autowired
private ESDataDynamicOperationApiService eSDataDynamicOperationApiService;
@Override
public List<MemberStoreDTO> listByExTernalUseridAndWxUserId(String externalUserid, String wxUserId) {
List<MemberUnionidRelated> list = memberUnionidRelatedMapper.listByExTernalUseridAndWxUserId(externalUserid, wxUserId);
List<MemberStoreDTO> result = new ArrayList<>();
if(CollectionUtil.isEmpty(list)){
return null;
}
//1、查该staff的门店id
List<TabHaobanStaffDepartmentRelated> relatedIds = staffDepartmentRelatedService.listByWxUserId(wxUserId);
if(CollectionUtil.isEmpty(relatedIds)){
log.info("staff关联部门不存在1");
return null;
}
List<String> departmentIds = relatedIds.stream().map(s->s.getDepartmentId()).collect(Collectors.toList());
if(CollectionUtil.isEmpty(departmentIds)){
log.info("staff部门不存在1");
return null;
}
List<DepartmentDTO> stores = departmentApiService.listByDepartmentIds(departmentIds, 1);
if(CollectionUtil.isEmpty(stores)){
log.info("staff关联门店不存在1");
return null;
}
List<String> storeIds = stores.stream().map(s->s.getRelatedId()).collect(Collectors.toList());
//2、获取member的storeId
for(MemberUnionidRelated tab : list){
String memberId = tab.getMemberId();
if(StringUtils.isEmpty(memberId)){
continue ;
}
String gicEnterpriseId = tab.getEnterpriseId();
JSONObject searchJson = new JSONObject();
searchJson = NewNodeAddUtil.addNewNodeForAnd(MemberDataEnum.member_memberId.getCode(), OperateEnum.OPERATE_EQ.getValue(), memberId,searchJson);
DynamicSearchDTO dynamicSearchDTO = new DynamicSearchDTO();
dynamicSearchDTO.setEnterpriseId(gicEnterpriseId);
dynamicSearchDTO.setColumnCategoryCode("member");
dynamicSearchDTO.setSearchJson(searchJson);
dynamicSearchDTO.setBegin(0);
dynamicSearchDTO.setRecordNumber(1);
log.info("gicEnterpriseId=========>{},searchJson=========={}",gicEnterpriseId,searchJson);
ESResponseQueryBatch responseQuery = eSDataDynamicOperationApiService.queryDataBatch(dynamicSearchDTO, false, null);
if(null == responseQuery){
log.info("会员不存在1");
continue;
}
List<JSONObject> res = responseQuery.getRes();
if(CollectionUtil.isEmpty(res)){
log.info("会员不存在2");
continue;
}
String storeId = "";
for (JSONObject jsonObject : res) {
storeId = jsonObject.get("storeId") == null?"":jsonObject.get("storeId").toString();
}
if(StringUtils.isEmpty(storeId)){
log.info("会员门店不存在");
continue;
}
String[] memberStoreIds =storeId.split(" ");
List<String> memberStoreIdList = Arrays.asList(memberStoreIds);
//取交集
memberStoreIdList.retainAll(storeIds);
if(CollectionUtil.isEmpty(memberStoreIdList)){
continue;
}else{
for(String resultStoreId : memberStoreIdList){
MemberStoreDTO dto = new MemberStoreDTO();
dto.setMemberId(memberId);
dto.setStoreId(resultStoreId);
result.add(dto);
}
}
}
return result;
}
@Override @Override
public MemberUnionidRelatedDTO getByUnionId(String staffId, String unionid) { public MemberUnionidRelatedDTO getByUnionId(String staffId, String unionid) {
TabHaobanStaff staff = staffService.selectById(staffId); TabHaobanStaff staff = staffService.selectById(staffId);
...@@ -137,7 +238,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA ...@@ -137,7 +238,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
for (TabHaobanWxEnterpriseRelated tabHaobanWxEnterpriseRelated : list) { for (TabHaobanWxEnterpriseRelated tabHaobanWxEnterpriseRelated : list) {
String key = "external" + tabHaobanWxEnterpriseRelated.getEnterpriseId() + "_"+ userId1 + "_" + name + "_" + createTime; String key = "external" + tabHaobanWxEnterpriseRelated.getEnterpriseId() + "_"+ userId1 + "_" + name + "_" + createTime;
RedisUtil.lock(key,2l); RedisUtil.lock(key,2l);
dto.setWxEnterpriseId(tabHaobanWxEnterpriseRelated.getEnterpriseId()); dto.setWxEnterpriseId(tabHaobanWxEnterpriseRelated.getWxEnterpriseId());
dto.setEnterpriseId(tabHaobanWxEnterpriseRelated.getEnterpriseId());
MemberDTO member = null; MemberDTO member = null;
TabHaobanStaff staff = staffService.selectByUserIdAndEnterpriseId(userId1, tabHaobanWxEnterpriseRelated.getWxEnterpriseId()); TabHaobanStaff staff = staffService.selectByUserIdAndEnterpriseId(userId1, tabHaobanWxEnterpriseRelated.getWxEnterpriseId());
if(staff == null){ if(staff == null){
......
...@@ -22,6 +22,7 @@ import com.gic.haoban.manage.service.config.Config; ...@@ -22,6 +22,7 @@ import com.gic.haoban.manage.service.config.Config;
import com.gic.haoban.manage.service.entity.*; import com.gic.haoban.manage.service.entity.*;
import com.gic.haoban.manage.service.service.*; import com.gic.haoban.manage.service.service.*;
import com.gic.mq.sdk.GicMQClient; import com.gic.mq.sdk.GicMQClient;
import com.gic.wechat.api.service.qywx.QywxDepartmentApiService;
import java.util.List; import java.util.List;
...@@ -57,6 +58,10 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -57,6 +58,10 @@ public class MessageApiServiceImpl implements MessageApiService {
private WxApplicationService wxApplicationService; private WxApplicationService wxApplicationService;
@Autowired @Autowired
private Config config; private Config config;
@Autowired
private QywxDepartmentApiService qywxDepartmentApiService;
private final String CONTACT_APP = "contactSuiteId";
@Override @Override
public void gicMessageReceive(GicMessageDTO gicMessageDTO) { public void gicMessageReceive(GicMessageDTO gicMessageDTO) {
...@@ -73,7 +78,7 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -73,7 +78,7 @@ public class MessageApiServiceImpl implements MessageApiService {
public void wxMessageReceive(QywxCallBackDTO qywxCallBackDTO) { public void wxMessageReceive(QywxCallBackDTO qywxCallBackDTO) {
GicMQClient clientInstance = GICMQClientUtil.getClientInstance(); GicMQClient clientInstance = GICMQClientUtil.getClientInstance();
try { try {
if(config.getSuiteId().equals(qywxCallBackDTO.getSuiteId())){ if(config.getSuiteId().equals(qywxCallBackDTO.getSuiteId()) || CONTACT_APP.equals(qywxCallBackDTO.getSuiteId())){
log.info("发送消息到dealWxMessageMq,{}", JSON.toJSONString(qywxCallBackDTO)); log.info("发送消息到dealWxMessageMq,{}", JSON.toJSONString(qywxCallBackDTO));
clientInstance.sendMessage("dealWxMessageMq", JSON.toJSONString(qywxCallBackDTO)); clientInstance.sendMessage("dealWxMessageMq", JSON.toJSONString(qywxCallBackDTO));
} }
...@@ -152,18 +157,14 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -152,18 +157,14 @@ public class MessageApiServiceImpl implements MessageApiService {
QywxCallBackDTO dto = JSON.parseObject(param, QywxCallBackDTO.class); QywxCallBackDTO dto = JSON.parseObject(param, QywxCallBackDTO.class);
log.info("【处理微信回调】dto={}",JSON.toJSONString(param)); log.info("【处理微信回调】dto={}",JSON.toJSONString(param));
if(dto != null){ if(dto != null){
String siteId = dto.getSuiteId();
String corpId = dto.getAuthCorpId(); String corpId = dto.getAuthCorpId();
TabHaobanWxEnterprise enterprise = this.enterpriseService.getEnterpriseBycorpId(corpId); TabHaobanWxEnterprise enterprise = this.enterpriseService.getEnterpriseBycorpId(corpId);
if(enterprise != null){ if(enterprise != null){
TabHaobanWxApplication application = wxApplicationService.selectBySiteIdAndWxEnterpriseId(siteId, enterprise.getWxEnterpriseId()); if(dto.getChangeType().endsWith("party")){
if(application != null && application.getApplicationType() == 1){ this.dealDepartment(dto);
if(dto.getChangeType().endsWith("party")){ }else {
this.dealDepartment(dto); this.dealUser(dto);
}else { }
this.dealUser(dto);
}
}
} }
} }
} }
...@@ -195,7 +196,22 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -195,7 +196,22 @@ public class MessageApiServiceImpl implements MessageApiService {
} }
departmentDTO.setWxEnterpriseId(enterprise.getWxEnterpriseId()); departmentDTO.setWxEnterpriseId(enterprise.getWxEnterpriseId());
departmentDTO.setWxDepartmentId(qywxCallBackDTO.getId()+""); departmentDTO.setWxDepartmentId(qywxCallBackDTO.getId()+"");
departmentDTO.setSort(qywxCallBackDTO.getOrder()); if(qywxCallBackDTO.getParentId() != null){
List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listDepartment(qywxCallBackDTO.getAuthCorpId(), qywxCallBackDTO.getSuiteId(), qywxCallBackDTO.getParentId());
if(list != null){
for (com.gic.wechat.api.dto.qywx.DepartmentDTO departmentDTO2 : list) {
if(departmentDTO2.getId().equals(departmentDTO.getDepartmentId())){
departmentDTO.setSort(qywxCallBackDTO.getOrder());
}else{
TabHaobanDepartment tab = this.departmentService.getByWxId(departmentDTO2.getId() + "", enterprise.getWxEnterpriseId());
if(tab != null){
tab.setSort(departmentDTO2.getOrder());
this.departmentService.edit(EntityUtil.changeEntityByJSON(DepartmentDTO.class, tab));
}
}
}
}
}
if(qywxCallBackDTO.getChangeType().equals(WxEditType.ADDDEPART.getCode())){ if(qywxCallBackDTO.getChangeType().equals(WxEditType.ADDDEPART.getCode())){
String response = this.departmentService.add(departmentDTO); String response = this.departmentService.add(departmentDTO);
log.info("微信同步新增部门:{}", JSON.toJSONString(response)); log.info("微信同步新增部门:{}", JSON.toJSONString(response));
...@@ -318,6 +334,7 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -318,6 +334,7 @@ public class MessageApiServiceImpl implements MessageApiService {
if(StringUtils.isNotBlank(staffRelated.getClerkCode())){ if(StringUtils.isNotBlank(staffRelated.getClerkCode())){
staffApiService.cleanGicClerk(staffRelated.getClerkCode(), staffRelated.getDepartmentId()); staffApiService.cleanGicClerk(staffRelated.getClerkCode(), staffRelated.getDepartmentId());
} }
this.staffDepartmentRelatedService.del(EntityUtil.changeEntityByJSON(StaffDepartmentRelatedDTO.class, staffRelated));
this.staffService.delByuserid(oldStaff.getStaffId()); this.staffService.delByuserid(oldStaff.getStaffId());
}else { }else {
log.info("微信同步删除的门店不存在,{}", qywxCallBackDTO.getUserid()); log.info("微信同步删除的门店不存在,{}", qywxCallBackDTO.getUserid());
......
...@@ -47,17 +47,14 @@ import com.gic.haoban.manage.service.dao.mapper.StaffMapper; ...@@ -47,17 +47,14 @@ import com.gic.haoban.manage.service.dao.mapper.StaffMapper;
import com.gic.haoban.manage.service.entity.TabHaobanDepartment; import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.gic.haoban.manage.service.entity.TabHaobanStaff; import com.gic.haoban.manage.service.entity.TabHaobanStaff;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated; import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.entity.TabHaobanWxApplication;
import com.gic.haoban.manage.service.service.DepartmentService; import com.gic.haoban.manage.service.service.DepartmentService;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService; import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.gic.haoban.manage.service.service.StaffService; import com.gic.haoban.manage.service.service.StaffService;
import com.gic.haoban.manage.service.service.UserLoginLogService; import com.gic.haoban.manage.service.service.UserLoginLogService;
import com.gic.haoban.manage.service.service.WxApplicationService;
import com.gic.haoban.manage.service.service.WxEnterpriseService; import com.gic.haoban.manage.service.service.WxEnterpriseService;
import com.gic.wechat.api.dto.qywx.UserDTO; import com.gic.wechat.api.dto.qywx.UserDTO;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
@Service @Service
public class StaffApiServiceImpl implements StaffApiService { public class StaffApiServiceImpl implements StaffApiService {
...@@ -77,8 +74,6 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -77,8 +74,6 @@ public class StaffApiServiceImpl implements StaffApiService {
@Autowired @Autowired
private WxEnterpriseService wxEnterpriseService; private WxEnterpriseService wxEnterpriseService;
@Autowired @Autowired
private WxApplicationService wxApplicationService;
@Autowired
private DepartmentService departmentService; private DepartmentService departmentService;
@Autowired @Autowired
private ClerkService clerkService; private ClerkService clerkService;
...@@ -126,41 +121,38 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -126,41 +121,38 @@ public class StaffApiServiceImpl implements StaffApiService {
//调接口获取 //调接口获取
String wxUserId = ""; String wxUserId = "";
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(staff.getWxEnterpriseId()); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(staff.getWxEnterpriseId());
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(staff.getWxEnterpriseId(),1);
if(enterpriseDTO != null) { if(enterpriseDTO != null) {
if(application != null) { UserDTO userDTO = new UserDTO();
UserDTO userDTO = new UserDTO(); userDTO.setCorpid(enterpriseDTO.getCorpid());
userDTO.setCorpid(enterpriseDTO.getCorpid()); String[] departmentIdArr = departmentIds.split(",");
String[] departmentIdArr = departmentIds.split(","); Integer[] wxDepartmentIdArrIntegers = new Integer[departmentIdArr.length];
Integer[] wxDepartmentIdArrIntegers = new Integer[departmentIdArr.length]; int index = 0;
int index = 0; for (String string : departmentIdArr) {
for (String string : departmentIdArr) { TabHaobanDepartment tabs = departmentService.selectById(string);
TabHaobanDepartment tabs = departmentService.selectById(string); wxDepartmentIdArrIntegers[index] = Integer.parseInt(tabs.getWxDepartmentId());
wxDepartmentIdArrIntegers[index] = Integer.parseInt(tabs.getWxDepartmentId()); index ++;
index ++; }
} userDTO.setDepartment(wxDepartmentIdArrIntegers);
userDTO.setDepartment(wxDepartmentIdArrIntegers); userDTO.setGender(staff.getSex() == null ? null:staff.getSex().toString());
userDTO.setGender(staff.getSex() == null ? null:staff.getSex().toString()); userDTO.setMobile(staff.getPhoneNumber());
userDTO.setMobile(staff.getPhoneNumber()); userDTO.setName(staff.getStaffName());
userDTO.setName(staff.getStaffName()); userDTO.setUserid(staffId);
userDTO.setUserid(staffId); userDTO.setAlias(staff.getNickName());
userDTO.setAlias(staff.getNickName()); userDTO.setExternal_position(tab.getExtendPostion());
userDTO.setExternal_position(tab.getExtendPostion()); userDTO.setPosition(tab.getPostion());
userDTO.setPosition(tab.getPostion()); if(activeFlag == 1) {
if(activeFlag == 1) { userDTO.setTo_invite(true);
userDTO.setTo_invite(true); }
} logger.info("【店员新增】userDTO = {}",JSON.toJSONString(userDTO));
logger.info("【店员新增】userDTO = {}",JSON.toJSONString(userDTO)); JSONResponse jp = qywxUserApiService.createSelfWorkWxUser(userDTO, enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret());
JSONResponse jp = qywxUserApiService.createWorkWxUser(userDTO, enterpriseDTO.getCorpid(), application.getSiteId()); logger.info("【店员新增】jp = {}",JSON.toJSONString(jp));
logger.info("【店员新增】jp = {}",JSON.toJSONString(jp)); if(jp.getErrorCode() != 0) {
if(jp.getErrorCode() != 0) { hr.setCode(0);
hr.setCode(0); hr.setMessage("微信新增失败");
hr.setMessage("微信新增失败"); return hr;
return hr;
}
staffService.add(tab);
wxUserId = staffId;
} }
staffService.add(tab);
wxUserId = staffId;
} }
if(StringUtils.isNotBlank(wxUserId)){ if(StringUtils.isNotBlank(wxUserId)){
String[] departmentIdArr = departmentIds.split(","); String[] departmentIdArr = departmentIds.split(",");
...@@ -229,12 +221,9 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -229,12 +221,9 @@ public class StaffApiServiceImpl implements StaffApiService {
if(relatedList.size() == 1) { if(relatedList.size() == 1) {
TabHaobanStaff staff = staffService.selectById(relatedList.get(0).getStaffId()); TabHaobanStaff staff = staffService.selectById(relatedList.get(0).getStaffId());
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(staff.getWxEnterpriseId()); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(staff.getWxEnterpriseId());
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(staff.getWxEnterpriseId(),1);
if(enterpriseDTO != null) { if(enterpriseDTO != null) {
if(application != null) { JSONResponse jp = qywxUserApiService.deleteSelfWorkWxUser(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), staff.getWxUserId());
JSONResponse jp = qywxUserApiService.deleteWorkWxUser(enterpriseDTO.getCorpid(), application.getSiteId(), staff.getWxUserId()); logger.info("【删除成员】jp={}",JSON.toJSONString(jp));
logger.info("【删除成员】jp={}",JSON.toJSONString(jp));
}
} }
staffDepartmentRelatedService.del(related); staffDepartmentRelatedService.del(related);
staffService.delByuserid(relatedList.get(0).getStaffId()); staffService.delByuserid(relatedList.get(0).getStaffId());
...@@ -297,89 +286,77 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -297,89 +286,77 @@ public class StaffApiServiceImpl implements StaffApiService {
TabHaobanStaff staff = staffService.selectByUserIdAndEnterpriseId(userId,wxEnterpriseId); TabHaobanStaff staff = staffService.selectByUserIdAndEnterpriseId(userId,wxEnterpriseId);
if(staff == null) { if(staff == null) {
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId,1);
if(application == null){
application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId,2);
}
if(enterpriseDTO != null) { if(enterpriseDTO != null) {
if(application != null) { Date now = new Date();
Date now = new Date(); UserDTO user = qywxUserApiService.getSelfWorkWxUser(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), userId);
UserDTO user = qywxUserApiService.getWorkWxUser(enterpriseDTO.getCorpid(), application.getSiteId(), userId); logger.info("【新增用户】user={}",JSON.toJSONString(user));
logger.info("【新增用户】user={}",JSON.toJSONString(user)); TabHaobanStaff tab = new TabHaobanStaff();
TabHaobanStaff tab = new TabHaobanStaff(); tab.setWxUserId(userId);
tab.setWxUserId(userId); tab.setCreateTime(now);
tab.setCreateTime(now); tab.setUpdateTime(now);
tab.setUpdateTime(now); tab.setStatusFlag(1);
tab.setStatusFlag(1); tab.setWxEnterpriseId(wxEnterpriseId);
tab.setWxEnterpriseId(wxEnterpriseId); tab.setPhoneNumber(user.getMobile());
tab.setPhoneNumber(user.getMobile()); if (StringUtils.isNotBlank(user.getName())) {
if (StringUtils.isNotBlank(user.getName())) { tab.setStaffName(EmojiParser.removeAllEmojis(user.getName()));
tab.setStaffName(EmojiParser.removeAllEmojis(user.getName())); }
} if (StringUtils.isNotBlank(user.getAlias())) {
if (StringUtils.isNotBlank(user.getAlias())) { tab.setNickName(EmojiParser.removeAllEmojis(user.getAlias()));
tab.setNickName(EmojiParser.removeAllEmojis(user.getAlias())); }
}
// tab.setNickName(user.getAlias()); // tab.setNickName(user.getAlias());
tab.setNationCode("86"); tab.setNationCode("86");
tab.setSex(user.getGender() == null ? 1:Integer.parseInt(user.getGender())); tab.setSex(user.getGender() == null ? 1:Integer.parseInt(user.getGender()));
tab.setActiveFlag(1);
tab.setPostion(user.getPosition());
tab.setExtendPostion(user.getExternal_position());
if(user.getStatus() != null && user.getStatus() == 1){
tab.setActiveFlag(1); tab.setActiveFlag(1);
tab.setPostion(user.getPosition()); } else {
tab.setExtendPostion(user.getExternal_position()); tab.setActiveFlag(0);
if(user.getStatus() != null && user.getStatus() == 1){ }
tab.setActiveFlag(1); String staffId = staffService.add(tab);
} else {
tab.setActiveFlag(0); Integer[] departmentId = user.getDepartment();
} for (Integer integer : departmentId) {
String staffId = staffService.add(tab); TabHaobanDepartment tabDepartment = departmentService.getByWxId(integer.toString(), wxEnterpriseId);
if(tabDepartment != null){
Integer[] departmentId = user.getDepartment(); TabHaobanStaffDepartmentRelated tabStaff = staffDepartmentRelatedService.getDepartmentIdAndStaffId(tabDepartment.getDepartmentId(), tab.getStaffId());
for (Integer integer : departmentId) { if(tabStaff == null){
TabHaobanDepartment tabDepartment = departmentService.getByWxId(integer.toString(), wxEnterpriseId); StaffDepartmentRelatedDTO dto = new StaffDepartmentRelatedDTO();
if(tabDepartment != null){ dto.setPhoneNumber(user.getMobile());
TabHaobanStaffDepartmentRelated tabStaff = staffDepartmentRelatedService.getDepartmentIdAndStaffId(tabDepartment.getDepartmentId(), tab.getStaffId()); dto.setWxUserId(userId);
if(tabStaff == null){ dto.setStaffId(staffId);
StaffDepartmentRelatedDTO dto = new StaffDepartmentRelatedDTO(); dto.setStaffName(user.getName());
dto.setPhoneNumber(user.getMobile()); dto.setWxEnterpriseId(wxEnterpriseId);
dto.setWxUserId(userId); dto.setStatusFlag(1);
dto.setStaffId(staffId); dto.setDepartmentId(tabDepartment.getDepartmentId());
dto.setStaffName(user.getName()); dto.setNationCode("86");
dto.setWxEnterpriseId(wxEnterpriseId); dto.setStaffName(user.getName());
dto.setStatusFlag(1); staffDepartmentRelatedService.add(dto);
dto.setDepartmentId(tabDepartment.getDepartmentId());
dto.setNationCode("86");
dto.setStaffName(user.getName());
staffDepartmentRelatedService.add(dto);
}
} }
} }
} }
} }
}else{ }else{
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId,1);
if(application == null){
application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId,2);
}
if(enterpriseDTO != null) { if(enterpriseDTO != null) {
if(application != null) { UserDTO user = qywxUserApiService.getSelfWorkWxUser(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), userId);
UserDTO user = qywxUserApiService.getWorkWxUser(enterpriseDTO.getCorpid(), application.getSiteId(), userId); logger.info("【修改用户】user={}",JSON.toJSONString(user));
logger.info("【修改用户】user={}",JSON.toJSONString(user)); Integer[] departmentId = user.getDepartment();
Integer[] departmentId = user.getDepartment(); String departmentIds = "";
String departmentIds = ""; for (Integer integer : departmentId) {
for (Integer integer : departmentId) { TabHaobanDepartment tabDepartment = departmentService.getByWxId(integer.toString(), wxEnterpriseId);
TabHaobanDepartment tabDepartment = departmentService.getByWxId(integer.toString(), wxEnterpriseId); if(tabDepartment != null){
if(tabDepartment != null){ departmentIds += tabDepartment.getDepartmentId() + ",";
departmentIds += tabDepartment.getDepartmentId() + ",";
}
}
if(StringUtils.isNotBlank(departmentIds)){
departmentIds = departmentIds.substring(1,departmentIds.length() - 1);
} }
StaffDTO staffDTO = EntityUtil.changeEntityByJSON(StaffDTO.class, staff);
staffDTO.setWeixinPush(true);
this.staffEdit(staffDTO, departmentIds);
//String staffId = staffService.add(tab);
} }
if(StringUtils.isNotBlank(departmentIds)){
departmentIds = departmentIds.substring(0,departmentIds.length() - 1);
}
StaffDTO staffDTO = EntityUtil.changeEntityByJSON(StaffDTO.class, staff);
staffDTO.setWeixinPush(true);
this.staffEdit(staffDTO, departmentIds);
//String staffId = staffService.add(tab);
} }
} }
} }
...@@ -456,7 +433,7 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -456,7 +433,7 @@ public class StaffApiServiceImpl implements StaffApiService {
ClerkDTO clerkDTO= clerkService.getClerkByCodeNoStatus(enterpriseId,related.getClerkCode()); ClerkDTO clerkDTO= clerkService.getClerkByCodeNoStatus(enterpriseId,related.getClerkCode());
//if(!staffDTO.getPhoneNumber().equals(related.getPhoneNumber())||!staffDTO.getStaffName().equals(clerkDTO.getStaffName())){ //if(!staffDTO.getPhoneNumber().equals(related.getPhoneNumber())||!staffDTO.getStaffName().equals(clerkDTO.getStaffName())){
String headPic = staffDTO.getHeadImg(); String headPic = staffDTO.getHeadImg();
if(clerkDTO != null && (!clerkDTO.getClerkName().equals(staffName) || !staffDTO.getPhoneNumber().equals(clerkDTO.getPhoneNumber())) if(clerkDTO != null && (StringUtils.isNotBlank(staffName) && !clerkDTO.getClerkName().equals(staffName) || !staffDTO.getPhoneNumber().equals(clerkDTO.getPhoneNumber()))
|| (org.apache.commons.lang3.StringUtils.isNotBlank(headPic) && !headPic.equals(clerkDTO.getImageUrl())) || (org.apache.commons.lang3.StringUtils.isNotBlank(headPic) && !headPic.equals(clerkDTO.getImageUrl()))
|| !staffDTO.getSex().equals(clerkDTO.getClerkGender())){ || !staffDTO.getSex().equals(clerkDTO.getClerkGender())){
logger.info("【员工修改】clerkDTO={}",JSON.toJSONString(clerkDTO)); logger.info("【员工修改】clerkDTO={}",JSON.toJSONString(clerkDTO));
...@@ -492,31 +469,28 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -492,31 +469,28 @@ public class StaffApiServiceImpl implements StaffApiService {
Boolean weixinPush = staffDTO.getWeixinPush(); Boolean weixinPush = staffDTO.getWeixinPush();
if(weixinPush == null || !weixinPush){ if(weixinPush == null || !weixinPush){
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(oldStaff.getWxEnterpriseId()); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(oldStaff.getWxEnterpriseId());
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(oldStaff.getWxEnterpriseId(),1);
if(enterpriseDTO != null) { if(enterpriseDTO != null) {
if(application != null) { UserDTO userDTO = new UserDTO();
UserDTO userDTO = new UserDTO(); userDTO.setCorpid(enterpriseDTO.getCorpid());
userDTO.setCorpid(enterpriseDTO.getCorpid()); userDTO.setAlias(staffDTO.getNickName());
userDTO.setAlias(staffDTO.getNickName());
String[] departmentIdArr = departmentIds.split(",");
String[] departmentIdArr = departmentIds.split(","); Integer[] wxDepartmentIdArrIntegers = new Integer[departmentIdArr.length];
Integer[] wxDepartmentIdArrIntegers = new Integer[departmentIdArr.length]; int index = 0;
int index = 0; for (String string : departmentIdArr) {
for (String string : departmentIdArr) { TabHaobanDepartment tabs = departmentService.selectById(string);
TabHaobanDepartment tabs = departmentService.selectById(string); wxDepartmentIdArrIntegers[index] = Integer.parseInt(tabs.getWxDepartmentId());
wxDepartmentIdArrIntegers[index] = Integer.parseInt(tabs.getWxDepartmentId()); index ++;
index ++;
}
userDTO.setDepartment(wxDepartmentIdArrIntegers);
userDTO.setGender(staffDTO.getSex() == null ?"":staffDTO.getSex().toString());
userDTO.setMobile(staffDTO.getPhoneNumber());
userDTO.setName(staffDTO.getStaffName());
userDTO.setUserid(oldStaff.getWxUserId());
userDTO.setPosition(staffDTO.getPostion());
userDTO.setExternal_position(staffDTO.getExtendPostion());
JSONResponse jp = qywxUserApiService.updateWorkWxUser(userDTO, enterpriseDTO.getCorpid(), application.getSiteId());
} }
userDTO.setDepartment(wxDepartmentIdArrIntegers);
userDTO.setGender(staffDTO.getSex() == null ?"":staffDTO.getSex().toString());
userDTO.setMobile(staffDTO.getPhoneNumber());
userDTO.setName(staffDTO.getStaffName());
userDTO.setUserid(oldStaff.getWxUserId());
userDTO.setPosition(staffDTO.getPostion());
userDTO.setExternal_position(staffDTO.getExtendPostion());
JSONResponse jp = qywxUserApiService.updateSelfWorkWxUser(userDTO, enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret());
} }
} }
} }
...@@ -624,12 +598,15 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -624,12 +598,15 @@ public class StaffApiServiceImpl implements StaffApiService {
continue; continue;
} }
if ("postionName".equals(name)) { if ("positionName".equals(name)) {
clerkMid.setPostionName(value); clerkMid.setPostionName(value);
continue; continue;
} }
if ("nationcode".equals(name)) { if ("nationcode".equals(name)) {
if(StringUtils.isNotBlank(value) && value.startsWith("+")){
value = value.replace("+", "");
}
clerkMid.setNationcode((StringUtils.isBlank(value) ? "86" : value)); clerkMid.setNationcode((StringUtils.isBlank(value) ? "86" : value));
continue; continue;
} }
...@@ -719,6 +696,7 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -719,6 +696,7 @@ public class StaffApiServiceImpl implements StaffApiService {
//修改 //修改
}else{ }else{
staff.setHeadImg(headPic); staff.setHeadImg(headPic);
//staff.setPostion(postion);
// staff.setStaffName(staffName); // staff.setStaffName(staffName);
if(staff.getActiveFlag() != null && staff.getActiveFlag() != 1){ if(staff.getActiveFlag() != null && staff.getActiveFlag() != 1){
staff.setStaffName(staffName); staff.setStaffName(staffName);
...@@ -773,12 +751,11 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -773,12 +751,11 @@ public class StaffApiServiceImpl implements StaffApiService {
return staff; return staff;
} }
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId); WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(wxEnterpriseId);
TabHaobanWxApplication application = wxApplicationService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 1);
if (null == enterpriseDTO || application == null) { if (null == enterpriseDTO ) {
return null; return null;
} }
String userId = qywxUserApiService.getWxUserIdByPhonenumber(enterpriseDTO.getCorpid(), application.getSiteId(), phoneNumber); String userId = qywxUserApiService.getSelfWxUserIdByPhonenumber(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), phoneNumber);
logger.info("获取userId:{},{}", phoneNumber, userId); logger.info("获取userId:{},{}", phoneNumber, userId);
if (userId == null) { if (userId == null) {
return null; return null;
...@@ -793,8 +770,8 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -793,8 +770,8 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
@Override @Override
public void initWxUser(String corpid, String suiteid, String wxEnterpriseId, Integer wxDepartmentId) { public void initWxUser(String corpid, String contactSecret, String wxEnterpriseId, Integer wxDepartmentId) {
List<UserDTO> list = this.qywxUserApiService.listDepartmentUser(corpid, suiteid, wxDepartmentId.toString(), 0); List<UserDTO> list = this.qywxUserApiService.listSelfDepartmentUser(corpid, contactSecret, wxDepartmentId.toString(), 0);
if(CollectionUtils.isNotEmpty(list)){ if(CollectionUtils.isNotEmpty(list)){
for(UserDTO dto : list){ for(UserDTO dto : list){
this.wxGetAdd(dto.getUserid(), wxEnterpriseId); this.wxGetAdd(dto.getUserid(), wxEnterpriseId);
......
...@@ -28,6 +28,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela ...@@ -28,6 +28,7 @@ public class StaffDepartmentRelatedApiServiceImpl implements StaffDepartmentRela
private StaffDepartmentRelatedService staffDepartmentRelatedService; private StaffDepartmentRelatedService staffDepartmentRelatedService;
@Autowired @Autowired
private StaffDepartmentRelatedMapper staffDepartmentRelatedMapper; private StaffDepartmentRelatedMapper staffDepartmentRelatedMapper;
@Override @Override
public List<StaffDepartmentRelatedDTO> listByDepartmentId( public List<StaffDepartmentRelatedDTO> listByDepartmentId(
String departmentId) { String departmentId) {
......
...@@ -47,10 +47,6 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -47,10 +47,6 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
private WxEnterpriseMapper wxEnterpriseMapper; private WxEnterpriseMapper wxEnterpriseMapper;
@Autowired @Autowired
private WxApplicationService wxApplicationService; private WxApplicationService wxApplicationService;
@Autowired
private QywxDepartmentApiService qywxDepartmentApiService;
@Autowired
private DepartmentService departmentService;
@Override @Override
public void callbackReviceEnterprise(QywxCorpInfoSimpleDTO dto) { public void callbackReviceEnterprise(QywxCorpInfoSimpleDTO dto) {
...@@ -63,8 +59,9 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService { ...@@ -63,8 +59,9 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
wxDTO.setWxEnterpriseId(enterprise.getWxEnterpriseId()); wxDTO.setWxEnterpriseId(enterprise.getWxEnterpriseId());
wxDTO.setStatusFlag(1); wxDTO.setStatusFlag(1);
wxEnterpriseService.update(wxDTO); wxEnterpriseService.update(wxDTO);
}else{
wxEnterpriseId = wxEnterpriseService.add(wxDTO);
} }
wxEnterpriseId = wxEnterpriseService.add(wxDTO);
String userId = dto.getUserid(); String userId = dto.getUserid();
String name = dto.getName(); String name = dto.getName();
if(StringUtils.isNotBlank(userId)) { if(StringUtils.isNotBlank(userId)) {
......
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
<dubbo:reference interface="com.gic.enterprise.api.service.StoreService" id="storeService"/> <dubbo:reference interface="com.gic.enterprise.api.service.StoreService" id="storeService"/>
<dubbo:reference interface="com.gic.member.api.service.MemberOpenCardBusinessService" id="memberOpenCardBusinessService"/> <dubbo:reference interface="com.gic.member.api.service.MemberOpenCardBusinessService" id="memberOpenCardBusinessService"/>
<dubbo:reference id="eSDataDynamicOperationApiService" interface="com.gic.search.engine.api.service.dynamic.ESDataDynamicOperationApiService" timeout="10000"/>
</beans> </beans>
\ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
<result column="member_id" property="memberId" jdbcType="VARCHAR" /> <result column="member_id" property="memberId" jdbcType="VARCHAR" />
<result column="unionid" property="unionid" jdbcType="VARCHAR" /> <result column="unionid" property="unionid" jdbcType="VARCHAR" />
<result column="wx_enterprise_id" property="wxEnterpriseId" jdbcType="VARCHAR" /> <result column="wx_enterprise_id" property="wxEnterpriseId" jdbcType="VARCHAR" />
<result column="enterprise_id" property="enterpriseId" jdbcType="VARCHAR" />
<result column="status_flag" property="statusFlag" jdbcType="INTEGER" /> <result column="status_flag" property="statusFlag" jdbcType="INTEGER" />
<result column="external_userid" property="externalUserid" jdbcType="VARCHAR" /> <result column="external_userid" property="externalUserid" jdbcType="VARCHAR" />
<result column="wx_user_id" property="wxUserId" jdbcType="VARCHAR" /> <result column="wx_user_id" property="wxUserId" jdbcType="VARCHAR" />
...@@ -17,7 +18,7 @@ ...@@ -17,7 +18,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List" > <sql id="Base_Column_List" >
member_unionid_related_id, member_id, unionid, wx_enterprise_id, status_flag, external_userid, member_unionid_related_id, member_id, unionid, wx_enterprise_id, status_flag, external_userid,
wx_user_id, create_time, update_time,add_create_time,self_external_userid,external_name wx_user_id, create_time, update_time,add_create_time,self_external_userid,external_name,enterprise_id
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select select
...@@ -33,11 +34,11 @@ ...@@ -33,11 +34,11 @@
insert into tab_haoban_member_unionid_related (member_unionid_related_id, member_id, insert into tab_haoban_member_unionid_related (member_unionid_related_id, member_id,
unionid, wx_enterprise_id, status_flag, unionid, wx_enterprise_id, status_flag,
external_userid, wx_user_id, create_time, external_userid, wx_user_id, create_time,
update_time,add_create_time,self_external_userid,external_name) update_time,add_create_time,self_external_userid,external_name,enterprise_id)
values (#{memberUnionidRelatedId,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR}, values (#{memberUnionidRelatedId,jdbcType=VARCHAR}, #{memberId,jdbcType=VARCHAR},
#{unionid,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER}, #{unionid,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{statusFlag,jdbcType=INTEGER},
#{externalUserid,jdbcType=VARCHAR}, #{wxUserId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{externalUserid,jdbcType=VARCHAR}, #{wxUserId,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP},#{addCreateTime},#{selfExternalUserid},#{externalName}) #{updateTime,jdbcType=TIMESTAMP},#{addCreateTime},#{selfExternalUserid},#{externalName},#{enterpriseId})
</insert> </insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated" > <insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.MemberUnionidRelated" >
insert into tab_haoban_member_unionid_related insert into tab_haoban_member_unionid_related
...@@ -54,6 +55,9 @@ ...@@ -54,6 +55,9 @@
<if test="wxEnterpriseId != null" > <if test="wxEnterpriseId != null" >
wx_enterprise_id, wx_enterprise_id,
</if> </if>
<if test="enterpriseId != null" >
enterprise_id,
</if>
<if test="statusFlag != null" > <if test="statusFlag != null" >
status_flag, status_flag,
</if> </if>
...@@ -92,6 +96,9 @@ ...@@ -92,6 +96,9 @@
<if test="wxEnterpriseId != null" > <if test="wxEnterpriseId != null" >
#{wxEnterpriseId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR},
</if> </if>
<if test="enterpriseId != null" >
#{enterpriseId,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null" > <if test="statusFlag != null" >
#{statusFlag,jdbcType=INTEGER}, #{statusFlag,jdbcType=INTEGER},
</if> </if>
...@@ -130,6 +137,9 @@ ...@@ -130,6 +137,9 @@
<if test="wxEnterpriseId != null" > <if test="wxEnterpriseId != null" >
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}, wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if> </if>
<if test="enterpriseId != null" >
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
</if>
<if test="statusFlag != null" > <if test="statusFlag != null" >
status_flag = #{statusFlag,jdbcType=INTEGER}, status_flag = #{statusFlag,jdbcType=INTEGER},
</if> </if>
...@@ -162,6 +172,7 @@ ...@@ -162,6 +172,7 @@
set member_id = #{memberId,jdbcType=VARCHAR}, set member_id = #{memberId,jdbcType=VARCHAR},
unionid = #{unionid,jdbcType=VARCHAR}, unionid = #{unionid,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}, wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
status_flag = #{statusFlag,jdbcType=INTEGER}, status_flag = #{statusFlag,jdbcType=INTEGER},
external_userid = #{externalUserid,jdbcType=VARCHAR}, external_userid = #{externalUserid,jdbcType=VARCHAR},
wx_user_id = #{wxUserId,jdbcType=VARCHAR}, wx_user_id = #{wxUserId,jdbcType=VARCHAR},
...@@ -198,6 +209,14 @@ ...@@ -198,6 +209,14 @@
and status_flag = 1 and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId} and wx_enterprise_id = #{wxEnterpriseId}
</select> </select>
<select id="listByExTernalUseridAndWxUserId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId}
and status_flag = 1
and external_userid = #{externalUserid}
</select>
<select id="getByParams" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="getByParams" resultMap="BaseResultMap" parameterType="java.lang.String" >
select select
...@@ -205,7 +224,7 @@ ...@@ -205,7 +224,7 @@
from tab_haoban_member_unionid_related from tab_haoban_member_unionid_related
where wx_user_id = #{wxUserId} where wx_user_id = #{wxUserId}
and status_flag = 1 and status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId} and enterprise_id = #{enterpriseId}
and external_name = #{externalName} and external_name = #{externalName}
and add_create_time = #{addCreateTime} and add_create_time = #{addCreateTime}
</select> </select>
......
...@@ -213,6 +213,7 @@ ...@@ -213,6 +213,7 @@
from tab_haoban_staff_department_related from tab_haoban_staff_department_related
where staff_id = #{staffId,jdbcType=VARCHAR} where staff_id = #{staffId,jdbcType=VARCHAR}
and status_flag = 1 and status_flag = 1
group by department_id
</select> </select>
<update id="delByUserid" > <update id="delByUserid" >
update tab_haoban_staff_department_related update tab_haoban_staff_department_related
...@@ -232,6 +233,14 @@ ...@@ -232,6 +233,14 @@
limit 1 limit 1
</select> </select>
<select id="listByWxUserId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_staff_department_related
where wx_user_id = #{wxUserId}
and status_flag = 1
</select>
<select id="countByDepartmentId" resultType="java.lang.Integer" parameterType="java.lang.String" > <select id="countByDepartmentId" resultType="java.lang.Integer" parameterType="java.lang.String" >
select select
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
<result column="round_logo_url" property="roundLogoUrl" jdbcType="VARCHAR" /> <result column="round_logo_url" property="roundLogoUrl" jdbcType="VARCHAR" />
<result column="wx_secret_key" property="wxSecretKey" jdbcType="VARCHAR" /> <result column="wx_secret_key" property="wxSecretKey" jdbcType="VARCHAR" />
<result column="member_secret" property="memberSecret" jdbcType="VARCHAR"/> <result column="member_secret" property="memberSecret" jdbcType="VARCHAR"/>
<result column="contact_secret" property="contactSecret" jdbcType="VARCHAR"/>
<result column="level" property="level" jdbcType="INTEGER" /> <result column="level" property="level" jdbcType="INTEGER" />
<result column="contact_flag" property="contactFlag" jdbcType="INTEGER" /> <result column="contact_flag" property="contactFlag" jdbcType="INTEGER" />
<result column="bind_flag" property="bindFlag" jdbcType="INTEGER" /> <result column="bind_flag" property="bindFlag" jdbcType="INTEGER" />
...@@ -38,7 +39,7 @@ ...@@ -38,7 +39,7 @@
corp_user_max, corp_full_name, subject_type, verified_end_time, corp_wxqrcode, corp_scale, corp_user_max, corp_full_name, subject_type, verified_end_time, corp_wxqrcode, corp_scale,
corp_industry, corp_sub_industry, location, auth_info, agent, agentid, appid, name, corp_industry, corp_sub_industry, location, auth_info, agent, agentid, appid, name,
square_logo_url, round_logo_url, level, bind_flag, status_flag, create_time, update_time,contact_flag,wx_secret_key square_logo_url, round_logo_url, level, bind_flag, status_flag, create_time, update_time,contact_flag,wx_secret_key
,member_secret ,member_secret,contact_secret
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select select
...@@ -59,7 +60,7 @@ ...@@ -59,7 +60,7 @@
auth_info, agent, agentid, auth_info, agent, agentid,
appid, name, square_logo_url, appid, name, square_logo_url,
round_logo_url, level, bind_flag, round_logo_url, level, bind_flag,
status_flag, create_time, update_time,contact_flag,wx_secret_key status_flag, create_time, update_time,contact_flag,wx_secret_key,contact_secret
) )
values (#{wxEnterpriseId,jdbcType=VARCHAR}, #{corpid,jdbcType=VARCHAR}, #{permanentCode,jdbcType=VARCHAR}, values (#{wxEnterpriseId,jdbcType=VARCHAR}, #{corpid,jdbcType=VARCHAR}, #{permanentCode,jdbcType=VARCHAR},
#{corpName,jdbcType=VARCHAR}, #{corpType,jdbcType=VARCHAR}, #{corpSquareLogoUrl,jdbcType=VARCHAR}, #{corpName,jdbcType=VARCHAR}, #{corpType,jdbcType=VARCHAR}, #{corpSquareLogoUrl,jdbcType=VARCHAR},
...@@ -69,7 +70,7 @@ ...@@ -69,7 +70,7 @@
#{authInfo,jdbcType=VARCHAR}, #{agent,jdbcType=VARCHAR}, #{agentid,jdbcType=VARCHAR}, #{authInfo,jdbcType=VARCHAR}, #{agent,jdbcType=VARCHAR}, #{agentid,jdbcType=VARCHAR},
#{appid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{squareLogoUrl,jdbcType=VARCHAR}, #{appid,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{squareLogoUrl,jdbcType=VARCHAR},
#{roundLogoUrl,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER}, #{bindFlag,jdbcType=INTEGER}, #{roundLogoUrl,jdbcType=VARCHAR}, #{level,jdbcType=INTEGER}, #{bindFlag,jdbcType=INTEGER},
#{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},#{contactFlag},#{wxSecretKey} #{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},#{contactFlag},#{wxSecretKey},#{contactSecret}
) )
</insert> </insert>
<insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise" > <insert id="insertSelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise" >
...@@ -162,6 +163,9 @@ ...@@ -162,6 +163,9 @@
<if test="wxSecretKey != null" > <if test="wxSecretKey != null" >
wx_secret_key, wx_secret_key,
</if> </if>
<if test="contactSecret != null" >
contact_secret,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides="," > <trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="wxEnterpriseId != null" > <if test="wxEnterpriseId != null" >
...@@ -251,6 +255,9 @@ ...@@ -251,6 +255,9 @@
<if test="wxSecretKey != null" > <if test="wxSecretKey != null" >
#{wxSecretKey,jdbcType=TIMESTAMP}, #{wxSecretKey,jdbcType=TIMESTAMP},
</if> </if>
<if test="contactSecret != null" >
#{contactSecret,jdbcType=TIMESTAMP},
</if>
</trim> </trim>
</insert> </insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise" > <update id="updateByPrimaryKeySelective" parameterType="com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise" >
...@@ -340,6 +347,9 @@ ...@@ -340,6 +347,9 @@
<if test="wxSecretKey != null" > <if test="wxSecretKey != null" >
wx_secret_key = #{wxSecretKey,jdbcType=VARCHAR}, wx_secret_key = #{wxSecretKey,jdbcType=VARCHAR},
</if> </if>
<if test="contactSecret != null" >
contact_secret = #{contactSecret,jdbcType=VARCHAR},
</if>
</set> </set>
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
</update> </update>
...@@ -372,6 +382,7 @@ ...@@ -372,6 +382,7 @@
contact_flag = #{contactFlag,jdbcType=INTEGER}, contact_flag = #{contactFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
wx_secret_key = #{wxSecretKey,jdbcType=VARCHAR}, wx_secret_key = #{wxSecretKey,jdbcType=VARCHAR},
contact_secret = #{contactSecret,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP} update_time = #{updateTime,jdbcType=TIMESTAMP}
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
</update> </update>
......
...@@ -19,7 +19,7 @@ public class ServiceTest { ...@@ -19,7 +19,7 @@ public class ServiceTest {
@Test @Test
public void test() { public void test() {
wxEnterpriseRelatedApiService.listEnterpriseByWxEnterpriseId("073e89a37eb14acabf258e59a57359b6"); //wxEnterpriseRelatedApiService.listEnterpriseByWxEnterpriseId("073e89a37eb14acabf258e59a57359b6");
} }
......
...@@ -48,7 +48,7 @@ public class AdminController extends WebBaseController{ ...@@ -48,7 +48,7 @@ public class AdminController extends WebBaseController{
public HaobanResponse adminList() { public HaobanResponse adminList() {
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser(); LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId(); String wxEnterpriseId = login.getWxEnterpriseId();
WxApplicationDTO application = wxApplicationApiService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 1); WxApplicationDTO application = wxApplicationApiService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 2);
WxEnterpriseDTO enterprise = wxEnterpriseApiService.getOne(wxEnterpriseId); WxEnterpriseDTO enterprise = wxEnterpriseApiService.getOne(wxEnterpriseId);
logger.info("【管理员查询】corpid={},siteId={},agentId={}",enterprise.getCorpid(),application.getSiteId(),application.getAgentId()); logger.info("【管理员查询】corpid={},siteId={},agentId={}",enterprise.getCorpid(),application.getSiteId(),application.getAgentId());
String adminList = qywxSuiteApiService.getAdminList(enterprise.getCorpid(), application.getSiteId(), Integer.parseInt(application.getAgentId())); String adminList = qywxSuiteApiService.getAdminList(enterprise.getCorpid(), application.getSiteId(), Integer.parseInt(application.getAgentId()));
......
...@@ -102,13 +102,18 @@ public class ApplicationController extends WebBaseController{ ...@@ -102,13 +102,18 @@ public class ApplicationController extends WebBaseController{
} }
@RequestMapping("has-bind-contract") @RequestMapping("has-bind-contract")
public HaobanResponse hasBindContract(){ public HaobanResponse hasBindContract(){
LoginVO login = AuthRequestUtil.getSessionUser(); LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId(); String wxEnterpriseId = login.getWxEnterpriseId();
WxApplicationDTO wxApplicationDTO = this.wxApplicationApiService.selectByWxEnterpriseIdAndApplicationType(wxEnterpriseId, 1); WxEnterpriseDTO enterpriseDTO = this.wxEnterpriseApiService.getOne(wxEnterpriseId);
if(wxApplicationDTO != null){ if(enterpriseDTO != null){
return resultResponse(HaoBanErrCode.ERR_1, true); if(StringUtils.isNotBlank(enterpriseDTO.getContactSecret()) && enterpriseDTO.getContactFlag() != null && enterpriseDTO.getContactFlag() == 0){
this.departmentApiService.initwxDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), enterpriseDTO.getWxEnterpriseId());
enterpriseDTO.setContactFlag(1);
wxEnterpriseApiService.update(enterpriseDTO);
}
} }
return resultResponse(HaoBanErrCode.ERR_1, false);
return resultResponse(HaoBanErrCode.ERR_1, true);
} }
@RequestMapping("get-auth-url") @RequestMapping("get-auth-url")
...@@ -136,7 +141,7 @@ public class ApplicationController extends WebBaseController{ ...@@ -136,7 +141,7 @@ public class ApplicationController extends WebBaseController{
applicationDTO.setAgentName(dto.getAgentName()); applicationDTO.setAgentName(dto.getAgentName());
applicationDTO.setSiteId(dto.getSuiteId()); applicationDTO.setSiteId(dto.getSuiteId());
wxApplicationApiService.addSuite(applicationDTO); wxApplicationApiService.addSuite(applicationDTO);
this.departmentApiService.initwxDepartment(dto.getCorpid(), suiteId, enterpriseDTO.getWxEnterpriseId()); this.departmentApiService.initwxDepartment(dto.getCorpid(), enterpriseDTO.getContactSecret(), enterpriseDTO.getWxEnterpriseId());
enterpriseDTO.setContactFlag(1); enterpriseDTO.setContactFlag(1);
wxEnterpriseApiService.update(enterpriseDTO); wxEnterpriseApiService.update(enterpriseDTO);
} }
......
...@@ -689,40 +689,68 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -689,40 +689,68 @@ public class DepartmentContoller extends WebBaseController{
List<ClerkListDTO> list = clerkService.getClerkByStoreId(store.getEnterpriseId(), storeId); List<ClerkListDTO> list = clerkService.getClerkByStoreId(store.getEnterpriseId(), storeId);
logger.info("【处理门店下导购】list={}",JSON.toJSONString(list)); logger.info("【处理门店下导购】list={}",JSON.toJSONString(list));
for (ClerkListDTO clerkListDTO : list) { for (ClerkListDTO clerkListDTO : list) {
String nationcode = clerkListDTO.getNationcode(); try {
String phoneNumber = clerkListDTO.getPhoneNumber(); String nationcode = clerkListDTO.getNationcode();
if(StringUtils.isBlank(phoneNumber)){ if(StringUtils.isNotBlank(nationcode) && nationcode.startsWith("+")){
continue; nationcode = nationcode.replace("+", "");
} }
String clerkCode = clerkListDTO.getClerkCode(); String phoneNumber = clerkListDTO.getPhoneNumber();
StaffDTO staff = staffApiService.selectByNationcodeAndPhoneNumber(wxEnterpriseId, nationcode, phoneNumber); if(StringUtils.isBlank(phoneNumber)){
if(staff == null){ continue;
staff = new StaffDTO();
staff.setNationCode(nationcode);
staff.setActiveFlag(1);
staff.setDepartmentIds(departmentId);
staff.setBindFlag(1);
staff.setClerkCode(clerkCode);
staff.setNickName(clerkListDTO.getClerkName());
staff.setStaffName(clerkListDTO.getClerkName());
staff.setPostion(clerkListDTO.getPositionName());
staff.setWxEnterpriseId(wxEnterpriseId);
staff.setPhoneNumber(phoneNumber);
try {
staff.setSex(clerkListDTO.getClerkGender() == null?null:Integer.parseInt(clerkListDTO.getClerkGender()));
} catch (Exception e) {
logger.info("【同步店员】设置性别错误sex={}",clerkListDTO.getClerkGender());
} }
staff.setSyncPostionFlag(1); String clerkCode = clerkListDTO.getClerkCode();
StaffDTO staff = staffApiService.selectByNationcodeAndPhoneNumber(wxEnterpriseId, nationcode, phoneNumber);
ServiceResponse hr = staffApiService.add(staff, departmentId); if(staff == null){
if(hr.getCode() == 1){ staff = new StaffDTO();
StaffDepartmentRelatedDTO staffRelated = staffApiService.getDepartmentIdAndStaffId(departmentId, hr.getResult().toString()); staff.setNationCode(nationcode);
staff.setActiveFlag(1);
staff.setDepartmentIds(departmentId);
staff.setBindFlag(1);
staff.setClerkCode(clerkCode);
staff.setNickName(clerkListDTO.getClerkName());
staff.setStaffName(clerkListDTO.getClerkName());
staff.setPostion(clerkListDTO.getPositionName());
staff.setWxEnterpriseId(wxEnterpriseId);
staff.setPhoneNumber(phoneNumber);
try {
staff.setSex(clerkListDTO.getClerkGender() == null?null:Integer.parseInt(clerkListDTO.getClerkGender()));
} catch (Exception e) {
logger.info("【同步店员】设置性别错误sex={}",clerkListDTO.getClerkGender());
}
staff.setSyncPostionFlag(1);
ServiceResponse hr = staffApiService.add(staff, departmentId);
if(hr.getCode() == 1){
StaffDepartmentRelatedDTO staffRelated = staffApiService.getDepartmentIdAndStaffId(departmentId, hr.getResult().toString());
StaffDepartmentRelatedDTO isCodeExist = staffApiService.getDepartmentIdAndCode(departmentId,clerkCode);
if(staffRelated != null && isCodeExist == null){
staffRelated.setClerkCode(clerkCode);
staffDepartmentRelatedApiService.updateById(staffRelated);
ClerkDTO clerkDTO= clerkService.getClerkByCodeNoStatus(enterpriseId,clerkCode);
if(clerkDTO != null && (!clerkDTO.getClerkName().equals(staff.getStaffName()) || !staff.getPhoneNumber().equals(clerkDTO.getPhoneNumber()))){
logger.info("【员工修改】clerkDTO={}",JSON.toJSONString(clerkDTO));
clerkDTO.setClerkName(staff.getStaffName());
clerkDTO.setPhoneNumber(staff.getPhoneNumber());
clerkService.updateClerk(clerkDTO);
}
}
}
}else{
String staffId = staff.getStaffId();
List<StaffDepartmentRelatedDTO> relatedList = staffApiService.listStaffDepartmentByStaffId(staffId);
String departmentIds = departmentId;
for (StaffDepartmentRelatedDTO staffDepartmentRelatedDTO : relatedList) {
departmentIds += "," + staffDepartmentRelatedDTO.getDepartmentId();
}
Map<String,StaffDepartmentRelatedDTO> map = com.gic.commons.util.CollectionUtil.toMap(relatedList, "departmentId");
if(map.get(departmentId) == null){
staffApiService.staffEdit(staff, departmentIds);
}
StaffDepartmentRelatedDTO staffRelated = staffApiService.getDepartmentIdAndStaffId(departmentId, staffId);
//如果这个人是未绑定的 则绑定clerk
StaffDepartmentRelatedDTO isCodeExist = staffApiService.getDepartmentIdAndCode(departmentId,clerkCode); StaffDepartmentRelatedDTO isCodeExist = staffApiService.getDepartmentIdAndCode(departmentId,clerkCode);
if(staffRelated != null && isCodeExist == null){ if(StringUtils.isBlank(staffRelated.getClerkCode()) && isCodeExist == null){
staffRelated.setClerkCode(clerkCode);
staffDepartmentRelatedApiService.updateById(staffRelated);
ClerkDTO clerkDTO= clerkService.getClerkByCodeNoStatus(enterpriseId,clerkCode); ClerkDTO clerkDTO= clerkService.getClerkByCodeNoStatus(enterpriseId,clerkCode);
if(clerkDTO != null && (!clerkDTO.getClerkName().equals(staff.getStaffName()) || !staff.getPhoneNumber().equals(clerkDTO.getPhoneNumber()))){ if(clerkDTO != null && (!clerkDTO.getClerkName().equals(staff.getStaffName()) || !staff.getPhoneNumber().equals(clerkDTO.getPhoneNumber()))){
logger.info("【员工修改】clerkDTO={}",JSON.toJSONString(clerkDTO)); logger.info("【员工修改】clerkDTO={}",JSON.toJSONString(clerkDTO));
...@@ -730,34 +758,13 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -730,34 +758,13 @@ public class DepartmentContoller extends WebBaseController{
clerkDTO.setPhoneNumber(staff.getPhoneNumber()); clerkDTO.setPhoneNumber(staff.getPhoneNumber());
clerkService.updateClerk(clerkDTO); clerkService.updateClerk(clerkDTO);
} }
staffRelated.setClerkCode(clerkCode);
staffDepartmentRelatedApiService.updateById(staffRelated);
} }
} }
}else{ } catch (Exception e) {
String staffId = staff.getStaffId(); logger.info("同步失败");
List<StaffDepartmentRelatedDTO> relatedList = staffApiService.listStaffDepartmentByStaffId(staffId);
String departmentIds = departmentId;
for (StaffDepartmentRelatedDTO staffDepartmentRelatedDTO : relatedList) {
departmentIds += "," + staffDepartmentRelatedDTO.getDepartmentId();
}
Map<String,StaffDepartmentRelatedDTO> map = com.gic.commons.util.CollectionUtil.toMap(relatedList, "departmentId");
if(map.get(departmentId) == null){
staffApiService.staffEdit(staff, departmentIds);
}
StaffDepartmentRelatedDTO staffRelated = staffApiService.getDepartmentIdAndStaffId(departmentId, staffId);
//如果这个人是未绑定的 则绑定clerk
StaffDepartmentRelatedDTO isCodeExist = staffApiService.getDepartmentIdAndCode(departmentId,clerkCode);
if(StringUtils.isBlank(staffRelated.getClerkCode()) && isCodeExist == null){
ClerkDTO clerkDTO= clerkService.getClerkByCodeNoStatus(enterpriseId,clerkCode);
if(clerkDTO != null && (!clerkDTO.getClerkName().equals(staff.getStaffName()) || !staff.getPhoneNumber().equals(clerkDTO.getPhoneNumber()))){
logger.info("【员工修改】clerkDTO={}",JSON.toJSONString(clerkDTO));
clerkDTO.setClerkName(staff.getStaffName());
clerkDTO.setPhoneNumber(staff.getPhoneNumber());
clerkService.updateClerk(clerkDTO);
}
staffRelated.setClerkCode(clerkCode);
staffDepartmentRelatedApiService.updateById(staffRelated);
}
} }
} }
}else{ }else{
......
package com.gic.haoban.manage.web.anno;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.util.concurrent.TimeUnit;
/**
* 访问限制
* 默认1秒
* @author hzw
*
*/
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface HttpLimit {
long time() default 1L;
TimeUnit unit() default TimeUnit.SECONDS;
int times() default 2;
}
\ No newline at end of file
...@@ -30,6 +30,7 @@ import com.gic.haoban.manage.api.service.BindApiService; ...@@ -30,6 +30,7 @@ import com.gic.haoban.manage.api.service.BindApiService;
import com.gic.haoban.manage.api.service.DepartmentApiService; import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService; import com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService;
import com.gic.haoban.manage.web.anno.HttpLimit;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode; import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.haoban.manage.web.interceptor.WebInterceptor; import com.gic.haoban.manage.web.interceptor.WebInterceptor;
import com.gic.haoban.manage.web.vo.ClerkVo; import com.gic.haoban.manage.web.vo.ClerkVo;
...@@ -166,6 +167,7 @@ public class ClerkController extends WebBaseController{ ...@@ -166,6 +167,7 @@ public class ClerkController extends WebBaseController{
} }
//成员绑定 //成员绑定
@HttpLimit
@RequestMapping("/staff-bind") @RequestMapping("/staff-bind")
public HaobanResponse staffBind(String departmentId,String fromClerkCode,String fromStaffDepartmentRelatedId) { public HaobanResponse staffBind(String departmentId,String fromClerkCode,String fromStaffDepartmentRelatedId) {
if(StringUtils.isAnyBlank(departmentId,fromClerkCode,fromStaffDepartmentRelatedId)){ if(StringUtils.isAnyBlank(departmentId,fromClerkCode,fromStaffDepartmentRelatedId)){
...@@ -175,6 +177,7 @@ public class ClerkController extends WebBaseController{ ...@@ -175,6 +177,7 @@ public class ClerkController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
//成员解除绑定 //成员解除绑定
@HttpLimit
@RequestMapping("/clerk-single-unbind") @RequestMapping("/clerk-single-unbind")
public HaobanResponse clerkSingleUnbind(String fromClerkCode,String departmentId) { public HaobanResponse clerkSingleUnbind(String fromClerkCode,String departmentId) {
if(StringUtils.isAnyBlank(fromClerkCode)){ if(StringUtils.isAnyBlank(fromClerkCode)){
...@@ -184,6 +187,7 @@ public class ClerkController extends WebBaseController{ ...@@ -184,6 +187,7 @@ public class ClerkController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
//成员换绑定 //成员换绑定
@HttpLimit
@RequestMapping("/clerk-unbind") @RequestMapping("/clerk-unbind")
public HaobanResponse clerkUnbind(String departmentId,String fromClerkCode,String toStaffId,String manager) { public HaobanResponse clerkUnbind(String departmentId,String fromClerkCode,String toStaffId,String manager) {
if(StringUtils.isAnyBlank(fromClerkCode,toStaffId)){ if(StringUtils.isAnyBlank(fromClerkCode,toStaffId)){
...@@ -197,6 +201,7 @@ public class ClerkController extends WebBaseController{ ...@@ -197,6 +201,7 @@ public class ClerkController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
//店长转让 //店长转让
@HttpLimit
@RequestMapping("/clerk-manager-tranfer") @RequestMapping("/clerk-manager-tranfer")
public HaobanResponse clerkManagerTranfer(String departmentId,String fromClerkCode,String toStaffDepartmentRelatedId) { public HaobanResponse clerkManagerTranfer(String departmentId,String fromClerkCode,String toStaffDepartmentRelatedId) {
logger.info("===========================》111111111111111"); logger.info("===========================》111111111111111");
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.gic.enterprise.api.dto.StoreDTO; import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.haoban.base.api.common.ServiceResponse; import com.gic.haoban.base.api.common.ServiceResponse;
...@@ -9,6 +10,7 @@ import com.gic.haoban.common.utils.HaobanResponse; ...@@ -9,6 +10,7 @@ import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.contacts.manage.api.service.StoreService; import com.gic.haoban.contacts.manage.api.service.StoreService;
import com.gic.haoban.manage.api.dto.*; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.service.DepartmentApiService; import com.gic.haoban.manage.api.service.DepartmentApiService;
import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
import com.gic.haoban.manage.api.service.StaffApiService; import com.gic.haoban.manage.api.service.StaffApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseApiService; import com.gic.haoban.manage.api.service.WxEnterpriseApiService;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService; import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
...@@ -21,6 +23,7 @@ import com.gic.haoban.manage.web.vo.StoreVO; ...@@ -21,6 +23,7 @@ import com.gic.haoban.manage.web.vo.StoreVO;
import com.gic.wechat.api.dto.qywx.UserDTO; import com.gic.wechat.api.dto.qywx.UserDTO;
import com.gic.wechat.api.service.qywx.QywxCorpApiService; import com.gic.wechat.api.service.qywx.QywxCorpApiService;
import com.gic.wechat.api.service.qywx.QywxUserApiService; import com.gic.wechat.api.service.qywx.QywxUserApiService;
import org.apache.commons.collections.CollectionUtils; 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;
...@@ -55,6 +58,9 @@ public class InfoController extends WebBaseController{ ...@@ -55,6 +58,9 @@ public class InfoController extends WebBaseController{
@Autowired @Autowired
private com.gic.enterprise.api.service.StoreService storeService; private com.gic.enterprise.api.service.StoreService storeService;
@Autowired
private MemberUnionidRelatedApiService memberUnionidRelatedApiService;
private static Logger logger= LoggerFactory.getLogger(InfoController.class); private static Logger logger= LoggerFactory.getLogger(InfoController.class);
@Autowired @Autowired
...@@ -96,6 +102,7 @@ public class InfoController extends WebBaseController{ ...@@ -96,6 +102,7 @@ public class InfoController extends WebBaseController{
infoVo.setStaffName(loginStaff.getStaffName()); infoVo.setStaffName(loginStaff.getStaffName());
infoVo.setPhoneNumber(loginStaff.getPhoneNumber()); infoVo.setPhoneNumber(loginStaff.getPhoneNumber());
infoVo.setNationcode(loginStaff.getNationCode()); infoVo.setNationcode(loginStaff.getNationCode());
infoVo.setWxUserId(loginStaff.getWxUserId());
return resultResponse(HaoBanErrCode.ERR_1,infoVo); return resultResponse(HaoBanErrCode.ERR_1,infoVo);
} }
...@@ -165,6 +172,15 @@ public class InfoController extends WebBaseController{ ...@@ -165,6 +172,15 @@ public class InfoController extends WebBaseController{
} }
@RequestMapping("get-member-store")
public HaobanResponse getMemberStore(String externalUserid,String wxUserId) {
if (StringUtils.isAnyBlank(externalUserid,wxUserId)) {
return resultResponse(HaoBanErrCode.ERR_2);
}
List<MemberStoreDTO> result = memberUnionidRelatedApiService.listByExTernalUseridAndWxUserId(externalUserid, wxUserId);
return resultResponse(HaoBanErrCode.ERR_1,result);
}
@RequestMapping("get-staff-info") @RequestMapping("get-staff-info")
public HaobanResponse getStaffInfo(String phoneNumber) { public HaobanResponse getStaffInfo(String phoneNumber) {
if (StringUtils.isBlank(phoneNumber)) { if (StringUtils.isBlank(phoneNumber)) {
......
...@@ -68,6 +68,8 @@ public enum HaoBanErrCode { ...@@ -68,6 +68,8 @@ public enum HaoBanErrCode {
ERR_21(21, "验证码已过期或者错误"), ERR_21(21, "验证码已过期或者错误"),
ERR_22(22, "验证码一分钟只能请求一次"), ERR_22(22, "验证码一分钟只能请求一次"),
ERR_10008(10008,"请不要过于频繁点击"),
/** /**
* 员工档案模块 * 员工档案模块
......
package com.gic.haoban.manage.web.interceptor;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Map;
import com.alibaba.fastjson.JSONObject;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.web.anno.HttpLimit;
import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
import com.gic.redis.data.util.RedisUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* 测试登录拦截器
*
* @author zhurz
*/
public class HttpLimitInterceptor extends HandlerInterceptorAdapter {
private static Logger logger = LoggerFactory.getLogger(HttpLimitInterceptor.class);
private void errorResult(HttpServletResponse httpServletResponse, HaoBanErrCode errCode) {
HaobanResponse response = new HaobanResponse();
response.setErrorCode(errCode.getCode());
response.setMessage(errCode.getMsg());
PrintWriter writer = null;
try {
httpServletResponse.setHeader("Content-type", "application/json;charset=UTF-8");
writer = httpServletResponse.getWriter();
writer.append(JSONObject.toJSONString(response));
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {
String requestURI = httpServletRequest.getRequestURI();
logger.info("post-url:{}", requestURI);
Map<String, String[]> parameterMap = httpServletRequest.getParameterMap();
logger.info("post-params:{}", JSONObject.toJSONString(parameterMap));
if (!(o instanceof HandlerMethod)) {
return true;
}
HandlerMethod handler = (HandlerMethod) o;
HttpLimit httpLimit = handler.getMethodAnnotation(HttpLimit.class);
if (httpLimit != null) {
String ip = getIpAddress(httpServletRequest);
String url = httpServletRequest.getRequestURL().toString();
String key = "http_limit_".concat(url);
key = key + ip;
if(RedisUtil.getCache(key)!=null){
this.errorResult(httpServletResponse, HaoBanErrCode.ERR_10008);
logger.info("过于频繁点击");
return false;
}else{
RedisUtil.setCache(key, 1, httpLimit.time());
}
}
return true;
}
private String getIpAddress(HttpServletRequest request) {
String ip = request.getHeader("x-forwarded-for");
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("WL-Proxy-Client-IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_CLIENT_IP");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getHeader("HTTP_X_FORWARDED_FOR");
}
if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {
ip = request.getRemoteAddr();
}
return ip;
}
}
...@@ -18,6 +18,14 @@ public class AppStaffVo implements Serializable { ...@@ -18,6 +18,14 @@ public class AppStaffVo implements Serializable {
private String phoneNumber; private String phoneNumber;
private String wxEnterpriseId; private String wxEnterpriseId;
private String wxEnterpriseName; private String wxEnterpriseName;
private String wxUserId;
public String getWxUserId() {
return wxUserId;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
public String getStaffId() { public String getStaffId() {
return staffId; return staffId;
} }
......
...@@ -15,7 +15,14 @@ public class InfoVo implements Serializable { ...@@ -15,7 +15,14 @@ public class InfoVo implements Serializable {
private String staffName; private String staffName;
private String phoneNumber; private String phoneNumber;
private String nationcode; private String nationcode;
private String wxUserId;
public String getWxUserId() {
return wxUserId;
}
public void setWxUserId(String wxUserId) {
this.wxUserId = wxUserId;
}
public String getStaffId() { public String getStaffId() {
return staffId; return staffId;
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<dubbo:reference interface="com.gic.haoban.manage.api.service.AuditSettingApiService" id="auditSettingApiService"/> <dubbo:reference interface="com.gic.haoban.manage.api.service.AuditSettingApiService" id="auditSettingApiService"/>
<dubbo:reference interface="com.gic.dict.api.service.ManagerDictService" id="managerDictService"/> <dubbo:reference interface="com.gic.dict.api.service.ManagerDictService" id="managerDictService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.ApplicationSettingApiService" id="applicationSettingApiService"/> <dubbo:reference interface="com.gic.haoban.manage.api.service.ApplicationSettingApiService" id="applicationSettingApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService" id="memberUnionidRelatedApiService"/>
<dubbo:reference interface="com.gic.haoban.communicate.api.service.valid.ValidationCodeService" id="validationCodeService"/> <dubbo:reference interface="com.gic.haoban.communicate.api.service.valid.ValidationCodeService" id="validationCodeService"/>
......
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