cloud-server-account/src/main/java/com/dsh/account/controller/AppUserController.java
@@ -63,6 +63,7 @@ public List<TAppUser> queryAppUserList(@RequestBody AppUserByNameAndPhoneDTO dto){ return appUserService.queryAPPUserByNameAndPhone(dto); } /** * 根据用户姓名和电话模糊查询 */ cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java
@@ -63,6 +63,15 @@ return studentService.save(student); } /** * 获取有学员的用户ids * @return */ @ResponseBody @PostMapping("/student/getHasStudentUser") public List<Integer> getHasStudentUser(){ return studentService.list(new QueryWrapper<TStudent>()).stream().map(TStudent::getAppUserId).distinct().collect(Collectors.toList()); } /** * 获取用户学员列表 * @param appUserId * @return cloud-server-account/src/main/java/com/dsh/account/dto/AppUserByNameAndPhoneDTO.java
New file @@ -0,0 +1,12 @@ package com.dsh.account.dto; import lombok.Data; /** * 通过用户姓名和电话进行模糊查询DTO */ @Data public class AppUserByNameAndPhoneDTO { private String userName; private String phone; } cloud-server-activity/src/main/java/com/dsh/activity/controller/CouponController.java
@@ -1,4 +1,5 @@ package com.dsh.activity.controller; import java.util.Date; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; @@ -12,10 +13,13 @@ import com.dsh.activity.feignclient.account.AppUserClient; import com.dsh.activity.feignclient.account.CityClient; import com.dsh.activity.feignclient.account.StoreStaffClient; import com.dsh.activity.feignclient.account.StudentClient; import com.dsh.activity.feignclient.account.model.AppUserByNameAndPhoneDTO; import com.dsh.activity.feignclient.account.model.TCityManager; import com.dsh.activity.feignclient.account.model.TStoreStaff; import com.dsh.activity.feignclient.model.CouponExamineListSearch; import com.dsh.activity.feignclient.model.CouponListOfSearch; import com.dsh.activity.feignclient.model.TAppUser; import com.dsh.activity.feignclient.other.OperatorClient; import com.dsh.activity.feignclient.other.RegionClient; import com.dsh.activity.feignclient.other.StoreClient; @@ -93,6 +97,8 @@ @Autowired private AppUserClient appUserClient; @Autowired private StudentClient studentClient; /** * 查询注册赠送优惠券 判断当前优惠券限领数量 @@ -630,18 +636,69 @@ } boolean save = couponService.save(coupon); AppUserByNameAndPhoneDTO dto = new AppUserByNameAndPhoneDTO(); List<TAppUser> tAppUsers = appUserClient.queryAppUserList(dto); // 发放数量 Integer quantityIssued = dataVo.getQuantityIssued(); // 限领数量 Integer pickUpQuantity = dataVo.getPickUpQuantity(); // 赠送用户数量 int count = quantityIssued / pickUpQuantity; // 自动发券 if (dataVo.getDistributionMethod() == 3){ // 判断用户人群 再判断限领数量 switch (dataVo.getUserGroup()){ case 1: // 给全部用户发券 // 全部用户ids List<Integer> collect = tAppUsers.stream() .map(TAppUser::getId).collect(Collectors.toList()); for (int i = 0; i < count; i++) { for (int j = 0; j < pickUpQuantity; j++) { UserCoupon u1 = new UserCoupon(); u1.setCouponId(coupon.getId()); u1.setUserId(collect.get(i)); u1.setStatus(1); u1.setVerificationUserId(null); u1.setVerificationTime(null); u1.setInsertTime(new Date()); ucService.save(u1); } } break; case 2: // 给年度会员发券 获取年度会员ids List<Integer> collect1 = tAppUsers.stream().filter(t -> t.getVipEndTime().after(new Date())) .map(TAppUser::getId) .collect(Collectors.toList()); for (int i = 0; i < count; i++) { for (int j = 0; j < pickUpQuantity; j++) { UserCoupon u1 = new UserCoupon(); u1.setCouponId(coupon.getId()); u1.setUserId(collect1.get(i)); u1.setStatus(1); u1.setVerificationUserId(null); u1.setVerificationTime(null); u1.setInsertTime(new Date()); ucService.save(u1); } } break; case 3: // 给已有学员用户发券 获取已有学员的用户ids List<Integer> collect2 = studentClient.getHasStudentUser(); for (int i = 0; i < count; i++) { for (int j = 0; j < pickUpQuantity; j++) { UserCoupon u1 = new UserCoupon(); u1.setCouponId(coupon.getId()); u1.setUserId(collect2.get(i)); u1.setStatus(1); u1.setVerificationUserId(null); u1.setVerificationTime(null); u1.setInsertTime(new Date()); ucService.save(u1); } } break; } } cloud-server-activity/src/main/java/com/dsh/activity/feignclient/account/AppUserClient.java
@@ -1,8 +1,14 @@ package com.dsh.activity.feignclient.account; import com.dsh.activity.feignclient.account.model.AppUser; import com.dsh.activity.feignclient.account.model.AppUserByNameAndPhoneDTO; import com.dsh.activity.feignclient.model.TAppUser; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; /** * @author zhibing.pu @@ -19,5 +25,9 @@ */ @PostMapping("/base/appUser/queryAppUser") AppUser queryAppUser(Integer appUserId); /** * 获取所有用户 */ @PostMapping("/base/appUser/queryAppUserList") public List<TAppUser> queryAppUserList(@RequestBody AppUserByNameAndPhoneDTO dto); } cloud-server-activity/src/main/java/com/dsh/activity/feignclient/account/StudentClient.java
@@ -4,6 +4,7 @@ import com.dsh.activity.feignclient.account.model.Student; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; @@ -22,4 +23,10 @@ */ @PostMapping("/student/queryStudentList") List<TStudent> queryStudentList(Integer appUserId); /** * 获取有学员的用户ids * @return */ @PostMapping("/student/getHasStudentUser") public List<Integer> getHasStudentUser(); } cloud-server-activity/src/main/java/com/dsh/activity/feignclient/account/model/AppUserByNameAndPhoneDTO.java
New file @@ -0,0 +1,12 @@ package com.dsh.activity.feignclient.account.model; import lombok.Data; /** * 通过用户姓名和电话进行模糊查询DTO */ @Data public class AppUserByNameAndPhoneDTO { private String userName; private String phone; } cloud-server-activity/src/main/java/com/dsh/activity/feignclient/model/TAppUser.java
New file @@ -0,0 +1,176 @@ package com.dsh.activity.feignclient.model; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import java.util.Date; /** * <p> * 用户信息 * </p> * * @author administrator * @since 2023-06-14 */ @Data @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("t_app_user") public class TAppUser { private static final long serialVersionUID = 1L; /** * 主键 */ @TableId(value = "id", type = IdType.AUTO) private Integer id; /** * 编号 */ @TableField("code") private String code; /** * 姓名 */ @TableField("name") private String name; /** * 电话 */ @TableField("phone") private String phone; /** * 密码 */ @TableField("password") private String password; /** * 生日 */ @TableField("birthday") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date birthday; /** * 性别(1=男,2=女) */ @TableField("gender") private Integer gender; /** * 身高 */ @TableField("height") private Double height; /** * 体重 */ @TableField("weight") private Double weight; /** * bmi健康值 */ @TableField("bmi") private Double bmi; /** * 身份证号 */ @TableField("idCard") private String idCard; /** * 微信openid */ @TableField("openid") private String openid; /** * 省 */ @TableField("province") private String province; /** * 省编号 */ @TableField("provinceCode") private String provinceCode; /** * 市 */ @TableField("city") private String city; /** * 市编号 */ @TableField("cityCode") private String cityCode; /** * 是否是年度会员(0=否,1=是) */ @TableField("isVip") private Integer isVip; /** * 会员有效期 */ @TableField("vipEndTime") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date vipEndTime; /** * 会员等级id */ @TableField("viplevelId") private Integer viplevelId; /** * 推荐用户id */ @TableField("referralUserId") private Integer referralUserId; /** * 销售员id */ @TableField("salesmanUserId") private Integer salesmanUserId; /** * 状态(1=正常,2=冻结,3=删除) */ @TableField("state") private Integer state; /** * 剩余积分 */ @TableField("integral") private Integer integral; /** * 玩湃币 */ @TableField("playPaiCoins") private Integer playPaiCoins; /** * 用户头像 */ @TableField("headImg") private String headImg; /** * 添加时间 */ @TableField("insertTime") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") private Date insertTime; /** * 添加类型 type = 1 平台 type=2 运营商 type=3门店 */ @TableField("insertType") private Integer insertType; /** * 添加人id平台管理员id 运营商id */ @TableField("addUserId") private Integer addUserId; @TableField(exist = false) private Integer age; } cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCompetitionController.java
@@ -90,6 +90,7 @@ List<TStore> operatorId = storeService.list(new QueryWrapper<TStore>().eq("operatorId", objectId)); model.addAttribute("stores",operatorId); if (UserExt.getUser().getObjectType()==2){ // 查询这个运营商管理的省 TOperator id = tOperatorService.getOne(new QueryWrapper<TOperator>().eq("id", UserExt.getUser().getObjectId())); if (id.getType()==1){ @@ -101,7 +102,10 @@ List<TOperatorCity> list4 = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId", UserExt.getUser().getObjectId()).eq("pid", 0)); model.addAttribute("province",list4); } model.addAttribute("operator",objectId); } if (UserExt.getUser().getObjectType()==1) model.addAttribute("operator",0); return PREFIX + "TCompetition_add.html"; } cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TShopController.java
@@ -135,23 +135,31 @@ model.addAttribute("objectType",UserExt.getUser().getObjectType()); return PREFIX + "TShop_add.html"; } // 运营商根据省筛选市区 @RequestMapping("/getProvinceYys") @ResponseBody public Object getProvinceYys(Integer operatorId) { // 获取运营商管理的所有省 List<TOperatorCity> list = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId", operatorId) .eq("pid", 0)); return list; } // 运营商根据省筛选市区 @RequestMapping("/getCityYys") @ResponseBody public Object getCityYys(String province) { Integer objectId = UserExt.getUser().getObjectId(); public Object getCityYys(String province,Integer operatorId) { // 通过选择的省 获取管理的市 TOperatorCity byId = operatorCityService.getOne(new QueryWrapper<TOperatorCity>() .eq("code",province).eq("operatorId",objectId)); .eq("code",province).eq("operatorId",operatorId)); // 如果为null 则说明管理的全国 if (byId == null){ TCity code = cityService.getOne(new QueryWrapper<TCity>().eq("code", province)); return cityService.list(new QueryWrapper<TCity>().eq("parent_id",code.getId())); }else{ List<TOperatorCity> list = operatorCityService.list(new QueryWrapper<TOperatorCity>() .eq("operatorId", UserExt.getUser().getObjectId()) .eq("operatorId", operatorId) .eq("pid",byId.getId())); if (list.size() == 0){ // 说明管理整个省 @@ -212,12 +220,13 @@ List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); // TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getProvinceCode())); List<TOperatorCity> one = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1)); List<TOperatorCity> ones = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1)); List<TOperatorCity> ones = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>() .eq(TOperatorCity::getOperatorId, byId.getOperatorId()) .eq(TOperatorCity::getPid, 0)); if(ones.size()>0){ model.addAttribute("list",ones); TOperatorCity one1 = operatorCityService.getOne(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getType, 1).eq(TOperatorCity::getCode,byId.getProvinceCode())); TOperatorCity one1 = operatorCityService.getOne(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, byId.getOperatorId()).eq(TOperatorCity::getPid, 0).eq(TOperatorCity::getCode,byId.getProvinceCode())); List<TOperatorCity> list3 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().in(TOperatorCity::getPid, one1.getId()).eq(TOperatorCity::getType, 2)); model.addAttribute("list1",list3); System.out.println("===list3======="+list3); @@ -259,9 +268,6 @@ List<TOperatorCity> list4 = operatorCityService.list(new QueryWrapper<TOperatorCity>().eq("operatorId", UserExt.getUser().getObjectId()).eq("pid", 0)); model.addAttribute("list",list4); } }else{ List<TCity> list5 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); model.addAttribute("list",list5); } return PREFIX + "TShop_edit.html"; } @@ -416,19 +422,21 @@ List<TOperatorCity> list1 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, yyId)); if(list1.size()>0){ if (ToolUtil.isNotEmpty(tStore.getProvinceCode())) { TOperatorCity byId = operatorCityService.getById(tStore.getProvinceCode()); TOperatorCity byId = operatorCityService.getOne(new QueryWrapper<TOperatorCity>().eq("code",tStore.getProvinceCode()) .eq("operatorId",yyId)); TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getCode())); tStore.setProvince(one.getName()); tStore.setProvinceCode(one.getCode()); List<TOperatorCity> list = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getPid, byId.getId()).eq(TOperatorCity::getType, 2)); if (list.size() > 0) { TOperatorCity byId1 = operatorCityService.getById(tStore.getCityCode()); TOperatorCity byId1 = operatorCityService.getOne(new QueryWrapper<TOperatorCity>().eq("code",tStore.getCityCode()) .eq("operatorId",yyId)); TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId1.getCode())); tStore.setCity(one1.getName()); tStore.setCityCode(one1.getCode()); } else { TCity byId1 = cityService.getById(tStore.getCityCode()); TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId1.getCode())); TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getCityCode())); tStore.setCity(one1.getName()); tStore.setCityCode(one1.getCode()); } @@ -482,7 +490,11 @@ tStore.setStoreStaffId(user.getId()); tStore.setLon(lon); tStore.setLat(lat); tStore.setOperatorId(UserExt.getUser().getObjectId()); if (yyId == null || yyId == 0){ tStore.setOperatorId(0); }else{ tStore.setOperatorId(yyId); } storeService.save(tStore); user.setObjectId(tStore.getId()); @@ -490,61 +502,61 @@ // 添加场地 TSite tSite = new TSite(); tSite.setName(tStore.getName()); tSite.setStoreId(tStore.getId()); tSite.setSign(1); siteService.save(tSite); HashMap<String, String> mapSite = new HashMap<>(); mapSite.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); 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); ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); for (int i = 1; i < 9; i++) { StoreConfig storeConfig = new StoreConfig(); storeConfig.setIsOpen(1); storeConfig.setSort(i); storeConfig.setType(i); storeConfig.setStoreId(tStore.getId()); storeConfigs.add(storeConfig); } storeConfigService.saveBatch(storeConfigs); // TSite tSite = new TSite(); // tSite.setName(tStore.getName()); // tSite.setStoreId(tStore.getId()); // tSite.setSign(1); // siteService.save(tSite); // // HashMap<String, String> mapSite = new HashMap<>(); // mapSite.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); // 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); // // ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); // for (int i = 1; i < 9; i++) { // StoreConfig storeConfig = new StoreConfig(); // storeConfig.setIsOpen(1); // storeConfig.setSort(i); // storeConfig.setType(i); // storeConfig.setStoreId(tStore.getId()); // storeConfigs.add(storeConfig); // } // storeConfigService.saveBatch(storeConfigs); // 添加门店 HashMap<String, String> map1 = new HashMap<>(); map1.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); map1.put("name",tStore.getName()); map1.put("short_name",tStore.getName()); map1.put("location",tStore.getCity()); map1.put("address",tStore.getAddress()); map1.put("telephone",tStore.getPhone()); map1.put("linkman",userName); 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()); map1.put("space_id",tStore.getId().toString()); String result = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map1); System.out.println(result); // // 添加门店 // HashMap<String, String> map1 = new HashMap<>(); // map1.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); // map1.put("name",tStore.getName()); // map1.put("short_name",tStore.getName()); // map1.put("location",tStore.getCity()); // map1.put("address",tStore.getAddress()); // map1.put("telephone",tStore.getPhone()); // map1.put("linkman",userName); // 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()); // map1.put("space_id",tStore.getId().toString()); // String result = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map1); // System.out.println(result); for (String s : tStore.getIds().split(",")) { HashMap<String, String> map = new HashMap<>(); map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); map.put("space_id",tStore.getId()+""); 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); System.out.println(s1); } // for (String s : tStore.getIds().split(",")) { // HashMap<String, String> map = new HashMap<>(); // map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); // map.put("space_id",tStore.getId()+""); // 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); // System.out.println(s1); // } @@ -571,18 +583,21 @@ List<TOperatorCity> list1 = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getOperatorId, yyId)); if(list1.size()>0){ if (ToolUtil.isNotEmpty(tStore.getProvinceCode())) { TOperatorCity byId = operatorCityService.getById(tStore.getProvinceCode()); TOperatorCity byId = operatorCityService.getOne(new QueryWrapper<TOperatorCity>().eq("operatorId", yyId) .eq("code", tStore.getProvinceCode())); TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getCode())); tStore.setProvince(one.getName()); tStore.setProvinceCode(one.getCode()); List<TOperatorCity> list = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>().eq(TOperatorCity::getPid, byId.getId()).eq(TOperatorCity::getType, 2)); List<TOperatorCity> list = operatorCityService.list(new LambdaQueryWrapper<TOperatorCity>() .eq(TOperatorCity::getPid, byId.getId()).ne(TOperatorCity::getPid, 0)); if (list.size() > 0) { TOperatorCity byId1 = operatorCityService.getById(tStore.getCityCode()); TOperatorCity byId1 = operatorCityService.getOne(new QueryWrapper<TOperatorCity>().eq("operatorId", yyId) .eq("code", tStore.getCityCode())); TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId1.getCode())); tStore.setCity(one1.getName()); tStore.setCityCode(one1.getCode()); } else { TCity byId1 = cityService.getById(tStore.getCityCode()); TCity byId1 = cityService.getOne(new QueryWrapper<TCity>().eq("code",tStore.getCityCode())); TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId1.getCode())); tStore.setCity(one1.getName()); tStore.setCityCode(one1.getCode()); cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/system/TStudentController.java
@@ -445,15 +445,15 @@ @RequestMapping("/updatecom") @ResponseBody public ResultUtil updatecom(Integer id,String content,String images) { public ResultUtil updatecom(@RequestBody StudentPingYuDTO dto) { EvaluateStudent evaluateStudent = new EvaluateStudent(); evaluateStudent.setId(id); evaluateStudent.setContent(content); evaluateStudent.setImgs(images); evaluateStudent.setId(dto.getId()); evaluateStudent.setContent(dto.getContent()); evaluateStudent.setImgs(dto.getImages()); appUserClient.save(evaluateStudent); evaluateStudentService.updateById(evaluateStudent); // evaluateStudentService.updateById(evaluateStudent); cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/StudentPingYuDTO.java
New file @@ -0,0 +1,13 @@ package com.dsh.guns.modular.system.model; import lombok.Data; /** * 学员评语 */ @Data public class StudentPingYuDTO { String content; String images; Integer id; } cloud-server-management/src/main/webapp/WEB-INF/view/system/operator/Operator.html
@@ -39,7 +39,7 @@ <#button name="编辑" icon="fa-edit" clickFun="TSite.openInfo()" space="true"/> <#button name="冻结" icon="fa-remove" clickFun="TSite.offShelf()" space="true"/> <#button name="解冻" icon="fa-check" clickFun="TSite.onShelf()" space="true"/> <#button name="分账比例" icon="fa-plus" clickFun="TSite.proportion()"/> <#button name="重置密码" icon="fa-search" clickFun="TSite.reload()" space="true"/> </div> <#table id="TSiteTable"/> cloud-server-management/src/main/webapp/WEB-INF/view/system/tCompetition/TCompetition_add.html
@@ -45,7 +45,7 @@ <div class="ibox float-e-margins"> <div class="ibox-content"> <input hidden id="operator" value="${operator}"> <div class="form-horizontal" id="carInfoForm"> @if(type==1){ cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_add.html
@@ -46,10 +46,11 @@ <div class="form-horizontal" id="carInfoForm"> <input hidden id="role" value="${role}"> <input hidden id="operator" value="${operator}"> <input hidden id="objectType" value="${objectType}"> @if(role=='1'){ <div class="form-group"> <label class="col-sm-3 control-label">门店类型:</label> <label class="col-sm-3 control-label">*门店类型:</label> <div class="col-sm-9"> <input type="radio" name="type" value="1" onclick="updateType(1)"> 平台门店 <input type="radio" name="type" value="2" onclick="updateType(2)" id="radio1" checked > 运营商门店 @@ -60,9 +61,9 @@ @if(role=='1'){ <div id="yys" hidden> <div class="form-group"> <label class="col-sm-3 control-label">所属运营商:</label> <label class="col-sm-3 control-label">*所属运营商:</label> <div class="col-sm-9"> <select class="form-control" id="account" name="account" onchange="TCarInfoDlg.oneChange1(this)" > <select class="form-control" id="account" name="account" onchange="TCarInfoDlg.oneChange3(this)" > <option value="">选择运营商</option> @for(i in yysList){ <option value="${i.id}" ${i.id == operator ? 'selected' : ''}>${i.name}</option> @@ -71,14 +72,14 @@ </div> </div> <div class="form-group" id="provinceCode"> <label class="col-sm-3 control-label">所在省:</label> <label class="col-sm-3 control-label">*所在省:</label> <div class="col-sm-9"> <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange2(this)"> <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange9(this)"> </select> </div> </div> <div class="form-group" id="cityCode"> <label class="col-sm-3 control-label">所在市:</label> <label class="col-sm-3 control-label">*所在市:</label> <div class="col-sm-9"> <select class="form-control" id="cCode" name="cCode" > <option value="">选择市</option> @@ -89,7 +90,7 @@ @} <div id="yys1" > <div class="form-group" id="provinceCode1"> <label class="col-sm-3 control-label">所在省:</label> <label class="col-sm-3 control-label">*所在省:</label> <div class="col-sm-9"> <select class="form-control" id="pCode1" name="pCode1" onchange="TCarInfoDlg.oneChange9(this)"> <option value="">选择省</option> @@ -100,7 +101,7 @@ </div> </div> <div class="form-group" id="cityCode1"> <label class="col-sm-3 control-label">所在市:</label> <label class="col-sm-3 control-label">*所在市:</label> <div class="col-sm-9"> <select class="form-control" id="cCode1" name="cCode1" > <option value="">选择市</option> @@ -108,10 +109,10 @@ </div> </div> </div> <#input id="name" name="门店名称" type="text"/> <#input id="phone" name="联系电话" type="text"/> <#input id="name" name="*门店名称" type="text"/> <#input id="phone" name="*联系电话" type="text"/> <div class="form-group"> <label class="col-sm-3 control-label">门店地址:</label> <label class="col-sm-3 control-label">*门店地址:</label> <div class="col-sm-9"> <input class="form-control" id="address" name="address" type="text" onchange="TCarInfoDlg.searchByStationName(this,1)"> </div> @@ -125,14 +126,14 @@ <#input id="time" name="营业时间" type="text"/> <div class="form-group"> <label class="col-sm-3 control-label">门店介绍:</label> <label class="col-sm-3 control-label">*门店介绍:</label> <div class="col-sm-9"> <textarea id="introduce" style="width: 617px; height: 180px;"></textarea> </div> </div> <#input id="userName" name="店长姓名" type="text"/> <#input id="userPhone" name="店长手机号" type="text"/> <#avatar id="img" name="门店封面(推荐像素722*360px)" /> <#input id="userName" name="*店长姓名" type="text"/> <#input id="userPhone" name="*店长手机号" type="text"/> <#avatar id="img" name="*门店封面(推荐像素722*360px)" /> <div class="row" id="app1"> <div class="col-sm-6" style="width: 100%;margin-left: 103px;"> <div class="form-group"> cloud-server-management/src/main/webapp/WEB-INF/view/system/tShop/TShop_edit.html
@@ -58,7 +58,7 @@ <div class="form-group" id="yys" hidden > <label class="col-sm-3 control-label">所属运营商:</label> <div class="col-sm-9"> <select class="form-control" id="account" name="account" onchange="TCarInfoDlg.oneChange1(this)"> <select class="form-control" id="account" name="account" onchange="TCarInfoDlg.oneChange3(this)"> @for(obj in yysList){ <option value="${obj.id}" ${obj.id == item.operatorId ? 'selected=selected' : ''}>${obj.name}</option> @} cloud-server-management/src/main/webapp/static/modular/system/operator/operator_add.js
@@ -144,8 +144,8 @@ Feng.error("请输入管理员电话"); return; } console.log("看看手机号") console.log($("#phone").val()) console.log("看看手机号"); console.log($("#phone").val()); if (!phoneRegex.test($("#phone").val())){ Feng.info("手机号不合法,请重新输入!"); cloud-server-management/src/main/webapp/static/modular/system/tCompetition/tCompetition_info.js
@@ -105,6 +105,7 @@ TCarInfoDlg.oneChange9 = function (e) { console.log(111) var oneId=$(e).val(); var operatorId = $("#operator").val() var ajax = new $ax(Feng.ctxPath + "/tShop/getCityYys", function(data){ if(data!=null){ if(language==1){ @@ -122,6 +123,7 @@ } }); ajax.set("province",oneId); ajax.set("operatorId",operatorId); ajax.start(); }; TCarInfoDlg.oneChangeNext9 = function (e) { cloud-server-management/src/main/webapp/static/modular/system/tShop/tShop_info.js
@@ -125,6 +125,7 @@ TCarInfoDlg.oneChange9 = function (e) { console.log(111) var oneId=$(e).val(); var operatorId = $("#account").val(); var ajax = new $ax(Feng.ctxPath + "/tShop/getCityYys", function(data){ if(data!=null){ if(language==1){ @@ -142,6 +143,7 @@ } }); ajax.set("province",oneId); ajax.set("operatorId",operatorId); ajax.start(); } TCarInfoDlg.oneChangeNext = function (e) { @@ -214,25 +216,29 @@ let pCode1 = $("#pCode1").val() let cCode1 = $("#cCode1").val() let name = $("#name").val() let phone = $("#phone").val() var elementById = document.getElementById("radio1"); if (elementById.checked) { if (pCode == '' && $("#role").val() == "1") { Feng.info("请选择省") return; } if (cCode == '' && $("#role").val() == "1") { Feng.info("请选择市") return; } } if(pCode=='' && $("#role")=="1" && OBJradio==2){ Feng.info("请选择省") return; } if(cCode=='' && $("#role")=="1" && OBJradio==2){ Feng.info("请选择市") return; } if(pCode1=='' && $("#role")=="1" && OBJradio==1){ Feng.info("请选择省") return; } if(cCode1=='' && $("#role")=="1" && OBJradio==12){ Feng.info("请选择市") return; if (!elementById.checked){ if(pCode1=='' && $("#role").val()=="1"){ Feng.info("请选择省") return; } if(cCode1=='' && $("#role").val()=="1"){ Feng.info("请选择市") return; } } if(name==''){ Feng.info("门店名称不能为空") @@ -261,9 +267,9 @@ Feng.info("请填写营业时间") return; } let intro = $("#intro").val() let introduce = $("#introduce").val() if(intro==''){ if(introduce==''){ Feng.info("请填写门店介绍") return; } @@ -311,23 +317,11 @@ var ajax = new $ax(Feng.ctxPath + "/tShop/add", function(data){ if(data=="5001"){ Feng.error("该店长手机号已经存在!") }else if(data.code == 200){ if(language==1){ Feng.success("添加成功!"); }else if(language==2){ Feng.success("Successfully added!"); }else { Feng.success("Sangat berhasil ditambah!"); } }else{ Feng.success("添加成功!"); window.parent.TCompetition.table.refresh(); TCarInfoDlg.close(); }else{ Feng.error(data.msg); } },function(data){ }); ajax.set(this.tCarInfoData); ajax.set("provinceCode",pCode); @@ -337,7 +331,7 @@ ajax.set("cityManagerId",null); ajax.set("address",address); ajax.set("time",time); ajax.set("introduce",intro); ajax.set("introduce",introduce); ajax.set("userName",userName); ajax.set("userPhone",userPhone); ajax.set("coverDrawing",img); @@ -487,19 +481,19 @@ let name = $("#name").val() let phone = $("#phone").val() if(pCode=='' && $("#role")=="1" && OBJradio==2){ if(pCode=='' && $("#role").val()=="1" && OBJradio==2){ Feng.info("请选择省") return; } if(cCode=='' && $("#role")=="1" && OBJradio==2){ if(cCode=='' && $("#role").val()=="1" && OBJradio==2){ Feng.info("请选择市") return; } if(pCode1=='' && $("#role")=="1" && OBJradio==1){ if(pCode1=='' && $("#role").val()=="1" && OBJradio==1){ Feng.info("请选择省") return; } if(cCode1=='' && $("#role")=="1" && OBJradio==12) { if(cCode1=='' && $("#role").val()=="1" && OBJradio==12) { Feng.info("请选择市") } if(name==''){ @@ -530,9 +524,9 @@ Feng.info("请填写营业时间") return; } let intro = $("#intro").val() let introduce = $("#introduce").val() if(intro==''){ if(introduce==''){ Feng.info("请填写门店介绍") return; } @@ -600,7 +594,7 @@ ajax.set("cityManagerId",account); ajax.set("address",address); ajax.set("time",time); ajax.set("introduce",intro); ajax.set("introduce",introduce); ajax.set("userName",userName); ajax.set("userPhone",userPhone); ajax.set("coverDrawing",img); @@ -876,22 +870,63 @@ TCarInfoDlg.oneChange2 = function (e) { console.log(111) var oneId=$(e).val(); var ajax = new $ax(Feng.ctxPath + "/tShop/onChange2", function(data){ if(data!=null){ if(language==1){ var content='<option value="">选择市</option>'; }else if(language==2){ var content='<option value="">Choose your franchisee</option>'; }else { var content='<option value="">Pilih franchisee Anda</option>'; var elementById = document.getElementById("radio1"); // 如果选中了运营商门店 那就查询这个运营商下的市 if (elementById.checked){ var operatorId = $("#account").val(); console.log("我看看运营商id") var ajax = new $ax(Feng.ctxPath + "/tShop/getCityYys", function(data){ if(data!=null){ if(language==1){ var content='<option value="">选择市</option>'; }else if(language==2){ var content='<option value="">Choose your franchisee</option>'; }else { var content='<option value="">Pilih franchisee Anda</option>'; } $.each(data, function(k,v) { content += "<option value='"+v.code+"'>"+v.name+"</option>"; }); $("#cCode1").empty().append(content); $("#cCode").empty().append(content); } }); ajax.set("province",oneId); ajax.set("operatorId",operatorId); ajax.start(); }else{ var ajax = new $ax(Feng.ctxPath + "/tShop/onChange2", function(data){ if(data!=null){ if(language==1){ var content='<option value="">选择市</option>'; }else if(language==2){ var content='<option value="">Choose your franchisee</option>'; }else { var content='<option value="">Pilih franchisee Anda</option>'; } $.each(data, function(k,v) { content += "<option value='"+v.code+"'>"+v.name+"</option>"; }); $("#cCode").empty().append(content); } }); ajax.set("oneId",oneId); ajax.start(); } } TCarInfoDlg.oneChange3 = function (e) { var operatorId=$(e).val(); var ajax = new $ax(Feng.ctxPath + "/tShop/getProvinceYys", function(data){ if(data!=null){ var content='<option value="">选择市</option>'; $.each(data, function(k,v) { content += "<option value='"+v.code+"'>"+v.name+"</option>"; }); $("#cCode").empty().append(content); $("#pCode").empty().append(content); } }); ajax.set("oneId",oneId); ajax.set("operatorId",operatorId); ajax.start(); } @@ -899,6 +934,7 @@ TCarInfoDlg.oneChangeNext1 = function (e) { var oneId=$(e).val(); var ajax = new $ax(Feng.ctxPath + "/tCompetition/oneChangeNext", function(data){