Commit 46ddddf1 by qwmqiuwenmin

fix

parent 03c21832
...@@ -258,24 +258,24 @@ public class ClerkController extends WebBaseController{ ...@@ -258,24 +258,24 @@ public class ClerkController extends WebBaseController{
@HttpLimit @HttpLimit
@RequestMapping("/staff-add") @RequestMapping("/staff-add")
public HaobanResponse staffAdd(StaffDTO staffDTO,String storeId,String clerkCode) { public HaobanResponse staffAdd(StaffDTO staffDTO,String storeId,String clerkCode) {
// String wxEnterpriseId = staffDTO.getWxEnterpriseId(); String wxEnterpriseId = staffDTO.getWxEnterpriseId();
// String staffName = staffDTO.getStaffName(); String staffName = staffDTO.getStaffName();
// String phoneNumber = staffDTO.getPhoneNumber(); String phoneNumber = staffDTO.getPhoneNumber();
// String nationcode = staffDTO.getNationCode(); String nationcode = staffDTO.getNationCode();
// String postion = staffDTO.getPostion(); String postion = staffDTO.getPostion();
// Integer sex = staffDTO.getSex(); Integer sex = staffDTO.getSex();
// staffDTO.setWxEnterpriseId(wxEnterpriseId); staffDTO.setWxEnterpriseId(wxEnterpriseId);
// if(StringUtils.isBlank(staffName)) { if(StringUtils.isBlank(staffName)) {
// return resultResponse(HaoBanErrCode.ERR_10004); return resultResponse(HaoBanErrCode.ERR_10004);
// } }
// StaffDTO staff = staffApiService.selectByNationcodeAndPhoneNumber(wxEnterpriseId,nationcode,phoneNumber); StaffDTO staff = staffApiService.selectByNationcodeAndPhoneNumber(wxEnterpriseId,nationcode,phoneNumber);
// if(staff != null) { if(staff != null) {
// return resultResponse(HaoBanErrCode.ERR_10005); return resultResponse(HaoBanErrCode.ERR_10005);
// } }
// boolean flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAdd(storeId, clerkCode, sex, staffName, phoneNumber, nationcode, postion); boolean flag = syncHaobanToGicServiceApi.syncClerkToGicClerkAdd(storeId, clerkCode, sex, staffName, phoneNumber, nationcode, postion);
// if(!flag){ if(!flag){
// return resultResponse(HaoBanErrCode.ERR_10010); return resultResponse(HaoBanErrCode.ERR_10010);
// } }
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
...@@ -302,10 +302,10 @@ public class ClerkController extends WebBaseController{ ...@@ -302,10 +302,10 @@ public class ClerkController extends WebBaseController{
staffApiService.del(staffDepartmentRelatedId); staffApiService.del(staffDepartmentRelatedId);
}else{ }else{
ClerkDTO clerk = clerkService.getClerkByClerkCode(departmentDTO.getEnterpriseId(), related.getClerkCode()); ClerkDTO clerk = clerkService.getClerkByClerkCode(departmentDTO.getEnterpriseId(), related.getClerkCode());
// if(clerk != null && distributeApiService.getClerkMemberCount(departmentDTO.getEnterpriseId(), clerk.getClerkId(), storeId) == 0){ if(clerk != null && distributeApiService.getClerkMemberCount(departmentDTO.getEnterpriseId(), clerk.getClerkId(), storeId) == 0){
// syncHaobanToGicServiceApi.delGicClerk(clerk.getClerkId()); syncHaobanToGicServiceApi.delGicClerk(clerk.getClerkId());
// staffApiService.del(staffDepartmentRelatedId); staffApiService.del(staffDepartmentRelatedId);
// } }
} }
} }
if(flag){ if(flag){
...@@ -346,27 +346,9 @@ public class ClerkController extends WebBaseController{ ...@@ -346,27 +346,9 @@ public class ClerkController extends WebBaseController{
String key = "haoban_fresh_wx_friend" + yyyyMM + staffId; String key = "haoban_fresh_wx_friend" + yyyyMM + staffId;
Integer count = RedisUtil.getCache(key) == null ? 0 : (Integer)RedisUtil.getCache(key); Integer count = RedisUtil.getCache(key) == null ? 0 : (Integer)RedisUtil.getCache(key);
if(count == null || count < 4){ if(count == null || count < 4){
WxEnterpriseDTO enterprise = wxEnterpriseApiService.getOne(wxEnterpriseId);
RedisUtil.setCache(key,count + 1,31 * 24 * 60 * 60l); RedisUtil.setCache(key,count + 1,31 * 24 * 60 * 60l);
memberUnionidRelatedApiService.freshWxFrend(wxEnterpriseId, wxUserId); memberUnionidRelatedApiService.freshWxFrend(wxEnterpriseId, wxUserId);
// String res = qywxUserApiService.listSelfExternalUserid(enterprise.getCorpid(), enterprise.getWxSecretKey(), staff.getWxUserId());
// JSONObject json = JSON.parseObject(res);
// if("0".equals(json.getString("errcode"))){
// String external_userid = json.getString("external_userid");
// JSONArray jsonArr = json.getJSONArray(external_userid);
// List<MemberUnionidRelatedDTO> list = memberUnionidRelatedApiService.getByWxUserIdAndWxEnterpriseId(wxUserId, wxEnterpriseId);
// List<String> externalUserIdList = list.stream().map(student->student.getExternalUserid())
// .collect(Collectors.toList());
// for (Object object : jsonArr) {
// if(externalUserIdList.contains(object.toString())){
// continue;
// }else{
// //String string = qywxUserApiService.getCorpSelfExternalUseridInfo(enterprise.getCorpid(), enterprise.getWxSecretKey(), object.toString());
// memberUnionidRelatedApiService.add(wxEnterpriseId, object.toString(), wxUserId);
// }
// }
// }
}else{ }else{
return resultResponse(HaoBanErrCode.ERR_10011); return resultResponse(HaoBanErrCode.ERR_10011);
} }
......
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