| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | }) |
| | | public ResultUtil<List<Goods>> pointsMallList(MallRequest request){ |
| | | try { |
| | | System.out.println("======request========"+request); |
| | | return ResultUtil.success(tauService.queryAppUserIntegral(request)); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | |
| | | private String phone; |
| | | private Integer isVip; |
| | | private Integer state; |
| | | private String salesmanUserId; |
| | | private String salesmanUser; |
| | | // 角色类型 |
| | | private Integer insertType; |
| | | // 平台/运营商/门店id |
| | |
| | | |
| | | import com.dsh.account.controller.CoachTypeController; |
| | | |
| | | import com.dsh.account.controller.UseBenefitsController; |
| | | import com.dsh.account.model.vo.userBenefitDetail.Goods; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | |
| | | class AccountApplicationTests { |
| | | |
| | | @Autowired |
| | | private CoachTypeController controller; |
| | | private UseBenefitsController useBenefitsController; |
| | | |
| | | |
| | | @Test |
| | | void contextLoads() { |
| | | System.out.println(System.getProperty("java.version")); |
| | | System.out.println(System.getProperty("java.compiler")); |
| | | System.out.println(System.getProperty("java.vm.specification.version")); |
| | | System.out.println(System.getProperty("java.specification.version")); |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | @PostMapping("/base/coupon/getAllCoupons") |
| | | public List<Coupon> getAllCoupons(@RequestBody CommodityRequest request){ |
| | | List<Coupon> couponList = new ArrayList<>(); |
| | | String provinceCode = ""; |
| | | String cityCode = ""; |
| | | if (ToolUtil.isEmpty(request.getLat()) && ToolUtil.isEmpty(request.getLon())){ |
| | | return couponList; |
| | | } |
| | | // String provinceCode = ""; |
| | | // String cityCode = ""; |
| | | // if (ToolUtil.isEmpty(request.getLat()) && ToolUtil.isEmpty(request.getLon())){ |
| | | // return couponList; |
| | | // } |
| | | // try { |
| | | // Map<String, String> geocode = gdMapGeocodingUtil.geocode(request.getLon(), request.getLat()); |
| | | // provinceCode = geocode.get("provinceCode"); |
| | | // cityCode = geocode.get("cityCode"); |
| | | // }catch (Exception e){ |
| | | // e.printStackTrace(); |
| | | // } |
| | | try { |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(request.getLon(), request.getLat()); |
| | | provinceCode = geocode.get("provinceCode"); |
| | | cityCode = geocode.get("cityCode"); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | try { |
| | | LocalDateTime currentDate = LocalDateTime.now(); |
| | | |
| | | couponList = couponService.list(new QueryWrapper<Coupon>() |
| | | .eq("auditStatus",2) |
| | | .eq("distributionMethod",1) |
| | | .eq("state",1) |
| | | .eq("status",2)); |
| | | if (couponList.size() > 0 ){ |
| | | Iterator<Coupon> iterator = couponList.iterator(); |
| | | while (iterator.hasNext()) { |
| | | Coupon merchandise = iterator.next(); |
| | | if (merchandise.getUseScope() == 2){ |
| | | List<CouponCity> couponCities = cityService.list(new LambdaQueryWrapper<CouponCity>() |
| | | .eq(CouponCity::getCouponId,merchandise.getId())); |
| | | if (couponCities.size() > 0){ |
| | | for (CouponCity couponCity : couponCities) { |
| | | if (!Objects.equals(couponCity.getCityCode(), cityCode) && !Objects.equals(couponCity.getProvinceCode(), provinceCode)){ |
| | | iterator.remove(); // 移除符合条件的商品 |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .eq("status",1) |
| | | .le("startTime", currentDate) |
| | | .ge("endTime", currentDate)); |
| | | // if (couponList.size() > 0 ){ |
| | | // Iterator<Coupon> iterator = couponList.iterator(); |
| | | // while (iterator.hasNext()) { |
| | | // Coupon merchandise = iterator.next(); |
| | | // if (merchandise.getUseScope() == 2){ |
| | | // List<CouponCity> couponCities = cityService.list(new LambdaQueryWrapper<CouponCity>() |
| | | // .eq(CouponCity::getCouponId,merchandise.getId())); |
| | | // if (couponCities.size() > 0){ |
| | | // for (CouponCity couponCity : couponCities) { |
| | | // if (!Objects.equals(couponCity.getCityCode(), cityCode) && !Objects.equals(couponCity.getProvinceCode(), provinceCode)){ |
| | | // iterator.remove(); // 移除符合条件的商品 |
| | | // break; |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | return couponList; |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | |
| | | |
| | | return discountService.updateBatchById(list); |
| | | } |
| | | @Autowired |
| | | private ICoursePackagePaymentConfigService packagePaymentConfigService; |
| | | @PostMapping("/course/times") |
| | | public List<Integer> times( @RequestBody Integer oneId){ |
| | | List<CoursePackagePaymentConfig> list = packagePaymentConfigService.list(new QueryWrapper<CoursePackagePaymentConfig>().eq("coursePackageId",oneId)); |
| | | List<Integer> integerList = new ArrayList<>(); |
| | | for (CoursePackagePaymentConfig coursePackagePaymentConfig : list) { |
| | | integerList.add(coursePackagePaymentConfig.getClassHours()); |
| | | } |
| | | |
| | | |
| | | return integerList; |
| | | } |
| | | |
| | | @PostMapping("/course/queryFee") |
| | | public HashMap<String, Object> queryFee(@RequestBody QueryDataFee queryDataFee){ |
| | |
| | | coursePackageListVo.setPayType(coursePackage.getPayType()); |
| | | |
| | | |
| | | coursePackageListVo.setPlayPaiCoin(coursePackagePaymentConfig.getPlayPaiCoin()); |
| | | |
| | | if (coursePackagePaymentConfig!=null) { |
| | | coursePackageListVo.setPlayPaiCoin(coursePackagePaymentConfig.getPlayPaiCoin()); |
| | | } |
| | | //会员显示原价和会员价(最低)。非会员显示会员价和支付价(最低) |
| | | if(appUser.getIsVip() == 0){//非会员 |
| | | List<TCoursePackageDiscount> list2 = coursePackageDiscountService.list(new QueryWrapper<TCoursePackageDiscount>().eq("coursePackagePaymentConfigId", coursePackagePaymentConfig.getId()) |
| | |
| | | private String phone; |
| | | private Integer isVip; |
| | | private Integer state; |
| | | private Integer salesmanUserId; |
| | | private Integer salesmanUser; |
| | | // 角色类型 |
| | | private Integer insertType; |
| | | // 平台/运营商/门店id |
| | |
| | | |
| | | @PostMapping("/course/auditDiscount") |
| | | Boolean auditDiscount(AuditDiscount auditDiscount); |
| | | |
| | | @PostMapping("/course/times") |
| | | List<Integer> timeChange(@RequestBody Integer oneId); |
| | | } |
| | |
| | | @RequestMapping("/listAll") |
| | | @ResponseBody |
| | | public List<QueryAppUserVO> listAll(String province, String city,String name, |
| | | String phone,Integer isVip, Integer salesmanUserName){ |
| | | String phone,Integer isVip, String salesmanUserName){ |
| | | QueryAppUser queryAppUser = new QueryAppUser(); |
| | | queryAppUser.setProvince(province); |
| | | queryAppUser.setCity(city); |
| | | queryAppUser.setName(name); |
| | | queryAppUser.setPhone(phone); |
| | | queryAppUser.setIsVip(isVip); |
| | | queryAppUser.setSalesmanUserId(salesmanUserName); |
| | | // queryAppUser.setSalesmanUser(salesmanUserName); |
| | | if (province!=null && (!province.equals(""))){ |
| | | TCity p = cityService.getOne(new QueryWrapper<TCity>().eq("code", province)); |
| | | queryAppUser.setProvince(p.getName()); |
| | |
| | | import com.dsh.course.feignClient.account.model.TCityManager; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.competition.model.*; |
| | | import com.dsh.course.feignClient.course.CourseClient; |
| | | import com.dsh.course.feignClient.course.model.TCoursePackage; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | 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.TCity; |
| | | import com.dsh.guns.modular.system.model.TCourse; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.model.User; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | |
| | | } |
| | | |
| | | |
| | | @Resource |
| | | private CourseClient courseClient; |
| | | @RequestMapping(value = "/timeChange") |
| | | @ResponseBody |
| | | public List<Integer> timeChange(Integer oneId) { |
| | | |
| | | List<Integer> integerList = courseClient.timeChange(oneId); |
| | | return integerList ; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object list(TCityManager manager) { |
| | |
| | | |
| | | |
| | | |
| | | }else { |
| | | Integer id = pointMercharsClient.add(pointsMerchandise); |
| | | } |
| | | return new SuccessTip<>(); |
| | | |
| | |
| | | |
| | | @Override |
| | | public User getByAccount(String account) { |
| | | System.out.println("=====account===="+account); |
| | | return this.baseMapper.getByAccount(account); |
| | | } |
| | | |
| | |
| | | <label class="col-sm-3 control-label">课时数:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="coursePackageConfigId" name="coursePackageConfigId"> |
| | | <option value="">选择课时数</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | }, |
| | | {title: '发放数量', field: 'quantityIssued', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '限领数量', field: 'pickUpQuantity', visible: true, align: 'center', valign: 'middle' |
| | | {title: '限领数量', field: 'hasPickQty', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '已领数量', field: 'hasPickQty', visible: true, align: 'center', valign: 'middle' |
| | | {title: '已领数量', field: 'pickUpQuantity', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '已兑换数量', field: 'hasExchangeQty', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | |
| | | return ; |
| | | } |
| | | |
| | | const quantityIssuedInput = document.getElementById('quantityIssued'); |
| | | const pickUpQuantityInput = document.getElementById('pickUpQuantity'); |
| | | |
| | | const quantityIssued2 = Number(quantityIssuedInput.value); |
| | | const pickUpQuantity2 = Number(pickUpQuantityInput.value); |
| | | |
| | | if (isNaN(quantityIssued2) || isNaN(pickUpQuantity2)) { |
| | | Feng.error("优惠卷数量必须为数字") |
| | | console.log('Both quantityIssued and pickUpQuantity must be numbers.'); |
| | | } else if (quantityIssued2 >= pickUpQuantity2) { |
| | | |
| | | console.log('quantityIssued is greater than pickUpQuantity.'); |
| | | } else { |
| | | |
| | | Feng.error("发放数量必须大于等于限领数量") |
| | | return |
| | | console.log('quantityIssued is not greater than pickUpQuantity.'); |
| | | } |
| | | |
| | | |
| | | |
| | | let typeAll = document.querySelector('input[name="type"]:checked').value; |
| | | if(typeAll==2){ |
| | | let pCode = $("#pCode").val() |
| | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | var selectElement = document.getElementById("coursePackageId"); |
| | | var selectedText = selectElement.options[selectElement.selectedIndex].text; |
| | | |
| | | ajax.set("name",selectedText); |
| | | |
| | | ajax.set("typeAll",typeAll); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | |
| | | Feng.info("请上传实景图") |
| | | return; |
| | | } |
| | | |
| | | |
| | | const quantityIssuedInput = document.getElementById('quantityIssued'); |
| | | const pickUpQuantityInput = document.getElementById('pickUpQuantity'); |
| | | |
| | | const quantityIssued1 = Number(quantityIssuedInput.value); |
| | | const pickUpQuantity1 = Number(pickUpQuantityInput.value); |
| | | |
| | | if (isNaN(quantityIssued1) || isNaN(pickUpQuantity1)) { |
| | | Feng.error("优惠卷数量必须为数字") |
| | | console.log('Both quantityIssued and pickUpQuantity must be numbers.'); |
| | | } else if (quantityIssued1 >= pickUpQuantity1) { |
| | | |
| | | console.log('quantityIssued is greater than pickUpQuantity.'); |
| | | } else { |
| | | |
| | | Feng.error("发放数量必须大于限领数量") |
| | | console.log('quantityIssued is not greater than pickUpQuantity.'); |
| | | } |
| | | var imgOne =""; |
| | | console.log(goodImgs) |
| | | console.log(goodImgs.length) |
| | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | TGoodsInfoDlg.oneChange = function () { |
| | | TGoodsInfoDlg.oneChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/onChange", function(data){ |
| | | if(data!=null){ |
| | |
| | | } |
| | | TGoodsInfoDlg.storeChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/storeChange", function(data){ |
| | | var ajax = new $ax(Feng.ctxPath + "/coursePackage/queryStore", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择门店</option>'; |
| | |
| | | $("#storeId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.set("cityCode",oneId); |
| | | ajax.start(); |
| | | } |
| | | TGoodsInfoDlg.packageChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/packageChange", function(data){ |
| | | var ajax = new $ax(Feng.ctxPath + "/coursePackage/queryCoursePackageLists", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择课包</option>'; |
| | |
| | | }else { |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | $.each(data.rows, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#coursePackageId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.set("coursePackageTypeId",oneId); |
| | | ajax.set("order","desc"); |
| | | ajax.set("offset",0); |
| | | ajax.set("limit",100); |
| | | ajax.start(); |
| | | } |
| | | TGoodsInfoDlg.timeChange = function (e) { |
| | |
| | | var content='<option value="">Pilih franchisee Anda</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.classHours+"</option>"; |
| | | content += "<option value='"+v+"'>"+v+"</option>"; |
| | | }); |
| | | $("#coursePackageConfigId").empty().append(content); |
| | | } |
| | |
| | | try { |
| | | List<Banner> list = bannerService.list(new QueryWrapper<Banner>().eq("position", position).eq("state", 1).orderByAsc("sort")); |
| | | |
| | | List<Banner> list2 = bannerService.list1(position); |
| | | List<BannerVo> list2 = bannerService.list1(position); |
| | | |
| | | List<BannerVo> list1 = new ArrayList<>(); |
| | | for (Banner banner : list2) { |
| | | BannerVo bannerVo = new BannerVo(); |
| | | BeanUtils.copyProperties(banner, bannerVo); |
| | | list1.add(bannerVo); |
| | | } |
| | | return ResultUtil.success(list1); |
| | | // List<BannerVo> list1 = new ArrayList<>(); |
| | | // for (Banner banner : list2) { |
| | | // BannerVo bannerVo = new BannerVo(); |
| | | // BeanUtils.copyProperties(banner, bannerVo); |
| | | // list1.add(bannerVo); |
| | | // } |
| | | return ResultUtil.success(list2); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | |
| | | import com.dsh.other.entity.Banner; |
| | | import com.dsh.other.feignclient.model.AdvertisementChangeStateDTO; |
| | | import com.dsh.other.feignclient.model.AdvertisementQuery; |
| | | import com.dsh.other.model.BannerVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | |
| | |
| | | |
| | | String getFirst(); |
| | | |
| | | List<Banner> list1(Integer position); |
| | | List<BannerVo> list1(Integer position); |
| | | } |
| | |
| | | private String img; |
| | | @ApiModelProperty("跳转页面") |
| | | private String page; |
| | | @ApiModelProperty("名称") |
| | | private String name; |
| | | @ApiModelProperty("跳转类型") |
| | | private String type; |
| | | @ApiModelProperty("跳转页面Id") |
| | | private Integer turnId; |
| | | } |
| | |
| | | import java.util.List; |
| | | import com.dsh.other.entity.CreateHistoryDto; |
| | | import com.dsh.other.entity.GetHistoryDto; |
| | | import com.dsh.other.model.BannerVo; |
| | | |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | String getFirst(); |
| | | |
| | | List<Banner> list1(Integer position); |
| | | List<BannerVo> list1(Integer position); |
| | | } |
| | |
| | | import com.dsh.other.entity.CreateHistoryDto; |
| | | import com.dsh.other.entity.GetHistoryDto; |
| | | import com.dsh.other.mapper.BannerMapper; |
| | | import com.dsh.other.model.BannerVo; |
| | | import com.dsh.other.service.IBannerService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Banner> list1(Integer position) { |
| | | public List<BannerVo> list1(Integer position) { |
| | | return this.bannerMapper.list1(position); |
| | | } |
| | | |
| | |
| | | from t_img_config |
| | | where position = 6 |
| | | </select> |
| | | <select id="list1" resultType="com.dsh.other.entity.Banner"> |
| | | select tb.id as id,tb.img as img, tt.name as page |
| | | <select id="list1" resultType="com.dsh.other.model.BannerVo"> |
| | | select tb.id as id,tb.img as img, tb.page as page,tb.name as name,tb.type as type,tb.typeId as turnId |
| | | from t_banner tb |
| | | left join t_turn tt on tb.jumpPage = tt.id |
| | | where tb.position = #{position} |
| | | |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |