Commit d6e258e3 by huang

1111

parent 23a2f839
...@@ -6,4 +6,6 @@ import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO; ...@@ -6,4 +6,6 @@ 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);
} }
...@@ -18,4 +18,6 @@ public interface WxEnterpriseRelatedMapper { ...@@ -18,4 +18,6 @@ public interface WxEnterpriseRelatedMapper {
int updateByPrimaryKey(TabHaobanWxEnterpriseRelated record); int updateByPrimaryKey(TabHaobanWxEnterpriseRelated record);
List<TabHaobanWxEnterpriseRelated> listByWxenterpriseId(String wxEnterpriseId); List<TabHaobanWxEnterpriseRelated> listByWxenterpriseId(String wxEnterpriseId);
TabHaobanWxEnterpriseRelated findOneByEnterpriseId(String enterpriseId);
} }
\ No newline at end of file
package com.gic.haoban.manage.service.service.impl; package com.gic.haoban.manage.service.service.impl;
import java.util.Date;
import java.util.List; import java.util.List;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.haoban.common.utils.UuidUtil;
import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO; import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO;
import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService; import com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService;
import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper; import com.gic.haoban.manage.service.dao.mapper.WxEnterpriseRelatedMapper;
...@@ -12,6 +16,8 @@ import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated; ...@@ -12,6 +16,8 @@ import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
@Service @Service
public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApiService { public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApiService {
private static final Logger logger = LogManager.getLogger(WxEnterpriseRelatedApiServiceImpl.class);
private WxEnterpriseRelatedMapper wxEnterpriseRelatedMapper; private WxEnterpriseRelatedMapper wxEnterpriseRelatedMapper;
@Override @Override
public List<EnterpriseDetailDTO> listEnterpriseByWxEnterpriseId( public List<EnterpriseDetailDTO> listEnterpriseByWxEnterpriseId(
...@@ -22,5 +28,23 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi ...@@ -22,5 +28,23 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
//TODO 调熊大接口,获取nodeCount //TODO 调熊大接口,获取nodeCount
return result; return result;
} }
@Override
public void wxEnterpriseBind(String enterpriseId, String wxEnterpriseId,
String version) {
TabHaobanWxEnterpriseRelated tab = wxEnterpriseRelatedMapper.findOneByEnterpriseId(enterpriseId);
if(tab!= null){
logger.info("该gicEnterpriseId已经绑定过了");
}else{
tab = new TabHaobanWxEnterpriseRelated();
tab.setEnterpriseId(enterpriseId);
tab.setWxEnterpriseId(wxEnterpriseId);
tab.setStatusFlag(1);
tab.setVersion(version);
tab.setCreateTime(new Date());
tab.setUpdateTime(new Date());
tab.setWxEnterpriseRelatedId(UuidUtil.randomUUID());
wxEnterpriseRelatedMapper.insertSelective(tab);
}
}
} }
...@@ -122,6 +122,12 @@ ...@@ -122,6 +122,12 @@
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR} where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and status_flag = 1 and status_flag = 1
</select> </select>
<select id="findOneByEnterpriseId" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tab_haoban_wx_enterprise_related
where enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and status_flag = 1
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -15,6 +15,7 @@ import com.gic.haoban.manage.web.errCode.HaoBanErrCode; ...@@ -15,6 +15,7 @@ import com.gic.haoban.manage.web.errCode.HaoBanErrCode;
public class WxEnterpriseController extends WebBaseController{ public class WxEnterpriseController extends WebBaseController{
@Autowired @Autowired
private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService; private WxEnterpriseRelatedApiService wxEnterpriseRelatedApiService;
//授权企业列表
@RequestMapping("wx-enterprise-list") @RequestMapping("wx-enterprise-list")
public HaobanResponse wxEnterpriseList() { public HaobanResponse wxEnterpriseList() {
String wxEnterpriseId = "123456"; String wxEnterpriseId = "123456";
...@@ -22,5 +23,12 @@ public class WxEnterpriseController extends WebBaseController{ ...@@ -22,5 +23,12 @@ public class WxEnterpriseController extends WebBaseController{
return resultResponse(HaoBanErrCode.ERR_1, list); return resultResponse(HaoBanErrCode.ERR_1, list);
} }
//微信企业绑定接口
@RequestMapping("wx-enterprise-bind")
public HaobanResponse wxEnterpriseBind(String enterpriseId,String wxEnterpriseId,String version) {
wxEnterpriseRelatedApiService.wxEnterpriseBind(enterpriseId,wxEnterpriseId,version);
return resultResponse(HaoBanErrCode.ERR_1);
}
} }
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