Commit 957f43c0 by qwmqiuwenmin

Merge branch 'developer' of http://115.159.76.241/haoban3.0/haoban-manage3.0.git into developer

parents 72b272a4 0db99233
...@@ -59,12 +59,22 @@ public class WxEnterpriseDTO implements Serializable { ...@@ -59,12 +59,22 @@ public class WxEnterpriseDTO implements Serializable {
private String wxSecretKey; private String wxSecretKey;
private String memberSecret;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
//小程序版本 //小程序版本
private String smallVersion; private String smallVersion;
public String getMemberSecret() {
return memberSecret;
}
public void setMemberSecret(String memberSecret) {
this.memberSecret = memberSecret;
}
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public String getSmallVersion() { public String getSmallVersion() {
......
...@@ -58,12 +58,22 @@ public class TabHaobanWxEnterprise implements Serializable { ...@@ -58,12 +58,22 @@ public class TabHaobanWxEnterprise implements Serializable {
private String wxSecretKey; private String wxSecretKey;
private String memberSecret;
private Date createTime; private Date createTime;
private Date updateTime; private Date updateTime;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public String getMemberSecret() {
return memberSecret;
}
public void setMemberSecret(String memberSecret) {
this.memberSecret = memberSecret;
}
public String getWxEnterpriseId() { public String getWxEnterpriseId() {
return wxEnterpriseId; return wxEnterpriseId;
} }
......
...@@ -154,8 +154,12 @@ public class AuditApiServiceImpl implements AuditApiService{ ...@@ -154,8 +154,12 @@ public class AuditApiServiceImpl implements AuditApiService{
if(!StoreFieldEnum.STORE_IMAG.getValue().equals(changeField)){ if(!StoreFieldEnum.STORE_IMAG.getValue().equals(changeField)){
//非门店图片修改 //非门店图片修改
logger.info("===================进222"); logger.info("===================进222");
getStoreDTO( store, changeField, oldValue, newValue); StoreDetailDTO detailDTO = new StoreDetailDTO();
StoreDetailDTO detailDTO = EntityUtil.changeEntityByJSON(StoreDetailDTO.class, store); detailDTO.setStoreId(storeId);
detailDTO.setEnterpriseId(store.getEnterpriseId());
getStoreDTO( detailDTO, changeField, oldValue, newValue);
logger.info("detailDTO====================>为{}",JSONObject.toJSONString(detailDTO));
storeService.saveStore(detailDTO); storeService.saveStore(detailDTO);
// storeService.saveOrUpdateStore(store); // storeService.saveOrUpdateStore(store);
}else{ }else{
...@@ -164,7 +168,7 @@ public class AuditApiServiceImpl implements AuditApiService{ ...@@ -164,7 +168,7 @@ public class AuditApiServiceImpl implements AuditApiService{
storeService.updateStorePhotos(storeId, newValue); storeService.updateStorePhotos(storeId, newValue);
} }
} }
void getStoreDTO(StoreDTO store,String changeField,String oldValue,String newValue){ void getStoreDTO(StoreDetailDTO store,String changeField,String oldValue,String newValue){
logger.info("==========================>changeField={}",changeField); logger.info("==========================>changeField={}",changeField);
if(StoreFieldEnum.BUSINESS_TIME_STRING.getValue().equals(changeField)){ if(StoreFieldEnum.BUSINESS_TIME_STRING.getValue().equals(changeField)){
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm"); SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
...@@ -172,20 +176,20 @@ public class AuditApiServiceImpl implements AuditApiService{ ...@@ -172,20 +176,20 @@ public class AuditApiServiceImpl implements AuditApiService{
String [] newValues = newValue.split("-"); String [] newValues = newValue.split("-");
String openTime = newValues[0]; String openTime = newValues[0];
String closeTime = newValues[1]; String closeTime = newValues[1];
Date date1 = null; // Date date1 = null;
Date date2 = null; // Date date2 = null;
try { // try {
date1 = sdf.parse(openTime); // date1 = sdf.parse(openTime);
} catch (ParseException e) { // } catch (ParseException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
try { // try {
date2 = sdf.parse(closeTime); // date2 = sdf.parse(closeTime);
} catch (ParseException e) { // } catch (ParseException e) {
e.printStackTrace(); // e.printStackTrace();
} // }
store.setOpenTime(date1); store.setOpenTime(openTime);
store.setCloseTime(date2); store.setCloseTime(closeTime);
}else if(StoreFieldEnum.CONACTS_PHONE.getValue().equals(changeField)){ }else if(StoreFieldEnum.CONACTS_PHONE.getValue().equals(changeField)){
//联系电话 //联系电话
store.setConactsPhone(newValue); store.setConactsPhone(newValue);
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
<result column="square_logo_url" property="squareLogoUrl" jdbcType="VARCHAR" /> <result column="square_logo_url" property="squareLogoUrl" jdbcType="VARCHAR" />
<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="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" />
...@@ -37,6 +38,7 @@ ...@@ -37,6 +38,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
</sql> </sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" > <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select select
......
package com.gic.haoban.manage.web.controller; package com.gic.haoban.manage.web.controller;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
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.haoban.common.utils.EntityUtil; import com.gic.haoban.common.utils.EntityUtil;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.*;
import com.gic.haoban.manage.api.dto.UserLoginLogDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.YwWxEnterpriseDTO;
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.web.config.Config; import com.gic.haoban.manage.web.config.Config;
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.vo.AppStaffVo; import com.gic.haoban.manage.web.vo.AppStaffVo;
import com.gic.haoban.manage.web.vo.InfoVo; import com.gic.haoban.manage.web.vo.InfoVo;
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 org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
import java.util.stream.Collectors;
@RestController @RestController
public class InfoController extends WebBaseController{ public class InfoController extends WebBaseController{
...@@ -42,49 +35,88 @@ public class InfoController extends WebBaseController{ ...@@ -42,49 +35,88 @@ public class InfoController extends WebBaseController{
private StaffApiService staffApiService; private StaffApiService staffApiService;
@Autowired @Autowired
private WxEnterpriseApiService wxEnterpriseApiService; private WxEnterpriseApiService wxEnterpriseApiService;
@Autowired
private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService;
@Autowired
private QywxUserApiService qywxUserApiService;
private static Logger logger= LoggerFactory.getLogger(InfoController.class); private static Logger logger= LoggerFactory.getLogger(InfoController.class);
@Autowired @Autowired
private Config config; private Config config;
@RequestMapping("get-info-by-code") @RequestMapping("get-info-by-code")
public HaobanResponse getInfoByCode(String code) { public HaobanResponse getInfoByCode(String code) {
String userDTOJson = qywxCorpApiService.getCodeSession(config.getWxSuiteid(),code); String userDTOJson = qywxCorpApiService.getCodeSession(config.getWxSuiteid(),code);
logger.info("userDTOJson=============>{}",userDTOJson); logger.info("userDTOJson=============>{}",userDTOJson);
UserDTO user = JSON.parseObject(userDTOJson, UserDTO.class); UserDTO user = JSON.parseObject(userDTOJson, UserDTO.class);
if(user == null) { if(user == null) {
return resultResponse(HaoBanErrCode.ERR_6); return resultResponse(HaoBanErrCode.ERR_6);
} }
String userId = user.getUserid(); String userId = user.getUserid();
String corpId = user.getCorpid(); String corpId = user.getCorpid();
WxEnterpriseDTO enterprise = wxEnterpriseApiService.getEnterpriseBycorpId(corpId); WxEnterpriseDTO enterprise = wxEnterpriseApiService.getEnterpriseBycorpId(corpId);
StaffDTO loginStaff = null; StaffDTO loginStaff = null;
if(enterprise != null){ if(enterprise != null){
loginStaff = staffApiService.selectByUserIdAndEnterpriseId(userId,enterprise.getWxEnterpriseId()); loginStaff = staffApiService.selectByUserIdAndEnterpriseId(userId,enterprise.getWxEnterpriseId());
} }
if(loginStaff == null){ if(loginStaff == null){
if(enterprise != null){ if(enterprise != null){
staffApiService.wxGetAdd(userId,enterprise.getWxEnterpriseId()); staffApiService.wxGetAdd(userId,enterprise.getWxEnterpriseId());
loginStaff = staffApiService.selectByUserIdAndEnterpriseId(userId,enterprise.getWxEnterpriseId()); loginStaff = staffApiService.selectByUserIdAndEnterpriseId(userId,enterprise.getWxEnterpriseId());
} }
} }
if(loginStaff == null){ if(loginStaff == null){
return resultResponse(HaoBanErrCode.ERR_600001); return resultResponse(HaoBanErrCode.ERR_600001);
} }
String wxEnterpriseId = loginStaff.getWxEnterpriseId(); String wxEnterpriseId = loginStaff.getWxEnterpriseId();
WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseApiService.getOne(wxEnterpriseId); WxEnterpriseDTO wxEnterpriseDTO = wxEnterpriseApiService.getOne(wxEnterpriseId);
String accesstoken = qywxCorpApiService.getCorpAccessToken(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid()); String accesstoken = qywxCorpApiService.getCorpAccessToken(wxEnterpriseDTO.getCorpid(), config.getWxSuiteid());
InfoVo infoVo = new InfoVo(); InfoVo infoVo = new InfoVo();
infoVo.setAccessToken(accesstoken); infoVo.setAccessToken(accesstoken);
infoVo.setStaffId(loginStaff.getStaffId()); infoVo.setStaffId(loginStaff.getStaffId());
infoVo.setWxEnterpriseId(wxEnterpriseId); infoVo.setWxEnterpriseId(wxEnterpriseId);
infoVo.setStaffName(loginStaff.getStaffName()); infoVo.setStaffName(loginStaff.getStaffName());
infoVo.setPhoneNumber(loginStaff.getPhoneNumber()); infoVo.setPhoneNumber(loginStaff.getPhoneNumber());
infoVo.setNationcode(loginStaff.getNationCode()); infoVo.setNationcode(loginStaff.getNationCode());
return resultResponse(HaoBanErrCode.ERR_1,infoVo); return resultResponse(HaoBanErrCode.ERR_1,infoVo);
} }
@RequestMapping("get-user-by-member-code")
public HaobanResponse getInfoByMemberCode(String code, String gicEnterpriseId) {
EnterpriseDetailDTO enterpriseDetailDTO = wxEnterpriseRelatedApiService.getByEnterpriseId(gicEnterpriseId);
if (enterpriseDetailDTO == null) {
logger.info("改企业没有关系好办:{}", gicEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_500001);
}
WxEnterpriseDTO enterpriseDTO = wxEnterpriseApiService.getOne(enterpriseDetailDTO.getWxEnterpriseId());
if (enterpriseDetailDTO == null) {
logger.info("改企业不存在:{}", gicEnterpriseId);
return resultResponse(HaoBanErrCode.ERR_400002);
}
String userDTOJson = qywxUserApiService.getUserByCode(enterpriseDTO.getCorpid(), enterpriseDTO.getMemberSecret(), code);
logger.info("会员微信登录信息=============>{}", userDTOJson);
UserDTO user = JSON.parseObject(userDTOJson, UserDTO.class);
if (user == null) {
return resultResponse(HaoBanErrCode.ERR_6);
}
String userId = user.getUserid();
String corpId = user.getCorpid();
Map<String, String> ret = new HashMap<>();
ret.put("userId", userId);
ret.put("corpId", corpId);
return resultResponse(HaoBanErrCode.ERR_1, ret);
}
@RequestMapping("save-user-login-log") @RequestMapping("save-user-login-log")
public HaobanResponse saveUserLoginLog(UserLoginLogDTO userLoginLogDTO) { public HaobanResponse saveUserLoginLog(UserLoginLogDTO userLoginLogDTO) {
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
<dubbo:reference interface="com.gic.haoban.manage.api.service.WxEnterpriseApiService" id="wxEnterpriseApiService"/> <dubbo:reference interface="com.gic.haoban.manage.api.service.WxEnterpriseApiService" id="wxEnterpriseApiService"/>
<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.wechat.api.service.qywx.QywxCorpApiService" id="qywxCorpApiService"/> <dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxCorpApiService" id="qywxCorpApiService"/>
<dubbo:reference interface="com.gic.wechat.api.service.qywx.QywxUserApiService" id="qywxUserApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.BindApiService" id="bindApiService"/> <dubbo:reference interface="com.gic.haoban.manage.api.service.BindApiService" id="bindApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.AuditApiService" id="auditApiService"/> <dubbo:reference interface="com.gic.haoban.manage.api.service.AuditApiService" id="auditApiService"/>
<dubbo:reference interface="com.gic.haoban.manage.api.service.AuditSettingApiService" id="auditSettingApiService"/> <dubbo:reference interface="com.gic.haoban.manage.api.service.AuditSettingApiService" id="auditSettingApiService"/>
......
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