Commit 27453db7 by huangZW

111

parent 164b3861
...@@ -7,7 +7,7 @@ import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO; ...@@ -7,7 +7,7 @@ import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO;
public interface WxEnterpriseRelatedApiService { public interface WxEnterpriseRelatedApiService {
List<EnterpriseDetailDTO> listEnterpriseByWxEnterpriseId(String wxEnterpriseId); List<EnterpriseDetailDTO> listEnterpriseByWxEnterpriseId(String wxEnterpriseId);
void wxEnterpriseBind(String enterpriseId,String wxEnterpriseId,String version); int wxEnterpriseBind(String enterpriseId,String wxEnterpriseId,String version);
String getGicEnterpriseIdByEnterpriseRelatedId(String wxEnterpriseRelatedId); String getGicEnterpriseIdByEnterpriseRelatedId(String wxEnterpriseRelatedId);
} }
...@@ -33,11 +33,12 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi ...@@ -33,11 +33,12 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
return result; return result;
} }
@Override @Override
public void wxEnterpriseBind(String enterpriseId, String wxEnterpriseId, public int wxEnterpriseBind(String enterpriseId, String wxEnterpriseId,
String version) { String version) {
TabHaobanWxEnterpriseRelated tab = wxEnterpriseRelatedMapper.findOneByEnterpriseId(enterpriseId); TabHaobanWxEnterpriseRelated tab = wxEnterpriseRelatedMapper.findOneByEnterpriseId(enterpriseId);
if(tab!= null){ if(tab!= null){
logger.info("该gicEnterpriseId已经绑定过了"); logger.info("该gicEnterpriseId已经绑定过了");
return 1;
}else{ }else{
tab = new TabHaobanWxEnterpriseRelated(); tab = new TabHaobanWxEnterpriseRelated();
tab.setEnterpriseId(enterpriseId); tab.setEnterpriseId(enterpriseId);
...@@ -49,6 +50,7 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi ...@@ -49,6 +50,7 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
tab.setWxEnterpriseRelatedId(UuidUtil.randomUUID()); tab.setWxEnterpriseRelatedId(UuidUtil.randomUUID());
wxEnterpriseRelatedMapper.insertSelective(tab); wxEnterpriseRelatedMapper.insertSelective(tab);
} }
return 0;
} }
@Override @Override
public String getGicEnterpriseIdByEnterpriseRelatedId(String wxEnterpriseRelatedId) { public String getGicEnterpriseIdByEnterpriseRelatedId(String wxEnterpriseRelatedId) {
......
...@@ -38,7 +38,10 @@ public class WxEnterpriseController extends WebBaseController{ ...@@ -38,7 +38,10 @@ public class WxEnterpriseController extends WebBaseController{
//微信企业绑定接口 //微信企业绑定接口
@RequestMapping("wx-enterprise-bind") @RequestMapping("wx-enterprise-bind")
public HaobanResponse wxEnterpriseBind(String enterpriseId,String wxEnterpriseId,String version) { public HaobanResponse wxEnterpriseBind(String enterpriseId,String wxEnterpriseId,String version) {
wxEnterpriseRelatedApiService.wxEnterpriseBind(enterpriseId,wxEnterpriseId,version); int i = wxEnterpriseRelatedApiService.wxEnterpriseBind(enterpriseId,wxEnterpriseId,version);
if(i==1){
return resultResponse(HaoBanErrCode.ERR_1);
}
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
......
...@@ -67,7 +67,7 @@ public enum HaoBanErrCode { ...@@ -67,7 +67,7 @@ public enum HaoBanErrCode {
ERR_10004(10004,"成员名称不能为空"), ERR_10004(10004,"成员名称不能为空"),
ERR_10005(10005,"成员已存在"), ERR_10005(10005,"成员已存在"),
ERR_10006(10006,"该企业已经绑定过了"),
ERR_DEFINE(-888, "自定义错误"), ERR_DEFINE(-888, "自定义错误"),
ERR_OTHER(-999, "未知错误code"); ERR_OTHER(-999, "未知错误code");
......
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