| | |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.SinataUtil; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.IUserService; |
| | | import com.dsh.guns.modular.system.service.TOperatorCityService; |
| | | import com.dsh.guns.modular.system.service.TOperatorService; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import com.dsh.guns.modular.system.service.impl.TOperatorUserServiceImpl; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.catalina.valves.RemoteIpValve; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | |
| | | private TOperatorService operatorService; |
| | | @Autowired |
| | | private TOperatorCityService operatorCityService; |
| | | @Autowired |
| | | private IOperatorUserService operatorUserService; |
| | | @Autowired |
| | | private IUserService userService; |
| | | @Autowired |
| | |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | /** |
| | | * 跳转运营商商户去认证页面 |
| | | */ |
| | | @RequestMapping("/proportionAuth/{id}") |
| | | public String proportionAuth(Model model,@PathVariable("id") Integer id) { |
| | | model.addAttribute("operatorId",id); |
| | | return PREFIX + "OperatorUser_proportionAuth.html"; |
| | | } |
| | | /** |
| | | * 商户认证提交 |
| | | */ |
| | | @RequestMapping(value = "/auth") |
| | | @ResponseBody |
| | | public Object auth(Integer alipayType,Integer wechatType,String alipayNum,String wechatNum,Integer operatorId ) { |
| | | TOperator id = operatorService.getOne(new QueryWrapper<TOperator>().eq("id", operatorId)); |
| | | OperatorUser operatorUser = new OperatorUser(); |
| | | operatorUser.setUserId(id.getUserId()); |
| | | operatorUser.setAlipay("支付宝"); |
| | | operatorUser.setWechat("微信"); |
| | | operatorUser.setWechatType(wechatType); |
| | | operatorUser.setAlipayType(alipayType); |
| | | operatorUser.setAlipayNum(alipayNum); |
| | | operatorUser.setWechatNum(wechatNum); |
| | | operatorUser.setOperatorId(operatorId); |
| | | operatorUserService.save(operatorUser); |
| | | // 修改运营商状态为 已认证 |
| | | id.setStatus(2); |
| | | operatorService.updateById(id); |
| | | return SUCCESS_TIP; |
| | | } |
| | | /** |
| | | * 分账比例提交 |
| | | */ |
| | | @RequestMapping(value = "/proportion") |
| | | @ResponseBody |
| | | public Object auth(String alipayProportion,String wechatProportion,Integer operatorIdOne ) { |
| | | OperatorUser id = operatorUserService.getOne(new QueryWrapper<OperatorUser>().eq("id", operatorIdOne)); |
| | | id.setAlipayProportion(alipayProportion); |
| | | id.setWechatProportion(wechatProportion); |
| | | operatorUserService.updateById(id); |
| | | return SUCCESS_TIP; |
| | | } |
| | | /** |
| | | * 跳转运营商设置分账比例页面 |
| | | */ |
| | | @RequestMapping("/proportion/{id}") |
| | | public String proportion(Model model,@PathVariable("id") Integer id) { |
| | | OperatorUser o = operatorUserService.getOne(new QueryWrapper<OperatorUser>().eq("operatorId", id)); |
| | | model.addAttribute("operatorIdOne",o.getId()); |
| | | model.addAttribute("alipayProportion",o.getAlipayProportion()); |
| | | model.addAttribute("wechatProportion",o.getWechatProportion()); |
| | | return PREFIX + "OperatorUser_proportion.html"; |
| | | } |
| | | /** |
| | | * 批量重置密码 |
| | | * @return |
| | |
| | | List<Integer> userIds = list.stream() |
| | | .map(TOperator::getUserId) |
| | | .collect(Collectors.toList()); |
| | | String a123456 = SecureUtil.md5("123456"); |
| | | String a123456 = SecureUtil.md5("a123456"); |
| | | List<User> users = userService.list(new QueryWrapper<User>().in("id", userIds)); |
| | | for (User user : users) { |
| | | user.setPassword(a123456); |
| | |
| | | user.setName(userName); |
| | | user.setPhone(phone); |
| | | user.setObjectType(2); |
| | | userService.save(user); |
| | | TOperator data = new TOperator(); |
| | | data.setUserId(user.getId()); |
| | | data.setName(name); |
| | |
| | | data.setStatus(1); |
| | | data.setState(1); |
| | | operatorService.save(data); |
| | | user.setObjectId(data.getId()); |
| | | userService.save(user); |
| | | if (SinataUtil.isNotEmpty(comArr)){ |
| | | JSONArray jsonArray = JSON.parseArray(comArr); |
| | | int size = jsonArray.size(); |