Browse Source

联合广场通行管理优化
1、PC端增加配置字段;
2、微信端增加配置字段,前端可根据控制字段值进行控制;

longmeizhen@avic-s.com 2 years ago
parent
commit
93c5db15d6

+ 9 - 0
sql/longmeizhen/20220606.sql

@@ -0,0 +1,9 @@
+CREATE TABLE `tb_order_dinner_set` (
+                                       `id` int(11) NOT NULL AUTO_INCREMENT,
+                                       `status` varchar(2) DEFAULT '1' COMMENT '状态1-开启;0-关闭',
+                                       `orgId` int(11) DEFAULT NULL COMMENT '项目',
+                                       `userId` int(11) DEFAULT NULL COMMENT '用户',
+                                       PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='订餐设置表';
+
+ALTER TABLE `tb_lingling_currentset` ADD COLUMN `orderAffirm` tinyint(3) DEFAULT 0 COMMENT '预约信息确认:1-开启;0-关闭;';

+ 10 - 0
src/main/java/com/palmnest/application/dto/input/lingling/CurrentsetDto.java

@@ -16,6 +16,16 @@ public class CurrentsetDto {
 
     private Integer operator;
 
+    private Integer orderAffirm;//预约信息确认
+
+    public Integer getOrderAffirm() {
+        return orderAffirm;
+    }
+
+    public void setOrderAffirm(Integer orderAffirm) {
+        this.orderAffirm = orderAffirm;
+    }
+
     public Integer getOperator() {
         return operator;
     }

+ 10 - 0
src/main/java/com/palmnest/model/lingling/LingLingCurrentset.java

@@ -26,6 +26,16 @@ public class LingLingCurrentset  implements Serializable {
     private Date modifyTime;
     private Integer isEnabled;
 
+    private Integer orderAffirm;//预约信息确认
+
+    public Integer getOrderAffirm() {
+        return orderAffirm;
+    }
+
+    public void setOrderAffirm(Integer orderAffirm) {
+        this.orderAffirm = orderAffirm;
+    }
+
     @Id
     @GeneratedValue(strategy = GenerationType.AUTO)
     @Column(name = "id", unique = true, nullable = false)

+ 4 - 0
src/main/java/com/palmnest/webapp/controller/backstage/VisitorOrderInfoController.java

@@ -312,6 +312,10 @@ public class VisitorOrderInfoController extends BaseFormController {
 			currentsetDto.setVisitedMobileType(1);
 		}
 
+		if(null == currentsetDto.getOrderAffirm()){
+			currentsetDto.setOrderAffirm(0);
+		}
+
 		if(0 == currentsetDto.getIsLinglingAudit().intValue() && (1 != currentsetDto.getVisitedMobileType().intValue() || 1 != currentsetDto.getVisitedCompType().intValue())){
 			return AppResultUtil.createErrorDto("500","访客无需审核未开启时,预约输入字段被访人相关信息必须为必填项");
 		}

+ 60 - 0
src/main/java/com/palmnest/webapp/controller/wechat/VisitorUserInfoController.java

@@ -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);
+	}
+
 	/**
 	 * 保存用户信息
 	 *