|
@@ -40,6 +40,7 @@ import org.springframework.ui.ExtendedModelMap;
|
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
|
|
@@ -359,6 +360,7 @@ public class VisitorUserInfoController extends BaseFormController {
|
|
|
model.addAttribute("visitedMobileType", 1);
|
|
|
model.addAttribute("visitCompType", 1);
|
|
|
model.addAttribute("visitNameType", 1);
|
|
|
+ model.addAttribute("orderAffirm", 0);
|
|
|
if(null != wxUser && null != wxUser.getOrganizationId()){
|
|
|
LingLingCurrentset lingLingCurrentset= lingLingCurrentsetManager.getByOrgId(wxUser.getOrganizationId());
|
|
|
if(null != lingLingCurrentset){
|
|
@@ -366,6 +368,7 @@ public class VisitorUserInfoController extends BaseFormController {
|
|
|
model.addAttribute("visitedMobileType", lingLingCurrentset.getVisitedMobileType() == null ? 1 : lingLingCurrentset.getVisitedMobileType());
|
|
|
model.addAttribute("visitCompType", lingLingCurrentset.getVisitCompType() == null ? 1 : lingLingCurrentset.getVisitCompType());
|
|
|
model.addAttribute("visitNameType", lingLingCurrentset.getVisitNameType() == null ? 1 : lingLingCurrentset.getVisitNameType());
|
|
|
+ model.addAttribute("orderAffirm", lingLingCurrentset.getOrderAffirm() == null ? 0 : lingLingCurrentset.getOrderAffirm());
|
|
|
}
|
|
|
}
|
|
|
if ("0".equals(appUser.getUserType())) {// 白名单用户
|
|
@@ -378,6 +381,63 @@ public class VisitorUserInfoController extends BaseFormController {
|
|
|
return new ModelAndView("wechat/visitorform", model.asMap());
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @RequestMapping(value = "getAddVisitorInfo")
|
|
|
+ @ResponseBody
|
|
|
+ public AppResultDto getAddVisitorInfo(HttpServletRequest request, HttpServletResponse response) {
|
|
|
+ String openId = request.getParameter("openId");
|
|
|
+
|
|
|
+ Map<String,Object> model = new HashMap<>();
|
|
|
+ WxUser wxUser = scWxuserManager.getScWxuserByOpenId(openId);
|
|
|
+ if (wxUser == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ AppUser appUser = appUserManager.getAppUserByWxUserAndOrg(wxUser.getId(), wxUser.getOrganizationId());
|
|
|
+ if (appUser == null) {
|
|
|
+ appUser = appUserManager.get(wxUser.getUserId());
|
|
|
+ if (appUser == null) return null;
|
|
|
+ } else if (appUser.getVirtualArchId() != null) {
|
|
|
+ VirtualArchitecture virtualArchitecture = propertyManager.getVirtualArchitectureById(appUser.getVirtualArchId());
|
|
|
+ if (virtualArchitecture != null) {
|
|
|
+ model.put("companyName", virtualArchitecture.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ WxPublicno wxPublicno = publicNoManager.getByDevelopId(wxUser.getDevelopId());
|
|
|
+ if (wxPublicno == null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ model.put("openId", openId);
|
|
|
+ model.put("orgId", wxUser.getOrganizationId());
|
|
|
+ model.put("developId", wxUser.getDevelopId());
|
|
|
+ model.put("visitorIdentification", UUID.randomUUID().toString());
|
|
|
+ model.put("imageServer", FileUploadUtils.getVisitPrefix());
|
|
|
+
|
|
|
+ model.put("visitedCompType", 1);
|
|
|
+ model.put("visitedMobileType", 1);
|
|
|
+ model.put("visitCompType", 1);
|
|
|
+ model.put("visitNameType", 1);
|
|
|
+ model.put("orderAffirm", 0);
|
|
|
+ if(null != wxUser && null != wxUser.getOrganizationId()){
|
|
|
+ LingLingCurrentset lingLingCurrentset= lingLingCurrentsetManager.getByOrgId(wxUser.getOrganizationId());
|
|
|
+ if(null != lingLingCurrentset){
|
|
|
+ model.put("visitedCompType", lingLingCurrentset.getVisitedCompType() == null ? 1 : lingLingCurrentset.getVisitedCompType());
|
|
|
+ model.put("visitedMobileType", lingLingCurrentset.getVisitedMobileType() == null ? 1 : lingLingCurrentset.getVisitedMobileType());
|
|
|
+ model.put("visitCompType", lingLingCurrentset.getVisitCompType() == null ? 1 : lingLingCurrentset.getVisitCompType());
|
|
|
+ model.put("visitNameType", lingLingCurrentset.getVisitNameType() == null ? 1 : lingLingCurrentset.getVisitNameType());
|
|
|
+ model.put("orderAffirm", lingLingCurrentset.getOrderAffirm() == null ? 0 : lingLingCurrentset.getOrderAffirm());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if ("0".equals(appUser.getUserType())) {// 白名单用户
|
|
|
+ model.put("type", "2");
|
|
|
+ } else if ("-1".equals(appUser.getUserType()) || "2".equals(appUser.getUserType())) {// 低权限访客用户或者被禁用的人
|
|
|
+ model.put("type", "3");
|
|
|
+ }
|
|
|
+ model.put("userName", appUser.getUserName());
|
|
|
+ model.put("webUrl", Constants.SERVER_ADDRESS);
|
|
|
+ return AppResultUtil.createSuccesDto(model);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 保存用户信息
|
|
|
*
|