| | |
| | | |
| | | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml |
| | | hs_err_pid* |
| | | /.idea/ |
| | | /logs/ |
| | | /meiya-admin/target/ |
| | | /meiya-common/target/ |
| | | /meiya-core/target/ |
| | | /meiya-generator/target/ |
| | | /meiya-rest/target/ |
| | | /meiya-shop/target/ |
| | |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | return PREFIX + "memUserSales.html"; |
| | | boolean admin = ShiroKit.isAdmin(); |
| | | if (admin) { |
| | | return PREFIX + "memUserSales.html"; |
| | | } else { |
| | | return PREFIX + "memUserSalesAuth.html"; |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | |
| | | @ResponseBody |
| | | @RequestMapping(value = "/export") |
| | | public void export(String beginTime, String endTime, String nickName, String phone, String showId, Integer isLock, Integer isLeaveOffice, Integer memberGradeId, HttpServletResponse response) { |
| | | boolean admin = ShiroKit.isAdmin(); |
| | | List<Map<String, Object>> list = this.wrapperList(null, beginTime, endTime, nickName, phone, showId, isLock, isLeaveOffice, memberGradeId); |
| | | |
| | | // 表格数据【封装】 |
| | | List<List<Object>> dataList = new ArrayList<>(); |
| | | |
| | | // 头部列【封装】 |
| | | List<Object> shellList = new ArrayList<>(); |
| | | shellList.add("工号"); |
| | | shellList.add("提交时间"); |
| | | shellList.add("推荐人工号"); |
| | | shellList.add("推荐人"); |
| | | shellList.add("推荐人所在城市"); |
| | | shellList.add("姓名"); |
| | | shellList.add("性别"); |
| | | shellList.add("生日"); |
| | | shellList.add("联系电话"); |
| | | shellList.add("证件类型"); |
| | | shellList.add("证件号码"); |
| | | shellList.add("银行卡号"); |
| | | shellList.add("品行分"); |
| | | shellList.add("审核状态"); |
| | | shellList.add("佣金等级"); |
| | | shellList.add("积分"); |
| | | shellList.add("入司时间"); |
| | | shellList.add("状态"); |
| | | shellList.add("城市合伙人工号"); |
| | | shellList.add("城市合伙人团队"); |
| | | shellList.add("市场总监工号"); |
| | | shellList.add("市场总监团队"); |
| | | dataList.add(shellList); |
| | | |
| | | // 详细数据列【封装】 |
| | | for (Map<String, Object> map : list) { |
| | | shellList = new ArrayList<>(); |
| | | shellList.add(map.get("show_id")); |
| | | shellList.add(map.get("apply_time")); |
| | | shellList.add(map.get("equityUserShowId")); |
| | | shellList.add(map.get("equityUserRealName")); |
| | | shellList.add(map.get("equityUserCityCode")); |
| | | shellList.add(map.get("real_name")); |
| | | shellList.add(map.get("sex")); |
| | | shellList.add(map.get("birthday")); |
| | | shellList.add(map.get("phone")); |
| | | shellList.add(Convert.toInt(map.get("card_type")) == 0 ? "身份证" : "护照"); |
| | | shellList.add(map.get("id_card")); |
| | | shellList.add(map.get("bank_number")); |
| | | shellList.add(map.get("credit_score")); |
| | | shellList.add(EnumAuditState.getMarkByIndex(Convert.toInt(map.get("audit_state")))); |
| | | shellList.add(EnumMemberGrade.getAliasByIndex(Convert.toInt(map.get("member_grade_id")))); |
| | | shellList.add(map.get("integral")); |
| | | shellList.add(map.get("audit_time")); |
| | | Integer isLeaveOfficeNum = Convert.toInt(map.get("is_leave_office")); |
| | | shellList.add(isLeaveOfficeNum == 0 ? "在职" : isLeaveOfficeNum == 1 ? "离职" : "-"); |
| | | shellList.add(map.get("v4ShowId")); |
| | | shellList.add(map.get("v4Team")); |
| | | shellList.add(map.get("v5ShowId")); |
| | | shellList.add(map.get("v5Team")); |
| | | if (admin) { |
| | | // 头部列【封装】 |
| | | List<Object> shellList = new ArrayList<>(); |
| | | shellList.add("工号"); |
| | | shellList.add("提交时间"); |
| | | shellList.add("推荐人工号"); |
| | | shellList.add("推荐人"); |
| | | shellList.add("推荐人所在城市"); |
| | | shellList.add("姓名"); |
| | | shellList.add("性别"); |
| | | shellList.add("生日"); |
| | | shellList.add("联系电话"); |
| | | shellList.add("证件类型"); |
| | | shellList.add("证件号码"); |
| | | shellList.add("银行卡号"); |
| | | shellList.add("品行分"); |
| | | shellList.add("审核状态"); |
| | | shellList.add("佣金等级"); |
| | | shellList.add("积分"); |
| | | shellList.add("入司时间"); |
| | | shellList.add("状态"); |
| | | shellList.add("城市合伙人工号"); |
| | | shellList.add("城市合伙人团队"); |
| | | shellList.add("市场总监工号"); |
| | | shellList.add("市场总监团队"); |
| | | dataList.add(shellList); |
| | | |
| | | // 详细数据列【封装】 |
| | | for (Map<String, Object> map : list) { |
| | | shellList = new ArrayList<>(); |
| | | shellList.add(map.get("show_id")); |
| | | shellList.add(map.get("apply_time")); |
| | | shellList.add(map.get("equityUserShowId")); |
| | | shellList.add(map.get("equityUserRealName")); |
| | | shellList.add(map.get("equityUserCityCode")); |
| | | shellList.add(map.get("real_name")); |
| | | shellList.add(map.get("sex")); |
| | | shellList.add(map.get("birthday")); |
| | | shellList.add(map.get("phone")); |
| | | shellList.add(Convert.toInt(map.get("card_type")) == 0 ? "身份证" : "护照"); |
| | | shellList.add(map.get("id_card")); |
| | | shellList.add(map.get("bank_number")); |
| | | shellList.add(map.get("credit_score")); |
| | | shellList.add(EnumAuditState.getMarkByIndex(Convert.toInt(map.get("audit_state")))); |
| | | shellList.add(EnumMemberGrade.getAliasByIndex(Convert.toInt(map.get("member_grade_id")))); |
| | | shellList.add(map.get("integral")); |
| | | shellList.add(map.get("audit_time")); |
| | | Integer isLeaveOfficeNum = Convert.toInt(map.get("is_leave_office")); |
| | | shellList.add(isLeaveOfficeNum == 0 ? "在职" : isLeaveOfficeNum == 1 ? "离职" : "-"); |
| | | shellList.add(map.get("v4ShowId")); |
| | | shellList.add(map.get("v4Team")); |
| | | shellList.add(map.get("v5ShowId")); |
| | | shellList.add(map.get("v5Team")); |
| | | dataList.add(shellList); |
| | | } |
| | | } else { |
| | | // 头部列【封装】 |
| | | List<Object> shellList = new ArrayList<>(); |
| | | shellList.add("工号"); |
| | | shellList.add("提交时间"); |
| | | shellList.add("推荐人工号"); |
| | | shellList.add("推荐人"); |
| | | shellList.add("推荐人所在城市"); |
| | | shellList.add("姓名"); |
| | | shellList.add("性别"); |
| | | shellList.add("生日"); |
| | | shellList.add("证件类型"); |
| | | shellList.add("品行分"); |
| | | shellList.add("审核状态"); |
| | | shellList.add("佣金等级"); |
| | | shellList.add("积分"); |
| | | shellList.add("入司时间"); |
| | | shellList.add("状态"); |
| | | shellList.add("城市合伙人工号"); |
| | | shellList.add("城市合伙人团队"); |
| | | shellList.add("市场总监工号"); |
| | | shellList.add("市场总监团队"); |
| | | dataList.add(shellList); |
| | | |
| | | // 详细数据列【封装】 |
| | | for (Map<String, Object> map : list) { |
| | | shellList = new ArrayList<>(); |
| | | shellList.add(map.get("show_id")); |
| | | shellList.add(map.get("apply_time")); |
| | | shellList.add(map.get("equityUserShowId")); |
| | | shellList.add(map.get("equityUserRealName")); |
| | | shellList.add(map.get("equityUserCityCode")); |
| | | shellList.add(map.get("real_name")); |
| | | shellList.add(map.get("sex")); |
| | | shellList.add(map.get("birthday")); |
| | | shellList.add(Convert.toInt(map.get("card_type")) == 0 ? "身份证" : "护照"); |
| | | shellList.add(map.get("credit_score")); |
| | | shellList.add(EnumAuditState.getMarkByIndex(Convert.toInt(map.get("audit_state")))); |
| | | shellList.add(EnumMemberGrade.getAliasByIndex(Convert.toInt(map.get("member_grade_id")))); |
| | | shellList.add(map.get("integral")); |
| | | shellList.add(map.get("audit_time")); |
| | | Integer isLeaveOfficeNum = Convert.toInt(map.get("is_leave_office")); |
| | | shellList.add(isLeaveOfficeNum == 0 ? "在职" : isLeaveOfficeNum == 1 ? "离职" : "-"); |
| | | shellList.add(map.get("v4ShowId")); |
| | | shellList.add(map.get("v4Team")); |
| | | shellList.add(map.get("v5ShowId")); |
| | | shellList.add(map.get("v5Team")); |
| | | dataList.add(shellList); |
| | | } |
| | | } |
| | | |
| | | try { |
| | | String title = "营销员"; |
| | | // 调用工具类进行导出 |
| | |
| | | */ |
| | | @RequestMapping(value = "/detail/{memUserId}") |
| | | public Object detail(@PathVariable("memUserId") Integer memUserId, Model model) { |
| | | boolean admin = ShiroKit.isAdmin(); |
| | | model.addAttribute("isAdmin", admin); |
| | | // 个人信息 |
| | | MemUser memUser = memUserService.selectById(memUserId); |
| | | if (memUser != null) { |
| | |
| | | List<Map<String, Object>> getMapList(@Param("ew") Wrapper wrapper); |
| | | |
| | | List<Map<String, Object>> getMapList(Page<Map<String, Object>> page, @Param("ew") Wrapper wrapper); |
| | | |
| | | List<Map<String, Object>> getMapListAuth(@Param("ew") Wrapper wrapper); |
| | | |
| | | List<Map<String, Object>> getMapListAuth(Page<Map<String, Object>> page, @Param("ew")Wrapper wrapper); |
| | | } |
| | |
| | | id, create_time, show_id, phone, nick_name, password, avatar, is_lock, is_delete, is_leave_office, leave_office_time, real_name, id_card, city_code, member_grade_id, member_grade_time, sex, birthday, signature, address, |
| | | apply_time, audit_state, audit_time, card_type, integral, balance, balance_freeze, credit_score, bank_name, bank_open, bank_number, id_card_front_image, id_card_back_image, id_card_hand_image, sign_image, equity_user_id, equity_order_no |
| | | </sql> |
| | | |
| | | <sql id="Auth_Column_List"> |
| | | o.id, o.create_time, o.show_id, o.nick_name,o.password, o.avatar, o.is_lock, o.is_delete, o.is_leave_office, o.leave_office_time,o. real_name, o.id_card, o.city_code, o.member_grade_id, o.member_grade_time, o.sex, o.birthday, |
| | | o.signature, o.address,o.apply_time, o.audit_state, o.audit_time, o.card_type, o.integral,o.balance, o.balance_freeze, o.credit_score, o.id_card_front_image, o.id_card_back_image, o.id_card_hand_image, o.sign_image, o.equity_user_id, o.equity_order_no, |
| | | </sql> |
| | | <select id="getMapList" resultType="java.util.Map"> |
| | | SELECT o.*, ur.relation_path |
| | | FROM mem_user o |
| | | LEFT JOIN mem_user_relation ur ON ur.id = o.id |
| | | WHERE 1 = 1 ${ew.sqlSegment} |
| | | </select> |
| | | <select id="getMapListAuth" resultType="java.util.Map"> |
| | | SELECT <include refid="Auth_Column_List"/> ur.relation_path |
| | | FROM mem_user o |
| | | LEFT JOIN mem_user_relation ur ON ur.id = o.id |
| | | WHERE 1 = 1 ${ew.sqlSegment} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import com.sinata.common.enums.EnumUserBankDetailDoneType; |
| | | import com.sinata.common.enums.EnumUserBankDetailType; |
| | | import com.sinata.core.shiro.ShiroKit; |
| | | import com.sinata.modular.member.dao.MemUserMapper; |
| | | import com.sinata.modular.member.model.MemUser; |
| | | import com.sinata.modular.member.model.MemUserBankDetail; |
| | |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getMapList(Wrapper wrapper) { |
| | | return baseMapper.getMapList(wrapper); |
| | | boolean admin = ShiroKit.isAdmin(); |
| | | if (admin) { |
| | | return baseMapper.getMapList(wrapper); |
| | | } else { |
| | | return baseMapper.getMapListAuth(wrapper); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> getMapList(Page<Map<String, Object>> page, Wrapper wrapper) { |
| | | return baseMapper.getMapList(page, wrapper); |
| | | boolean admin = ShiroKit.isAdmin(); |
| | | if (admin) { |
| | | return baseMapper.getMapList(page, wrapper); |
| | | } else { |
| | | return baseMapper.getMapListAuth(page, wrapper); |
| | | } |
| | | } |
| | | |
| | | @Override |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>营销员管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <span class="input-group-addon">时间</span> |
| | | <input type="text" class="form-control layer-date" id="beginTime"> |
| | | <span class="input-group-addon">-</span> |
| | | <input type="text" class="form-control layer-date" id="endTime"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="nickName" name="用户姓名" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="phone" name="用户电话" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="showId" name="工号" /> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <span class="input-group-addon">状态</span> |
| | | <select id="isLeaveOffice" class="form-control"> |
| | | <option value="-1">全部</option> |
| | | <option value="0">在职</option> |
| | | <option value="1">离职</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <span class="input-group-addon">佣金等级</span> |
| | | <select id="memberGradeId" class="form-control"> |
| | | <option value="-1">全部</option> |
| | | <!--<option value="1">普通会员</option> |
| | | <option value="2">VIP会员</option> |
| | | <option value="3">黄金营销员</option> |
| | | <option value="4">城市合伙人</option> |
| | | <option value="5">市场总监</option>--> |
| | | <option value="1">Y</option> |
| | | <option value="2">Y</option> |
| | | <option value="3">S</option> |
| | | <option value="4">E</option> |
| | | <option value="5">X</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-2 pull-right"> |
| | | <#button name="搜索" icon="fa-search" clickFun="MemUserSales.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="MemUserSales.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="MemUserTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/memUserSales/audit")){ |
| | | <button type="button" class="btn btn-primary" onclick="MemUserSales.openMemUserAudit()">立即审核</button> |
| | | @} |
| | | @if(shiro.hasPermission("/memUserSales/detail/")){ |
| | | <button type="button" class="btn btn-primary" onclick="MemUserSales.openMemUserDetail()">查看详情</button> |
| | | @} |
| | | @if(shiro.hasPermission("/memUserSales/editCreditScore")){ |
| | | <button type="button" class="btn btn-primary" onclick="MemUserSales.openEditCreditScore()">修改品行分</button> |
| | | @} |
| | | @if(shiro.hasPermission("/memUserSales/export")){ |
| | | <button type="button" class="btn btn-primary" onclick="MemUserSales.export()"><i class="fa fa-external-link"></i> 导出</button> |
| | | @} |
| | | @if(shiro.hasPermission("/memUserSales/team")){ |
| | | <button type="button" class="btn btn-primary" onclick="MemUserSales.openMemUserTeam()">查看团队</button> |
| | | @} |
| | | @if(shiro.hasPermission("/memUserSales/updateLeaveOffice")){ |
| | | <button type="button" class="btn btn-primary" onclick="MemUserSales.updateLeaveOffice()">离职</button> |
| | | @} |
| | | @if(shiro.hasPermission("/memUserSales/editUserLevel")){ |
| | | <button type="button" class="btn btn-primary" onclick="MemUserSales.openEditUserLevel()">调整职级</button> |
| | | @} |
| | | @if(shiro.hasPermission("/memUserSales/editCityCode")){ |
| | | <button type="button" class="btn btn-primary" onclick="MemUserSales.openEditCityCode()">修改城市</button> |
| | | @} |
| | | @if(shiro.hasPermission("/memUserSales/updateState")){ |
| | | <input id='updateStateAuth' type="hidden" value='true'> |
| | | @} |
| | | </div> |
| | | <table id="MemUserTable" class="table_list_box" data-mobile-responsive="true" data-click-to-select="true"> |
| | | <thead> |
| | | <tr> |
| | | <th data-field="selectItem" data-checkbox="true"></th> |
| | | </tr> |
| | | </thead> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/member/memUserSales/memUserSalesAuth.js"></script> |
| | | @} |
| | |
| | | <label class="col-sm-2 control-label">性别</label> |
| | | <div class="col-sm-2 form-control-static">${item.sex!}</div> |
| | | </div> |
| | | @if(isAdmin){ |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">银行</label> |
| | | <div class="col-sm-2 form-control-static">${item.bankName!}</div> |
| | | |
| | | <label class="col-sm-2 control-label">银行卡号</label> |
| | | <div class="col-sm-2 form-control-static">${item.bankNumber!}</div> |
| | | |
| | | <label class="col-sm-2 control-label">开户行</label> |
| | | <div class="col-sm-2 form-control-static">${item.bankOpen!}</div> |
| | | </div> |
| | | @} |
| | | <div class="form-group"> |
| | | <label class="col-sm-2 control-label">银行</label> |
| | | <div class="col-sm-2 form-control-static">${item.bankName!}</div> |
| | | |
| | | <label class="col-sm-2 control-label">银行卡号</label> |
| | | <div class="col-sm-2 form-control-static">${item.bankNumber!}</div> |
| | | |
| | | <label class="col-sm-2 control-label">开户行</label> |
| | | <div class="col-sm-2 form-control-static">${item.bankOpen!}</div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | @if(isAdmin){ |
| | | <label class="col-sm-2 control-label">手机号</label> |
| | | <div class="col-sm-2 form-control-static">${item.phone!}</div> |
| | | |
| | | <label class="col-sm-2 control-label">证件号码</label> |
| | | <div class="col-sm-2 form-control-static">${item.idCard!}</div> |
| | | |
| | | @} |
| | | <label class="col-sm-2 control-label">提交时间</label> |
| | | <div class="col-sm-2 form-control-static">${item.createTime!}</div> |
| | | </div> |
New file |
| | |
| | | /** |
| | | * 销售人员信息管理初始化 |
| | | */ |
| | | var MemUserSales = { |
| | | id: "MemUserTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | MemUserSales.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', checkbox: true, visible: true}, |
| | | {title: '工号', field: 'show_id', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | return value != 0 ? value : ""; |
| | | } |
| | | }, |
| | | {title: '提交时间', field: 'apply_time', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '推荐人工号', field: 'equityUserShowId', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '推荐人', field: 'equityUserRealName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '推荐人所在城市', field: 'equityUserCityCode', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '姓名', field: 'real_name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '性别', field: 'sex', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '生日', field: 'birthday', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '证件类型', field: 'card_type', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | return {0: "身份证", 1: "护照"}[value]; |
| | | } |
| | | }, |
| | | {title: '品行分', field: 'credit_score', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '审核状态', field: 'audit_state', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | return {0: "待处理", 1: "通过", 2: "拒绝"}[value]; |
| | | } |
| | | }, |
| | | {title: '佣金等级', field: 'member_grade_id', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | //return {1: "普通会员", 2: "VIP会员", 3: "黄金营销员", 4: "城市合伙人", 5: "市场总监"}[value]; |
| | | return {1: "Y", 2: "Y", 3: "S", 4: "E", 5: "X"}[value]; |
| | | } |
| | | }, |
| | | {title: '积分', field: 'integral', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '入司时间', field: 'audit_time', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'is_leave_office', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | return {0: "在职", 1: "离职"}[value]; |
| | | } |
| | | }, |
| | | {title: '城市合伙人工号', field: 'v4ShowId', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '城市合伙人团队', field: 'v4Team', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '市场总监工号', field: 'v5ShowId', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '市场总监团队', field: 'v5Team', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '操作', field: 'opts', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | var opts = Feng.Opts(); |
| | | if ($("#updateStateAuth").val() == 'true') { |
| | | if (row.is_lock != undefined && row.is_lock == 1) { |
| | | opts.add("MemUserSales.updateState('" + row.id + "','0');", "解冻"); |
| | | } else { |
| | | opts.addDanger("MemUserSales.updateState('" + row.id + "','1');", "冻结"); |
| | | } |
| | | } |
| | | return opts.getOpts(); |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 1 条数据 |
| | | */ |
| | | MemUserSales.checkTableOnlyId = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length != 1){ |
| | | Feng.error("请选中 1 条数据!"); |
| | | return false; |
| | | } else { |
| | | MemUserSales.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击 修改品行分 |
| | | */ |
| | | MemUserSales.openEditCreditScore = function () { |
| | | var ids = Feng.checkBoxIds(MemUserSales.id); |
| | | if (ids == "") { |
| | | return; |
| | | } |
| | | this.layerIndex = layer.open({ |
| | | type: 2, |
| | | title: '', |
| | | area: ['500px', '250px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/memUserSales/openEditCreditScore?ids=' + ids |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 点击 修改职级 |
| | | */ |
| | | MemUserSales.openEditUserLevel = function () { |
| | | if (!MemUserSales.checkTableOnlyId()) { |
| | | return; |
| | | } |
| | | |
| | | this.layerIndex = layer.open({ |
| | | type: 2, |
| | | title: '', |
| | | area: ['600px', '450px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/memUserSales/openEditUserLevel/' + MemUserSales.seItem.id |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 点击 修改城市 |
| | | */ |
| | | MemUserSales.openEditCityCode = function () { |
| | | if (!MemUserSales.checkTableOnlyId()) { |
| | | return; |
| | | } |
| | | |
| | | this.layerIndex = layer.open({ |
| | | type: 2, |
| | | title: '', |
| | | area: ['80%', '60%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/memUserSales/openEditCityCode/' + MemUserSales.seItem.id |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看销售人员审核 |
| | | */ |
| | | MemUserSales.openMemUserAudit = function () { |
| | | if (!MemUserSales.checkTableOnlyId()) { |
| | | return; |
| | | } |
| | | |
| | | if (MemUserSales.seItem.audit_state != 0) { |
| | | Feng.info("销售员信息已审核!"); |
| | | return; |
| | | } |
| | | |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '审核销售人员', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/memUserSales/openAudit/' + MemUserSales.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看销售人员信息详情 |
| | | */ |
| | | MemUserSales.openMemUserDetail = function () { |
| | | if (!MemUserSales.checkTableOnlyId()) { |
| | | return; |
| | | } |
| | | |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '销售人员详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/memUserSales/detail/' + MemUserSales.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看团队 |
| | | */ |
| | | MemUserSales.openMemUserTeam = function (id) { |
| | | if (!MemUserSales.checkTableOnlyId()) { |
| | | return; |
| | | } |
| | | |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '团队成员', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/memUserSales/team?teamUserId=' + MemUserSales.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 编辑状态 |
| | | */ |
| | | MemUserSales.updateState = function (id, state) { |
| | | var operation = function() { |
| | | var ajax = new $ax(Feng.ctxPath + "/memUserSales/updateState", function (data) { |
| | | if(data.code == 200){ |
| | | Feng.success("操作成功!"); |
| | | MemUserSales.table.refresh(); |
| | | } else { |
| | | Feng.error("操作失败!" + data.message); |
| | | } |
| | | }, function () { |
| | | Feng.error("操作失败!"); |
| | | }); |
| | | ajax.set("userId", id); |
| | | ajax.set("state", state); |
| | | ajax.start(); |
| | | }; |
| | | Feng.confirm("是否 " + (state == 0 ? "解冻" : "冻结") + " 该用户?", operation); |
| | | }; |
| | | |
| | | /** |
| | | * 销售人员离职 |
| | | */ |
| | | MemUserSales.updateLeaveOffice = function () { |
| | | if (!MemUserSales.checkTableOnlyId()) { |
| | | return; |
| | | } |
| | | |
| | | Feng.confirm("是否确定该人员".concat("已离职?"), function() { |
| | | var ajax = new $ax(Feng.ctxPath + "/memUserSales/updateLeaveOffice", function (data) { |
| | | if(data.code == 200){ |
| | | Feng.success("操作成功!"); |
| | | MemUserSales.table.refresh(); |
| | | } else { |
| | | Feng.error("操作失败!" + data.message); |
| | | } |
| | | }, function () { |
| | | Feng.error("操作失败!"); |
| | | }); |
| | | ajax.set("userId", MemUserSales.seItem.id); |
| | | ajax.start(); |
| | | }); |
| | | }; |
| | | |
| | | /** |
| | | * 导出记录 |
| | | */ |
| | | MemUserSales.export = function () { |
| | | var beginTime = $("#beginTime").val(); |
| | | var endTime = $("#endTime").val(); |
| | | var nickName = $("#nickName").val(); |
| | | var phone = $("#phone").val(); |
| | | var showId = $("#showId").val(); |
| | | var isLock = $("#isLock").val(); |
| | | var isLeaveOffice = $("#isLeaveOffice").val(); |
| | | var memberGradeId = $("#memberGradeId").val(); |
| | | window.location.href = Feng.ctxPath + "/memUserSales/export" + |
| | | "?isLock=" + (isLock == undefined ? -1 : isLock) + |
| | | "&beginTime=" + beginTime + |
| | | "&endTime=" + endTime + |
| | | "&nickName=" + nickName + |
| | | "&showId=" + showId + |
| | | "&isLeaveOffice=" + isLeaveOffice + |
| | | "&memberGradeId=" + memberGradeId + |
| | | "&phone=" + phone; |
| | | }; |
| | | |
| | | /** |
| | | * 查询销售人员信息列表 |
| | | */ |
| | | MemUserSales.search = function () { |
| | | var queryData = {}; |
| | | queryData['beginTime'] = $("#beginTime").val(); |
| | | queryData['endTime'] = $("#endTime").val(); |
| | | queryData['nickName'] = $("#nickName").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['showId'] = $("#showId").val(); |
| | | queryData['isLock'] = $("#isLock").val(); |
| | | queryData['isLeaveOffice'] = $("#isLeaveOffice").val(); |
| | | queryData['memberGradeId'] = $("#memberGradeId").val(); |
| | | MemUserSales.table.refresh({query: queryData}); |
| | | }; |
| | | /** |
| | | * 重置查询条件 |
| | | */ |
| | | MemUserSales.resetSearch = function () { |
| | | $("#beginTime").val(""); |
| | | $("#endTime").val(""); |
| | | $("#nickName").val(""); |
| | | $("#phone").val(""); |
| | | $("#showId").val(""); |
| | | $("#isLock").val("-1"); |
| | | $("#isLeaveOffice").val("-1"); |
| | | $("#memberGradeId").val("-1"); |
| | | MemUserSales.search(); |
| | | }; |
| | | $(function () { |
| | | var defaultColunms = MemUserSales.initColumn(); |
| | | var table = new BSTable(MemUserSales.id, "/memUserSales/list", defaultColunms); |
| | | // 设置物理分页server(逻辑分页client) |
| | | table.setPaginationType("server"); |
| | | // 表单提交参数 |
| | | var queryData = {}; |
| | | queryData['beginTime'] = $("#beginTime").val(); |
| | | queryData['endTime'] = $("#endTime").val(); |
| | | queryData['nickName'] = $("#nickName").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['showId'] = $("#showId").val(); |
| | | queryData['isLock'] = $("#isLock").val(); |
| | | queryData['isLeaveOffice'] = $("#isLeaveOffice").val(); |
| | | queryData['memberGradeId'] = $("#memberGradeId").val(); |
| | | table.setQueryParams(queryData); |
| | | MemUserSales.table = table.init(); |
| | | |
| | | // 初始化开始时间、结束时间 |
| | | laydate.render({ |
| | | elem: '#beginTime' |
| | | }); |
| | | laydate.render({ |
| | | elem: '#endTime' |
| | | }); |
| | | }); |
| | | |
New file |
| | |
| | | package com.sinata.rest.core.juhe; |
| | | |
| | | import lombok.Data; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | |
| | | @Data |
| | | @Configuration |
| | | @ConfigurationProperties(prefix = "juhe") |
| | | class JuHeProperties{ |
| | | |
| | | private String openid; |
| | | |
| | | private String appkey; |
| | | } |
New file |
| | |
| | | package com.sinata.rest.core.juhe; |
| | | |
| | | |
| | | |
| | | import com.sinata.rest.core.util.MD5Util; |
| | | import org.apache.commons.codec.binary.Base64; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.util.Locale; |
| | | import java.util.Objects; |
| | | |
| | | import javax.crypto.Cipher; |
| | | |
| | | import javax.crypto.spec.SecretKeySpec; |
| | | |
| | | import static com.sinata.rest.core.juhe.TelecomUtil.MD5; |
| | | |
| | | public class SecurityAESTool { |
| | | |
| | | /** |
| | | * AES加密 |
| | | * |
| | | * @param str |
| | | * 明文 |
| | | * @param key |
| | | * 秘钥 |
| | | * @return |
| | | */ |
| | | public static String encrypt(String str, String key) { |
| | | byte[] crypted = null; |
| | | try { |
| | | |
| | | SecretKeySpec skey = new SecretKeySpec(key.getBytes("UTF-8"), "AES"); |
| | | Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); |
| | | cipher.init(Cipher.ENCRYPT_MODE, skey); |
| | | |
| | | String enStr = str; |
| | | crypted = cipher.doFinal(enStr.getBytes("UTF-8")); |
| | | } catch (Exception e) { |
| | | System.out.println(e.toString()); |
| | | } |
| | | |
| | | String body = new String(Base64.encodeBase64(crypted)); |
| | | return body; |
| | | } |
| | | |
| | | /** |
| | | * AES解密 |
| | | * |
| | | * @param input |
| | | * @param key |
| | | * @return |
| | | */ |
| | | public static String decrypt(String input, String key) { |
| | | byte[] output = null; |
| | | String body = null; |
| | | if (input == null || key == null) { |
| | | return null; |
| | | } |
| | | try { |
| | | SecretKeySpec skey = new SecretKeySpec(key.getBytes("UTF-8"), "AES"); |
| | | Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding"); |
| | | cipher.init(Cipher.DECRYPT_MODE, skey); |
| | | byte[] b = Base64.decodeBase64(input); |
| | | // 解密 |
| | | output = cipher.doFinal(b); |
| | | body = new String(output, "UTF-8"); |
| | | } catch (Exception e) { |
| | | System.out.println(e.toString()); |
| | | } |
| | | return body; |
| | | } |
| | | |
| | | public static void main(String[] args) throws UnsupportedEncodingException { |
| | | String openid = "JH1ad5c53745350580f7c24ca4b09717de"; |
| | | String key = MD5(openid).substring(0, 16);//取前16位作为加密密钥 |
| | | //String key = MD5Util.encrypt(appId).toLowerCase(Locale.ROOT).substring(0,16);//秘钥 |
| | | System.out.println(key); |
| | | //取lowerCase前16位 |
| | | String realname = "米涛"; // 明文 |
| | | String idcard = "510603199912053256"; // 明文 |
| | | |
| | | realname = SecurityAESTool.encrypt(realname, key); |
| | | System.out.println("realname:"+realname); |
| | | System.out.println("realname:"+SecurityAESTool.decrypt(realname, key)); |
| | | idcard = SecurityAESTool.encrypt(idcard, key); |
| | | System.out.println("idcard:"+idcard); |
| | | System.out.println("idcard:"+SecurityAESTool.decrypt(idcard, key)); |
| | | String mobile = "18283820718"; |
| | | mobile = SecurityAESTool.encrypt(mobile, key); |
| | | System.out.println("mobile:"+mobile); |
| | | System.out.println("mobile:"+SecurityAESTool.decrypt(mobile, key)); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.sinata.rest.core.juhe; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.internal.util.file.IOUtils; |
| | | import com.sinata.rest.common.exception.BizExceptionEnum; |
| | | import com.sinata.rest.core.exception.GunsException; |
| | | import lombok.Data; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.http.HttpEntity; |
| | | import org.apache.http.client.config.RequestConfig; |
| | | import org.apache.http.client.methods.CloseableHttpResponse; |
| | | import org.apache.http.client.methods.HttpGet; |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | | import org.apache.http.impl.client.HttpClients; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.context.properties.ConfigurationProperties; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLEncoder; |
| | | import java.security.MessageDigest; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /**三网手机实名认证 |
| | | * @author mitao |
| | | * @date 2024/4/1 |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | @RequiredArgsConstructor |
| | | public class TelecomUtil { |
| | | private final JuHeProperties juHeProperties; |
| | | //设置超时时间为5秒 |
| | | public static RequestConfig config = RequestConfig.custom().setConnectTimeout(5000).setSocketTimeout(5000).build(); |
| | | //明文查询地址 |
| | | public static String query_url = "https://v.juhe.cn/telecom/query?key="; |
| | | //加密查询地址 |
| | | public static String queryEncry_url = "https://v.juhe.cn/telecom/queryEncry?key="; |
| | | |
| | | public boolean verify(String realname, String idcard, String mobile) { |
| | | // ----------------------三网手机实名制认证----------------------------------------------------------------------- |
| | | // int queryType = 1;// 1:普通查询 2:加密查询 |
| | | // String realname = "";// 姓名 |
| | | // String idcard = "";// 身份证 |
| | | //String mobile="" // 手机号 |
| | | // int type = 1;// 是否显示手机运营商 1:显示 0:不显示(默认) |
| | | //int showid = 1 //是否显示聚合订单账号 1:显示 0:不显示(默认) |
| | | //int province = 1 //是否显示号码归属地 1:显示 0:不显示(默认) |
| | | //int detail = 1 //是否买显示匹配详情码 1:显示 0:不显示(默认) |
| | | // Map<String, Object> params = new HashMap<>(); |
| | | // params.put("realname", realname); |
| | | // params.put("idcard", idcard); |
| | | // params.put("mobile", mobile); |
| | | |
| | | // ----------------------调用三网手机实名认证(加密版)----------------------------------------------------------------------- |
| | | String key = MD5(juHeProperties.getOpenid()).substring(0, 16);//取前16位作为加密密钥 |
| | | int queryType = 2;// 加密版本 |
| | | realname = SecurityAESTool.encrypt(realname, key);//加密姓名 |
| | | idcard = SecurityAESTool.encrypt(idcard, key);//加密身份证 |
| | | mobile = SecurityAESTool.encrypt(mobile, key);// |
| | | Map<String, Object> params = new HashMap<>();//组合参数 |
| | | params.put("realname", realname); |
| | | params.put("idcard", idcard); |
| | | params.put("mobile", mobile); |
| | | //请求接口 |
| | | JSONObject result = null; |
| | | try { |
| | | result = JSONObject.parseObject(queryResult(params, queryType)); |
| | | } catch (Exception e) { |
| | | log.error("调用三网手机实名认证失败", e); |
| | | } |
| | | //打印结果 |
| | | System.out.println(result); |
| | | JSONObject innerResult = result.getJSONObject("result"); |
| | | if (result != null && innerResult != null && innerResult.getInteger("res") == 1) { |
| | | return true; |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * 请求接口查询数据 |
| | | * |
| | | * @param params 参数 |
| | | * @param queryType 类型,1明文查询(默认),2加密版 |
| | | * @return 结果 |
| | | * @throws Exception |
| | | */ |
| | | |
| | | private String queryResult(Map<String, Object> params, int queryType) throws Exception { |
| | | |
| | | CloseableHttpClient httpClient = HttpClients.createDefault(); |
| | | CloseableHttpResponse response = null; |
| | | String result = null; |
| | | String url = query_url; |
| | | switch (queryType) { |
| | | case 2: |
| | | url = queryEncry_url + juHeProperties.getAppkey(); |
| | | break; |
| | | } |
| | | try { |
| | | url = new StringBuffer(url).append("&").append(urlencode(params)).toString(); |
| | | HttpGet httpget = new HttpGet(url); |
| | | httpget.setConfig(config); |
| | | response = httpClient.execute(httpget); |
| | | HttpEntity resEntity = response.getEntity(); |
| | | if (resEntity != null) { |
| | | result = IOUtils.toString(resEntity.getContent(), "UTF-8"); |
| | | } |
| | | EntityUtils.consume(resEntity); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } finally { |
| | | response.close(); |
| | | httpClient.close(); |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | // 将map型转为请求参数型 |
| | | public static String urlencode(Map<String, ?> data) { |
| | | StringBuilder sb = new StringBuilder(); |
| | | for (Map.Entry<String, ?> i : data.entrySet()) { |
| | | try { |
| | | sb.append(i.getKey()).append("=").append(URLEncoder.encode(i.getValue() + "", "UTF-8")).append("&"); |
| | | } catch (UnsupportedEncodingException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | String result = sb.toString(); |
| | | result = result.substring(0, result.lastIndexOf("&")); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * md5加密 |
| | | * |
| | | * @param data |
| | | * @return 加密结果 |
| | | */ |
| | | public static String MD5(String data) { |
| | | StringBuffer md5str = new StringBuffer(); |
| | | byte[] input = data.getBytes(); |
| | | try { |
| | | // 创建一个提供信息摘要算法的对象,初始化为md5算法对象 |
| | | MessageDigest md = MessageDigest.getInstance("MD5"); |
| | | // 计算后获得字节数组 |
| | | byte[] buff = md.digest(input); |
| | | // 把数组每一字节换成16进制连成md5字符串 |
| | | int digital; |
| | | for (int i = 0; i < buff.length; i++) { |
| | | digital = buff[i]; |
| | | if (digital < 0) { |
| | | digital += 256; |
| | | } |
| | | if (digital < 16) { |
| | | md5str.append("0"); |
| | | } |
| | | md5str.append(Integer.toHexString(digital)); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | return md5str.toString(); |
| | | } |
| | | } |
| | |
| | | import com.sinata.common.enums.mall.EnumMallOrderState; |
| | | import com.sinata.common.user.VoUserGradeParent; |
| | | import com.sinata.rest.common.ApiUtils; |
| | | import com.sinata.rest.core.juhe.TelecomUtil; |
| | | import com.sinata.rest.modular.mall.controller.body.BodyApplySaleUser; |
| | | import com.sinata.rest.modular.mall.controller.body.BodyUserAuthentication; |
| | | import com.sinata.rest.modular.mall.controller.vo.*; |
| | | import com.sinata.rest.modular.mall.model.MallOrder; |
| | | import com.sinata.rest.modular.mall.model.MallVipEquity; |
| | |
| | | |
| | | @Autowired |
| | | private IMallVipEquityService mallVipEquityService; |
| | | |
| | | @Autowired |
| | | private TelecomUtil telecomUtil; |
| | | |
| | | @GetMapping(value = "/myShare") |
| | | @ApiOperation(value = "我的推广") |
| | |
| | | public ApiUtils applySaleUser(@RequestBody BodyApplySaleUser body) { |
| | | return memUserService.applySaleUser(body); |
| | | } |
| | | |
| | | @PostMapping(value = "/real-name-authentication") |
| | | @ApiOperation(value = "三网手机实名认证") |
| | | public ApiUtils realNameAuthentication(@RequestBody BodyUserAuthentication body) { |
| | | return ApiUtils.returnOK(telecomUtil.verify(body.getRealName(),body.getIdCard(),body.getPhone())); |
| | | } |
| | | // @GetMapping(value = "/directTeam") |
| | | // @ApiOperation(value = "我的直属团队") |
| | | // @ApiImplicitParams({ |
New file |
| | |
| | | package com.sinata.rest.modular.mall.controller.body; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "推荐他人入司实名-请求") |
| | | public class BodyUserAuthentication { |
| | | |
| | | @ApiModelProperty(value = "真实姓名") |
| | | private String realName; |
| | | |
| | | @ApiModelProperty(value = "身份证号") |
| | | private String idCard; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | private String phone; |
| | | |
| | | } |
| | |
| | | @ApiImplicitParam(name = "query", value = "传递的参数,小程序端在APP.onLaunch直接获取参数", dataType = "String", paramType = "query"), |
| | | }) |
| | | public Object generate_urllink(String path, String query) { |
| | | String access_token = PayUtils.getAccessToken(); |
| | | JSONObject responseBody = null; |
| | | try { |
| | | String access_token = PayUtils.getAccessToken(); |
| | | |
| | | String url = "https://api.weixin.qq.com/wxa/generate_urllink?access_token=" + access_token; |
| | | String url = "https://api.weixin.qq.com/wxa/generate_urllink?access_token=" + access_token; |
| | | |
| | | // 设置请求报头 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | | // 设置请求报头 |
| | | HttpHeaders headers = new HttpHeaders(); |
| | | headers.setContentType(MediaType.APPLICATION_JSON); |
| | | |
| | | // 创建请求主体 |
| | | Map<String, Object> requestBody = new HashMap<>(); |
| | | if (StrUtil.isNotBlank(path)) { |
| | | requestBody.put("path", path); |
| | | // 创建请求主体 |
| | | Map<String, Object> requestBody = new HashMap<>(); |
| | | if (StrUtil.isNotBlank(path)) { |
| | | requestBody.put("path", path); |
| | | } |
| | | if (StrUtil.isNotBlank(query)) { |
| | | requestBody.put("query", query); |
| | | } |
| | | // 到期失效的 URL Link 失效类型,失效时间:0,失效间隔天数:1 |
| | | requestBody.put("expire_type", 1); |
| | | // 到期失效的 URL Link 的失效间隔天数,最长间隔天数为30天. expire_type为 1 时必填 |
| | | requestBody.put("expire_interval", 30); |
| | | |
| | | // 用请求体和头创建HttpEntity对象 |
| | | HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(requestBody, headers); |
| | | |
| | | // 发送POST请求并获得响应 |
| | | ResponseEntity<JSONObject> responseEntity = restTemplate.postForEntity( |
| | | url, |
| | | requestEntity, |
| | | JSONObject.class |
| | | ); |
| | | |
| | | // 获取响应体 |
| | | responseBody = responseEntity.getBody(); |
| | | } catch (Exception e) { |
| | | log.error("generate_urllink异常",e); |
| | | } |
| | | if (StrUtil.isNotBlank(query)) { |
| | | requestBody.put("query", query); |
| | | } |
| | | // 到期失效的 URL Link 失效类型,失效时间:0,失效间隔天数:1 |
| | | requestBody.put("expire_type", 1); |
| | | // 到期失效的 URL Link 的失效间隔天数,最长间隔天数为30天. expire_type为 1 时必填 |
| | | requestBody.put("expire_interval", 30); |
| | | |
| | | // 用请求体和头创建HttpEntity对象 |
| | | HttpEntity<Map<String, Object>> requestEntity = new HttpEntity<>(requestBody, headers); |
| | | |
| | | // 发送POST请求并获得响应 |
| | | ResponseEntity<JSONObject> responseEntity = restTemplate.postForEntity( |
| | | url, |
| | | requestEntity, |
| | | JSONObject.class |
| | | ); |
| | | |
| | | // 获取响应体 |
| | | JSONObject responseBody = responseEntity.getBody(); |
| | | |
| | | // 打印响应体 |
| | | System.out.println(responseBody); |
| | | log.info("响应体---->{}",responseBody); |
| | | |
| | | return responseBody; |
| | | } |
| | |
| | | wx_secret_key: meitianmeiya13882090306111111111 |
| | | wx_public_secret_key: 3cd8a4812da753cbda4edd062bd11b63 |
| | | wx_service_app_id: wx9e0a20d9ffcacc05 #微信服务号ID |
| | | juhe: |
| | | appkey: 95cd620c933e53b79aac94edfd76ca4a |
| | | openid: JH1ad5c53745350580f7c24ca4b09717de |
| | |
| | | wx_secret_key: meitianmeiya13882090306111111111 |
| | | wx_public_secret_key: 3cd8a4812da753cbda4edd062bd11b63 |
| | | wx_service_app_id: wx9e0a20d9ffcacc05 #微信服务号ID |
| | | juhe: |
| | | appkey: 95cd620c933e53b79aac94edfd76ca4a |
| | | openid: JH1ad5c53745350580f7c24ca4b09717de |