zq-erp/src/main/java/com/matrix/biz/action/BizUserAction.java
@@ -5,7 +5,6 @@ import com.matrix.biz.dao.BizUserDao; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.StringUtils; import com.matrix.system.hive.action.util.QueryUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -44,18 +43,6 @@ } /** * 批量设置为销售员 * @param ids * @param status 1=销售员,0=普通用户 * @return */ @RequestMapping(value = "/setUserSales") @ResponseBody public AjaxResult setUserSales(String ids,Integer status){ List<String> userIds = StringUtils.strToCollToString(ids, ","); bizUserDao.updateSalesByIds(userIds,status); return new AjaxResult(AjaxResult.STATUS_SUCCESS,"修改成功"); } } zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java
@@ -8,6 +8,7 @@ import com.matrix.biz.bean.BizUser; import com.matrix.biz.dao.BizUserDao; import com.matrix.biz.service.BizUserService; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.tools.StringUtils; @@ -94,11 +95,11 @@ ShopSalesmanApply shopSalesmanApply=new ShopSalesmanApply(); shopSalesmanApply.setUserId(openId); shopSalesmanApply.setCreateBy(loginUser.getNickName()); shopSalesmanApply.setCreateBy(MatrixConstance.SYSTEM_USER); shopSalesmanApply.setApplyWay(ShopSalesmanApply.APPLY_WAY_SELF); shopSalesmanApply.setCompanyId(loginUser.getCompanyId()); shopSalesmanApply.setUpdateBy(loginUser.getNickName()); shopSalesmanApply.setUpdateBy(MatrixConstance.SYSTEM_USER); Date date = new Date(); shopSalesmanApply.setCreateTime(date); shopSalesmanApply.setUpdateTime(date); zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java
@@ -76,6 +76,20 @@ return ajaxResult; } @ApiOperation(value = "查询分销商城开关", notes = "1开启分销,2关闭分销") @GetMapping(value = "/getSalesMallSetting") public AjaxResult getSalesMallSwith() { BusParameterSettings fxSwith = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_SWITCH, HostInterceptor.getCompanyId()); BusParameterSettings fxModel = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_MODEL, HostInterceptor.getCompanyId()); AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("查询成功"); ajaxResult.putInMap("fxSwith",fxSwith.getParamValue()); ajaxResult.putInMap("fxModel",fxModel.getParamValue()); return ajaxResult; } @ApiOperation(value = "申请成为推广员", notes = "传入参数invitationId 邀请人openId ,非必填 例: {invitationId:openId}") @ApiResponses({ zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java
File was renamed from zq-erp/src/main/java/com/matrix/system/shopXcx/api/WxUserAction.java @@ -1,7 +1,6 @@ package com.matrix.system.shopXcx.api; package com.matrix.system.shopXcx.api.action; import com.matrix.biz.bean.BizUser; import com.matrix.biz.dao.BizUserDao; import com.matrix.biz.service.BizUserService; import com.matrix.component.redis.RedisUserLoginUtils; import com.matrix.component.tools.HttpCurlUtil; @@ -12,6 +11,7 @@ import com.matrix.core.web.BaseAction; import com.matrix.system.common.constance.AppConstance; import com.matrix.system.common.interceptor.HostInterceptor; import com.matrix.system.shopXcx.api.WeChatApiTools; import net.sf.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -39,8 +39,7 @@ @Autowired private RedisUserLoginUtils redisUserLoginUtils; @Autowired private BizUserDao bizUserDao; @Autowired WeChatApiTools weChatApiTools; @@ -128,43 +127,12 @@ BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); String openId = loginUser.getOpenId(); BizUser bizUser = bizUserService.findByOpenId(openId); //处理用户当前所在店铺 /* if(bizUser.getStaff()!=null){ //当前用户是员工账号 bizUser.setBusiness(bussinesssDao.selectById(bizUser.getStaff().getBusinessId())); bizUser.setRole(bizUser.getStaff().getRole()); }else{ //当前用户是boss账号 bizUser.setBusiness(bussinesssDao.findByUserOpenId(bizUser.getOpenId())); bizUser.setRole(AppConstance.User_ROLE_BOSS); }*/ AjaxResult res = new AjaxResult(); res.putInMap("userInfo", bizUser); res.setStatus(AjaxResult.STATUS_SUCCESS); return res; } /** * 获取其他用户简化信息 * @author JIANGYOUYAO * @email 935090232@qq.com * @date 2018年9月5日 * @param openId * @return */ @RequestMapping(value = "/getOtherUserInfo/{openId}") public @ResponseBody AjaxResult getOtherUserInfo(@PathVariable String openId) { BizUser bizUser = bizUserService.findByOpenId(openId); AjaxResult res = new AjaxResult(); res.putInMap("userInfo", bizUser); res.setStatus(AjaxResult.STATUS_SUCCESS); return res; } /** * 接收用户信息 zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html
@@ -21,14 +21,7 @@ <div class="col-md-2 col-xs-12"> <!-- 功能按钮部分 --> <div class=""> <button onclick="setUserSales('1')" type="button" class="btn btn-success btn-sm" matrix:btn="shopUser-exchangeScore"> <i class="fa fa-plus"></i>设为销售员 </button> <button onclick="setUserSales('0')" type="button" class="btn btn-success btn-sm" matrix:btn="shopUser-exchangeScore"> <i class="fa fa-minus-square"></i> 解除销售员 </button> </div> </div> <div class="col-md-10 col-xs-12"> @@ -199,63 +192,14 @@ function buildOperate(value, row, index){ var html = ""; html += '<div class="btn-group">' if (row.userVip == 1) { html += btns[0].replace('VALUE',value) html += btns[1].replace('VALUE',value) } html += '</div>'; return html; } function exchangeScore(_userId) { layer.open({ type : 2, title : "兑换积分", area : [ MUI.SIZE_L, '400px' ], maxmin : true, content : [ basePath+'/admin/bizUserScore/intoExchangePage?userId=' + _userId] }) } function getScoreFlow(_userId) { layer.open({ type : 2, title : "积分流水", area : [ MUI.SIZE_L, '400px' ], maxmin : true, content : [ basePath+'/admin/redirect/shop/user-score-flow?userId=' + _userId] }) } //设置用户销售员身份 function setUserSales(_status) { var ids = myGrid.getSelectItemsIds("userId"); if(ids.length < 1){ layer.msg("请选择要操作的数据", { icon : 5 }); return false; } var url = basePath + "/admin/bizUser/setUserSales?ids=" + ids + "&status=" + _status; if(_status == '1'){ MTools.handleItem(url,"确认要将这" + ids.split(",").length + "个用户设置为销售员吗?",function(){ myGrid.serchData(1) }); } else { MTools.handleItem(url,"确认要取消这" + ids.split(",").length + "个用户的销售员身份吗?",function(){ myGrid.serchData(1) }); } } </script> <!--权限按钮--> <script matrix:btn="shopUser-exchangeScore"> btns[0] = '<button type="button" class="btn btn-info mr10" onClick="exchangeScore(\'VALUE\')">兑换积分</button>' </script> <script matrix:btn="shopUser-scoreFlow"> btns[1] = '<button type="button" class="btn btn-primary ml10" onClick="getScoreFlow(\'VALUE\')">查看流水</button>' </script> </body> </html>