Commit 9e4e5610 by qwmqiuwenmin

fix

parent a7396644
......@@ -26,4 +26,6 @@ public interface WxEnterpriseRelatedApiService {
*/
List<EnterpriseDetailDTO> queryBindGicEnterpriseByTime(String seqTime);
int wxEnterpriseBind(String enterpriseId, String wxEnterpriseId, String version, String staffId, String staffName);
}
......@@ -157,4 +157,36 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
List<EnterpriseDetailDTO> details = EntityUtil.changeEntityListByJSON(EnterpriseDetailDTO.class, list);
return details;
}
@Override
public int wxEnterpriseBind(String enterpriseId, String wxEnterpriseId, String version, String staffId,
String staffName) {
TabHaobanWxEnterpriseRelated tab = wxEnterpriseRelatedMapper.findOneByEnterpriseId(enterpriseId);
if(tab!= null){
logger.info("该gicEnterpriseId已经绑定过了");
return 1;
}else{
tab = new TabHaobanWxEnterpriseRelated();
tab.setEnterpriseId(enterpriseId);
tab.setWxEnterpriseId(wxEnterpriseId);
tab.setStatusFlag(1);
tab.setVersion(version);
tab.setStaffId(staffId);
tab.setStaffName(staffName);
tab.setCreateTime(new Date());
tab.setUpdateTime(new Date());
tab.setWxEnterpriseRelatedId(UuidUtil.randomUUID());
wxEnterpriseRelatedMapper.insertSelective(tab);
TabHaobanStaff sStaff = staffMapper.selectSuperByWxEnterpriseId(wxEnterpriseId);
if(sStaff == null){
TabHaobanStaff staff = new TabHaobanStaff();
staff.setStaffName("超级管理员");
staff.setWxEnterpriseId(wxEnterpriseId);
staff.setSuperManagerFlag(1);
staffService.add(staff);
}
}
return 0;
}
}
......@@ -16,6 +16,7 @@ import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.EnterpriseDetailDTO;
import com.gic.haoban.manage.api.dto.SecretSettingDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.enums.SecretTypeEnum;
import com.gic.haoban.manage.api.service.DepartmentApiService;
......@@ -146,7 +147,10 @@ public class WxEnterpriseController extends WebBaseController{
}
LoginVO login = (LoginVO) AuthRequestUtil.getLoginUser();
wxEnterpriseId = login.getWxEnterpriseId();
int i = wxEnterpriseRelatedApiService.wxEnterpriseBind(enterpriseId,wxEnterpriseId,version);
StaffDTO staff = login.getStaffDTO();
String staffId = staff.getStaffId();
String staffName = staff.getStaffName();
int i = wxEnterpriseRelatedApiService.wxEnterpriseBind(enterpriseId,wxEnterpriseId,version,staffId,staffName);
if(i==1){
return resultResponse(HaoBanErrCode.ERR_10006);
}
......
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