Merge remote-tracking branch 'origin/master'
# Conflicts:
# cloud-server-course/src/main/java/com/dsh/course/entity/TCoursePackagePayment.java
# cloud-server-course/src/main/java/com/dsh/course/mapper/TCoursePackagePaymentMapper.java
# cloud-server-course/src/main/java/com/dsh/course/service/TCoursePackagePaymentService.java
# cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackagePaymentServiceImpl.java
# cloud-server-course/src/main/resources/mapper/TCoursePackagePaymentMapper.xml
# cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TFinanceController.java
# cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/SiteBooking.java
# cloud-server-management/src/main/webapp/WEB-INF/view/system/tCompetition/TCompetition_add.html
# cloud-server-other/src/main/java/com/dsh/other/entity/TGameConfig.java
| | |
| | | package com.dsh.account.controller; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.account.dto.*; |
| | | import com.dsh.account.entity.Coach; |
| | | import com.dsh.account.entity.GiftSearchDto; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.entity.*; |
| | | import com.dsh.account.feignclient.course.CoursePaymentClient; |
| | | import com.dsh.account.feignclient.course.model.TCoursePackagePayment; |
| | | import com.dsh.account.model.QueryDataFee; |
| | | import com.dsh.account.model.StudentVo; |
| | | import com.dsh.account.service.IVipPaymentService; |
| | | import com.dsh.account.service.RechargeRecordsService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.service.TStudentService; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import com.dsh.account.util.TokenUtil; |
| | | import com.dsh.account.util.ToolUtil; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import springfox.documentation.swagger2.mappers.ModelMapper; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | |
| | | @Autowired |
| | | private TokenUtil tokenUtil; |
| | | |
| | | @Autowired |
| | | private TAppUserService appUserService; |
| | | |
| | | @Autowired |
| | | private IVipPaymentService vipPaymentService; |
| | | |
| | | @Autowired |
| | | private RechargeRecordsService rechargeRecordsService; |
| | | |
| | | /** |
| | | * 添加学员 |
| | |
| | | System.out.println("=======giftSelect======selectDtos====>"+list); |
| | | return list; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/student/getUserPt") |
| | | @ResponseBody |
| | | public List<Integer> getUserPt(@RequestBody List<Integer> ids){ |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getInsertType, 1)); |
| | | return list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/student/queryFee") |
| | | public HashMap<String, Object> queryFee(@RequestBody QueryDataFee queryDataFee){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | String data = queryDataFee.getData(); |
| | | List<Integer> ids = queryDataFee.getIds(); |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | LambdaQueryWrapper<VipPayment> vipPaymentLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(data)){ |
| | | String stime = data.split(" - ")[0]+" 00:00:00"; |
| | | String etime = data.split(" - ")[1]+" 23:59:59"; |
| | | vipPaymentLambdaQueryWrapper.between(VipPayment::getInsertTime,stime,etime); |
| | | } |
| | | vipPaymentLambdaQueryWrapper.in(VipPayment::getAppUserId,ids); |
| | | vipPaymentLambdaQueryWrapper.eq(VipPayment::getPayStatus,2); |
| | | List<VipPayment> list = vipPaymentService.list(vipPaymentLambdaQueryWrapper); |
| | | double sum = list.stream().mapToDouble(VipPayment::getAmount).sum(); |
| | | |
| | | map.put("fee1",sum); |
| | | |
| | | LambdaQueryWrapper<RechargeRecords> rechargeRecordsLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(data)){ |
| | | String stime = data.split(" - ")[0]+" 00:00:00"; |
| | | String etime = data.split(" - ")[1]+" 23:59:59"; |
| | | rechargeRecordsLambdaQueryWrapper.between(RechargeRecords::getInsertTime,stime,etime); |
| | | } |
| | | rechargeRecordsLambdaQueryWrapper.in(RechargeRecords::getAppUserId,ids); |
| | | rechargeRecordsLambdaQueryWrapper.eq(RechargeRecords::getPayStatus,2); |
| | | List<RechargeRecords> list1 = rechargeRecordsService.list(rechargeRecordsLambdaQueryWrapper); |
| | | double sum1 = list1.stream().map(RechargeRecords::getAmount).reduce(BigDecimal.ZERO,BigDecimal::add).doubleValue(); |
| | | |
| | | map.put("fee2",sum1); |
| | | |
| | | |
| | | |
| | | |
| | | return map; |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/student/queryUserAge") |
| | | public HashMap<String, Object> queryUserAge(){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | List<TAppUser> list = appUserService.list(new LambdaQueryWrapper<TAppUser>().in(TAppUser::getInsertType, 1)); |
| | | List<Integer> collect = list.stream().map(TAppUser::getId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | List<TStudent> list1 = studentService.list(new LambdaQueryWrapper<TStudent>().in(TStudent::getAppUserId, collect)); |
| | | int age1=0; |
| | | int age2=0; |
| | | int age3=0; |
| | | int age4=0; |
| | | int boy=0; |
| | | int girl=0; |
| | | for (TStudent tStudent : list1) { |
| | | Date birthday = tStudent.getBirthday(); |
| | | long l = DateUtil.betweenYear(birthday, new Date(), true); |
| | | if(l<7){ |
| | | age1++; |
| | | }else if(l>=8 && l<11){ |
| | | age2++; |
| | | }else if(l>=11 && l<=12){ |
| | | age3++; |
| | | }else { |
| | | age4++; |
| | | } |
| | | if(tStudent.getSex()==1){ |
| | | boy++; |
| | | }else { |
| | | girl++; |
| | | } |
| | | } |
| | | map.put("age1",age1); |
| | | map.put("age2",age2); |
| | | map.put("age3",age3); |
| | | map.put("age4",age4); |
| | | map.put("boy",boy); |
| | | map.put("girl",girl); |
| | | return map; |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 添加人id平台管理员id 运营商id |
| | | */ |
| | | @TableField("type") |
| | | @TableField("addUserId") |
| | | private Integer addUserId; |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class RecordAppoint { |
| | | |
| | |
| | | @ApiModelProperty(value = "课状态(1待上课 2已开始 3已完成 4已取消 5已请假 6旷课)") |
| | | private Integer status; |
| | | |
| | | |
| | | private Integer userId; |
| | | |
| | | private Integer siteId; |
| | | |
| | | private List<Integer> ids; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class QueryDataFee { |
| | | private String data; |
| | | |
| | | private List<Integer> ids; |
| | | } |
| | |
| | | import com.dsh.activity.model.CoachChangeStateVO; |
| | | import com.dsh.activity.model.PointMerchandiseIncomeVo; |
| | | import com.dsh.activity.model.PointMerchandiseVo; |
| | | import com.dsh.activity.model.QueryDataFee; |
| | | import com.dsh.activity.model.request.*; |
| | | import com.dsh.activity.model.response.GoodsInfoOneVo; |
| | | import com.dsh.activity.model.response.StoreVos; |
| | |
| | | |
| | | @Resource |
| | | private CouponCityService ccityService; |
| | | |
| | | |
| | | @Resource |
| | | private PointsMerchandiseCityService pmdsCityService; |
| | | |
| | | @Autowired |
| | | private UserPointsMerchandiseService userPointsMerchandiseService; |
| | | |
| | |
| | | public List<PointMerchandiseIncomeVo> getAmount(){ |
| | | return userPointsMerchandiseService.getAmount(); |
| | | } |
| | | |
| | | @Resource |
| | | private PointsMerchandiseCityService pmdsCityService; |
| | | |
| | | |
| | | @ResponseBody |
| | |
| | | |
| | | |
| | | |
| | | |
| | | public int dealTimeStatus(String startTime, String endTime){ |
| | | LocalDate now = LocalDate.now(); |
| | | LocalDate start = LocalDate.parse(startTime); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/getIntegralGoodsListOfSearchAudit") |
| | | public List<Map<String,Object>> getIntegralGoodsListOfSearchAudit(@RequestBody IntegralGoodsOfSearch ofSearch){ |
| | | System.out.println(ofSearch); |
| | | List<Map<String, Object>> mapList = pmdsService.queryGoodsListOfSearchAudit(ofSearch); |
| | | if (mapList.size() > 0){ |
| | | for (Map<String, Object> stringObjectMap : mapList) { |
| | | Integer o = (Integer) stringObjectMap.get("id"); |
| | | String startTime = (String) stringObjectMap.get("startTime"); |
| | | String endTime = (String) stringObjectMap.get("endTime"); |
| | | stringObjectMap.put("timeValue",startTime + "至"+endTime); |
| | | int count1 = upmseService.count(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, o)); |
| | | int count2 = upmseService.count(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId, o) |
| | | .eq(UserPointsMerchandise::getStatus,2)); |
| | | stringObjectMap.put("hasExchangeQty",count1); |
| | | stringObjectMap.put("hasPickQty",count2); |
| | | |
| | | stringObjectMap.put("activeStatus",dealTimeStatus(startTime,endTime)); |
| | | } |
| | | if (ToolUtil.isNotEmpty(ofSearch.getActiveStatus())){ |
| | | mapList = dealTimeData(mapList,ofSearch.getActiveStatus()); |
| | | } |
| | | } |
| | | System.out.println("mapList->"+mapList); |
| | | return mapList; |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/updateType") |
| | | @ResponseBody |
| | | public Object updateType(@RequestBody String s){ |
| | | String[] split = s.split("_"); |
| | | PointsMerchandise byId = pmdsService.getById(split[0]); |
| | | byId.setStatus(Integer.valueOf(split[1])); |
| | | if(Integer.valueOf(split[1])==3){ |
| | | |
| | | byId.setRemark(split[2]); |
| | | } |
| | | return pmdsService.updateById(byId); |
| | | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/queryFee") |
| | | @ResponseBody |
| | | public HashMap<String, Object> queryFee(@RequestBody QueryDataFee queryDataFee){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | String data = queryDataFee.getData(); |
| | | List<Integer> ids = queryDataFee.getIds(); |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | List<PointsMerchandise> list1 = pmdsService.list(new LambdaQueryWrapper<PointsMerchandise>().eq(PointsMerchandise::getRedemptionMethod, 3)); |
| | | LambdaQueryWrapper<UserPointsMerchandise> vipPaymentLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(data)){ |
| | | String stime = data.split(" - ")[0]+" 00:00:00"; |
| | | String etime = data.split(" - ")[1]+" 23:59:59"; |
| | | vipPaymentLambdaQueryWrapper.between(UserPointsMerchandise::getInsertTime,stime,etime); |
| | | } |
| | | vipPaymentLambdaQueryWrapper.in(UserPointsMerchandise::getUserId,ids); |
| | | List<Integer> collect = list1.stream().map(PointsMerchandise::getId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | vipPaymentLambdaQueryWrapper.in(UserPointsMerchandise::getPointsMerchandiseId,collect); |
| | | vipPaymentLambdaQueryWrapper.eq(UserPointsMerchandise::getPayStatus,2); |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | List<UserPointsMerchandise> list = upmseService.list(vipPaymentLambdaQueryWrapper); |
| | | |
| | | double a =0; |
| | | double d =0; |
| | | double m =0; |
| | | double j =0; |
| | | double y =0; |
| | | for (UserPointsMerchandise userPointsMerchandise : list) { |
| | | for (PointsMerchandise pointsMerchandise : list1) { |
| | | if(pointsMerchandise.getId()==userPointsMerchandise.getPointsMerchandiseId()){ |
| | | a += pointsMerchandise.getCash().doubleValue(); |
| | | } |
| | | if(pointsMerchandise.getType()==3){ |
| | | if(pointsMerchandise.getCardType()==1){ |
| | | d += pointsMerchandise.getCash().doubleValue(); |
| | | } |
| | | if(pointsMerchandise.getCardType()==2){ |
| | | m += pointsMerchandise.getCash().doubleValue(); |
| | | } |
| | | if(pointsMerchandise.getCardType()==3){ |
| | | j += pointsMerchandise.getCash().doubleValue(); |
| | | } |
| | | if(pointsMerchandise.getCardType()==4){ |
| | | y += pointsMerchandise.getCash().doubleValue(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | map.put("all",a); |
| | | map.put("day",d); |
| | | map.put("month",m); |
| | | map.put("quarter",j); |
| | | map.put("year",y); |
| | | return map; |
| | | |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | private Integer shelves; |
| | | @TableField("cardType") |
| | | private Integer cardType; |
| | | @TableField("status") |
| | | private Integer status; |
| | | @TableField("remark") |
| | | private String remark; |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | |
| | | @Param("activeStatus") Integer activeStatus, |
| | | @Param("state") Integer state, |
| | | @Param("page") Page<Map<String, Object>> page); |
| | | List<Map<String, Object>> queryGoodsListOfSearchAudit(@Param("name")String name, |
| | | @Param("type")Integer type, |
| | | @Param("redemptionMethod")Integer redemptionMethod, |
| | | @Param("userPopulation") Integer userPopulation, |
| | | @Param("activeStatus") Integer activeStatus, |
| | | @Param("state") Integer state, |
| | | @Param("page") Page<Map<String, Object>> page); |
| | | |
| | | List<Map<String, Object>> ticketList(@Param("query") IntegralGoodsOfSearch ofSearch); |
| | | |
New file |
| | |
| | | package com.dsh.activity.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class QueryDataFee { |
| | | private String data; |
| | | |
| | | private List<Integer> ids; |
| | | } |
| | |
| | | |
| | | void saveCity(Integer id, String province, String provinceCode, String city, String cityCode); |
| | | |
| | | List<Map<String, Object>> queryGoodsListOfSearchAudit(IntegralGoodsOfSearch ofSearch); |
| | | |
| | | List<Map<String, Object>> ticketList(IntegralGoodsOfSearch ofSearch); |
| | | |
| | | Object changeState(CoachChangeStateVO dto); |
| | |
| | | return this.baseMapper.queryGoodsListOfSearch(ofSearch.getName(),ofSearch.getType(),ofSearch.getRedemptionMethod(), |
| | | ofSearch.getUserPopulation(),ofSearch.getActiveStatus(),ofSearch.getState(),ofSearch.getPage()); |
| | | } |
| | | @Override |
| | | public List<Map<String, Object>> queryGoodsListOfSearchAudit(IntegralGoodsOfSearch ofSearch) { |
| | | return this.baseMapper.queryGoodsListOfSearchAudit(ofSearch.getName(),ofSearch.getType(),ofSearch.getRedemptionMethod(), |
| | | ofSearch.getUserPopulation(),ofSearch.getActiveStatus(),ofSearch.getState(),ofSearch.getPage()); |
| | | } |
| | | |
| | | |
| | | @Override |
| | |
| | | pickUpQuantity, |
| | | `sort`, |
| | | shelves |
| | | |
| | | from t_points_merchandise |
| | | where 1 = 1 |
| | | <if test="name != null"> |
| | |
| | | </if> |
| | | order by insertTime desc |
| | | </select> |
| | | <select id="queryGoodsListOfSearchAudit" resultType="java.util.Map"> |
| | | SELECT id, |
| | | `name`, |
| | | `cover`, |
| | | `type`, |
| | | date_format(startTime ,'%Y-%m-%d') as startTime, |
| | | date_format(endTime ,'%Y-%m-%d') as endTime, |
| | | useScope, |
| | | userPopulation, |
| | | quantityIssued, |
| | | pickUpQuantity, |
| | | `sort`, |
| | | shelves, |
| | | status |
| | | from t_points_merchandise |
| | | where type =3 and `status` !=1 |
| | | <if test="name != null"> |
| | | and `name` like concat('%', #{name}, '%') |
| | | </if> |
| | | <if test="type != null"> |
| | | and cardType = #{type} |
| | | </if> |
| | | <if test="redemptionMethod != null"> |
| | | and redemptionMethod = #{redemptionMethod} |
| | | </if> |
| | | <if test="userPopulation != null"> |
| | | and userPopulation = #{userPopulation} |
| | | </if> |
| | | <if test="activeStatus != null"> |
| | | and `status` = #{activeStatus} |
| | | </if> |
| | | order by insertTime desc |
| | | </select> |
| | | <select id="ticketList" resultType="java.util.Map"> |
| | | SELECT id, |
| | | `name`, |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/competition/queryFee") |
| | | public Double queryFee(@RequestBody QueryDataFee queryDataFee){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | String data = queryDataFee.getData(); |
| | | List<Integer> ids = queryDataFee.getIds(); |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | LambdaQueryWrapper<PaymentCompetition> vipPaymentLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(data)){ |
| | | String stime = data.split(" - ")[0]+" 00:00:00"; |
| | | String etime = data.split(" - ")[1]+" 23:59:59"; |
| | | vipPaymentLambdaQueryWrapper.between(PaymentCompetition::getInsertTime,stime,etime); |
| | | } |
| | | vipPaymentLambdaQueryWrapper.in(PaymentCompetition::getAppUserId,ids); |
| | | vipPaymentLambdaQueryWrapper.eq(PaymentCompetition::getPayStatus,2); |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | objects.add(2); |
| | | vipPaymentLambdaQueryWrapper.in(PaymentCompetition::getPayType,objects); |
| | | List<PaymentCompetition> list = paymentCompetitionService.list(vipPaymentLambdaQueryWrapper); |
| | | double sum = list.stream().mapToDouble(PaymentCompetition::getAmount).sum(); |
| | | return sum; |
| | | } |
| | | |
| | | } |
| | | |
New file |
| | |
| | | package com.dsh.competition.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class QueryDataFee { |
| | | private String data; |
| | | |
| | | private List<Integer> ids; |
| | | } |
| | |
| | | import com.dsh.course.service.TCoursePackageService; |
| | | import com.dsh.course.service.TCoursePackageTypeService; |
| | | import com.dsh.course.service.TCourseService; |
| | | import com.dsh.course.util.PageFactory; |
| | | import com.dsh.course.util.PayMoneyUtil; |
| | | import com.dsh.course.util.ResultUtil; |
| | | import com.dsh.course.util.TokenUtil; |
| | | import com.dsh.course.util.*; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Api |
| | | @CrossOrigin |
| | |
| | | public String getHours(@RequestBody Integer coursePackageId1){ |
| | | return coursePackageService.getHours(coursePackageId1); |
| | | } |
| | | |
| | | @PostMapping("/course/queryFee") |
| | | public HashMap<String, Object> queryFee(@RequestBody QueryDataFee queryDataFee){ |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | String data = queryDataFee.getData(); |
| | | List<Integer> ids = queryDataFee.getIds(); |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | |
| | | LambdaQueryWrapper<TCoursePackagePayment> wrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(data)){ |
| | | String stime = data.split(" - ")[0]+" 00:00:00"; |
| | | String etime = data.split(" - ")[1]+" 23:59:59"; |
| | | wrapper.between(TCoursePackagePayment::getInsertTime,stime,etime); |
| | | } |
| | | wrapper.in(TCoursePackagePayment::getAppUserId,ids); |
| | | wrapper.eq(TCoursePackagePayment::getPayStatus,2); |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | objects.add(2); |
| | | objects.add(5); |
| | | objects.add(6); |
| | | wrapper.in(TCoursePackagePayment::getPayType,objects); |
| | | List<TCoursePackagePayment> list = coursePackagePaymentService.list(wrapper); |
| | | double v = list.stream().map(TCoursePackagePayment::getCashPayment).reduce(BigDecimal.ZERO, BigDecimal::add).doubleValue(); |
| | | List<Integer> collect = list.stream().map(TCoursePackagePayment::getCoursePackageId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | // |
| | | List<TCoursePackage> list2 = coursePackageService.list(new LambdaQueryWrapper<TCoursePackage>().in(TCoursePackage::getId, collect)); |
| | | // 课类型 |
| | | List<TCoursePackageType> list1 = coursePackageTypeService.list(); |
| | | |
| | | for (TCoursePackagePayment tCoursePackagePayment : list) { |
| | | for (TCoursePackage tCoursePackage : list2) { |
| | | if(tCoursePackagePayment.getCoursePackageId().equals(tCoursePackage.getId())){ |
| | | tCoursePackagePayment.setType(tCoursePackage.getCoursePackageTypeId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | ArrayList<HashMap<String, Object>> hashMaps = new ArrayList<>(); |
| | | |
| | | for (TCoursePackageType tCoursePackageType : list1) { |
| | | HashMap<String, Object> objectObjectHashMap = new HashMap<>(); |
| | | objectObjectHashMap.put("name",tCoursePackageType.getName()); |
| | | double a= 0; |
| | | for (TCoursePackagePayment tCoursePackagePayment : list) { |
| | | if(tCoursePackagePayment.getType().equals(tCoursePackageType.getId())){ |
| | | a += tCoursePackagePayment.getCashPayment().doubleValue(); |
| | | } |
| | | } |
| | | objectObjectHashMap.put("value",a); |
| | | hashMaps.add(objectObjectHashMap); |
| | | } |
| | | |
| | | HashMap<String, Object> map1 = new HashMap<>(); |
| | | map1.put("fee",v); |
| | | map1.put("data",hashMaps); |
| | | |
| | | return map1; |
| | | } |
| | | } |
| | |
| | | return packagePaymentService.save(packagePayment); |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coursePack/obtainStudentClassDetails") |
| | | public List<RecordAppoint> obtainStudentClassDetailsData(@RequestBody WeeksOfCourseRest stuId){ |
| | | try { |
| | |
| | | return a; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/coursePackagePayment/queryCourseData") |
| | | public List<Map<String,Object>> queryCourseData(@RequestBody List<Integer> ids){ |
| | | // 找出课程类型 找出剩余的课时数 |
| | | List<TCoursePackageType> list = coursePackageTypeService.list(); |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | List<TCoursePackagePayment> list1 = packagePaymentService.listOne(ids); |
| | | List<Integer> collect = list1.stream().map(TCoursePackagePayment::getCoursePackageId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | List<TCoursePackage> list2 = tcpService.list(new LambdaQueryWrapper<TCoursePackage>().in(TCoursePackage::getId, collect)); |
| | | for (TCoursePackagePayment tCoursePackagePayment : list1) { |
| | | for (TCoursePackage tCoursePackage : list2) { |
| | | if(tCoursePackagePayment.getCoursePackageId().equals(tCoursePackage.getId())){ |
| | | tCoursePackagePayment.setType(tCoursePackage.getType()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | List<Map<String,Object>> mapList = new ArrayList<>(); |
| | | for (TCoursePackageType tCoursePackageType : list) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("name",tCoursePackageType.getName()); |
| | | int a =0; |
| | | for (TCoursePackagePayment tCoursePackagePayment : list1) { |
| | | if(tCoursePackagePayment.getType().equals(tCoursePackageType.getId())){ |
| | | a += tCoursePackagePayment.getLaveClassHours(); |
| | | } |
| | | } |
| | | map.put("value",a); |
| | | mapList.add(map); |
| | | } |
| | | |
| | | |
| | | return mapList; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | |
| | | private BigDecimal cashPayment1; |
| | | |
| | | |
| | | @TableField(exist = false) |
| | | private Integer type; |
| | | } |
| | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class RecordAppoint { |
| | | |
| | |
| | | @ApiModelProperty(value = "课状态(1待上课 2已开始 3已完成 4已取消 5已请假 6旷课)") |
| | | private Integer status; |
| | | |
| | | private Integer userId; |
| | | |
| | | private Integer siteId; |
| | | |
| | | private List<Integer> ids; |
| | | |
| | | } |
| | |
| | | List<Map<String, Object>> getStudentTotal(StudentQeryDto studentQeryDto); |
| | | |
| | | List<Map<String, Object>> pacQueryDto(PacQueryDto pacQueryDto); |
| | | |
| | | List<TCoursePackagePayment> listOne(@Param("ids") List<Integer> ids); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class QueryDataFee { |
| | | private String data; |
| | | |
| | | private List<Integer> ids; |
| | | } |
| | |
| | | List<Map<String, Object>> getStudentTotal(StudentQeryDto studentQeryDto); |
| | | |
| | | List<Map<String, Object>> bypac(PacQueryDto pacQueryDto); |
| | | List<TCoursePackagePayment> listOne(List<Integer> ids); |
| | | |
| | | } |
| | |
| | | package com.dsh.course.service.impl; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.alipay.api.domain.Person; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | |
| | | |
| | | |
| | | return maps; |
| | | } |
| | | |
| | | @Override |
| | | public List<TCoursePackagePayment> listOne(List<Integer> ids) { |
| | | return this.baseMapper.listOne(ids); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | TCoursePackage coursePackage = tcpmapper.selectById(tCoursePackagePayment.getCoursePackageId()); |
| | | |
| | | |
| | | recordVo.setUserId(appUserId); |
| | | recordVo.setSiteId(coursePackage.getSiteId()); |
| | | List<Integer> ids = getIds(coursePackage.getSiteId()); |
| | | recordVo.setIds(ids); |
| | | |
| | | recordVo.setCoursePackageName(coursePackage.getName()); |
| | | recordVo.setCourseHours(tCoursePackagePayment.getClassHours()); |
| | | Date date = DateUtil.getDate(); |
| | |
| | | } |
| | | return recordVoList; |
| | | } |
| | | public List<Integer> getIds(Integer siteId) { |
| | | HttpRequest httpRequest = HttpRequest.get("https://try.daowepark.com/v7/user_api/general/get_space_area?space_id=" + siteId); |
| | | HttpResponse execute = httpRequest.execute(); |
| | | String body = execute.body(); |
| | | JSONObject jsonObject = JSONObject.parseObject(body); |
| | | Object data = jsonObject.get("data"); |
| | | JSONArray array = JSONArray.parseArray(data.toString()); |
| | | List<Integer> ids =new ArrayList<>(); |
| | | for (Object o : array) { |
| | | JSONObject jsonObject1 = JSONObject.parseObject(o.toString()); |
| | | Object id = jsonObject1.get("id"); |
| | | Integer integer = Integer.valueOf(id.toString()); |
| | | ids.add(integer); |
| | | } |
| | | return ids; |
| | | |
| | | } |
| | | @Override |
| | | public ResultUtil insertVipPaymentCallback(String code, String orderNumber) { |
| | | TCoursePackagePayment coursePackagePayment = this.baseMapper.getCoursePackagePaymentByCode(code); |
| | |
| | | |
| | | </select> |
| | | |
| | | <select id="listOne" resultType="com.dsh.course.entity.TCoursePackagePayment"> |
| | | select * from t_course_package_payment where appUserId in <foreach collection="ids" separator="," open="(" item="id" close=")">#{id}</foreach> |
| | | </select> |
| | | |
| | | <update id="updateBytime"> |
| | | update t_course_package_payment |
| | |
| | | #¿ª·¢»·¾³ |
| | | datasource.master0.type=com.alibaba.druid.pool.DruidDataSource |
| | | datasource.master0.driverClassName=com.mysql.cj.jdbc.Driver |
| | | datasource.master0.url=jdbc:mysql://8.137.22.229:3306/playpai_course?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.url=jdbc:mysql://192.168.110.80:3306/playpai_course?characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=Asia/Shanghai |
| | | datasource.master0.username=root |
| | | datasource.master0.password=playpai2023! |
| | | datasource.master0.password=123456 |
| | | datasource.master0.maxActive=20 |
| | | datasource.master0.maxWait=60000 |
| | | datasource.master0.minIdle=5 |
| | |
| | | |
| | | import com.dsh.course.dto.CreateHistoryDto; |
| | | import com.dsh.course.dto.GetHistoryDto; |
| | | import com.dsh.course.feignClient.account.model.QueryAppUser; |
| | | import com.dsh.course.feignClient.account.model.QueryAppUserVO; |
| | | import com.dsh.course.feignClient.account.model.*; |
| | | |
| | | import com.dsh.course.dto.StudentSearch; |
| | | import com.dsh.course.dto.TStudentDto; |
| | | import com.dsh.course.feignClient.account.model.QueryByNamePhone; |
| | | import com.dsh.course.feignClient.account.model.TAppUser; |
| | | import com.dsh.course.feignClient.other.model.SiteChangeStateVO; |
| | | import com.dsh.guns.modular.system.model.AdvertisementChangeStateDTO; |
| | | import com.dsh.guns.modular.system.model.AppUserByNameAndPhoneDTO; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | |
| | | @FeignClient("mb-cloud-account") |
| | |
| | | List<GetHistoryDto> getHisory(); |
| | | @PostMapping("/student/giftSelect") |
| | | List<SelectDto> giftSelect(@RequestBody GiftSearchDto giftSearchDto); |
| | | |
| | | @PostMapping("/student/getUserPt") |
| | | List<Integer> getUserPt(List<Integer> ids); |
| | | |
| | | @PostMapping("/student/queryFee") |
| | | HashMap<String, Object> queryFee(QueryDataFee queryDataFee); |
| | | |
| | | @PostMapping("/student/queryUserAge") |
| | | HashMap<String, Object> queryUserAge(); |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.account.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class QueryDataFee { |
| | | private String data; |
| | | |
| | | private List<Integer> ids; |
| | | } |
| | |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.model.QueryDataFee; |
| | | import com.dsh.course.feignClient.activity.model.IntegralGoodsOfSearch; |
| | | import com.dsh.course.feignClient.activity.model.PointMercharsPayedVo; |
| | | import com.dsh.course.feignClient.activity.model.PointMercharsVo; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | @PostMapping("/base/pointMerchars/writeOffGoodsStatus") |
| | | boolean writeOffGoodsStatus(@RequestBody Map<String, Object> map); |
| | | |
| | | @PostMapping("/base/pointMerchars/getIntegralGoodsListOfSearchAudit") |
| | | List<Map<String,Object>> getIntegralGoodsListOfSearchAudit(IntegralGoodsOfSearch ofSearch); |
| | | |
| | | @PostMapping("/base/pointMerchars/updateType") |
| | | Object updateType(String s); |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/queryFee") |
| | | HashMap<String, Object> queryFee(QueryDataFee queryDataFee); |
| | | |
| | | |
| | | } |
| | |
| | | package com.dsh.course.feignClient.competition; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.model.QueryDataFee; |
| | | import com.dsh.course.feignClient.competition.model.*; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | |
| | | @PostMapping("/base/competition/listAudit") |
| | | Page<Competition> listAudit(ListQuery listQuery); |
| | | |
| | | @PostMapping("/base/competition/queryFee") |
| | | Double queryFee(QueryDataFee queryDataFee); |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | package com.dsh.course.feignClient.course; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.model.QueryDataFee; |
| | | import com.dsh.course.feignClient.course.model.CourseChangeStateDTO; |
| | | import com.dsh.course.feignClient.course.model.QueryCourseList; |
| | | import com.dsh.guns.modular.system.model.EditCourseState; |
| | |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | |
| | | @PostMapping("/course/getHours") |
| | | String getHours(Integer coursePackageId1); |
| | | |
| | | |
| | | @PostMapping("/course/queryFee") |
| | | HashMap<String, Object> queryFee(QueryDataFee queryDataFee); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | @PostMapping("/coursePackagePayment/CountqueryByClassId") |
| | | Integer queryByClassId(Integer id); |
| | | |
| | | @PostMapping("/coursePackagePayment/queryCourseData") |
| | | List<Map<String,Object>> queryCourseData(List<Integer> ids); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.guns.modular.system.model.SiteBooking; |
| | | |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.dsh.course.feignClient.account.*; |
| | | import com.dsh.course.feignClient.account.model.CityManager; |
| | | import com.dsh.course.feignClient.account.model.QueryDataFee; |
| | | import com.dsh.course.feignClient.account.model.TAppUser; |
| | | import com.dsh.course.feignClient.account.model.VipPayment; |
| | | import com.dsh.course.feignClient.activity.PointMercharsClient; |
| | |
| | | import com.dsh.course.model.MoneyBack; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import groovyjarjarpicocli.CommandLine; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | private ICityService cityService; |
| | | @Autowired |
| | | private CityManagerClient cityManagerClient; |
| | | |
| | | @Autowired |
| | | private IUserService sysUserService; |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Autowired |
| | | private CourseClient courseClient; |
| | | @Autowired |
| | | private VipPaymentClient vipPaymentClient; |
| | | @Autowired |
| | |
| | | private CoursePackagePaymentClient coursePackagePaymentClient; |
| | | @Autowired |
| | | private CompetitionClient competitionClient; |
| | | |
| | | @Autowired |
| | | private ISiteBookingService siteBookingService; |
| | | @Autowired |
| | | private StoreClient storeClient; |
| | | @Autowired |
| | |
| | | */ |
| | | @RequestMapping("/platform") |
| | | public String index(Model model) { |
| | | Object o = type1(null); |
| | | model.addAttribute("data",o); |
| | | |
| | | |
| | | |
| | | // 教学统计 |
| | | HashMap<String, Object> map = appUserClient.queryUserAge(); |
| | | model.addAttribute("stuData",map); |
| | | |
| | | |
| | | |
| | | return PREFIX + "platformIncome.html"; |
| | | } |
| | | |
| | |
| | | model.addAttribute("objectType",objectType); |
| | | return PREFIX + "storeIncome.html"; |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private ITSiteTypeService siteTypeService; |
| | | |
| | | |
| | | @Autowired |
| | | private ITSiteService siteService; |
| | | |
| | | @RequestMapping("/type1") |
| | | @ResponseBody |
| | | public Object type1(String time) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | // 找出平台的用户 |
| | | List<User> list = sysUserService.list(new LambdaQueryWrapper<User>().eq(User::getObjectType, 1)); |
| | | List<Integer> ids = list.stream().map(User::getId).collect(Collectors.toList()); |
| | | List<Integer> userIds = appUserClient.getUserPt(ids); |
| | | QueryDataFee queryDataFee = new QueryDataFee(time, userIds); |
| | | // 会员费 |
| | | HashMap<String, Object> map1 = appUserClient.queryFee(queryDataFee); |
| | | Object fee1 = map1.get("fee1"); |
| | | |
| | | map.put("fee1",fee1); |
| | | //玩湃比 |
| | | Object fee2 = map1.get("fee2"); |
| | | map.put("fee2",fee2); |
| | | // 课程收入 |
| | | HashMap<String, Object> map3 = courseClient.queryFee(queryDataFee); |
| | | map.put("fee3",map3.get("fee")); |
| | | Object data = map3.get("data"); |
| | | map.put("courseData",data); |
| | | |
| | | |
| | | // 赛事收入 |
| | | Double aDouble1 = competitionClient.queryFee(queryDataFee); |
| | | map.put("fee4",aDouble1); |
| | | |
| | | // 订场 |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | LambdaQueryWrapper<SiteBooking> vipPaymentLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(time)){ |
| | | String stime = time.split(" - ")[0]+" 00:00:00"; |
| | | String etime = time.split(" - ")[1]+" 23:59:59"; |
| | | vipPaymentLambdaQueryWrapper.between(SiteBooking::getInsertTime,stime,etime); |
| | | } |
| | | if(userIds.size()==0){ |
| | | userIds.add(-1); |
| | | } |
| | | vipPaymentLambdaQueryWrapper.in(SiteBooking::getAppUserId,userIds); |
| | | vipPaymentLambdaQueryWrapper.ne(SiteBooking::getStatus,0); |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | objects.add(2); |
| | | vipPaymentLambdaQueryWrapper.in(SiteBooking::getPayType,objects); |
| | | List<SiteBooking> list1 = siteBookingService.list(vipPaymentLambdaQueryWrapper); |
| | | double sum = list1.stream().mapToDouble(SiteBooking::getPayMoney).sum(); |
| | | map.put("fee5",sum); |
| | | |
| | | |
| | | List<Integer> collect = list1.stream().map(SiteBooking::getSiteId).collect(Collectors.toList()); |
| | | if(collect.size()==0){ |
| | | collect.add(-1); |
| | | } |
| | | List<TSite> list3 = siteService.list(new LambdaQueryWrapper<TSite>().in(TSite::getId, collect)); |
| | | for (SiteBooking siteBooking : list1) { |
| | | for (TSite tSite : list3) { |
| | | if(siteBooking.getSiteId().equals(tSite.getId())){ |
| | | siteBooking.setType(tSite.getSiteTypeId()); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | List<TSiteType> list2 = siteTypeService.list(); |
| | | |
| | | List<Map<String,Object>> mapList = new ArrayList<>(); |
| | | |
| | | for (TSiteType tSiteType : list2) { |
| | | HashMap<String, Object> map2 = new HashMap<>(); |
| | | map2.put("name",tSiteType.getName()); |
| | | double a =0; |
| | | for (SiteBooking siteBooking : list1) { |
| | | if(tSiteType.getId().equals(siteBooking.getType())){ |
| | | a += siteBooking.getPayMoney(); |
| | | } |
| | | } |
| | | map2.put("value",a); |
| | | mapList.add(map2); |
| | | } |
| | | map.put("siteData",mapList); |
| | | |
| | | |
| | | // 商品 门票 |
| | | HashMap<String, Object> map2 = pointMercharsClient.queryFee(queryDataFee); |
| | | Object all = map2.get("all"); |
| | | Object day = map2.get("day"); |
| | | Object month = map2.get("month"); |
| | | Object quarter = map2.get("quarter"); |
| | | Object year = map2.get("year"); |
| | | map.put("fee7",all); |
| | | map.put("dayone",day); |
| | | map.put("monthone",month); |
| | | map.put("quarterone",quarter); |
| | | map.put("yearone",year); |
| | | |
| | | return map; |
| | | } |
| | | @RequestMapping("/stuCourseData") |
| | | @ResponseBody |
| | | public Object stuCourseData() { |
| | | ArrayList<Integer> objects = new ArrayList<>(); |
| | | objects.add(1); |
| | | List<Integer> userIds = appUserClient.getUserPt(objects); |
| | | List<Map<String,Object>> list = coursePackagePaymentClient.queryCourseData(userIds); |
| | | ArrayList<Object> objects2 = new ArrayList<>(); |
| | | ArrayList<Object> objects3 = new ArrayList<>(); |
| | | for (Map<String, Object> map : list) { |
| | | Object name = map.get("name"); |
| | | Object value = map.get("value"); |
| | | objects2.add(name); |
| | | objects3.add(value); |
| | | } |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("data1",objects2); |
| | | map.put("data2",objects3); |
| | | return map; |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | |
| | | List<TStore> list2 = storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getCityCode,competition.getCityCode())); |
| | | String[] split = competition.getImgs().split(","); |
| | | ArrayList<String> strings = new ArrayList<>(); |
| | | for (String s : split) { |
| | | strings.add(s); |
| | | } |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2); |
| | | model.addAttribute("imgs",strings); |
| | | model.addAttribute("type",2); |
| | | return PREFIX + "TCompetition_edit.html"; |
| | | } |
| | |
| | | } |
| | | competition.setAuditStatus(1); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | competition.setStartTime(format.parse(competition.getSTime())); |
| | | competition.setEndTime(format.parse(competition.getETime())); |
| | | SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd"); |
| | | competition.setStartTime(format1.parse(competition.getSTime())); |
| | | competition.setEndTime(format1.parse(competition.getETime())); |
| | | competition.setRegisterEndTime(format.parse(competition.getREndTime())); |
| | | competitionClient.add(competition); |
| | | return new SuccessTip<>(); |
| | |
| | | } |
| | | TAppUser tAppUser = appUserClient.queryById(competition.getAppUserId()); |
| | | Competition competition1 = competitionClient.queryById(competition.getCompetitionId()); |
| | | Store store = storeClient.getStoreById(Integer.valueOf(competition1.getStoreId())); |
| | | Store store = storeClient.getStoreById(Integer.valueOf(competition1.getStoreId().split(",")[0])); |
| | | IncomeVO temp = new IncomeVO(); |
| | | temp.setId(competition.getId().intValue()); |
| | | temp.setProvince(tAppUser.getProvince()); |
| | |
| | | |
| | | |
| | | private String PREFIX = "/system/tGoods/"; |
| | | private String PREFIX1 = "/system/tGoodsAudit/"; |
| | | |
| | | |
| | | @Resource |
| | |
| | | public String index(Model model) { |
| | | |
| | | return PREFIX + "TGoods.html"; |
| | | } |
| | | @RequestMapping("/audit") |
| | | public String audit(Model model) { |
| | | return PREFIX1 + "TGoodsAudit.html"; |
| | | } |
| | | |
| | | /** |
| | |
| | | public String storePage(Model model) { |
| | | return PREFIX + "TStoreList.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/updateType") |
| | | @ResponseBody |
| | | public Object updateType(Long id) { |
| | |
| | | System.out.println(ofSearch); |
| | | return pointMercharsClient.getIntegralGoodsListOfSearch(ofSearch); |
| | | } |
| | | @RequestMapping(value = "/listAudit") |
| | | @ResponseBody |
| | | public Object listOfIntegralGoodsAudit(String name, Integer type, Integer redemptionMethod , Integer userPopulation, Integer activeStatus) { |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | |
| | | IntegralGoodsOfSearch ofSearch = new IntegralGoodsOfSearch(); |
| | | ofSearch.setPage(page); |
| | | ofSearch.setName(name); |
| | | ofSearch.setType(type); |
| | | ofSearch.setRedemptionMethod(redemptionMethod); |
| | | ofSearch.setUserPopulation(userPopulation); |
| | | ofSearch.setActiveStatus(activeStatus); |
| | | return pointMercharsClient.getIntegralGoodsListOfSearchAudit(ofSearch); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/updateTypeOne") |
| | | @ResponseBody |
| | | public Object updateTypeOne(Integer id, Integer type, String remark) { |
| | | Object o = pointMercharsClient.updateType(id + "_" + type + "_" + remark); |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | 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.HttpRequestUtil; |
| | | import com.dsh.guns.modular.system.util.ResultUtil; |
| | | import com.sun.org.apache.regexp.internal.RE; |
| | | import groovyjarjarpicocli.CommandLine; |
| | | import net.bytebuddy.asm.Advice; |
| | | import org.aspectj.weaver.ast.Var; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpRequest; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | import java.text.DateFormat; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | |
| | | site.setInsertTime(new Date()); |
| | | site.setState(1); |
| | | siteClient.addSite(site); |
| | | |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("name",site.getName()); |
| | | map.put("short_name",site.getName()); |
| | | map.put("location",city); |
| | | map.put("address",store.getAddress()); |
| | | map.put("telephone",store.getPhone()); |
| | | map.put("linkman",""); |
| | | map.put("business_time","[{\"start_time\":\"00:00\",\"close_time\":\"23:59\"}]"); |
| | | map.put("logo",store.getCoverDrawing()); |
| | | map.put("remark",site.getIntroduce()); |
| | | map.put("lat",store.getLat()); |
| | | map.put("lng",store.getLon()); |
| | | HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map); |
| | | |
| | | return ResultUtil.success("添加成功"); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("name","测试场地"); |
| | | map.put("short_name","测试场地"); |
| | | map.put("location","成都"); |
| | | map.put("address","成都地址"); |
| | | map.put("telephone","17888888888"); |
| | | map.put("linkman","成都"); |
| | | map.put("business_time","[{\"start_time\":\"00:00\",\"close_time\":\"23:59\"}]"); |
| | | map.put("logo","https://we-park-life.oss-cn-beijing.aliyuncs.com/img/f325d449f2634855ad1fb0cc796465e8.png"); |
| | | map.put("remark","场地介绍"); |
| | | map.put("lat","30.670124"); |
| | | map.put("lng","103.929497"); |
| | | String s = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/addSpace", map); |
| | | System.out.println(s); |
| | | } |
| | | |
| | | /** |
| | | * 编辑场地管理 |
| | | */ |
| | |
| | | private Integer goType; |
| | | |
| | | private String money; |
| | | |
| | | @TableField(exist = false) |
| | | private Integer type; |
| | | } |
| | |
| | | package com.dsh.guns.modular.system.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.modular.system.model.SiteBooking; |
| | | public interface ISiteBookingService extends IService<SiteBooking> { |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/7/13 16:49 |
| | | */ |
| | | public interface ISiteBookingService extends IService<SiteBooking> { |
| | | } |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.SiteBookingMapper; |
| | | import com.dsh.guns.modular.system.model.SiteBooking; |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.course.mapper.SiteBookingMapper"> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | @layout("/common/_container.html"){ |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal"> |
| | | |
| | | <input hidden id="day" value="${data.dayone}"> |
| | | <input hidden id="month" value="${data.monthone}"> |
| | | <input hidden id="quarter" value="${data.quarterone}"> |
| | | <input hidden id="year" value="${data.yearone}"> |
| | | <input hidden id="age1" value="${stuData.age1}"> |
| | | <input hidden id="age2" value="${stuData.age2}"> |
| | | <input hidden id="age3" value="${stuData.age3}"> |
| | | <input hidden id="age4" value="${stuData.age4}"> |
| | | <input hidden id="boy" value="${stuData.boy}"> |
| | | <input hidden id="girl" value="${stuData.girl}"> |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-10"> |
| | | <div style="height: 50px;box-sizing: border-box;background:#f3f3f4;line-height: 50px;border:1px solid;margin-bottom: 20px;width: auto"> |
| | |
| | | <div id="div2" class='table1' onclick="getContent(2)" style="border-right: 1px solid #333;">运营统计</div> |
| | | <div id="div3" class='table1' onclick="getContent(3)" style="border-right: 1px solid #333;">教学统计</div> |
| | | </div> |
| | | |
| | | |
| | | <div class="row" id="content1" style="margin-left: 100px;"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | |
| | | </br> |
| | | <div class="col-sm-3" style="width: 400px;display: flex"> |
| | | <#TimeCon id="beginTime" name="时间段:" isTime="false"/> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="搜索" icon="fa-search" clickFun="search1()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-10" style="width: 1500px" > |
| | | </br> |
| | | </br> |
| | | <span>会员费收入:</span> |
| | | <span>玩湃币充值收入:</span> |
| | | <span>课程收入:</span> |
| | | <span>活动收入:</span> |
| | | <span>订场收入:</span> |
| | | <span>赛事收入:</span> |
| | | <span>商品收入:</span> |
| | | <span>其他收入:</span> |
| | | <span>会员费收入:<label id="fee1">${data.fee1}</label></span> |
| | | <span>玩湃币充值收入:<label id="fee2">${data.fee2}</label></span> |
| | | <span>课程收入:<label id="fee3">${data.fee3}</label></span> |
| | | <span>活动/赛事收入:<label id="fee4">${data.fee4}</label></span> |
| | | <span>订场收入:<label id="fee5">${data.fee5}</label></span> |
| | | <span>商品收入:<label id="fee7">${data.fee7}</label></span> |
| | | </br> |
| | | </br> |
| | | </br> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/dataStatistics/echarts.min.js"></script> |
| | | <script src="${ctxPath}/static/js/plugins/switchery/switchery.js"></script> |
| | | <script> |
| | | function search1(){ |
| | | var time = $("#beginTime").val() |
| | | var ajax = new $ax(Feng.ctxPath + "/data/type1", function (data) { |
| | | |
| | | $("#fee1").text(data.fee1) |
| | | $("#fee2").text(data.fee2) |
| | | $("#fee3").text(data.fee3) |
| | | $("#fee4").text(data.fee4) |
| | | $("#fee5").text(data.fee5) |
| | | $("#fee7").text(data.fee7) |
| | | $("#day").val(data.dayone) |
| | | $("#month").val(data.monthone) |
| | | $("#quarter").val(data.quarterone) |
| | | $("#year").val(data.yearone) |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | var chartDom = document.getElementById('cookieTicket'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '门票收入', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: data.dayone, name: '日卡' }, |
| | | { value: data.monthone, name: '月卡' }, |
| | | { value: data.quarterone, name: '季卡' }, |
| | | { value: data.yearone, name: '年卡' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | var chartDom = document.getElementById('cookieCourse'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '课程收入', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: data.courseData, |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | var chartDom = document.getElementById('cookieBooking'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | option = { |
| | | title: { |
| | | text: '订场收入', |
| | | subtext: '', |
| | | left: 'center' |
| | | }, |
| | | tooltip: { |
| | | trigger: 'item' |
| | | }, |
| | | |
| | | series: [ |
| | | { |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: data.siteData, |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | | shadowOffsetX: 0, |
| | | shadowColor: 'rgba(0, 0, 0, 0.5)' |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | |
| | | |
| | | }, function (data) { |
| | | |
| | | }); |
| | | ajax.set("time",time); |
| | | ajax.start(); |
| | | } |
| | | var ans = []; |
| | | var weekX = []; |
| | | var monthX = ["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]; |
| | |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | |
| | | option6 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | |
| | | } |
| | | ] |
| | | }; |
| | | |
| | | |
| | | |
| | | option7 = { |
| | | tooltip: { |
| | | trigger: 'axis' |
| | |
| | | $("#ensure").show(); |
| | | $("#nextB").hide(); |
| | | } |
| | | |
| | | |
| | | if(type==3){ |
| | | var ajax = new $ax(Feng.ctxPath + "/data/stuCourseData", function (data) { |
| | | |
| | | console.log(data.data1) |
| | | var chartDom = document.getElementById('cookieTeachCourse'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | |
| | | option = { |
| | | xAxis: { |
| | | type: 'category', |
| | | data: data.data1, |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: data.data2, |
| | | type: 'bar' |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | }, function (data) { |
| | | |
| | | }); |
| | | ajax.start(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | function getContent1(type){ |
| | | //设置点击字体颜色效果 |
| | |
| | | } |
| | | } |
| | | |
| | | </script> |
| | | <script> |
| | | $(function(){ |
| | | |
| | | var chartDom = document.getElementById('cookieTicket'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | |
| | | option = { |
| | | title: { |
| | | text: '门票收入', |
| | |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '年票' }, |
| | | { value: 735, name: '亲子票' }, |
| | | { value: $("#day").val(), name: '日卡' }, |
| | | { value: $("#month").val(), name: '月卡' }, |
| | | { value: $("#quarter").val(), name: '季卡' }, |
| | | { value: $("#year").val(), name: '年卡' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | |
| | | myChart.setOption(option); |
| | | }); |
| | | $(function(){ |
| | | var courseData = "${data.courseData}" |
| | | courseData =courseData.replace("[","").replace("]","") |
| | | courseData = courseData.split('},') |
| | | |
| | | var a=[]; |
| | | for (let j = 0; j <courseData.length; j++) { |
| | | if(j<courseData.length-1){ |
| | | var d = courseData[j].replace("{","").replace("}","").split(",") |
| | | let obj ={ |
| | | name:d[0].split("=")[1], |
| | | value:d[1].split("=")[1] |
| | | } |
| | | a.push(obj) |
| | | } |
| | | } |
| | | var chartDom = document.getElementById('cookieCourse'); |
| | | var myChart = echarts.init(chartDom); |
| | | var myChart = echarts.init(chartDom) |
| | | |
| | | var option; |
| | | option = { |
| | | title: { |
| | |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '篮球课' }, |
| | | { value: 735, name: '羽毛课' }, |
| | | { value: 735, name: '足球课' }, |
| | | |
| | | ], |
| | | data: a, |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | |
| | | myChart.setOption(option); |
| | | }); |
| | | $(function(){ |
| | | var courseData = "${data.siteData}" |
| | | |
| | | courseData =courseData.replace("[","").replace("]","") |
| | | courseData = courseData.split('},') |
| | | |
| | | var a=[]; |
| | | for (let j = 0; j <courseData.length; j++) { |
| | | if(j<courseData.length-1){ |
| | | var d = courseData[j].replace("{","").replace("}","").split(",") |
| | | let obj ={ |
| | | name:d[0].split("=")[1], |
| | | value:d[1].split("=")[1] |
| | | } |
| | | a.push(obj) |
| | | } |
| | | } |
| | | var chartDom = document.getElementById('cookieBooking'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | |
| | | name: 'Access From', |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '激战' }, |
| | | { value: 735, name: '篮球场' }, |
| | | { value: 735, name: '足球场' }, |
| | | |
| | | ], |
| | | data: a, |
| | | emphasis: { |
| | | itemStyle: { |
| | | shadowBlur: 10, |
| | |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '30-35' }, |
| | | { value: 735, name: '12-18' }, |
| | | { value: 1048, name: '0-7岁' }, |
| | | { value: 735, name: '8-10岁' }, |
| | | { value: 735, name: '11-12岁' }, |
| | | { value: 735, name: '13岁以上' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '30-35' }, |
| | | { value: 735, name: '12-18' }, |
| | | { value: $("#age1").val(), name: '0-7岁' }, |
| | | { value: $("#age2").val(), name: '8-10岁' }, |
| | | { value:$("#age3").val(), name: '11-12岁' }, |
| | | { value: $("#age4").val(), name: '13岁以上' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | |
| | | type: 'pie', |
| | | radius: '50%', |
| | | data: [ |
| | | { value: 1048, name: '男' }, |
| | | { value: 735, name: '女' }, |
| | | { value: $("#boy").val(), name: '男' }, |
| | | { value: $("#girl").val(), name: '女' }, |
| | | |
| | | ], |
| | | emphasis: { |
| | |
| | | }; |
| | | myChart.setOption(option); |
| | | }); |
| | | $(function(){ |
| | | var chartDom = document.getElementById('cookieTeachCourse'); |
| | | var myChart = echarts.init(chartDom); |
| | | var option; |
| | | |
| | | option = { |
| | | xAxis: { |
| | | type: 'category', |
| | | data: ['足球课', '篮球课', '羽毛球课', '网球课', '排球课'] |
| | | }, |
| | | yAxis: { |
| | | type: 'value' |
| | | }, |
| | | series: [ |
| | | { |
| | | data: [120, 200, 150, 80, 70, 110, 130], |
| | | type: 'bar' |
| | | } |
| | | ] |
| | | }; |
| | | myChart.setOption(option); |
| | | function stuCourseData(){ |
| | | |
| | | } |
| | | $(function(){ |
| | | |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | @layout("/common/_container.html"){ |
| | | <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=77b37f0753049c4e712ea79a24e0719c"></script> |
| | | <style> |
| | | .avatar-uploader .el-upload { |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | height: 100px; |
| | | width: 100px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .avatar-uploader .el-upload:hover { |
| | | border-color: #409EFF; |
| | | } |
| | | .avatar-uploader-icon { |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: 100px; |
| | | height: 100px; |
| | | line-height: 100px; |
| | | margin-top: 32px; |
| | | text-align: center; |
| | | } |
| | | .avatar { |
| | | width: 100px; |
| | | height: 100px; |
| | | display: block; |
| | | } |
| | | |
| | | .col-sm-12 { |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .col-sm-12 select { |
| | | height: 33px; |
| | | } |
| | | #app1{ |
| | | margin-left: 255px; |
| | | } |
| | | |
| | | |
| | | </style> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | |
| | |
| | | <div class="form-group" id="shop"> |
| | | <label class="col-sm-3 control-label">举办门店:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="shopId" name="shopId" multiple> |
| | | <select class="form-control" id="shopId" name="shopId"> |
| | | <option value="">选择门店</option> |
| | | </select> |
| | | </div> |
| | |
| | | </div> |
| | | |
| | | <#avatar id="coverDrawing" name="赛事封面(推荐像素:210*280px):" /> |
| | | <#avatar id="imgs" name="赛事图片(推荐像素:780*440px):" /> |
| | | <div class="row" id="app1"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*赛事活动图片(请上传不超过五张图片): </label> |
| | | <div class="col-sm-2" style="width: 100%;margin-left: 11%;margin-top: 1%"> |
| | | <el-upload |
| | | :limit="5" |
| | | class="avatar-uploader" |
| | | action="/tCouponManage/uploadPic" |
| | | list-type="picture-card" |
| | | accept="." |
| | | :on-success="handleAvatarSuccess" |
| | | :on-remove="handleRemove"> |
| | | <i class="el-icon-plus"></i> |
| | | </el-upload> |
| | | <el-dialog :visible.sync="dialogVisible"> |
| | | <img width="100%" :src="imageUrl1" alt=""> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <#avatar id="registrationNotes" name="报名须知(推荐像素:宽780px):" /> |
| | | |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCompetition/tCompetition_info.js"></script> |
| | | <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/css/select2.min.css"> |
| | | <!--<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>--> |
| | | <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.13/js/select2.min.js"></script> |
| | | <script src="${ctxPath}/js/vue/vue.js"></script> |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script> |
| | | $(document).ready(function() { |
| | | $('#shopId').select2({ |
| | | multiple: true, |
| | | closeOnSelect: false |
| | | }); |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '#startTime' |
| | | ,type:"datetime" |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | props: { |
| | | // 数量限制 |
| | | limit: { |
| | | type: Number, |
| | | default: 2 |
| | | }, |
| | | }, |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | console.log(TCarInfoDlg.goodsPicArray1) |
| | | TCarInfoDlg.goodsPicArray1.push(file); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | TCarInfoDlg.goodsPicArray1 = TCarInfoDlg.goodsPicArray1.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | }); |
| | | laydate.render({ |
| | | elem: '#endTime' |
| | | ,type:"datetime" |
| | | ,type:"date" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#startTime' |
| | | ,type:"date" |
| | | }); |
| | | |
| | | laydate.render({ |
| | | elem: '#registerEndTime' |
| | | ,type:"datetime" |
| | | }); |
| | |
| | | @layout("/common/_container.html"){ |
| | | <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=77b37f0753049c4e712ea79a24e0719c"></script> |
| | | <style> |
| | | .avatar-uploader .el-upload { |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | height: 100px; |
| | | width: 100px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .avatar-uploader .el-upload:hover { |
| | | border-color: #409EFF; |
| | | } |
| | | .avatar-uploader-icon { |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: 100px; |
| | | height: 100px; |
| | | line-height: 100px; |
| | | margin-top: 32px; |
| | | text-align: center; |
| | | } |
| | | .avatar { |
| | | width: 100px; |
| | | height: 100px; |
| | | display: block; |
| | | } |
| | | |
| | | .col-sm-12 { |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .col-sm-12 select { |
| | | height: 33px; |
| | | } |
| | | #app1{ |
| | | margin-left: 255px; |
| | | } |
| | | |
| | | |
| | | </style> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | |
| | |
| | | </div> |
| | | |
| | | <#avatar id="coverDrawing" name="赛事封面(推荐像素:210*280px):" avatarImg="${item.coverDrawing}" /> |
| | | <#avatar id="imgs" name="赛事图片(推荐像素:780*440px):" /> |
| | | <div class="row" id="app1"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*实景图片(请上传不超过五张图片): </label> |
| | | <div class="col-sm-2" style="width: 100%;margin-left: 11%;margin-top: 1%"> |
| | | <el-upload |
| | | :limit="5" |
| | | class="avatar-uploader" |
| | | action="/tCouponManage/uploadPic" |
| | | list-type="picture-card" |
| | | accept="." |
| | | :file-list="imageUrl2" |
| | | :on-success="handleAvatarSuccess" |
| | | :on-remove="handleRemove"> |
| | | <i class="el-icon-plus"></i> |
| | | </el-upload> |
| | | <el-dialog :visible.sync="dialogVisible"> |
| | | <img width="100%" :src="imageUrl2" alt=""> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <#avatar id="registrationNotes" name="报名须知(推荐像素:宽780px):" avatarImg="${item.registrationNotes}"/> |
| | | |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCompetition/tCompetition_info.js"></script> |
| | | <script src="${ctxPath}/js/vue/vue.js"></script> |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script> |
| | | let id = "${item.imgs}" |
| | | let obj = [] |
| | | |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | props: { |
| | | // 数量限制 |
| | | limit: { |
| | | type: Number, |
| | | default: 2 |
| | | }, |
| | | }, |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | imageUrl2: [], |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | file.url =file.response |
| | | TCarInfoDlg.goodsPicArray1.push(file); |
| | | }, |
| | | changeImg(){ |
| | | var i = id.split(",") |
| | | for (let j = 0; j <i.length; j++) { |
| | | let obj={ |
| | | fileName:i[j], |
| | | uuid:i[j], |
| | | url:i[j], |
| | | response:i[j], |
| | | } |
| | | this.imageUrl2.push(obj) |
| | | |
| | | } |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | TCarInfoDlg.goodsPicArray1 = TCarInfoDlg.goodsPicArray1.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | this.changeImg() |
| | | TCarInfoDlg.goodsPicArray1 = this.imageUrl2 |
| | | }, |
| | | }); |
| | | |
| | | |
| | | window.onload = function() { |
| | | if($("#type").val()==1){ |
| | | $("#types").html("未开始").css("color","goldenrod") |
| | |
| | | @layout("/common/_container.html"){ |
| | | @layout("/common/_container.html"){ |
| | | <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=77b37f0753049c4e712ea79a24e0719c"></script> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | |
| | | </div> |
| | | |
| | | <#avatar id="coverDrawing" name="赛事封面(推荐像素:210*280px):" avatarImg="${item.coverDrawing}" /> |
| | | <#avatar id="imgs" name="赛事图片(推荐像素:780*440px):" /> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">赛事图片(推荐像素:780*440px):</label> |
| | | <div class="col-sm-4"> |
| | | <div id="imgsPreId"> |
| | | @for(i in imgs){ |
| | | <img width="100px" height="100px" id="img" src="${i}"> |
| | | @} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <#avatar id="registrationNotes" name="报名须知(推荐像素:宽780px):" avatarImg="${item.registrationNotes}"/> |
| | | |
| | | <div class="form-group"> |
| | |
| | | |
| | | <#input id="quantityIssued" name="*兑换地点:" type="text" value="${item.exchangeArea}" readonly="true" /> |
| | | |
| | | @if(item.useScope == 2){ |
| | | @if(item.useScope == 3){ |
| | | <table class="table table-bordered" style="width: 70%;margin-left: 228px;" > |
| | | <thead> |
| | | <tr> |
| | |
| | | </table> |
| | | @} |
| | | |
| | | @if(item.useScope == 3){ |
| | | @if(item.useScope == 2){ |
| | | <table class="table table-bordered" style="width: 70%;margin-left: 228px;" > |
| | | <thead> |
| | | <tr> |
| | | <td>所在省市</td> |
| | | <td>所属账号</td> |
| | | <td>门店名称</td> |
| | | <td>所在省</td> |
| | | <td>所在市</td> |
| | | </tr> |
| | | </thead> |
| | | @for(c in city){ |
| | | <tr> |
| | | <td>${c.num1}</td> |
| | | <td>${c.num2}</td> |
| | | </tr> |
| | | @} |
| | | </table> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="id" value="${item.id}"> |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.oneChange(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}" ${obj.code == item.provinceCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="cityCode"> |
| | | <label class="col-sm-3 control-label">所在市:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="cCode" name="cCode"> |
| | | <option value="">选择市</option> |
| | | @for(obj in list1){ |
| | | <option value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#input id="name" name="管理员姓名" type="text" value="${item.name}"/> |
| | | <#input id="phone" name="管理员手机号" type="text" value="${item.phone}"/> |
| | | |
| | | |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCity/tCity_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#annualInspectionTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#commercialInsuranceTime' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateA' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#nextFixDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#GPSInstallDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | <script type="application/javascript"> |
| | | $(function() { |
| | | var companyType = $("input[name='companyType']:checked").val(); |
| | | if (1 == companyType){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == companyType){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | |
| | | TCarInfoDlg.zcServerClick(); |
| | | TCarInfoDlg.kcServerClick(); |
| | | |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | |
| | | <div class="ibox-title"> |
| | | <h5>门票审核管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="name" name="门票名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="type" name="门票类型"> |
| | | <option value="">全部</option> |
| | | <option value="1">日卡</option> |
| | | <option value="2">月卡</option> |
| | | <option value="3">季卡</option> |
| | | <option value="4">年卡</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="redemptionMethod" name="兑换方式"> |
| | | <option value="">全部</option> |
| | | <option value="1">积分</option> |
| | | <option value="2">现金+积分</option> |
| | | <option value="3">现金</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="userPopulation" name="用户人群"> |
| | | <option value="">全部</option> |
| | | <option value="1">全部用户</option> |
| | | <option value="2">年度会员</option> |
| | | <option value="3">已有学员用户</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="activeStatus" name="审核状态"> |
| | | <option value="">全部</option> |
| | | <option value="2">待审核</option> |
| | | <option value="3">已拒绝</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TPointProducts.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TPointProducts.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TPointProductsTableToolbar" role="group"> |
| | | <#button name="审核" icon="fa-remove" clickFun="TPointProducts.payDetail()" space="true"/> |
| | | <#button name="查看详情" icon="fa-remove" clickFun="TPointProducts.detail()" space="true"/> |
| | | </div> |
| | | <#table id="TPointProductsTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tGoodsAudit/tGoods.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <style> |
| | | .avatar-uploader .el-upload { |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | height: 100px; |
| | | width: 100px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .avatar-uploader .el-upload:hover { |
| | | border-color: #409eff; |
| | | } |
| | | .avatar-uploader-icon { |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: 100px; |
| | | height: 100px; |
| | | line-height: 100px; |
| | | margin-top: 34px; |
| | | text-align: center; |
| | | } |
| | | .avatar { |
| | | width: 100px; |
| | | height: 100px; |
| | | display: block; |
| | | } |
| | | |
| | | .col-sm-12 { |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .col-sm-12 select { |
| | | height: 33px; |
| | | } |
| | | </style> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">商品类型:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="type" value="1" checked onclick="updateType(1)"> 实体商品 |
| | | <input type="radio" name="type" value="2"onclick="updateType(2)" > 课包商品 |
| | | <input type="radio" name="type" value="3" onclick="updateType(1)"> 门票商品 |
| | | </div> |
| | | </div> |
| | | <div id="b1"> |
| | | <#input id="name" name="商品名称" type="text"/> |
| | | <div class="form-group" id="ticket" hidden> |
| | | <label class="col-sm-3 control-label">门票类型:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="cardType" value="1" checked> 日卡 |
| | | <input type="radio" name="cardType" value="2"> 月卡 |
| | | <input type="radio" name="cardType" value="3" > 季卡 |
| | | <input type="radio" name="cardType" value="4" > 年卡 |
| | | </div> |
| | | </div> |
| | | <#input id="price" name="原价" type="text"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">兑换方式:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="redemptionMethod" value="1" onclick="updateMethod(3)" checked> 积分 |
| | | <input type="radio" name="redemptionMethod" value="2" onclick="updateMethod(4)"> 现金+积分 |
| | | <input type="radio" name="redemptionMethod" value="3" onclick="updateMethod(5)"> 现金 |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group" id="y1" hidden> |
| | | <label class="col-sm-3 control-label">所需现金:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="cash" name="cash" type="text"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="y2"> |
| | | <label class="col-sm-3 control-label">所需积分:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="integral" name="integral" type="text"> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <#avatar id="cover" name="商品封面" /> |
| | | |
| | | <div class="row" id="app" > |
| | | <div class="col-sm-6" style="width: 100%"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label" style="width: 15%;margin-left: 7%">*商品图片(请上传不超过五张图片): </label> |
| | | <div class="col-sm-2" style="width: 100%;margin-left: 12%;margin-top: 1%"> |
| | | <el-upload |
| | | :limit="5" |
| | | class="avatar-uploader" |
| | | action="/tCouponManage/uploadPic" |
| | | list-type="picture-card" |
| | | accept=".jpg,.jpeg,.png,.JPG,.JPEG" |
| | | :on-success="handleAvatarSuccess" |
| | | :on-remove="handleRemove"> |
| | | <i class="el-icon-plus"></i> |
| | | </el-upload> |
| | | <el-dialog :visible.sync="dialogVisible"> |
| | | <img width="100%" :src="imageUrl1" alt=""></el-dialog> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">用户人群:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="userPopulation" value="1" checked> 全部用户 |
| | | <input type="radio" name="userPopulation" value="2" > 年度会员 |
| | | <input type="radio" name="userPopulation" value="3" > 已有学员用户 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">发放数量:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="quantityIssued" name="quantityIssued" type="text"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">限领数量:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="pickUpQuantity" name="pickUpQuantity" type="text"> |
| | | </div> |
| | | </div> |
| | | <#input id="startTime" name="有效期" type="text"/> |
| | | |
| | | <div class="row" id="belongsCon" > |
| | | <div class="form-group"> |
| | | <div class="form-group"> |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <label class="col-sm-3">*适用范围: </label> |
| | | <div class="col-sm-2" id="belongsNationwide" > |
| | | <input class="col-sm-1" onclick="scopeOfApplication1()" name="company" type="radio" |
| | | value="1" checked style="margin-top: 10px"/> |
| | | <label class="col-sm-1" style="width: 38%;margin-top: 7px">全国通用</label> |
| | | </div> |
| | | <div class="col-sm-2" id="belongsCity" > |
| | | <input class="col-sm-1" name="company" onclick="scopeOfApplication2()" type="radio" |
| | | value="2" style="margin-top: 10px"/> |
| | | <label class="col-sm-1" style="width: 38%;margin-top: 7px">指定城市</label> |
| | | </div> |
| | | <div class="col-sm-2" id="belongsStore" > |
| | | <input class="col-sm-1" name="company" onclick="scopeOfApplication3()" type="radio" |
| | | value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 38%;margin-top: 6px;">指定门店</label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row" id="citySelect" hidden="hidden"> |
| | | <div class="form-group"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*指定城市: </label> |
| | | <div class="col-sm-9 control-label"> |
| | | <select class="col-sm-1" id="provinceData" style="margin-top: 1%;width: 25%" onchange="changeCity(null)"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | <label class="col-sm-1" style="width: 9%;margin-top: 7px">省</label> |
| | | <select class="col-sm-1" style="margin-top: 1%;width: 25%" id="cityData"> |
| | | <option value="">请选择</option> |
| | | </select> |
| | | <label class="col-sm-1" style="width: 7%;margin-top: 7px">市</label> |
| | | <label name="addBranch" class="col-sm-1" onclick="TGoodsInfoDlg.addBranch()" style="border: 0px;cursor: pointer;margin-top: 1%"><i class="fa fa-plus-circle"></i></label> |
| | | </div> |
| | | <div id="cityDemo"></div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row" id="storeSelect" hidden="hidden"> |
| | | <div class="form-group"> |
| | | <div class="form-group"> |
| | | <div class="col-sm-12"> |
| | | <label class="col-sm-3 control-label">*指定门店: </label> |
| | | <button onclick="storeList()" |
| | | style="height: 22px;width: 82px;background-color: #4a8ff1;color: white;z-index: 15;position:relative;border: none;margin-top: 1%"> |
| | | 选择门店 |
| | | </button> |
| | | </div> |
| | | <div class="col-sm-12" style="margin-left: -57px;margin-top: 20px"> |
| | | <table class="table table-bordered" style="width: 70%;margin-left: 228px;" id="storeTable"> |
| | | <thead> |
| | | <tr> |
| | | <td>所在省市</td> |
| | | <td>所属账号</td> |
| | | <td>门店名称</td> |
| | | <td>操作</td> |
| | | </tr> |
| | | </thead> |
| | | <tbody id="coun"></tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group" style="margin-left:262px"> |
| | | <label class="col-sm-1 control-label">兑换说明:</label> |
| | | <div class="col-sm-5"> |
| | | <textarea type="text/plain" id="editor" style="height: 300px;width: 800px;"></textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="sort" name="sort" type="text"> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="b2" hidden> |
| | | |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TGoodsInfoDlg.oneChange(this)"> |
| | | <option value="">选择省</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="cityCode"> |
| | | <label class="col-sm-3 control-label">所在市:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="cCode" name="cCode" onchange="TGoodsInfoDlg.storeChange(this)"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">所属门店:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="storeId" name="storeId"> |
| | | <option value="">选择门店</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">课包类型:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="coursePackageTypeId" name="pCode" onchange="TGoodsInfoDlg.packageChange(this)"> |
| | | <option value="">选择课包类型</option> |
| | | @for(obj in courseType){ |
| | | <option value="${obj.id}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">课包名称:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="coursePackageId" name="coursePackageId" onchange="TGoodsInfoDlg.timeChange(this)"> |
| | | <option value="">选择课包</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" > |
| | | <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> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">原价:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="price1" name="price" type="text"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">兑换方式:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="redemptionMethod" value="1" checked onclick="updateMethod(1)" > 积分 |
| | | <input type="radio" name="redemptionMethod" value="2" onclick="updateMethod(2)"> 现金+积分 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="y3" hidden> |
| | | <label class="col-sm-3 control-label">所需现金:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="cash1" name="cash" type="text"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="y4"> |
| | | <label class="col-sm-3 control-label">所需积分:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="integral1" name="integral" type="text"> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <#avatar id="cover1" name="*商品封面" /> |
| | | <div class="row" id="app1" > |
| | | <div class="col-sm-6" style="width: 100%"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label" style="width: 15%;margin-left: 7%">*商品图片(请上传不超过五张图片): </label> |
| | | <div class="col-sm-2" style="width: 100%;margin-left: 12%;margin-top: 1%"> |
| | | <el-upload |
| | | :limit="5" |
| | | class="avatar-uploader" |
| | | action="/tCouponManage/uploadPic" |
| | | list-type="picture-card" |
| | | accept=".jpg,.jpeg,.png,.JPG,.JPEG" |
| | | :on-success="handleAvatarSuccess" |
| | | :on-remove="handleRemove"> |
| | | <i class="el-icon-plus"></i> |
| | | </el-upload> |
| | | <el-dialog :visible.sync="dialogVisible"> |
| | | <img width="100%" :src="imageUrl1" alt=""></el-dialog> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">用户人群:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="userPopulation" value="1" checked> 全部用户 |
| | | <input type="radio" name="userPopulation" value="2" > 年度会员 |
| | | <input type="radio" name="userPopulation" value="3" > 已有学员用户 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">发放数量:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="quantityIssued1" name="quantityIssued" type="text"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">限领数量:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="pickUpQuantity1" name="pickUpQuantity" type="text"> |
| | | </div> |
| | | </div> |
| | | <#input id="startTime1" name="有效期" type="text"/> |
| | | |
| | | <div class="form-group" style="margin-left:262px"> |
| | | <label class="col-sm-1 control-label">兑换说明:</label> |
| | | <div class="col-sm-5"> |
| | | <textarea type="text/plain" id="editor1" style="height: 300px;width: 800px;"></textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="sort1" name="sort" type="text"> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TGoodsInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TGoodsInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <script src="${ctxPath}/js/vue/vue.js"></script> |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script src="${ctxPath}/modular/system/tGoods/tGoods_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/tGoods/TStoreInfo.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#startTime', |
| | | range: true |
| | | }); |
| | | laydate.render({ |
| | | elem: '#startTime1', |
| | | range: true |
| | | }); |
| | | function updateMethod(e) { |
| | | console.log(e) |
| | | if(e==1){ |
| | | $("#y3").hide() |
| | | $("#y4").show() |
| | | }else if(e==2){ |
| | | $("#y4").show() |
| | | $("#y3").show() |
| | | }else if(e==3){ |
| | | $("#y1").hide() |
| | | $("#y2").show() |
| | | }else if(e==4){ |
| | | $("#y1").show() |
| | | $("#y2").show() |
| | | }else if(e==5) { |
| | | $("#y2").hide() |
| | | $("#y1").show() |
| | | } |
| | | |
| | | } |
| | | let i =1; |
| | | function updateType(e) { |
| | | |
| | | if(e==2){ |
| | | $("#b1").hide() |
| | | $("#b2").show() |
| | | if(i==1){ |
| | | var drivingLicensePhoto = new $WebUpload("cover1"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | i++; |
| | | } |
| | | $("#ticket").hide() |
| | | }else { |
| | | $("#b2").hide() |
| | | $("#b1").show() |
| | | $("#ticket").show() |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | function changeCity(n){ |
| | | |
| | | var provinceSelect = null; |
| | | if (n === undefined || n === null || n === ''){ |
| | | provinceSelect = document.getElementById("provinceData"); |
| | | }else { |
| | | provinceSelect = document.getElementById("provinceData"+n); |
| | | } |
| | | |
| | | var citySelect = null; |
| | | if (n === undefined || n === null || n === ''){ |
| | | citySelect = document.getElementById("cityData"); |
| | | }else { |
| | | citySelect = document.getElementById("cityData"+n); |
| | | } |
| | | |
| | | var selectedProvince = provinceSelect.value; |
| | | // 清空城市下拉框 |
| | | citySelect.innerHTML = '<option value="">请选择</option>'; |
| | | if (selectedProvince === "") { |
| | | return; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getCity", function(data){ |
| | | data.forEach(province => { |
| | | var option = document.createElement("option"); |
| | | option.value = province.id; // 根据你的数据结构确定省份的id字段 |
| | | option.text = province.name; // 根据你的数据结构确定省份的name字段 |
| | | citySelect.appendChild(option); |
| | | }); |
| | | },function(data){ |
| | | console.log('data:',data) |
| | | Feng.error("获取失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set('province',selectedProvince); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 全国通用 |
| | | */ |
| | | function scopeOfApplication1() { |
| | | $("#storeSelect").hide(); |
| | | $("#citySelect").hide(); |
| | | } |
| | | /** |
| | | * 指定城市 |
| | | */ |
| | | function scopeOfApplication2() { |
| | | $("#storeSelect").hide(); |
| | | $("#citySelect").show(); |
| | | } |
| | | /** |
| | | * 指定门店 |
| | | */ |
| | | function scopeOfApplication3() { |
| | | $("#storeSelect").show(); |
| | | $("#citySelect").hide(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | var vue2 = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | TGoodsInfoDlg.goodsPicArray.push(file); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | TGoodsInfoDlg.goodsPicArray = TGoodsInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | }); |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | TGoodsInfoDlg.goodsPicArray1.push(file); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | TGoodsInfoDlg.goodsPicArray = TGoodsInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <style> |
| | | .avatar-uploader .el-upload { |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | height: 100px; |
| | | width: 100px; |
| | | overflow: hidden; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .avatar-uploader .el-upload:hover { |
| | | border-color: #409eff; |
| | | } |
| | | |
| | | .avatar-uploader-icon { |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: 100px; |
| | | height: 100px; |
| | | line-height: 110px; |
| | | margin-top: 40px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .avatar { |
| | | width: 100px; |
| | | height: 100px; |
| | | display: block; |
| | | } |
| | | |
| | | .col-sm-12 { |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .col-sm-12 select { |
| | | height: 33px; |
| | | } |
| | | </style> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <div id="b1"> |
| | | <#input id="name" name="*商品名称:" type="text" value="${item.name}" readonly="true" /> |
| | | |
| | | <#input id="cover" name="*原价:" avatarImg="${item.price}" readonly="true" /> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*兑换方式:</label> |
| | | <div class="col-sm-4"> |
| | | @if(exchangeMethod == 1){ |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="1" checked style="margin-top: 10px" disabled/> |
| | | <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">全部用户</label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px" disabled/> |
| | | <label class="col-sm-1" style="width: 16%;margin-top: 7px">年度会员</label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px" disabled/> |
| | | <label class="col-sm-1" style="width: 18%;margin-top: 5px">已有学员用户</label> |
| | | @} |
| | | |
| | | @if(exchangeMethod == 2){ |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="1" style="margin-top: 10px" disabled/> |
| | | <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">全部用户</label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="2" checked style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px" disabled/> |
| | | <label class="col-sm-1" style="width: 16%;margin-top: 7px">年度会员</label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px" disabled/> |
| | | <label class="col-sm-1" style="width: 18%;margin-top: 5px">已有学员用户</label> |
| | | @} |
| | | |
| | | @if(exchangeMethod == 3){ |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="1" style="margin-top: 10px" disabled/> |
| | | <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">全部用户</label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px" disabled/> |
| | | <label class="col-sm-1" style="width: 16%;margin-top: 7px">年度会员</label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" |
| | | value="3" checked style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px" disabled/> |
| | | <label class="col-sm-1" style="width: 18%;margin-top: 5px">已有学员用户</label> |
| | | @} |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <#input id="cover" name="*所需现金:" avatarImg="${item.cash}" readonly="true" /> |
| | | <#input id="cover" name="*所需积分:" avatarImg="${item.integral}" readonly="true" /> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*商品封面:</label> |
| | | <div class="col-sm-4"> |
| | | <img height="100px" width="100px" src="${item.cover}"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*商品图片:</label> |
| | | <div class="col-sm-4"> |
| | | @if(pictures != null){ |
| | | @for(im in pictures){ |
| | | <img height="100px" width="100px" src="${im}"> |
| | | @} |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | <#input id="quantityIssued" name="*用户人群:" type="text" value="${item.userPopulation}" readonly="true" /> |
| | | <#input id="quantityIssued" name="*发放数量:" type="text" value="${item.quantityIssued}" readonly="true" /> |
| | | <#input id="quantityIssued" name="*限领数量:" type="text" value="${item.pickUpQuantity}" readonly="true" /> |
| | | <#input id="quantityIssued" name="*已兑换数量:" type="text" value="${item.hasPicked}" readonly="true" /> |
| | | <#input id="quantityIssued" name="*有效期:" type="text" value="${item.validTime}" readonly="true" /> |
| | | |
| | | <#input id="quantityIssued" name="*兑换地点:" type="text" value="${item.exchangeArea}" readonly="true" /> |
| | | |
| | | @if(item.useScope == 3){ |
| | | <table class="table table-bordered" style="width: 70%;margin-left: 228px;" > |
| | | <thead> |
| | | <tr> |
| | | <td>所在省市</td> |
| | | <td>所属账号</td> |
| | | <td>门店名称</td> |
| | | </tr> |
| | | </thead> |
| | | @for(s in store){ |
| | | <td>${s.num1}</td> |
| | | <td>${s.num2}</td> |
| | | <td>${s.num3}</td> |
| | | @} |
| | | </table> |
| | | @} |
| | | |
| | | @if(item.useScope == 2){ |
| | | <table class="table table-bordered" style="width: 70%;margin-left: 228px;" > |
| | | <thead> |
| | | <tr> |
| | | <td>所在省</td> |
| | | <td>所在市</td> |
| | | </tr> |
| | | </thead> |
| | | @for(c in city){ |
| | | <tr> |
| | | <td>${c.num1}</td> |
| | | <td>${c.num2}</td> |
| | | </tr> |
| | | @} |
| | | </table> |
| | | @} |
| | | <div class="form-group" style="margin-left:262px"> |
| | | <label class="col-sm-3 control-label">兑换说明:</label> |
| | | <div class="col-sm-4"> |
| | | <textarea type="text/plain" id="editor" style="height: 300px;width: 800px;" readonly>${item.redemptionInstructions}</textarea> |
| | | </div> |
| | | </div> |
| | | <#input id="quantityIssued" name="*排序:" type="text" value="${item.sort}" readonly="true" /> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TGoodsInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/js/vue/vue.js"></script> |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script src="${ctxPath}/modular/system/tGoods/tGoods_info.js"></script> |
| | | <script> |
| | | var vue2 = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | TGoodsInfoDlg.goodsPicArray.push(file.response); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | TGoodsInfoDlg.goodsPicArray = TGoodsInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <style> |
| | | .avatar-uploader .el-upload { |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | height: 100px; |
| | | width: 100px; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .avatar-uploader .el-upload:hover { |
| | | border-color: #409eff; |
| | | } |
| | | .avatar-uploader-icon { |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: 100px; |
| | | height: 100px; |
| | | line-height: 100px; |
| | | margin-top: 34px; |
| | | text-align: center; |
| | | } |
| | | .avatar { |
| | | width: 100px; |
| | | height: 100px; |
| | | display: block; |
| | | } |
| | | |
| | | .col-sm-12 { |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .col-sm-12 select { |
| | | height: 33px; |
| | | } |
| | | </style> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <input id="s1" value="${item.redemptionMethod}" hidden> |
| | | <input id="s2" value="${item.userPopulation}" hidden> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <#label id="types" name="商品类型" type="text" value="课包商品" /> |
| | | |
| | | <div id="b2" > |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="pCode" name="pCode"> |
| | | <option value="">${item.province}</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="cityCode"> |
| | | <label class="col-sm-3 control-label">所在市:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="cCode" name="cCode" > |
| | | <option value="">${item.city}</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">所属门店:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="storeId" name="storeId"> |
| | | <option value="">${shopName}</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">课包类型:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="coursePackageTypeId" name="pCode" onchange="TGoodsInfoDlg.packageChange(this)"> |
| | | <option value="">${typeName}</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">课包名称:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="coursePackageId" name="coursePackageId" onchange="TGoodsInfoDlg.timeChange(this)"> |
| | | <option value="">${pageName}</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" > |
| | | <label class="col-sm-3 control-label">课时数:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="coursePackageConfigId" name="coursePackageConfigId"> |
| | | <option value="">${classHours}</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">原价:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="price1" name="price" type="text" value="${item.price}" readonly> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">兑换方式:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="redemptionMethod" value="1" checked onclick="updateMethod(1)"> 积分 |
| | | <input type="radio" name="redemptionMethod" value="2" onclick="updateMethod(2)"> 现金+积分 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="y3" hidden> |
| | | <label class="col-sm-3 control-label">所需现金:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="cash1" name="cash" type="text" value="${item.cash}"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="y4"> |
| | | <label class="col-sm-3 control-label">所需积分:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="integral1" name="integral" type="text" value="${item.integral}"> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*商品图片:</label> |
| | | <div class="col-sm-4"> |
| | | <img height="100px" width="100px" src="${item.cover}"> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label head-scu-label">*商品图片:</label> |
| | | <div class="col-sm-4"> |
| | | @for(im in pictures){ |
| | | <img height="100px" width="100px" src="${im}"> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">用户人群:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="userPopulation" value="1" checked> 全部用户 |
| | | <input type="radio" name="userPopulation" value="2" > 年度会员 |
| | | <input type="radio" name="userPopulation" value="3" > 已有学员用户 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">发放数量:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="quantityIssued1" name="quantityIssued" type="text" value="${item.quantityIssued}" readonly> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">限领数量:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="pickUpQuantity1" name="pickUpQuantity" type="text" value="${item.pickUpQuantity}" readonly> |
| | | </div> |
| | | </div> |
| | | <#input id="startTime1" name="有效期" type="text" value="${sTime} - ${eTime}" readonly="true"/> |
| | | |
| | | <div class="form-group" style="margin-left:262px"> |
| | | <label class="col-sm-1 control-label">兑换说明:</label> |
| | | <div class="col-sm-5"> |
| | | <textarea type="text/plain" id="editor1" style="height: 300px;width: 800px;" readonly>${item.redemptionInstructions}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="sort1" name="sort" type="text" value="${item.sort}" readonly> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TGoodsInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | <script src="${ctxPath}/js/vue/vue.js"></script> |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script src="${ctxPath}/modular/system/tGoods/tGoods_info.js"></script> |
| | | <script src="${ctxPath}/modular/system/tGoods/TStoreInfo.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#startTime', |
| | | range: true |
| | | }); |
| | | laydate.render({ |
| | | elem: '#startTime1', |
| | | range: true |
| | | }); |
| | | function updateMethod(e) { |
| | | console.log(e) |
| | | if(e==1){ |
| | | $("#y3").hide() |
| | | $("#y4").show() |
| | | }else if(e==2){ |
| | | $("#y4").show() |
| | | $("#y3").show() |
| | | }else if(e==3){ |
| | | $("#y1").hide() |
| | | $("#y2").show() |
| | | }else if(e==4){ |
| | | $("#y1").show() |
| | | $("#y2").show() |
| | | }else if(e==5) { |
| | | $("#y2").hide() |
| | | $("#y1").show() |
| | | } |
| | | |
| | | } |
| | | let i =1; |
| | | function updateType(e) { |
| | | |
| | | if(e==2){ |
| | | $("#b1").hide() |
| | | $("#b2").show() |
| | | if(i==1){ |
| | | var drivingLicensePhoto = new $WebUpload("cover1"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | i++; |
| | | } |
| | | |
| | | }else { |
| | | $("#b2").hide() |
| | | $("#b1").show() |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | function changeCity(n){ |
| | | |
| | | var provinceSelect = null; |
| | | if (n === undefined || n === null || n === ''){ |
| | | provinceSelect = document.getElementById("provinceData"); |
| | | }else { |
| | | provinceSelect = document.getElementById("provinceData"+n); |
| | | } |
| | | |
| | | var citySelect = null; |
| | | if (n === undefined || n === null || n === ''){ |
| | | citySelect = document.getElementById("cityData"); |
| | | }else { |
| | | citySelect = document.getElementById("cityData"+n); |
| | | } |
| | | |
| | | var selectedProvince = provinceSelect.value; |
| | | // 清空城市下拉框 |
| | | citySelect.innerHTML = '<option value="">请选择</option>'; |
| | | if (selectedProvince === "") { |
| | | return; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getCity", function(data){ |
| | | data.forEach(province => { |
| | | var option = document.createElement("option"); |
| | | option.value = province.id; // 根据你的数据结构确定省份的id字段 |
| | | option.text = province.name; // 根据你的数据结构确定省份的name字段 |
| | | citySelect.appendChild(option); |
| | | }); |
| | | },function(data){ |
| | | console.log('data:',data) |
| | | Feng.error("获取失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set('province',selectedProvince); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 全国通用 |
| | | */ |
| | | function scopeOfApplication1() { |
| | | $("#storeSelect").hide(); |
| | | $("#citySelect").hide(); |
| | | } |
| | | /** |
| | | * 指定城市 |
| | | */ |
| | | function scopeOfApplication2() { |
| | | $("#storeSelect").hide(); |
| | | $("#citySelect").show(); |
| | | } |
| | | /** |
| | | * 指定门店 |
| | | */ |
| | | function scopeOfApplication3() { |
| | | $("#storeSelect").show(); |
| | | $("#citySelect").hide(); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | var vue2 = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | TGoodsInfoDlg.goodsPicArray.push(file); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | couponInfoDlg.goodsPicArray = couponInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | }); |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | TGoodsInfoDlg.goodsPicArray1.push(file); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | couponInfoDlg.goodsPicArray = couponInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | }); |
| | | |
| | | |
| | | window.onload = function(){ |
| | | var OBJradio=document.getElementsByName("redemptionMethod") |
| | | if(OBJradio==1){ |
| | | $("#y4").show() |
| | | $("#y3").hide() |
| | | } |
| | | if(OBJradio==2){ |
| | | $("#y4").show() |
| | | $("#y3").show() |
| | | } |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s1").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("userPopulation") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s2").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <style> |
| | | .avatar-uploader .el-upload { |
| | | border: 1px dashed #d9d9d9; |
| | | border-radius: 6px; |
| | | cursor: pointer; |
| | | position: relative; |
| | | height: 100px; |
| | | width: 100px; |
| | | overflow: hidden; |
| | | display: inline-block; |
| | | } |
| | | |
| | | .avatar-uploader .el-upload:hover { |
| | | border-color: #409eff; |
| | | } |
| | | |
| | | .avatar-uploader-icon { |
| | | font-size: 28px; |
| | | color: #8c939d; |
| | | width: 100px; |
| | | height: 100px; |
| | | line-height: 110px; |
| | | margin-top: 40px; |
| | | text-align: center; |
| | | } |
| | | |
| | | .avatar { |
| | | width: 100px; |
| | | height: 100px; |
| | | display: block; |
| | | } |
| | | |
| | | .col-sm-12 { |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .col-sm-12 select { |
| | | height: 33px; |
| | | } |
| | | </style> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <div id="b1"> |
| | | <input id="goodsId" value="${id}" hidden="hidden"> |
| | | <#input id="name" name="商品名称" type="text" value="${item.name}" readonly="true" /> |
| | | |
| | | <#avatar id="cover" name="商品封面:" avatarImg="${item.cover}" /> |
| | | |
| | | |
| | | <div class="row" id="app" style="margin-left: 225px;"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">商品图片(请上传不超过五张图片): </label> |
| | | <div class="col-sm-2" style="width: 100%;margin-left: 24%;margin-top: 1%"> |
| | | <div class="avatar-uploader" style="display: flex;"> |
| | | @for(im in pictures){ |
| | | <div style="margin-right: 16px;position: relative"> |
| | | <img height="100px" width="100px" src="${im}"> |
| | | <i class="el-icon-delete" onclick="delImg(this)" style="color: red;font-size: 18px;position: absolute;left: 0;right: 0;top: 0;bottom: 0"></i> |
| | | </div> |
| | | @} |
| | | <el-upload |
| | | :limit="5" |
| | | class="avatar-uploader" |
| | | action="/tCouponManage/uploadPic" |
| | | list-type="picture-card" |
| | | accept=".jpg,.jpeg,.png,.JPG,.JPEG" |
| | | :on-success="handleAvatarSuccess" |
| | | :on-remove="handleRemove"> |
| | | <i class="el-icon-plus"></i> |
| | | </el-upload> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">发放数量:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="quantityIssued" name="quantityIssued" type="text" value="${item.quantityIssued}"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">限领数量:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="pickUpQuantity" name="pickUpQuantity" type="text" value="${item.pickUpQuantity}"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" style="margin-left:262px"> |
| | | <label class="col-sm-1 control-label">兑换说明:</label> |
| | | <div class="col-sm-5"> |
| | | <textarea type="text/plain" id="editor" style="height: 300px;width: 800px;">${item.content}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="sort" name="sort" type="text" value="${item.sort}"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TGoodsInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TGoodsInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/js/vue/vue.js"></script> |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script src="${ctxPath}/modular/system/tGoods/tGoods_info.js"></script> |
| | | <script> |
| | | var vue2 = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | TGoodsInfoDlg.goodsPicArray.push(file.response); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | TGoodsInfoDlg.goodsPicArray = TGoodsInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <input id="id" value="${id}" hidden="hidden"> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="name" name="姓名" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="phone" name="联系方式:" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="status" name="状态:"> |
| | | <option value="">全部</option> |
| | | <option value="1">未使用</option> |
| | | <option value="2">已使用</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TPayInfo.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TPayInfo.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TPayInfoTableToolbar" role="group"> |
| | | <#button name="核销" icon="fa-plus" clickFun="TPayInfo.WriteOff()"/> |
| | | </div> |
| | | <#table id="TPayInfoTable"/> |
| | | |
| | | <div style="margin-left: 40%"> |
| | | <button type="button" class="btn btn-info button-margin" onclick="TPayInfo.close()" |
| | | id="submit" style="width: 30%;height: 40px;background: #0d8ddb;color: white;border: none;"> |
| | | <i class="fa fa-check"></i> 关闭 |
| | | </button> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tGoods/tPay_info.js"></script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>所在门店</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <select class="form-control" id="province"> |
| | | <option value="">全部</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <select class="form-control" id="city"> |
| | | <option value="">全部</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="userPopulation" name="所属账号" > |
| | | <option value="">全部</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="storeName" name="门店名称" placeholder="请输入门店名称"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TStoreProvince.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TStoreProvince.resetSearch()"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TStoreProvinceTableToolbar" role="group"> |
| | | </div> |
| | | <#table id="TStoreProvinceTable"/> |
| | | <div style="margin-left: 30%"> |
| | | <button type="button" class="btn btn-info button-margin" onclick="TStoreProvince.storeOfClosePage()" |
| | | id="closePage" style="width: 30%;height: 40px;background: #0d8ddb;color: white;border: none;"> |
| | | <i class="fa fa-check"></i> 关闭 |
| | | </button> |
| | | |
| | | <button type="button" class="btn btn-info button-margin" onclick="TStoreProvince.saveSelectStores()" |
| | | id="submit" style="margin-left: 5%;width: 30%;height: 40px;background: #0d8ddb;color: white;border: none;"> |
| | | <i class="fa fa-check"></i> 保存 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tGoods/TStoreInfo.js"></script> |
| | | <script src="${ctxPath}/modular/system/tGoods/TCouponInfo.js"></script> |
| | | @} |
| | |
| | | var language=1; |
| | | var TCarInfoDlg = { |
| | | tCarInfoData : {}, |
| | | goodsPicArray1:[], |
| | | validateFields: { |
| | | carBrandId: { |
| | | validators: { |
| | |
| | | return; |
| | | } |
| | | |
| | | var goodImgs = TCarInfoDlg.goodsPicArray1; |
| | | if(goodImgs.length==0){ |
| | | Feng.info("请上传赛事活动图片") |
| | | return; |
| | | } |
| | | var imgOne =""; |
| | | for (let i = 0; i <goodImgs.length; i++) { |
| | | if(i==goodImgs.length-1){ |
| | | imgOne += (goodImgs[i].response) |
| | | }else { |
| | | imgOne+=(goodImgs[i].response+",") |
| | | } |
| | | |
| | | } |
| | | |
| | | var coverDrawing = $("#coverDrawing").val(); |
| | | var coverDrawing = $("#coverDrawing").val(); |
| | | var registrationNotes = $("#registrationNotes").val() |
| | |
| | | ajax.set("realName",realName); |
| | | ajax.set("coverDrawing",coverDrawing); |
| | | ajax.set("introduction",introduction); |
| | | ajax.set("imgs",introduction); |
| | | ajax.set("imgs",imgOne); |
| | | ajax.set("registrationNotes",registrationNotes); |
| | | ajax.set("longitude", $("#longitude").val()); |
| | | ajax.set("latitude", $("#latitude").val()); |
| | |
| | | return; |
| | | } |
| | | var registerEndTime = $("#registerEndTime").val(); |
| | | let registerCondition = document.querySelector('input[name="registerCondition"]:checked').value; |
| | | var startAge = $("#startAge").val(); |
| | | var endAge = $("#endAge").val(); |
| | | var cashPrice = $("#cashPrice").val(); |
| | |
| | | Feng.info("请输入赛事简介"); |
| | | return; |
| | | } |
| | | |
| | | var goodImgs = TCarInfoDlg.goodsPicArray1; |
| | | |
| | | if(goodImgs.length==0){ |
| | | Feng.info("请上传赛事活动图片") |
| | | return; |
| | | } |
| | | var imgOne =""; |
| | | console.log(goodImgs) |
| | | console.log(goodImgs.length) |
| | | for (let i = 0; i <goodImgs.length; i++) { |
| | | console.log(goodImgs[i].response,11) |
| | | if(i==goodImgs.length-1){ |
| | | imgOne += (goodImgs[i].response) |
| | | }else { |
| | | imgOne+=(goodImgs[i].response+",") |
| | | } |
| | | |
| | | } |
| | | console.log(imgOne) |
| | | |
| | | var coverDrawing = $("#coverDrawing").val(); |
| | | var coverDrawing = $("#coverDrawing").val(); |
| | |
| | | ajax.set("sTime",startTime); |
| | | ajax.set("eTime",endTime); |
| | | ajax.set("rEndTime",registerEndTime); |
| | | ajax.set("registerCondition",registerCondition); |
| | | ajax.set("startAge",startAge); |
| | | ajax.set("endAge",endAge); |
| | | ajax.set("cashPrice",cashPrice); |
| | |
| | | ajax.set("realName",realName); |
| | | ajax.set("coverDrawing",coverDrawing); |
| | | ajax.set("introduction",introduction); |
| | | ajax.set("imgs",introduction); |
| | | ajax.set("imgs",imgOne); |
| | | ajax.set("registrationNotes",registrationNotes); |
| | | ajax.set("longitude", $("#longitude").val()); |
| | | ajax.set("latitude", $("#latitude").val()); |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TStoreProvince = { |
| | | id: "TStoreProvinceTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1, |
| | | storeList: [] |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TStoreProvince.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', checkbox: true}, |
| | | {title: '选择', field: '', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '所属账号', field: 'accountName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所在省市', field: 'provinceCity', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '门店名称', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TStoreProvince.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TStoreProvince.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | |
| | | TStoreProvince.storeOfClosePage = function (){ |
| | | parent.layer.close(parent.layer.getFrameIndex(window.frameElement.id)); |
| | | } |
| | | |
| | | TStoreProvince.saveSelectStores = function (){ |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if (selected.length == 0) { |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | } |
| | | var arr = []; |
| | | console.log('selected--->',selected) |
| | | for(var i in selected){ |
| | | if(typeof selected[i].id != "undefined"){ |
| | | arr.push({ |
| | | id: selected[i].id, |
| | | provinceCity: typeof selected[i].provinceCity != "undefined" ? selected[i].provinceCity : "", |
| | | accountName: typeof selected[i].accountName != "undefined" ? selected[i].accountName : "", |
| | | name: typeof selected[i].name != "undefined" ? selected[i].name : "" |
| | | }) |
| | | } |
| | | } |
| | | window.parent.TCarInfoDlg.selecUserOpt(arr); |
| | | TStoreProvince.storeOfClosePage(); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TStoreProvince.search = function () { |
| | | var queryData = {}; |
| | | |
| | | var provinceElement = document.getElementById("province"); |
| | | var provinceId = provinceElement.value; |
| | | |
| | | var cityElement = document.getElementById("city"); |
| | | var cityElementId = cityElement.value; |
| | | |
| | | queryData['provinceId'] = provinceId; |
| | | queryData['cityId'] = cityElementId; |
| | | queryData['cityManagerId'] = $("#userPopulation").val(); |
| | | queryData['storeName'] = $("#storeName").val(); |
| | | TStoreProvince.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 重置搜索 |
| | | */ |
| | | TStoreProvince.resetSearch = function () { |
| | | var provinceSelect = document.getElementById("province"); |
| | | provinceSelect.innerHTML = '<option value="">全部</option>'; |
| | | |
| | | var citySelect = document.getElementById("city"); |
| | | citySelect.innerHTML = '<option value="">全部</option>'; |
| | | |
| | | queryProvince(); |
| | | |
| | | $("#userPopulation").val(''); |
| | | $("#storeName").val(''); |
| | | TStoreProvince.search(); |
| | | }; |
| | | |
| | | function queryProvince(){ |
| | | // 发送AJAX请求到后台获取省份数据 |
| | | // 假设后台返回的数据格式为一个包含省份ID和名称的数组 |
| | | var provinceSelect = document.getElementById("province"); |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getProvince", function(data){ |
| | | data.forEach(province => { |
| | | var option = document.createElement("option"); |
| | | option.value = province.id; // 根据你的数据结构确定省份的id字段 |
| | | option.text = province.name; // 根据你的数据结构确定省份的name字段 |
| | | provinceSelect.appendChild(option); |
| | | }); |
| | | },function(data){ |
| | | Feng.error("下拉失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.start(); |
| | | provinceSelect.addEventListener("change", queryCity); |
| | | } |
| | | |
| | | |
| | | // 获取城市数据 |
| | | function queryCity() { |
| | | var selectedProvinceId = this.value; // 获取选择的省份ID |
| | | // 发送AJAX请求到后台获取对应省份的城市数据 |
| | | // 假设后台返回的数据格式为一个包含城市ID和名称的数组 |
| | | |
| | | var citySelect = document.getElementById("city"); |
| | | citySelect.innerHTML = ""; |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getCity", function(data){ |
| | | data.forEach(province => { |
| | | var option = document.createElement("option"); |
| | | option.value = province.id; // 根据你的数据结构确定省份的id字段 |
| | | option.text = province.name; // 根据你的数据结构确定省份的name字段 |
| | | citySelect.appendChild(option); |
| | | }); |
| | | },function(data){ |
| | | console.log('data:',data) |
| | | Feng.error("获取失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set('province',selectedProvinceId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function () { |
| | | var defaultColunms = TStoreProvince.initColumn(); |
| | | var table = new BSTable(TStoreProvince.id, "/tCouponManage/storeDetailsOfSearch", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TStoreProvince.table = table.init(); |
| | | |
| | | queryProvince(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var TPointProducts = { |
| | | id: "TPointProductsTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TPointProducts.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '商品名称', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '兑换地点', field: 'useScope', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "全国", 2: "指定城市", 3: "指定门店"}[value] |
| | | } |
| | | }, |
| | | {title: '用户人群', field: 'userPopulation', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "全部用户", 2: "年度会员", 3: "已有学员用户"}[value] |
| | | } |
| | | }, |
| | | {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: 'hasExchangeQty', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '排序', field: 'sort', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '审核状态', field: 'status', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return { 2: "待审核", 3: "已拒绝"}[value] |
| | | } |
| | | }, |
| | | |
| | | ]; |
| | | }; |
| | | function currentTime(timestamp){ |
| | | var time = timestamp + ''; |
| | | if(time.length != 13){ |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp);; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D + h + m + s; |
| | | return strDate |
| | | } |
| | | |
| | | function currentTime1(timestamp){ |
| | | var time = timestamp + ''; |
| | | if(time.length != 13){ |
| | | timestamp = timestamp * 1000; |
| | | } |
| | | var date = new Date(timestamp);; |
| | | var Y = date.getFullYear() + '-'; |
| | | var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'; |
| | | var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' '; |
| | | |
| | | var h = (date.getHours() < 10 ? '0' + (date.getHours()) : date.getHours()) + ':'; |
| | | var m = (date.getMinutes() < 10 ? '0' + (date.getMinutes()) : date.getMinutes()) + ':'; |
| | | var s = (date.getSeconds() < 10 ? '0' + (date.getSeconds()) : date.getSeconds()); |
| | | var strDate = Y + M + D ; |
| | | return strDate |
| | | } |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TPointProducts.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TPointProducts.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 添加 |
| | | */ |
| | | TPointProducts.openAddTPointProducts = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tGoods/tGoods_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 查看详情 |
| | | */ |
| | | TPointProducts.detail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tGoods/goods_info/' + TPointProducts.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 购买详情 |
| | | */ |
| | | TPointProducts.payDetail = function () { |
| | | if (this.check()) { |
| | | layer.open({ |
| | | type: 1 |
| | | , title: '审核' |
| | | , area: ['50%', '50%'] |
| | | , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset |
| | | , id: 'layerDemo' //防止重复弹出cge |
| | | , content: '<div class="form-horizontal">' + |
| | | ' <div class="col-sm-11" style="margin-top: 30px">' + |
| | | ' <div class="col-sm-11">' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">审核状态:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input type="radio" name="type1" value="1" checked>通过 <input type="radio" name="type1" value="3">拒绝\n' + |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">拒绝理由:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <textarea id="remark" style="height: 193px; width: 368px;"></textarea>\n' + |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>' |
| | | , btn: ['保存', '取消'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | , yes: function () { |
| | | var OBJradio= $("input[name='type1']:checked").val(); |
| | | console.log(OBJradio) |
| | | let remark = $("#remark").val() |
| | | console.log(remark) |
| | | if(OBJradio==3){ |
| | | if(remark==''){ |
| | | Feng.info("请输入拒绝理由") |
| | | return; |
| | | } |
| | | } |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tGoods/updateTypeOne", function (data) { |
| | | if (data.code == 200) { |
| | | Feng.success("操作成功!"); |
| | | TPointProducts.table.refresh(); |
| | | window.parent.layer.closeAll(); |
| | | } else { |
| | | return Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | return Feng.error("操作失败!"); |
| | | }); |
| | | ajax.set("id",TPointProducts.seItem.id) |
| | | ajax.set("type",OBJradio) |
| | | ajax.set("remark",remark) |
| | | ajax.start(); |
| | | layer.closeAll(); |
| | | }, |
| | | }); |
| | | |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 编辑页面 |
| | | */ |
| | | TPointProducts.openEditPage = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tGoods/tGoods_update/' + TPointProducts.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 上下架处理 |
| | | * @param m |
| | | */ |
| | | TPointProducts.grounding = function (m) { |
| | | console.log('m:',m); |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tGoods/grounding", function (data) { |
| | | Feng.success("操作成功!"); |
| | | TPointProducts.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("操作失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.set("type",m); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TPointProducts.search = function () { |
| | | var queryData = {}; |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['type'] = $("#type").val(); |
| | | queryData['redemptionMethod'] = $("#redemptionMethod").val(); |
| | | queryData['userPopulation'] = $("#userPopulation").val(); |
| | | queryData['activeStatus'] = $("#activeStatus").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | TPointProducts.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TPointProducts.resetSearch = function () { |
| | | $("#name").val(""); |
| | | $("#type").val(""); |
| | | $("#redemptionMethod").val(""); |
| | | $("#userPopulation").val(""); |
| | | $("#activeStatus").val(""); |
| | | $("#state").val(""); |
| | | TPointProducts.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TPointProducts.initColumn(); |
| | | var table = new BSTable(TPointProducts.id, "/tGoods/listAudit", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TPointProducts.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 初始化车辆管理详情对话框 |
| | | */ |
| | | var language=1; |
| | | var TGoodsInfoDlg = { |
| | | tGoodsInfoData : {}, |
| | | validateFields: { |
| | | }, |
| | | goodsPicArray:[], |
| | | goodsPicArray1:[], |
| | | storeIds: [], |
| | | |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TGoodsInfoDlg.validate = function () { |
| | | $('#carInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#carInfoForm').bootstrapValidator('validate'); |
| | | return $("#carInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TGoodsInfoDlg.clearData = function() { |
| | | this.tGoodsInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TGoodsInfoDlg.set = function(key, val) { |
| | | this.tGoodsInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TGoodsInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TGoodsInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TPointProducts.layerIndex); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TGoodsInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('isPlatCar') |
| | | .set('companyId') |
| | | .set('franchiseeId') |
| | | .set('carColor') |
| | | .set('carModelId') |
| | | .set('carBrandId') |
| | | .set('carLicensePlate') |
| | | .set('carPhoto') |
| | | .set('drivingLicenseNumber') |
| | | .set('drivingLicensePhoto') |
| | | .set('annualInspectionTime') |
| | | .set('commercialInsuranceTime') |
| | | .set('createTime') |
| | | .set('state') |
| | | .set('addType') |
| | | .set('addObjectId') |
| | | .set('plateColor') |
| | | .set('vehicleType') |
| | | .set('ownerName') |
| | | .set('engineId') |
| | | .set('VIN') |
| | | .set('certifyDateA') |
| | | .set('fuelType') |
| | | .set('engineDisplace') |
| | | .set('certificate') |
| | | .set('transAgency') |
| | | .set('transArea') |
| | | .set('transDateStart') |
| | | .set('transDateStop') |
| | | .set('certifyDateB') |
| | | .set('fixState') |
| | | .set('nextFixDate') |
| | | .set('checkState') |
| | | .set('feePrintId') |
| | | .set('GPSBrand') |
| | | .set('GPSModel') |
| | | .set('GPSIMEI') |
| | | .set('GPSInstallDate') |
| | | .set('registerDate') |
| | | .set('commercialType'); |
| | | } |
| | | function storeList(){ |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '门店列表', |
| | | area: ['80%', '80%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tGoods/storeList' |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | TGoodsInfoDlg.selecUserOpt = function (arrays){ |
| | | console.log(arrays) |
| | | //获取所有的值 |
| | | var subArr= this.storeIds; |
| | | $(".timeClass").each(function () { |
| | | subArr.push($(this).find("input[name*='id']").val()); |
| | | }); |
| | | var str = ''; |
| | | for(var i in arrays){ |
| | | var b = true; |
| | | for(var j in subArr){ |
| | | if(arrays[i].id === Number(subArr[j])){ |
| | | b = false; |
| | | break |
| | | } |
| | | } |
| | | if(b){ |
| | | this.storeIds.push(arrays[i].id) |
| | | str += '<tr class="timeClass">' + |
| | | '<td><input type="hidden" id="id" name="id" value="'+arrays[i].id+'"><input type="hidden" id="provinceCity" name="provinceCity" value="'+arrays[i].provinceCity+'">' + arrays[i].provinceCity + '</td>' + |
| | | '<td><input type="hidden" id="accountName" name="accountName" value="'+arrays[i].accountName+'">' + arrays[i].accountName + '</td>' + |
| | | '<td><input type="hidden" id="name" name="name" value="'+arrays[i].name+'">' + arrays[i].name + '</td><td><button onclick="deleteSub(this)">移除</button></td></tr>'; |
| | | } |
| | | } |
| | | $("#coun").append(str); |
| | | console.log('storeIds',this.storeIds) |
| | | } |
| | | function deleteSub(e) { |
| | | console.log(e); |
| | | var row = $(e).closest('tr'); |
| | | var value = row.find('#id').val(); |
| | | TGoodsInfoDlg.storeIds.splice(TGoodsInfoDlg.storeIds.indexOf(parseInt(value)), 1) |
| | | $(e).parent().parent().remove(); |
| | | console.log('storeIds',TGoodsInfoDlg.storeIds) |
| | | } |
| | | TGoodsInfoDlg.delete = function (o) { |
| | | $(o).parent("div").remove() |
| | | } |
| | | var num = 0; |
| | | TGoodsInfoDlg.addBranch = function () { |
| | | num=num+1; |
| | | var a= ""; |
| | | a = "<div style=\'margin-left: 25%\' class=\"col-sm-9 control-label\">\n" + |
| | | " <select class=\"col-sm-1\" id=\'provinceData"+num+"\' style=\"margin-top: 1%;width: 25%\" onchange=\'changeCity("+num+")\'>\n" + |
| | | " <option value=\"\">请选择</option>\n" + |
| | | " </select>\n" + |
| | | " <label class=\"col-sm-1\" style=\"width: 9%;margin-top: 7px\">省</label>\n" + |
| | | " <select class=\"col-sm-1\" style=\"margin-top: 1%;width: 25%\" id=\'cityData"+num+"\'>\n" + |
| | | " <option value=\"\">请选择</option>\n" + |
| | | " </select>\n" + |
| | | " <label class=\"col-sm-1\" style=\"width: 7%;margin-top: 7px\">市</label>\n" + |
| | | " <label name=\"addBranch\" class=\"col-sm-1\" onclick=\"TGoodsInfoDlg.delete(this)\" style=\"border: 0px;cursor: pointer;margin-top: 1%\"><i class=\"fa fa-trash\"></i></label>"+ |
| | | " </div>"; |
| | | $("#cityDemo").append($(a)); |
| | | getProvince(num); |
| | | } |
| | | function changeCity(n){ |
| | | |
| | | var provinceSelect = null; |
| | | if (n === undefined || n === null || n === ''){ |
| | | provinceSelect = document.getElementById("provinceData"); |
| | | }else { |
| | | provinceSelect = document.getElementById("provinceData"+n); |
| | | } |
| | | |
| | | var citySelect = null; |
| | | if (n === undefined || n === null || n === ''){ |
| | | citySelect = document.getElementById("cityData"); |
| | | }else { |
| | | citySelect = document.getElementById("cityData"+n); |
| | | } |
| | | |
| | | var selectedProvince = provinceSelect.value; |
| | | // 清空城市下拉框 |
| | | citySelect.innerHTML = '<option value="">请选择</option>'; |
| | | if (selectedProvince === "") { |
| | | return; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getCity", function(data){ |
| | | data.forEach(province => { |
| | | var option = document.createElement("option"); |
| | | option.value = province.id; // 根据你的数据结构确定省份的id字段 |
| | | option.text = province.name; // 根据你的数据结构确定省份的name字段 |
| | | citySelect.appendChild(option); |
| | | }); |
| | | },function(data){ |
| | | console.log('data:',data) |
| | | Feng.error("获取失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set('province',selectedProvince); |
| | | ajax.start(); |
| | | } |
| | | function getProvince(n){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/getProvince", function(data){ |
| | | console.log(data) |
| | | var provinceSelect = null; |
| | | if (n === undefined || n === null || ''){ |
| | | provinceSelect = document.getElementById("provinceData"); |
| | | }else { |
| | | provinceSelect = document.getElementById("provinceData"+n); |
| | | } |
| | | data.forEach(province => { |
| | | var option = document.createElement("option"); |
| | | option.value = province.id; // 根据你的数据结构确定省份的id字段 |
| | | option.text = province.name; // 根据你的数据结构确定省份的name字段 |
| | | provinceSelect.appendChild(option); |
| | | }); |
| | | },function(data){ |
| | | Feng.error("下拉失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.start(); |
| | | } |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TGoodsInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | let typeAll = document.querySelector('input[name="type"]:checked').value; |
| | | if(typeAll==2){ |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | let storeId = $("#storeId").val() |
| | | if(storeId==''){ |
| | | Feng.info("请选择门店") |
| | | return; |
| | | } |
| | | let coursePackageTypeId = $("#coursePackageTypeId").val() |
| | | if(coursePackageTypeId==''){ |
| | | Feng.info("请选择课包类型") |
| | | return; |
| | | } |
| | | let coursePackageId = $("#coursePackageId").val() |
| | | if(coursePackageId==''){ |
| | | Feng.info("请选择课包") |
| | | return; |
| | | } |
| | | let coursePackageConfigId = $("#coursePackageConfigId").val() |
| | | if(coursePackageConfigId==''){ |
| | | Feng.info("请选择课时数") |
| | | return; |
| | | } |
| | | let price = $("#price1").val() |
| | | if(price==''){ |
| | | Feng.info("请填写原价") |
| | | return; |
| | | } |
| | | let type = document.querySelector('input[name="redemptionMethod"]:checked').value; |
| | | if(type==''){ |
| | | Feng.info("请选择兑换方式") |
| | | return; |
| | | } |
| | | let integral=''; |
| | | let cash=''; |
| | | if(type==1){ |
| | | integral = $("#integral1").val() |
| | | if(integral==''){ |
| | | Feng.info("请填写所需积分") |
| | | return; |
| | | } |
| | | } |
| | | if(type==2){ |
| | | integral = $("#integral1").val() |
| | | if(integral==''){ |
| | | Feng.info("请填写所需积分") |
| | | return; |
| | | } |
| | | cash = $("#cash1").val() |
| | | if(cash==''){ |
| | | Feng.info("请填写所需现金") |
| | | return; |
| | | } |
| | | } |
| | | |
| | | let cover1 = $("#cover1").val() |
| | | // if(cover1==''){ |
| | | // Feng.info("请上传封面") |
| | | // return; |
| | | // } |
| | | var goodImgs = this.goodsPicArray1; |
| | | var imgOne =""; |
| | | if(goodImgs.length==0){ |
| | | }else { |
| | | for (let i = 0; i <goodImgs.length; i++) { |
| | | if(i==goodImgs.length-1){ |
| | | imgOne += (goodImgs[i].response) |
| | | }else { |
| | | imgOne+=(goodImgs[i].response+",") |
| | | } |
| | | } |
| | | } |
| | | |
| | | let userPopulation = document.querySelector('input[name="userPopulation"]:checked').value; |
| | | if(userPopulation==''){ |
| | | Feng.info("请选择用户人群") |
| | | return; |
| | | } |
| | | |
| | | let quantityIssued = $("#quantityIssued1").val() |
| | | if(quantityIssued==''){ |
| | | Feng.info("请填写发放数量") |
| | | return; |
| | | } |
| | | let pickUpQuantity = $("#pickUpQuantity1").val() |
| | | if(pickUpQuantity==''){ |
| | | Feng.info("请填写限领数量") |
| | | return; |
| | | } |
| | | let startTime = $("#startTime1").val() |
| | | if(startTime==''){ |
| | | Feng.info("请选择有效期") |
| | | return; |
| | | } |
| | | let text = TGoodsInfoDlg.editor1.getContent(); |
| | | console.log(text) |
| | | if(text==""){ |
| | | Feng.info("请输入兑换说明") |
| | | return; |
| | | } |
| | | |
| | | let sort = $("#sort1").val() |
| | | if(sort==''){ |
| | | Feng.info("请填写排序") |
| | | return; |
| | | } |
| | | |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tGoods/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!"); |
| | | } |
| | | window.parent.TPointProducts.table.refresh(); |
| | | TGoodsInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("typeAll",typeAll); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("storeId",storeId); |
| | | ajax.set("coursePackageTypeId",coursePackageTypeId); |
| | | ajax.set("coursePackageId",coursePackageId); |
| | | ajax.set("coursePackageConfigId",coursePackageConfigId); |
| | | ajax.set("price",price); |
| | | ajax.set("type",type); |
| | | ajax.set("integral",integral); |
| | | ajax.set("cash",cash); |
| | | ajax.set("cover",cover1); |
| | | ajax.set("imgOne",imgOne); |
| | | ajax.set("userPopulation",userPopulation); |
| | | ajax.set("quantityIssued",quantityIssued); |
| | | ajax.set("pickUpQuantity",pickUpQuantity); |
| | | ajax.set("startTime",startTime); |
| | | ajax.set("text",text); |
| | | ajax.set("sort",sort); |
| | | ajax.start(); |
| | | |
| | | }else { |
| | | let name = $("#name").val() |
| | | if(name==''){ |
| | | Feng.info("请填写商品名称") |
| | | return; |
| | | } |
| | | let price = $("#price").val() |
| | | if(price==''){ |
| | | Feng.info("请填写原价") |
| | | return; |
| | | } |
| | | let type = document.querySelector('input[name="redemptionMethod"]:checked').value; |
| | | if(type==''){ |
| | | Feng.info("请选择兑换方式") |
| | | return; |
| | | } |
| | | |
| | | let integral=''; |
| | | let cash=''; |
| | | if(type==1){ |
| | | integral = $("#integral").val() |
| | | if(integral==''){ |
| | | Feng.info("请填写所需积分") |
| | | return; |
| | | } |
| | | } |
| | | if(type==2){ |
| | | integral = $("#integral").val() |
| | | if(integral==''){ |
| | | Feng.info("请填写所需积分") |
| | | return; |
| | | } |
| | | cash = $("#cash").val() |
| | | if(cash==''){ |
| | | Feng.info("请填写所需现金") |
| | | return; |
| | | } |
| | | } |
| | | if(type==3){ |
| | | cash = $("#cash").val() |
| | | if(cash==''){ |
| | | Feng.info("请填写所需现金") |
| | | return; |
| | | } |
| | | } |
| | | |
| | | let cover1 = $("#cover").val() |
| | | var goodImgs = this.goodsPicArray; |
| | | var imgOne =""; |
| | | if(goodImgs.length==0){ |
| | | }else { |
| | | for (let i = 0; i <goodImgs.length; i++) { |
| | | if(i==goodImgs.length-1){ |
| | | imgOne += (goodImgs[i].response) |
| | | }else { |
| | | imgOne+=(goodImgs[i].response+",") |
| | | } |
| | | } |
| | | } |
| | | |
| | | let userPopulation = document.querySelector('input[name="userPopulation"]:checked').value; |
| | | if(userPopulation==''){ |
| | | Feng.info("请选择用户人群") |
| | | return; |
| | | } |
| | | |
| | | let quantityIssued = $("#quantityIssued").val() |
| | | if(quantityIssued==''){ |
| | | Feng.info("请填写发放数量") |
| | | return; |
| | | } |
| | | let pickUpQuantity = $("#pickUpQuantity").val() |
| | | if(pickUpQuantity==''){ |
| | | Feng.info("请填写限领数量") |
| | | return; |
| | | } |
| | | let startTime = $("#startTime").val() |
| | | if(startTime==''){ |
| | | Feng.info("请选择有效期") |
| | | return; |
| | | } |
| | | |
| | | let company = document.querySelector('input[name="company"]:checked').value; |
| | | |
| | | var cityIds = []; |
| | | var cts = ""; |
| | | if (company === '2'){ |
| | | var myselect=document.getElementById('cityData'); |
| | | var seCity = myselect.options[myselect.selectedIndex].value; |
| | | if (seCity === null || seCity === undefined || seCity === ''){ |
| | | return Feng.error('请选中一个省市'); |
| | | } |
| | | cityIds.push(seCity); |
| | | if (num > 0){ |
| | | for (let i = 1; i <= num; i++) { |
| | | var insSelect=document.getElementById('cityData'+i); |
| | | var inData = insSelect.options[insSelect.selectedIndex].value; |
| | | if (inData !== undefined || inData !== null || inData !== ''){ |
| | | cityIds.push(inData); |
| | | } |
| | | } |
| | | cts = cityIds.join(','); |
| | | }else { |
| | | cts = cityIds |
| | | } |
| | | } |
| | | |
| | | const commaSeparatedString = this.goodsPicArray.join(','); |
| | | |
| | | var stores = ""; |
| | | if (company === '3'){ |
| | | console.log('3---this.storeIds',this.storeIds); |
| | | if (TGoodsInfoDlg.storeIds.length === 0 ){ |
| | | return Feng.error('请至少选择一个门店'); |
| | | } |
| | | stores = this.storeIds.join(','); |
| | | console.log('stores--===--',stores) |
| | | } |
| | | |
| | | let text = TGoodsInfoDlg.editor.getContent(); |
| | | console.log(text) |
| | | if(text==""){ |
| | | Feng.info("请输入兑换说明") |
| | | return; |
| | | } |
| | | |
| | | let sort = $("#sort").val() |
| | | if(sort==''){ |
| | | Feng.info("请填写排序") |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tGoods/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!"); |
| | | } |
| | | window.parent.TPointProducts.table.refresh(); |
| | | TGoodsInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("typeAll",typeAll); |
| | | ajax.set("name",name); |
| | | ajax.set("price",price); |
| | | ajax.set("type",type); |
| | | ajax.set("integral",integral); |
| | | ajax.set("cash",cash); |
| | | ajax.set("cover",cover1); |
| | | ajax.set("imgOne",imgOne); |
| | | ajax.set("userPopulation",userPopulation); |
| | | ajax.set("quantityIssued",quantityIssued); |
| | | ajax.set("pickUpQuantity",pickUpQuantity); |
| | | ajax.set("startTime",startTime); |
| | | ajax.set("useScope",company); |
| | | ajax.set("cityIds",cts); |
| | | ajax.set("storeIds",stores); |
| | | ajax.set("text",text); |
| | | ajax.set("sort",sort); |
| | | ajax.set("cardType",document.querySelector('input[name="cardType"]:checked').value); |
| | | ajax.start(); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 删除图片的函数 |
| | | * @param e |
| | | */ |
| | | function delImg(e){ |
| | | |
| | | $(e).parent().remove(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TGoodsInfoDlg.editSubmit = function() { |
| | | let cover = $("#cover").val(); |
| | | let goodsId = $("#goodsId").val(); |
| | | var productImages = ""; |
| | | if (TGoodsInfoDlg.goodsPicArray.length > 0){ |
| | | productImages = TGoodsInfoDlg.goodsPicArray.join(','); |
| | | } |
| | | let quantityIssued = $("#quantityIssued").val(); |
| | | let pickUpQuantity = $("#pickUpQuantity").val(); |
| | | let editor = jQuery.trim(TGoodsInfoDlg.editor.getContent()); |
| | | console.log('editor:',editor) |
| | | |
| | | let sort = $("#sort").val(); |
| | | |
| | | if (quantityIssued === undefined || quantityIssued === null || quantityIssued === ''){ |
| | | return Feng.error('发放数量不能为空!'); |
| | | } |
| | | if (pickUpQuantity === undefined || pickUpQuantity === null || pickUpQuantity === ''){ |
| | | return Feng.error('限领数量不能为空!'); |
| | | } |
| | | let quantityHas = $("#quantityHas").val(); |
| | | if (quantityIssued <= quantityHas){ |
| | | return Feng.error('发放数量小于已领数量!'); |
| | | } |
| | | |
| | | |
| | | if (editor === undefined || editor === null || editor === ''){ |
| | | return Feng.error('兑换说明不能为空!'); |
| | | } |
| | | if (sort === undefined || sort === null || sort === ''){ |
| | | return Feng.error('排序不能为空!'); |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tGoods/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | | window.parent.TPointProducts.table.refresh(); |
| | | TGoodsInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("pointMerchandiseId",goodsId); |
| | | ajax.set("quantityIssued",quantityIssued); |
| | | ajax.set("pickUpQuantity",pickUpQuantity); |
| | | ajax.set("redemptionInstructions",editor); |
| | | ajax.set("cover",cover); |
| | | ajax.set("productImages",productImages); |
| | | ajax.set("sort",sort); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | |
| | | getProvince(null); |
| | | Feng.initValidator("carInfoForm", TGoodsInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("cover"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | TGoodsInfoDlg.editor = UE.getEditor('editor'); |
| | | TGoodsInfoDlg.editor1 = UE.getEditor('editor1'); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | TGoodsInfoDlg.oneChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/onChange", 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(); |
| | | } |
| | | TGoodsInfoDlg.storeChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/storeChange", 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.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#storeId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TGoodsInfoDlg.packageChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/packageChange", 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.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#coursePackageId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TGoodsInfoDlg.timeChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/timeChange", 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.id+"'>"+v.classHours+"</option>"; |
| | | }); |
| | | $("#coursePackageConfigId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | | */ |
| | | TGoodsInfoDlg.companyTypeClick = function (e) { |
| | | if (1 == e){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == e){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 车辆品牌改变时执行 |
| | | */ |
| | | TGoodsInfoDlg.brandChange = function (e) { |
| | | var carBrandId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/brandChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择车辆类型</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Please select the vehicle type</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih Jenis Kendaraan</option>'; |
| | | } |
| | | |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#carModelId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("carBrandId",carBrandId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 专车服务被点击 |
| | | */ |
| | | TGoodsInfoDlg.zcServerClick = function () { |
| | | var serverBox1 = $('#serverBox1').prop('checked'); |
| | | if (serverBox1){ |
| | | $("#zcModelDiv").show(); |
| | | } else { |
| | | $("#zcModelDiv").hide(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 跨城服务被点击 |
| | | */ |
| | | TGoodsInfoDlg.kcServerClick = function () { |
| | | var serverBox3 = $('#serverBox3').prop('checked'); |
| | | if (serverBox3){ |
| | | $("#kcModelDiv").show(); |
| | | } else { |
| | | $("#kcModelDiv").hide(); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TPayInfo = { |
| | | id: "TPayInfoTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1, |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TPayInfo.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '选择', field: '', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '联系方式', field: 'phone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '使用状态', field: 'status', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {1: "未使用", 2: "已核销"}[value] |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TPayInfo.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TPayInfo.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 核销操作 |
| | | * @constructor |
| | | */ |
| | | TPayInfo.WriteOff = function (){ |
| | | if (TPayInfo.check()) { |
| | | if (TPayInfo.seItem.status === 2){ |
| | | return Feng.error("重复核销!"); |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tGoods/write_off", function (data) { |
| | | Feng.success("核销成功!"); |
| | | TPayInfo.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("核销失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",TPayInfo.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TPayInfo.close = function() { |
| | | parent.layer.close(window.parent.TPointProducts.layerIndex); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TPayInfo.search = function () { |
| | | var queryData = {}; |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['status'] = $("#status").val(); |
| | | queryData['id'] = $("#id").val(); |
| | | TPayInfo.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 重置搜索 |
| | | */ |
| | | TPayInfo.resetSearch = function () { |
| | | $("#name").val(''); |
| | | $("#phone").val(''); |
| | | $("#status").val(''); |
| | | TPayInfo.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | let goodsId = $("#id").val(); |
| | | var defaultColunms = TPayInfo.initColumn(); |
| | | var table = new BSTable(TPayInfo.id, "/tGoods/payList/"+goodsId, defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TPayInfo.table = table.init(); |
| | | }); |
New file |
| | |
| | | package com.dsh.other.controller; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.other.entity.TGame; |
| | | import com.dsh.other.entity.TGameConfig; |
| | | import com.dsh.other.entity.TGameRecord; |
| | | import com.dsh.other.feignclient.account.AppUserClient; |
| | | import com.dsh.other.feignclient.account.model.AppUser; |
| | | import com.dsh.other.model.QueryMySiteVo; |
| | | import com.dsh.other.service.TGameConfigService; |
| | | import com.dsh.other.service.TGameRecordService; |
| | | import com.dsh.other.service.TGameService; |
| | | import com.dsh.other.util.*; |
| | | import com.dsh.other.util.httpClinet.HttpResult; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | 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 java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("/api/game") |
| | | public class GameController { |
| | | |
| | | @Autowired |
| | | private TGameRecordService gameRecordService; |
| | | |
| | | @Autowired |
| | | private TGameService gameService; |
| | | |
| | | @Autowired |
| | | private TGameConfigService gameConfigService; |
| | | |
| | | @Autowired |
| | | private TokenUtil tokenUtil; |
| | | |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/queryGameList") |
| | | @ApiOperation(value = "获取当前场地的游戏列表配置", tags = {"用户—游戏"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "siteId", name = "siteId", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "storeId", name = "storeId", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<List<TGameConfig>> queryGameList(Integer siteId, Integer storeId){ |
| | | try { |
| | | List<TGameConfig> tGameConfigs = new ArrayList<>(); |
| | | |
| | | List<TGame> list = gameService.list(new LambdaQueryWrapper<TGame>().eq(TGame::getSiteId, siteId).eq(TGame::getStoreId, storeId)); |
| | | if(list.size()>0){ |
| | | Integer id = list.get(0).getId(); |
| | | tGameConfigs = gameConfigService.list(new LambdaQueryWrapper<TGameConfig>().eq(TGameConfig::getOtherId, id)); |
| | | } |
| | | return ResultUtil.success(tGameConfigs); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/payGame") |
| | | @ApiOperation(value = "支付游戏", tags = {"用户—游戏"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(value = "三方游戏id", name = "gameId", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "游戏配置id", name = "configId", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "sutuId", name = "sutuId", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "spaceId", name = "spaceId", dataType = "int", required = true), |
| | | @ApiImplicitParam(value = "1微信 2支付宝 3玩湃币", name = "type", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil payGame(Integer gameId, Integer configId,Integer type,Integer sutuId,Integer spaceId){ |
| | | try { |
| | | Integer uid = tokenUtil.getUserIdFormRedis(); |
| | | if(null == uid){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | TGameConfig config = gameConfigService.getById(configId); |
| | | TGameRecord tGameRecord = new TGameRecord(); |
| | | tGameRecord.setGameId(gameId); |
| | | tGameRecord.setPayType(type); |
| | | tGameRecord.setUserId(uid); |
| | | tGameRecord.setNumber(code); |
| | | gameRecordService.save(tGameRecord); |
| | | if(type==1){ |
| | | ResultUtil weixinpay = payMoneyUtil.weixinpay("游戏支付", "", code, config.getCash().toString(), "/base/course/weChatPaymentCourseCallback", "APP", ""); |
| | | if(weixinpay.getCode() == 200){ |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | int num = 1; |
| | | int wait = 0; |
| | | while (num <= 10){ |
| | | int min = 5000; |
| | | wait += (min * num); |
| | | Thread.sleep(wait); |
| | | List<TGameRecord> list = gameRecordService.list(new QueryWrapper<TGameRecord>().eq("code", code).eq("payType", 2)); |
| | | TGameRecord one = list.get(0); |
| | | |
| | | if(one.getStatus() == 1){ |
| | | break; |
| | | } |
| | | ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryWXOrder(code, ""); |
| | | if(resultUtil.getCode() == 200 && one.getStatus() == 0){ |
| | | /** |
| | | * SUCCESS—支付成功, |
| | | * REFUND—转入退款, |
| | | * NOTPAY—未支付, |
| | | * CLOSED—已关闭, |
| | | * REVOKED—已撤销(刷卡支付), |
| | | * USERPAYING--用户支付中, |
| | | * PAYERROR--支付失败(其他原因,如银行返回失败) |
| | | */ |
| | | Map<String, String> data1 = resultUtil.getData(); |
| | | String s = data1.get("trade_state"); |
| | | String transaction_id = data1.get("transaction_id"); |
| | | if("REFUND".equals(s) || "NOTPAY".equals(s) || "CLOSED".equals(s) || "REVOKED".equals(s) || "PAYERROR".equals(s) || num == 10){ |
| | | break; |
| | | } |
| | | if("SUCCESS".equals(s)){ |
| | | for (TGameRecord coursePackagePayment : list) { |
| | | coursePackagePayment.setStatus(1); |
| | | coursePackagePayment.setOrderNo(transaction_id); |
| | | } |
| | | gameRecordService.updateBatchById(list); |
| | | Integer integer = startGame(uid, gameId, spaceId, sutuId); |
| | | break; |
| | | } |
| | | if("USERPAYING".equals(s)){ |
| | | num++; |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | return weixinpay; |
| | | }else if(type==2){ |
| | | ResultUtil alipay = payMoneyUtil.alipay("游戏支付", "游戏支付", "", code, config.getCash().toString(), "/base/course/aliPaymentCourseCallback"); |
| | | if(alipay.getCode() == 200){ |
| | | new Thread(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | int num = 1; |
| | | int wait = 0; |
| | | while (num <= 10){ |
| | | int min = 5000; |
| | | wait += (min * num); |
| | | Thread.sleep(wait); |
| | | List<TGameRecord> list = gameRecordService.list(new QueryWrapper<TGameRecord>().eq("code", code).eq("payType", 3)); |
| | | TGameRecord one = list.get(0); |
| | | if(one.getStatus() == 1){ |
| | | break; |
| | | } |
| | | ResultUtil<Map<String, String>> resultUtil = payMoneyUtil.queryALIOrder(code); |
| | | if(resultUtil.getCode() == 200 && one.getStatus() == 0){ |
| | | /** |
| | | * WAIT_BUYER_PAY(交易创建,等待买家付款)、 |
| | | * TRADE_CLOSED(未付款交易超时关闭,或支付完成后全额退款)、 |
| | | * TRADE_SUCCESS(交易支付成功)、 |
| | | * TRADE_FINISHED(交易结束,不可退款) |
| | | */ |
| | | Map<String, String> data1 = resultUtil.getData(); |
| | | String s = data1.get("tradeStatus"); |
| | | String tradeNo = data1.get("tradeNo"); |
| | | if("TRADE_CLOSED".equals(s) || "TRADE_FINISHED".equals(s) || num == 10){ |
| | | break; |
| | | } |
| | | if("TRADE_SUCCESS".equals(s)){ |
| | | for (TGameRecord coursePackagePayment : list) { |
| | | coursePackagePayment.setStatus(1); |
| | | coursePackagePayment.setOrderNo(tradeNo); |
| | | } |
| | | gameRecordService.updateBatchById(list); |
| | | Integer integer = startGame(uid, gameId, spaceId, sutuId); |
| | | break; |
| | | } |
| | | if("WAIT_BUYER_PAY".equals(s)){ |
| | | num++; |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }).start(); |
| | | } |
| | | return alipay; |
| | | }else if(type==3){ |
| | | AppUser appUser = appUserClient.queryAppUser(uid); |
| | | Integer playPaiCoins = appUser.getPlayPaiCoins(); |
| | | BigDecimal playCoin = config.getPlayCoin(); |
| | | int i = playCoin.intValue(); |
| | | if(playPaiCoins<i){ |
| | | return ResultUtil.error("玩湃币不足"); |
| | | } |
| | | int i1 = playPaiCoins - i; |
| | | appUser.setPlayPaiCoins(i1); |
| | | appUserClient.updateAppUser(appUser); |
| | | startGame(uid,gameId,spaceId,sutuId); |
| | | return ResultUtil.success(); |
| | | |
| | | }else { |
| | | return ResultUtil.error("支付方式错误"); |
| | | } |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | private static Integer startGame(Integer uid,Integer gameId,Integer spaceId,Integer sutuId){ |
| | | HashMap<String, String> map = new HashMap<>(); |
| | | map.put("sign","0DB011836143EEE2C2E072967C9F4E4B"); |
| | | map.put("app_user_id",uid+""); |
| | | map.put("game_id",gameId+""); |
| | | map.put("space_id",spaceId+""); |
| | | map.put("sutu_id",sutuId+""); |
| | | |
| | | String s = HttpRequestUtil.postRequest("https://try.daowepark.com/v7/user_api/general/gameStart", map); |
| | | JSONObject jsonObject = JSONObject.parseObject(s); |
| | | Object code = jsonObject.get("code"); |
| | | if(String.valueOf(code)!=null && "200".equals(String.valueOf(code))){ |
| | | return 200; |
| | | }else { |
| | | return 500; |
| | | } |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | Integer integer = startGame(1, 13, 1001, 1001); |
| | | System.out.println(integer); |
| | | } |
| | | } |
| | |
| | | package com.dsh.other.controller; |
| | | |
| | | import cn.hutool.http.HttpRequest; |
| | | import cn.hutool.http.HttpResponse; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.other.entity.Site; |
| | | import com.dsh.other.entity.SiteBooking; |
| | |
| | | @ApiImplicitParam(value = "id", name = "id", dataType = "int", required = true), |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | }) |
| | | public ResultUtil<SiteBooking> queryMySiteById(Integer id){ |
| | | public ResultUtil<Map<String,Object>> queryMySiteById(Integer id){ |
| | | try { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | SiteBooking byId = siteBookingService.getById(id); |
| | | return ResultUtil.success(byId); |
| | | List<Integer> ids = getIds(byId.getSiteId()); |
| | | map.put("data",byId); |
| | | map.put("ids",ids); |
| | | return ResultUtil.success(map); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | public List<Integer> getIds(Integer siteId) { |
| | | HttpRequest httpRequest = HttpRequest.get("https://try.daowepark.com/v7/user_api/general/get_space_area?space_id=" + siteId); |
| | | HttpResponse execute = httpRequest.execute(); |
| | | String body = execute.body(); |
| | | JSONObject jsonObject = JSONObject.parseObject(body); |
| | | Object data = jsonObject.get("data"); |
| | | JSONArray array = JSONArray.parseArray(data.toString()); |
| | | List<Integer> ids =new ArrayList<>(); |
| | | for (Object o : array) { |
| | | JSONObject jsonObject1 = JSONObject.parseObject(o.toString()); |
| | | Object id = jsonObject1.get("id"); |
| | | Integer integer = Integer.valueOf(id.toString()); |
| | | ids.add(integer); |
| | | } |
| | | return ids; |
| | | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/api/site/cancelMySite") |
| | |
| | | return ResultUtil.paranErr("storeId"); |
| | | } |
| | | try { |
| | | List<StoreConfig> list = storeConfigService.list(new QueryWrapper<StoreConfig>().eq("storeId", storeId).orderByAsc("sort")); |
| | | List<StoreConfig> list = storeConfigService.list(new QueryWrapper<StoreConfig>().eq("storeId", storeId).orderByAsc("sort").eq("isOpen",1)); |
| | | List<StoreConfigVo> listVo = new ArrayList<>(); |
| | | for (StoreConfig storeConfig : list) { |
| | | StoreConfigVo storeConfigVo = new StoreConfigVo(); |
| | |
| | | private Integer gameId; |
| | | @TableField("otherId") |
| | | private Integer otherId; |
| | | |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
New file |
| | |
| | | package com.dsh.other.entity; |
| | | |
| | | import java.math.BigDecimal; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import java.io.Serializable; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-10-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_game_record") |
| | | public class TGameRecord extends Model<TGameRecord> { |
| | | |
| | | private static final long serialVersionUID=1L; |
| | | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @TableField("userId") |
| | | private Integer userId; |
| | | |
| | | @TableField("gameId") |
| | | private Integer gameId; |
| | | |
| | | /** |
| | | * 1玩湃币 2微信 3支付宝 |
| | | */ |
| | | @TableField("payType") |
| | | private Integer payType; |
| | | |
| | | /** |
| | | * 金额 |
| | | */ |
| | | private BigDecimal money; |
| | | |
| | | /** |
| | | * 0待支付 1已支付 |
| | | */ |
| | | private Integer status; |
| | | |
| | | private String number; |
| | | @TableField("orderNo") |
| | | private String orderNo; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
| | |
| | | /** |
| | | * 图片 |
| | | */ |
| | | private String url; |
| | | @TableField("url") |
| | | private String backgroundImage; |
| | | |
| | | /** |
| | | * 跳转模块 |
New file |
| | |
| | | package com.dsh.other.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.other.entity.TGameRecord; |
| | | |
| | | /** |
| | | * <p> |
| | | * Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-10-07 |
| | | */ |
| | | public interface TGameRecordMapper extends BaseMapper<TGameRecord> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.other.entity.TGameRecord; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-10-07 |
| | | */ |
| | | public interface TGameRecordService extends IService<TGameRecord> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.service.impl; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.other.entity.TGameRecord; |
| | | import com.dsh.other.mapper.TGameRecordMapper; |
| | | import com.dsh.other.service.TGameRecordService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * <p> |
| | | * 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-10-07 |
| | | */ |
| | | @Service |
| | | public class TGameRecordServiceImpl extends ServiceImpl<TGameRecordMapper, TGameRecord> implements TGameRecordService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.other.util; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import org.apache.commons.httpclient.HttpClient; |
| | | import org.apache.commons.httpclient.HttpException; |
| | | import org.apache.commons.httpclient.SimpleHttpConnectionManager; |
| | | import org.apache.commons.httpclient.methods.GetMethod; |
| | | import org.apache.commons.httpclient.methods.PostMethod; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.io.PrintWriter; |
| | | import java.security.MessageDigest; |
| | | import java.util.Map; |
| | | |
| | | public class HttpRequestUtil { |
| | | |
| | | public static String postRequest(String url, Map<String, String> params) { |
| | | // 构造HttpClient的实例 |
| | | HttpClient httpClient = new HttpClient(); |
| | | // 创建POST方法的实例 |
| | | PostMethod postMethod = new PostMethod(url); |
| | | // 设置请求头信息 |
| | | postMethod.setRequestHeader("Connection", "close"); |
| | | postMethod.addRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"); |
| | | // 添加参数 |
| | | for (Map.Entry<String, String> entry : params.entrySet()) { |
| | | postMethod.addParameter(entry.getKey(), entry.getValue()); |
| | | } |
| | | // 使用系统提供的默认的恢复策略,设置请求重试处理,用的是默认的重试处理:请求三次 |
| | | httpClient.getParams().setBooleanParameter("http.protocol.expect-continue", false); |
| | | // 接收处理结果 |
| | | String result = null; |
| | | try { |
| | | // 执行Http Post请求 |
| | | httpClient.executeMethod(postMethod); |
| | | // 返回处理结果 |
| | | result = postMethod.getResponseBodyAsString(); |
| | | } catch (HttpException e) { |
| | | // 发生致命的异常,可能是协议不对或者返回的内容有问题 |
| | | System.out.println("请检查输入的URL!"); |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | // 发生网络异常 |
| | | System.out.println("发生网络异常!"); |
| | | e.printStackTrace(); |
| | | } finally { |
| | | // 释放链接 |
| | | postMethod.releaseConnection(); |
| | | // 关闭HttpClient实例 |
| | | if (httpClient != null) { |
| | | ((SimpleHttpConnectionManager) httpClient.getHttpConnectionManager()).shutdown(); |
| | | httpClient = null; |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | public static String postRequest1(String url, Map<String, String> params,String appKey,String appSecret) { |
| | | // 构造HttpClient的实例 |
| | | HttpClient httpClient = new HttpClient(); |
| | | // 创建POST方法的实例 |
| | | PostMethod postMethod = new PostMethod(url); |
| | | // 设置请求头信息 |
| | | String nonce = String.valueOf(Double.valueOf(Math.random() * 1000000.0D).intValue()); |
| | | String timeMillis = String.valueOf(System.currentTimeMillis()); |
| | | String signature = string2Sha1(appSecret + nonce + timeMillis); |
| | | postMethod.setRequestHeader("Host", "api-cn.ronghub.com"); |
| | | postMethod.setRequestHeader("App-Key", appKey); |
| | | postMethod.setRequestHeader("Signature", signature); |
| | | postMethod.setRequestHeader("Nonce", nonce); |
| | | postMethod.setRequestHeader("Timestamp", timeMillis); |
| | | postMethod.setRequestHeader("Host", "api-cn.ronghub.com"); |
| | | postMethod.addRequestHeader("Content-Type", "application/json"); |
| | | // 添加参数 |
| | | for (Map.Entry<String, String> entry : params.entrySet()) { |
| | | postMethod.addParameter(entry.getKey(), entry.getValue()); |
| | | } |
| | | // 使用系统提供的默认的恢复策略,设置请求重试处理,用的是默认的重试处理:请求三次 |
| | | httpClient.getParams().setBooleanParameter("http.protocol.expect-continue", false); |
| | | // 接收处理结果 |
| | | String result = null; |
| | | try { |
| | | // 执行Http Post请求 |
| | | httpClient.executeMethod(postMethod); |
| | | // 返回处理结果 |
| | | result = postMethod.getResponseBodyAsString(); |
| | | } catch (HttpException e) { |
| | | // 发生致命的异常,可能是协议不对或者返回的内容有问题 |
| | | System.out.println("请检查输入的URL!"); |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | // 发生网络异常 |
| | | System.out.println("发生网络异常!"); |
| | | e.printStackTrace(); |
| | | } finally { |
| | | // 释放链接 |
| | | postMethod.releaseConnection(); |
| | | // 关闭HttpClient实例 |
| | | if (httpClient != null) { |
| | | ((SimpleHttpConnectionManager) httpClient.getHttpConnectionManager()).shutdown(); |
| | | httpClient = null; |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | private static String string2Sha1(String str){ |
| | | if(str==null||str.length()==0){ |
| | | return null; |
| | | } |
| | | char hexDigits[] = {'0','1','2','3','4','5','6','7','8','9', |
| | | 'a','b','c','d','e','f'}; |
| | | try { |
| | | MessageDigest mdTemp = MessageDigest.getInstance("SHA1"); |
| | | mdTemp.update(str.getBytes("UTF-8")); |
| | | |
| | | byte[] md = mdTemp.digest(); |
| | | int j = md.length; |
| | | char buf[] = new char[j*2]; |
| | | int k = 0; |
| | | for (int i = 0; i < j; i++) { |
| | | byte byte0 = md[i]; |
| | | buf[k++] = hexDigits[byte0 >>> 4 & 0xf]; |
| | | buf[k++] = hexDigits[byte0 & 0xf]; |
| | | } |
| | | return new String(buf); |
| | | } catch (Exception e) { |
| | | // TODO: handle exception |
| | | return null; |
| | | } |
| | | } |
| | | public static String getRequest(String url, Map<String, String> params) { |
| | | // 构造HttpClient实例 |
| | | HttpClient client = new HttpClient(); |
| | | // 拼接参数 |
| | | String paramStr = ""; |
| | | for (String key : params.keySet()) { |
| | | paramStr = paramStr + "&" + key + "=" + params.get(key); |
| | | } |
| | | paramStr = paramStr.substring(1); |
| | | // 创建GET方法的实例 |
| | | GetMethod method = new GetMethod(url + "?" + paramStr); |
| | | // 接收返回结果 |
| | | String result = null; |
| | | try { |
| | | // 执行HTTP GET方法请求 |
| | | client.executeMethod(method); |
| | | // 返回处理结果 |
| | | result = method.getResponseBodyAsString(); |
| | | } catch (HttpException e) { |
| | | // 发生致命的异常,可能是协议不对或者返回的内容有问题 |
| | | System.out.println("请检查输入的URL!"); |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | // 发生网络异常 |
| | | System.out.println("发生网络异常!"); |
| | | e.printStackTrace(); |
| | | } finally { |
| | | // 释放链接 |
| | | method.releaseConnection(); |
| | | // 关闭HttpClient实例 |
| | | if (client != null) { |
| | | ((SimpleHttpConnectionManager) client |
| | | .getHttpConnectionManager()).shutdown(); |
| | | client = null; |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 发送网络请求 |
| | | * @param url |
| | | * @return |
| | | */ |
| | | public static String sendNetRequest(String url, Map<String, String> params) { |
| | | // 构造HttpClient实例 |
| | | HttpClient client = new HttpClient(); |
| | | String paramStr = ""; |
| | | for (String key : params.keySet()) { |
| | | paramStr = paramStr + "&" + key + "=" + params.get(key); |
| | | } |
| | | paramStr = paramStr.substring(1); |
| | | System.err.println(url + "?" + paramStr); |
| | | // 创建GET方法的实例 |
| | | GetMethod method = new GetMethod(url + "?" + paramStr); |
| | | // 接收返回结果 |
| | | String result = null; |
| | | try { |
| | | // 执行HTTP GET方法请求 |
| | | client.executeMethod(method); |
| | | // 返回处理结果 |
| | | result = method.getResponseBodyAsString(); |
| | | } catch (HttpException e) { |
| | | // 发生致命的异常,可能是协议不对或者返回的内容有问题 |
| | | System.out.println("请检查输入的URL!"); |
| | | e.printStackTrace(); |
| | | } catch (IOException e) { |
| | | // 发生网络异常 |
| | | System.out.println("发生网络异常!"); |
| | | e.printStackTrace(); |
| | | } finally { |
| | | // 释放链接 |
| | | method.releaseConnection(); |
| | | // 关闭HttpClient实例 |
| | | if (client != null) { |
| | | ((SimpleHttpConnectionManager) client.getHttpConnectionManager()).shutdown(); |
| | | client = null; |
| | | } |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * jsonp跨域请求数据响应<br/> |
| | | * 方法名:responsejsonpData<br/> |
| | | * @author:Mryang<br/> |
| | | * @createTime:2016年7月31日-下午11:17:31 <br/> |
| | | * @tel: 15198268054<br/> |
| | | * @param request |
| | | * @param response |
| | | * @param map void<br/> |
| | | * @exception <br/> |
| | | * @since 1.0.0 |
| | | */ |
| | | public void responsejsonpData(HttpServletRequest request, HttpServletResponse response, Map<String, Object> map) { |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setHeader("Content-Type", "text/html;Charset=utf-8"); |
| | | try { |
| | | PrintWriter writer = response.getWriter(); |
| | | String params = request.getParameter("callback"); |
| | | String json = JSONObject.toJSONString(map); |
| | | writer.print(params+ "("+json+")"); |
| | | } catch (IOException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.dsh.other.mapper.TGameRecordMapper"> |
| | | |
| | | |
| | | </mapper> |