| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import cn.hutool.http.HttpRequest; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | import com.dsh.course.feignClient.communityWorldCup.Model.WorldCupStoreVO; |
| | | import com.dsh.course.feignClient.communityWorldCup.WorldCupStoreClient; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.other.model.Site; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import com.dsh.guns.modular.system.util.GaoDeMapUtil; |
| | | import com.dsh.guns.modular.system.model.StoreConfig; |
| | | import com.dsh.guns.modular.system.model.TCity; |
| | | import com.dsh.guns.modular.system.model.TOperator; |
| | | import com.dsh.guns.modular.system.model.TOperatorCity; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.model.TStoreListVo; |
| | | import com.dsh.guns.modular.system.model.TStoreOther; |
| | | import com.dsh.guns.modular.system.model.TStoreOtherConfig; |
| | | import com.dsh.guns.modular.system.model.TStoreOtherConfigTrue; |
| | | import com.dsh.guns.modular.system.model.TTurn; |
| | | import com.dsh.guns.modular.system.model.User; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.service.ITSiteService; |
| | | import com.dsh.guns.modular.system.service.IUserService; |
| | | import com.dsh.guns.modular.system.service.StoreConfigService; |
| | | import com.dsh.guns.modular.system.service.TOperatorCityService; |
| | | import com.dsh.guns.modular.system.service.TOperatorService; |
| | | import com.dsh.guns.modular.system.service.TStoreOtherConfigService; |
| | | import com.dsh.guns.modular.system.service.TStoreOtherConfigTrueService; |
| | | import com.dsh.guns.modular.system.service.TStoreOtherService; |
| | | import com.dsh.guns.modular.system.service.TTurnService; |
| | | import com.dsh.guns.modular.system.util.HttpRequestUtil; |
| | | import io.swagger.models.auth.In; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.bouncycastle.math.raw.Mod; |
| | | import com.dsh.guns.modular.system.util.ImageUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import java.io.IOException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | // public static void main(String[] args) { |
| | | //// HashMap<String, String> map = new HashMap<>(); |
| | | //// map.put("page","1"); |
| | | //// map.put("space_id","2010"); |
| | | //// // 获取门禁列表 |
| | | //// String s1 = HttpRequestUtil.getRequest |
| | | //// ("https://port.daowepark.com/v7/user_api/general/getDevice", map); |
| | | //// System.err.println(s1); |
| | | // |
| | | // HashMap<String, String> map = new HashMap<>(); |
| | | // map.put("page","1"); |
| | | // map.put("space_id","2010"); |
| | | // map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | // map.put("space_id","1"); |
| | | // map.put("device_id","1"); |
| | | // map.put("region_id","2010"); |
| | | // // 获取门禁列表 |
| | | // String s1 = HttpRequestUtil.getRequest |
| | | // ("https://try.daowepark.com/v7/user_api/general/getDevice", map); |
| | | // ("https://port.daowepark.com/v7/user_api/general/getDevice", map); |
| | | // System.err.println(s1); |
| | | |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("space_id","1"); |
| | | map.put("device_id","1"); |
| | | map.put("region_id","2010"); |
| | | // 获取门禁列表 |
| | | String s1 = HttpRequestUtil.getRequest |
| | | ("https://try.daowepark.com/v7/user_api/general/getDevice", map); |
| | | System.err.println(s1); |
| | | }; |
| | | // }; |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | model.addAttribute("time",byId.getStartTime()+" - "+byId.getEndTime()); |
| | | User byId1 = userMapper.selectById(byId.getStoreStaffId()); |
| | | model.addAttribute("city",byId1); |
| | | model.addAttribute("managerName", byId.getManagerName()); |
| | | model.addAttribute("managerPhone", byId.getPhone()); |
| | | model.addAttribute("type",1); |
| | | // 如果当前登陆人是运营商 |
| | | if (UserExt.getUser().getObjectType()==2){ |
| | |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | model.addAttribute("time",byId.getStartTime()+" - "+byId.getEndTime()); |
| | | User byId1 = userMapper.selectById(byId.getStoreStaffId()); |
| | | model.addAttribute("city",byId1); |
| | | model.addAttribute("managerName", byId.getManagerName()); |
| | | model.addAttribute("managerPhone", byId.getPhone()); |
| | | model.addAttribute("type",0); |
| | | |
| | | return PREFIX + "TShop_edit.html"; |
| | |
| | | }else{ |
| | | model.addAttribute("worldCupStores",worldCupStores); |
| | | } |
| | | //玩湃惠民卡 |
| | | StoreConfig c10 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,10)); |
| | | model.addAttribute("c10",c10!=null?c10:new StoreConfig()); |
| | | //会员卡板块 |
| | | StoreConfig c11 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,11)); |
| | | model.addAttribute("c11",c11!=null?c11:new StoreConfig()); |
| | | //散客入场 |
| | | StoreConfig c12 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,12)); |
| | | model.addAttribute("c12",c12!=null?c12:new StoreConfig()); |
| | | return PREFIX + "TShop_imgAll.html"; |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | public Object list(String provinceCode, String cityCode , String name, String phone,String shopName) { |
| | | Page<TStoreListVo> page = new PageFactory<TStoreListVo>().defaultPage(); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | List<TStoreListVo> list =new ArrayList<>(); |
| | | if("3".equals(roleid)){ |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | list = storeService.listAllStore(page,provinceCode,cityCode,name,phone,shopName,objectId); |
| | | }else { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | if (Integer.valueOf(3).equals(objectType)) { |
| | | // 门店员工按员工-门店中间表的数据范围查询;getStoreIdsByUserId 同时兼容 |
| | | // sys_user.objectId 和 t_store.storeStaffId 两种历史归属数据。 |
| | | List<Integer> storeIds = userMapper.getStoreIdsByUserId(UserExt.getUser().getId()); |
| | | if (!CollectionUtils.isEmpty(storeIds)) { |
| | | list = storeService.listAllStoresByIds(page, provinceCode, cityCode, name, phone, shopName, storeIds); |
| | | } |
| | | } else if (Integer.valueOf(2).equals(objectType)) { |
| | | Integer objectId = UserExt.getUser().getObjectId(); |
| | | list = storeService.listAll(page,provinceCode,cityCode,name,phone,shopName,objectId); |
| | | } else { |
| | | // 平台账号不带运营商条件,查询全部门店;数据范围由 objectType 决定, |
| | | // 不能用 roleid(菜单权限)判断,避免员工被授予角色 1 后被误当成运营商。 |
| | | list = storeService.listAll(page, provinceCode, cityCode, name, phone, shopName, null); |
| | | } |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | @RequestMapping(value = "/listOne") |
| | | @ResponseBody |
| | | public Object listOne(Integer id) { |
| | |
| | | @ResponseBody |
| | | public Object listTwo1(Integer id) { |
| | | Page<TStoreOtherConfigTrue> page = new PageFactory<TStoreOtherConfigTrue>().defaultPage(); |
| | | List<TStoreOtherConfigTrue> list = tStoreOtherConfigTrueService.page(page,new LambdaQueryWrapper<TStoreOtherConfigTrue>().eq(TStoreOtherConfigTrue::getPid, id).eq(TStoreOtherConfigTrue::getState,1)).getRecords(); |
| | | List<TStoreOtherConfigTrue> list = tStoreOtherConfigTrueService.page(page,new LambdaQueryWrapper<TStoreOtherConfigTrue>().eq(TStoreOtherConfigTrue::getPid, id).eq(TStoreOtherConfigTrue::getState,1).orderByDesc(TStoreOtherConfigTrue::getId)).getRecords(); |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object list(TStore tStore,String time,String userName,String userPhone,String ids,Integer type,Integer yyId,String lat,String lon,String pCode1,String cCode1) { |
| | | public Object list(TStore tStore, String time, String ids, Integer type, Integer yyId, String lat, String lon, |
| | | String pCode1, String cCode1, String userName) { |
| | | try { |
| | | if (ToolUtil.isEmpty(userName) || ToolUtil.isEmpty(tStore.getPhone())) { |
| | | return ERROR; |
| | | } |
| | | tStore.setManagerName(userName); |
| | | if(yyId==null || type==1){ |
| | | yyId=0; |
| | | } |
| | |
| | | } |
| | | } |
| | | }else { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getId, tStore.getProvinceCode())); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getProvinceCode())); |
| | | tStore.setProvince(one.getName()); |
| | | tStore.setProvinceCode(one.getCode()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getId, tStore.getCityCode())); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getCityCode())); |
| | | tStore.setCity(one1.getName()); |
| | | tStore.setCityCode(one1.getCode()); |
| | | } |
| | |
| | | tStore.setOperatorId(yyId); |
| | | tStore.setState(1); |
| | | tStore.setCreateTime(new Date()); |
| | | User user = new User(); |
| | | List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getAccount, userPhone)); |
| | | if(users.size()>0){ |
| | | return "5001"; |
| | | } |
| | | user.setAccount(userPhone); |
| | | user.setName(userName); |
| | | user.setRoleid("3"); |
| | | user.setPhone(userPhone); |
| | | user.setPassword(SecureUtil.md5("a123456")); |
| | | user.setObjectType(3); |
| | | user.setStatus(1); |
| | | userMapper.insert(user); |
| | | tStore.setStoreStaffId(user.getId()); |
| | | tStore.setLon(lon); |
| | | tStore.setLat(lat); |
| | | if (yyId == null || yyId == 0){ |
| | |
| | | tStore.setOperatorId(UserExt.getUser().getObjectId()); |
| | | } |
| | | |
| | | user.setObjectId(tStore.getId()); |
| | | userService.updateById(user); |
| | | // 添加门店 |
| | | HashMap<String, String> map1 = new HashMap<>(); |
| | | map1.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | |
| | | map1.put("location",tStore.getCity()); |
| | | map1.put("address",tStore.getAddress()); |
| | | map1.put("telephone",tStore.getPhone()); |
| | | map1.put("linkman",userName); |
| | | map1.put("linkman",tStore.getName()); |
| | | map1.put("business_time","[{\"start_time\":\""+tStore.getStartTime()+"\",\"close_time\":\""+tStore.getEndTime()+"\"}]"); |
| | | map1.put("logo",tStore.getCoverDrawing()); |
| | | map1.put("remark",tStore.getIntroduce()); |
| | | map1.put("lat",tStore.getLat()); |
| | | map1.put("lng",tStore.getLon()); |
| | | String result = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map1); |
| | | // String result = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map1); |
| | | String result = HttpRequestUtil.postRequest("https://port.daowepark.com/v7/user_api/general/addSpace", map1); |
| | | System.out.println(result); |
| | | JSONObject jsonObject = JSONObject.parseObject(result); |
| | | JSONObject data = jsonObject.getJSONObject("data"); |
| | |
| | | Integer integer = Integer.valueOf(space_id); |
| | | tStore.setId(integer); |
| | | storeService.save(tStore); |
| | | System.err.println(tStore); |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | for (int i = 1; i < 9; i++) { |
| | | StoreConfig storeConfig = new StoreConfig(); |
| | |
| | | // mapSite.put("name",tStore.getName()); |
| | | // mapSite.put("space_id",tStore.getId().toString()); |
| | | // mapSite.put("area_id",tSite.getId().toString()); |
| | | // HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpaceArea", mapSite); |
| | | // HttpRequestUtil.postRequest("https://port.daowepark.com/v7/user_api/general/addSpaceArea", mapSite); |
| | | // for (String s : tStore.getIds().split(",")) { |
| | | // HashMap<String, String> map = new HashMap<>(); |
| | | // map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | |
| | | // map.put("device_id",s); |
| | | // map.put("region_id",tSite.getId().toString()); |
| | | // // 添加门禁 |
| | | // String s1 = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addDevice", map); |
| | | // String s1 = HttpRequestUtil.postRequest("https://port.daowepark.com/v7/user_api/general/addDevice", map); |
| | | // System.out.println(s1); |
| | | // } |
| | | return new SuccessTip<>(); |
| | |
| | | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TStore tStore,String time,String userName,String userPhone,String ids,Integer type,Integer yyId,String lat,String lon,String pCode1,String cCode1) { |
| | | public Object update(TStore tStore, String time, String ids, Integer type, Integer yyId, String lat, String lon, |
| | | String pCode1, String cCode1, String userName) { |
| | | try { |
| | | TStore byIdc = storeService.getById(tStore.getId()); |
| | | if (ToolUtil.isEmpty(userName) || ToolUtil.isEmpty(tStore.getPhone())) { |
| | | return ERROR; |
| | | } |
| | | tStore.setManagerName(userName); |
| | | |
| | | if(yyId==null){ |
| | | yyId=0; |
| | |
| | | } |
| | | } |
| | | }else { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getId, tStore.getProvinceCode())); |
| | | // 编辑页提交的是行政区划编码;按 id 查询会导致查不到省、市,随后访问名称时抛出 NPE。 |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getProvinceCode())); |
| | | if (one == null) { |
| | | return ERROR; |
| | | } |
| | | tStore.setProvince(one.getName()); |
| | | tStore.setProvinceCode(one.getCode()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getId, tStore.getCityCode())); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getCityCode())); |
| | | if (one1 == null) { |
| | | return ERROR; |
| | | } |
| | | tStore.setCity(one1.getName()); |
| | | tStore.setCityCode(one1.getCode()); |
| | | } |
| | |
| | | if(ToolUtil.isEmpty(tStore.getCoverDrawing())){ |
| | | tStore.setCoverDrawing(byIdc.getCoverDrawing()); |
| | | } |
| | | User user = userMapper.selectById(byIdc.getStoreStaffId()); |
| | | List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getAccount, userPhone).ne(User::getId,tStore.getStoreStaffId())); |
| | | if(users.size()>0){ |
| | | return "5001"; |
| | | } |
| | | user.setAccount(userPhone); |
| | | user.setName(userName); |
| | | user.setPhone(userPhone); |
| | | userMapper.updateById(user); |
| | | tStore.setLon(lon); |
| | | tStore.setLat(lat); |
| | | // 运营商编辑 |
| | |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/onChange") |
| | | @ResponseBody |
| | | public Object onChange(Integer oneId) { |
| | |
| | | } |
| | | @RequestMapping(value = "/saveImgAll") |
| | | @ResponseBody |
| | | public Object saveImgAll(Integer id,Integer px1,Integer px2,Integer px3,Integer px4,Integer px5,Integer px6,Integer px7,Integer px8, |
| | | String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8, |
| | | Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8,String str) { |
| | | public Object saveImgAll(Integer id,Integer px1,Integer px2,Integer px3,Integer px4,Integer px5,Integer px6,Integer px7,Integer px8,Integer px10,Integer px11,Integer px12, |
| | | String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8,String c10,String c111,String c12, |
| | | Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8,Integer r10,Integer r11,Integer r12,String str) { |
| | | try { |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | StoreConfig collect1 = collect(id, px1, r1, c1, 1); |
| | |
| | | StoreConfig collect6 = collect(id, px6, r6, c6, 6); |
| | | StoreConfig collect7 = collect(id, px7, r7, c7, 7); |
| | | StoreConfig collect8 = collect(id, px8, r8, c8, 8); |
| | | StoreConfig collect10 = collect(id, px10, r10, c10, 10); |
| | | StoreConfig collect11 = collect(id, px11, r11, c111, 11); |
| | | StoreConfig collect12 = collect(id, px12, r12, c12, 12); |
| | | storeConfigs.add(collect1); |
| | | storeConfigs.add(collect2); |
| | | storeConfigs.add(collect3); |
| | |
| | | storeConfigs.add(collect6); |
| | | storeConfigs.add(collect7); |
| | | storeConfigs.add(collect8); |
| | | storeConfigService.updateBatchById(storeConfigs); |
| | | storeConfigs.add(collect10); |
| | | storeConfigs.add(collect11); |
| | | storeConfigs.add(collect12); |
| | | storeConfigService.saveOrUpdateBatch(storeConfigs); |
| | | |
| | | // 修改世界杯 |
| | | JSONArray jsonArray = JSONObject.parseArray(str); |
| | |
| | | worldCupStore.setSort(sort); |
| | | worldCupStore.setId(id1); |
| | | worldCupStore.setBackgroundImage(backgroundImage); |
| | | if (ToolUtil.isNotEmpty(backgroundImage)) { |
| | | worldCupStore.setDisplayType(ImageUtils.getImageDimensions(backgroundImage).getDisplayType()); |
| | | } |
| | | worldCupStore.setIsOpen(isOpen); |
| | | worldCupStores.add(worldCupStore); |
| | | } |
| | |
| | | StoreConfig one = storeConfigService.getOne(new QueryWrapper<StoreConfig>() |
| | | .eq("storeId", id) |
| | | .eq("type", type)); |
| | | if (one!=null){ |
| | | one.setSort(sort); |
| | | one.setIsOpen(isOpen); |
| | | if(ToolUtil.isNotEmpty(img)){ |
| | | one.setBackgroundImage(img); |
| | | try { |
| | | if (one != null) { |
| | | one.setSort(sort); |
| | | one.setIsOpen(isOpen); |
| | | if (ToolUtil.isNotEmpty(img)) { |
| | | one.setBackgroundImage(img); |
| | | one.setDisplayType(ImageUtils.getImageDimensions(img).getDisplayType()); |
| | | } |
| | | } |
| | | if (one == null) { |
| | | StoreConfig storeConfig = new StoreConfig(); |
| | | storeConfig.setStoreId(id); |
| | | storeConfig.setType(type); |
| | | storeConfig.setIsOpen(isOpen); |
| | | storeConfig.setSort(sort); |
| | | storeConfig.setBackgroundImage(img); |
| | | if (ToolUtil.isNotEmpty(img)) { |
| | | storeConfig.setDisplayType(ImageUtils.getImageDimensions(img).getDisplayType()); |
| | | } |
| | | storeConfigService.save(storeConfig); |
| | | return storeConfig; |
| | | } |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | if (one == null){ |
| | | StoreConfig storeConfig = new StoreConfig(); |
| | | storeConfig.setStoreId(id); |
| | | storeConfig.setType(type); |
| | | storeConfig.setIsOpen(isOpen); |
| | | storeConfig.setSort(sort); |
| | | storeConfig.setBackgroundImage(img); |
| | | storeConfigService.save(storeConfig); |
| | | return storeConfig; |
| | | } |
| | | |
| | | return one; |
| | | } |
| | | @RequestMapping(value = "/oneChangeNext") |
| | |
| | | @ResponseBody |
| | | public Object freeze(Integer id) { |
| | | try { |
| | | // 查询门店 获取门店店长id |
| | | TStore store = storeService.getById(id); |
| | | // 冻结 |
| | | store.setState(2); |
| | | storeService.updateById(store); |
| | | Integer storeStaffId = store.getStoreStaffId(); |
| | | User user = userService.getById(storeStaffId); |
| | | user.setStatus(2); |
| | | userService.updateById(user); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | @ResponseBody |
| | | public Object unfreeze(Integer id) { |
| | | try { |
| | | // 查询门店 获取门店店长id |
| | | TStore store = storeService.getById(id); |
| | | // 解冻 |
| | | store.setState(1); |
| | | storeService.updateById(store); |
| | | Integer storeStaffId = store.getStoreStaffId(); |
| | | User user = userService.getById(storeStaffId); |
| | | user.setStatus(1); |
| | | userService.updateById(user); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | public Object pwd(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | if (byId == null || byId.getStoreStaffId() == null) { |
| | | return ERROR; |
| | | } |
| | | User user = userMapper.selectById(byId.getStoreStaffId()); |
| | | if (user == null) { |
| | | return ERROR; |
| | | } |
| | | user.setPassword(SecureUtil.md5("a123456")); |
| | | userMapper.updateById(user); |
| | | return SUCCESS_TIP; |