| | |
| | | @TableField("pledge_bank") |
| | | private String pledgeBank; |
| | | |
| | | @Column(name = "pledge_bank_user", columnDefinition = "varchar(40) COMMENT '质押银行业务员'") |
| | | @TableField("pledge_bank_user") |
| | | private String pledgeBankUser; |
| | | |
| | | //质押公司 |
| | | @Column(name = "pledge_company", columnDefinition = "varchar(40) COMMENT '质押公司'") |
| | | @TableField("pledge_company") |
| | |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | |
| | | //获取当前登录人 |
| | | SysUser user = ContextUtil.getLoginUser(); |
| | | |
| | | if(null != user){ |
| | | if (Constant.USER_TYPE_10.equals(user.getUserType())) { |
| | | //监管用户,直接查询组织下所有库区 |
| | | return this.listDept(null,user.getCompanyId(),null); |
| | |
| | | } |
| | | } |
| | | return this.listDept(null,user.getCompanyId(),null); |
| | | |
| | | } |
| | | return this.listDept(null,ContextUtil.getCompanyId(),null); |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | return pledgeContractMapper.selectList(queryWrapper); |
| | | } |
| | | |
| | | |
| | | public List<PledgeContract> getDateByUser(String userId) { |
| | | if(StringUtils.isBlank(userId)){ |
| | | return new ArrayList<PledgeContract>(); |
| | | } |
| | | QueryWrapper<PledgeContract> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("company_id", ContextUtil.getCompanyId()); |
| | | queryWrapper.eq("pledge_bank_user", userId); |
| | | return pledgeContractMapper.selectList(queryWrapper); |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 根据条件查询 |
| | | * @param id |
| | |
| | | */ |
| | | public void listPage(Page<SnapReply> page, IgdsBaseParam param) { |
| | | QueryWrapper<SnapReply> queryWrapper = new QueryWrapper<>(); |
| | | |
| | | if (StringUtils.isBlank(param.getCompanyId())) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | |
| | | //库区检索 |
| | |
| | | snapReplyMapper.selectPage(page, queryWrapper); |
| | | } |
| | | |
| | | public void listPageByListDept(Page<SnapReply> page, IgdsBaseParam param, List<String> listDept) { |
| | | if( listDept == null || listDept.isEmpty()){ |
| | | return; |
| | | } |
| | | |
| | | QueryWrapper<SnapReply> queryWrapper = new QueryWrapper<>(); |
| | | if (StringUtils.isBlank(param.getCompanyId())) { |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | } |
| | | queryWrapper.eq("company_id", param.getCompanyId()); |
| | | |
| | | //库区检索 |
| | | if (!listDept.isEmpty()) { |
| | | queryWrapper.in("dept_id", listDept); |
| | | } |
| | | //是否处理检索 |
| | | if (StringUtils.isNotBlank(param.getKey())) { |
| | | queryWrapper.eq("is_handle", param.getKey()); |
| | | } |
| | | |
| | | queryWrapper.orderByDesc("create_time"); |
| | | queryWrapper.orderByDesc("id"); |
| | | snapReplyMapper.selectPage(page, queryWrapper); |
| | | } |
| | | |
| | | /** |
| | | * 查询所有数据 |
| | | * |
| | |
| | | |
| | | return userMapper.selectUserList(param); |
| | | } |
| | | |
| | | |
| | | public List<SysUser> getBindBankUserList(String bankId) { |
| | | SysUser param = new SysUser(); |
| | | param.setCompanyId(ContextUtil.getCompanyId()); |
| | | param.setUserType(Constant.USER_TYPE_20); |
| | | if( StringUtils.isNotBlank(bankId)){ |
| | | param.setUserData(bankId); |
| | | } |
| | | return userMapper.selectUserList(param); |
| | | } |
| | | } |
| | |
| | | <Property name="dataType">[dtPledgeContractDepot]</Property> |
| | | <Property name="loadMode">manual</Property> |
| | | </DataSet> |
| | | <DataSet id="dsBankUser"> |
| | | <Property name="dataProvider">pledgeContractPR#getBankUserList</Property> |
| | | <Property name="userData">业务经理下拉列表</Property> |
| | | <Property name="loadMode">manual</Property> |
| | | <Property name="dataType">[dtSysUser]</Property> |
| | | </DataSet> |
| | | <Container> |
| | | <Property name="className">c-param</Property> |
| | | <AutoForm> |
| | |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">pledgeBankUser</Property> |
| | | <Property name="property">pledgeBankUser</Property> |
| | | <Property name="trigger">dsBankUserDropDown</Property> |
| | | <Editor/> |
| | | </AutoFormElement> |
| | | <AutoFormElement> |
| | | <Property name="name">pledgeCompany</Property> |
| | | <Property name="property">pledgeCompany</Property> |
| | | <Editor/> |
| | |
| | | </Children> |
| | | <Tools/> |
| | | </Dialog> |
| | | <DataSetDropDown id="dsBankUserDropDown"> |
| | | <ClientEvent name="onOpen">
 |
| | | var entity = view.get("#dsMain.data:#");
 |
| | | if(!entity){
 |
| | | $alert("请先选择所属库区");
 |
| | | }else{
 |
| | | var pledgeBank = entity.get("pledgeBank");
 |
| | | if(!pledgeBank){
 |
| | | $alert("请先选择质押银行");
 |
| | | }else{
 |
| | | view.get("#dsBankUser").set("parameter",entity.get("pledgeBank")).flushAsync();
 |
| | | } |
| | | }</ClientEvent> |
| | | <Property name="dataSet">dsBankUser</Property> |
| | | <Property name="height">450</Property> |
| | | <Property name="autoOpen">true</Property> |
| | | <Property name="assignmentMap">pledgeBankUser=userId</Property> |
| | | <Property name="width">400</Property> |
| | | <DataColumn> |
| | | <Property name="align">center</Property> |
| | | <Property name="name">userName</Property> |
| | | <Property name="property">userName</Property> |
| | | <Editor/> |
| | | </DataColumn> |
| | | </DataSetDropDown> |
| | | </View> |
| | | </ViewConfig> |
| | |
| | | import com.fzzy.igds.service.DepotService; |
| | | import com.fzzy.igds.service.PledgeContractDepotService; |
| | | import com.fzzy.igds.service.PledgeContractService; |
| | | import com.fzzy.igds.service.SysUserService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | |
| | | @Resource |
| | | private PledgeContractDepotService pledgeContractDepotService; |
| | | |
| | | @Resource |
| | | private SysUserService sysUserService; |
| | | |
| | | @Resource |
| | | private DepotService depotService; |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | /** 获取质押银行业务经理数据 |
| | | * pledgeContractPR#getBankUserList |
| | | * |
| | | * @return |
| | | */ |
| | | @DataProvider |
| | | public List<SysUser> getBankUserList(String parentId) { |
| | | if (com.ruoyi.common.utils.StringUtils.isNotEmpty(parentId)) { |
| | | return sysUserService.getBindBankUserList(parentId); |
| | | } |
| | | return sysUserService.getBindBankUserList(null); |
| | | } |
| | | } |
| | |
| | | <Property name="valueProperty">name</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="pledgeBankUser"> |
| | | <Property name="label">银行业务经理</Property> |
| | | <Property name="mapping"> |
| | | <Property name="mapValues">${dorado.getDataProvider("pledgeContractPR#getBankUserList").getResult()}</Property> |
| | | <Property name="keyProperty">userId</Property> |
| | | <Property name="valueProperty">userName</Property> |
| | | </Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="pledgeCompany"> |
| | | <Property></Property> |
| | | <Property name="label">质押公司</Property> |
| | |
| | | </PropertyDef> |
| | | <PropertyDef name="userName"> |
| | | <Property></Property> |
| | | <Property name="label">用户名称</Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="userType"> |
| | | <Property></Property> |
| | | </PropertyDef> |
| | | <PropertyDef name="userData"> |
| | | <Property name="label">所属银行</Property> |
| | | </PropertyDef> |
| | | </DataType> |
| | | </Model> |
| | |
| | | import com.fzzy.appwx.constant.WeChatConst; |
| | | import com.fzzy.appwx.manager.WeChatManager; |
| | | import com.fzzy.appwx.param.WeChatBaseParam; |
| | | import com.fzzy.group.manager.GroupManager; |
| | | import com.fzzy.igds.data.ConfigData; |
| | | import com.fzzy.igds.data.PageResponse; |
| | | import com.fzzy.igds.domain.Dept; |
| | | import com.fzzy.igds.domain.SnapReply; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.net.URLEncoder; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.List; |
| | | |
| | | @Slf4j |
| | | @Controller |
| | |
| | | private ConfigData configData; |
| | | @Resource |
| | | private WeChatManager weChatManager; |
| | | @Resource |
| | | private GroupManager groupManager; |
| | | |
| | | |
| | | /** |
| | |
| | | tag = "home"; |
| | | } |
| | | |
| | | String newUrl = WeChatConst.USER_AUTH_UPR |
| | | .replace("APPID", configData.getWxAppId()) |
| | | .replace("REDIRECT_URI", URLEncoder.encode(url, "UTF-8")) |
| | | .replace("STATE", tag); |
| | | |
| | | return "redirect:" + newUrl; |
| | | // return "redirect:" + url + "?state=" + tag; |
| | | // String newUrl = WeChatConst.USER_AUTH_UPR |
| | | // .replace("APPID", configData.getWxAppId()) |
| | | // .replace("REDIRECT_URI", URLEncoder.encode(url, "UTF-8")) |
| | | // .replace("STATE", tag); |
| | | // |
| | | // return "redirect:" + newUrl; |
| | | return "redirect:" + url + "?state=" + tag; |
| | | } |
| | | |
| | | |
| | |
| | | mv.addObject("userName", userName); |
| | | } |
| | | mv.setViewName("/wx/" + state); |
| | | //验证码类型 |
| | | if("bind".equals( state) || "unbind".equals( state)){ |
| | | mv.addObject("captchaType", "math"); |
| | | } |
| | | |
| | | //// //测试代码开启 |
| | | // String openid = "testOpenId"; |
| | | // mv.addObject("openid", openid); |
| | | // SysUser user = weChatManager.getUser(openid); |
| | | // if (StringUtils.isEmpty(userName)) { |
| | | // if (user != null) { |
| | | // userName = user.getUserName(); |
| | | // } |
| | | // } |
| | | // |
| | | // if (StringUtils.isNotEmpty(userName)) { |
| | | // mv.addObject("userName", userName); |
| | | // } |
| | | //// //测试代码结束 |
| | | |
| | | //查询库区信息 |
| | | List<Dept> deptList = groupManager.getDeptList(); |
| | | mv.addObject("deptList", deptList); |
| | | |
| | | |
| | | // //测试代码开启 |
| | | String openid = "testOpenId"; |
| | | mv.addObject("openid", openid); |
| | | SysUser user = weChatManager.getUser(openid); |
| | | if (StringUtils.isEmpty(userName)) { |
| | | if (user != null) { |
| | | userName = user.getUserName(); |
| | | } |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(userName)) { |
| | | mv.addObject("userName", userName); |
| | | } |
| | | // //测试代码结束 |
| | | |
| | | return mv; |
| | | } |
| | |
| | | */ |
| | | @PostMapping(value = "/bandOpenId") |
| | | @ResponseBody |
| | | public PageResponse<String> bandOpenId( @RequestBody WeChatBaseParam param) { |
| | | return weChatManager.bandOpenId(param); |
| | | public PageResponse<String> bandOpenId(HttpServletRequest httpRequest, @RequestBody WeChatBaseParam param) { |
| | | return weChatManager.bandOpenId(httpRequest,param); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @PostMapping(value = "/unBandOpenId") |
| | | @ResponseBody |
| | | public PageResponse<String> unBandOpenId( @RequestBody WeChatBaseParam param) { |
| | | return weChatManager.unBandOpenId(param); |
| | | public PageResponse<String> unBandOpenId( HttpServletRequest httpRequest, @RequestBody WeChatBaseParam param) { |
| | | //在这里调用验证码校验 |
| | | |
| | | return weChatManager.unBandOpenId(httpRequest,param); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 获取出入库告警批复分页数据 |
| | | * |
| | |
| | | import com.fzzy.igds.constant.RespCodeEnum; |
| | | import com.fzzy.igds.data.IgdsBaseParam; |
| | | import com.fzzy.igds.data.PageResponse; |
| | | import com.fzzy.igds.domain.PledgeContract; |
| | | import com.fzzy.igds.domain.PledgeContractDepot; |
| | | import com.fzzy.igds.domain.SnapReply; |
| | | import com.fzzy.igds.service.PledgeContractDepotService; |
| | | import com.fzzy.igds.service.PledgeContractService; |
| | | import com.fzzy.igds.service.SnapReplyService; |
| | | import com.google.code.kaptcha.Constants; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.ShiroUtils; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Component |
| | | public class WeChatManager { |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private WeChatUtil weChatUtil; |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | @Resource |
| | | private SnapReplyService snapReplyService; |
| | | |
| | | @Resource |
| | | private PledgeContractService pledgeContractService; |
| | | |
| | | @Resource |
| | | private PledgeContractDepotService pledgeContractDepotService; |
| | | |
| | | |
| | | public String getOpenid(String code) { |
| | |
| | | return new PageResponse(RespCodeEnum.CODE_0000.getCode(), "查询成功", user); |
| | | } |
| | | |
| | | //校验验证码 |
| | | public boolean validateResponse(HttpServletRequest request, String validateCode) { |
| | | // ① 从Session获取生成的验证码 |
| | | Object obj = ShiroUtils.getSession().getAttribute(Constants.KAPTCHA_SESSION_KEY); |
| | | String code = String.valueOf(obj != null ? obj : ""); |
| | | |
| | | // ② 立即清除Session中的验证码(防止重复使用) |
| | | request.getSession().removeAttribute(Constants.KAPTCHA_SESSION_KEY); |
| | | |
| | | // ③ 比对用户输入和正确答案(忽略大小写) |
| | | if (StringUtils.isEmpty(validateCode) || !validateCode.equalsIgnoreCase(code)) { |
| | | return false; |
| | | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | //绑定openId |
| | | public PageResponse<String> bandOpenId(WeChatBaseParam param) { |
| | | public PageResponse<String> bandOpenId(HttpServletRequest httpRequest,WeChatBaseParam param) { |
| | | |
| | | //判断参数 |
| | | if (null == param || StringUtils.isEmpty(param.getOpenid())) { |
| | |
| | | return new PageResponse<String>(RespCodeEnum.CODE_1007.getCode(), "手机号为空,请填写"); |
| | | |
| | | } |
| | | // if (StringUtils.isEmpty(param.getMsgCode())) { |
| | | // return new PageResponse<String>(RespCodeEnum.CODE_1007.getCode(), "验证码不能为空"); |
| | | // |
| | | // } |
| | | // |
| | | // String code = (String) redisService.getCacheObject(WeChatConst.WX_MOBILE_CODE + param.getMobile()); |
| | | // if(StringUtils.isEmpty(code)){ |
| | | // res.put("code","1007"); |
| | | // res.put("msg","验证码已失效,请重新获取"); |
| | | // return res; |
| | | // } |
| | | // if(! code.equals(param.getMsgCode())){ |
| | | // res.put("code","1007"); |
| | | // res.put("msg","验证码错误"); |
| | | // return res; |
| | | // } |
| | | if (StringUtils.isEmpty(param.getMsgCode())) { |
| | | return new PageResponse<String>(RespCodeEnum.CODE_1007.getCode(), "验证码不能为空"); |
| | | |
| | | } |
| | | //验证码验证 |
| | | boolean validateResponse = validateResponse(httpRequest, param.getMsgCode()); |
| | | if (!validateResponse) { |
| | | return new PageResponse<String>(RespCodeEnum.CODE_1007.getCode(), "验证码错误"); |
| | | } |
| | | |
| | | //根据手机号查看用户是否是系统用户 |
| | | SysUser user = sysUserService.selectUserByPhoneNumber(param.getMobile()); |
| | |
| | | |
| | | // redisService.deleteObject(WeChatConst.WX_MOBILE_CODE + param.getMobile()); |
| | | |
| | | return new PageResponse<String>(RespCodeEnum.CODE_0000.getCode(), "请求成功"); |
| | | return new PageResponse<String>(RespCodeEnum.CODE_0000.getCode(), "绑定成功"); |
| | | |
| | | } |
| | | |
| | | |
| | | //解绑openId |
| | | public PageResponse<String> unBandOpenId(WeChatBaseParam param) { |
| | | public PageResponse<String> unBandOpenId(HttpServletRequest httpRequest,WeChatBaseParam param) { |
| | | |
| | | //判断参数 |
| | | if (null == param || StringUtils.isEmpty(param.getOpenid())) { |
| | |
| | | return new PageResponse<String>(RespCodeEnum.CODE_1007.getCode(), "验证码不能为空"); |
| | | |
| | | } |
| | | |
| | | // String code = (String) redisService.getCacheObject(WeChatConst.WX_MOBILE_CODE + param.getMobile()); |
| | | // if(StringUtils.isEmpty(code)){ |
| | | // res.put("code","1007"); |
| | | // res.put("msg","验证码已失效,请重新获取"); |
| | | // return res; |
| | | // |
| | | // } |
| | | // if(! code.equals(param.getMsgCode())){ |
| | | // res.put("code","1007"); |
| | | // res.put("msg","验证码错误"); |
| | | // return res; |
| | | // } |
| | | |
| | | //验证码验证 |
| | | boolean validateResponse = validateResponse(httpRequest, param.getMsgCode()); |
| | | if (!validateResponse) { |
| | | return new PageResponse<String>(RespCodeEnum.CODE_1007.getCode(), "验证码错误"); |
| | | } |
| | | //根据手机号查询用户是否已经绑定 |
| | | SysUser user = sysUserService.selectUserByPhoneNumber(param.getMobile()); |
| | | if (user == null || StringUtils.isEmpty(user.getPhonenumber())) { |
| | |
| | | |
| | | user.setOpenId(""); |
| | | sysUserService.updateUserInfo(user); |
| | | |
| | | // redisService.deleteObject(WeChatConst.WX_MOBILE_CODE + param.getMobile()); |
| | | |
| | | return new PageResponse<String>(RespCodeEnum.CODE_0000.getCode(), "请求成功"); |
| | | |
| | |
| | | return new PageResponse<Page<SnapReply>>(RespCodeEnum.CODE_1006.getCode(), "尚未绑定服务,请先绑定!"); |
| | | |
| | | } |
| | | //获取业务经理绑定的质押合同 |
| | | List<PledgeContract> dateByUser = pledgeContractService.getDateByUser(String.valueOf(user.getUserId())); |
| | | if (dateByUser == null || dateByUser.isEmpty()) { |
| | | //返回空数据 |
| | | return new PageResponse<Page<SnapReply>>(RespCodeEnum.CODE_0000.getCode(), "请求成功", new Page<>(param.getPageNo(), param.getPageSize())); |
| | | } |
| | | List<PledgeContractDepot> pledgeContractDepots = new ArrayList<>() ; |
| | | for (PledgeContract pledgeContract : dateByUser) { |
| | | String id = pledgeContract.getId(); |
| | | IgdsBaseParam depotPParam = new IgdsBaseParam(); |
| | | depotPParam.setParentId(id); |
| | | List<PledgeContractDepot> pledgeContractDepots1 = pledgeContractDepotService.listAll(depotPParam); |
| | | pledgeContractDepots.addAll(pledgeContractDepots1); |
| | | } |
| | | if(pledgeContractDepots.isEmpty()){ |
| | | //返回空数据 |
| | | return new PageResponse<Page<SnapReply>>(RespCodeEnum.CODE_0000.getCode(), "请求成功", new Page<>(param.getPageNo(), param.getPageSize())); |
| | | } |
| | | |
| | | // 获取pledgeContractDepots中去重后的库区IDList |
| | | List<String> deptIdList = pledgeContractDepots.stream().map(PledgeContractDepot::getPledgeDept).distinct().collect(Collectors.toList()); |
| | | |
| | | //分页拼接 |
| | | Page<SnapReply> page = new Page<>(param.getPageNo(), param.getPageSize()); |
| | | //查询参数组装 |
| | | IgdsBaseParam queryParam = new IgdsBaseParam(); |
| | | queryParam.setDeptId(String.valueOf(user.getDeptId())); |
| | | queryParam.setCompanyId(user.getCompanyId()); |
| | | queryParam.setKey(Constant.YN_N); |
| | | snapReplyService.listPage(page, queryParam); |
| | | snapReplyService.listPageByListDept(page, queryParam,deptIdList); |
| | | return new PageResponse<Page<SnapReply>>(RespCodeEnum.CODE_0000.getCode(), "请求成功", page); |
| | | } |
| | | |
| | |
| | | .mui-content { |
| | | margin: 0 6px; |
| | | } |
| | | |
| | | .mui-content-padded { |
| | | margin: 10px; |
| | | width: 96%; |
| | | margin: auto; |
| | | margin-top: 8px; |
| | | } |
| | | |
| | | .mui-radio { |
| | | float: left; |
| | | } |
| | | |
| | | .mui-radio.mui-left input[type=radio] { |
| | | left: 1px; |
| | | } |
| | | |
| | | .mui-checkbox.mui-left label, .mui-radio.mui-left label { |
| | | padding-right: 20px; |
| | | padding-left: 35px; |
| | | } |
| | | |
| | | .mui-btn-block { |
| | | width: 96%; |
| | | margin: auto; |
| | | margin-top: 10px; |
| | | padding: 8px 0; |
| | | } |
| | | |
| | | .mui-input-row label ~ input { |
| | | float: left; |
| | | width: 50%; |
| | | } |
| | | |
| | | .mui-input-row label { |
| | | width: 27%; |
| | | } |
| | | |
| | | .btn { |
| | | margin-top: 4px; |
| | | margin-right: 2px; |
| | |
| | | color: #fff; |
| | | padding: 5px 5px; |
| | | } |
| | | |
| | | .ts { |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .login-yzm-btn { |
| | | width: 80px; |
| | | height: 38px; |
| | | } |
| | | </style> |
| | | </head> |
| | |
| | | </div> |
| | | <div class="mui-input-row"> |
| | | <label>验证码</label> |
| | | <input id="code" style="width: 45%;" type="text" class="mui-input-clear" placeholder="5分钟内有效"> |
| | | <div id="count"> |
| | | <button type="button" class="btn" onclick="getCheck()">获取验证码</button> |
| | | <input id="code" style="width: 45%;" type="text" class="mui-input-clear" placeholder="在此输入验证码"> |
| | | </div> |
| | | <div class="mui-input-row" style="height: 60px"> |
| | | <label >点击更换验证码</label> |
| | | <a href="javascript:void(0);" title="点击更换验证码" class="login-yzm-btn"> |
| | | <img class="imgcode" |
| | | th:src="@{/captcha/captchaImage(type=${captchaType})}"/> |
| | | </a> |
| | | </div> |
| | | </form> |
| | | </div> |
| | |
| | | <script th:src="@{/wx/wx-common.js}"></script> |
| | | <script th:src="@{/ajax/libs/mui/js/mui.js}"></script> |
| | | <script th:inline="javascript"> |
| | | |
| | | var openid = [[${openid}]]; //用户的openid |
| | | var c = 60; //获取验证码后的倒计时 |
| | | var captchaType = [[${captchaType}]]; //验证码类型 |
| | | mui.init(); |
| | | |
| | | //获取验证码 |
| | | function getCheck() { |
| | | var phone = document.getElementById("phone").value; |
| | | if (phone == null || phone.trim() == '') { |
| | | mui.alert("手机号不能为空!", '提示', ["确定"], function() {}, "div"); |
| | | return; |
| | | } |
| | | var flag = /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(phone); |
| | | if (!flag) { |
| | | mui.alert("手机号格式不正确!", '提示', ["确定"], function() {}, "div"); |
| | | return; |
| | | } |
| | | //请求参数 |
| | | var data = JSON.stringify({ |
| | | "data": { |
| | | "openid": openid, |
| | | "mobile": phone |
| | | } |
| | | }); |
| | | |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../wx/gateway", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: data, |
| | | success: function (result) { |
| | | if (result.code == "0000") { |
| | | mui.toast("校验码已发送!"); |
| | | //倒计时计数 |
| | | count(); |
| | | } else { |
| | | mui.alert(result.msg, '提示', ["确定"], function() {}, "div"); |
| | | } |
| | | } |
| | | $('.imgcode').click(function () { |
| | | var url = "../captcha/captchaImage?type=" + captchaType + "&s=" + Math.random(); |
| | | $(".imgcode").attr("src", url); |
| | | }); |
| | | } |
| | | |
| | | function count() { |
| | | $("#count").html(''); |
| | | $("#count").addClass("ts"); |
| | | var interval = setInterval(function () {//定义定时器 |
| | | if (c == 0) { |
| | | clearInterval(interval);//清除定时器 |
| | | $("#count").removeClass("ts"); |
| | | $("#count").html('<button type="button" class="btn" onclick="getCheck()">获取验证码</button>'); |
| | | c = 60; |
| | | } else { |
| | | $("#count").html(c + 's后重试'); |
| | | c--; |
| | | } |
| | | }, 1000); |
| | | } |
| | | |
| | | //绑定提交 |
| | | function binding() { |
| | | var phone = document.getElementById("phone").value; |
| | | if (phone == null || phone.trim() == '') { |
| | | mui.alert("手机号不能为空!", '提示', ["确定"], function() {}, "div"); |
| | | mui.alert("手机号不能为空!", '提示', ["确定"], function () { |
| | | }, "div"); |
| | | return; |
| | | } |
| | | var flag = /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(phone); |
| | | if (!flag) { |
| | | mui.alert("手机号格式不正确!", '提示', ["确定"], function() {}, "div"); |
| | | mui.alert("手机号格式不正确!", '提示', ["确定"], function () { |
| | | }, "div"); |
| | | return; |
| | | } |
| | | var code = document.getElementById("code").value; |
| | | // if (code == null || code.trim() == '') { |
| | | // mui.alert("验证码不能为空!", '提示', ["确定"], function() {}, "div"); |
| | | // return; |
| | | // } |
| | | if (code == null || code.trim() == '') { |
| | | mui.alert("验证码不能为空!", '提示', ["确定"], function() {}, "div"); |
| | | return; |
| | | } |
| | | |
| | | var data = { |
| | | "openid": openid, |
| | |
| | | if (result.code == "0000") { |
| | | mui.toast("绑定成功!"); |
| | | } else { |
| | | mui.alert(result.msg, '提示', ["确定"], function() {}, "div"); |
| | | mui.alert(result.msg, '提示', ["确定"], function () { |
| | | }, "div"); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | </script> |
| | | </body> |
| | | </html> |
| | |
| | | |
| | | |
| | | $(function () { |
| | | window.addEventListener('pageshow', function(event) { |
| | | // 如果页面是从缓存中恢复的(包括后退),则重新加载 |
| | | if (event.persisted || performance.getEntriesByType('navigation')[0]?.type === 'back_forward') { |
| | | location.reload(); |
| | | } |
| | | }); |
| | | |
| | | if (loginType == "WECHAT") { |
| | | $("#bind").css("display", ""); |
| | | $("#unbind").css("display", ""); |
| | |
| | | .mui-content { |
| | | margin: 0 6px; |
| | | } |
| | | |
| | | .mui-content-padded { |
| | | margin: 10px; |
| | | width: 96%; |
| | | margin: auto; |
| | | margin-top: 8px; |
| | | } |
| | | |
| | | .mui-radio.mui-left input[type=radio] { |
| | | left: 1px; |
| | | } |
| | | |
| | | .mui-checkbox.mui-left label, .mui-radio.mui-left label { |
| | | padding-right: 20px; |
| | | padding-left: 35px; |
| | | } |
| | | |
| | | .mui-btn-block { |
| | | width: 96%; |
| | | margin: auto; |
| | | margin-top: 10px; |
| | | padding: 8px 0; |
| | | } |
| | | |
| | | .mui-input-row label ~ input { |
| | | float: left; |
| | | width: 50%; |
| | | } |
| | | |
| | | .mui-input-row label { |
| | | width: 27%; |
| | | } |
| | | |
| | | .btn { |
| | | margin-top: 4px; |
| | | margin-right: 2px; |
| | |
| | | color: #fff; |
| | | padding: 5px 5px; |
| | | } |
| | | |
| | | .ts { |
| | | margin-top: 10px; |
| | | } |
| | | |
| | | .login-yzm-btn { |
| | | width: 80px; |
| | | height: 38px; |
| | | } |
| | | </style> |
| | | </head> |
| | |
| | | </div> |
| | | <div class="mui-input-row"> |
| | | <label>验证码</label> |
| | | <input id="code" style="width: 45%;" type="text" class="mui-input-clear" placeholder="5分钟内有效"> |
| | | <div id="count"> |
| | | <button type="button" class="btn" onclick="getCheck()">获取验证码</button> |
| | | <input id="code" style="width: 45%;" type="text" class="mui-input-clear" placeholder="在此输入验证码"> |
| | | </div> |
| | | <div class="mui-input-row" style="height: 60px"> |
| | | <label>点击更换验证码</label> |
| | | <a href="javascript:void(0);" title="点击更换验证码" class="login-yzm-btn"> |
| | | <img class="imgcode" |
| | | th:src="@{/captcha/captchaImage(type=${captchaType})}"/> |
| | | </a> |
| | | </div> |
| | | </form> |
| | | </div> |
| | |
| | | <script th:inline="javascript"> |
| | | |
| | | var openid = [[${openid}]]; //用户的openid |
| | | var c = 60; //获取验证码后的倒计时 |
| | | var captchaType = [[${captchaType}]]; //验证码类型 |
| | | |
| | | mui.init(); |
| | | |
| | | //获取验证码 |
| | | function getCheck() { |
| | | var phone = document.getElementById("phone").value; |
| | | if (phone == null || phone.trim() == '') { |
| | | mui.alert("手机号不能为空", '提示', ["确定"], function() {}, "div"); |
| | | return; |
| | | } |
| | | var flag = /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(phone); |
| | | if (!flag) { |
| | | mui.alert("手机号格式不正确", '提示', ["确定"], function() {}, "div"); |
| | | return; |
| | | } |
| | | |
| | | //请求参数 |
| | | var data = JSON.stringify({ |
| | | "interfaceId": "app_1004", |
| | | "sign": "01", |
| | | "outId": "01-01", |
| | | "reqDateTime": new Date(), |
| | | "data": { |
| | | "openid": openid, |
| | | "mobile": phone |
| | | } |
| | | $('.imgcode').click(function () { |
| | | var url = "../captcha/captchaImage?type=" + captchaType + "&s=" + Math.random(); |
| | | $(".imgcode").attr("src", url); |
| | | }); |
| | | |
| | | $.ajax({ |
| | | type: "POST", |
| | | url: "../wx/gateway", |
| | | dataType: "json", |
| | | contentType: "application/json;charset=UTF-8", |
| | | data: data, |
| | | success: function (result) { |
| | | if (result.code == "0000") { |
| | | mui.toast("校验码已发送"); |
| | | //倒计时计数 |
| | | count(); |
| | | } else { |
| | | mui.alert(result.msg, '提示', ["确定"], function() {}, "div"); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //倒计时计数 |
| | | function count() { |
| | | $("#count").html(''); |
| | | $("#count").addClass("ts"); |
| | | var interval = setInterval(function () {//定义定时器 |
| | | if (c == 0) { |
| | | clearInterval(interval);//清除定时器 |
| | | $("#count").removeClass("ts"); |
| | | $("#count").html('<button type="button" class="btn" onclick="getCheck()">获取验证码</button>'); |
| | | c = 60; |
| | | } else { |
| | | $("#count").html(c + 's后重试'); |
| | | c--; |
| | | } |
| | | }, 1000); |
| | | } |
| | | |
| | | //绑定提交 |
| | | function unBinding() { |
| | | var phone = document.getElementById("phone").value; |
| | | if (phone == null || phone.trim() == '') { |
| | | mui.alert("手机号不能为空!", '提示', ["确定"], function() {}, "div"); |
| | | mui.alert("手机号不能为空!", '提示', ["确定"], function () { |
| | | }, "div"); |
| | | return; |
| | | } |
| | | var flag = /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(phone); |
| | | if (!flag) { |
| | | mui.alert("手机号格式不正确!", '提示', ["确定"], function() {}, "div"); |
| | | mui.alert("手机号格式不正确!", '提示', ["确定"], function () { |
| | | }, "div"); |
| | | return; |
| | | } |
| | | var code = document.getElementById("code").value; |
| | | // if (code == null || code.trim() == '') { |
| | | // mui.alert("验证码不能为空!", '提示', ["确定"], function() {}, "div"); |
| | | // return; |
| | | // } |
| | | if (code == null || code.trim() == '') { |
| | | mui.alert("验证码不能为空!", '提示', ["确定"], function () { |
| | | }, "div"); |
| | | return; |
| | | } |
| | | |
| | | var data = { |
| | | "openid": openid, |
| | |
| | | if (result.code == "0000") { |
| | | mui.toast("解绑成功!"); |
| | | } else { |
| | | mui.alert(result.msg, '提示', ["确定"], function() {}, "div"); |
| | | mui.alert(result.msg, '提示', ["确定"], function () { |
| | | }, "div"); |
| | | } |
| | | }); |
| | | } |
| | |
| | | <script th:inline="javascript"> |
| | | var warnId = [[${id}]]; //设备id |
| | | var companyId = [[${companyId}]]; //组织编码 |
| | | var deptList = [[${deptList}]]; |
| | | var userName = [[${userName}]]; //当前操作人账号 |
| | | var loginType = [[${loginType}]]; //登录方式 |
| | | var deptListMap = {}; |
| | | $(function () { |
| | | //所有库区 |
| | | if (deptList) { |
| | | for (var i = 0; i < deptList.length; i++) { |
| | | deptListMap[deptList[i].id] = deptList[i]; |
| | | } |
| | | } |
| | | mui.init(); |
| | | try { |
| | | getDeviceList(); |
| | |
| | | |
| | | //初始化页面数据 |
| | | function initData(data) { |
| | | var deptName = deptListMap[data.deptId] ? deptListMap[data.deptId].kqmc : data.deptId; |
| | | |
| | | var html1 = ''; |
| | | var html2 = ''; |
| | | html1 += '<h4 class="mui-ellipsis">' + data.id; |
| | | html1 += '<span class="first">' + data.deptId + '</span></h4>'; |
| | | html1 += '<h4 class="mui-ellipsis">' +deptName; |
| | | html1 += '<h5 class="mui-ellipsis">' + data.createTime + '</h5>'; |
| | | html1 += '<p>' + data.content + '</p>'; |
| | | |
| | |
| | | <script th:src="@{/ajax/libs/mui/js/mui.js}"></script> |
| | | <script th:inline="javascript"> |
| | | var loginType = [[${loginType}]]; //登录方式 |
| | | var deptList = [[${deptList}]]; |
| | | var userName = [[${userName}]]; |
| | | openid = [[${openid}]]; //用户的openid |
| | | SERVE_URL = location.href.split("/wx/")[0]; //服务域名 |
| | |
| | | var total; |
| | | var pageCount; //总页码数 |
| | | var warnList; //每页数据 |
| | | var deptListMap = {}; |
| | | $(function () { |
| | | //所有库区 |
| | | if (deptList) { |
| | | for (var i = 0; i < deptList.length; i++) { |
| | | deptListMap[deptList[i].id] = deptList[i]; |
| | | } |
| | | } |
| | | |
| | | // 监听页面显示事件(微信 H5 环境) |
| | | window.addEventListener('pageshow', function() { |
| | | if (localStorage.getItem('needRefresh') === 'true') { |
| | |
| | | mui('#pullrefresh').pullRefresh().endPullupToRefresh((pageNo>=pageCount)); |
| | | var table = document.body.querySelector('.mui-table-view'); |
| | | for (var i = 0; i < warnList.length; i++) { |
| | | var deptName = deptListMap[warnList[i].deptId] ? deptListMap[warnList[i].deptId].kqmc : warnList[i].deptId; |
| | | console.log(deptListMap); |
| | | var li = document.createElement('li'); |
| | | li.className = 'mui-table-view-cell'; |
| | | var html = ''; |
| | | html += '<div onclick="toWarnDetail(\'' + warnList[i].id +'\',\'' + warnList[i].companyId + '\')" class="mui-table">'; |
| | | html += '<div class="mui-table-cell mui-col-xs-10"><h4 class="mui-ellipsis">' + warnList[i].id; |
| | | html += '</span></h4><h5>所属库区:<span>' + warnList[i].deptId; |
| | | html += '</span></h4><h5>所属库区:<span>' + deptName; |
| | | html += '</span></h5><h5>警告时间:<span>' + warnList[i].createTime; |
| | | html += '</span></h5><p class="mui-h6 mui-ellipsis">警告说明:' +warnList[i].content; |
| | | li.innerHTML = html; |