Merge remote-tracking branch 'origin/master'
# Conflicts:
# cloud-server-account/src/main/java/com/dsh/account/controller/AppUserController.java
# cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java
# cloud-server-course/src/main/java/com/dsh/course/entity/CoursePackageScheduling.java
# cloud-server-course/src/main/java/com/dsh/course/entity/CoursePackageStudent.java
# cloud-server-course/src/main/java/com/dsh/course/mapper/CoursePackageSchedulingMapper.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/CoursePackageSchedulingServiceImpl.java
# cloud-server-course/src/main/java/com/dsh/course/service/impl/TCoursePackagePaymentServiceImpl.java
# cloud-server-course/src/main/resources/mapper/CoursePackageSchedulingMapper.xml
# cloud-server-course/src/main/resources/mapper/TCoursePackagePaymentMapper.xml
| | |
| | | package com.dsh.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.model.AddAppUserVo; |
| | | import com.dsh.account.model.JoinPlayPaiVo; |
| | | import com.dsh.account.model.LoginSMSCodeVo; |
| | | import com.dsh.account.model.LoginWeChatVo; |
| | | import com.dsh.account.model.*; |
| | | import com.dsh.account.service.IVipPaymentService; |
| | | import com.dsh.account.service.TAppUserService; |
| | | import com.dsh.account.util.PayMoneyUtil; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.PrintWriter; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/appUser/getAllUser") |
| | | @ResponseBody |
| | | public List<TAppUser> getAllUser(){ |
| | | try { |
| | | return appUserService.list(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/appUser/queryByNamePhone") |
| | | public List<TAppUser> queryByNamePhone(@RequestBody QueryByNamePhone queryByNamePhone){ |
| | | try { |
| | | LambdaQueryWrapper<TAppUser> tAppUserLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(queryByNamePhone.getName())){ |
| | | tAppUserLambdaQueryWrapper.like(TAppUser::getName,queryByNamePhone.getName()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(queryByNamePhone.getPhone())){ |
| | | tAppUserLambdaQueryWrapper.like(TAppUser::getPhone,queryByNamePhone.getPhone()); |
| | | } |
| | | List<TAppUser> list = appUserService.list(tAppUserLambdaQueryWrapper); |
| | | return list; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new ArrayList<>(); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/base/appUser/queryById") |
| | | public TAppUser queryById(@RequestBody Integer appUserId){ |
| | | try { |
| | | return appUserService.getById(appUserId); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new TAppUser(); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据名称模糊搜索用户 |
| | | * @param name |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.model.RecordAppoint; |
| | | import com.dsh.account.model.vo.classDetails.*; |
| | | import com.dsh.account.model.vo.classDetails.classInsVo.*; |
| | | import com.dsh.account.model.vo.commentDetail.StuCommentsVo; |
| | |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "查询时间yyyy-MM-dd", name = "time", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "用户经度", name = "longitude", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "用户纬度", name = "latitude", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "用户经度", name = "longitude", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "用户纬度", name = "latitude", required = false, dataType = "string"), |
| | | }) |
| | | public ResultUtil<List<CourseVenue>> queryWeeksOfClassInfo(String time,Integer stuId, String longitude, String latitude){ |
| | | try { |
| | |
| | | @ApiImplicitParam(value = "时间类型 0=全部 1=近一周 2=近一个月 3=近一年", name = "timeType", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "课程名称", name = "appointStatus", required = false, dataType = "string"), |
| | | }) |
| | | public ResultUtil<AppointmentRecordVo> cgeClassAppointmentRecordList(Integer stuId,Integer appointStatus,Integer timeType,String search){ |
| | | public ResultUtil<List<RecordAppoint>> cgeClassAppointmentRecordList(Integer stuId, Integer appointStatus, Integer timeType, String search){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | |
| | | import com.dsh.account.service.UserIntegralChangesService; |
| | | 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; |
| | |
| | | @ApiOperation(value = "上传用户头像", tags = {"APP-使用福利"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(name = "file",value = "图片字节",dataType = "MultipartFile") |
| | | @ApiImplicitParam(name = "userImage",value = "用户头像连接",dataType = "string") |
| | | }) |
| | | public ResultUtil uploadAppUserProfile(MultipartFile file, HttpServletRequest request){ |
| | | public ResultUtil uploadAppUserProfile(String userImage){ |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return ResultUtil.success(tauService.uploadAppUserHeadImg(appUserId,file,request)); |
| | | TAppUser byId = tauService.getById(appUserId); |
| | | if (ToolUtil.isNotEmpty(userImage)){ |
| | | byId.setHeadImg(userImage); |
| | | tauService.updateById(byId); |
| | | }else { |
| | | ResultUtil.error("头像不能为空!"); |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | @ApiOperation(value = "充值明细", tags = {"APP-使用福利"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "年月", name = "yearMonth", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "年月", name = "yearMonth", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "页码", name = "pageNum", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "每页数量", name = "pageSize", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = false, dataType = "int"), |
| | | }) |
| | | public ResultUtil<List<RechargesDetail>> wpGoldRechargeRecord(String yearMonth, Integer recordId,Integer pageNum,Integer pageSize){ |
| | | try { |
| | |
| | | @ApiOperation(value = "积分商城-商品兑换", tags = {"APP-使用福利"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "商品id", name = "goodId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "商品类型 1实物 2课包 3门票 4优惠券", name = "goodsType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "兑换数量", name = "nums", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "兑换方式(1=积分,2=积分+现金)", name = "exchangeType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "现金支付方式(1=微信 2=支付宝)", name = "payType", required = false, dataType = "int"), |
| | | @ApiImplicitParam(value = "学员id列表", name = "stuIds", required = false), |
| | | }) |
| | | public ResultUtil productRedemptionOperation(Integer goodId, Integer goodsType,Integer nums,Integer exchangeType,Integer payType,List<Integer> stuIds){ |
| | | public ResultUtil productRedemptionOperation(GoodsExchangeVo exchangeType){ |
| | | try { |
| | | Integer userIdFormRedis = tokenUtil.getUserIdFormRedis(); |
| | | if(null == userIdFormRedis){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | return tauService.productRedemptionOperation(userIdFormRedis,goodId,goodsType,nums,exchangeType,payType,stuIds); |
| | | return tauService.productRedemptionOperation(userIdFormRedis,exchangeType); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | |
| | | @ApiOperation(value = "积分商城-积分明细", tags = {"APP-使用福利"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "年月", name = "yearMonth", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "年月", name = "yearMonth", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "记录(1充值 2扣除)", name = "recordId", required = false, dataType = "int"), |
| | | }) |
| | | public ResultUtil<List<IntegralsData>> pointDetails(String yearMonth, Integer recordId){ |
| | | try { |
| | |
| | | @ApiOperation(value = "积分商城-兑换记录", tags = {"APP-使用福利"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "使用状态 (1已使用 2未使用)", name = "useType", required = true, dataType = "string"), |
| | | @ApiImplicitParam(value = "商品类型 1实物 2课包 3门票 4优惠券", name = "goodType", required = true, dataType = "int"), |
| | | @ApiImplicitParam(value = "使用状态 (1已使用 2未使用)", name = "useType", required = false, dataType = "string"), |
| | | @ApiImplicitParam(value = "商品类型 1实物 2课包 3门票 4优惠券", name = "goodType", required = false, dataType = "int"), |
| | | }) |
| | | public ResultUtil<List<ExchangeDetailsResponse>> exchangeRecordsDetails(Integer useType, Integer goodType){ |
| | | try { |
| | |
| | | package com.dsh.account.controller; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.account.entity.UserIntegral; |
| | | import com.dsh.account.entity.UserIntegralChanges; |
| | | import com.dsh.account.model.IntegralListQuery; |
| | | import com.dsh.account.model.SaveUserIntegralChangesVo; |
| | | import com.dsh.account.service.UserIntegralChangesService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | @PostMapping("/userIntegralChanges/list") |
| | | public Page<UserIntegral> list(@RequestBody IntegralListQuery integralListQuery){ |
| | | try { |
| | | Page<UserIntegral> userIntegralPage = new Page<>(integralListQuery.getOffset(), integralListQuery.getLimit()); |
| | | |
| | | Page<UserIntegral> list = userIntegralChangesService.listAll(userIntegralPage,integralListQuery); |
| | | return list; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new Page<>(); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | |
| | | * 生日 |
| | | */ |
| | | @TableField("birthday") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date birthday; |
| | | /** |
| | | * 性别(1=男,2=女) |
| | |
| | | * 会员有效期 |
| | | */ |
| | | @TableField("vipEndTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date vipEndTime; |
| | | /** |
| | | * 会员等级id |
| | |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | |
New file |
| | |
| | | package com.dsh.account.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户积分变动记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-10 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_user_integral_changes") |
| | | public class UserIntegral extends Model<UserIntegral> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | private String city; |
| | | private String province; |
| | | private String name; |
| | | private String phone; |
| | | private Integer type; |
| | | private Integer oldIntegral; |
| | | private Integer newIntegral; |
| | | private Integer integral; |
| | | private Integer category; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | private String remark; |
| | | |
| | | |
| | | } |
| | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | @TableId(value = "id", type = IdType.NONE) |
| | | private Long id; |
| | | /** |
| | | * 用户id |
| | | */ |
| | |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | |
| | | /** |
| | | * 变动类型(1增加 2扣除) |
| | | */ |
| | | @TableField("category") |
| | | private Integer category; |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | |
| | | |
| | | import com.dsh.account.feignclient.activity.model.*; |
| | | import com.dsh.account.model.vo.userBenefitDetail.ExchangeDetailsResponse; |
| | | import com.dsh.account.model.vo.userBenefitDetail.ExchangeDetailsVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.PointDetailsVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.ProductDetailsVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/getCommoditys") |
| | | public List<PointsMerchandise> getVicinityGoods(@RequestBody CommodityRequest request); |
| | | PointMerchandiseVo getVicinityGoods(@RequestBody CommodityRequest request); |
| | | |
| | | @PostMapping("/base/pointMerchars/getRedeemedNums") |
| | | public int getRedeemedQuantity(@RequestBody Integer goodId); |
| | |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/getDetailsOfExchange") |
| | | List<ExchangeDetailsResponse> getIntegralExchangeDetails(@RequestBody Integer appUserId); |
| | | ExchangeDetailsVo getIntegralExchangeDetails(@RequestBody Integer appUserId); |
| | | |
| | | @PostMapping("/base/pointMerchars/getSpecificsOfGoods") |
| | | public PointDetailsVo getSpecificsOfGoods(@RequestBody Integer speMercharsId); |
| | |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/saveDetailsUserPointMercase") |
| | | public void saveDetailsUserPointMercase(@RequestBody UserPointsMerchandise merchandise); |
| | | public void saveDetailsUserPointMercase( UserPointsMerchandise merchandise); |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/updateDetailsUserPointMercase") |
| | |
| | | |
| | | @PostMapping("/base/pointMerchars/queryUserPointMerchaseByCode") |
| | | public List<UserPointsMerchandise> queryUserPointMerchaseByCode(@RequestBody String code); |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/queryUserHasGoodsNums") |
| | | int queryUserHasGoodsNums(@RequestBody AppUserGoodResp goodResp); |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/deletePaymentRecord") |
| | | void deletePaymentRecord(@RequestBody String code); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.activity.model; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class AppUserGoodResp { |
| | | /** |
| | | * 用户id |
| | | */ |
| | | Integer appUserId; |
| | | /** |
| | | * 商品id |
| | | */ |
| | | Integer goodId; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.feignclient.activity.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class PointMerchandiseVo { |
| | | |
| | | |
| | | List<PointsMerchandise> merchandises; |
| | | |
| | | } |
| | |
| | | */ |
| | | private Long id; |
| | | /** |
| | | * 优惠券id |
| | | * 商品id |
| | | */ |
| | | private Integer pointsMerchandiseId; |
| | | /** |
| | |
| | | * 现金的支付状态(1=待支付 2=已支付) |
| | | */ |
| | | private Integer payStatus; |
| | | /** |
| | | * 可使用的门店id |
| | | */ |
| | | private Integer storeId; |
| | | /** |
| | | * 1=正常 2= 删除 |
| | | */ |
| | | private Integer state; |
| | | |
| | | |
| | | } |
| | |
| | | import com.dsh.account.feignclient.competition.model.GetStuSourseList; |
| | | import com.dsh.account.feignclient.competition.model.PaymentCompetition; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.model.BillingRequest; |
| | | import com.dsh.account.model.BillingRequestVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | List<PurchaseRecordVo> getStuSourseList(@RequestBody GetStuSourseList getStuSourseList); |
| | | |
| | | @PostMapping("/base/competition/getPayedCompetitions") |
| | | List<PaymentCompetition> getAllCompetitionPayRecord(@RequestBody BillingDataRequestVo requestVo); |
| | | BillingRequestVo getAllCompetitionPayRecord(@RequestBody BillingDataRequestVo requestVo); |
| | | |
| | | @PostMapping("/base/competition/getCancelOrderOfUserPay") |
| | | public List<PaymentCompetition> getCancelOrderOfUserPayRecord(@RequestBody BillingDataRequestVo appUserId); |
| | | BillingRequestVo getCancelOrderOfUserPayRecord(@RequestBody BillingDataRequestVo appUserId); |
| | | |
| | | @PostMapping("/base/competition/getPlayPaiFGoldPayRecord") |
| | | List<PaymentCompetition> getPlayPaiFGoldPayRecord(@RequestBody Integer appUserId); |
| | |
| | | public class BillingDataRequestVo { |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | private Date monthStart = null; |
| | | private String monthStart = null; |
| | | |
| | | @ApiModelProperty(value = "结束时间时间") |
| | | private Date monthEnd = null; |
| | | private String monthEnd = null; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | private Integer appUserId; |
| | |
| | | |
| | | import com.dsh.account.feignclient.competition.model.BillingDataRequestVo; |
| | | import com.dsh.account.feignclient.course.model.*; |
| | | import com.dsh.account.model.BillingRequest; |
| | | import com.dsh.account.model.BillingRequestVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | List<PurchaseVo> getAppUsersCourseData(@RequestBody Integer appUserId); |
| | | |
| | | @PostMapping("/base/coursePack/allPaymentCourseList") |
| | | public List<TCoursePackagePayment> getAppuserCourseList(@RequestBody Integer appUserId); |
| | | public List<CouponPaymentVo> getAppuserCourseList(@RequestBody Integer appUserId); |
| | | |
| | | @PostMapping("/coursePackagePayment/courseRenewPlayPaiPay") |
| | | public int paymentWanpaiRenewCourse(@RequestBody PlayPaiGoldCoursePackage coursePackage); |
| | |
| | | public boolean savePaymentCoursePackage(@RequestBody TCoursePackagePayment packagePayment); |
| | | |
| | | @PostMapping("/base/coursePack/allAmountPayRecordOfUser") |
| | | public List<TCoursePackagePayment> getAmountPayRecord(@RequestBody BillingDataRequestVo appUserId); |
| | | BillingRequestVo getAmountPayRecord(@RequestBody BillingDataRequestVo appUserId); |
| | | |
| | | @PostMapping("/base/coursePack/obtainStudentClassDetails") |
| | | List<RecordAppoint> obtainStudentClassDetailsData(@RequestBody WeeksOfCourseRest stuId); |
New file |
| | |
| | | package com.dsh.account.feignclient.course.model; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CouponPaymentVo { |
| | | /** |
| | | * 时间 |
| | | */ |
| | | private String time; |
| | | /** |
| | | * 金额 |
| | | */ |
| | | private double amount; |
| | | |
| | | } |
| | |
| | | public class CourseOfStoreVo { |
| | | |
| | | @ApiModelProperty(value = "课包id") |
| | | private Integer courseId; |
| | | private Long courseId; |
| | | |
| | | @ApiModelProperty(value = "课包名称") |
| | | private String courseName; |
| | |
| | | |
| | | @ApiModelProperty(value = "课包课时价格") |
| | | private double coursePrice; |
| | | |
| | | @ApiModelProperty(value = "预约状态") |
| | | private Integer status; |
| | | } |
| | |
| | | */ |
| | | private BigDecimal cashPayment; |
| | | /** |
| | | * 玩湃币价格 |
| | | * 玩湃币价格/积分 |
| | | */ |
| | | private Integer playPaiCoin; |
| | | /** |
| | |
| | | |
| | | import com.dsh.account.feignclient.competition.model.BillingDataRequestVo; |
| | | import com.dsh.account.feignclient.other.model.SiteBooking; |
| | | import com.dsh.account.model.BillingRequestOfType; |
| | | import com.dsh.account.model.RequestOfTypeVo; |
| | | import com.dsh.account.model.vo.exploreDetail.SiteVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | public interface SiteClient { |
| | | |
| | | @PostMapping("/base/site/queryPaymentSiteDetail") |
| | | List<SiteBooking> getAllSiteBookingList(@RequestBody BillingDataRequestVo appUserId); |
| | | RequestOfTypeVo getAllSiteBookingList(@RequestBody BillingDataRequestVo appUserId); |
| | | |
| | | |
| | | @PostMapping("/base/site/queryPlaypaiGoldSiteDetail") |
| | |
| | | package com.dsh.account.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.account.entity.UserIntegral; |
| | | import com.dsh.account.entity.UserIntegralChanges; |
| | | import com.dsh.account.model.IntegralListQuery; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface UserIntegralChangesMapper extends BaseMapper<UserIntegralChanges> { |
| | | |
| | | Page<UserIntegral> listAll(@Param("userIntegralPage") Page<UserIntegral> userIntegralPage, @Param("query") IntegralListQuery integralListQuery, @Param("sTime") String sTime, @Param("eTime") String eTime); |
| | | } |
New file |
| | |
| | | package com.dsh.account.model; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class BillingRequest { |
| | | |
| | | /** |
| | | * MM-dd HH:mm |
| | | */ |
| | | private String time; |
| | | /** |
| | | * 金额 |
| | | */ |
| | | private double amount; |
| | | } |
New file |
| | |
| | | package com.dsh.account.model; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class BillingRequestOfType { |
| | | /** |
| | | * |
| | | */ |
| | | private Integer status; |
| | | /** |
| | | * MM-dd HH:mm |
| | | */ |
| | | private String time; |
| | | /** |
| | | * 金额 |
| | | */ |
| | | private double amount; |
| | | } |
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 BillingRequestVo { |
| | | |
| | | List<BillingRequest> requests; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class IntegralListQuery { |
| | | private long limit; |
| | | private long offset; |
| | | |
| | | private String name; |
| | | |
| | | private String phone; |
| | | |
| | | private Integer type; |
| | | private Integer category; |
| | | private String time; |
| | | } |
New file |
| | |
| | | package com.dsh.account.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class QueryByNamePhone { |
| | | private String name; |
| | | |
| | | private String phone; |
| | | } |
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 RequestOfTypeVo { |
| | | |
| | | List<BillingRequestOfType> request; |
| | | } |
| | |
| | | public static class CouList{ |
| | | |
| | | @ApiModelProperty(value = "课包ID") |
| | | Integer courseID; |
| | | Long courseID; |
| | | |
| | | @ApiModelProperty(value = "课包名称") |
| | | String courseName; |
| | |
| | | @ApiModelProperty(value = "详细说明") |
| | | String detail; |
| | | |
| | | @ApiModelProperty(value = "预约状态:1=未预约,2=已预约") |
| | | Integer status; |
| | | |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.userBenefitDetail; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class ExchangeDetailsVo { |
| | | |
| | | List<ExchangeDetailsResponse> detailsResponses; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.account.model.vo.userBenefitDetail; |
| | | |
| | | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class GoodsExchangeVo { |
| | | @ApiModelProperty(value = "商品id",required = true) |
| | | Integer goodId; |
| | | |
| | | @ApiModelProperty(value = "商品类型 1实物 2课包 3门票 4优惠券",required = true) |
| | | Integer goodsType; |
| | | |
| | | @ApiModelProperty(value = "兑换数量",required = false) |
| | | Integer nums; |
| | | |
| | | @ApiModelProperty(value = "兑换方式(1=积分,2=积分+现金 3=现金)",required = true) |
| | | Integer exchangeType; |
| | | |
| | | @ApiModelProperty(value = "现金支付方式(1=微信 2=支付宝)",required = false) |
| | | Integer payType; |
| | | |
| | | @ApiModelProperty(value = "学员id列表",required = false) |
| | | List<Integer> stuIds; |
| | | |
| | | @ApiModelProperty(value = "门店id",required = false) |
| | | Integer storeId; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "金额 例如 -90 ") |
| | | private String consumeAmount; |
| | | /** |
| | | * 1充值 2扣除 |
| | | */ |
| | | @ApiModelProperty(value = "1充值 2扣除") |
| | | private Integer recordId; |
| | | |
| | | } |
| | |
| | | |
| | | List<Goods> queryAppUserIntegral(MallRequest request); |
| | | |
| | | ResultUtil uploadAppUserHeadImg(Integer appUserId, MultipartFile file, HttpServletRequest request); |
| | | |
| | | ProductDetailsVo productDetails(Integer goodId, Integer goodsType ); |
| | | |
| | | StuAndStoreResponse queryAppUserDefaultStuAndStore(Integer userIdFormRedis ,Integer pointsMerId, String lat, String lon,Integer isCourse); |
| | | |
| | | ResultUtil productRedemptionOperation(Integer userIdFormRedis, Integer goodId, Integer goodsType,Integer nums,Integer exchangeType,Integer payType,List<Integer> stuIds); |
| | | ResultUtil productRedemptionOperation(Integer userIdFormRedis, GoodsExchangeVo exchangeVo); |
| | | |
| | | ResultUtil exchangeAddPaymentCallback(String code, String orderNumber,Integer payType); |
| | | |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.account.entity.TStudent; |
| | | import com.dsh.account.feignclient.competition.model.PurchaseRecordVo; |
| | | import com.dsh.account.feignclient.course.model.RecordAppoint; |
| | | import com.dsh.account.feignclient.other.model.StoreDetailList; |
| | | import com.dsh.account.feignclient.other.model.StoreInfo; |
| | | import com.dsh.account.feignclient.other.model.SysNotice; |
| | |
| | | * @param appUserId |
| | | * @return |
| | | */ |
| | | AppointmentRecordVo getAppointmentRecords(Integer stuId, Integer appUserId,Integer appointStatus,Integer timeType,String search); |
| | | List<RecordAppoint> getAppointmentRecords(Integer stuId, Integer appUserId, Integer appointStatus, Integer timeType, String search); |
| | | |
| | | ResultUtil cancelReservationOfCourse( Integer courseStuRecordId); |
| | | |
| | |
| | | package com.dsh.account.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.account.entity.UserIntegral; |
| | | import com.dsh.account.entity.UserIntegralChanges; |
| | | import com.dsh.account.model.IntegralListQuery; |
| | | import com.dsh.account.model.SaveUserIntegralChangesVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.ExchangeDetailsResponse; |
| | | import com.dsh.account.model.vo.userBenefitDetail.IntegralsData; |
| | |
| | | |
| | | PointDetailsVo queryRedemptionDetails(Integer detailsId); |
| | | |
| | | Page<UserIntegral> listAll(Page<UserIntegral> userIntegralPage, IntegralListQuery integralListQuery); |
| | | |
| | | |
| | | } |
| | |
| | | import com.dsh.account.feignclient.competition.DeductionCompetitionsClient; |
| | | import com.dsh.account.feignclient.competition.model.PaymentCompetition; |
| | | import com.dsh.account.feignclient.course.CoursePaymentClient; |
| | | import com.dsh.account.feignclient.course.model.CouponPaymentVo; |
| | | import com.dsh.account.feignclient.course.model.TCoursePackagePayment; |
| | | import com.dsh.account.feignclient.other.RechargeConfigClient; |
| | | import com.dsh.account.feignclient.other.SiteClient; |
| | |
| | | import com.dsh.account.model.vo.userBenefitDetail.RechargePayRequest; |
| | | import com.dsh.account.model.vo.userBenefitDetail.RechargesDetail; |
| | | import com.dsh.account.service.RechargeRecordsService; |
| | | import com.dsh.account.util.DateTimeHelper; |
| | | import com.dsh.account.util.PayMoneyUtil; |
| | | import com.dsh.account.util.ResultUtil; |
| | | import com.dsh.account.util.UUIDUtil; |
| | | import com.dsh.account.util.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageImpl; |
| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.EVENT_REGISTRATION.getMsg() ); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(competition.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("-" + competition.getAmount()); |
| | | consumeDetail.setRecordId(2); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | // 2.课包购买 |
| | | List<TCoursePackagePayment> appuserCourseList = cpClient.getAppuserCourseList(appUserId); |
| | | List<CouponPaymentVo> appuserCourseList = cpClient.getAppuserCourseList(appUserId); |
| | | if (appuserCourseList.size() > 0){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : appuserCourseList) { |
| | | for (CouponPaymentVo tCoursePackagePayment : appuserCourseList) { |
| | | RechargesDetail consumeDetail = new RechargesDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.COURSE_PACKAGE_PURCHASE.getMsg() ); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(tCoursePackagePayment.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("-" + tCoursePackagePayment.getPlayPaiCoin()); |
| | | consumeDetail.setConsumeTime(tCoursePackagePayment.getTime()); |
| | | consumeDetail.setConsumeAmount("-" + tCoursePackagePayment.getAmount()); |
| | | consumeDetail.setRecordId(2); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.VENUE_RESERVATION.name()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(booking.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("-" + booking.getPayMoney()); |
| | | consumeDetail.setRecordId(2); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.RECHARGE.name() + ":" + rechargeRecord.getPlayPaiCoins()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(rechargeRecord.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("+" + rechargeRecord.getAmount()); |
| | | consumeDetail.setRecordId(1); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | if (ToolUtil.isNotEmpty(recordId)){ |
| | | details = details.stream() |
| | | .filter(record -> record.getRecordId().equals(recordId)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | if (details.size() > 0 ){ |
| | | Collections.sort(details, new Comparator<RechargesDetail>() { |
| | |
| | | } |
| | | }); |
| | | } |
| | | Pageable pageable = PageRequest.of(pageNum - 1, pageSize); |
| | | Page<RechargesDetail> page = getPage(details, pageable); |
| | | return page.getContent(); |
| | | //当前第几页 |
| | | int pageNo = pageNum; |
| | | //一页五条 |
| | | int size = pageSize; |
| | | |
| | | //分页 |
| | | details = details.stream().skip((pageNo - 1) * size).limit(size). |
| | | collect(Collectors.toList()); |
| | | |
| | | return details; |
| | | } |
| | | |
| | | @Override |
| | |
| | | BigDecimal amount = BigDecimal.ZERO; |
| | | if (rechargeConfig.size() > 0){ |
| | | for (Map<String, Object> stringObjectMap : rechargeConfig) { |
| | | Long o = (Long) stringObjectMap.get("money"); |
| | | double o = (double) stringObjectMap.get("money"); |
| | | if (BigDecimal.valueOf(o).compareTo(request.getAmount()) == 0) { |
| | | amount = BigDecimal.valueOf(o); |
| | | rechargeRecords.setAmount(BigDecimal.valueOf(o)); |
| | |
| | | return null; |
| | | } |
| | | |
| | | // 对数据进行分页处理的方法 |
| | | private static Page<RechargesDetail> getPage(List<RechargesDetail> dataList, Pageable pageable) { |
| | | int start = (int) pageable.getOffset(); |
| | | int end = Math.min((start + pageable.getPageSize()), dataList.size()); |
| | | return new PageImpl<>(dataList.subList(start, end), pageable, dataList.size()); |
| | | public static <T> List<T> pageList(List<T> list, int pageNum, int pageSize) { |
| | | //计算总页数 |
| | | int page = list.size() % pageSize == 0 ? list.size() / pageSize : list.size() / pageSize + 1; |
| | | //兼容性分页参数错误 |
| | | pageNum = pageNum <= 0 ? 1 : pageNum; |
| | | pageNum = pageNum >= page ? page : pageNum; |
| | | // 开始索引 |
| | | int begin = 0; |
| | | // 结束索引 |
| | | int end = 0; |
| | | if (pageNum != page) { |
| | | begin = (pageNum - 1) * pageSize; |
| | | end = begin + pageSize; |
| | | } else { |
| | | begin = (pageNum - 1) * pageSize; |
| | | end = list.size(); |
| | | } |
| | | return list.subList(begin, end); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.dsh.account.feignclient.other.model.StoreDetailOfCourse; |
| | | import com.dsh.account.feignclient.other.model.TImgConfig; |
| | | import com.dsh.account.mapper.*; |
| | | import com.dsh.account.model.AddAppUserVo; |
| | | import com.dsh.account.model.JoinPlayPaiVo; |
| | | import com.dsh.account.model.LoginSMSCodeVo; |
| | | import com.dsh.account.model.LoginWeChatVo; |
| | | import com.dsh.account.model.*; |
| | | import com.dsh.account.model.dto.Coupon; |
| | | import com.dsh.account.model.vo.classDetails.CourseVenue; |
| | | import com.dsh.account.model.vo.classDetails.ExerciseVideo; |
| | |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.data.domain.Pageable; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.StringUtils; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | couList.setCourseName(courseOfStoreVo.getCourseName()); |
| | | couList.setTimeStr(courseOfStoreVo.getClassStartTime() + "-" + courseOfStoreVo.getClassEndTime()); |
| | | couList.setDetail("¥" + courseOfStoreVo.getCoursePrice() + "/会员扣2学时"); |
| | | couList.setStatus(courseOfStoreVo.getStatus()); |
| | | courses.add(couList); |
| | | } |
| | | courseVenue.setCourses(courses); |
| | |
| | | List<ConsumeDetail> details = new ArrayList<>(); |
| | | |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd HH:mm"); |
| | | SimpleDateFormat result = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | Date monthStart = null; |
| | | Date monthEnd = null; |
| | | if (StringUtils.hasText(yearMonth)) { |
| | |
| | | } |
| | | |
| | | BillingDataRequestVo requestVo = new BillingDataRequestVo(); |
| | | requestVo.setMonthStart(monthStart); |
| | | requestVo.setMonthEnd(monthEnd); |
| | | requestVo.setMonthStart(result.format(monthStart)); |
| | | requestVo.setMonthEnd(result.format(monthEnd)); |
| | | requestVo.setAppUserId(appUserId); |
| | | // 1.赛事报名 |
| | | List<PaymentCompetition> allCompetitionPayRecord = deducClient.getAllCompetitionPayRecord(requestVo); |
| | | if (allCompetitionPayRecord.size() > 0 ){ |
| | | for (PaymentCompetition paymentCompetition : allCompetitionPayRecord) { |
| | | BillingRequestVo allCompetitionPayRecord = deducClient.getAllCompetitionPayRecord(requestVo); |
| | | if (ToolUtil.isNotEmpty(allCompetitionPayRecord.getRequests())){ |
| | | for (BillingRequest paymentCompetition : allCompetitionPayRecord.getRequests()) { |
| | | ConsumeDetail consumeDetail = new ConsumeDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.EVENT_REGISTRATION.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(paymentCompetition.getInsertTime())); |
| | | consumeDetail.setConsumeTime(paymentCompetition.getTime()); |
| | | consumeDetail.setConsumeAmount("-" + paymentCompetition.getAmount()); |
| | | details.add(consumeDetail); |
| | | consumeDetail.setType(1); |
| | | } |
| | | } |
| | | // 2.取消赛事报名 |
| | | List<PaymentCompetition> cancelOrderOfUserPayRecord = deducClient.getCancelOrderOfUserPayRecord(requestVo); |
| | | if (cancelOrderOfUserPayRecord.size() > 0 ){ |
| | | for (PaymentCompetition paymentCompetition : cancelOrderOfUserPayRecord) { |
| | | BillingRequestVo cancelOrderOfUserPayRecord = deducClient.getCancelOrderOfUserPayRecord(requestVo); |
| | | if (ToolUtil.isNotEmpty(cancelOrderOfUserPayRecord.getRequests())){ |
| | | for (BillingRequest paymentCompetition : cancelOrderOfUserPayRecord.getRequests()) { |
| | | ConsumeDetail consumeDetail = new ConsumeDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.CANCEL_EVENT_REGISTRATION.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(paymentCompetition.getInsertTime())); |
| | | consumeDetail.setConsumeTime(paymentCompetition.getTime()); |
| | | consumeDetail.setConsumeAmount("+" + paymentCompetition.getAmount()); |
| | | consumeDetail.setType(1); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | // 3.课包购买 |
| | | List<TCoursePackagePayment> amountPayRecord = paymentClient.getAmountPayRecord(requestVo); |
| | | if (amountPayRecord.size() > 0 ){ |
| | | for (TCoursePackagePayment coursePackagePayment : amountPayRecord) { |
| | | BillingRequestVo amountPayRecord = paymentClient.getAmountPayRecord(requestVo); |
| | | if (ToolUtil.isNotEmpty(amountPayRecord.getRequests())){ |
| | | for (BillingRequest coursePackagePayment : amountPayRecord.getRequests()) { |
| | | ConsumeDetail consumeDetail = new ConsumeDetail(); |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.COURSE_PACKAGE_PURCHASE.getMsg()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(coursePackagePayment.getInsertTime())); |
| | | consumeDetail.setConsumeAmount("-" + coursePackagePayment.getCashPayment()); |
| | | consumeDetail.setConsumeTime(coursePackagePayment.getTime()); |
| | | consumeDetail.setConsumeAmount("-" + coursePackagePayment.getAmount()); |
| | | consumeDetail.setType(2); |
| | | details.add(consumeDetail); |
| | | } |
| | | } |
| | | // 4.场地预约 |
| | | List<SiteBooking> allSiteBookingList = stClient.getAllSiteBookingList(requestVo); |
| | | if (allSiteBookingList.size() > 0){ |
| | | for (SiteBooking booking : allSiteBookingList) { |
| | | RequestOfTypeVo allSiteBookingList = stClient.getAllSiteBookingList(requestVo); |
| | | if (ToolUtil.isNotEmpty(allSiteBookingList.getRequest())){ |
| | | for (BillingRequestOfType booking : allSiteBookingList.getRequest()) { |
| | | ConsumeDetail consumeDetail = new ConsumeDetail(); |
| | | if (booking.getStatus() != 5){ |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.VENUE_RESERVATION.getMsg()); |
| | | consumeDetail.setConsumeAmount("-" + booking.getPayMoney()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(booking.getPayTime())); |
| | | consumeDetail.setConsumeAmount("-" + booking.getAmount()); |
| | | consumeDetail.setConsumeTime(booking.getTime()); |
| | | consumeDetail.setType(2); |
| | | }else { |
| | | consumeDetail.setConsumeName(RechargeRecordEnum.CANCEL_VENUE_RESERVATION.getMsg()); |
| | | consumeDetail.setConsumeAmount("+" + booking.getPayMoney()); |
| | | consumeDetail.setConsumeTime(simpleDateFormat.format(booking.getCancelTime())); |
| | | consumeDetail.setConsumeAmount("+" + booking.getAmount()); |
| | | consumeDetail.setConsumeTime(booking.getTime()); |
| | | consumeDetail.setType(1); |
| | | } |
| | | details.add(consumeDetail); |
| | |
| | | CommodityRequest commodityRequest = new CommodityRequest(); |
| | | commodityRequest.setLon(request.getLon()); |
| | | commodityRequest.setLat(request.getLat()); |
| | | List<PointsMerchandise> vicinityGoods = mcClient.getVicinityGoods(commodityRequest); |
| | | if (vicinityGoods.size() > 0) { |
| | | for (PointsMerchandise vicinityGood : vicinityGoods) { |
| | | PointMerchandiseVo vicinityGoods = mcClient.getVicinityGoods(commodityRequest); |
| | | if (ToolUtil.isNotEmpty(vicinityGoods.getMerchandises())) { |
| | | for (PointsMerchandise vicinityGood : vicinityGoods.getMerchandises()) { |
| | | Goods commodity = new Goods(); |
| | | switch (vicinityGood.getType()) { |
| | | case 1: |
| | |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | Pageable pageable = PageRequest.of(request.getPageNum() - 1, request.getPageSize()); |
| | | Page<Goods> page = getPage(goods, pageable); |
| | | return page.getContent(); |
| | | |
| | | //当前第几页 |
| | | int pageNo = request.getPageNum(); |
| | | //一页五条 |
| | | int size = request.getPageSize(); |
| | | |
| | | //分页 |
| | | goods = goods.stream().skip((pageNo - 1) * size).limit(size). |
| | | collect(Collectors.toList()); |
| | | return goods; |
| | | } |
| | | |
| | | // 对数据进行分页处理的方法 |
| | |
| | | int start = (int) pageable.getOffset(); |
| | | int end = Math.min((start + pageable.getPageSize()), dataList.size()); |
| | | return new PageImpl<>(dataList.subList(start, end), pageable, dataList.size()); |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil uploadAppUserHeadImg(Integer appUserId, MultipartFile file, HttpServletRequest request) { |
| | | try { |
| | | String filePath = OssUploadUtil.ossUpload(request,file); |
| | | TAppUser tAppUser = this.baseMapper.selectById(appUserId); |
| | | tAppUser.setHeadImg(filePath); |
| | | this.baseMapper.updateById(tAppUser); |
| | | } catch (IOException e) { |
| | | ResultUtil.error("头像上传失败!"); |
| | | } |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | |
| | | } |
| | | |
| | | @Override |
| | | public ResultUtil productRedemptionOperation(Integer userIdFormRedis, Integer goodId, Integer goodsType,Integer nums,Integer exchangeType,Integer payType,List<Integer> stuIds) { |
| | | PointsMerchandise merchandise = mcClient.selectPointsMerchandiseById(goodId); |
| | | @Transactional |
| | | public ResultUtil productRedemptionOperation(Integer userIdFormRedis, GoodsExchangeVo exchangeType) { |
| | | System.out.println("exchangeType:--->"); |
| | | System.out.println(exchangeType); |
| | | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | String code = sdf.format(new Date()) + UUIDUtil.getNumberRandom(5); |
| | | for (int i = 0; i < nums; i++) { |
| | | PointsMerchandise merchandise = mcClient.selectPointsMerchandiseById(exchangeType.getGoodId()); |
| | | if (ToolUtil.isEmpty(merchandise)){ |
| | | return ResultUtil.error("商品不存在"); |
| | | } |
| | | TAppUser tAppUser = this.baseMapper.selectById(userIdFormRedis); |
| | | if (ToolUtil.isEmpty(tAppUser)){ |
| | | return ResultUtil.error("用户不存在"); |
| | | } |
| | | int goodsNums = 0; |
| | | if (ToolUtil.isEmpty(exchangeType.getNums())){ |
| | | goodsNums = 1; |
| | | }else { |
| | | goodsNums = exchangeType.getNums(); |
| | | } |
| | | AppUserGoodResp goodResp = new AppUserGoodResp(); |
| | | goodResp.setAppUserId(userIdFormRedis); |
| | | goodResp.setGoodId(merchandise.getId()); |
| | | int count = mcClient.queryUserHasGoodsNums(goodResp); |
| | | if (ToolUtil.isNotEmpty(count) && count >= merchandise.getPickUpQuantity()){ |
| | | return ResultUtil.error("超过限领数量"); |
| | | } |
| | | |
| | | for (int i = 0; i < goodsNums; i++) { |
| | | // 新增积分商品兑换记录 |
| | | UserPointsMerchandise pointsMerchandise = new UserPointsMerchandise(); |
| | | pointsMerchandise.setPointsMerchandiseId(goodId); |
| | | pointsMerchandise.setPointsMerchandiseId(exchangeType.getGoodId()); |
| | | pointsMerchandise.setUserId(userIdFormRedis); |
| | | pointsMerchandise.setStatus(1); |
| | | pointsMerchandise.setState(1); |
| | | if (merchandise.getUseScope() == 3){ |
| | | if (exchangeType.getGoodsType() == 2){ |
| | | CoursePackage coursePackage = cpageClient.queryCoursePackageById(merchandise.getCoursePackageId()); |
| | | pointsMerchandise.setStoreId(coursePackage.getStoreId()); |
| | | }else { |
| | | pointsMerchandise.setStoreId(exchangeType.getStoreId()); |
| | | } |
| | | } |
| | | pointsMerchandise.setCode(code); |
| | | mcClient.saveDetailsUserPointMercase(pointsMerchandise); |
| | | } |
| | | |
| | | // 扣减积分 |
| | | TAppUser tAppUser = this.baseMapper.selectById(userIdFormRedis); |
| | | |
| | | |
| | | // 积分变更记录 |
| | | UserIntegralChanges userIntegralChanges = new UserIntegralChanges(); |
| | | userIntegralChanges.setAppUserId(userIdFormRedis); |
| | | userIntegralChanges.setOldIntegral(tAppUser.getIntegral()); |
| | | userIntegralChanges.setType(2); |
| | | tAppUser.setIntegral(null == tAppUser.getIntegral() ? merchandise.getIntegral() : tAppUser.getIntegral() +merchandise.getIntegral()); |
| | | userIntegralChanges.setNewIntegral(tAppUser.getIntegral()); |
| | | userIntegralChanges.setInsertTime(new Date()); |
| | | uicMapper.insert(userIntegralChanges); |
| | | |
| | | this.baseMapper.updateById(tAppUser); |
| | | // 现金支付 |
| | | if (exchangeType == 2) { |
| | | switch (goodsType) { |
| | | case 2: |
| | | for (int i = 0; i < stuIds.size(); i++) { |
| | | List<CoursePackagePaymentConfig> courseConfigList = cpconClient.getCourseConfigList(merchandise.getCoursePackageId()); |
| | | |
| | | TCoursePackagePayment packagePayment = new TCoursePackagePayment(); |
| | | packagePayment.setAppUserId(userIdFormRedis); |
| | | packagePayment.setStudentId(stuIds.get(i)); |
| | | packagePayment.setCoursePackageId(merchandise.getCoursePackageId()); |
| | | for (CoursePackagePaymentConfig coursePackagePaymentConfig : courseConfigList) { |
| | | if (Objects.equals(coursePackagePaymentConfig.getId(),merchandise.getCoursePackageConfigId())){ |
| | | packagePayment.setClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | packagePayment.setTotalClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | packagePayment.setLaveClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | packagePayment.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | break; |
| | | switch (exchangeType.getExchangeType()){ |
| | | // 积分 |
| | | case 1: |
| | | boolean b = dealAppUserIntegral(userIdFormRedis,tAppUser,merchandise.getIntegral()); |
| | | if (b){ |
| | | switch (exchangeType.getGoodsType()){ |
| | | case 2: |
| | | Integer stuNums = 0; |
| | | if (ToolUtil.isNotEmpty(exchangeType.getStuIds())){ |
| | | stuNums = exchangeType.getStuIds().size(); |
| | | }else { |
| | | stuNums = 1; |
| | | } |
| | | for (int i = 0; i < stuNums; i++) { |
| | | List<CoursePackagePaymentConfig> courseConfigList = cpconClient.getCourseConfigList(merchandise.getCoursePackageId()); |
| | | TCoursePackagePayment packagePayment = new TCoursePackagePayment(); |
| | | packagePayment.setAppUserId(userIdFormRedis); |
| | | packagePayment.setStudentId(exchangeType.getStuIds().get(i)); |
| | | packagePayment.setCoursePackageId(merchandise.getCoursePackageId()); |
| | | for (CoursePackagePaymentConfig coursePackagePaymentConfig : courseConfigList) { |
| | | if (Objects.equals(coursePackagePaymentConfig.getId(), merchandise.getCoursePackageConfigId())) { |
| | | packagePayment.setClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | packagePayment.setTotalClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | packagePayment.setLaveClassHours(coursePackagePaymentConfig.getClassHours()); |
| | | packagePayment.setOriginalPrice(coursePackagePaymentConfig.getCashPayment()); |
| | | break; |
| | | } |
| | | } |
| | | packagePayment.setPlayPaiCoin(merchandise.getIntegral()); |
| | | packagePayment.setAbsencesNumber(0); |
| | | packagePayment.setPayUserType(1); |
| | | packagePayment.setPayStatus(2); |
| | | packagePayment.setPayUserId(userIdFormRedis); |
| | | packagePayment.setStatus(1); |
| | | packagePayment.setState(1); |
| | | packagePayment.setCode(code); |
| | | paymentClient.savePaymentCoursePackage(packagePayment); |
| | | } |
| | | break; |
| | | case 4: |
| | | for (int i = 0; i < goodsNums; i++) { |
| | | UserCoupon coupon = new UserCoupon(); |
| | | coupon.setCouponId(exchangeType.getGoodId()); |
| | | coupon.setUserId(userIdFormRedis); |
| | | coupon.setStatus(1); |
| | | ucponClient.insertToAppuserCoupon(coupon); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | }else { |
| | | return ResultUtil.error("用户积分不足!"); |
| | | } |
| | | break; |
| | | case 2: |
| | | // 积分+现金 |
| | | boolean dealt = dealAppUserIntegral(userIdFormRedis,tAppUser,merchandise.getIntegral()); |
| | | switch (exchangeType.getPayType()) { |
| | | case 1: |
| | | try { |
| | | if (merchandise.getType() == 2) { |
| | | return WechatPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code); |
| | | } else { |
| | | return WechatPayment(merchandise.getCash().multiply(new BigDecimal(goodsNums)), code); |
| | | } |
| | | } catch (Exception e) { |
| | | return ResultUtil.runErr(); |
| | | } |
| | | packagePayment.setPlayPaiCoin(merchandise.getIntegral()); |
| | | packagePayment.setAbsencesNumber(0); |
| | | packagePayment.setPayUserType(1); |
| | | packagePayment.setPayStatus(1); |
| | | packagePayment.setPayUserId(userIdFormRedis); |
| | | packagePayment.setStatus(1); |
| | | packagePayment.setState(1); |
| | | packagePayment.setInsertTime(new Date()); |
| | | packagePayment.setCode(code); |
| | | paymentClient.savePaymentCoursePackage(packagePayment); |
| | | } |
| | | break; |
| | | case 4: |
| | | for (int i = 0; i < nums; i++) { |
| | | UserCoupon coupon = new UserCoupon(); |
| | | coupon.setCouponId(goodId); |
| | | coupon.setUserId(userIdFormRedis); |
| | | coupon.setStatus(1); |
| | | coupon.setInsertTime(new Date()); |
| | | ucponClient.insertToAppuserCoupon(coupon); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | switch (payType){ |
| | | case 1: |
| | | try { |
| | | if (merchandise.getType() == 2){ |
| | | return WechatPayment(merchandise.getCash().multiply(new BigDecimal(stuIds.size())),code); |
| | | }else { |
| | | return WechatPayment(merchandise.getCash().multiply(new BigDecimal(nums)),code); |
| | | case 2: |
| | | if (merchandise.getType() == 2) { |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code); |
| | | } else { |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(goodsNums)), code); |
| | | } |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | case 2: |
| | | if (merchandise.getType() == 2){ |
| | | AlipayPayment(merchandise.getCash().multiply(new BigDecimal(stuIds.size())),code); |
| | | }else { |
| | | AlipayPayment(merchandise.getCash().multiply(new BigDecimal(nums)),code); |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | default: |
| | | break; |
| | | } |
| | | break; |
| | | case 3: |
| | | switch (exchangeType.getPayType()) { |
| | | case 1: |
| | | try { |
| | | if (merchandise.getType() == 2) { |
| | | return WechatPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code); |
| | | } else { |
| | | return WechatPayment(merchandise.getCash().multiply(new BigDecimal(goodsNums)), code); |
| | | } |
| | | } catch (Exception e) { |
| | | return ResultUtil.runErr(); |
| | | } |
| | | case 2: |
| | | if (merchandise.getType() == 2) { |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(exchangeType.getStuIds().size())), code); |
| | | } else { |
| | | return AlipayPayment(merchandise.getCash().multiply(new BigDecimal(goodsNums)), code); |
| | | } |
| | | default: |
| | | break; |
| | | } |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | public boolean dealAppUserIntegral(Integer appUserId,TAppUser appUser,Integer points){ |
| | | try { |
| | | if (ToolUtil.isEmpty(appUser.getIntegral()) || (ToolUtil.isNotEmpty(appUser.getIntegral()) && appUser.getIntegral() < points)){ |
| | | return false; |
| | | } |
| | | // 积分变更记录 |
| | | UserIntegralChanges userIntegralChanges = new UserIntegralChanges(); |
| | | userIntegralChanges.setAppUserId(appUserId); |
| | | userIntegralChanges.setOldIntegral(appUser.getIntegral()); |
| | | userIntegralChanges.setType(2); |
| | | appUser.setIntegral(null == appUser.getIntegral() ? points : appUser.getIntegral() - points); |
| | | userIntegralChanges.setNewIntegral(appUser.getIntegral()); |
| | | userIntegralChanges.setInsertTime(new Date()); |
| | | userIntegralChanges.setCategory(2); |
| | | uicMapper.insert(userIntegralChanges); |
| | | |
| | | this.baseMapper.updateById(appUser); |
| | | return true; |
| | | }catch (Exception e){ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | private ResultUtil AlipayPayment(BigDecimal cash, String code) { |
| | | ResultUtil alipay = payMoneyUtil.alipay("课包续费", "", "", code, cash.toString(), |
| | |
| | | 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){ |
| | | // coursePackagePayment.setState(3); |
| | | // couPayClient.delPaymentCoursePackage(coursePackagePayment.getId()); |
| | | // break; |
| | | // } |
| | | if("REFUND".equals(s) || "NOTPAY".equals(s) || "CLOSED".equals(s) || "REVOKED".equals(s) || "PAYERROR".equals(s) || num == 10){ |
| | | mcClient.deletePaymentRecord(code); |
| | | break; |
| | | } |
| | | if("TRADE_SUCCESS".equals(s)){ |
| | | for (UserPointsMerchandise userPointsMerchandise : userPointsMerchandises) { |
| | | userPointsMerchandise.setPayStatus(2); |
| | |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | mcClient.deletePaymentRecord(code); |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | |
| | | 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){ |
| | | // coursePackagePayment.setState(3); |
| | | // couPayClient.delPaymentCoursePackage(coursePackagePayment.getId()); |
| | | // break; |
| | | // } |
| | | if("REFUND".equals(s) || "NOTPAY".equals(s) || "CLOSED".equals(s) || "REVOKED".equals(s) || "PAYERROR".equals(s) || num == 10){ |
| | | mcClient.deletePaymentRecord(code); |
| | | break; |
| | | } |
| | | if("SUCCESS".equals(s)){ |
| | | for (UserPointsMerchandise userPointsMerchandise : userPointsMerchandises) { |
| | | userPointsMerchandise.setPayStatus(2); |
| | |
| | | coupon.setCouponId(userPointsMerchandises.get(0).getPointsMerchandiseId()); |
| | | coupon.setUserId(userPointsMerchandises.get(0).getUserId()); |
| | | coupon.setStatus(1); |
| | | coupon.setInsertTime(new Date()); |
| | | ucponClient.insertToAppuserCoupon(coupon); |
| | | break; |
| | | default: |
| | |
| | | coupon.setCouponId(userPointsMerchandises.get(0).getPointsMerchandiseId()); |
| | | coupon.setUserId(userPointsMerchandises.get(0).getUserId()); |
| | | coupon.setStatus(1); |
| | | coupon.setInsertTime(new Date()); |
| | | ucponClient.insertToAppuserCoupon(coupon); |
| | | break; |
| | | default: |
| | |
| | | List<StoreResponse> responses = new ArrayList<>(); |
| | | if (goodsType == 4){ |
| | | List<Integer> couponStoreIds = ucponClient.getCouponStoreIds(pointsMerId); |
| | | for (Integer couponStoreId : couponStoreIds) { |
| | | StoreDetailOfCourse courseOfStore = storeClient.getCourseOfStore(couponStoreId); |
| | | if(ToolUtil.isNotEmpty(courseOfStore)){ |
| | | StoreResponse response = new StoreResponse(); |
| | | response.setStoreId(couponStoreId); |
| | | response.setStoreName(courseOfStore.getStoreName()); |
| | | responses.add(response); |
| | | if (couponStoreIds.size() > 0 ){ |
| | | for (Integer couponStoreId : couponStoreIds) { |
| | | StoreDetailOfCourse courseOfStore = storeClient.getCourseOfStore(couponStoreId); |
| | | if(ToolUtil.isNotEmpty(courseOfStore)){ |
| | | StoreResponse response = new StoreResponse(); |
| | | response.setStoreId(couponStoreId); |
| | | response.setStoreName(courseOfStore.getStoreName()); |
| | | responses.add(response); |
| | | } |
| | | } |
| | | } |
| | | |
| | | }else { |
| | | List<Integer> integers = mcsClient.queryPointMerStoreIds(pointsMerId); |
| | | for (Integer integer : integers) { |
| | | StoreDetailOfCourse courseOfStore = storeClient.getCourseOfStore(integer); |
| | | if(ToolUtil.isNotEmpty(courseOfStore)){ |
| | | StoreResponse response = new StoreResponse(); |
| | | response.setStoreId(integer); |
| | | response.setStoreName(courseOfStore.getStoreName()); |
| | | responses.add(response); |
| | | if (integers.size() > 0 ){ |
| | | for (Integer integer : integers) { |
| | | StoreDetailOfCourse courseOfStore = storeClient.getCourseOfStore(integer); |
| | | if(ToolUtil.isNotEmpty(courseOfStore)){ |
| | | StoreResponse response = new StoreResponse(); |
| | | response.setStoreId(integer); |
| | | response.setStoreName(courseOfStore.getStoreName()); |
| | | responses.add(response); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AppointmentRecordVo getAppointmentRecords(Integer stuId, Integer appUserId,Integer appointStatus,Integer timeType,String search) { |
| | | AppointmentRecordVo recordVo = new AppointmentRecordVo(); |
| | | TStudent tStudent = this.baseMapper.selectOne(new QueryWrapper<TStudent>() |
| | | .eq("id",stuId ) |
| | | .eq("appUserId",appUserId)); |
| | | if (ToolUtil.isNotEmpty(tStudent)){ |
| | | recordVo.setStuId(tStudent.getId()); |
| | | recordVo.setStuName(tStudent.getName()); |
| | | WeeksOfCourseRest courseRest = new WeeksOfCourseRest(); |
| | | courseRest.setAppUserId(appUserId); |
| | | courseRest.setStuId(stuId); |
| | | List<RecordAppoint> recordAppoints = couPayClient.obtainStudentClassDetailsData(courseRest); |
| | | if (ToolUtil.isEmpty(appointStatus)){ |
| | | recordVo.setAppointStatus(0); |
| | | }else { |
| | | recordVo.setAppointStatus(appointStatus); |
| | | if (recordAppoints.size() > 0 ){ |
| | | public List<RecordAppoint> getAppointmentRecords(Integer stuId, Integer appUserId,Integer appointStatus,Integer timeType,String search) { |
| | | WeeksOfCourseRest courseRest = new WeeksOfCourseRest(); |
| | | courseRest.setAppUserId(appUserId); |
| | | courseRest.setStuId(stuId); |
| | | List<RecordAppoint> recordAppoints = couPayClient.obtainStudentClassDetailsData(courseRest); |
| | | if (recordAppoints.size() > 0) { |
| | | if (ToolUtil.isNotEmpty(appointStatus) && appointStatus != 0) { |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> record.getStatus().equals(appointStatus)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if (ToolUtil.isNotEmpty(search)){ |
| | | recordVo.setAppointStatus(appointStatus); |
| | | if (recordAppoints.size() > 0 ){ |
| | | if (ToolUtil.isNotEmpty(search)) { |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> record.getCoursePackageName().contains(search)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if (ToolUtil.isNotEmpty(timeType)){ |
| | | |
| | | if (ToolUtil.isNotEmpty(timeType) && timeType != 0) { |
| | | Date lastOfDate = DateUtil.getLastOfDate(); |
| | | switch (timeType){ |
| | | switch (timeType) { |
| | | case 1: |
| | | Date lastWeekStartDate = DateUtil.getLastWeekStartDate(); |
| | | if (recordAppoints.size() > 0 ){ |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> { |
| | | try { |
| | |
| | | } |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | break; |
| | | case 2: |
| | | Date lastMonthStartDate = DateUtil.getLastMonthStartDate(); |
| | | if (recordAppoints.size() > 0 ){ |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> { |
| | | try { |
| | |
| | | } |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | break; |
| | | case 3: |
| | | Date lastYearStartDate = DateUtil.getLastYearStartDate(); |
| | | if (recordAppoints.size() > 0 ){ |
| | | recordAppoints = recordAppoints.stream() |
| | | .filter(record -> { |
| | | try { |
| | |
| | | } |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | |
| | | break; |
| | | default: |
| | | break; |
| | | |
| | | } |
| | | } |
| | | recordVo.setAppointList(recordAppoints); |
| | | } |
| | | return recordVo; |
| | | return recordAppoints; |
| | | } |
| | | |
| | | @Override |
| | |
| | | package com.dsh.account.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.account.entity.TAppUser; |
| | | import com.dsh.account.entity.UserIntegral; |
| | | import com.dsh.account.entity.UserIntegralChanges; |
| | | import com.dsh.account.feignclient.activity.MerChandiseClient; |
| | | import com.dsh.account.mapper.TAppUserMapper; |
| | | import com.dsh.account.mapper.UserIntegralChangesMapper; |
| | | import com.dsh.account.model.IntegralListQuery; |
| | | import com.dsh.account.model.SaveUserIntegralChangesVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.ExchangeDetailsResponse; |
| | | import com.dsh.account.model.vo.userBenefitDetail.ExchangeDetailsVo; |
| | | import com.dsh.account.model.vo.userBenefitDetail.IntegralsData; |
| | | import com.dsh.account.model.vo.userBenefitDetail.PointDetailsVo; |
| | | import com.dsh.account.service.UserIntegralChangesService; |
| | |
| | | appUser.setIntegral(appUser.getIntegral() + vo.getIntegral()); |
| | | userIntegralChanges.setNewIntegral(appUser.getIntegral()); |
| | | userIntegralChanges.setInsertTime(new Date()); |
| | | userIntegralChanges.setCategory(1); |
| | | this.save(userIntegralChanges); |
| | | } |
| | | |
| | | @Override |
| | | public List<ExchangeDetailsResponse> queryExchangeGoodsdetails(Integer userIdFormRedis, Integer useType, Integer goodType) { |
| | | List<ExchangeDetailsResponse> integralExchangeDetails = mcClient.getIntegralExchangeDetails(userIdFormRedis); |
| | | if (ToolUtil.isNotEmpty(useType)){ |
| | | integralExchangeDetails = integralExchangeDetails.stream() |
| | | .filter(response -> Objects.equals(response.getUseStatus(), useType)) |
| | | .collect(Collectors.toList()); |
| | | List<ExchangeDetailsResponse> detailsResponses = new ArrayList<>(); |
| | | ExchangeDetailsVo integralExchangeDetails = mcClient.getIntegralExchangeDetails(userIdFormRedis); |
| | | if (ToolUtil.isNotEmpty(integralExchangeDetails.getDetailsResponses())){ |
| | | detailsResponses = integralExchangeDetails.getDetailsResponses(); |
| | | if (ToolUtil.isNotEmpty(useType)){ |
| | | detailsResponses = integralExchangeDetails.getDetailsResponses().stream() |
| | | .filter(response -> Objects.equals(response.getUseStatus(), useType)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | if (ToolUtil.isNotEmpty(goodType)){ |
| | | detailsResponses = integralExchangeDetails.getDetailsResponses().stream() |
| | | .filter(response -> Objects.equals(response.getGoodType(), goodType)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | } |
| | | if (ToolUtil.isNotEmpty(goodType)){ |
| | | integralExchangeDetails = integralExchangeDetails.stream() |
| | | .filter(response -> Objects.equals(response.getGoodType(), goodType)) |
| | | .collect(Collectors.toList()); |
| | | } |
| | | return integralExchangeDetails; |
| | | return detailsResponses; |
| | | } |
| | | |
| | | @Override |
| | | public PointDetailsVo queryRedemptionDetails(Integer detailsId) { |
| | | return mcClient.getSpecificsOfGoods(detailsId); |
| | | } |
| | | |
| | | @Override |
| | | public Page<UserIntegral> listAll(Page<UserIntegral> userIntegralPage, IntegralListQuery integralListQuery) { |
| | | String sTime =null; |
| | | String eTime =null; |
| | | if(ToolUtil.isNotEmpty(integralListQuery.getTime())){ |
| | | sTime = integralListQuery.getTime().split(" - ")[0]+" 00:00:00"; |
| | | eTime = integralListQuery.getTime().split(" - ")[1]+" 23:59:59"; |
| | | } |
| | | Page<UserIntegral> userIntegrals = this.baseMapper.listAll(userIntegralPage, integralListQuery, sTime, eTime); |
| | | for (UserIntegral userIntegral : userIntegrals.getRecords()) { |
| | | if(userIntegral.getCategory()==1){ |
| | | userIntegral.setIntegral(userIntegral.getNewIntegral()-userIntegral.getOldIntegral()); |
| | | }else { |
| | | userIntegral.setIntegral(userIntegral.getOldIntegral()-userIntegral.getNewIntegral()); |
| | | } |
| | | } |
| | | return userIntegrals; |
| | | } |
| | | } |
| | |
| | | <mapper namespace="com.dsh.account.mapper.UserIntegralChangesMapper"> |
| | | |
| | | |
| | | <select id="listAll" resultType="com.dsh.account.entity.UserIntegral"> |
| | | select t1.id,t2.province,t2.city,t2.name,t2.phone,t1.type,t1.oldIntegral,t1.newIntegral,t1.category ,t1.insertTime,t1.remark from t_user_integral_changes t1 left join t_app_user t2 on t1.appUserId = t2.id |
| | | where 1=1 |
| | | <if test="query.name !=null and query.name !=''"> |
| | | and t2.name like concat("%",#{query.name},"%") |
| | | </if> |
| | | <if test="query.phone !=null and query.phone !=''"> |
| | | and t2.phone like concat("%",#{query.phone},"%") |
| | | </if> |
| | | <if test="query.type !=null "> |
| | | and t1.type like concat("%",#{query.type},"%") |
| | | </if> |
| | | <if test="query.category !=null "> |
| | | and t1.category like concat("%",#{query.category},"%") |
| | | </if> |
| | | <if test="sTime !=null "> |
| | | and t1.insertTime between #{sTime} and #{eTime} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.activity.entity.Coupon; |
| | | import com.dsh.activity.entity.CouponCity; |
| | | import com.dsh.activity.entity.CouponStore; |
| | | import com.dsh.activity.entity.UserCoupon; |
| | | import com.dsh.activity.feignclient.account.AppUserClient; |
| | | import com.dsh.activity.feignclient.account.CityClient; |
| | | import com.dsh.activity.feignclient.account.StoreStaffClient; |
| | | import com.dsh.activity.feignclient.account.model.TCityManager; |
| | | import com.dsh.activity.feignclient.account.model.TStoreStaff; |
| | | import com.dsh.activity.feignclient.model.CouponExamineListSearch; |
| | | import com.dsh.activity.feignclient.model.CouponListOfSearch; |
| | | import com.dsh.activity.feignclient.other.RegionClient; |
| | | import com.dsh.activity.feignclient.other.StoreClient; |
| | | import com.dsh.activity.feignclient.other.model.CityDataAndProvinceDataVo; |
| | | import com.dsh.activity.feignclient.other.model.Store; |
| | | import com.dsh.activity.model.CouponListVo; |
| | | import com.dsh.activity.model.CouponRecordQuery; |
| | | import com.dsh.activity.model.request.CommodityRequest; |
| | | import com.dsh.activity.model.request.CouponDataVo; |
| | | import com.dsh.activity.model.request.CouponPackageReq; |
| | | import com.dsh.activity.model.response.CouponPackageResp; |
| | | import com.dsh.activity.service.CouponCityService; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Resource |
| | | private StoreClient stoClient; |
| | | |
| | | |
| | | @Resource |
| | | private RegionClient regionClient; |
| | | |
| | | @Resource |
| | | private CouponStoreService couStoreService; |
| | | |
| | | @Resource |
| | | private CouponCityService cityService; |
| | | |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | @PostMapping("/base/coupon/insertToAppuserCoupon") |
| | | public void insertToAppuserCoupon(@RequestBody UserCoupon coupon){ |
| | | coupon.setInsertTime(new Date()); |
| | | ucService.save(coupon); |
| | | } |
| | | |
| | |
| | | JSONObject jsonObject = JSON.parseObject(coupon.getContent()); |
| | | switch (coupon.getType()){ |
| | | case 1: |
| | | couponInfo.put("num1",jsonObject.getDouble("num1")); |
| | | couponInfo.put("num2",jsonObject.getDouble("num2")); |
| | | // {"conditionalAmount":50,"deductionAmount":10,"experienceName":""} |
| | | couponInfo.put("num1",jsonObject.getDouble("conditionalAmount")); |
| | | couponInfo.put("num2",jsonObject.getDouble("deductionAmount")); |
| | | break; |
| | | case 2: |
| | | couponInfo.put("num1",jsonObject.getDouble("num1")); |
| | | couponInfo.put("num1",jsonObject.getDouble("conditionalAmount")); |
| | | break; |
| | | case 3: |
| | | couponInfo.put("num1",jsonObject.getString("num1")); |
| | | couponInfo.put("num1",jsonObject.getString("experienceName")); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/insertIntoCouponData") |
| | | public boolean saveCouponData(@RequestBody CouponDataVo dataVo){ |
| | | try { |
| | | System.out.println(dataVo); |
| | | Coupon coupon = new Coupon(); |
| | | coupon.setName(dataVo.getCouponName()); |
| | | coupon.setType(dataVo.getPrescription()); |
| | | HashMap<String, Object> stringObjectHashMap = new HashMap<>(); |
| | | switch (dataVo.getPrescription()){ |
| | | // {"conditionalAmount":50,"deductionAmount":10,"experienceName":""} |
| | | case 1: |
| | | stringObjectHashMap.put("conditionalAmount",dataVo.getCondition()); |
| | | stringObjectHashMap.put("deductionAmount",dataVo.getSubtraction()); |
| | | coupon.setContent(stringObjectHashMap.toString()); |
| | | break; |
| | | case 2: |
| | | stringObjectHashMap.put("conditionalAmount",dataVo.getDiscount()); |
| | | coupon.setContent(stringObjectHashMap.toString()); |
| | | break; |
| | | case 3: |
| | | stringObjectHashMap.put("experienceName",dataVo.getExperience()); |
| | | coupon.setContent(stringObjectHashMap.toString()); |
| | | break; |
| | | default: |
| | | break; |
| | | } |
| | | coupon.setIllustrate(dataVo.getIllustrate()); |
| | | coupon.setDistributionMethod(dataVo.getDistributionMethod()); |
| | | coupon.setRedemptionMethod(dataVo.getExchangeMethod()); |
| | | coupon.setCash(dataVo.getRequiredCash()); |
| | | coupon.setIntegral(BigDecimal.valueOf(dataVo.getRequiredPoints())); |
| | | coupon.setQuantityIssued(dataVo.getQuantityIssued()); |
| | | coupon.setPickUpQuantity(dataVo.getPickUpQuantity()); |
| | | coupon.setUseScope(dataVo.getCompany()); |
| | | coupon.setAuditStatus(1); |
| | | coupon.setStatus(1); |
| | | coupon.setInsertTime(new Date()); |
| | | coupon.setCover(dataVo.getGoodImg()); |
| | | List<String> goodImgs = dataVo.getGoodImgs(); |
| | | StringBuilder builder = new StringBuilder(); |
| | | if (goodImgs.size() > 0){ |
| | | if (goodImgs.size() == 1){ |
| | | coupon.setProductImages(goodImgs.get(0)); |
| | | }else { |
| | | for (String goodImg : goodImgs) { |
| | | builder.append(goodImg).append(","); |
| | | } |
| | | builder.deleteCharAt(builder.lastIndexOf(",")); |
| | | coupon.setProductImages(builder.toString()); |
| | | } |
| | | } |
| | | coupon.setPublisherType(dataVo.getUserType()); |
| | | if (dataVo.getUserType() == 1){ |
| | | coupon.setCityManagerId(dataVo.getCityManagerId()); |
| | | } |
| | | boolean save = couponService.save(coupon); |
| | | if (save){ |
| | | if (dataVo.getCompany() == 2){ |
| | | for (Integer storeId : dataVo.getStoreIds()) { |
| | | CouponStore couponStore = new CouponStore(); |
| | | couponStore.setCouponId(coupon.getId()); |
| | | couponStore.setStoreId(storeId); |
| | | couStoreService.save(couponStore); |
| | | } |
| | | } |
| | | List<Integer> cityIds = dataVo.getCityIds(); |
| | | if (dataVo.getCompany() == 3 && cityIds.size() > 0 ){ |
| | | List<CityDataAndProvinceDataVo> cityAndProvince = regionClient.getCityAndProvince(cityIds); |
| | | for (CityDataAndProvinceDataVo cityId : cityAndProvince) { |
| | | CouponCity couponCity = new CouponCity(); |
| | | couponCity.setCouponId(coupon.getId()); |
| | | couponCity.setCityCode(cityId.getCityCode()); |
| | | couponCity.setCity(cityId.getCityName()); |
| | | couponCity.setProvinceCode(cityId.getProvinceCode()); |
| | | couponCity.setProvince(cityId.getProvinceName()); |
| | | cityService.save(couponCity); |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | }catch (Exception e){ |
| | | return false; |
| | | } |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/queryCity") |
| | | public List<CouponCity> queryCity(@RequestBody Integer id){ |
| | | List<CouponCity> list = cityService.list(new LambdaQueryWrapper<CouponCity>().eq(CouponCity::getCouponId, id)); |
| | | return list; |
| | | } |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coupon/queryStore") |
| | | public List<Integer> queryStore(@RequestBody Integer id){ |
| | | return couStoreService.list(new LambdaQueryWrapper<CouponStore>().eq(CouponStore::getCouponId,id)).stream().map(CouponStore::getStoreId).collect(Collectors.toList()); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/base/coupon/listRecord") |
| | | @ResponseBody |
| | | public List<Map<String,Object>> listRecord(@RequestBody CouponRecordQuery ofSearch){ |
| | | Page<Object> objectPage = new Page<>(ofSearch.getOffset(), ofSearch.getLimit()); |
| | | return couponService.listRecord(objectPage,ofSearch.getId(),ofSearch.getIds(),ofSearch.getType()); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/base/coupon/updateType") |
| | | public void updateType(@RequestBody Long id){ |
| | | couponService.updateType(id); |
| | | } |
| | | } |
| | |
| | | import com.dsh.activity.feignclient.model.*; |
| | | import com.dsh.activity.feignclient.other.StoreClient; |
| | | import com.dsh.activity.feignclient.other.model.StoreDetailOfCourse; |
| | | import com.dsh.activity.model.PointMerchandiseVo; |
| | | import com.dsh.activity.model.request.AppUserGoodResp; |
| | | import com.dsh.activity.model.request.CommodityRequest; |
| | | import com.dsh.activity.service.*; |
| | | import com.dsh.activity.util.GDMapGeocodingUtil; |
| | |
| | | List<IntegralCommodity> commodity = new ArrayList<>(); |
| | | List<PointsMerchandise> merchandises = pmdsService.list(new QueryWrapper<PointsMerchandise>() |
| | | .eq("state",1) |
| | | .eq("shelves",1) |
| | | .gt("endTime",new Date())); |
| | | if (merchandises.size() > 0){ |
| | | for (PointsMerchandise merchandise : merchandises) { |
| | |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/getCommoditys") |
| | | public List<PointsMerchandise> getVicinityGoods(@RequestBody CommodityRequest request){ |
| | | public PointMerchandiseVo getVicinityGoods(@RequestBody CommodityRequest request){ |
| | | PointMerchandiseVo pointMerchandiseVo = new PointMerchandiseVo(); |
| | | List<PointsMerchandise> list = new ArrayList<>(); |
| | | String provinceCode = ""; |
| | | String cityCode = ""; |
| | | if (ToolUtil.isEmpty(request.getLon()) && ToolUtil.isEmpty(request.getLat())){ |
| | | return list; |
| | | return pointMerchandiseVo; |
| | | } |
| | | try { |
| | | Map<String, String> geocode = gdMapGeocodingUtil.geocode(request.getLon(), request.getLat()); |
| | |
| | | } |
| | | |
| | | list = pmdsService.list(new QueryWrapper<PointsMerchandise>() |
| | | .eq("state", 1)); |
| | | .eq("state", 1) |
| | | .eq("shelves",1)); |
| | | if (list.size() > 0 ){ |
| | | Iterator<PointsMerchandise> iterator = list.iterator(); |
| | | while (iterator.hasNext()) { |
| | |
| | | iterator.remove(); // 移除符合条件的商品 |
| | | } |
| | | } |
| | | pointMerchandiseVo.setMerchandises(list); |
| | | } |
| | | return list; |
| | | return pointMerchandiseVo; |
| | | } |
| | | |
| | | @PostMapping("/base/pointMerchars/getRedeemedNums") |
| | |
| | | CoursePackage coursePackage = cpClient.queryCoursePackageById(merchandise.getCoursePackageId()); |
| | | |
| | | detailsVo.setGoodId(coursePackage.getId()); |
| | | List<String> list1 = Arrays.asList(StrUtils.splitStr2StrArr(coursePackage.getDetailDrawing(), ",")); |
| | | List<String> list1 = new ArrayList<>(); |
| | | list1.add(coursePackage.getCoverDrawing()); |
| | | list1.addAll(Arrays.asList(StrUtils.splitStr2StrArr(coursePackage.getDetailDrawing(), ","))); |
| | | detailsVo.setPics(list1); |
| | | Collections.sort(detailsVo.getPics(), (s1, s2) -> { |
| | | if (s1.equals(coursePackage.getCoverDrawing())) { |
| | |
| | | int coursePackageNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId",merchandise.getId() )); |
| | | detailsVo.setRedeemedNum(coursePackageNums); |
| | | detailsVo.setResidueNum(merchandise.getQuantityIssued() - coursePackageNums); |
| | | detailsVo.setResidueNum(Math.max(merchandise.getQuantityIssued() - coursePackageNums, 0)); |
| | | detailsVo.setPerLimit(merchandise.getPickUpQuantity()); |
| | | if (merchandise.getRedemptionMethod() == 1){ |
| | | detailsVo.setExchangeType(1); |
| | |
| | | case 3: |
| | | |
| | | detailsVo.setGoodId(merchandise.getId()); |
| | | List<String> list2 = Arrays.asList(StrUtils.splitStr2StrArr(merchandise.getProductImages(), ",")); |
| | | list2.add(merchandise.getCover()); |
| | | List<String> list2 = new ArrayList<>(); |
| | | String cover = merchandise.getCover(); |
| | | list2.add(cover); |
| | | list2.addAll(Arrays.asList(StrUtils.splitStr2StrArr(merchandise.getProductImages(), ","))); |
| | | detailsVo.setPics(list2); |
| | | Collections.sort(detailsVo.getPics(), (s1, s2) -> { |
| | | if (s1.equals(merchandise.getCover())) { |
| | |
| | | int count = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId",merchandise.getId() )); |
| | | detailsVo.setRedeemedNum(count); |
| | | detailsVo.setResidueNum(merchandise.getQuantityIssued()-count); |
| | | detailsVo.setResidueNum(Math.max(merchandise.getQuantityIssued() - count, 0)); |
| | | detailsVo.setPerLimit(merchandise.getPickUpQuantity()); |
| | | detailsVo.setExchangeType(merchandise.getRedemptionMethod()); |
| | | if (merchandise.getRedemptionMethod() == 1){ |
| | | detailsVo.setIntegral(merchandise.getIntegral()); |
| | | }else { |
| | |
| | | } |
| | | detailsVo.setCost(merchandise.getPrice()); |
| | | if (merchandise.getUseScope() == 1){ |
| | | detailsVo.setExchangeAddrType(1); |
| | | detailsVo.setBelongs("全国通用"); |
| | | }else if (merchandise.getUseScope() == 2){ |
| | | detailsVo.setExchangeAddrType(2); |
| | | detailsVo.setBelongs(merchandise.getProvince()+"|"+merchandise.getCity() + "用户可用"); |
| | | }else { |
| | | detailsVo.setExchangeAddrType(3); |
| | | List<PointsMerchandiseStore> list = pmdstoService.list(new QueryWrapper<PointsMerchandiseStore>() |
| | | .eq("pointsMerchandiseId",merchandise.getId() )); |
| | | PointsMerchandiseStore pointsMerchandiseStore = list.get(0); |
| | |
| | | // 优惠券 |
| | | Coupon coupon = iCouponService.getById(detailRequest.getGoodId()); |
| | | detailsVo.setGoodId(coupon.getId()); |
| | | List<String> list3 = Arrays.asList(StrUtils.splitStr2StrArr(coupon.getProductImages(), ",")); |
| | | list3.add(coupon.getCover()); |
| | | List<String> list3 = new ArrayList<>(); |
| | | list3.add(ToolUtil.isEmpty(coupon.getCover()) ? "" : coupon.getCover()); |
| | | if (ToolUtil.isNotEmpty(coupon.getProductImages())){ |
| | | list3.addAll(Arrays.asList(StrUtils.splitStr2StrArr(coupon.getProductImages(), ","))); |
| | | } |
| | | detailsVo.setPics(list3); |
| | | Collections.sort(detailsVo.getPics(), (s1, s2) -> { |
| | | if (s1.equals(coupon.getCover())) { |
| | |
| | | }); |
| | | detailsVo.setGoodName(coupon.getName()); |
| | | detailsVo.setBelongsScope(coupon.getUserPopulation()); |
| | | int couponNums = uconService.count(new QueryWrapper<UserCoupon>() |
| | | .eq("couponId",coupon.getId() )); |
| | | int couponNums = upmseService.count(new QueryWrapper<UserPointsMerchandise>() |
| | | .eq("pointsMerchandiseId",merchandise.getId() )); |
| | | detailsVo.setRedeemedNum(couponNums); |
| | | detailsVo.setResidueNum(coupon.getQuantityIssued()-couponNums); |
| | | detailsVo.setResidueNum(Math.max(coupon.getQuantityIssued() - couponNums, 0)); |
| | | detailsVo.setPerLimit(coupon.getPickUpQuantity()); |
| | | if (merchandise.getRedemptionMethod() == 1){ |
| | | detailsVo.setIntegral(merchandise.getIntegral()); |
| | | detailsVo.setExchangeType(coupon.getRedemptionMethod()); |
| | | if (coupon.getRedemptionMethod() == 1){ |
| | | detailsVo.setIntegral(coupon.getIntegral().intValue()); |
| | | }else { |
| | | detailsVo.setIntegral(merchandise.getIntegral()); |
| | | detailsVo.setCash(merchandise.getCash()); |
| | | detailsVo.setIntegral(coupon.getIntegral().intValue()); |
| | | detailsVo.setCash(coupon.getCash()); |
| | | } |
| | | if (coupon.getUseScope() == 1){ |
| | | detailsVo.setExchangeAddrType(1); |
| | | detailsVo.setBelongs("全国通用"); |
| | | }else if (coupon.getUseScope() == 2){ |
| | | detailsVo.setExchangeAddrType(2); |
| | | List<CouponCity> list = ccityService.list(new LambdaQueryWrapper<CouponCity>() |
| | | .eq(CouponCity::getCouponId, coupon.getId())); |
| | | if (list.size() > 0){ |
| | | detailsVo.setBelongs(list.get(0).getProvince()+"|"+list.get(0).getCity() + "用户可用"); |
| | | } |
| | | }else { |
| | | detailsVo.setExchangeAddrType(3); |
| | | List<CouponStore> list = cstoreService.list(new QueryWrapper<CouponStore>() |
| | | .eq("couponId",coupon.getId() )); |
| | | StoreDetailOfCourse courseOfStore = stoClient.getCourseOfStore(list.get(0).getStoreId()); |
| | | detailsVo.setBelongs(courseOfStore.getStoreName()+"可用"); |
| | | } |
| | | detailsVo.setStartTime(format.format(merchandise.getStartTime())); |
| | | detailsVo.setEndTime(format.format(merchandise.getEndTime())); |
| | | detailsVo.setStartTime(format.format(coupon.getStartTime())); |
| | | detailsVo.setEndTime(format.format(coupon.getEndTime())); |
| | | |
| | | detailsVo.setContents(coupon.getIllustrate()); |
| | | detailsVo.setGoodType(4); |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/getDetailsOfExchange") |
| | | public List<ExchangeDetailsResponse> getIntegralExchangeDetails(@RequestBody Integer appUserId){ |
| | | public ExchangeDetailsVo getIntegralExchangeDetails(@RequestBody Integer appUserId){ |
| | | ExchangeDetailsVo detailsVo = new ExchangeDetailsVo(); |
| | | List<ExchangeDetailsResponse> responses = new ArrayList<>(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | List<UserPointsMerchandise> pointsMerchandises = upmseService.list(new QueryWrapper<UserPointsMerchandise>() |
| | |
| | | } |
| | | detailsResponse.setStartTime(simpleDateFormat.format(merchandise.getStartTime())); |
| | | detailsResponse.setEndTime(simpleDateFormat.format(merchandise.getEndTime())); |
| | | detailsResponse.setUseStatus(pointsMerchandise.getStatus()); |
| | | detailsResponse.setUseStatus(pointsMerchandise.getStatus() == 1 ? 2 : 1); |
| | | detailsResponse.setGoodType(merchandise.getType()); |
| | | responses.add(detailsResponse); |
| | | } |
| | | detailsVo.setDetailsResponses(responses); |
| | | } |
| | | return responses; |
| | | return detailsVo; |
| | | } |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/getSpecificsOfGoods") |
| | | public PointDetailsVo getSpecificsOfGoods(@RequestBody Integer speMercharsId){ |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | |
| | | detailsVo.setBelongs(pmdsServiceById.getProvince()+pmdsServiceById.getCity()); |
| | | break; |
| | | case 3: |
| | | PointsMerchandiseStore one = pmdstoService.getOne(new QueryWrapper<PointsMerchandiseStore>() |
| | | .eq("pointsMerchandiseId",pmdsServiceById.getId() )); |
| | | StoreDetailOfCourse courseOfStore = stoClient.getCourseOfStore(one.getStoreId()); |
| | | StoreDetailOfCourse courseOfStore = stoClient.getCourseOfStore(byId.getStoreId()); |
| | | detailsVo.setBelongs(courseOfStore.getStoreName()+" "+courseOfStore.getStoreAddr()); |
| | | break; |
| | | default: |
| | |
| | | |
| | | @PostMapping("/base/pointMerchars/saveDetailsUserPointMercase") |
| | | public void saveDetailsUserPointMercase(@RequestBody UserPointsMerchandise merchandise){ |
| | | merchandise.setInsertTime(new Date()); |
| | | upmseService.save(merchandise); |
| | | } |
| | | |
| | |
| | | return storeIds; |
| | | } |
| | | |
| | | /** |
| | | * 获取用户已兑换商品的数量 |
| | | * @param goodResp |
| | | * @return 数量 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/queryUserHasGoodsNums") |
| | | public int queryUserHasGoodsNums(@RequestBody AppUserGoodResp goodResp){ |
| | | int count = upmseService.count(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getUserId,goodResp.getGoodId()) |
| | | .eq(UserPointsMerchandise::getPointsMerchandiseId,goodResp.getGoodId())); |
| | | System.out.println(count); |
| | | return count; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 变更兑换商品的的状态 |
| | | * @param code |
| | | * @return 数量 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/base/pointMerchars/deletePaymentRecord") |
| | | public void deletePaymentRecord(@RequestBody String code){ |
| | | List<UserPointsMerchandise> list = upmseService.list(new LambdaQueryWrapper<UserPointsMerchandise>() |
| | | .eq(UserPointsMerchandise::getCode,code)); |
| | | if (list.size() > 0 ){ |
| | | for (UserPointsMerchandise pointsMerchandise : list) { |
| | | pointsMerchandise.setState(2); |
| | | upmseService.updateById(pointsMerchandise); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/userCoupon/queryCouponOfStore") |
| | | public List<Integer> getCouponStoreIds(@RequestBody Integer couponId){ |
| | | try { |
| | |
| | | @TableName("t_coupon_city") |
| | | public class CouponCity extends Model<CouponCity> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | |
| | | /** |
| | | * 优惠券id |
| | | */ |
| | | @TableField("couponId") |
| | | private Integer couponId; |
| | | /** |
| | | * 省 |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | |
| | | /** |
| | | * 优惠券id |
| | | */ |
| | | @TableField("couponId") |
| | | private Integer couponId; |
| | | /** |
| | | * 门店id |
| | | */ |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | |
| | | |
| | |
| | | */ |
| | | @TableField("coursePackageConfigId") |
| | | private Integer coursePackageConfigId; |
| | | /** |
| | | * 1=上架 2=下架 |
| | | */ |
| | | @TableField("shelves") |
| | | private Integer shelves; |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | |
| | | package com.dsh.activity.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | |
| | | /** |
| | | * 积分商品id |
| | | */ |
| | | @TableField("pointsMerchandiseId") |
| | | private Integer pointsMerchandiseId; |
| | | /** |
| | | * 门店id |
| | | */ |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | |
| | | |
| | |
| | | @TableId(value = "id", type = IdType.NONE) |
| | | private Long id; |
| | | /** |
| | | * 优惠券id |
| | | * 商品id |
| | | */ |
| | | @TableField("pointsMerchandiseId") |
| | | private Integer pointsMerchandiseId; |
| | |
| | | */ |
| | | @TableField("payStatus") |
| | | private Integer payStatus; |
| | | /** |
| | | * 可使用的门店id |
| | | */ |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | /** |
| | | * 1=正常 2=删除 |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | |
| | | @PostMapping("/base/pointMerchars/convertGoods") |
| | | public List<IntegralCommodity> getConvertibleGoods(); |
| | | |
| | | @PostMapping("/base/pointMerchars/getCommoditys") |
| | | public List<PointsMerchandise> getVicinityGoods(@RequestBody CommodityRequest request); |
| | | |
| | | @PostMapping("/base/pointMerchars/getRedeemedNums") |
| | | public int getRedeemedQuantity(@RequestBody Integer goodId); |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/getGoodDetails") |
| | | ProductDetailsVo getGoodDetailsWithId(@RequestBody ProductDetailRequest detailRequest); |
| | | |
| | | @PostMapping("/base/pointMerchars/getDetailsOfExchange") |
| | | List<ExchangeDetailsResponse> getIntegralExchangeDetails(@RequestBody Integer appUserId); |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/getSpecificsOfGoods") |
| | |
| | | |
| | | @PostMapping("/base/pointMerchars/selectPointsMerchandiseById") |
| | | public PointsMerchandise selectPointsMerchandiseById(@RequestBody Integer speMercharsId); |
| | | |
| | | |
| | | @PostMapping("/base/pointMerchars/saveDetailsUserPointMercase") |
| | | public void saveDetailsUserPointMercase(@RequestBody UserPointsMerchandise merchandise); |
| | | |
| | | @PostMapping("/base/pointMerchars/updateDetailsUserPointMercase") |
| | | public void updateDetailsUserPointMercase(@RequestBody UserPointsMerchandise merchandise); |
| | |
| | | */ |
| | | @PostMapping("/base/appUser/queryAppUser") |
| | | AppUser queryAppUser(Integer appUserId); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.feignclient.model; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class ExchangeDetailsVo { |
| | | |
| | | List<ExchangeDetailsResponse> detailsResponses; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.feignclient.other; |
| | | |
| | | |
| | | import com.dsh.activity.feignclient.other.model.CityDataAndProvinceDataVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | import java.util.List; |
| | | |
| | | @FeignClient("mb-cloud-other") |
| | | public interface RegionClient { |
| | | |
| | | |
| | | @PostMapping("/base/region/getCityAndProvince") |
| | | public List<CityDataAndProvinceDataVo> getCityAndProvince(List<Integer> ids); |
| | | } |
New file |
| | |
| | | package com.dsh.activity.feignclient.other.model; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CityDataAndProvinceDataVo { |
| | | |
| | | String cityName; |
| | | |
| | | String cityCode; |
| | | |
| | | String provinceName; |
| | | |
| | | String provinceCode; |
| | | |
| | | } |
| | |
| | | @Param("page")Page<Map<String, Object>> page); |
| | | |
| | | |
| | | List<Map<String, Object>> listRecord(@Param("objectPage") Page<Object> objectPage, @Param("id") Integer id, @Param("ids") List<Integer> ids, @Param("type") Integer type); |
| | | |
| | | |
| | | void updateType(@Param("id") Long id); |
| | | } |
New file |
| | |
| | | package com.dsh.activity.model; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class CouponRecordQuery { |
| | | |
| | | private long offset; |
| | | |
| | | private long limit; |
| | | |
| | | private Integer id; |
| | | |
| | | private List<Integer> ids; |
| | | |
| | | private Integer type; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.model; |
| | | |
| | | import com.dsh.activity.entity.PointsMerchandise; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class PointMerchandiseVo { |
| | | |
| | | |
| | | List<PointsMerchandise> merchandises; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.model.request; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class AppUserGoodResp { |
| | | /** |
| | | * 用户id |
| | | */ |
| | | Integer appUserId; |
| | | /** |
| | | * 商品id |
| | | */ |
| | | Integer goodId; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.activity.model.request; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CouponDataVo { |
| | | /** |
| | | * 用户类型1=城市管理者 2=平台管理者 |
| | | */ |
| | | Integer userType; |
| | | /** |
| | | * 城市管理者id |
| | | */ |
| | | Integer cityManagerId; |
| | | /** |
| | | * 券名称 |
| | | */ |
| | | String couponName; |
| | | /** |
| | | * 优惠券类型 |
| | | */ |
| | | Integer prescription; |
| | | /** |
| | | * 条件金额 |
| | | */ |
| | | BigDecimal condition; |
| | | /** |
| | | * 减去金额 |
| | | */ |
| | | BigDecimal subtraction; |
| | | /** |
| | | * 折扣金额 |
| | | */ |
| | | BigDecimal discount; |
| | | /** |
| | | * 体验券名称 |
| | | */ |
| | | String experience; |
| | | /** |
| | | * 说明 |
| | | */ |
| | | String illustrate; |
| | | /** |
| | | * 发放方式 |
| | | */ |
| | | Integer distributionMethod; |
| | | /** |
| | | * 所需积分 |
| | | */ |
| | | Integer requiredPoints; |
| | | /** |
| | | * 用户人群 |
| | | */ |
| | | Integer userGroup; |
| | | /** |
| | | * 发放数量 |
| | | */ |
| | | Integer quantityIssued; |
| | | /** |
| | | * 限领数量 |
| | | */ |
| | | Integer pickUpQuantity; |
| | | /** |
| | | * 有效期 |
| | | */ |
| | | String periodOfValidity; |
| | | /** |
| | | * 兑换方式 |
| | | */ |
| | | Integer exchangeMethod; |
| | | /** |
| | | * 所需现金 |
| | | */ |
| | | BigDecimal requiredCash; |
| | | /** |
| | | * 封面图 |
| | | */ |
| | | String goodImg; |
| | | /** |
| | | * 图片列表 |
| | | */ |
| | | List<String> goodImgs; |
| | | /** |
| | | * 适用范围 |
| | | */ |
| | | Integer company; |
| | | /** |
| | | * 城市code |
| | | */ |
| | | List<Integer> cityIds; |
| | | /** |
| | | * 门店列表 |
| | | */ |
| | | List<Integer> storeIds; |
| | | } |
| | |
| | | package com.dsh.activity.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.activity.entity.Coupon; |
| | | import com.dsh.activity.feignclient.model.CouponExamineListSearch; |
| | |
| | | |
| | | List<Map<String, Object>> queryCouponExamineList(CouponExamineListSearch ofSearch); |
| | | |
| | | List<Map<String, Object>> listRecord(Page<Object> objectPage, Integer id, List<Integer> ids, Integer type); |
| | | |
| | | void updateType(Long id); |
| | | } |
| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.activity.entity.Coupon; |
| | | import com.dsh.activity.feignclient.account.AppUserClient; |
| | |
| | | couponListVo.setType(coupon.getType()); |
| | | couponListVo.setEffectiveTime(sdf.format(coupon.getStartTime()) + "-" + sdf.format(coupon.getEndTime())); |
| | | String content = coupon.getContent(); |
| | | if (coupon.getType() == 1) {//满减{"num1":1,"num2":1} |
| | | if (coupon.getType() == 1) {//满减 |
| | | // {"conditionalAmount":50,"deductionAmount":10,"experienceName":""} |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | couponListVo.setUseCondition("满" + jsonObject.getDouble("num1") + "元可用"); |
| | | couponListVo.setFavorable(jsonObject.getString("num2")); |
| | | couponListVo.setUseCondition("满" + jsonObject.getDouble("conditionalAmount") + "元可用"); |
| | | couponListVo.setFavorable(jsonObject.getString("deductionAmount")); |
| | | } |
| | | if (coupon.getType() == 2) {//代金券{"num1":1} |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | couponListVo.setUseCondition(""); |
| | | couponListVo.setFavorable(jsonObject.getString("num1")); |
| | | couponListVo.setFavorable(jsonObject.getString("conditionalAmount")); |
| | | } |
| | | if (coupon.getType() == 3) {//体验券{"num1":1} |
| | | JSONObject jsonObject = JSON.parseObject(content); |
| | | couponListVo.setUseCondition(""); |
| | | couponListVo.setFavorable(jsonObject.getString("num1")); |
| | | couponListVo.setFavorable(jsonObject.getString("experienceName")); |
| | | } |
| | | listVos.add(couponListVo); |
| | | } |
| | |
| | | return this.baseMapper.queryCouponExamineList(ofSearch.getName(),ofSearch.getType(),ofSearch.getUserPopulation(),ofSearch.getDistributionMethod(),ofSearch.getAuditStatus(),ofSearch.getPage()); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> listRecord(Page<Object> objectPage, Integer id, List<Integer> ids, Integer type) { |
| | | return this.baseMapper.listRecord(objectPage,id,ids,type); |
| | | } |
| | | |
| | | @Override |
| | | public void updateType(Long id) { |
| | | this.baseMapper.updateType(id); |
| | | } |
| | | |
| | | } |
| | |
| | | JSONObject jsonObject = JSON.parseObject(coupon.getContent()); |
| | | switch (coupon.getType()) { |
| | | case 1: |
| | | // {"conditionalAmount":50,"deductionAmount":10,"experienceName":""} |
| | | // 满减券 |
| | | Double num1 = jsonObject.getDouble("num1"); |
| | | Double num2 = jsonObject.getDouble("num2"); |
| | | Double num1 = jsonObject.getDouble("conditionalAmount"); |
| | | Double num2 = jsonObject.getDouble("deductionAmount"); |
| | | ruleModel.setConditionalAmount("满"+num1+"可用"); |
| | | ruleModel.setDeductionAmount("¥ "+num2); |
| | | ruleModel.setExperienceName(""); |
| | | break; |
| | | case 2: |
| | | // 代金券 |
| | | Double jsonObjectDouble = jsonObject.getDouble("num1"); |
| | | Double jsonObjectDouble = jsonObject.getDouble("conditionalAmount"); |
| | | ruleModel.setConditionalAmount(""); |
| | | ruleModel.setDeductionAmount("¥ "+jsonObjectDouble); |
| | | ruleModel.setExperienceName(""); |
| | |
| | | // 体验券 |
| | | ruleModel.setConditionalAmount(""); |
| | | ruleModel.setDeductionAmount(""); |
| | | ruleModel.setExperienceName(jsonObject.getString("num1")); |
| | | ruleModel.setExperienceName(jsonObject.getString("experienceName")); |
| | | break; |
| | | default: |
| | | break; |
| | |
| | | <?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.activity.mapper.CouponMapper"> |
| | | <update id="updateType"> |
| | | update t_user_coupon set status = 2 where id =#{id} |
| | | </update> |
| | | |
| | | <select id="queryConponRuleOfJson" resultType="java.util.Map"> |
| | | SELECT JSON_EXTRACT(content, "$.conditionalAmount") as conditionalAmount, |
| | |
| | | quantityIssued, |
| | | pickUpQuantity, |
| | | `status`, |
| | | state |
| | | state, |
| | | illustrate |
| | | from t_coupon |
| | | where 1 = 1 |
| | | <if test="name != null"> |
| | |
| | | </if> |
| | | order by insertTime desc |
| | | </select> |
| | | <select id="listRecord" resultType="java.util.Map"> |
| | | select id,userId,status from t_user_coupon where couponId =#{id} |
| | | and userId in <foreach collection="ids" separator="," open="(" item="i" close=")"> |
| | | #{i} |
| | | </foreach> |
| | | <if test="type !=null"> |
| | | and status =#{type} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| | |
| | | import com.dsh.competition.entity.Participant; |
| | | import com.dsh.competition.entity.PaymentCompetition; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.account.AppUserClient; |
| | | import com.dsh.competition.feignclient.account.model.AppUser; |
| | | import com.dsh.competition.feignclient.model.*; |
| | | import com.dsh.competition.model.CompetitionInfo; |
| | | import com.dsh.competition.model.CompetitionListVo; |
| | |
| | | @Autowired |
| | | private IParticipantService participantService; |
| | | |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/competition/getPayedCompetitions") |
| | | public List<PaymentCompetition> getAllCompetitionPayRecord(@RequestBody BillingDataRequestVo requestVo){ |
| | | List<Integer> integers = new ArrayList<>(); |
| | | integers.add(1); |
| | | integers.add(2); |
| | | return paymentCompetitionService.list(new QueryWrapper<PaymentCompetition>() |
| | | .in("payType",integers) |
| | | .eq("appUserId",requestVo.getAppUserId()) |
| | | .eq("payStatus",2) |
| | | .between("payTime",requestVo.getMonthStart(),requestVo.getMonthEnd())); |
| | | public BillingRequestVo getAllCompetitionPayRecord(@RequestBody BillingDataRequestVo requestVo){ |
| | | BillingRequestVo billingRequestVo = new BillingRequestVo(); |
| | | List<BillingRequest> integers = new ArrayList<>(); |
| | | integers = paymentCompetitionService.queryDatas(requestVo.getAppUserId(),requestVo.getMonthStart(),requestVo.getMonthEnd()); |
| | | System.out.println(integers); |
| | | if (integers.size() > 0 ){ |
| | | billingRequestVo.setRequests(integers); |
| | | } |
| | | return billingRequestVo; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/competition/getCancelOrderOfUserPay") |
| | | public List<PaymentCompetition> getCancelOrderOfUserPayRecord(@RequestBody BillingDataRequestVo requestVo){ |
| | | List<Integer> integers = new ArrayList<>(); |
| | | integers.add(1); |
| | | integers.add(2); |
| | | return paymentCompetitionService.list(new QueryWrapper<PaymentCompetition>() |
| | | .in("payType",integers) |
| | | .eq("appUserId",requestVo.getAppUserId()) |
| | | .eq("payStatus",3) |
| | | .between("refundTime",requestVo.getMonthStart(),requestVo.getMonthEnd())); |
| | | public BillingRequestVo getCancelOrderOfUserPayRecord(@RequestBody BillingDataRequestVo requestVo){ |
| | | BillingRequestVo billingRequestVo = new BillingRequestVo(); |
| | | List<BillingRequest> integers = new ArrayList<>(); |
| | | integers = paymentCompetitionService.queryCancelDatas(requestVo.getAppUserId(),requestVo.getMonthStart(),requestVo.getMonthEnd()); |
| | | System.out.println(integers); |
| | | if (integers.size() > 0 ){ |
| | | billingRequestVo.setRequests(integers); |
| | | } |
| | | return billingRequestVo; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @PostMapping("/base/competition/queryById") |
| | | public Competition queryById(Integer id){ |
| | | public Competition queryById(@RequestBody Integer id){ |
| | | try { |
| | | return cttService.getById(id); |
| | | }catch (Exception e){ |
| | |
| | | wrapper.lt(Competition::getEndTime,listQuery.getTime().split(" - ")[1]+" 23:59:59"); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getState())){ |
| | | wrapper.eq(Competition::getState,listQuery.getState()); |
| | | wrapper.eq(Competition::getStatus,listQuery.getState()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getRegisterCondition())){ |
| | | wrapper.eq(Competition::getRegisterCondition,listQuery.getRegisterCondition()); |
| | | } |
| | | wrapper.in(Competition::getStoreId,listQuery.getIds()); |
| | | wrapper.eq(Competition::getAuditStatus,2); |
| | | wrapper.orderByDesc(Competition::getInsertTime); |
| | | |
| | | Page<Competition> page = cttService.page(competitionPage, wrapper); |
| | | return page; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return new Page<Competition>(); |
| | | } |
| | | } |
| | | @PostMapping("/base/competition/listAudit") |
| | | public Page<Competition> listAudit(@RequestBody ListQuery listQuery){ |
| | | try { |
| | | Page<Competition> competitionPage = new Page<>(listQuery.getOffset(),listQuery.getLimit()); |
| | | LambdaQueryWrapper<Competition> wrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(listQuery.getProvinceCode())){ |
| | | wrapper.eq(Competition::getProvinceCode,listQuery.getProvinceCode()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getCityCode())){ |
| | | wrapper.eq(Competition::getProvinceCode,listQuery.getCityCode()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getEventName())){ |
| | | wrapper.like(Competition::getName,listQuery.getEventName()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getState())){ |
| | | wrapper.eq(Competition::getAuditStatus,listQuery.getState()); |
| | | } |
| | | if(ToolUtil.isNotEmpty(listQuery.getRegisterCondition())){ |
| | | wrapper.eq(Competition::getRegisterCondition,listQuery.getRegisterCondition()); |
| | | } |
| | | wrapper.in(Competition::getStoreId,listQuery.getIds()); |
| | | ArrayList<Integer> integers = new ArrayList<>(); |
| | | integers.add(1); |
| | | integers.add(3); |
| | | wrapper.in(Competition::getAuditStatus,integers); |
| | | wrapper.orderByDesc(Competition::getInsertTime); |
| | | |
| | | Page<Competition> page = cttService.page(competitionPage, wrapper); |
| | | return page; |
| | | }catch (Exception e){ |
| | |
| | | @PostMapping("/base/competition/add") |
| | | public void add(@RequestBody Competition competition){ |
| | | try { |
| | | competition.setInsertTime(new Date()); |
| | | cttService.save(competition); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | } |
| | | |
| | | |
| | | // @PostMapping("/base/competition/getPeopleFromId") |
| | | // public Page<Participant> getPeopleFromId(@RequestBody GetPeopleQuery getPeopleQuery){ |
| | | // try { |
| | | // Page<Participant> participantPage = new Page<>(); |
| | | // LambdaQueryWrapper<Participant> participantLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | // if(getPeopleQuery.getState()!=null){ |
| | | // participantLambdaQueryWrapper.eq(Participant::getState) |
| | | // } |
| | | // participantService.page() |
| | | // }catch (Exception e){ |
| | | // return null; |
| | | // } |
| | | // } |
| | | @PostMapping("/base/competition/getPeopleFromId") |
| | | public Page<CompetitionUser> getPeopleFromId(@RequestBody GetPeopleQuery getPeopleQuery){ |
| | | try { |
| | | Page<UserCompetition> participantPage = new Page<>(getPeopleQuery.getOffset(),getPeopleQuery.getLimit()); |
| | | Page<CompetitionUser> page = participantService.getPeopleFromId(participantPage,getPeopleQuery.getId(),getPeopleQuery.getState()); |
| | | return page; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | |
| | | * 报名结束时间 |
| | | */ |
| | | @TableField("registerEndTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date registerEndTime; |
| | | /** |
| | | * 报名条件(1=全部用户,2=仅限年度会员参与,3=仅限学员参与) |
| | |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date insertTime; |
| | | |
| | | |
| | |
| | | |
| | | import com.dsh.competition.entity.PaymentCompetition; |
| | | import com.dsh.competition.feignclient.model.BillingDataRequestVo; |
| | | import com.dsh.competition.feignclient.model.BillingRequest; |
| | | import com.dsh.competition.feignclient.model.GetStuSourseList; |
| | | import com.dsh.competition.feignclient.model.PurchaseRecordVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | |
| | | @PostMapping("/base/competition/getCompetitionsDetails") |
| | | public List<PurchaseRecordVo> getStuSourseList(@RequestBody GetStuSourseList sourseList); |
| | | |
| | | @PostMapping("/base/competition/getPayedCompetitions") |
| | | List<PaymentCompetition> getAllCompetitionPayRecord(@RequestBody BillingDataRequestVo requestVo); |
| | | |
| | | @PostMapping("/base/competition/getCancelOrderOfUserPay") |
| | | public List<PaymentCompetition> getCancelOrderOfUserPayRecord(@RequestBody BillingDataRequestVo requestVo); |
| | | |
| | | @PostMapping("/base/competition/getPlayPaiFGoldPayRecord") |
| | | List<PaymentCompetition> getPlayPaiFGoldPayRecord(@RequestBody Integer appUserId); |
| | |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/29 14:09 |
| | |
| | | */ |
| | | @PostMapping("/base/appUser/updateAppUser") |
| | | void updateAppUser(AppUser appUser); |
| | | |
| | | @PostMapping("/base/appUser/getAllUser") |
| | | List<AppUser> getAllUser(); |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public class BillingDataRequestVo { |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | private Date monthStart = null; |
| | | private String monthStart = null; |
| | | |
| | | @ApiModelProperty(value = "结束时间时间") |
| | | private Date monthEnd = null; |
| | | private String monthEnd = null; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | private Integer appUserId; |
New file |
| | |
| | | package com.dsh.competition.feignclient.model; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class BillingRequest { |
| | | /** |
| | | * MM-dd HH:mm |
| | | */ |
| | | private String time; |
| | | /** |
| | | * 金额 |
| | | */ |
| | | private double amount; |
| | | } |
New file |
| | |
| | | package com.dsh.competition.feignclient.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class BillingRequestVo { |
| | | |
| | | List<BillingRequest> requests; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.competition.feignclient.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CompetitionUser { |
| | | private String name; |
| | | |
| | | private Integer sex; |
| | | |
| | | private String phone; |
| | | private String idCard; |
| | | private Integer state; |
| | | } |
| | |
| | | package com.dsh.competition.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.competition.entity.Participant; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.model.CompetitionUser; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/7/6 16:51 |
| | | */ |
| | | public interface ParticipantMapper extends BaseMapper<Participant> { |
| | | Page<CompetitionUser> getPeopleFromId(@Param("participantPage") Page<UserCompetition> participantPage, @Param("id") Integer id, @Param("state") Integer state); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.competition.entity.PaymentCompetition; |
| | | import com.dsh.competition.feignclient.model.BillingRequest; |
| | | import com.dsh.competition.model.CompetitionListVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | |
| | | */ |
| | | List<CompetitionListVo> queryMyCompetitionList(@Param("uid") Integer uid, @Param("type") Integer type, |
| | | @Param("pageSize") Integer pageSize, @Param("pageNo") Integer pageNo); |
| | | |
| | | List<BillingRequest> queryDatas(@Param("appUserId") Integer appUserId, |
| | | @Param("monthStart")String monthStart, |
| | | @Param("monthEnd")String monthEnd); |
| | | |
| | | List<BillingRequest> queryCancelDatas(@Param("appUserId") Integer appUserId, |
| | | @Param("monthStart")String monthStart, |
| | | @Param("monthEnd")String monthEnd); |
| | | |
| | | } |
| | |
| | | package com.dsh.competition.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.competition.entity.Participant; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.model.CompetitionUser; |
| | | import com.dsh.competition.model.AddParticipant; |
| | | import com.dsh.competition.model.EditParticipant; |
| | | import com.dsh.competition.model.ParticipantVo; |
| | |
| | | * @throws Exception |
| | | */ |
| | | void saveParticipant(SaveParticipant saveParticipant) throws Exception; |
| | | |
| | | Page<CompetitionUser> getPeopleFromId(Page<UserCompetition> participantPage, Integer id, Integer state); |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.competition.entity.PaymentCompetition; |
| | | import com.dsh.competition.feignclient.model.BillingRequest; |
| | | import com.dsh.competition.model.CompetitionInfo; |
| | | import com.dsh.competition.model.CompetitionListVo; |
| | | import com.dsh.competition.util.ResultUtil; |
| | |
| | | * @throws Exception |
| | | */ |
| | | ResultUtil cancelMyCompetition(Long id) throws Exception; |
| | | |
| | | List<BillingRequest> queryDatas(Integer appUserId, String monthStart, String monthEnd); |
| | | |
| | | List<BillingRequest> queryCancelDatas(Integer appUserId, String monthStart, String monthEnd); |
| | | |
| | | } |
| | |
| | | package com.dsh.competition.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.competition.entity.Participant; |
| | | import com.dsh.competition.entity.UserCompetition; |
| | | import com.dsh.competition.feignclient.account.StudentClient; |
| | | import com.dsh.competition.feignclient.account.model.Student; |
| | | import com.dsh.competition.feignclient.course.CoursePackagePaymentClient; |
| | | import com.dsh.competition.feignclient.model.CompetitionUser; |
| | | import com.dsh.competition.mapper.ParticipantMapper; |
| | | import com.dsh.competition.model.AddParticipant; |
| | | import com.dsh.competition.model.EditParticipant; |
| | |
| | | this.save(one); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Page<CompetitionUser> getPeopleFromId(Page<UserCompetition> participantPage, Integer id, Integer state) { |
| | | return this.baseMapper.getPeopleFromId(participantPage,id,state); |
| | | } |
| | | } |
| | |
| | | import com.dsh.competition.feignclient.account.model.Student; |
| | | import com.dsh.competition.feignclient.course.CoursePackagePaymentClient; |
| | | import com.dsh.competition.feignclient.course.model.PaymentDeductionClassHour; |
| | | import com.dsh.competition.feignclient.model.BillingRequest; |
| | | import com.dsh.competition.feignclient.other.StoreClient; |
| | | import com.dsh.competition.feignclient.other.model.Store; |
| | | import com.dsh.competition.mapper.PaymentCompetitionMapper; |
| | |
| | | } |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | | public List<BillingRequest> queryDatas(Integer appUserId, String monthStart, String monthEnd) { |
| | | return this.baseMapper.queryDatas(appUserId,monthStart,monthEnd); |
| | | } |
| | | |
| | | @Override |
| | | public List<BillingRequest> queryCancelDatas(Integer appUserId, String monthStart, String monthEnd) { |
| | | return this.baseMapper.queryCancelDatas(appUserId,monthStart,monthEnd); |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | <select id="queryCompetitionList" resultType="com.dsh.competition.model.CompetitionListVo"> |
| | | select * from ( |
| | | select |
| | | aa.id, |
| | | aa.name, |
| | | aa.coverDrawing, |
| | | aa.cityName, |
| | | aa.registerCondition, |
| | | aa.introduction, |
| | | aa.registerEndTime, |
| | | aa.age, |
| | | aa.heat |
| | | from ( |
| | | select |
| | | a.id, |
| | | a.`name`, |
| | |
| | | a.city as cityName, |
| | | a.registerCondition, |
| | | a.introduction, |
| | | DATE_FORMAT(a.registerEndTime, '%Y-%m-%d %H:%i') as registerEndTime, |
| | | CONCAT(a.startAge, '-', a.endAge) as `age`, |
| | | (a.baseNumber + a.applicantsNumber) as `heat` |
| | | DATE_FORMAT(a.registerEndTime, '%Y-%m-%d %H:%i') registerEndTime, |
| | | CONCAT(a.startAge, '-', a.endAge) age, |
| | | (a.baseNumber + a.applicantsNumber) heat |
| | | from t_competition a |
| | | where a.auditStatus = 2 and a.`status` = 2 and a.state = 1 |
| | | <if test="null != cityCode and '' != cityCode"> |
| | |
| | | <?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.competition.mapper.ParticipantMapper"> |
| | | <select id="getPeopleFromId" resultType="com.dsh.competition.feignclient.model.CompetitionUser"> |
| | | select t2.name,t2.gender sex,t2.phone ,t2.idcard idCard ,t3.payStatus state from t_user_competition t1 left join t_participant t2 on t1.participantId = t2.id left join t_payment_competition t3 on t1.paymentCompetitionId = t3.id |
| | | where t1.competitionId =#{id} and t2.id is not null and t3.id is not null |
| | | <if test="state !=null and state !='' and state ==1"> |
| | | and t3.payStatus in (1,2) |
| | | </if> |
| | | <if test="state !=null and state !='' and state ==3"> |
| | | and t3.payStatus =3 |
| | | </if> |
| | | |
| | | |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | </if> |
| | | order by a.insertTime desc limit #{pageNo}, #{pageSize} |
| | | </select> |
| | | <select id="queryDatas" resultType="com.dsh.competition.feignclient.model.BillingRequest"> |
| | | SELECT DATE_FORMAT(insertTime, '%m-%d %H:%i')as `time`, |
| | | amount |
| | | from t_payment_competition |
| | | where payStatus = 2 and payType = 1 and payType = 2 |
| | | <if test="null != monthStart and '' != monthStart and null != monthEnd and '' != monthEnd"> |
| | | and DATE_FORMAT(payTime, '%Y-%m-%d %H:%i:%s') between #{monthStart} and #{monthEnd} |
| | | </if> |
| | | <if test="null != appUserId and '' != appUserId "> |
| | | and appUserId = #{appUserId} |
| | | </if> |
| | | </select> |
| | | <select id="queryCancelDatas" resultType="com.dsh.competition.feignclient.model.BillingRequest"> |
| | | SELECT DATE_FORMAT(insertTime, '%m-%d %H:%i')as `time`, |
| | | amount |
| | | from t_payment_competition |
| | | where payStatus = 3 and payType = 1 and payType = 2 |
| | | <if test="null != monthStart and '' != monthStart and null != monthEnd and '' != monthEnd"> |
| | | and DATE_FORMAT(refundTime, '%Y-%m-%d %H:%i:%s') between #{monthStart} and #{monthEnd} |
| | | </if> |
| | | <if test="null != appUserId and '' != appUserId "> |
| | | and appUserId = #{appUserId} |
| | | </if> |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | linkedList.add(result1); |
| | | |
| | | //分片规则配置 |
| | | result1.getTables().add(getCoursePackageSchedulingTableRuleConfiguration()); |
| | | Properties props5 = new Properties(); |
| | | props5.setProperty("algorithm-expression", "t_course_package_scheduling$->{coursePackageId % 5 + 1}"); |
| | | result1.getShardingAlgorithms().put("t_course_package_scheduling-inline", new AlgorithmConfiguration("INLINE", props5)); |
| | | result1.getKeyGenerators().put("t_course_package_scheduling-snowflake", new AlgorithmConfiguration("SNOWFLAKE", new Properties())); |
| | | linkedList.add(result1); |
| | | |
| | | return linkedList; |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | | * @return |
| | | */ |
| | | private ShardingTableRuleConfiguration getCoursePackageSchedulingTableRuleConfiguration() { |
| | | ShardingTableRuleConfiguration result = new ShardingTableRuleConfiguration("t_course_package_scheduling", "m_$->{0}.t_course_package_scheduling$->{1..5}");//30 |
| | | result.setTableShardingStrategy(new StandardShardingStrategyConfiguration("coursePackageId", "t_course_package_scheduling-inline")); |
| | | result.setKeyGenerateStrategy(new KeyGenerateStrategyConfiguration("id", "t_course_package_scheduling-snowflake")); |
| | | return result; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 分片算法配置 |
| | |
| | | package com.dsh.course.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.*; |
| | |
| | | import com.dsh.course.model.BaseVo; |
| | | import com.dsh.course.model.QueryRegistrationRecord; |
| | | import com.dsh.course.model.QueryWalkInStudentList; |
| | | import com.dsh.course.model.BillingRequest; |
| | | import com.dsh.course.model.BillingRequestVo; |
| | | import com.dsh.course.model.dto.DiscountJsonDto; |
| | | import com.dsh.course.model.vo.CourseDetailRequest; |
| | | import com.dsh.course.model.vo.RegisterCourseVo; |
| | |
| | | @Autowired |
| | | private CancelledClassesService cancelledClassesService; |
| | | |
| | | @Resource |
| | | private CoursePackageStudentService cspsService; |
| | | |
| | | |
| | | @Autowired |
| | | private PayMoneyUtil payMoneyUtil; |
| | | @Resource |
| | |
| | | .groupBy("coursePackageId")); |
| | | if (list.size() > 0){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : list) { |
| | | TCoursePackage tCoursePackage = tcpService.getById(tCoursePackagePayment.getCoursePackageId()); |
| | | CoursePackagePaymentConfig paymentConfig = icppcService.getOne(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("coursePackageId",tCoursePackage.getId() ) |
| | | .eq("classHours",tCoursePackagePayment.getClassHours())); |
| | | CoursePackageStudent packageStudent = cspsService.getOne(new LambdaQueryWrapper<CoursePackageStudent>() |
| | | .eq(CoursePackageStudent::getAppUserId, courseRest.getAppUserId()) |
| | | .eq(CoursePackageStudent::getStudentId,courseRest.getStuId()) |
| | | .eq(CoursePackageStudent::getCoursePackagePaymentId,tCoursePackagePayment.getId()) |
| | | .eq(CoursePackageStudent::getCoursePackageId,tCoursePackagePayment.getCoursePackageId())); |
| | | if (ToolUtil.isEmpty(packageStudent) || (ToolUtil.isNotEmpty(packageStudent) && packageStudent.getReservationStatus() != 1)){ |
| | | // 没有预约过的/已经取消了的 |
| | | TCoursePackage tCoursePackage = tcpService.getById(tCoursePackagePayment.getCoursePackageId()); |
| | | CoursePackagePaymentConfig paymentConfig = icppcService.getOne(new QueryWrapper<CoursePackagePaymentConfig>() |
| | | .eq("coursePackageId",tCoursePackage.getId() ) |
| | | .eq("classHours",tCoursePackagePayment.getClassHours())); |
| | | // 获取课程有效结束时间,判断 查询的日期parse 是否在有效期范围内 |
| | | Date expirationDate = DateTimeHelper.getExpirationDate(tCoursePackagePayment.getInsertTime(),tCoursePackage.getValidDays()); |
| | | System.out.println(expirationDate.after(parse)); |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | System.out.println(StrUtils.dealStrToList(classWeeks).contains(DateTimeHelper.getDayOfWeek(parse))); |
| | | if (expirationDate.after(parse) && StrUtils.dealStrToList(classWeeks).contains(DateTimeHelper.getDayOfWeek(parse))){ |
| | | CourseOfStoreVo storeVo = new CourseOfStoreVo(); |
| | | storeVo.setCourseId(tCoursePackage.getId()); |
| | | storeVo.setCourseName(tCoursePackage.getName()); |
| | | storeVo.setClassStartTime(tCoursePackage.getClassStartTime()); |
| | | storeVo.setClassEndTime(tCoursePackage.getClassEndTime()); |
| | | storeVo.setStoreId(tCoursePackage.getStoreId()); |
| | | Store store = sreClient.queryStoreById(tCoursePackage.getStoreId()); |
| | | storeVo.setStoreAddress(store.getAddress()); |
| | | storeVo.setLat(store.getLat()); |
| | | storeVo.setLon(store.getLon()); |
| | | storeVo.setCoursePrice(ToolUtil.isEmpty(paymentConfig.getCashPayment()) ? (double) paymentConfig.getPlayPaiCoin():paymentConfig.getCashPayment()); |
| | | course.add(storeVo); |
| | | Date expirationDate = DateTimeHelper.getExpirationDate(tCoursePackagePayment.getInsertTime(),tCoursePackage.getValidDays()); |
| | | System.out.println(expirationDate.after(parse)); |
| | | String classWeeks = tCoursePackage.getClassWeeks(); |
| | | System.out.println(StrUtils.dealStrToList(classWeeks).contains(DateTimeHelper.getDayOfWeek(parse))); |
| | | if (expirationDate.after(parse) && StrUtils.dealStrToList(classWeeks).contains(DateTimeHelper.getDayOfWeek(parse))){ |
| | | CourseOfStoreVo storeVo = new CourseOfStoreVo(); |
| | | storeVo.setCourseId(tCoursePackagePayment.getId()); |
| | | storeVo.setCourseName(tCoursePackage.getName()); |
| | | storeVo.setClassStartTime(tCoursePackage.getClassStartTime()); |
| | | storeVo.setClassEndTime(tCoursePackage.getClassEndTime()); |
| | | storeVo.setStoreId(tCoursePackage.getStoreId()); |
| | | Store store = sreClient.queryStoreById(tCoursePackage.getStoreId()); |
| | | storeVo.setStoreAddress(store.getAddress()); |
| | | storeVo.setLat(store.getLat()); |
| | | storeVo.setLon(store.getLon()); |
| | | storeVo.setCoursePrice(ToolUtil.isEmpty(paymentConfig.getCashPayment()) ? (double) paymentConfig.getPlayPaiCoin():paymentConfig.getCashPayment()); |
| | | storeVo.setStatus(1); |
| | | course.add(storeVo); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @PostMapping("/base/coursePack/allPaymentCourseList") |
| | | public List<TCoursePackagePayment> getAppuserCourseList(@RequestBody Integer appUserId){ |
| | | return packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>() |
| | | .eq("appUserId",appUserId) |
| | | .eq("payType",3) |
| | | .eq("payStatus",2) |
| | | .eq("state",1)); |
| | | @ResponseBody |
| | | public List<CouponPaymentVo> getAppuserCourseList(@RequestBody Integer appUserId){ |
| | | List<CouponPaymentVo> paymentVos = new ArrayList<>(); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MM-dd HH:mm"); |
| | | List<TCoursePackagePayment> list = packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>() |
| | | .eq("appUserId", appUserId) |
| | | .eq("payType", 3) |
| | | .eq("payStatus", 2) |
| | | .eq("state", 1)); |
| | | if (list.size() > 0 ){ |
| | | for (TCoursePackagePayment tCoursePackagePayment : list) { |
| | | CouponPaymentVo couponPaymentVo = new CouponPaymentVo(); |
| | | couponPaymentVo.setTime(simpleDateFormat.format(tCoursePackagePayment.getInsertTime())); |
| | | couponPaymentVo.setAmount( tCoursePackagePayment.getPlayPaiCoin()); |
| | | paymentVos.add(couponPaymentVo); |
| | | } |
| | | } |
| | | return paymentVos; |
| | | } |
| | | |
| | | |
| | | @ResponseBody |
| | | @PostMapping("/base/coursePack/allAmountPayRecordOfUser") |
| | | public List<TCoursePackagePayment> getAmountPayRecord(@RequestBody BillingDataRequestVo billingDataRequestVo){ |
| | | return packagePaymentService.list(new QueryWrapper<TCoursePackagePayment>() |
| | | .eq("appUserId",billingDataRequestVo.getAppUserId()) |
| | | .notIn("payType",3) |
| | | .eq("payStatus",2) |
| | | .eq("state",1) |
| | | .between("insertTime",billingDataRequestVo.getMonthStart(),billingDataRequestVo.getMonthEnd())); |
| | | public BillingRequestVo getAmountPayRecord(@RequestBody BillingDataRequestVo billingDataRequestVo){ |
| | | BillingRequestVo requestVo = new BillingRequestVo(); |
| | | List<BillingRequest> billingRequests = packagePaymentService.queryAmountDatas(billingDataRequestVo.getAppUserId(), billingDataRequestVo.getMonthStart(), billingDataRequestVo.getMonthEnd()); |
| | | if (billingRequests.size() >0){ |
| | | requestVo.setRequests(billingRequests); |
| | | } |
| | | return requestVo; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | @PostMapping("/base/coursePack/savePaymentCoursePackage") |
| | | public boolean savePaymentCoursePackage(@RequestBody TCoursePackagePayment packagePayment){ |
| | | packagePayment.setInsertTime(new Date()); |
| | | return packagePaymentService.save(packagePayment); |
| | | } |
| | | |
| | |
| | | public void editCoursePackagePayment(TCoursePackagePayment coursePackagePayment){ |
| | | packagePaymentService.updateById(coursePackagePayment); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上课主页-预约操作 |
| | | */ |
| | | @ResponseBody |
| | | @PostMapping("/api/startCource/reverse") |
| | | @ApiOperation(value = "上课主页-预约操作", tags = {"APP-开始上课"}) |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "Bearer +token", required = true, dataType = "String", paramType = "header", defaultValue = "Bearer eyJhbGciOiJIUzUxMiJ9....."), |
| | | @ApiImplicitParam(value = "课包id", name = "courseID", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "时间 yyyy-MM-dd", name = "time", required = true, dataType = "String"), |
| | | @ApiImplicitParam(value = "学员id", name = "stuId", required = true, dataType = "int"), |
| | | }) |
| | | public ResultUtil reverse(String courseID,String time,Integer stuId){ |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); |
| | | try { |
| | | Integer appUserId = tokenUtil.getUserIdFormRedis(); |
| | | if(null == appUserId){ |
| | | return ResultUtil.tokenErr(); |
| | | } |
| | | TCoursePackagePayment packagePayment = packagePaymentService.getOne(new LambdaQueryWrapper<TCoursePackagePayment>() |
| | | .eq(TCoursePackagePayment::getCoursePackageId,courseID ) |
| | | .eq(TCoursePackagePayment::getAppUserId,appUserId) |
| | | .eq(TCoursePackagePayment::getStudentId,stuId) |
| | | ); |
| | | |
| | | if (ToolUtil.isEmpty(packagePayment)){ |
| | | return ResultUtil.error("该用户未购买该课包"); |
| | | } |
| | | CoursePackageStudent coursePackageStudent = cspsService.getOne(new LambdaQueryWrapper<CoursePackageStudent>() |
| | | .eq(CoursePackageStudent::getCoursePackageId,packagePayment.getCoursePackageId()) |
| | | .eq(CoursePackageStudent::getCoursePackagePaymentId,courseID) |
| | | .eq(CoursePackageStudent::getStudentId,stuId) |
| | | .eq(CoursePackageStudent::getAppUserId,appUserId) |
| | | ); |
| | | |
| | | if (ToolUtil.isNotEmpty(coursePackageStudent) && coursePackageStudent.getReservationStatus() == 0){ |
| | | coursePackageStudent.setReservationStatus(1); |
| | | coursePackageStudent.setInsertTime(simpleDateFormat.parse(time)); |
| | | cspsService.updateById(coursePackageStudent); |
| | | }else { |
| | | coursePackageStudent = new CoursePackageStudent(); |
| | | coursePackageStudent.setAppUserId(appUserId); |
| | | coursePackageStudent.setStudentId(stuId); |
| | | coursePackageStudent.setCoursePackageId(packagePayment.getCoursePackageId()); |
| | | coursePackageStudent.setCoursePackagePaymentId(Long.parseLong(courseID)); |
| | | coursePackageStudent.setReservationStatus(1); |
| | | coursePackageStudent.setInsertTime(simpleDateFormat.parse(time)); |
| | | cspsService.save(coursePackageStudent); |
| | | } |
| | | return ResultUtil.success(); |
| | | }catch (Exception e){ |
| | | return ResultUtil.runErr(); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/11 10:46 |
| | | * <p> |
| | | * 课包排课记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-30 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_course_package_scheduling") |
| | | public class CoursePackageScheduling { |
| | | public class CoursePackageScheduling extends Model<CoursePackageScheduling> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | |
| | | */ |
| | | @TableField("status") |
| | | private Integer status; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
| | |
| | | @PostMapping("/base/coursePack/savePaymentCoursePackage") |
| | | public boolean savePaymentCoursePackage(@RequestBody TCoursePackagePayment packagePayment); |
| | | |
| | | @PostMapping("/base/coursePack/allAmountPayRecordOfUser") |
| | | public List<TCoursePackagePayment> getAmountPayRecord(@RequestBody BillingDataRequestVo appUserId); |
| | | |
| | | @PostMapping("/base/coursePack/obtainStudentClassDetails") |
| | | List<RecordAppoint> obtainStudentClassDetailsData(@RequestBody Integer stuId); |
| | | |
| | |
| | | public class BillingDataRequestVo { |
| | | |
| | | @ApiModelProperty(value = "开始时间") |
| | | private Date monthStart = null; |
| | | private String monthStart = null; |
| | | |
| | | @ApiModelProperty(value = "结束时间时间") |
| | | private Date monthEnd = null; |
| | | private String monthEnd = null; |
| | | |
| | | @ApiModelProperty(value = "用户id") |
| | | private Integer appUserId; |
New file |
| | |
| | | package com.dsh.course.feignclient.model; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CouponPaymentVo { |
| | | /** |
| | | * 时间 |
| | | */ |
| | | private String time; |
| | | /** |
| | | * 金额 |
| | | */ |
| | | private double amount; |
| | | |
| | | } |
| | |
| | | public class CourseOfStoreVo { |
| | | |
| | | @ApiModelProperty(value = "课包id") |
| | | private Integer courseId; |
| | | private Long courseId; |
| | | |
| | | @ApiModelProperty(value = "课包名称") |
| | | private String courseName; |
| | |
| | | |
| | | @ApiModelProperty(value = "课包课时价格") |
| | | private double coursePrice; |
| | | |
| | | @ApiModelProperty(value = "预约状态") |
| | | private Integer status; |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.entity.TCoursePackagePayment; |
| | | import com.dsh.course.model.QueryRegistrationRecord; |
| | | import com.dsh.course.model.BillingRequest; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | TCoursePackagePayment getCoursePackagePaymentByCode(@Param("code") String code); |
| | | |
| | | List<BillingRequest> billingDataRequestVo(@Param("appUserId")Integer appUserId, |
| | | @Param("monthStart")String monthStart, |
| | | @Param("monthEnd")String monthEnd); |
| | | |
| | | |
| | | /** |
| | | * 获取课包报名信息 |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class BillingRequest { |
| | | |
| | | /** |
| | | * MM-dd HH:mm |
| | | */ |
| | | private String time; |
| | | /** |
| | | * 金额 |
| | | */ |
| | | private double amount; |
| | | } |
New file |
| | |
| | | package com.dsh.course.model; |
| | | |
| | | import com.dsh.course.model.BillingRequest; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class BillingRequestVo { |
| | | |
| | | List<BillingRequest> requests; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.course.entity.CoursePackageScheduling; |
| | | |
| | | /** |
| | | * <p> |
| | | * 课包排课 服务类 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-06-30 |
| | | */ |
| | | public interface CoursePackageSchedulingService extends IService<CoursePackageScheduling> { |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.dsh.course.feignclient.model.RecordAppoint; |
| | | import com.dsh.course.model.QueryRegistrationRecord; |
| | | import com.dsh.course.model.QueryWalkInStudentList; |
| | | import com.dsh.course.model.BillingRequest; |
| | | import com.dsh.course.model.vo.RegisterCourseVo; |
| | | import com.dsh.course.model.vo.request.ClasspaymentRequest; |
| | | import com.dsh.course.model.vo.request.CourseOfAfterRequest; |
| | |
| | | |
| | | ResultUtil insertVipPaymentCallback(String code, String orderNumber); |
| | | |
| | | List<BillingRequest> queryAmountDatas(Integer appUserId, String monthStart, String monthEnd); |
| | | |
| | | |
| | | /** |
| | | * 获取课包报名信息 |
| | |
| | | import com.dsh.course.feignclient.other.StoreClient; |
| | | import com.dsh.course.feignclient.other.model.Store; |
| | | import com.dsh.course.mapper.*; |
| | | import com.dsh.course.model.BillingRequest; |
| | | import com.dsh.course.model.QueryRegistrationRecord; |
| | | import com.dsh.course.model.QueryWalkInStudentList; |
| | | import com.dsh.course.model.dto.DiscountJsonDto; |
| | |
| | | return ResultUtil.success(); |
| | | } |
| | | |
| | | @Override |
| | | public List<BillingRequest> queryAmountDatas(Integer appUserId, String monthStart, String monthEnd) { |
| | | return this.baseMapper.billingDataRequestVo(appUserId,monthStart,monthEnd); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取课包报名信息 |
| | |
| | | .eq("type", 1).eq("auditStatus", 2)); |
| | | Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | for (TCoursePackageDiscount coursePackageDiscount : list2) { |
| | | Double num1 = JSON.parseObject(coursePackageDiscount.getContent()).getDouble("num1"); |
| | | Double num1 = JSON.parseObject(coursePackageDiscount.getContent()).getDouble("discountMember"); |
| | | if(vipPrice.compareTo(num1) > 0){ |
| | | vipPrice = num1; |
| | | } |
| | |
| | | .eq("type", 1).eq("auditStatus", 2)); |
| | | Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | for (TCoursePackageDiscount coursePackageDiscount : list2) { |
| | | Double num1 = JSON.parseObject(coursePackageDiscount.getContent()).getDouble("num1"); |
| | | Double num1 = JSON.parseObject(coursePackageDiscount.getContent()).getDouble("discountMember"); |
| | | if(vipPrice.compareTo(num1) > 0){ |
| | | vipPrice = num1; |
| | | } |
| | |
| | | .eq("type", 1).eq("auditStatus", 2)); |
| | | Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | for (TCoursePackageDiscount coursePackageDiscount : list2) { |
| | | Double num1 = JSON.parseObject(coursePackageDiscount.getContent()).getDouble("num1"); |
| | | Double num1 = JSON.parseObject(coursePackageDiscount.getContent()).getDouble("discountMember"); |
| | | if(vipPrice.compareTo(num1) > 0){ |
| | | vipPrice = num1; |
| | | } |
| | |
| | | .eq("type", 1).eq("auditStatus", 2)); |
| | | Double vipPrice = coursePackagePaymentConfig.getCashPayment(); |
| | | for (TCoursePackageDiscount coursePackageDiscount : list2) { |
| | | Double num1 = JSON.parseObject(coursePackageDiscount.getContent()).getDouble("num1"); |
| | | Double num1 = JSON.parseObject(coursePackageDiscount.getContent()).getDouble("discountMember"); |
| | | if(vipPrice.compareTo(num1) > 0){ |
| | | vipPrice = num1; |
| | | } |
| | |
| | | } |
| | | if(coupon.getType() == 1){//满减 |
| | | JSONObject jsonObject = JSON.parseObject(coupon.getContent()); |
| | | Double num1 = jsonObject.getDouble("num1"); |
| | | Double num2 = jsonObject.getDouble("num2"); |
| | | // {"conditionalAmount":50,"deductionAmount":10,"experienceName":""} |
| | | Double num1 = jsonObject.getDouble("conditionalAmount"); |
| | | Double num2 = jsonObject.getDouble("deductionAmount"); |
| | | if(price.compareTo(num1) <= 0){ |
| | | return ResultUtil.error("该优惠券无法使用"); |
| | | } |
| | |
| | | } |
| | | if(coupon.getType() == 2){//代金券 |
| | | JSONObject jsonObject = JSON.parseObject(coupon.getContent()); |
| | | Double num1 = jsonObject.getDouble("num1"); |
| | | Double num1 = jsonObject.getDouble("conditionalAmount"); |
| | | if(price.compareTo(num1) <= 0){ |
| | | return ResultUtil.error("该优惠券无法使用"); |
| | | } |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="billingDataRequestVo" resultType="com.dsh.course.model.BillingRequest"> |
| | | SELECT DATE_FORMAT(payTime, '%m-%d %H:%i')as `time`, |
| | | amount |
| | | from t_course_package_payment |
| | | where payStatus = 2 and state = 1 and payType = 3 |
| | | <if test="null != monthStart and '' != monthStart and null != monthEnd and '' != monthEnd"> |
| | | and DATE_FORMAT(insertTime, '%Y-%m-%d %H:%i:%s') between #{monthStart} and #{monthEnd} |
| | | </if> |
| | | <if test="null != appUserId and '' != appUserId "> |
| | | and appUserId = #{appUserId} |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="queryRegistrationRecord" resultType="map"> |
New file |
| | |
| | | package com.dsh.course.feignClient.account; |
| | | |
| | | import com.dsh.course.feignClient.account.model.QueryByNamePhone; |
| | | import com.dsh.course.feignClient.account.model.TAppUser; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | |
| | | @FeignClient("mb-cloud-account") |
| | | public interface AppUserClient { |
| | | |
| | | |
| | | @PostMapping("/base/appUser/queryByNamePhone") |
| | | List<TAppUser> queryByNamePhone(QueryByNamePhone queryByNamePhone); |
| | | |
| | | @PostMapping("/base/appUser/queryById") |
| | | TAppUser queryById(Integer appUserId); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.account; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.model.*; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | |
| | | import java.util.List; |
| | | |
| | | @FeignClient("mb-cloud-account") |
| | | public interface IntegralClient { |
| | | |
| | | |
| | | |
| | | @PostMapping("/userIntegralChanges/list") |
| | | Page<UserIntegral> list(IntegralListQuery integralListQuery); |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.account.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class IntegralListQuery { |
| | | private long limit; |
| | | private long offset; |
| | | |
| | | private String name; |
| | | |
| | | private String phone; |
| | | |
| | | private Integer type; |
| | | private Integer category; |
| | | private String time; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.account.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class QueryByNamePhone { |
| | | private String name; |
| | | |
| | | private String phone; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.account.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户信息 |
| | | * </p> |
| | | * |
| | | * @author administrator |
| | | * @since 2023-06-14 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_app_user") |
| | | public class TAppUser { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 编号 |
| | | */ |
| | | @TableField("code") |
| | | private String code; |
| | | /** |
| | | * 姓名 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | /** |
| | | * 电话 |
| | | */ |
| | | @TableField("phone") |
| | | private String phone; |
| | | /** |
| | | * 密码 |
| | | */ |
| | | @TableField("password") |
| | | private String password; |
| | | /** |
| | | * 生日 |
| | | */ |
| | | @TableField("birthday") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date birthday; |
| | | /** |
| | | * 性别(1=男,2=女) |
| | | */ |
| | | @TableField("gender") |
| | | private Integer gender; |
| | | /** |
| | | * 身高 |
| | | */ |
| | | @TableField("height") |
| | | private Double height; |
| | | /** |
| | | * 体重 |
| | | */ |
| | | @TableField("weight") |
| | | private Double weight; |
| | | /** |
| | | * bmi健康值 |
| | | */ |
| | | @TableField("bmi") |
| | | private Double bmi; |
| | | /** |
| | | * 身份证号 |
| | | */ |
| | | @TableField("idCard") |
| | | private String idCard; |
| | | /** |
| | | * 微信openid |
| | | */ |
| | | @TableField("openid") |
| | | private String openid; |
| | | /** |
| | | * 省 |
| | | */ |
| | | @TableField("province") |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | @TableField("city") |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | /** |
| | | * 是否是年度会员(0=否,1=是) |
| | | */ |
| | | @TableField("isVip") |
| | | private Integer isVip; |
| | | /** |
| | | * 会员有效期 |
| | | */ |
| | | @TableField("vipEndTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date vipEndTime; |
| | | /** |
| | | * 会员等级id |
| | | */ |
| | | @TableField("viplevelId") |
| | | private Integer viplevelId; |
| | | /** |
| | | * 推荐用户id |
| | | */ |
| | | @TableField("referralUserId") |
| | | private Integer referralUserId; |
| | | /** |
| | | * 销售员id |
| | | */ |
| | | @TableField("salesmanUserId") |
| | | private Integer salesmanUserId; |
| | | /** |
| | | * 状态(1=正常,2=冻结,3=删除) |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | /** |
| | | * 剩余积分 |
| | | */ |
| | | @TableField("integral") |
| | | private Integer integral; |
| | | /** |
| | | * 玩湃币 |
| | | */ |
| | | @TableField("playPaiCoins") |
| | | private Integer playPaiCoins; |
| | | /** |
| | | * 用户头像 |
| | | */ |
| | | @TableField("headImg") |
| | | private String headImg; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.account.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户积分变动记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-10 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_user_integral_changes") |
| | | public class UserIntegral extends Model<UserIntegral> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | private String city; |
| | | private String province; |
| | | private String name; |
| | | private String phone; |
| | | private Integer type; |
| | | private Integer oldIntegral; |
| | | private Integer newIntegral; |
| | | private Integer integral; |
| | | private Integer category; |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | private String remark; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.account.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 用户积分变动记录 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-10 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_user_integral_changes") |
| | | public class UserIntegralChanges extends Model<UserIntegralChanges> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 用户id |
| | | */ |
| | | @TableField("appUserId") |
| | | private Integer appUserId; |
| | | /** |
| | | * 积分类型(1=赠送积分,2=兑换商品,3=完成课后练习,4=观看教学视频) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 历史积分 |
| | | */ |
| | | @TableField("oldIntegral") |
| | | private Integer oldIntegral; |
| | | /** |
| | | * 新积分 |
| | | */ |
| | | @TableField("newIntegral") |
| | | private Integer newIntegral; |
| | | /** |
| | | * 备注 |
| | | */ |
| | | @TableField("remark") |
| | | private String remark; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | |
| | | private Integer category; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.dsh.course.feignClient.activity; |
| | | |
| | | |
| | | import com.dsh.course.feignClient.activity.model.Coupon; |
| | | import com.dsh.course.feignClient.activity.model.CouponExamineListSearch; |
| | | import com.dsh.course.feignClient.activity.model.CouponListOfSearch; |
| | | import com.dsh.course.feignClient.activity.model.*; |
| | | import com.dsh.guns.modular.system.model.CouponDataVo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | |
| | | @PostMapping("/base/coupon/updateCouponExamine") |
| | | boolean updateCouponData(@RequestBody Coupon coupon); |
| | | |
| | | @PostMapping("/base/coupon/insertIntoCouponData") |
| | | void insertIntoData(@RequestBody CouponDataVo dataVo); |
| | | |
| | | @PostMapping("/base/coupon/queryCity") |
| | | List<CouponCity> queryCity(Integer id); |
| | | @PostMapping("/base/coupon/queryStore") |
| | | List<Integer> queryStore(Integer id); |
| | | |
| | | @PostMapping("/base/coupon/listRecord") |
| | | List<Map<String,Object>> listRecord(CouponRecordQuery ofSearch); |
| | | |
| | | @PostMapping("/base/coupon/updateType") |
| | | void updateType(Long id); |
| | | } |
| | |
| | | /** |
| | | * 开始时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date startTime; |
| | | /** |
| | | * 结束时间 |
| | | */ |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date endTime; |
| | | /** |
| | | * 使用范围(1=全国,2=指定城市,3=指定门店) |
New file |
| | |
| | | package com.dsh.course.feignClient.activity.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | /** |
| | | * <p> |
| | | * 优惠券使用门店关系数据 |
| | | * </p> |
| | | * |
| | | * @author jqs |
| | | * @since 2023-07-07 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @TableName("t_coupon_city") |
| | | public class CouponCity extends Model<CouponCity> { |
| | | |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 优惠券id |
| | | */ |
| | | private Integer couponId; |
| | | /** |
| | | * 省 |
| | | */ |
| | | @TableField("province") |
| | | private String province; |
| | | /** |
| | | * 省编号 |
| | | */ |
| | | @TableField("provinceCode") |
| | | private String provinceCode; |
| | | /** |
| | | * 市 |
| | | */ |
| | | @TableField("city") |
| | | private String city; |
| | | /** |
| | | * 市编号 |
| | | */ |
| | | @TableField("cityCode") |
| | | private String cityCode; |
| | | |
| | | |
| | | @Override |
| | | protected Serializable pkVal() { |
| | | return this.id; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.activity.model; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Data |
| | | public class CouponRecordQuery { |
| | | |
| | | private long offset; |
| | | |
| | | private long limit; |
| | | |
| | | private Integer id; |
| | | |
| | | private List<Integer> ids; |
| | | |
| | | private Integer type; |
| | | |
| | | } |
| | |
| | | package com.dsh.course.feignClient.competition; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.competition.model.Competition; |
| | | import com.dsh.course.feignClient.competition.model.GetPeopleQuery; |
| | | import com.dsh.course.feignClient.competition.model.ListQuery; |
| | | import com.dsh.course.feignClient.competition.model.Participant; |
| | | import com.dsh.course.feignClient.competition.model.*; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | |
| | | @PostMapping("/base/competition/cancel") |
| | | void cancel(Integer id); |
| | | @PostMapping("/base/competition/getPeopleFromId") |
| | | Page<Participant> getPeopleFromId(GetPeopleQuery getPeopleQuery); |
| | | Page<CompetitionUser> getPeopleFromId(GetPeopleQuery getPeopleQuery); |
| | | |
| | | @PostMapping("/base/competition/listUser") |
| | | Page<CompetitionUser> listUser(CompetitionUserQuery competitionUserQuery); |
| | | |
| | | @PostMapping("/base/competition/listAudit") |
| | | Page<Competition> listAudit(ListQuery listQuery); |
| | | } |
| | | |
| | | |
| | |
| | | * 报名结束时间 |
| | | */ |
| | | @TableField("registerEndTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date registerEndTime; |
| | | /** |
| | | * 报名条件(1=全部用户,2=仅限年度会员参与,3=仅限学员参与) |
| | |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private Date insertTime; |
| | | |
| | | @TableField(exist = false) |
| | | private String storeName; |
| | | @TableField(exist = false) |
| | | private String sTime; |
| | | @TableField(exist = false) |
| | | private String eTime; |
| | | @TableField(exist = false) |
| | | private String rEndTime; |
| | | |
| | | |
| | | |
| | | @Override |
New file |
| | |
| | | package com.dsh.course.feignClient.competition.model; |
| | | |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class CompetitionUser { |
| | | private String name; |
| | | |
| | | private Integer sex; |
| | | |
| | | private String phone; |
| | | private String idCard; |
| | | private Integer state; |
| | | } |
New file |
| | |
| | | package com.dsh.course.feignClient.competition.model; |
| | | |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class CompetitionUserQuery { |
| | | private Integer id; |
| | | private Integer state; |
| | | } |
| | |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.guns.modular.system.model.TEvaluation; |
| | | import com.dsh.guns.modular.system.model.TEvaluationListVo; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.model.TStoreListVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/7/6 16:51 |
| | | */ |
| | | public interface EvaluationMapper extends BaseMapper<TEvaluation> { |
| | | |
| | | |
| | | List<TEvaluationListVo> listAll(@Param("page") Page<TEvaluationListVo> page, @Param("provinceCode") String provinceCode, @Param("cityCode") String cityCode, @Param("name") String name, @Param("phone") String phone, @Param("shopName") String shopName); |
| | | |
| | | TEvaluationListVo info(@Param("id") Integer id); |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.guns.modular.system.model.Protocol; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/14 15:03 |
| | | */ |
| | | public interface ProtocolMapper extends BaseMapper<Protocol> { |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.guns.modular.system.model.Notice; |
| | | import com.dsh.guns.modular.system.model.TNotice; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 通知表 Mapper 接口 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2017-07-11 |
| | | */ |
| | | public interface TNoticeMapper extends BaseMapper<TNotice> { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.course.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.dsh.guns.modular.system.model.TSite; |
| | | import com.dsh.guns.modular.system.model.TSiteType; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:45 |
| | | */ |
| | | public interface TSiteTypeMapper extends BaseMapper<TSiteType> { |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.CityClient; |
| | | import com.dsh.course.feignClient.account.model.CityListQuery; |
| | | import com.dsh.course.feignClient.account.model.TCityManager; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 17:25:12 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tAgree") |
| | | public class TAgreeController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tAgreement/"; |
| | | |
| | | |
| | | @Autowired |
| | | private IProtocolService protocolService; |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | Protocol one = protocolService.getOne(new LambdaQueryWrapper<Protocol>().eq(Protocol::getType, 1)); |
| | | Protocol two = protocolService.getOne(new LambdaQueryWrapper<Protocol>().eq(Protocol::getType, 2)); |
| | | Protocol three = protocolService.getOne(new LambdaQueryWrapper<Protocol>().eq(Protocol::getType, 3)); |
| | | Protocol four = protocolService.getOne(new LambdaQueryWrapper<Protocol>().eq(Protocol::getType, 4)); |
| | | model.addAttribute("one",one); |
| | | model.addAttribute("two",two); |
| | | model.addAttribute("three",three); |
| | | model.addAttribute("four",four); |
| | | return PREFIX + "tAgreementDriver.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加车辆管理 |
| | | */ |
| | | @RequestMapping("/notice_add") |
| | | public String tNoticeAdd(Model model) { |
| | | return PREFIX + "notice_add.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | @RequestMapping(value = "/updateAppParam") |
| | | @ResponseBody |
| | | public Object update(Integer id,String context) { |
| | | try { |
| | | Protocol byId = protocolService.getById(id); |
| | | byId.setContent(context); |
| | | protocolService.updateById(byId); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.dsh.course.feignClient.account.model.CityListQuery; |
| | | import com.dsh.course.feignClient.account.model.TCityManager; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.competition.model.Competition; |
| | | import com.dsh.course.feignClient.competition.model.GetPeopleQuery; |
| | | import com.dsh.course.feignClient.competition.model.ListQuery; |
| | | import com.dsh.course.feignClient.competition.model.Participant; |
| | | import com.dsh.course.feignClient.competition.model.*; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | |
| | | public Object getPeopleFromId(Integer id,Integer state) { |
| | | try { |
| | | Page<Object> page = new PageFactory<>().defaultPage(); |
| | | Page<Participant> data = competitionClient.getPeopleFromId(new GetPeopleQuery(page.getSize(),page.getCurrent(),id,state)); |
| | | Page<CompetitionUser> data = competitionClient.getPeopleFromId(new GetPeopleQuery(page.getSize(),page.getCurrent(),id,state)); |
| | | return super.packForBT(data); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
New file |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.competition.model.Competition; |
| | | import com.dsh.course.feignClient.competition.model.CompetitionUser; |
| | | import com.dsh.course.feignClient.competition.model.GetPeopleQuery; |
| | | import com.dsh.course.feignClient.competition.model.ListQuery; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.TCity; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 17:25:12 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tCompetitionAudit") |
| | | public class TCompetitionAuditController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tCompetitionAudit/"; |
| | | |
| | | @Autowired |
| | | private CompetitionClient competitionClient; |
| | | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "TCompetition.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加车辆管理 |
| | | */ |
| | | @RequestMapping("/tCompetition_add") |
| | | public String tCompetitionAdd(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "TCompetition_add.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到修改车辆管理 |
| | | */ |
| | | @RequestMapping("/tCompetition_update/{id}") |
| | | public String tCarUpdate(@PathVariable Integer id, Model model) { |
| | | Competition competition = competitionClient.queryById(id); |
| | | model.addAttribute("item",competition); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | 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())); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2); |
| | | model.addAttribute("type",2); |
| | | return PREFIX + "TCompetition_edit.html"; |
| | | } |
| | | @RequestMapping("/tCompetition_info/{id}") |
| | | public String tCarInfo(@PathVariable Integer id, Model model) { |
| | | Competition competition = competitionClient.queryById(id); |
| | | model.addAttribute("item",competition); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | 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())); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2); |
| | | model.addAttribute("type",2); |
| | | |
| | | return PREFIX + "TCompetition_edit.html"; |
| | | } |
| | | @RequestMapping("/tCompetition_user/{id}") |
| | | public String tCarUser(@PathVariable Integer id, Model model) { |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "TCompetitionUser.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String provinceCode, String cityCode, String shopName, String eventName, String time, Integer state, Integer registerCondition) { |
| | | List<Integer> ids = new ArrayList<>(); |
| | | List<TStore> list = null; |
| | | // 获取门店id |
| | | if(ToolUtil.isNotEmpty(shopName)){ |
| | | list = storeService.list(new LambdaQueryWrapper<TStore>().like(TStore::getName, shopName)); |
| | | ids = list.stream().map(TStore::getId).collect(Collectors.toList()); |
| | | }else { |
| | | list = storeService.list(); |
| | | ids = storeService.list().stream().map(TStore::getId).collect(Collectors.toList()); |
| | | } |
| | | if(ids.size()==0){ |
| | | ids.add(-1); |
| | | } |
| | | Page<Competition> page = new PageFactory<Competition>().defaultPage(); |
| | | ListQuery listQuery = new ListQuery(page.getSize(),page.getCurrent(),provinceCode,cityCode,eventName,time,state,registerCondition,ids); |
| | | Page<Competition> competitions = competitionClient.listAudit(listQuery); |
| | | for (Competition competition : competitions.getRecords()) { |
| | | for (TStore tStore : list) { |
| | | if(competition.getStoreId().equals(tStore.getId())){ |
| | | competition.setStoreName(tStore.getName()); |
| | | } |
| | | } |
| | | } |
| | | return super.packForBT(competitions); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/listUser/{id}") |
| | | @ResponseBody |
| | | public Object listUser(@PathVariable Integer id,Integer state) { |
| | | try { |
| | | Page<Object> page = new PageFactory<>().defaultPage(); |
| | | Page<CompetitionUser> data = competitionClient.getPeopleFromId(new GetPeopleQuery(page.getSize(),page.getCurrent(),id,state)); |
| | | return super.packForBT(data); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object list(Competition competition) { |
| | | try { |
| | | if(ToolUtil.isNotEmpty(competition.getProvinceCode())) { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | competition.setProvince(one.getName()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getCityCode())); |
| | | competition.setCity(one1.getName()); |
| | | } |
| | | 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())); |
| | | competition.setRegisterEndTime(format.parse(competition.getREndTime())); |
| | | competitionClient.add(competition); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(Competition competition) { |
| | | try { |
| | | Competition competition1 = competitionClient.queryById(competition.getId()); |
| | | if(ToolUtil.isNotEmpty(competition.getProvinceCode())) { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | competition.setProvince(one.getName()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getCityCode())); |
| | | competition.setCity(one1.getName()); |
| | | } |
| | | if(ToolUtil.isEmpty(competition.getCoverDrawing())){ |
| | | competition.setCoverDrawing(competition1.getCoverDrawing()); |
| | | } |
| | | if(ToolUtil.isEmpty(competition.getRegistrationNotes())){ |
| | | competition.setRegistrationNotes(competition1.getRegistrationNotes()); |
| | | } |
| | | competitionClient.update(competition); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/cancel") |
| | | public Object cancel(Integer id) { |
| | | try { |
| | | competitionClient.cancel(id); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/audit") |
| | | @ResponseBody |
| | | public Object cancel(Integer id,Integer audit,String text) { |
| | | try { |
| | | Competition competition = competitionClient.queryById(id); |
| | | competition.setAuditStatus(audit); |
| | | competition.setAuditRemark(text); |
| | | competitionClient.update(competition); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/getPeopleFromId") |
| | | public Object getPeopleFromId(Integer id,Integer state) { |
| | | try { |
| | | Page<Object> page = new PageFactory<>().defaultPage(); |
| | | Page<CompetitionUser> data = competitionClient.getPeopleFromId(new GetPeopleQuery(page.getSize(),page.getCurrent(),id,state)); |
| | | return super.packForBT(data); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/onChange") |
| | | @ResponseBody |
| | | public Object onChange(Integer oneId) { |
| | | try { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, oneId)); |
| | | return cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/oneChangeNext") |
| | | @ResponseBody |
| | | public Object oneChangeNext(Integer oneId) { |
| | | try { |
| | | return storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getCityCode, oneId)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.competition.model.Competition; |
| | | import com.dsh.course.feignClient.competition.model.GetPeopleQuery; |
| | | import com.dsh.course.feignClient.competition.model.ListQuery; |
| | | import com.dsh.course.feignClient.competition.model.Participant; |
| | | import com.dsh.course.feignClient.competition.model.*; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.support.HttpKit; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.TCity; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.*; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | private ICityService cityService; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "TCompetition.html"; |
| | | } |
| | | |
| | |
| | | */ |
| | | @RequestMapping("/tCompetition_add") |
| | | public String tCompetitionAdd(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "TCompetition_add.html"; |
| | | } |
| | | |
| | |
| | | public String tCarUpdate(@PathVariable Integer id, Model model) { |
| | | Competition competition = competitionClient.queryById(id); |
| | | model.addAttribute("item",competition); |
| | | return PREFIX + "tCompetition_edit.html"; |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | 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())); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2); |
| | | model.addAttribute("type",1); |
| | | return PREFIX + "TCompetition_edit.html"; |
| | | } |
| | | @RequestMapping("/tCompetition_info/{id}") |
| | | public String tCarInfo(@PathVariable Integer id, Model model) { |
| | | Competition competition = competitionClient.queryById(id); |
| | | model.addAttribute("item",competition); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | 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())); |
| | | model.addAttribute("list",list); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2); |
| | | model.addAttribute("type",2); |
| | | |
| | | return PREFIX + "TCompetition_edit.html"; |
| | | } |
| | | @RequestMapping("/tCompetition_user/{id}") |
| | | public String tCarUser(@PathVariable Integer id, Model model) { |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "TCompetitionUser.html"; |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/listUser/{id}") |
| | | @ResponseBody |
| | | public Object listUser(@PathVariable Integer id,Integer state) { |
| | | try { |
| | | Page<Object> page = new PageFactory<>().defaultPage(); |
| | | Page<CompetitionUser> data = competitionClient.getPeopleFromId(new GetPeopleQuery(page.getSize(),page.getCurrent(),id,state)); |
| | | return super.packForBT(data); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object list(Competition competition) { |
| | | try { |
| | | if(ToolUtil.isNotEmpty(competition.getProvinceCode())) { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | competition.setProvince(one.getName()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getCityCode())); |
| | | competition.setCity(one1.getName()); |
| | | } |
| | | 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())); |
| | | competition.setRegisterEndTime(format.parse(competition.getREndTime())); |
| | | competitionClient.add(competition); |
| | | return SUCCESS_TIP; |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(Competition competition) { |
| | | try { |
| | | Competition competition1 = competitionClient.queryById(competition.getId()); |
| | | if(ToolUtil.isNotEmpty(competition.getProvinceCode())) { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getProvinceCode())); |
| | | competition.setProvince(one.getName()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, competition.getCityCode())); |
| | | competition.setCity(one1.getName()); |
| | | } |
| | | if(ToolUtil.isEmpty(competition.getCoverDrawing())){ |
| | | competition.setCoverDrawing(competition1.getCoverDrawing()); |
| | | } |
| | | if(ToolUtil.isEmpty(competition.getRegistrationNotes())){ |
| | | competition.setRegistrationNotes(competition1.getRegistrationNotes()); |
| | | } |
| | | competitionClient.update(competition); |
| | | return SUCCESS_TIP; |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | |
| | | public Object getPeopleFromId(Integer id,Integer state) { |
| | | try { |
| | | Page<Object> page = new PageFactory<>().defaultPage(); |
| | | Page<Participant> data = competitionClient.getPeopleFromId(new GetPeopleQuery(page.getSize(),page.getCurrent(),id,state)); |
| | | Page<CompetitionUser> data = competitionClient.getPeopleFromId(new GetPeopleQuery(page.getSize(),page.getCurrent(),id,state)); |
| | | return super.packForBT(data); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/oneChangeNext") |
| | | @ResponseBody |
| | | public Object oneChangeNext(Integer oneId) { |
| | | try { |
| | | return storeService.list(new LambdaQueryWrapper<TStore>().eq(TStore::getCityCode, oneId)); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.AppUserClient; |
| | | import com.dsh.course.feignClient.account.CityManagerClient; |
| | | import com.dsh.course.feignClient.account.model.CityManager; |
| | | import com.dsh.course.feignClient.account.model.QueryByNamePhone; |
| | | import com.dsh.course.feignClient.account.model.TAppUser; |
| | | import com.dsh.course.feignClient.activity.CouponClient; |
| | | import com.dsh.course.feignClient.activity.model.Coupon; |
| | | import com.dsh.course.feignClient.activity.model.CouponCity; |
| | | import com.dsh.course.feignClient.activity.model.CouponListOfSearch; |
| | | import com.dsh.course.feignClient.activity.model.CouponRecordQuery; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.CouponDataVo; |
| | | import com.dsh.guns.modular.system.model.Region; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.service.IRegionService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.util.OBSUploadUtil; |
| | | import org.apache.commons.beanutils.ConvertUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | |
| | | @Resource |
| | | private CityManagerClient cmgrClient; |
| | | |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/coupon_record/{id}") |
| | | public String memberCouponAdd(@PathVariable Integer id,Model model) { |
| | | Coupon coupon = client.queryCouponById(id); |
| | | |
| | | model.addAttribute("id",id); |
| | | model.addAttribute("type",coupon.getType()); |
| | | return PREFIX + "TCouponRecord.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("/coupon_detail/{id}") |
| | | public String memberCouponDetail(@PathVariable Integer id,Model model) { |
| | | Coupon coupon = client.queryCouponById(id); |
| | | String content = coupon.getContent(); |
| | | JSONObject jsonObject = JSONObject.parseObject(content); |
| | | String one =""; |
| | | String two =""; |
| | | String three =""; |
| | | if(coupon.getType()==1){ |
| | | one = jsonObject.get("conditionalAmount").toString(); |
| | | two = jsonObject.get("deductionAmount").toString(); |
| | | } |
| | | if(coupon.getType()==2){ |
| | | one = jsonObject.get("conditionalAmount").toString(); |
| | | } |
| | | if(coupon.getType()==3){ |
| | | three = jsonObject.get("experienceName").toString(); |
| | | } |
| | | List<CouponCity> list = new ArrayList<>(); |
| | | List<Integer> list1=null; |
| | | List<TStore> list2=new ArrayList<>(); |
| | | if(coupon.getUseScope()==2){ |
| | | list = client.queryCity(coupon.getId()); |
| | | } |
| | | if(coupon.getUseScope()==3){ |
| | | list1 = client.queryStore(coupon.getId()); |
| | | list2 = storeService.list(new LambdaQueryWrapper<TStore>().in(TStore::getId, list1)); |
| | | for (TStore tStore : list2) { |
| | | CityManager cityManager = cmgrClient.queryCityManagerById(tStore.getCityManagerId()); |
| | | if (ToolUtil.isNotEmpty(cityManager)){ |
| | | tStore.setProvince(tStore.getProvince()+tStore.getCity()); |
| | | tStore.setPhone(cityManager.getName()+"-"+cityManager.getPhone()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | model.addAttribute("city",list); |
| | | model.addAttribute("store",list2); |
| | | model.addAttribute("s",new SimpleDateFormat("yyyy-MM-dd").format(coupon.getStartTime())); |
| | | model.addAttribute("e",new SimpleDateFormat("yyyy-MM-dd").format(coupon.getEndTime())); |
| | | model.addAttribute("one",one); |
| | | model.addAttribute("two",two); |
| | | model.addAttribute("three",three); |
| | | ArrayList<String> strings = new ArrayList<>(); |
| | | String productImages = coupon.getProductImages(); |
| | | for (String s : productImages.split(",")) { |
| | | strings.add(s); |
| | | } |
| | | |
| | | model.addAttribute("img",strings); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | System.out.println(objectType); |
| | | model.addAttribute("item",coupon); |
| | | return PREFIX + "TCouponInfo.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到门店管理列表页 |
| | |
| | | @RequestMapping("/storeList") |
| | | public String storePage(Model model) { |
| | | return PREFIX + "TStoreList.html"; |
| | | } |
| | | @RequestMapping("/updateType") |
| | | @ResponseBody |
| | | public Object updateType(Long id) { |
| | | client.updateType(id); |
| | | return new SuccessTip<>(); |
| | | } |
| | | |
| | | @RequestMapping("/storeDetailsOfSearch") |
| | |
| | | } |
| | | if (ToolUtil.isNotEmpty(cityId)){ |
| | | Region cityRegion = regiService.getById(cityId); |
| | | provinceCode = cityRegion.getCode(); |
| | | cityCode = cityRegion.getCode(); |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<Map<String,Object>> storeList = storeService.queryListOfpage(provinceCode,cityCode,cityManagerId,storeName,page); |
| | |
| | | ofSearch.setState(state); |
| | | return client.getCouponListOfSearch(ofSearch); |
| | | } |
| | | @RequestMapping(value = "/listRecord") |
| | | @ResponseBody |
| | | public Object listRecord(Integer id,String name, Integer type, String phone) { |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<TAppUser> tAppUsers = appUserClient.queryByNamePhone(new QueryByNamePhone(name, phone)); |
| | | if(tAppUsers.size()==0){ |
| | | return new ArrayList<>(); |
| | | } |
| | | CouponRecordQuery ofSearch = new CouponRecordQuery(); |
| | | ofSearch.setId(id); |
| | | ofSearch.setLimit(page.getSize()); |
| | | ofSearch.setOffset(page.getCurrent()); |
| | | ofSearch.setIds(tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList())); |
| | | ofSearch.setType(type); |
| | | List<Map<String, Object>> maps = client.listRecord(ofSearch); |
| | | for (Map<String, Object> map : maps) { |
| | | map.put("id",map.get("id").toString()); |
| | | for (TAppUser tAppUser : tAppUsers) { |
| | | if(map.get("userId").equals(tAppUser.getId())){ |
| | | map.put("name",tAppUser.getName()); |
| | | map.put("phone",tAppUser.getPhone()); |
| | | } |
| | | } |
| | | } |
| | | return maps; |
| | | } |
| | | |
| | | @RequestMapping(value = "/getProvince") |
| | | @ResponseBody |
| | | public Object getProvince(){ |
| | | return regiService.list(new LambdaQueryWrapper<Region>() |
| | | .eq(Region::getParentId,0)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/onShelf") |
| | | @ResponseBody |
| | | public Object onShelf(Integer id,Integer type){ |
| | | Coupon coupon = client.queryCouponById(id); |
| | | coupon.setState(type); |
| | | client.updateCouponData(coupon); |
| | | return new SuccessTip<>(); |
| | | } |
| | | |
| | | |
| | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | @RequestMapping(value = "/commitData") |
| | | public void commitData(){ |
| | | |
| | | |
| | | |
| | | @PostMapping(value = "/commitData") |
| | | @ResponseBody |
| | | public Object commitData( CouponDataVo dataVo){ |
| | | System.out.println(dataVo); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | dataVo.setUserType(objectType); |
| | | client.insertIntoData(dataVo); |
| | | return new SuccessTip<>(); |
| | | } |
| | | @PostMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update( Integer id,Integer num,Integer num1,String text){ |
| | | Coupon coupon = client.queryCouponById(id); |
| | | coupon.setQuantityIssued(num); |
| | | coupon.setPickUpQuantity(num1); |
| | | coupon.setIllustrate(text); |
| | | client.updateCouponData(coupon); |
| | | return new SuccessTip<>(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.AppUserClient; |
| | | import com.dsh.course.feignClient.account.CityManagerClient; |
| | | import com.dsh.course.feignClient.account.model.CityManager; |
| | | import com.dsh.course.feignClient.account.model.QueryByNamePhone; |
| | | import com.dsh.course.feignClient.account.model.TAppUser; |
| | | import com.dsh.course.feignClient.activity.CouponClient; |
| | | import com.dsh.course.feignClient.activity.model.Coupon; |
| | | import com.dsh.course.feignClient.activity.model.CouponCity; |
| | | import com.dsh.course.feignClient.activity.model.CouponListOfSearch; |
| | | import com.dsh.course.feignClient.activity.model.CouponRecordQuery; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.CouponDataVo; |
| | | import com.dsh.guns.modular.system.model.Region; |
| | | import com.dsh.guns.modular.system.model.TCity; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.IRegionService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.util.OBSUploadUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.io.IOException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | |
| | | /** |
| | | * 优惠券管理 控制器 |
| | | */ |
| | | |
| | | @Controller |
| | | @RequestMapping("/tGoods") |
| | | public class TGoodsController { |
| | | |
| | | |
| | | |
| | | private String PREFIX = "/system/tGoods/"; |
| | | |
| | | |
| | | @Resource |
| | | private IRegionService regiService; |
| | | |
| | | @Resource |
| | | private IStoreService storeService; |
| | | |
| | | @Resource |
| | | private CouponClient client; |
| | | |
| | | @Resource |
| | | private CityManagerClient cmgrClient; |
| | | |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到优惠券管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | |
| | | return PREFIX + "TGoods.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加 |
| | | */ |
| | | @RequestMapping("/tGoods_add") |
| | | public String memberCouponAdd(Model model) { |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | System.out.println(objectType); |
| | | model.addAttribute("userType",objectType); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "TGoods_add.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping("/coupon_record/{id}") |
| | | public String memberCouponAdd(@PathVariable Integer id,Model model) { |
| | | Coupon coupon = client.queryCouponById(id); |
| | | |
| | | model.addAttribute("id",id); |
| | | model.addAttribute("type",coupon.getType()); |
| | | return PREFIX + "TCouponRecord.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | @RequestMapping("/coupon_detail/{id}") |
| | | public String memberCouponDetail(@PathVariable Integer id,Model model) { |
| | | Coupon coupon = client.queryCouponById(id); |
| | | String content = coupon.getContent(); |
| | | JSONObject jsonObject = JSONObject.parseObject(content); |
| | | String one =""; |
| | | String two =""; |
| | | String three =""; |
| | | if(coupon.getType()==1){ |
| | | one = jsonObject.get("conditionalAmount").toString(); |
| | | two = jsonObject.get("deductionAmount").toString(); |
| | | } |
| | | if(coupon.getType()==2){ |
| | | one = jsonObject.get("conditionalAmount").toString(); |
| | | } |
| | | if(coupon.getType()==3){ |
| | | three = jsonObject.get("experienceName").toString(); |
| | | } |
| | | List<CouponCity> list = new ArrayList<>(); |
| | | List<Integer> list1=null; |
| | | List<TStore> list2=new ArrayList<>(); |
| | | if(coupon.getUseScope()==2){ |
| | | list = client.queryCity(coupon.getId()); |
| | | } |
| | | if(coupon.getUseScope()==3){ |
| | | list1 = client.queryStore(coupon.getId()); |
| | | list2 = storeService.list(new LambdaQueryWrapper<TStore>().in(TStore::getId, list1)); |
| | | for (TStore tStore : list2) { |
| | | CityManager cityManager = cmgrClient.queryCityManagerById(tStore.getCityManagerId()); |
| | | if (ToolUtil.isNotEmpty(cityManager)){ |
| | | tStore.setProvince(tStore.getProvince()+tStore.getCity()); |
| | | tStore.setPhone(cityManager.getName()+"-"+cityManager.getPhone()); |
| | | } |
| | | } |
| | | |
| | | } |
| | | model.addAttribute("city",list); |
| | | model.addAttribute("store",list2); |
| | | model.addAttribute("s",new SimpleDateFormat("yyyy-MM-dd").format(coupon.getStartTime())); |
| | | model.addAttribute("e",new SimpleDateFormat("yyyy-MM-dd").format(coupon.getEndTime())); |
| | | model.addAttribute("one",one); |
| | | model.addAttribute("two",two); |
| | | model.addAttribute("three",three); |
| | | ArrayList<String> strings = new ArrayList<>(); |
| | | String productImages = coupon.getProductImages(); |
| | | for (String s : productImages.split(",")) { |
| | | strings.add(s); |
| | | } |
| | | |
| | | model.addAttribute("img",strings); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | System.out.println(objectType); |
| | | model.addAttribute("item",coupon); |
| | | return PREFIX + "TCouponInfo.html"; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 跳转到门店管理列表页 |
| | | */ |
| | | @RequestMapping("/storeList") |
| | | public String storePage(Model model) { |
| | | return PREFIX + "TStoreList.html"; |
| | | } |
| | | @RequestMapping("/updateType") |
| | | @ResponseBody |
| | | public Object updateType(Long id) { |
| | | client.updateType(id); |
| | | return new SuccessTip<>(); |
| | | } |
| | | |
| | | @RequestMapping("/storeDetailsOfSearch") |
| | | @ResponseBody |
| | | public Object listOfStore(Integer provinceId,Integer cityId,Integer cityManagerId,String storeName){ |
| | | System.out.println("provinceId"+provinceId); |
| | | System.out.println("cityId"+cityId); |
| | | System.out.println("cityManagerId"+cityManagerId); |
| | | System.out.println("storeName"+storeName); |
| | | String provinceCode = null; |
| | | String cityCode = null; |
| | | if (ToolUtil.isNotEmpty(provinceId)){ |
| | | Region provinceRegion = regiService.getById(provinceId); |
| | | provinceCode = provinceRegion.getCode(); |
| | | } |
| | | if (ToolUtil.isNotEmpty(cityId)){ |
| | | Region cityRegion = regiService.getById(cityId); |
| | | cityCode = cityRegion.getCode(); |
| | | } |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<Map<String,Object>> storeList = storeService.queryListOfpage(provinceCode,cityCode,cityManagerId,storeName,page); |
| | | if (storeList.size() > 0 ){ |
| | | for (Map<String, Object> stringObjectMap : storeList) { |
| | | String provinceName = (String) stringObjectMap.get("province"); |
| | | String cityName = (String) stringObjectMap.get("city"); |
| | | stringObjectMap.put("provinceCity",provinceName+cityName); |
| | | Integer managerId = (Integer) stringObjectMap.get("cityManagerId"); |
| | | CityManager cityManager = cmgrClient.queryCityManagerById(managerId); |
| | | if (ToolUtil.isNotEmpty(cityManager)){ |
| | | stringObjectMap.put("accountName",cityManager.getName()+"+"+cityManager.getPhone()); |
| | | } |
| | | } |
| | | } |
| | | return storeList; |
| | | } |
| | | |
| | | /** |
| | | * 获取 优惠券管理 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object listOfDatas(String name, Integer type, Integer distributionMethod , Integer userPopulation, Integer status, Integer state) { |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | CouponListOfSearch ofSearch = new CouponListOfSearch(); |
| | | ofSearch.setPage(page); |
| | | ofSearch.setName(name); |
| | | ofSearch.setType(type); |
| | | ofSearch.setDistributionMethod(distributionMethod); |
| | | ofSearch.setUserPopulation(userPopulation); |
| | | ofSearch.setStatus(status); |
| | | ofSearch.setState(state); |
| | | return client.getCouponListOfSearch(ofSearch); |
| | | } |
| | | @RequestMapping(value = "/listRecord") |
| | | @ResponseBody |
| | | public Object listRecord(Integer id,String name, Integer type, String phone) { |
| | | Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage(); |
| | | List<TAppUser> tAppUsers = appUserClient.queryByNamePhone(new QueryByNamePhone(name, phone)); |
| | | if(tAppUsers.size()==0){ |
| | | return new ArrayList<>(); |
| | | } |
| | | CouponRecordQuery ofSearch = new CouponRecordQuery(); |
| | | ofSearch.setId(id); |
| | | ofSearch.setLimit(page.getSize()); |
| | | ofSearch.setOffset(page.getCurrent()); |
| | | ofSearch.setIds(tAppUsers.stream().map(TAppUser::getId).collect(Collectors.toList())); |
| | | ofSearch.setType(type); |
| | | List<Map<String, Object>> maps = client.listRecord(ofSearch); |
| | | for (Map<String, Object> map : maps) { |
| | | map.put("id",map.get("id").toString()); |
| | | for (TAppUser tAppUser : tAppUsers) { |
| | | if(map.get("userId").equals(tAppUser.getId())){ |
| | | map.put("name",tAppUser.getName()); |
| | | map.put("phone",tAppUser.getPhone()); |
| | | } |
| | | } |
| | | } |
| | | return maps; |
| | | } |
| | | |
| | | @RequestMapping(value = "/getProvince") |
| | | @ResponseBody |
| | | public Object getProvince(){ |
| | | return regiService.list(new LambdaQueryWrapper<Region>() |
| | | .eq(Region::getParentId,0)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/onShelf") |
| | | @ResponseBody |
| | | public Object onShelf(Integer id,Integer type){ |
| | | Coupon coupon = client.queryCouponById(id); |
| | | coupon.setState(type); |
| | | client.updateCouponData(coupon); |
| | | return new SuccessTip<>(); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/getCity") |
| | | @ResponseBody |
| | | public Object getCity(Integer province){ |
| | | return regiService.list(new LambdaQueryWrapper<Region>() |
| | | .eq(Region::getParentId,province)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/uploadPic") |
| | | @ResponseBody |
| | | public Object add(@RequestParam("file") MultipartFile imgFile) throws IOException { |
| | | String originalFilename = imgFile.getOriginalFilename(); |
| | | String newName = originalFilename.substring(imgFile.getOriginalFilename().lastIndexOf(".")); |
| | | String url = OBSUploadUtil.inputStreamUpload(imgFile); |
| | | Map<String, String> map = new HashMap<String, String>(); |
| | | //是否上传成功 |
| | | map.put("state", "SUCCESS"); |
| | | //现在文件名称 |
| | | map.put("title", newName); |
| | | //文件原名称 |
| | | map.put("original", originalFilename); |
| | | //文件类型 .+后缀名 |
| | | map.put("type", originalFilename.substring(imgFile.getOriginalFilename().lastIndexOf("."))); |
| | | //文件路径 |
| | | map.put("url", url); |
| | | //文件大小(字节数) |
| | | map.put("size", imgFile.getSize() + ""); |
| | | System.out.println(map); |
| | | return url; |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | @PostMapping(value = "/commitData") |
| | | @ResponseBody |
| | | public Object commitData( CouponDataVo dataVo){ |
| | | System.out.println(dataVo); |
| | | Integer objectType = UserExt.getUser().getObjectType(); |
| | | dataVo.setUserType(objectType); |
| | | client.insertIntoData(dataVo); |
| | | return new SuccessTip<>(); |
| | | } |
| | | @PostMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update( Integer id,Integer num,Integer num1,String text){ |
| | | Coupon coupon = client.queryCouponById(id); |
| | | coupon.setQuantityIssued(num); |
| | | coupon.setPickUpQuantity(num1); |
| | | coupon.setIllustrate(text); |
| | | client.updateCouponData(coupon); |
| | | return new SuccessTip<>(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.CityClient; |
| | | import com.dsh.course.feignClient.account.IntegralClient; |
| | | import com.dsh.course.feignClient.account.model.*; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.service.ITNoticeService; |
| | | import com.dsh.guns.modular.system.service.StoreConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 17:25:12 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tIntegral") |
| | | public class TIntegralController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tIntegral/"; |
| | | |
| | | |
| | | @Autowired |
| | | private IntegralClient client; |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | return PREFIX + "TIntegral.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String name, String phone,Integer type,Integer category,String time) { |
| | | Page<UserIntegral> page = new PageFactory<UserIntegral>().defaultPage(); |
| | | IntegralListQuery integralListQuery = new IntegralListQuery(page.getSize(), page.getCurrent(), name, phone, type, category, time); |
| | | Page<UserIntegral> list = client.list(integralListQuery); |
| | | return super.packForBT(list); |
| | | } |
| | | @RequestMapping("/tIntegral_add") |
| | | public String tCompetitionAdd(Model model) { |
| | | return PREFIX + "TIntegral_add.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object list(String name,String text,Integer sort) { |
| | | try { |
| | | TNotice tNotice = new TNotice(); |
| | | tNotice.setContent(text); |
| | | tNotice.setInsertTime(new Date()); |
| | | tNotice.setContent(text); |
| | | tNotice.setName(name); |
| | | tNotice.setSort(sort); |
| | | tNotice.setState(1); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.CityClient; |
| | | import com.dsh.course.feignClient.account.model.CityListQuery; |
| | | import com.dsh.course.feignClient.account.model.TCityManager; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 17:25:12 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tNotice") |
| | | public class TNoticController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/notice/"; |
| | | |
| | | @Autowired |
| | | private CompetitionClient competitionClient; |
| | | |
| | | @Autowired |
| | | private CityClient cityClient; |
| | | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Resource |
| | | private UserMapper userMapper; |
| | | |
| | | @Resource |
| | | private StoreConfigService storeConfigService; |
| | | |
| | | @Autowired |
| | | private ITNoticeService noticeService; |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | return PREFIX + "notice.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加车辆管理 |
| | | */ |
| | | @RequestMapping("/notice_add") |
| | | public String tNoticeAdd(Model model) { |
| | | return PREFIX + "notice_add.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到修改车辆管理 |
| | | */ |
| | | @RequestMapping("/notice_update/{id}") |
| | | public String tCityUpdate(@PathVariable Integer id, Model model) { |
| | | TNotice byId = noticeService.getById(id); |
| | | model.addAttribute("item",byId); |
| | | model.addAttribute("type",1); |
| | | return PREFIX + "notice_edit.html"; |
| | | } |
| | | @RequestMapping("/notice_info/{id}") |
| | | public String tInfo(@PathVariable Integer id, Model model) { |
| | | TNotice byId = noticeService.getById(id); |
| | | model.addAttribute("item",byId); |
| | | model.addAttribute("type",2); |
| | | return PREFIX + "notice_edit.html"; |
| | | } |
| | | @RequestMapping("/tShop_info/{id}") |
| | | public String tCityInfo(@PathVariable Integer id, Model model) { |
| | | TStore byId = storeService.getById(id); |
| | | model.addAttribute("item",byId); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getProvinceCode())); |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | CityListQuery cityListQuery = new CityListQuery(); |
| | | cityListQuery.setOffset(1); |
| | | cityListQuery.setLimit(10000); |
| | | cityListQuery.setCityCode(byId.getCityCode()); |
| | | Page<TCityManager> list2 = cityClient.list(cityListQuery); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2.getRecords()); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | model.addAttribute("time",byId.getStartTime()+" - "+byId.getEndTime()); |
| | | User byId1 = userMapper.selectById(byId.getStoreStaffId()); |
| | | model.addAttribute("city",byId1); |
| | | model.addAttribute("type",0); |
| | | return PREFIX + "tShop_edit.html"; |
| | | } |
| | | @RequestMapping("/tShop_gift/{id}") |
| | | public String tCityGift(@PathVariable Integer id, Model model) { |
| | | TStore byId = storeService.getById(id); |
| | | model.addAttribute("welfarePicture",byId.getWelfarePicture()); |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "tShop_img.html"; |
| | | } |
| | | @RequestMapping("/tShop_indexSet/{id}") |
| | | public String tCityIndexSet(@PathVariable Integer id, Model model) { |
| | | StoreConfig c1 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,1)); |
| | | model.addAttribute("c1",c1); |
| | | StoreConfig c2 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,2)); |
| | | model.addAttribute("c2",c2); |
| | | StoreConfig c3 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,3)); |
| | | model.addAttribute("c3",c3); |
| | | StoreConfig c4 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,4)); |
| | | model.addAttribute("c4",c4); |
| | | StoreConfig c5 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,5)); |
| | | model.addAttribute("c5",c5); |
| | | StoreConfig c6 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,6)); |
| | | model.addAttribute("c6",c6); |
| | | StoreConfig c7 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,7)); |
| | | model.addAttribute("c7",c7); |
| | | StoreConfig c8 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,8)); |
| | | model.addAttribute("c8",c8); |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "tShop_imgAll.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String name, Integer type) { |
| | | Page<TNotice> page = new PageFactory<TNotice>().defaultPage(); |
| | | LambdaQueryWrapper<TNotice> tNoticeLambdaQueryWrapper = new LambdaQueryWrapper<>(); |
| | | if(ToolUtil.isNotEmpty(name)){ |
| | | tNoticeLambdaQueryWrapper.like(TNotice::getName,name); |
| | | } |
| | | if(ToolUtil.isNotEmpty(type)){ |
| | | tNoticeLambdaQueryWrapper.eq(TNotice::getUpOrDown,type); |
| | | } |
| | | tNoticeLambdaQueryWrapper.eq(TNotice::getState,1); |
| | | Page<TNotice> page1 = noticeService.page(page, tNoticeLambdaQueryWrapper); |
| | | return super.packForBT(page1); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object list(String name,String text,Integer sort) { |
| | | try { |
| | | TNotice tNotice = new TNotice(); |
| | | tNotice.setContent(text); |
| | | tNotice.setInsertTime(new Date()); |
| | | tNotice.setContent(text); |
| | | tNotice.setName(name); |
| | | tNotice.setSort(sort); |
| | | tNotice.setState(1); |
| | | noticeService.save(tNotice); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(Integer id,String name,String text,Integer sort) { |
| | | try { |
| | | TNotice byId = noticeService.getById(id); |
| | | byId.setName(name); |
| | | byId.setContent(text); |
| | | byId.setSort(sort); |
| | | noticeService.updateById(byId); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/onChange") |
| | | @ResponseBody |
| | | public Object onChange(Integer oneId) { |
| | | try { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, oneId)); |
| | | return cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/saveImgAll") |
| | | @ResponseBody |
| | | public Object saveImgAll(Integer id,Integer px1,Integer px2,Integer px3,Integer px4,Integer px5,Integer px6,Integer px7,Integer px8, |
| | | String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8, |
| | | Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8) { |
| | | try { |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | StoreConfig collect1 = collect(id, px1, r1, c1, 1); |
| | | StoreConfig collect2 = collect(id, px2, r2, c2, 2); |
| | | StoreConfig collect3 = collect(id, px3, r3, c3, 3); |
| | | StoreConfig collect4 = collect(id, px4, r4, c4, 4); |
| | | StoreConfig collect5 = collect(id, px5, r5, c5, 5); |
| | | StoreConfig collect6 = collect(id, px6, r6, c6, 6); |
| | | StoreConfig collect7 = collect(id, px7, r7, c7, 7); |
| | | StoreConfig collect8 = collect(id, px8, r8, c8, 8); |
| | | storeConfigs.add(collect1); |
| | | storeConfigs.add(collect2); |
| | | storeConfigs.add(collect3); |
| | | storeConfigs.add(collect4); |
| | | storeConfigs.add(collect5); |
| | | storeConfigs.add(collect6); |
| | | storeConfigs.add(collect7); |
| | | storeConfigs.add(collect8); |
| | | storeConfigService.updateBatchById(storeConfigs); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | private StoreConfig collect(Integer id,Integer sort,Integer isOpen,String img,int type){ |
| | | StoreConfig one = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType, type)); |
| | | one.setSort(sort); |
| | | one.setIsOpen(isOpen); |
| | | if(ToolUtil.isNotEmpty(img)){ |
| | | one.setBackgroundImage(img); |
| | | } |
| | | return one; |
| | | } |
| | | @RequestMapping(value = "/oneChangeNext") |
| | | @ResponseBody |
| | | public Object oneChangeNext(String oneId) { |
| | | |
| | | try { |
| | | CityListQuery cityListQuery = new CityListQuery(); |
| | | cityListQuery.setCityCode(oneId); |
| | | cityListQuery.setOffset(1); |
| | | cityListQuery.setLimit(100000); |
| | | Page<TCityManager> list = cityClient.list(cityListQuery); |
| | | List<TCityManager> records = list.getRecords(); |
| | | for (TCityManager record : records) { |
| | | record.setName(record.getName()+"-"+record.getPhone()); |
| | | } |
| | | return records; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(Integer id) { |
| | | try { |
| | | TNotice byId = noticeService.getById(id); |
| | | byId.setState(3); |
| | | noticeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/updateType") |
| | | @ResponseBody |
| | | public Object updateType(Integer id,Integer state) { |
| | | try { |
| | | TNotice byId = noticeService.getById(id); |
| | | byId.setUpOrDown(state); |
| | | noticeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/saveImg") |
| | | @ResponseBody |
| | | public Object saveImg(Integer id,String img) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setWelfarePicture(img); |
| | | storeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/freeze") |
| | | @ResponseBody |
| | | public Object freeze(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setState(2); |
| | | storeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/unfreeze") |
| | | @ResponseBody |
| | | public Object unfreeze(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setState(1); |
| | | storeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/pwd") |
| | | @ResponseBody |
| | | public Object pwd(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | User user = userMapper.selectById(byId.getStoreStaffId()); |
| | | user.setPassword(SecureUtil.md5("a123456")); |
| | | userMapper.updateById(user); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | import com.dsh.course.feignClient.account.model.CityListQuery; |
| | | import com.dsh.course.feignClient.account.model.TCityManager; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.feignClient.competition.model.Competition; |
| | | import com.dsh.course.feignClient.competition.model.GetPeopleQuery; |
| | | import com.dsh.course.feignClient.competition.model.Participant; |
| | | import com.dsh.course.mapper.StoreConfigMapper; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/getPeopleFromId") |
| | | public Object getPeopleFromId(Integer id,Integer state) { |
| | | try { |
| | | Page<Object> page = new PageFactory<>().defaultPage(); |
| | | Page<Participant> data = competitionClient.getPeopleFromId(new GetPeopleQuery(page.getSize(),page.getCurrent(),id,state)); |
| | | return super.packForBT(data); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
New file |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.CityClient; |
| | | import com.dsh.course.feignClient.account.model.CityListQuery; |
| | | import com.dsh.course.feignClient.account.model.TCityManager; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.IEvaluationService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.service.StoreConfigService; |
| | | import org.apache.ibatis.ognl.Evaluation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 17:25:12 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tShopEvaluation") |
| | | public class TShopEvaluationController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tShopEvaluation/"; |
| | | |
| | | @Autowired |
| | | private CompetitionClient competitionClient; |
| | | |
| | | @Autowired |
| | | private CityClient cityClient; |
| | | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Resource |
| | | private UserMapper userMapper; |
| | | |
| | | @Resource |
| | | private StoreConfigService storeConfigService; |
| | | @Autowired |
| | | private IEvaluationService evaluationService; |
| | | |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | return PREFIX + "TShop.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加车辆管理 |
| | | */ |
| | | @RequestMapping("/tShop_add") |
| | | public String tCompetitionAdd(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | return PREFIX + "tShop_add.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到修改车辆管理 |
| | | */ |
| | | @RequestMapping("/tShop_update/{id}") |
| | | public String tCityUpdate(@PathVariable Integer id, Model model) { |
| | | TStore byId = storeService.getById(id); |
| | | model.addAttribute("item",byId); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getProvinceCode())); |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | CityListQuery cityListQuery = new CityListQuery(); |
| | | cityListQuery.setOffset(1); |
| | | cityListQuery.setLimit(10000); |
| | | cityListQuery.setCityCode(byId.getCityCode()); |
| | | Page<TCityManager> list2 = cityClient.list(cityListQuery); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2.getRecords()); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | model.addAttribute("time",byId.getStartTime()+" - "+byId.getEndTime()); |
| | | User byId1 = userMapper.selectById(byId.getStoreStaffId()); |
| | | model.addAttribute("city",byId1); |
| | | model.addAttribute("type",1); |
| | | return PREFIX + "tShop_edit.html"; |
| | | } |
| | | @RequestMapping("/tShop_info/{id}") |
| | | public String tCityInfo(@PathVariable Integer id, Model model) { |
| | | TEvaluationListVo vo = evaluationService.info(id); |
| | | model.addAttribute("item",vo); |
| | | ArrayList<String> strings = new ArrayList<>(); |
| | | String imgs = vo.getImgs(); |
| | | for (String s : imgs.split(",")) { |
| | | strings.add(s); |
| | | } |
| | | model.addAttribute("imgs",strings); |
| | | model.addAttribute("name1",vo.getPName()); |
| | | model.addAttribute("name2",vo.getCName()); |
| | | return PREFIX + "tShop_edit.html"; |
| | | } |
| | | @RequestMapping("/tShop_gift/{id}") |
| | | public String tCityGift(@PathVariable Integer id, Model model) { |
| | | TStore byId = storeService.getById(id); |
| | | model.addAttribute("welfarePicture",byId.getWelfarePicture()); |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "tShop_img.html"; |
| | | } |
| | | @RequestMapping("/tShop_indexSet/{id}") |
| | | public String tCityIndexSet(@PathVariable Integer id, Model model) { |
| | | StoreConfig c1 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,1)); |
| | | model.addAttribute("c1",c1); |
| | | StoreConfig c2 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,2)); |
| | | model.addAttribute("c2",c2); |
| | | StoreConfig c3 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,3)); |
| | | model.addAttribute("c3",c3); |
| | | StoreConfig c4 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,4)); |
| | | model.addAttribute("c4",c4); |
| | | StoreConfig c5 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,5)); |
| | | model.addAttribute("c5",c5); |
| | | StoreConfig c6 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,6)); |
| | | model.addAttribute("c6",c6); |
| | | StoreConfig c7 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,7)); |
| | | model.addAttribute("c7",c7); |
| | | StoreConfig c8 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,8)); |
| | | model.addAttribute("c8",c8); |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "tShop_imgAll.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String provinceCode, String cityCode ,String shopName, String name, String phone) { |
| | | Page<TEvaluationListVo> page = new PageFactory<TEvaluationListVo>().defaultPage(); |
| | | List<TEvaluationListVo> list = evaluationService.listAll(page,provinceCode,cityCode,name,phone,shopName); |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | | @RequestMapping(value = "/updateState") |
| | | @ResponseBody |
| | | public Object updateState(Integer id, Integer state) { |
| | | TEvaluation byId = evaluationService.getById(id); |
| | | byId.setState(state); |
| | | evaluationService.updateById(byId); |
| | | return new SuccessTip<>(); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object list(TStore tStore,String time,String userName,String userPhone) { |
| | | try { |
| | | if(ToolUtil.isNotEmpty(tStore.getProvinceCode())) { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getProvinceCode())); |
| | | tStore.setProvince(one.getName()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getCityCode())); |
| | | tStore.setCity(one1.getName()); |
| | | } |
| | | tStore.setStartTime(time.split(" - ")[0]); |
| | | tStore.setEndTime(time.split(" - ")[1]); |
| | | tStore.setState(1); |
| | | User user = new User(); |
| | | List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getAccount, userPhone)); |
| | | if(users.size()>0){ |
| | | return "5001"; |
| | | } |
| | | user.setAccount(userPhone); |
| | | user.setName(userName); |
| | | user.setRoleid("2"); |
| | | user.setPhone(userPhone); |
| | | user.setPassword(SecureUtil.md5("a123456")); |
| | | userMapper.insert(user); |
| | | tStore.setStoreStaffId(user.getId()); |
| | | storeService.save(tStore); |
| | | |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | for (int i = 1; i < 9; i++) { |
| | | StoreConfig storeConfig = new StoreConfig(); |
| | | storeConfig.setIsOpen(1); |
| | | storeConfig.setSort(i); |
| | | storeConfig.setType(i); |
| | | storeConfig.setStoreId(tStore.getId()); |
| | | storeConfigs.add(storeConfig); |
| | | } |
| | | storeConfigService.saveBatch(storeConfigs); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TStore tStore,String time,String userName,String userPhone) { |
| | | try { |
| | | TStore byId = storeService.getById(tStore.getId()); |
| | | |
| | | if(ToolUtil.isNotEmpty(tStore.getProvinceCode())) { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getProvinceCode())); |
| | | tStore.setProvince(one.getName()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getCityCode())); |
| | | tStore.setCity(one1.getName()); |
| | | } |
| | | tStore.setStartTime(time.split(" - ")[0]); |
| | | tStore.setEndTime(time.split(" - ")[1]); |
| | | if(ToolUtil.isEmpty(tStore.getCoverDrawing())){ |
| | | tStore.setCoverDrawing(byId.getCoverDrawing()); |
| | | } |
| | | User user = userMapper.selectById(byId.getStoreStaffId()); |
| | | List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getAccount, userPhone).ne(User::getId,tStore.getStoreStaffId())); |
| | | if(users.size()>0){ |
| | | return "5001"; |
| | | } |
| | | user.setAccount(userPhone); |
| | | user.setName(userName); |
| | | user.setPhone(userPhone); |
| | | userMapper.updateById(user); |
| | | storeService.updateById(tStore); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/onChange") |
| | | @ResponseBody |
| | | public Object onChange(Integer oneId) { |
| | | try { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, oneId)); |
| | | return cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/saveImgAll") |
| | | @ResponseBody |
| | | public Object saveImgAll(Integer id,Integer px1,Integer px2,Integer px3,Integer px4,Integer px5,Integer px6,Integer px7,Integer px8, |
| | | String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8, |
| | | Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8) { |
| | | try { |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | StoreConfig collect1 = collect(id, px1, r1, c1, 1); |
| | | StoreConfig collect2 = collect(id, px2, r2, c2, 2); |
| | | StoreConfig collect3 = collect(id, px3, r3, c3, 3); |
| | | StoreConfig collect4 = collect(id, px4, r4, c4, 4); |
| | | StoreConfig collect5 = collect(id, px5, r5, c5, 5); |
| | | StoreConfig collect6 = collect(id, px6, r6, c6, 6); |
| | | StoreConfig collect7 = collect(id, px7, r7, c7, 7); |
| | | StoreConfig collect8 = collect(id, px8, r8, c8, 8); |
| | | storeConfigs.add(collect1); |
| | | storeConfigs.add(collect2); |
| | | storeConfigs.add(collect3); |
| | | storeConfigs.add(collect4); |
| | | storeConfigs.add(collect5); |
| | | storeConfigs.add(collect6); |
| | | storeConfigs.add(collect7); |
| | | storeConfigs.add(collect8); |
| | | storeConfigService.updateBatchById(storeConfigs); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | private StoreConfig collect(Integer id,Integer sort,Integer isOpen,String img,int type){ |
| | | StoreConfig one = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType, type)); |
| | | one.setSort(sort); |
| | | one.setIsOpen(isOpen); |
| | | if(ToolUtil.isNotEmpty(img)){ |
| | | one.setBackgroundImage(img); |
| | | } |
| | | return one; |
| | | } |
| | | @RequestMapping(value = "/oneChangeNext") |
| | | @ResponseBody |
| | | public Object oneChangeNext(String oneId) { |
| | | |
| | | try { |
| | | CityListQuery cityListQuery = new CityListQuery(); |
| | | cityListQuery.setCityCode(oneId); |
| | | cityListQuery.setOffset(1); |
| | | cityListQuery.setLimit(100000); |
| | | Page<TCityManager> list = cityClient.list(cityListQuery); |
| | | List<TCityManager> records = list.getRecords(); |
| | | for (TCityManager record : records) { |
| | | record.setName(record.getName()+"-"+record.getPhone()); |
| | | } |
| | | return records; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/cancel") |
| | | public Object cancel(Integer id) { |
| | | try { |
| | | competitionClient.cancel(id); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/saveImg") |
| | | @ResponseBody |
| | | public Object saveImg(Integer id,String img) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setWelfarePicture(img); |
| | | storeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/freeze") |
| | | @ResponseBody |
| | | public Object freeze(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setState(2); |
| | | storeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/unfreeze") |
| | | @ResponseBody |
| | | public Object unfreeze(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setState(1); |
| | | storeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/pwd") |
| | | @ResponseBody |
| | | public Object pwd(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | User user = userMapper.selectById(byId.getStoreStaffId()); |
| | | user.setPassword(SecureUtil.md5("a123456")); |
| | | userMapper.updateById(user); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.CityClient; |
| | | import com.dsh.course.feignClient.account.model.CityListQuery; |
| | | import com.dsh.course.feignClient.account.model.TCityManager; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.ICityService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.service.ITSiteService; |
| | | import com.dsh.guns.modular.system.service.StoreConfigService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 17:25:12 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tSite") |
| | | public class TSiteController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tSite/"; |
| | | |
| | | @Autowired |
| | | private CompetitionClient competitionClient; |
| | | |
| | | @Autowired |
| | | private CityClient cityClient; |
| | | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Resource |
| | | private UserMapper userMapper; |
| | | |
| | | @Resource |
| | | private StoreConfigService storeConfigService; |
| | | |
| | | @Autowired |
| | | private ITSiteService siteService; |
| | | |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",1); |
| | | return PREFIX + "TSite.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加车辆管理 |
| | | */ |
| | | @RequestMapping("/tShop_add") |
| | | public String tCompetitionAdd(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",2); |
| | | return PREFIX + "tShop_add.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到修改车辆管理 |
| | | */ |
| | | @RequestMapping("/tShop_update/{id}") |
| | | public String tCityUpdate(@PathVariable Integer id, Model model) { |
| | | TStore byId = storeService.getById(id); |
| | | model.addAttribute("item",byId); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getProvinceCode())); |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | CityListQuery cityListQuery = new CityListQuery(); |
| | | cityListQuery.setOffset(1); |
| | | cityListQuery.setLimit(10000); |
| | | cityListQuery.setCityCode(byId.getCityCode()); |
| | | Page<TCityManager> list2 = cityClient.list(cityListQuery); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2.getRecords()); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",2); |
| | | model.addAttribute("time",byId.getStartTime()+" - "+byId.getEndTime()); |
| | | User byId1 = userMapper.selectById(byId.getStoreStaffId()); |
| | | model.addAttribute("city",byId1); |
| | | model.addAttribute("type",1); |
| | | return PREFIX + "tShop_edit.html"; |
| | | } |
| | | @RequestMapping("/tShop_info/{id}") |
| | | public String tCityInfo(@PathVariable Integer id, Model model) { |
| | | TStore byId = storeService.getById(id); |
| | | model.addAttribute("item",byId); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getProvinceCode())); |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | CityListQuery cityListQuery = new CityListQuery(); |
| | | cityListQuery.setOffset(1); |
| | | cityListQuery.setLimit(10000); |
| | | cityListQuery.setCityCode(byId.getCityCode()); |
| | | Page<TCityManager> list2 = cityClient.list(cityListQuery); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2.getRecords()); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | model.addAttribute("time",byId.getStartTime()+" - "+byId.getEndTime()); |
| | | User byId1 = userMapper.selectById(byId.getStoreStaffId()); |
| | | model.addAttribute("city",byId1); |
| | | model.addAttribute("type",0); |
| | | return PREFIX + "tShop_edit.html"; |
| | | } |
| | | @RequestMapping("/tShop_gift/{id}") |
| | | public String tCityGift(@PathVariable Integer id, Model model) { |
| | | TStore byId = storeService.getById(id); |
| | | model.addAttribute("welfarePicture",byId.getWelfarePicture()); |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "tShop_img.html"; |
| | | } |
| | | @RequestMapping("/tShop_indexSet/{id}") |
| | | public String tCityIndexSet(@PathVariable Integer id, Model model) { |
| | | StoreConfig c1 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,1)); |
| | | model.addAttribute("c1",c1); |
| | | StoreConfig c2 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,2)); |
| | | model.addAttribute("c2",c2); |
| | | StoreConfig c3 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,3)); |
| | | model.addAttribute("c3",c3); |
| | | StoreConfig c4 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,4)); |
| | | model.addAttribute("c4",c4); |
| | | StoreConfig c5 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,5)); |
| | | model.addAttribute("c5",c5); |
| | | StoreConfig c6 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,6)); |
| | | model.addAttribute("c6",c6); |
| | | StoreConfig c7 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,7)); |
| | | model.addAttribute("c7",c7); |
| | | StoreConfig c8 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,8)); |
| | | model.addAttribute("c8",c8); |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "tShop_imgAll.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String provinceCode, String cityCode , String name, String phone,String shopName) { |
| | | Page<TStoreListVo> page = new PageFactory<TStoreListVo>().defaultPage(); |
| | | List<TStoreListVo> list = storeService.listAll(page,provinceCode,cityCode,name,phone,shopName); |
| | | for (TStoreListVo tStoreListVo : list) { |
| | | TCityManager byId = cityClient.getById(tStoreListVo.getCityManagerId()); |
| | | tStoreListVo.setAccount(byId.getName()+"-"+byId.getPhone()); |
| | | |
| | | } |
| | | page.setRecords(list); |
| | | return super.packForBT(page); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object list(TStore tStore,String time,String userName,String userPhone) { |
| | | try { |
| | | if(ToolUtil.isNotEmpty(tStore.getProvinceCode())) { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getProvinceCode())); |
| | | tStore.setProvince(one.getName()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getCityCode())); |
| | | tStore.setCity(one1.getName()); |
| | | } |
| | | tStore.setStartTime(time.split(" - ")[0]); |
| | | tStore.setEndTime(time.split(" - ")[1]); |
| | | tStore.setState(1); |
| | | User user = new User(); |
| | | List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getAccount, userPhone)); |
| | | if(users.size()>0){ |
| | | return "5001"; |
| | | } |
| | | user.setAccount(userPhone); |
| | | user.setName(userName); |
| | | user.setRoleid("2"); |
| | | user.setPhone(userPhone); |
| | | user.setPassword(SecureUtil.md5("a123456")); |
| | | userMapper.insert(user); |
| | | tStore.setStoreStaffId(user.getId()); |
| | | storeService.save(tStore); |
| | | |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | for (int i = 1; i < 9; i++) { |
| | | StoreConfig storeConfig = new StoreConfig(); |
| | | storeConfig.setIsOpen(1); |
| | | storeConfig.setSort(i); |
| | | storeConfig.setType(i); |
| | | storeConfig.setStoreId(tStore.getId()); |
| | | storeConfigs.add(storeConfig); |
| | | } |
| | | storeConfigService.saveBatch(storeConfigs); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(TStore tStore,String time,String userName,String userPhone) { |
| | | try { |
| | | TStore byId = storeService.getById(tStore.getId()); |
| | | |
| | | if(ToolUtil.isNotEmpty(tStore.getProvinceCode())) { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getProvinceCode())); |
| | | tStore.setProvince(one.getName()); |
| | | TCity one1 = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, tStore.getCityCode())); |
| | | tStore.setCity(one1.getName()); |
| | | } |
| | | tStore.setStartTime(time.split(" - ")[0]); |
| | | tStore.setEndTime(time.split(" - ")[1]); |
| | | if(ToolUtil.isEmpty(tStore.getCoverDrawing())){ |
| | | tStore.setCoverDrawing(byId.getCoverDrawing()); |
| | | } |
| | | User user = userMapper.selectById(byId.getStoreStaffId()); |
| | | List<User> users = userMapper.selectList(new LambdaQueryWrapper<User>().eq(User::getAccount, userPhone).ne(User::getId,tStore.getStoreStaffId())); |
| | | if(users.size()>0){ |
| | | return "5001"; |
| | | } |
| | | user.setAccount(userPhone); |
| | | user.setName(userName); |
| | | user.setPhone(userPhone); |
| | | userMapper.updateById(user); |
| | | storeService.updateById(tStore); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/onChange") |
| | | @ResponseBody |
| | | public Object onChange(Integer oneId) { |
| | | try { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, oneId)); |
| | | return cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/saveImgAll") |
| | | @ResponseBody |
| | | public Object saveImgAll(Integer id,Integer px1,Integer px2,Integer px3,Integer px4,Integer px5,Integer px6,Integer px7,Integer px8, |
| | | String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8, |
| | | Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8) { |
| | | try { |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | StoreConfig collect1 = collect(id, px1, r1, c1, 1); |
| | | StoreConfig collect2 = collect(id, px2, r2, c2, 2); |
| | | StoreConfig collect3 = collect(id, px3, r3, c3, 3); |
| | | StoreConfig collect4 = collect(id, px4, r4, c4, 4); |
| | | StoreConfig collect5 = collect(id, px5, r5, c5, 5); |
| | | StoreConfig collect6 = collect(id, px6, r6, c6, 6); |
| | | StoreConfig collect7 = collect(id, px7, r7, c7, 7); |
| | | StoreConfig collect8 = collect(id, px8, r8, c8, 8); |
| | | storeConfigs.add(collect1); |
| | | storeConfigs.add(collect2); |
| | | storeConfigs.add(collect3); |
| | | storeConfigs.add(collect4); |
| | | storeConfigs.add(collect5); |
| | | storeConfigs.add(collect6); |
| | | storeConfigs.add(collect7); |
| | | storeConfigs.add(collect8); |
| | | storeConfigService.updateBatchById(storeConfigs); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | private StoreConfig collect(Integer id,Integer sort,Integer isOpen,String img,int type){ |
| | | StoreConfig one = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType, type)); |
| | | one.setSort(sort); |
| | | one.setIsOpen(isOpen); |
| | | if(ToolUtil.isNotEmpty(img)){ |
| | | one.setBackgroundImage(img); |
| | | } |
| | | return one; |
| | | } |
| | | @RequestMapping(value = "/oneChangeNext") |
| | | @ResponseBody |
| | | public Object oneChangeNext(String oneId) { |
| | | |
| | | try { |
| | | CityListQuery cityListQuery = new CityListQuery(); |
| | | cityListQuery.setCityCode(oneId); |
| | | cityListQuery.setOffset(1); |
| | | cityListQuery.setLimit(100000); |
| | | Page<TCityManager> list = cityClient.list(cityListQuery); |
| | | List<TCityManager> records = list.getRecords(); |
| | | for (TCityManager record : records) { |
| | | record.setName(record.getName()+"-"+record.getPhone()); |
| | | } |
| | | return records; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/cancel") |
| | | public Object cancel(Integer id) { |
| | | try { |
| | | competitionClient.cancel(id); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/saveImg") |
| | | @ResponseBody |
| | | public Object saveImg(Integer id,String img) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setWelfarePicture(img); |
| | | storeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/freeze") |
| | | @ResponseBody |
| | | public Object freeze(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setState(2); |
| | | storeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/unfreeze") |
| | | @ResponseBody |
| | | public Object unfreeze(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setState(1); |
| | | storeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/pwd") |
| | | @ResponseBody |
| | | public Object pwd(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | User user = userMapper.selectById(byId.getStoreStaffId()); |
| | | user.setPassword(SecureUtil.md5("a123456")); |
| | | userMapper.updateById(user); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | import cn.hutool.crypto.SecureUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.account.CityClient; |
| | | import com.dsh.course.feignClient.account.model.CityListQuery; |
| | | import com.dsh.course.feignClient.account.model.TCityManager; |
| | | import com.dsh.course.feignClient.competition.CompetitionClient; |
| | | import com.dsh.course.mapper.UserMapper; |
| | | import com.dsh.guns.config.UserExt; |
| | | import com.dsh.guns.core.base.controller.BaseController; |
| | | import com.dsh.guns.core.base.tips.SuccessTip; |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.*; |
| | | import com.dsh.guns.modular.system.service.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 车辆管理控制器 |
| | | * |
| | | * @author fengshuonan |
| | | * @Date 2020-06-05 17:25:12 |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/tSiteType") |
| | | public class TSiteTypeController extends BaseController { |
| | | |
| | | private String PREFIX = "/system/tSiteType/"; |
| | | |
| | | @Autowired |
| | | private CompetitionClient competitionClient; |
| | | |
| | | @Autowired |
| | | private CityClient cityClient; |
| | | |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | @Autowired |
| | | private ICityService cityService; |
| | | |
| | | @Resource |
| | | private UserMapper userMapper; |
| | | |
| | | @Resource |
| | | private StoreConfigService storeConfigService; |
| | | |
| | | @Autowired |
| | | private ITSiteTypeService siteTypeService; |
| | | |
| | | |
| | | /** |
| | | * 跳转到车辆管理首页 |
| | | */ |
| | | @RequestMapping("") |
| | | public String index(Model model) { |
| | | return PREFIX + "TSite.html"; |
| | | } |
| | | |
| | | /** |
| | | * 跳转到添加车辆管理 |
| | | */ |
| | | @RequestMapping("/tShop_add") |
| | | public String tCompetitionAdd(Model model) { |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",2); |
| | | return PREFIX + "tShop_add.html"; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 跳转到修改车辆管理 |
| | | */ |
| | | @RequestMapping("/tShop_update/{id}") |
| | | public String tCityUpdate(@PathVariable Integer id, Model model) { |
| | | TStore byId = storeService.getById(id); |
| | | model.addAttribute("item",byId); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getProvinceCode())); |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | CityListQuery cityListQuery = new CityListQuery(); |
| | | cityListQuery.setOffset(1); |
| | | cityListQuery.setLimit(10000); |
| | | cityListQuery.setCityCode(byId.getCityCode()); |
| | | Page<TCityManager> list2 = cityClient.list(cityListQuery); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2.getRecords()); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",2); |
| | | model.addAttribute("time",byId.getStartTime()+" - "+byId.getEndTime()); |
| | | User byId1 = userMapper.selectById(byId.getStoreStaffId()); |
| | | model.addAttribute("city",byId1); |
| | | model.addAttribute("type",1); |
| | | return PREFIX + "tShop_edit.html"; |
| | | } |
| | | @RequestMapping("/tShop_info/{id}") |
| | | public String tCityInfo(@PathVariable Integer id, Model model) { |
| | | TStore byId = storeService.getById(id); |
| | | model.addAttribute("item",byId); |
| | | List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); |
| | | model.addAttribute("list",list); |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, byId.getProvinceCode())); |
| | | List<TCity> list1 = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | CityListQuery cityListQuery = new CityListQuery(); |
| | | cityListQuery.setOffset(1); |
| | | cityListQuery.setLimit(10000); |
| | | cityListQuery.setCityCode(byId.getCityCode()); |
| | | Page<TCityManager> list2 = cityClient.list(cityListQuery); |
| | | model.addAttribute("list1",list1); |
| | | model.addAttribute("list2",list2.getRecords()); |
| | | String roleid = UserExt.getUser().getRoleid(); |
| | | model.addAttribute("role",roleid); |
| | | model.addAttribute("time",byId.getStartTime()+" - "+byId.getEndTime()); |
| | | User byId1 = userMapper.selectById(byId.getStoreStaffId()); |
| | | model.addAttribute("city",byId1); |
| | | model.addAttribute("type",0); |
| | | return PREFIX + "tShop_edit.html"; |
| | | } |
| | | @RequestMapping("/tShop_gift/{id}") |
| | | public String tCityGift(@PathVariable Integer id, Model model) { |
| | | TStore byId = storeService.getById(id); |
| | | model.addAttribute("welfarePicture",byId.getWelfarePicture()); |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "tShop_img.html"; |
| | | } |
| | | @RequestMapping("/tShop_indexSet/{id}") |
| | | public String tCityIndexSet(@PathVariable Integer id, Model model) { |
| | | StoreConfig c1 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,1)); |
| | | model.addAttribute("c1",c1); |
| | | StoreConfig c2 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,2)); |
| | | model.addAttribute("c2",c2); |
| | | StoreConfig c3 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,3)); |
| | | model.addAttribute("c3",c3); |
| | | StoreConfig c4 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,4)); |
| | | model.addAttribute("c4",c4); |
| | | StoreConfig c5 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,5)); |
| | | model.addAttribute("c5",c5); |
| | | StoreConfig c6 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,6)); |
| | | model.addAttribute("c6",c6); |
| | | StoreConfig c7 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,7)); |
| | | model.addAttribute("c7",c7); |
| | | StoreConfig c8 = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType,8)); |
| | | model.addAttribute("c8",c8); |
| | | model.addAttribute("id",id); |
| | | return PREFIX + "tShop_imgAll.html"; |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list() { |
| | | Page<TSiteType> page = new PageFactory<TSiteType>().defaultPage(); |
| | | Page<TSiteType> page1 = siteTypeService.page(page, new LambdaQueryWrapper<TSiteType>().ne(TSiteType::getState,3)); |
| | | return super.packForBT(page1); |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/add") |
| | | @ResponseBody |
| | | public Object list(String name) { |
| | | try { |
| | | List<TSiteType> list = siteTypeService.list(new LambdaQueryWrapper<TSiteType>().eq(TSiteType::getName, name)); |
| | | if(list.size()>0){ |
| | | return "5001"; |
| | | } |
| | | TSiteType tSiteType = new TSiteType(); |
| | | tSiteType.setName(name); |
| | | tSiteType.setState(1); |
| | | siteTypeService.save(tSiteType); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/update") |
| | | @ResponseBody |
| | | public Object update(Integer id,String name) { |
| | | try { |
| | | |
| | | List<TSiteType> list = siteTypeService.list(new LambdaQueryWrapper<TSiteType>().eq(TSiteType::getName, name).ne(TSiteType::getId,id)); |
| | | if(list.size()>0){ |
| | | return "5001"; |
| | | } |
| | | TSiteType byId = siteTypeService.getById(id); |
| | | byId.setName(name); |
| | | siteTypeService.updateById(byId); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/onChange") |
| | | @ResponseBody |
| | | public Object onChange(Integer oneId) { |
| | | try { |
| | | TCity one = cityService.getOne(new LambdaQueryWrapper<TCity>().eq(TCity::getCode, oneId)); |
| | | return cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId,one.getId())); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/saveImgAll") |
| | | @ResponseBody |
| | | public Object saveImgAll(Integer id,Integer px1,Integer px2,Integer px3,Integer px4,Integer px5,Integer px6,Integer px7,Integer px8, |
| | | String c1,String c2,String c3,String c4,String c5,String c6,String c7,String c8, |
| | | Integer r1,Integer r2,Integer r3,Integer r4,Integer r5,Integer r6,Integer r7,Integer r8) { |
| | | try { |
| | | ArrayList<StoreConfig> storeConfigs = new ArrayList<>(); |
| | | StoreConfig collect1 = collect(id, px1, r1, c1, 1); |
| | | StoreConfig collect2 = collect(id, px2, r2, c2, 2); |
| | | StoreConfig collect3 = collect(id, px3, r3, c3, 3); |
| | | StoreConfig collect4 = collect(id, px4, r4, c4, 4); |
| | | StoreConfig collect5 = collect(id, px5, r5, c5, 5); |
| | | StoreConfig collect6 = collect(id, px6, r6, c6, 6); |
| | | StoreConfig collect7 = collect(id, px7, r7, c7, 7); |
| | | StoreConfig collect8 = collect(id, px8, r8, c8, 8); |
| | | storeConfigs.add(collect1); |
| | | storeConfigs.add(collect2); |
| | | storeConfigs.add(collect3); |
| | | storeConfigs.add(collect4); |
| | | storeConfigs.add(collect5); |
| | | storeConfigs.add(collect6); |
| | | storeConfigs.add(collect7); |
| | | storeConfigs.add(collect8); |
| | | storeConfigService.updateBatchById(storeConfigs); |
| | | return new SuccessTip<>(); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | private StoreConfig collect(Integer id,Integer sort,Integer isOpen,String img,int type){ |
| | | StoreConfig one = storeConfigService.getOne(new LambdaQueryWrapper<StoreConfig>().eq(StoreConfig::getStoreId, id).eq(StoreConfig::getType, type)); |
| | | one.setSort(sort); |
| | | one.setIsOpen(isOpen); |
| | | if(ToolUtil.isNotEmpty(img)){ |
| | | one.setBackgroundImage(img); |
| | | } |
| | | return one; |
| | | } |
| | | @RequestMapping(value = "/oneChangeNext") |
| | | @ResponseBody |
| | | public Object oneChangeNext(String oneId) { |
| | | |
| | | try { |
| | | CityListQuery cityListQuery = new CityListQuery(); |
| | | cityListQuery.setCityCode(oneId); |
| | | cityListQuery.setOffset(1); |
| | | cityListQuery.setLimit(100000); |
| | | Page<TCityManager> list = cityClient.list(cityListQuery); |
| | | List<TCityManager> records = list.getRecords(); |
| | | for (TCityManager record : records) { |
| | | record.setName(record.getName()+"-"+record.getPhone()); |
| | | } |
| | | return records; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/cancel") |
| | | public Object cancel(Integer id) { |
| | | try { |
| | | competitionClient.cancel(id); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/saveImg") |
| | | @ResponseBody |
| | | public Object saveImg(Integer id,String img) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setWelfarePicture(img); |
| | | storeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/freeze") |
| | | @ResponseBody |
| | | public Object freeze(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setState(2); |
| | | storeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | @RequestMapping(value = "/unfreeze") |
| | | @ResponseBody |
| | | public Object unfreeze(Integer id) { |
| | | try { |
| | | TStore byId = storeService.getById(id); |
| | | byId.setState(1); |
| | | storeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/delete") |
| | | @ResponseBody |
| | | public Object delete(Integer id) { |
| | | try { |
| | | TSiteType byId = siteTypeService.getById(id); |
| | | byId.setState(3); |
| | | siteTypeService.updateById(byId); |
| | | return SUCCESS_TIP; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return ERROR; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | try { |
| | | //文件上传,具体根据实际替换 |
| | | //File upload, replace according to actual situation |
| | | pictureName = OBSUploadUtil.inputStreamUpload(picture); |
| | | |
| | | pictureName = OssUploadUtil.ossUpload("img/", picture); |
| | | String result = "{'original': '" + picture.getOriginalFilename() + "', 'state': 'SUCCESS', 'url': '" + pictureName + "'}"; |
| | | if (callback == null) { |
| | | return JSON.parseObject(result); |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CouponDataVo { |
| | | /** |
| | | * 用户类型1=城市管理者 2=平台管理者 |
| | | */ |
| | | Integer userType; |
| | | /** |
| | | * 城市管理者id |
| | | */ |
| | | Integer cityManagerId; |
| | | /** |
| | | * 券名称 |
| | | */ |
| | | String couponName; |
| | | /** |
| | | * 优惠券类型 |
| | | */ |
| | | Integer prescription; |
| | | /** |
| | | * 条件金额 |
| | | */ |
| | | BigDecimal condition; |
| | | /** |
| | | * 减去金额 |
| | | */ |
| | | BigDecimal subtraction; |
| | | /** |
| | | * 折扣金额 |
| | | */ |
| | | BigDecimal discount; |
| | | /** |
| | | * 体验券名称 |
| | | */ |
| | | BigDecimal experience; |
| | | /** |
| | | * 说明 |
| | | */ |
| | | String illustrate; |
| | | /** |
| | | * 发放方式 |
| | | */ |
| | | Integer distributionMethod; |
| | | /** |
| | | * 所需积分 |
| | | */ |
| | | Integer requiredPoints; |
| | | /** |
| | | * 用户人群 |
| | | */ |
| | | Integer userGroup; |
| | | /** |
| | | * 发放数量 |
| | | */ |
| | | Integer quantityIssued; |
| | | /** |
| | | * 限领数量 |
| | | */ |
| | | Integer pickUpQuantity; |
| | | /** |
| | | * 有效期 |
| | | */ |
| | | String periodOfValidity; |
| | | /** |
| | | * 兑换方式 |
| | | */ |
| | | Integer exchangeMethod; |
| | | /** |
| | | * 所需现金 |
| | | */ |
| | | BigDecimal requiredCash; |
| | | /** |
| | | * 封面图 |
| | | */ |
| | | String goodImg; |
| | | /** |
| | | * 图片列表 |
| | | */ |
| | | List<String> goodImgs; |
| | | /** |
| | | * 适用范围 |
| | | */ |
| | | Integer company; |
| | | /** |
| | | * 城市code |
| | | */ |
| | | List<Integer> cityIds; |
| | | /** |
| | | * 门店列表 |
| | | */ |
| | | List<Integer> storeIds; |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/14 14:59 |
| | | */ |
| | | @Data |
| | | @TableName("t_protocol") |
| | | public class Protocol { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 数据类型(1=用户协议,2=隐私协议,3=运动安全公告书) |
| | | */ |
| | | @TableField("type") |
| | | private Integer type; |
| | | /** |
| | | * 内容 |
| | | */ |
| | | @TableField("content") |
| | | private String content; |
| | | /** |
| | | * 添加时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | @TableName("t_store_evaluation") |
| | | public class TEvaluation { |
| | | |
| | | private Integer id; |
| | | |
| | | @TableField("appUserId") |
| | | private Integer appUserId; |
| | | @TableField("storeId") |
| | | private Integer storeId; |
| | | private Double score; |
| | | private String content; |
| | | private String imgs; |
| | | private Integer state; |
| | | @TableField("insertTime") |
| | | private Date insertTime; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | |
| | | @Data |
| | | public class TEvaluationListVo { |
| | | private Integer id; |
| | | |
| | | private String pName; |
| | | |
| | | private String cName; |
| | | |
| | | private String shopName; |
| | | |
| | | private String name; |
| | | |
| | | private String phone; |
| | | |
| | | private Double score; |
| | | |
| | | private String time; |
| | | |
| | | private Integer appUserId; |
| | | private String imgs; |
| | | private String content; |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.extension.activerecord.Model; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import lombok.Data; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * <p> |
| | | * 通知表 |
| | | * </p> |
| | | * |
| | | * @author stylefeng |
| | | * @since 2017-07-11 |
| | | */ |
| | | @TableName("t_notice") |
| | | @Data |
| | | public class TNotice extends Model<TNotice> { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value="id", type= IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 标题 |
| | | */ |
| | | private String name; |
| | | /** |
| | | * 类型 |
| | | */ |
| | | private Integer sort; |
| | | /** |
| | | * 内容 |
| | | */ |
| | | private String content; |
| | | /** |
| | | * 创建时间 |
| | | */ |
| | | @TableField("insertTime") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private Date insertTime; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | private Integer state; |
| | | @TableField("upOrDown") |
| | | private Integer upOrDown; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.model; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:43 |
| | | */ |
| | | @Data |
| | | @TableName("t_site_type") |
| | | public class TSiteType { |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Integer id; |
| | | /** |
| | | * 门店id |
| | | */ |
| | | @TableField("state") |
| | | private Integer state; |
| | | /** |
| | | * 场地名称 |
| | | */ |
| | | @TableField("name") |
| | | private String name; |
| | | } |
| | |
| | | public class TStore { |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | @TableField("name") |
| | | private String name; |
| | | @TableField("storeStaffId") |
| | | private Integer storeStaffId; |
New file |
| | |
| | | package com.dsh.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.modular.system.model.TEvaluation; |
| | | import com.dsh.guns.modular.system.model.TEvaluationListVo; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.model.TStoreListVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | | * 字典服务 |
| | | * |
| | | * @author fengshuonan |
| | | * @date 2017-04-27 17:00 |
| | | */ |
| | | public interface IEvaluationService extends IService<TEvaluation> { |
| | | |
| | | |
| | | List<TEvaluationListVo> listAll(Page<TEvaluationListVo> page, String provinceCode, String cityCode, String name, String phone, String shopName); |
| | | |
| | | TEvaluationListVo info(Integer id); |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.modular.system.model.Protocol; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/14 15:04 |
| | | */ |
| | | public interface IProtocolService extends IService<Protocol> { |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.modular.system.model.Notice; |
| | | import com.dsh.guns.modular.system.model.TNotice; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 通知表 服务类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng123 |
| | | * @since 2018-02-22 |
| | | */ |
| | | public interface ITNoticeService extends IService<TNotice> { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.dsh.guns.modular.system.model.TSite; |
| | | import com.dsh.guns.modular.system.model.TSiteType; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:49 |
| | | */ |
| | | public interface ITSiteTypeService extends IService<TSiteType> { |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.feignClient.account.AppUserClient; |
| | | import com.dsh.course.feignClient.account.model.QueryByNamePhone; |
| | | import com.dsh.course.feignClient.account.model.TAppUser; |
| | | import com.dsh.course.feignClient.auth.UserClient; |
| | | import com.dsh.course.mapper.EvaluationMapper; |
| | | import com.dsh.course.mapper.StoreMapper; |
| | | import com.dsh.guns.modular.system.model.TEvaluation; |
| | | import com.dsh.guns.modular.system.model.TEvaluationListVo; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.model.TStoreListVo; |
| | | import com.dsh.guns.modular.system.service.IEvaluationService; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | @Service |
| | | public class EvaluationServiceImpl extends ServiceImpl<EvaluationMapper, TEvaluation> implements IEvaluationService { |
| | | |
| | | @Autowired |
| | | private AppUserClient appUserClient; |
| | | |
| | | @Override |
| | | public List<TEvaluationListVo> listAll(Page<TEvaluationListVo> page, String provinceCode, String cityCode, String name, String phone, String shopName) { |
| | | List<TAppUser> list = appUserClient.queryByNamePhone(new QueryByNamePhone(name,phone)); |
| | | if(list.size()==0){ |
| | | return new ArrayList<>(); |
| | | } |
| | | |
| | | List<TEvaluationListVo> tEvaluationListVos = this.baseMapper.listAll(page, provinceCode, cityCode, name, phone, shopName); |
| | | for (TEvaluationListVo tEvaluationListVo : tEvaluationListVos) { |
| | | for (TAppUser tAppUser : list) { |
| | | if(tEvaluationListVo.getAppUserId().equals(tAppUser.getId())){ |
| | | tEvaluationListVo.setName(tAppUser.getName()); |
| | | tEvaluationListVo.setPhone(tAppUser.getPhone()); |
| | | } |
| | | } |
| | | } |
| | | return tEvaluationListVos; |
| | | } |
| | | |
| | | @Override |
| | | public TEvaluationListVo info(Integer id) { |
| | | TEvaluationListVo info = this.baseMapper.info(id); |
| | | Integer appUserId = info.getAppUserId(); |
| | | TAppUser tAppUser = appUserClient.queryById(appUserId); |
| | | info.setName(tAppUser.getName()); |
| | | info.setPhone(tAppUser.getPhone()); |
| | | return info; |
| | | } |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.ProtocolMapper; |
| | | import com.dsh.guns.modular.system.model.Protocol; |
| | | import com.dsh.guns.modular.system.service.IProtocolService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @date 2023/6/14 15:05 |
| | | */ |
| | | @Service |
| | | public class ProtocolServiceImpl extends ServiceImpl<ProtocolMapper, Protocol> implements IProtocolService { |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.NoticeMapper; |
| | | import com.dsh.course.mapper.TNoticeMapper; |
| | | import com.dsh.guns.modular.system.model.Notice; |
| | | import com.dsh.guns.modular.system.model.TNotice; |
| | | import com.dsh.guns.modular.system.service.INoticeService; |
| | | import com.dsh.guns.modular.system.service.ITNoticeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * <p> |
| | | * 通知表 服务实现类 |
| | | * </p> |
| | | * |
| | | * @author stylefeng123 |
| | | * @since 2018-02-22 |
| | | */ |
| | | @Service |
| | | public class TNoticeServiceImpl extends ServiceImpl<TNoticeMapper, TNotice> implements ITNoticeService { |
| | | |
| | | } |
New file |
| | |
| | | package com.dsh.guns.modular.system.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.dsh.course.mapper.TSiteMapper; |
| | | import com.dsh.course.mapper.TSiteTypeMapper; |
| | | import com.dsh.guns.modular.system.model.TSite; |
| | | import com.dsh.guns.modular.system.model.TSiteType; |
| | | import com.dsh.guns.modular.system.service.ITSiteService; |
| | | import com.dsh.guns.modular.system.service.ITSiteTypeService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @author zhibing.pu |
| | | * @Date 2023/8/1 17:50 |
| | | */ |
| | | @Service |
| | | public class TSiteTypeServiceImpl extends ServiceImpl<TSiteTypeMapper, TSiteType> implements ITSiteTypeService { |
| | | } |
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.guns.modular.system.model.Protocol"> |
| | | |
| | | </mapper> |
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.EvaluationMapper"> |
| | | |
| | | <select id="listAll" resultType="com.dsh.guns.modular.system.model.TEvaluationListVo"> |
| | | select t1.id,t1.appUserId,t1.score,t1.insertTime time,t2.name shopName,t2.province pName,t2.city cName from t_store_evaluation t1 left join t_store t2 on t1.storeId =t2.id |
| | | where t1.state !=3 |
| | | <if test="provinceCode!=null and provinceCode !=''"> |
| | | and t2.provinceCode =#{provinceCode} |
| | | </if> |
| | | <if test="cityCode!=null and cityCode !=''"> |
| | | and t2.cityCode =#{cityCode} |
| | | </if> |
| | | <if test="shopName!=null and shopName !=''"> |
| | | and t2.name like concat("%",#{shopName},"%") |
| | | </if> |
| | | <if test="shopName!=null and shopName !=''"> |
| | | and t2.name like concat("%",#{shopName},"%") |
| | | </if> |
| | | </select> |
| | | <select id="info" resultType="com.dsh.guns.modular.system.model.TEvaluationListVo"> |
| | | select t1.id,t1.appUserId,t1.score,t1.insertTime time,t1.imgs,t1.content,t2.name shopName,t2.province pName,t2.city cName from t_store_evaluation t1 left join t_store t2 on t1.storeId =t2.id |
| | | where t1.id =#{id} |
| | | </select> |
| | | </mapper> |
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.TNoticeMapper"> |
| | | |
| | | </mapper> |
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.TSiteTypeMapper"> |
| | | |
| | | </mapper> |
| | |
| | | ) as aa order by aa.code |
| | | </select> |
| | | <select id="queryListOfpage" resultType="java.util.Map"> |
| | | SELECT id, cityManagerId, province, city, `name` |
| | | SELECT `id`, `cityManagerId`, `province`, `city`, `name` |
| | | from t_store |
| | | where 1=1 |
| | | <if test="provinceCode != null"> |
| | |
| | | <if test="cityManagerId != null"> |
| | | and cityManagerId = #{cityManagerId} |
| | | </if> |
| | | <if test="storeName != null and storeName != ' '"> |
| | | <if test="storeName != null and storeName != ''"> |
| | | and `name` like CONCAT('%',#{storeName},'%') |
| | | </if> |
| | | </select> |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>通知管理</h5> |
| | | <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="condition" name="名称" /> |
| | | <#NameCon id="name" name="公告名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="type" name="状态"> |
| | | <option value="">全部</option> |
| | | <option value="1">已上架</option> |
| | | <option value="0">已下架</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="Notice.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="Notice.research()"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="NoticeTableToolbar" role="group"> |
| | | @if(shiro.hasPermission("/notice/add")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="Notice.openAddNotice()"/> |
| | | @} |
| | | @if(shiro.hasPermission("/notice/update")){ |
| | | <#button name="添加" icon="fa-plus" clickFun="Notice.openAdd()"/> |
| | | <#button name="修改" icon="fa-plus" clickFun="Notice.openNoticeDetail()" space="true"/> |
| | | @} |
| | | @if(shiro.hasPermission("/notice/delete")){ |
| | | <#button name="删除" icon="fa-plus" clickFun="Notice.delete()" space="true"/> |
| | | @} |
| | | <#button name="查看详情" icon="fa-plus" clickFun="Notice.info()" space="true"/> |
| | | <#button name="上架" icon="fa-plus" clickFun="Notice.updateType(1)" space="true"/> |
| | | <#button name="下架" icon="fa-plus" clickFun="Notice.updateType(0)" space="true"/> |
| | | </div> |
| | | <#table id="NoticeTable"/> |
| | | </div> |
| | |
| | | <input type="hidden" id="id" value=""> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-1 control-label">标题</label> |
| | | <div class="col-sm-11"> |
| | | <input class="form-control" id="title" name="title" type="text"> |
| | | <label class="col-sm-1 control-label">公告名称</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="name" name="name" type="text"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-1 control-label">内容</label> |
| | | <div class="col-sm-11"> |
| | | <div id="editor" class="editorHeight"> |
| | | </div> |
| | | <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-1 control-label">排序:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" type="text" id="sort" name="sort"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | |
| | | |
| | | </div> |
| | | </div> |
| | | <script type="text/javascript" src="//unpkg.com/wangeditor/release/wangEditor.min.js"></script> |
| | | <script src="${ctxPath}/modular/system/notice/notice_info.js"></script> |
| | | @} |
| | | @} |
| | |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="noticeInfoForm"> |
| | | |
| | | <input type="hidden" id="id" value="${notice.id}"> |
| | | <input type="hidden" id="contentVal" value='${notice.content}'> |
| | | <input type="hidden" id="id" value="${item.id}"> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-1 control-label">标题</label> |
| | | <div class="col-sm-11"> |
| | | <input class="form-control" id="title" name="title" type="text" value="${notice.title}"> |
| | | <label class="col-sm-1 control-label">公告名称</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" id="name" name="name" type="text" value="${item.name}"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-1 control-label">内容</label> |
| | | <div class="col-sm-11"> |
| | | <div id="editor" class="editorHeight"> |
| | | </div> |
| | | <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-1 control-label">排序:</label> |
| | | <div class="col-sm-5"> |
| | | <input class="form-control" type="text" id="sort" name="sort" value="${item.sort}"> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | @if(type==1){ |
| | | <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="NoticeInfoDlg.editSubmit()"/> |
| | | @} |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="NoticeInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="tabs-container"> |
| | | <ul class="nav nav-tabs"> |
| | | <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">注册协议</a></li> |
| | | <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">用户协议</a></li> |
| | | <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">隐私协议</a></li> |
| | | <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">用户协议</a></li> |
| | | <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">隐私协议</a></li> |
| | | <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">运动安全告知书</a></li> |
| | | <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">注销账号说明</a></li> |
| | | </ul> |
| | | <div class="tab-content"> |
| | | <div id="tab-1" class="tab-pane active"> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | <div id="tab-4" class="tab-pane"> |
| | | <div class="panel-body"> |
| | | <textarea type="text/plain" id="editor_4" style="width:1200px;height:400px;">${four.content}</textarea> |
| | | <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="update_4(${four.id});"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | function submitData(content,id) { |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgreement/updateAppParam", function(data){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tAgree/updateAppParam", function(data){ |
| | | Feng.success("编辑成功!"); |
| | | },function(data){ |
| | | Feng.error("编辑失败!" + data.responseJSON.message + "!"); |
| | |
| | | <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"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在省 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="pCode" onchange="TCompetition.oneChange(this)"> |
| | | <option value="">全部</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在市 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="cCode"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="shopName" name="门店名称" /> |
| | |
| | | <#button name="添加" icon="fa-plus" clickFun="TCompetition.openAddTCompetition()"/> |
| | | <#button name="编辑" icon="fa-edit" clickFun="TCompetition.openTCompetitionDetail()" space="true"/> |
| | | <#button name="取消" icon="fa-remove" clickFun="TCompetition.delete()" space="true"/> |
| | | <#button name="查看详情" icon="fa-remove" clickFun="TCompetition.delete()" space="true"/> |
| | | <#button name="已报名人员" icon="fa-remove" clickFun="TCompetition.delete()" space="true"/> |
| | | <#button name="查看详情" icon="fa-remove" clickFun="TCompetition.info()" space="true"/> |
| | | <#button name="已报名人员" icon="fa-remove" clickFun="TCompetition.user()" space="true"/> |
| | | |
| | | </div> |
| | | <#table id="TCompetitionTable"/> |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | |
| | | <div class="ibox-title"> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <input hidden id="id" value="${id}"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="state" name="状态" > |
| | | <option value="">全部</option> |
| | | <option value="1">正常</option> |
| | | <option value="3">已取消</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCompetition.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="导出" icon="fa-plus" clickFun="TCompetition.export()"/> |
| | | </div> |
| | | <#table id="TCompetitionTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCompetition/tCompetitionUser.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#createTime' |
| | | ,range: true |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | @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 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"> |
| | | <select class="form-control" id="pCode" name="pCode" onchange="TCarInfoDlg.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"> |
| | | <select class="form-control" id="cCode" name="cCode" onchange="TCarInfoDlg.oneChangeNext(this)"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">支付方式:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="checkbox"> 现金支付 |
| | | <input type="checkbox"> 玩湃币支付 |
| | | <input type="checkbox"> 课时支付 |
| | | <input type="checkbox" onclick="updateType(1,this)"> 现金支付 |
| | | <input type="checkbox" onclick="updateType(2,this)"> 玩湃币支付 |
| | | <input type="checkbox" onclick="updateType(3,this)"> 课时支付 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <div class="form-group" id="payType1" style="display: none"> |
| | | <label class="col-sm-3 control-label">现金支付:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="cashPrice"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <div class="form-group" id="payType2" style="display: none"> |
| | | <label class="col-sm-3 control-label">玩湃币支付:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="playPaiCoin"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <div class="form-group" id="payType3" style="display: none"> |
| | | <label class="col-sm-3 control-label">课时支付:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="classPrice"> |
| | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">参加地点:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 500px;" type="text" id="address"> |
| | | <input class="form-control" style="width: 500px;" type="text" id="address" onchange="TCarInfoDlg.searchByStationName(this,1)"> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10" style="margin-left: 397px;width: 70%;" > |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <div hidden id="longitude"></div> |
| | | <div hidden id="latitude"></div> |
| | | |
| | | <#input id="applicantsNumber" name="报名人数" type="text"/> |
| | | <#input id="baseNumber" name="基础报名人数" type="text"/> |
| | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">赛事简介:</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="introduction"></textarea> |
| | | <textarea id="introduction" style="height: 203px; width: 506px;"></textarea> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCompetition/tCompetition_info.js"></script> |
| | | <script> |
| | | |
| | | |
| | | laydate.render({ |
| | | elem: '#annualInspectionTime' |
| | | ,lang:"en" |
| | | elem: '#startTime' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#commercialInsuranceTime' |
| | | ,lang:"en" |
| | | elem: '#endTime' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateA' |
| | | ,lang:"en" |
| | | elem: '#registerEndTime' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,lang:"en" |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,lang:"en" |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateB' |
| | |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | |
| | | |
| | | function updateType(e,o) { |
| | | if(e==1){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType1").show(); |
| | | }else { |
| | | $("#payType1").hide(); |
| | | } |
| | | } |
| | | if(e==2){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType2").show(); |
| | | }else { |
| | | $("#payType2").hide(); |
| | | } |
| | | } |
| | | if(e==3){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType3").show(); |
| | | }else { |
| | | $("#payType3").hide(); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | @} |
| | |
| | | @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 class="form-horizontal" id="carInfoForm"> |
| | | <input type="hidden" id="id" name="id" value="${item.id}"> |
| | | |
| | | <input type="hidden" id="roleType" name="roleType" value="${roleType}"> |
| | | @if(language==1){ |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">所属机构:</label> |
| | | <div class="col-sm-9" style="display: flex;align-items: center;"> |
| | | @if(roleType == 1){ |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="companyType1" value="1" name="companyType" ${1 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(1)"> |
| | | <label for="companyType1"> 平台车辆 </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="companyTyp2" value="2" name="companyType" ${2 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(2)"> |
| | | <label for="companyTyp2"> 加盟车辆 </label> |
| | | </div> |
| | | <select class="form-control companyDiv" id="oneId" onchange="TCarInfoDlg.oneChange(this)" style="width: 200px"> |
| | | <option value="">选择所属分公司</option> |
| | | @for(obj in companyList!){ |
| | | <option value="${obj.id}" ${obj.id == item.companyId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | <select class="form-control companyDiv" id="twoId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">选择所属加盟商</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 2){ |
| | | <span class="control-label">${objectName!}</span> |
| | | <select class="form-control" id="franchiseeId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">选择所属加盟商</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 3){ |
| | | <span class="control-label">${objectName!}</span> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <fieldset> |
| | | <label class="col-sm-3 control-label">服务模式:</label> |
| | | <div class="col-sm-9"> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox1" value="1" ${2 == one ? 'checked=checked' : ''} onclick="TCarInfoDlg.zcServerClick()"> |
| | | <label for="serverBox1"> 摩托车 </label> |
| | | </div> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox4" value="4" ${2 == four ? 'checked=checked' : ''}> |
| | | <label for="serverBox4"> 同城快送 </label> |
| | | </div> |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | <div class="form-group" id="zcModelDiv"> |
| | | <label class="col-sm-3 control-label">摩托车车型:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="zcModel" name="zcModel"> |
| | | <option value="">选择车型</option> |
| | | @for(obj in zcModelList){ |
| | | <option value="${obj.id}" ${obj.id == zcModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#select id="carBrandId" name="车辆品牌:" onchange="TCarInfoDlg.brandChange(this)"> |
| | | <option value="">选择车辆品牌</option> |
| | | @for(obj in brandList){ |
| | | <option value="${obj.id}" ${obj.id == item.carBrandId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carModelId" name="车辆类型:"> |
| | | <option value="">选择车辆类型</option> |
| | | @for(obj in modelList){ |
| | | <option value="${obj.id}" ${obj.id == item.carModelId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carColor" name="车辆颜色:"> |
| | | <option value="">选择车辆颜色</option> |
| | | <option value="1" ${'1' == item.carColor ? 'selected=selected' : ''}>黑色</option> |
| | | <option value="2" ${'2' == item.carColor ? 'selected=selected' : ''}>银色</option> |
| | | <option value="3" ${'3' == item.carColor ? 'selected=selected' : ''}>白色</option> |
| | | <option value="4" ${'4' == item.carColor ? 'selected=selected' : ''}>红色</option> |
| | | <option value="5" ${'5' == item.carColor ? 'selected=selected' : ''}>黄色</option> |
| | | <option value="6" ${'6' == item.carColor ? 'selected=selected' : ''}>橙色</option> |
| | | <option value="7" ${'7' == item.carColor ? 'selected=selected' : ''}>蓝色</option> |
| | | </#select> |
| | | <#input id="carLicensePlate" name="车牌号" value="${item.carLicensePlate}"/> |
| | | <#avatar id="carPhoto" name="车辆照片:" avatarImg="${item.carPhoto}"/> |
| | | <#input id="drivingLicenseNumber" name="行驶证编号" value="${item.drivingLicenseNumber}"/> |
| | | <#avatar id="drivingLicensePhoto" name="行驶证照片:" avatarImg="${item.drivingLicensePhoto}"/> |
| | | <#input id="annualInspectionTime" name="年检到期时间" type="text" value="${item.annualInspectionTime}"/> |
| | | <#input id="commercialInsuranceTime" name="商业保险到期时间" type="text" value="${item.commercialInsuranceTime}"/> |
| | | </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="TCarInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(language==2){ |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">Affiliated organization:</label> |
| | | <div class="col-sm-9" style="display: flex;align-items: center;"> |
| | | @if(roleType == 1){ |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="companyType1" value="1" name="companyType" ${1 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(1)"> |
| | | <label for="companyType1"> Platform vehicle </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="companyTyp2" value="2" name="companyType" ${2 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(2)"> |
| | | <label for="companyTyp2"> Franchised vehicles </label> |
| | | </div> |
| | | <select class="form-control companyDiv" id="oneId" onchange="TCarInfoDlg.oneChange(this)" style="width: 200px"> |
| | | <option value="">Select Branch</option> |
| | | @for(obj in companyList!){ |
| | | <option value="${obj.id}" ${obj.id == item.companyId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | <select class="form-control companyDiv" id="twoId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">Select the franchisee</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 2){ |
| | | <span class="control-label">${objectName!}</span> |
| | | <select class="form-control" id="franchiseeId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">Select the franchisee</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 3){ |
| | | <span class="control-label">${objectName!}</span> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <fieldset> |
| | | <label class="col-sm-3 control-label">Service mode:</label> |
| | | <input hidden id="id" value="${item.id}"> |
| | | <input hidden id="s1" value="${item.registerCondition}"> |
| | | <input hidden id="q1" value="${item.cashPrice}"> |
| | | <input hidden id="q2" value="${item.playPaiCoin}"> |
| | | <input hidden id="q3" value="${item.classPrice}"> |
| | | <input hidden id="rname" value="${item.realName}"> |
| | | <input hidden id="type" value="${item.status}"> |
| | | @if(type==2){ |
| | | <#label id="types" name="当前状态" type="text" /> |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">举办省:</label> |
| | | <div class="col-sm-9"> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox1" value="1" ${2 == one ? 'checked=checked' : ''} onclick="TCarInfoDlg.zcServerClick()"> |
| | | <label for="serverBox1"> motorcycle </label> |
| | | </div> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox4" value="4" ${2 == four ? 'checked=checked' : ''}> |
| | | <label for="serverBox4"> Intra-city express delivery </label> |
| | | </div> |
| | | <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> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | <div class="form-group" id="zcModelDiv"> |
| | | <label class="col-sm-3 control-label">Motorcycle model setting:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="zcModel" name="zcModel"> |
| | | <option value="">Select vehicle type</option> |
| | | @for(obj in zcModelList){ |
| | | <option value="${obj.id}" ${obj.id == zcModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="kcModelDiv"> |
| | | <label class="col-sm-3 control-label">Cross city travel model:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="kcModel" name="kcModel"> |
| | | <option value="">Select vehicle type</option> |
| | | @for(obj in kcModelList){ |
| | | <option value="${obj.id}" ${obj.id == kcModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#select id="carBrandId" name="Vehicle brand:" onchange="TCarInfoDlg.brandChange(this)"> |
| | | <option value="">Select vehicle brand</option> |
| | | @for(obj in brandList){ |
| | | <option value="${obj.id}" ${obj.id == item.carBrandId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carModelId" name="Vehicle type:"> |
| | | <option value="">Select vehicle type</option> |
| | | @for(obj in modelList){ |
| | | <option value="${obj.id}" ${obj.id == item.carModelId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carColor" name="Vehicle color:"> |
| | | <option value="">Select vehicle color</option> |
| | | <option value="1" ${'1' == item.carColor ? 'selected=selected' : ''}>black</option> |
| | | <option value="2" ${'2' == item.carColor ? 'selected=selected' : ''}>silvery</option> |
| | | <option value="3" ${'3' == item.carColor ? 'selected=selected' : ''}>white</option> |
| | | <option value="4" ${'4' == item.carColor ? 'selected=selected' : ''}>red</option> |
| | | <option value="5" ${'5' == item.carColor ? 'selected=selected' : ''}>yellow</option> |
| | | <option value="6" ${'6' == item.carColor ? 'selected=selected' : ''}>orange</option> |
| | | <option value="7" ${'7' == item.carColor ? 'selected=selected' : ''}>blue</option> |
| | | </#select> |
| | | <#input id="carLicensePlate" name="License plate number" value="${item.carLicensePlate}"/> |
| | | <#avatar id="carPhoto" name="Vehicle photos:" avatarImg="${item.carPhoto}"/> |
| | | <#input id="drivingLicenseNumber" name="Driving license number" value="${item.drivingLicenseNumber}"/> |
| | | <#avatar id="drivingLicensePhoto" name="Photo of driving license:" avatarImg="${item.drivingLicensePhoto}"/> |
| | | <#input id="annualInspectionTime" name="Annual inspection expiration time" type="text" value="${item.annualInspectionTime}"/> |
| | | <#input id="commercialInsuranceTime" name="Expiration time of commercial insurance" type="text" value="${item.commercialInsuranceTime}"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="Submit" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="Cancel" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(language==3){ |
| | | <div class="row"> |
| | | <div class="col-sm-11"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">Organisasi Afiliasi:</label> |
| | | <div class="col-sm-9" style="display: flex;align-items: center;"> |
| | | @if(roleType == 1){ |
| | | <div class="radio radio-info radio-inline"> |
| | | <input type="radio" id="companyType1" value="1" name="companyType" ${1 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(1)"> |
| | | <label for="companyType1"> Kendaraan platform </label> |
| | | </div> |
| | | <div class="radio radio-success radio-inline"> |
| | | <input type="radio" id="companyTyp2" value="2" name="companyType" ${2 == companyType ? 'checked=checked' : ''} onclick="TCarInfoDlg.companyTypeClick(2)"> |
| | | <label for="companyTyp2"> Kendaraan waralaba </label> |
| | | </div> |
| | | <select class="form-control companyDiv" id="oneId" onchange="TCarInfoDlg.oneChange(this)" style="width: 200px"> |
| | | <option value="">Pilih Branch</option> |
| | | @for(obj in companyList!){ |
| | | <option value="${obj.id}" ${obj.id == item.companyId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | <select class="form-control companyDiv" id="twoId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">Pilih pemilik franchise</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 2){ |
| | | <span class="control-label">${objectName!}</span> |
| | | <select class="form-control" id="franchiseeId" style="width: 200px;margin-left: 30px;"> |
| | | <option value="">Pilih pemilik franchise</option> |
| | | @for(obj in franchiseeList!){ |
| | | <option value="${obj.id}" ${obj.id == item.franchiseeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @}else if(roleType == 3){ |
| | | <span class="control-label">${objectName!}</span> |
| | | @} |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <fieldset> |
| | | <label class="col-sm-3 control-label">Mode Layanan:</label> |
| | | <div class="form-group" id="cityCode"> |
| | | <label class="col-sm-3 control-label">举办市:</label> |
| | | <div class="col-sm-9"> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox1" value="1" ${2 == one ? 'checked=checked' : ''} onclick="TCarInfoDlg.zcServerClick()"> |
| | | <label for="serverBox1"> sepeda motor </label> |
| | | </div> |
| | | <div class="checkbox checkbox-success checkbox-inline"> |
| | | <input type="checkbox" name="serverBox" id="serverBox4" value="4" ${2 == four ? 'checked=checked' : ''}> |
| | | <label for="serverBox4"> Pengiriman Ekspres Dalam Kota </label> |
| | | </div> |
| | | <select class="form-control" id="cCode" name="cCode" onchange="TCarInfoDlg.oneChangeNext(this)"> |
| | | <option value="">选择市</option> |
| | | @for(obj in list1){ |
| | | <option value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </fieldset> |
| | | </div> |
| | | <div class="form-group" id="zcModelDiv"> |
| | | <label class="col-sm-3 control-label">Pengaturan model sepeda motor:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="zcModel" name="zcModel"> |
| | | <option value="">Pilih Jenis Kendaraan</option> |
| | | @for(obj in zcModelList){ |
| | | <option value="${obj.id}" ${obj.id == zcModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="form-group" id="kcModelDiv"> |
| | | <label class="col-sm-3 control-label">Model perjalanan melintasi kota:</label> |
| | | <div class="col-sm-9"> |
| | | <select class="form-control" id="kcModel" name="kcModel"> |
| | | <option value="">Pilih Jenis Kendaraan</option> |
| | | @for(obj in kcModelList){ |
| | | <option value="${obj.id}" ${obj.id == kcModel ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | @} |
| | | <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"> |
| | | <option value="">选择门店</option> |
| | | @for(obj in list2){ |
| | | <option value="${obj.id}" ${obj.id == item.storeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <#select id="carBrandId" name="Merek kendaraan:" onchange="TCarInfoDlg.brandChange(this)"> |
| | | <option value="">Pilih Merek Kendaraan</option> |
| | | @for(obj in brandList){ |
| | | <option value="${obj.id}" ${obj.id == item.carBrandId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carModelId" name="Jenis Kendaraan:"> |
| | | <option value="">Pilih Jenis Kendaraan</option> |
| | | @for(obj in modelList){ |
| | | <option value="${obj.id}" ${obj.id == item.carModelId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </#select> |
| | | <#select id="carColor" name="车辆颜色:"> |
| | | <option value="">选择车辆颜色</option> |
| | | <option value="1" ${'1' == item.carColor ? 'selected=selected' : ''}>hitam</option> |
| | | <option value="2" ${'2' == item.carColor ? 'selected=selected' : ''}>perak</option> |
| | | <option value="3" ${'3' == item.carColor ? 'selected=selected' : ''}>putih</option> |
| | | <option value="4" ${'4' == item.carColor ? 'selected=selected' : ''}>merah</option> |
| | | <option value="5" ${'5' == item.carColor ? 'selected=selected' : ''}>kuning</option> |
| | | <option value="6" ${'6' == item.carColor ? 'selected=selected' : ''}>oranye</option> |
| | | <option value="7" ${'7' == item.carColor ? 'selected=selected' : ''}>biru</option> |
| | | </#select> |
| | | <#input id="carLicensePlate" name="Nomor plat nomor" value="${item.carLicensePlate}"/> |
| | | <#avatar id="carPhoto" name="Foto kendaraan:" avatarImg="${item.carPhoto}"/> |
| | | <#input id="drivingLicenseNumber" name="Nomor SIM Mengemudi" value="${item.drivingLicenseNumber}"/> |
| | | <#avatar id="drivingLicensePhoto" name="Foto SIM:" avatarImg="${item.drivingLicensePhoto}"/> |
| | | <#input id="annualInspectionTime" name="Waktu Kedaluwarsa Inspeksi Tahunan" type="text" value="${item.annualInspectionTime}"/> |
| | | <#input id="commercialInsuranceTime" name="Waktu kedaluwarsa asuransi komersial" type="text" value="${item.commercialInsuranceTime}"/> |
| | | </div> |
| | | </div> |
| | | <#input id="name" name="赛事名称" type="text" value="${item.name}"/> |
| | | <#input id="startTime" name="开始时间" type="text" value="${item.startTime}"/> |
| | | <#input id="endTime" name="结束时间" type="text" value="${item.endTime}"/> |
| | | <#input id="registerEndTime" name="截止报名时间" type="text" value="${item.registerEndTime}"/> |
| | | @if(type==2){ |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">报名条件:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="registerCondition" value="1"> 全部用户 |
| | | <input type="radio" name="registerCondition" value="2">仅限年度会员参与 |
| | | <input type="radio" name="registerCondition" value="3">仅限学员参与 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | <#button btnCss="info" name="Kirim" id="ensure" icon="fa-check" clickFun="TCarInfoDlg.editSubmit()"/> |
| | | <#button btnCss="danger" name="Batal" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">报名年龄:</label> |
| | | <div class="col-sm-9" style="display: flex"> |
| | | <input class="form-control" style="width: 100px;" type="text" id="startAge" value="${item.startAge}"> ~ <input class="form-control" style="width: 100px;" type="text" id="endAge" value="${item.endAge}"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">支付方式:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="checkbox" id="t1" onclick="updateType(1,this)"> 现金支付 |
| | | <input type="checkbox" id="t2" onclick="updateType(2,this)"> 玩湃币支付 |
| | | <input type="checkbox" id="t3" onclick="updateType(3,this)"> 课时支付 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="payType1" style="display: none"> |
| | | <label class="col-sm-3 control-label">现金支付:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="cashPrice" value="${item.cashPrice}"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="payType2" style="display: none"> |
| | | <label class="col-sm-3 control-label">玩湃币支付:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="playPaiCoin" value="${item.playPaiCoin}"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="payType3" style="display: none"> |
| | | <label class="col-sm-3 control-label">课时支付:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="classPrice" value="${item.classPrice}"> |
| | | </div> |
| | | </div> |
| | | @} |
| | | |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">参加地点:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 500px;" type="text" id="address" onchange="TCarInfoDlg.searchByStationName(this,1)" value="${item.address}"> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10" style="margin-left: 397px;width: 70%;" > |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <div hidden id="longitude" value="${item.longitude}"></div> |
| | | <div hidden id="latitude" value="${item.latitude}"></div> |
| | | |
| | | <#input id="applicantsNumber" name="报名人数" type="text" value="${item.applicantsNumber}"/> |
| | | <#input id="baseNumber" name="基础报名人数" type="text" value="${item.baseNumber}"/> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">是否实名:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="realName" value="1"> 是 |
| | | <input type="radio" name="realName" value="0"> 否 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">赛事简介:</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="introduction" style="height: 203px; width: 506px;">${item.introduction}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | <#avatar id="coverDrawing" name="赛事封面(推荐像素:210*280px):" avatarImg="${item.coverDrawing}" /> |
| | | <#avatar id="imgs" name="赛事图片(推荐像素:780*440px):" /> |
| | | <#avatar id="registrationNotes" name="报名须知(推荐像素:宽780px):" avatarImg="${item.registrationNotes}"/> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | @if(type==1){ |
| | | <#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> |
| | | <script src="${ctxPath}/modular/system/tCar/tCar_info.js"></script> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCompetition/tCompetition_info.js"></script> |
| | | <script> |
| | | window.onload = function() { |
| | | if($("#type").val()==1){ |
| | | $("#types").html("未开始").css("color","goldenrod") |
| | | }else if($("#type").val()==2){ |
| | | $("#types").html("已开始").css("color","green") |
| | | }else if($("#type").val()==3){ |
| | | $("#types").html("已结束").css("color","red") |
| | | }else if($("#type").val()==4){ |
| | | $("#types").html("已取消").css("color","red") |
| | | } |
| | | |
| | | |
| | | |
| | | var OBJradio = document.getElementsByName("registerCondition") |
| | | for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio |
| | | if ($("#s1").val() == OBJradio[i].value) {//判断是否与radio的值相同 |
| | | OBJradio[i].checked = true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio = document.getElementsByName("realName") |
| | | for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio |
| | | if ($("#rname").val() == OBJradio[i].value) {//判断是否与radio的值相同 |
| | | OBJradio[i].checked = true//修改选中状态 |
| | | } |
| | | } |
| | | |
| | | if($("#q1").val()>0 && $("#type").val()==2){ |
| | | $("#payType1").show(); |
| | | $("input[id='t1']").attr("checked", "checked") |
| | | } |
| | | if($("#q2").val()>0 && $("#type").val()==2){ |
| | | $("#payType2").show(); |
| | | $("input[id='t2']").attr("checked", "checked") |
| | | } |
| | | if($("#q3").val()>0 && $("#type").val()==2){ |
| | | $("#payType3").show(); |
| | | $("input[id='t3']").attr("checked", "checked") |
| | | } |
| | | |
| | | } |
| | | |
| | | laydate.render({ |
| | | elem: '#annualInspectionTime' |
| | | ,lang:"en" |
| | | elem: '#startTime' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#commercialInsuranceTime' |
| | | ,lang:"en" |
| | | elem: '#endTime' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateA' |
| | | ,lang:"en" |
| | | elem: '#registerEndTime' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,lang:"en" |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,lang:"en" |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | |
| | | 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(); |
| | | |
| | | |
| | | function updateType(e,o) { |
| | | if(e==1){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType1").show(); |
| | | }else { |
| | | $("#payType1").hide(); |
| | | } |
| | | } |
| | | |
| | | TCarInfoDlg.zcServerClick(); |
| | | TCarInfoDlg.kcServerClick(); |
| | | |
| | | }); |
| | | if(e==2){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType2").show(); |
| | | }else { |
| | | $("#payType2").hide(); |
| | | } |
| | | } |
| | | if(e==3){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType3").show(); |
| | | }else { |
| | | $("#payType3").hide(); |
| | | } |
| | | } |
| | | } |
| | | </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"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在省 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="pCode" onchange="TCompetition.oneChange(this)"> |
| | | <option value="">全部</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在市 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="cCode"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="shopName" name="门店名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="eventName" name="赛事名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="state" name="状态" > |
| | | <option value="">全部</option> |
| | | <option value="1">待审核</option> |
| | | <option value="3">未通过</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="registerCondition" name="报名条件" > |
| | | <option value="">全部</option> |
| | | <option value="1">全部用户</option> |
| | | <option value="2">仅限年度会员参与</option> |
| | | <option value="3">仅限学员参与</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCompetition.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="审核" icon="fa-plus" clickFun="TCompetition.openTCompetitionDetail()"/> |
| | | <#button name="查看详情" icon="fa-remove" clickFun="TCompetition.openAddTCompetition()" space="true"/> |
| | | </div> |
| | | <#table id="TCompetitionTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCompetitionAudit/tCompetition.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#createTime' |
| | | ,range: true |
| | | ,lang:"en" |
| | | }); |
| | | </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"> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <input hidden id="id" value="${id}"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="state" name="状态" > |
| | | <option value="">全部</option> |
| | | <option value="1">正常</option> |
| | | <option value="3">已取消</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCompetition.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="导出" icon="fa-plus" clickFun="TCompetition.export()"/> |
| | | </div> |
| | | <#table id="TCompetitionTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCompetition/tCompetitionUser.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#createTime' |
| | | ,range: true |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @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 class="form-horizontal" id="carInfoForm"> |
| | | |
| | | <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.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="TCarInfoDlg.oneChangeNext(this)"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <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"> |
| | | <option value="">选择门店</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#input id="name" name="赛事名称" type="text"/> |
| | | <#input id="startTime" name="开始时间" type="text"/> |
| | | <#input id="endTime" name="结束时间" type="text"/> |
| | | <#input id="registerEndTime" name="截止报名时间" type="text"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">报名条件:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="registerCondition" value="1" checked> 全部用户 |
| | | <input type="radio" name="registerCondition" value="2">仅限年度会员参与 |
| | | <input type="radio" name="registerCondition" value="3">仅限学员参与 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">报名年龄:</label> |
| | | <div class="col-sm-9" style="display: flex"> |
| | | <input class="form-control" style="width: 100px;" type="text" id="startAge"> ~ <input class="form-control" style="width: 100px;" type="text" id="endAge"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">支付方式:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="checkbox" onclick="updateType(1,this)"> 现金支付 |
| | | <input type="checkbox" onclick="updateType(2,this)"> 玩湃币支付 |
| | | <input type="checkbox" onclick="updateType(3,this)"> 课时支付 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="payType1" style="display: none"> |
| | | <label class="col-sm-3 control-label">现金支付:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="cashPrice"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="payType2" style="display: none"> |
| | | <label class="col-sm-3 control-label">玩湃币支付:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="playPaiCoin"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="payType3" style="display: none"> |
| | | <label class="col-sm-3 control-label">课时支付:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="classPrice"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">参加地点:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 500px;" type="text" id="address" onchange="TCarInfoDlg.searchByStationName(this,1)"> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10" style="margin-left: 397px;width: 70%;" > |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <div hidden id="longitude"></div> |
| | | <div hidden id="latitude"></div> |
| | | |
| | | <#input id="applicantsNumber" name="报名人数" type="text"/> |
| | | <#input id="baseNumber" name="基础报名人数" type="text"/> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">是否实名:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="realName" value="1" checked> 是 |
| | | <input type="radio" name="realName" value="0"> 否 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">赛事简介:</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="introduction" style="height: 203px; width: 506px;"></textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | <#avatar id="coverDrawing" name="赛事封面(推荐像素:210*280px):" /> |
| | | <#avatar id="imgs" name="赛事图片(推荐像素:780*440px):" /> |
| | | <#avatar id="registrationNotes" name="报名须知(推荐像素:宽780px):" /> |
| | | |
| | | </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="TCarInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCompetition/tCompetition_info.js"></script> |
| | | <script> |
| | | |
| | | |
| | | laydate.render({ |
| | | elem: '#startTime' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#endTime' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerEndTime' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#nextFixDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#GPSInstallDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | |
| | | |
| | | function updateType(e,o) { |
| | | if(e==1){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType1").show(); |
| | | }else { |
| | | $("#payType1").hide(); |
| | | } |
| | | } |
| | | if(e==2){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType2").show(); |
| | | }else { |
| | | $("#payType2").hide(); |
| | | } |
| | | } |
| | | if(e==3){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType3").show(); |
| | | }else { |
| | | $("#payType3").hide(); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | @} |
New file |
| | |
| | | @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 class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="id" value="${item.id}"> |
| | | <input hidden id="s1" value="${item.registerCondition}"> |
| | | <input hidden id="q1" value="${item.cashPrice}"> |
| | | <input hidden id="q2" value="${item.playPaiCoin}"> |
| | | <input hidden id="q3" value="${item.classPrice}"> |
| | | <input hidden id="rname" value="${item.realName}"> |
| | | <input hidden id="type" value="${item.auditStatus}"> |
| | | @if(type==2){ |
| | | <#label id="types" name="当前状态" type="text" /> |
| | | <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 disabled value="${obj.code}" ${obj.code == item.provinceCode ? 'selected=selected' : ''}>${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="TCarInfoDlg.oneChangeNext(this)"> |
| | | <option value="">选择市</option> |
| | | @for(obj in list1){ |
| | | <option disabled value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | <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"> |
| | | <option value="">选择门店</option> |
| | | @for(obj in list2){ |
| | | <option disabled value="${obj.id}" ${obj.id == item.storeId ? 'selected=selected' : ''}>${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <#input id="name" name="赛事名称" type="text" value="${item.name}" readonly="true"/> |
| | | <#input id="startTime" name="开始时间" type="text" value="${item.startTime}" readonly="true"/> |
| | | <#input id="endTime" name="结束时间" type="text" value="${item.endTime}" readonly="true"/> |
| | | <#input id="registerEndTime" name="截止报名时间" type="text" value="${item.registerEndTime}" readonly="true"/> |
| | | @if(type==2){ |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">报名条件:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="registerCondition" value="1" disabled> 全部用户 |
| | | <input type="radio" name="registerCondition" value="2" disabled>仅限年度会员参与 |
| | | <input type="radio" name="registerCondition" value="3" disabled>仅限学员参与 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">报名年龄:</label> |
| | | <div class="col-sm-9" style="display: flex"> |
| | | <input class="form-control" style="width: 100px;" type="text" id="startAge" value="${item.startAge}" readonly> ~ <input class="form-control" style="width: 100px;" type="text" id="endAge" value="${item.endAge}" readonly> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">支付方式:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="checkbox" id="t1" onclick="updateType(1,this)" disabled> 现金支付 |
| | | <input type="checkbox" id="t2" onclick="updateType(2,this)" disabled> 玩湃币支付 |
| | | <input type="checkbox" id="t3" onclick="updateType(3,this)" disabled> 课时支付 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="payType1" style="display: none"> |
| | | <label class="col-sm-3 control-label">现金支付:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="cashPrice" value="${item.cashPrice}" readonly> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="payType2" style="display: none"> |
| | | <label class="col-sm-3 control-label">玩湃币支付:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="playPaiCoin" value="${item.playPaiCoin}"readonly> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group" id="payType3" style="display: none"> |
| | | <label class="col-sm-3 control-label">课时支付:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="classPrice" value="${item.classPrice}" readonly> |
| | | </div> |
| | | </div> |
| | | @} |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">参加地点:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 500px;" type="text" id="address" onchange="TCarInfoDlg.searchByStationName(this,1)" value="${item.address}" readonly> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10" style="margin-left: 397px;width: 70%;" > |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <div hidden id="longitude" value="${item.longitude}"></div> |
| | | <div hidden id="latitude" value="${item.latitude}"></div> |
| | | |
| | | <#input id="applicantsNumber" name="报名人数" type="text" value="${item.applicantsNumber}" readonly="true"/> |
| | | <#input id="baseNumber" name="基础报名人数" type="text" value="${item.baseNumber}" readonly="true"/> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">是否实名:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="realName" value="1" disabled> 是 |
| | | <input type="radio" name="realName" value="0" disabled> 否 |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">赛事简介:</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="introduction" style="height: 203px; width: 506px;" readonly>${item.introduction}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | <#avatar id="coverDrawing" name="赛事封面(推荐像素:210*280px):" avatarImg="${item.coverDrawing}" /> |
| | | <#avatar id="imgs" name="赛事图片(推荐像素:780*440px):" /> |
| | | <#avatar id="registrationNotes" name="报名须知(推荐像素:宽780px):" avatarImg="${item.registrationNotes}"/> |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">审核状态:</label> |
| | | <div class="col-sm-9"> |
| | | <input type="radio" name="auditType" value="2" checked> 通过 <input type="radio" name="auditType" value="3" > 拒绝 |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">拒绝理由:</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="text" style="height: 203px; width: 506px;"></textarea> |
| | | </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="editSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCompetitionAudit/tCompetition_info.js"></script> |
| | | <script> |
| | | |
| | | window.onload = function() { |
| | | if($("#type").val()==1){ |
| | | $("#types").html("待审核").css("color","goldenrod") |
| | | }else if($("#type").val()==3){ |
| | | $("#types").html("未通过").css("color","red") |
| | | } |
| | | |
| | | |
| | | |
| | | var OBJradio = document.getElementsByName("registerCondition") |
| | | for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio |
| | | if ($("#s1").val() == OBJradio[i].value) {//判断是否与radio的值相同 |
| | | OBJradio[i].checked = true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio = document.getElementsByName("realName") |
| | | for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio |
| | | if ($("#rname").val() == OBJradio[i].value) {//判断是否与radio的值相同 |
| | | OBJradio[i].checked = true//修改选中状态 |
| | | } |
| | | } |
| | | |
| | | if($("#q1").val()>0 && $("#type").val()==2){ |
| | | $("#payType1").show(); |
| | | $("input[id='t1']").attr("checked", "checked") |
| | | } |
| | | if($("#q2").val()>0 && $("#type").val()==2){ |
| | | $("#payType2").show(); |
| | | $("input[id='t2']").attr("checked", "checked") |
| | | } |
| | | if($("#q3").val()>0 && $("#type").val()==2){ |
| | | $("#payType3").show(); |
| | | $("input[id='t3']").attr("checked", "checked") |
| | | } |
| | | |
| | | } |
| | | |
| | | function editSubmit(){ |
| | | let audit = document.querySelector('input[name="auditType"]:checked').value; |
| | | let text = $("#text").val() |
| | | if(audit==3){ |
| | | if(text==''){ |
| | | Feng.info("请输入拒绝理由") |
| | | return false; |
| | | } |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetitionAudit/audit", function (data) { |
| | | if (data.code == 200) { |
| | | Feng.success("操作成功!"); |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | } else if(data=="repeat"){ |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | Feng.error("请勿重复操作"); |
| | | }else { |
| | | return Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("操作失败!") |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | return Feng.error("操作失败!"); |
| | | }, function (data) { |
| | | if(language==1){ |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | }else if(language==2){ |
| | | swal("Failed to delete", data.responseJSON.message + "!", "warning"); |
| | | }else { |
| | | swal("Hapus Gagal", data.responseJSON.message + "!", "warning"); |
| | | } |
| | | |
| | | }); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.set("audit",audit); |
| | | ajax.set("text",text); |
| | | ajax.start(); |
| | | } |
| | | |
| | | laydate.render({ |
| | | elem: '#startTime' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#endTime' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerEndTime' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStart' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#transDateStop' |
| | | ,type:"datetime" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#certifyDateB' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#nextFixDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#GPSInstallDate' |
| | | ,lang:"en" |
| | | }); |
| | | laydate.render({ |
| | | elem: '#registerDate' |
| | | ,lang:"en" |
| | | }); |
| | | |
| | | |
| | | function updateType(e,o) { |
| | | if(e==1){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType1").show(); |
| | | }else { |
| | | $("#payType1").hide(); |
| | | } |
| | | } |
| | | if(e==2){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType2").show(); |
| | | }else { |
| | | $("#payType2").hide(); |
| | | } |
| | | } |
| | | if(e==3){ |
| | | if($(o).is(":checked")){ |
| | | $("#payType3").show(); |
| | | }else { |
| | | $("#payType3").hide(); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | @} |
| | |
| | | <h5>优惠券管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | |
| | | <div class="hidden-xs" id="TCouponTableToolbar" role="group"> |
| | | <#button name="添加" icon="fa-plus" clickFun="TCoupon.openAdd()"/> |
| | | <#button name="编辑" icon="fa-edit" clickFun="TCoupon.openChange()" space="true"/> |
| | | <#button name="上架" icon="fa-remove" clickFun="TCoupon.onShelf()" space="true"/> |
| | | <#button name="下架" icon="fa-remove" clickFun="TCoupon.offShelf()" space="true"/> |
| | | <#button name="上架" icon="fa-remove" clickFun="TCoupon.onShelf(1)" space="true"/> |
| | | <#button name="下架" icon="fa-remove" clickFun="TCoupon.onShelf(2)" space="true"/> |
| | | <#button name="查看详情" icon="fa-remove" clickFun="TCoupon.openDetail()" space="true"/> |
| | | <#button name="领取记录" icon="fa-remove" clickFun="TCoupon.openCollectionRecord()" space="true"/> |
| | | </div> |
| | |
| | | } |
| | | |
| | | .avatar-uploader .el-upload:hover { |
| | | border-color: #409EFF; |
| | | border-color: #409eff; |
| | | } |
| | | .avatar-uploader-icon { |
| | | font-size: 28px; |
| | |
| | | <div class="form-group"> |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <label class="col-sm-3 control-label">*发放方式: </label> |
| | | <input class="col-sm-1 control-label" id="distributionMethod" type="radio" |
| | | <input class="col-sm-1 control-label" name="distributionMethod" type="radio" |
| | | value="1" checked style="margin-top: 10px"/> |
| | | <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">积分购买</label> |
| | | <input class="col-sm-1 control-label" id="distributionMethod" type="radio" |
| | | <input class="col-sm-1 control-label" name="distributionMethod" type="radio" |
| | | value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 16%;margin-top: 7px">注册赠送</label> |
| | | <input class="col-sm-1 control-label" id="distributionMethod" type="radio" |
| | | <input class="col-sm-1 control-label" name="distributionMethod" type="radio" |
| | | value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 16%;margin-top: 7px">自动发券</label> |
| | | </div> |
| | |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <label class="col-sm-3 control-label">*兑换方式: </label> |
| | | <input class="col-sm-1 control-label" onclick="exchangeMethod1()" name="exchangeMethod" type="radio" |
| | | value="1" checked style="margin-top: 10px"/> |
| | | value="1" style="margin-top: 10px"/> |
| | | <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">积分</label> |
| | | <input class="col-sm-1 control-label" name="exchangeMethod" onclick="exchangeMethod2()" type="radio" |
| | | value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> |
| | |
| | | <el-upload |
| | | class="avatar-uploader" |
| | | action="/tCouponManage/uploadPic" |
| | | :show-file-list="false" |
| | | :on-success="handleAvatarSuccess" |
| | | accept=".jpg,.jpeg,.png,.JPG,.JPEG" |
| | | :on-remove="handleRemove" |
| | | :before-upload="beforeAvatarUpload"> |
| | | <img v-if="imageUrl" :src="imageUrl" class="avatar"> |
| | | <i v-else class="el-icon-plus avatar-uploader-icon"></i> |
| | |
| | | class="avatar-uploader" |
| | | action="/tCouponManage/uploadPic" |
| | | list-type="picture-card" |
| | | accept="." |
| | | accept=".jpg,.jpeg,.png,.JPG,.JPEG" |
| | | :on-success="handleAvatarSuccess" |
| | | :on-remove="handleRemove"> |
| | | <i class="el-icon-plus"></i> |
| | |
| | | <td>操作</td> |
| | | </tr> |
| | | </thead> |
| | | <tbody id></tbody> |
| | | <tbody id="coun"></tbody> |
| | | </table> |
| | | </div> |
| | | </div> |
| | |
| | | <script src="${ctxPath}/js/elementui/index.js"></script> |
| | | <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> |
| | | <script src="${ctxPath}/modular/system/tCoupon/TCouponInfo.js"></script> |
| | | <script src="${ctxPath}/modular/system/tCoupon/TStoreInfo.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#periodOfValidity', |
| | |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | couponInfoDlg.goodsCover = URL.createObjectURL(file.raw); |
| | | this.imageUrl = URL.createObjectURL(file.raw); |
| | | couponInfoDlg.goodsCover = file.response; |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | couponInfoDlg.goodsCover = ''; |
| | | console.log(couponInfoDlg.goodsCover) |
| | | }, |
| | | }, |
| | | created() { |
| | |
| | | |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | props: { |
| | | // 数量限制 |
| | | limit: { |
| | | type: Number, |
| | | default: 2 |
| | | }, |
| | | }, |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
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 hidden id="t1" value="${item.type}"> |
| | | <input hidden id="t2" value="${item.distributionMethod}"> |
| | | <input hidden id="t3" value="${item.redemptionMethod}"> |
| | | <input hidden id="t4" value="${item.userPopulation}"> |
| | | <input hidden id="t5" value="${item.useScope}"> |
| | | <input hidden id="one" value="${one}"> |
| | | <input hidden id="two" value="${two}"> |
| | | <input hidden id="three" value="${three}"> |
| | | <input hidden id="city" value="${city}"> |
| | | <div class="form-horizontal"> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*优惠券名称: </label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="name" name="name" autocomplete="off" placeholder="请输入优惠券名称" value="${item.name}" readonly> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*优惠券类型: </label> |
| | | <input class="col-sm-1" style="margin-left: 2.7%;width: 13px;height: 13px;" |
| | | name="prescription" onclick="radio1()" checked disabled |
| | | value="1" type="radio"> |
| | | <label class="col-sm-1" style="margin-left: 10px;width: 17%">满减券: 满</label> |
| | | <input type="text" class="col-sm-1" id="conditionalAmount" readonly |
| | | onkeyup="value=value.replace(/\D/g,'')"/> |
| | | <label class="col-sm-1" style="margin-left: -1.5%;width: 14%"> 元 , 减 </label> |
| | | <input type="text" class="col-sm-1" id="deductionAmount" readonly |
| | | onkeyup="value=value.replace(/\D/g,'')"/> |
| | | <label class="col-sm-1" style="margin-left: -1.5%"> 元</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <input class="col-sm-1" name="prescription" type="radio" value="2" disabled |
| | | onclick="radio2()" |
| | | style="margin-left: 24.7%;"> |
| | | <label class="col-sm-1" style="margin-left: -17px;width: 20%;">代金券: 可抵</label> |
| | | <input class="col-sm-1" id="voucherAmount" readonly /> |
| | | <label class="col-sm-1">元</label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <input class="col-sm-1" name="prescription" type="radio" value="3" disabled |
| | | onclick="radio3()" |
| | | style="margin-left: 24.7%;"> |
| | | <label class="col-sm-1 control-label" style="margin-left: -1%;width: 14%;margin-top: -5px">体验券: </label> |
| | | <input class="col-sm-1" style="width: 35%" id="experienceName" name="name" |
| | | autocomplete="off" placeholder="请输入体验券名称" readonly> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*优惠券说明: </label> |
| | | <div class="col-sm-9"> |
| | | <textarea type="checkbox" id="illustrate" style="margin-left: 1%;width: 75%;height: 120px" |
| | | placeholder="请输入优惠券说明" disabled>${item.illustrate}</textarea> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <label class="col-sm-3 control-label">*发放方式: </label> |
| | | <input class="col-sm-1 control-label" name="distributionMethod" type="radio" disabled |
| | | value="1" checked style="margin-top: 10px"/> |
| | | <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">积分购买</label> |
| | | <input class="col-sm-1 control-label" name="distributionMethod" type="radio" disabled |
| | | value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 16%;margin-top: 7px">注册赠送</label> |
| | | <input class="col-sm-1 control-label" name="distributionMethod" type="radio" disabled |
| | | value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 16%;margin-top: 7px">自动发券</label> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row" id="exchangeType" > |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <label class="col-sm-3 control-label">*兑换方式: </label> |
| | | <input class="col-sm-1 control-label" onclick="exchangeMethod1()" name="exchangeMethod" type="radio" disabled |
| | | value="1" style="margin-top: 10px"/> |
| | | <label class="col-sm-1" style="margin-left: -15px;width: 16%;margin-top: 7px">积分</label> |
| | | <input class="col-sm-1 control-label" name="exchangeMethod" onclick="exchangeMethod2()" type="radio" disabled |
| | | value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 20%;margin-top: 7px">现金+积分</label> |
| | | <input class="col-sm-1 control-label" name="exchangeMethod" onclick="exchangeMethod3()" type="radio" disabled |
| | | value="3" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 9%;margin-top: 7px">现金</label> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row" id="needAmount" > |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所需现金</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="requiredCash" placeholder="请输入所需现金" name="requiredCash" autocomplete="off" type="text" value="${item.cash}" readonly |
| | | onkeyup="this.value=this.value.replace(/\D/g,'')"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row" id="needIntegral" > |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*所需积分</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="requiredPoints" placeholder="请输入所需积分" name="requiredPoints" autocomplete="off" type="text" value="${item.integral}" readonly |
| | | onkeyup="this.value=this.value.replace(/\D/g,'')"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <label class="col-sm-3 control-label">*用户人群: </label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" disabled |
| | | value="1" checked style="margin-top: 10px"/> |
| | | <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" disabled |
| | | value="2" style="margin-left: 5%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 16%;margin-top: 7px">年度会员</label> |
| | | <input class="col-sm-1 control-label" name="userGroup" type="radio" disabled |
| | | value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-1" style="width: 18%;margin-top: 5px">已有学员用户</label> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*发放数量</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="quantityIssued" placeholder="请输入发放数量" name="quantityIssued" autocomplete="off" type="text" value="${item.quantityIssued}" readonly |
| | | onkeyup="this.value=this.value.replace(/\D/g,'')"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*限领数量</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="pickUpQuantity" placeholder="请输入限领数量" name="pickUpQuantity" autocomplete="off" type="text" value="${item.pickUpQuantity}" readonly |
| | | onkeyup="this.value=this.value.replace(/\D/g,'')"> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <label class="col-sm-3 control-label">*有效期: </label> |
| | | <input type="text" style="width: 30%;margin-left: 1%" class="col-sm-3" id="periodOfValidity" value="${s} - ${e}" disabled |
| | | placeholder="请选择"/> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row" id="app" > |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*商品封面: </label> |
| | | <div class="col-sm-2" style="margin-top: 2%"> |
| | | <img src=${item.cover}> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <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%"> |
| | | @for(i in img){ |
| | | <img src=${i} style="width: 150px"> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row" id="belongsCon" > |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <div class="initialLevel col-sm-12 control-label form-group"> |
| | | <label class="col-sm-3">*适用范围: </label> |
| | | <div class="col-sm-3" id="belongsNationwide" > |
| | | <input class="col-sm-1" onclick="scopeOfApplication1()" name="company" type="radio" disabled |
| | | value="1" style="margin-top: 10px"/> |
| | | <label class="col-sm-2" style="width: 68%;margin-top: 7px">全国通用</label> |
| | | </div> |
| | | <div class="col-sm-3" id="belongsCity" > |
| | | <input class="col-sm-1" name="company" onclick="scopeOfApplication2()" type="radio" disabled |
| | | value="2" style="margin-top: 10px"/> |
| | | <label class="col-sm-2" style="width: 64%;margin-top: 7px">指定城市</label> |
| | | </div> |
| | | <div class="col-sm-3" id="belongsStore" > |
| | | <input class="col-sm-1" name="company" onclick="scopeOfApplication3()" type="radio" disabled |
| | | value="3" style="margin-left: 4%;margin-top: 10px;width: 13px;height: 13px"/> |
| | | <label class="col-sm-2" style="width: 64%;margin-top: 6px;">指定门店</label> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row" id="citySelect" hidden="hidden"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">*指定城市: </label> |
| | | <table class="table table-bordered" style="width: 70%;margin-left: 228px;" id=""> |
| | | <thead> |
| | | <tr> |
| | | <td>省</td> |
| | | <td>市</td> |
| | | </tr> |
| | | @for(c in city){ |
| | | <td>${c.province}</td> |
| | | <td>${c.city}</td> |
| | | @} |
| | | </thead> |
| | | </table> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row" id="storeSelect" hidden="hidden"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <div class="col-sm-12"> |
| | | <label class="col-sm-3 control-label">*指定门店: </label> |
| | | </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> |
| | | </tr> |
| | | @for(s in store){ |
| | | <td>${s.province}</td> |
| | | <td>${s.phone}</td> |
| | | <td>${s.name}</td> |
| | | @} |
| | | </thead> |
| | | </table> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="row"> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10" style="margin-left: 20%;"> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" |
| | | clickFun="couponInfoDlg.close()"/> |
| | | </div> |
| | | </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/tCoupon/TCouponInfo.js"></script> |
| | | <script src="${ctxPath}/modular/system/tCoupon/TStoreInfo.js"></script> |
| | | <script type="text/javascript"> |
| | | window.onload = function() { |
| | | console.log(12312) |
| | | } |
| | | laydate.render({ |
| | | elem: '#periodOfValidity', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | var vue1 = new Vue({ |
| | | el: '#app', |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | this.imageUrl = URL.createObjectURL(file.raw); |
| | | couponInfoDlg.goodsCover = file.response; |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | couponInfoDlg.goodsCover = ''; |
| | | console.log(couponInfoDlg.goodsCover) |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | }); |
| | | |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | couponInfoDlg.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() { |
| | | }, |
| | | }); |
| | | |
| | | |
| | | |
| | | </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"> |
| | | <input hidden id="id" value="${id}"> |
| | | <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="type" name="状态" > |
| | | <option value="">全部</option> |
| | | <option value="2">已使用</option> |
| | | <option value="1">未使用</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCoupon.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCoupon.resetSearch()"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCouponTableToolbar" role="group"> |
| | | @if(type==3){ |
| | | <#button name="核销" icon="fa-plus" clickFun="TCoupon.updateType()"/> |
| | | @} |
| | | </div> |
| | | <#table id="TCouponTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tCoupon/TCouponRecord.js"></script> |
| | | @} |
| | |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="province" name="所在省" > |
| | | <option value="">全部</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#SelectCon id="city" name="所在市" > |
| | | <option value="">全部</option> |
| | | </#SelectCon> |
| | | </div> |
| | | <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> |
| | |
| | | </div> |
| | | <#table id="TStoreProvinceTable"/> |
| | | <div style="margin-left: 30%"> |
| | | <button type="button" class="btn btn-info button-margin" onclick="storeOfClosePage()" |
| | | <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="saveSelectStores()" |
| | | <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> |
| | | <script src="${ctxPath}/modular/system/tCoupon/TStoreInfo.js"></script> |
| | | <script src="${ctxPath}/modular/system/tCoupon/TCouponInfo.js"></script> |
| | | @} |
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> |
| | | </#SelectCon> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="phone" name="管理员手机号" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCompetition.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="添加" icon="fa-plus" clickFun="TCompetition.openAddTCompetition()"/> |
| | | <#button name="编辑" icon="fa-edit" clickFun="TCompetition.openTCompetitionDetail()" space="true"/> |
| | | <#button name="冻结" icon="fa-remove" clickFun="TCompetition.freeze()" space="true"/> |
| | | <#button name="解冻" icon="fa-remove" clickFun="TCompetition.unfreeze()" space="true"/> |
| | | <#button name="重置密码" icon="fa-remove" clickFun="TCompetition.reload()" space="true"/> |
| | | |
| | | </div> |
| | | <#table id="TCompetitionTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tGoods/tGoods.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#createTime' |
| | | ,range: true |
| | | ,lang:"en" |
| | | }); |
| | | </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"/> |
| | | <#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" checked> 积分 |
| | | <input type="radio" name="redemptionMethod" value="2" > 现金+积分 |
| | | <input type="radio" name="redemptionMethod" value="3" > 现金 |
| | | </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" 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="margin-top: 2%"> |
| | | <el-upload |
| | | class="avatar-uploader" |
| | | action="/tCouponManage/uploadPic" |
| | | :on-success="handleAvatarSuccess" |
| | | accept=".jpg,.jpeg,.png,.JPG,.JPEG" |
| | | :on-remove="handleRemove" |
| | | :before-upload="beforeAvatarUpload"> |
| | | <img v-if="imageUrl" :src="imageUrl" class="avatar"> |
| | | <i v-else class="el-icon-plus avatar-uploader-icon"></i> |
| | | </el-upload> |
| | | </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="0" 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="1" 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="1" 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="TCarInfoDlg.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="TCarInfoDlg.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"> |
| | | <option value="">选择市</option> |
| | | </select> |
| | | </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="TCarInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.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 src="${ctxPath}/modular/system/tGoods/TStoreInfo.js"></script> |
| | | <script> |
| | | |
| | | function updateType(e) { |
| | | if(e==2){ |
| | | $("#b1").hide() |
| | | $("#b2").show() |
| | | }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) { |
| | | TCarInfoDlg.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() { |
| | | }, |
| | | }); |
| | | </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> |
| | | @} |
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"> |
| | | <#NameCon id="phone" 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="category" name="变动类型"> |
| | | <option value="">全部</option> |
| | | <option value="1">增加</option> |
| | | <option value="2">扣除</option> |
| | | </#SelectCon> |
| | | |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="time" name="变动时间" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TSite.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TSite.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="赠送积分" icon="fa-plus" clickFun="TSite.openAdd()"/> |
| | | |
| | | </div> |
| | | <#table id="TSiteTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tIntegral/tIntegral.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time' |
| | | ,range: true |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-content"> |
| | | <div class="form-horizontal" id="carInfoForm"> |
| | | <div class="row" id="app1"> |
| | | <#input id="phone" name="用户手机号" type="text" /> |
| | | <#input id="number" name="赠送数量" type="text" /> |
| | | |
| | | |
| | | |
| | | </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="TCarInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tIntegral/tIntegral.js"></script> |
| | | @} |
New file |
| | |
| | | @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 class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="id" value="${item.id}"> |
| | | <input hidden id="role" value="${role}"> |
| | | @if(role=='1'){ |
| | | <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> |
| | | @} |
| | | </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="TCarInfoDlg.oneChangeNext(this)"> |
| | | <option value="">选择市</option> |
| | | @for(obj in list1){ |
| | | <option value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${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="account" name="account"> |
| | | <option value="">选择账号</option> |
| | | @for(obj in list2){ |
| | | <option value="${obj.id}" ${obj.id == item.cityManagerId ? 'selected=selected' : ''}>${obj.name}-${obj.phone}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | <#input id="name" name="门店名称" type="text" value="${item.name}"/> |
| | | <#input id="phone" name="联系电话" type="text" value="${item.phone}"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店地址:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="address" name="address" type="text" value="${item.address}" onchange="TCarInfoDlg.searchByStationName(this,1)"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10" style="margin-left: 397px;width: 70%;" > |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <#input id="time" name="营业时间" type="text" value="${time}"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店介绍:</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="introduce" style="width: 617px; height: 180px;">${item.introduce}</textarea> |
| | | </div> |
| | | </div> |
| | | <#input id="userName" name="管理员姓名" type="text" value="${city.name}"/> |
| | | <#input id="userPhone" name="管理员手机号" type="text" value="${city.account}"/> |
| | | <#avatar id="img" name="门店封面(推荐像素722*360px)" avatarImg="${item.coverDrawing}"/> |
| | | <#input id="imgOne" name="实景照片" type="text" value="${item.realPicture}"/> |
| | | |
| | | |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | @if(type==1){ |
| | | <#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/tShop/tShop_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | }); |
| | | </script> |
| | | <script type="application/javascript"> |
| | | |
| | | </script> |
| | | @} |
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="${id}"> |
| | | @if(welfarePicture==null){ |
| | | <#avatar id="welfarePicture" name="福利图片"/> |
| | | @} |
| | | @if(welfarePicture!=null){ |
| | | <#avatar id="welfarePicture" name="福利图片" avatarImg="${welfarePicture}"/> |
| | | @} |
| | | @if(welfarePicture==12321){ |
| | | <div class="form-group"> |
| | | <div class="col-sm-4"> |
| | | <div id="welfarePicturePreId"> |
| | | <div><img width="700px" height="800px" id="img" src="${welfarePicture}" ></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <input type="hidden" id="welfarePicture"> |
| | | </div> |
| | | <div class="col-sm-2" style="margin-left: 280px"> |
| | | <div class="head-scu-btn upload-btn webuploader-container" id="welfarePictureBtnId"><div class="webuploader-pick"> |
| | | <i class="fa fa-upload"></i> Upload |
| | | </div><div id="rt_rt_1h6lka0hk9mucj87vf1t21qk31" style="position: absolute; inset: 0px auto auto 0px; width: 82px; height: 28px; overflow: hidden;"><input type="file" name="file" class="webuploader-element-invisible" accept="image/gif,image/jpg,image/jpeg,image/bmp,image/png"><label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255);"></label></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="TCarInfoDlg.saveImg()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_info.js"></script> |
| | | <script> |
| | | </script> |
| | | <script type="application/javascript"> |
| | | </script> |
| | | @} |
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="${id}"> |
| | | <input hidden id="s1" value="${c1.isOpen}"> |
| | | <input hidden id="s2" value="${c2.isOpen}"> |
| | | <input hidden id="s3" value="${c3.isOpen}"> |
| | | <input hidden id="s4" value="${c4.isOpen}"> |
| | | <input hidden id="s5" value="${c5.isOpen}"> |
| | | <input hidden id="s6" value="${c6.isOpen}"> |
| | | <input hidden id="s7" value="${c7.isOpen}"> |
| | | <input hidden id="s8" value="${c8.isOpen}"> |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 报名玩湃课程:<input type="radio" name="r1" value="1">开启 <input type="radio" name="r1" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px1" value="${c1.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c1==null){ |
| | | <#avatar id="c1" name="背景图" /> |
| | | @} |
| | | @if(c1!=null){ |
| | | <#avatar id="c1" name="背景图" avatarImg="${c1.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 预约场地:<input type="radio" name="r2" value="1">开启 <input type="radio" name="r2" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px2" value="${c2.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c2==null){ |
| | | <#avatar id="c2" name="背景图" /> |
| | | @} |
| | | @if(c2!=null){ |
| | | <#avatar id="c2" name="背景图" avatarImg="${c2.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 报名赛事及活动:<input type="radio" name="r3" value="1">开启 <input type="radio" name="r3" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px3" value="${c3.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c3==null){ |
| | | <#avatar id="c3" name="背景图" /> |
| | | @} |
| | | @if(c3!=null){ |
| | | <#avatar id="c3" name="背景图" avatarImg="${c3.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 免费福利:<input type="radio" name="r4" value="1">开启 <input type="radio" name="r4" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px4" value="${c4.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c4==null){ |
| | | <#avatar id="c4" name="背景图" /> |
| | | @} |
| | | @if(c4!=null){ |
| | | <#avatar id="c4" name="背景图" avatarImg="${c4.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 线上课得积分:<input type="radio" name="r5" value="1">开启 <input type="radio" name="r5" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px5" value="${c5.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c5==null){ |
| | | <#avatar id="c5" name="背景图" /> |
| | | @} |
| | | @if(c5!=null){ |
| | | <#avatar id="c5" name="背景图" avatarImg="${c5.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 购买优惠门票:<input type="radio" name="r6" value="1">开启 <input type="radio" name="r6" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px6" value="${c6.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c6==null){ |
| | | <#avatar id="c6" name="背景图" /> |
| | | @} |
| | | @if(c6!=null){ |
| | | <#avatar id="c6" name="背景图" avatarImg="${c6.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 看视频得奖励:<input type="radio" name="r7" value="1">开启 <input type="radio" name="r7" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px7" value="${c7.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c7==null){ |
| | | <#avatar id="c7" name="背景图" /> |
| | | @} |
| | | @if(c7!=null){ |
| | | <#avatar id="c7" name="背景图" avatarImg="${c7.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 智慧球场:<input type="radio" name="r8" value="1">开启 <input type="radio" name="r8" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px8" value="${c8.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c8==null){ |
| | | <#avatar id="c8" name="背景图" /> |
| | | @} |
| | | @if(c8!=null){ |
| | | <#avatar id="c8" name="背景图" avatarImg="${c8.backgroundImage}"/> |
| | | @} |
| | | </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="TCarInfoDlg.saveAllImg()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_info.js"></script> |
| | | |
| | | <script> |
| | | </script> |
| | | <script type="application/javascript"> |
| | | window.onload = function(){ |
| | | var OBJradio=document.getElementsByName("r1") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s1").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r2") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s2").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r3") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s3").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r4") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s4").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r5") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s5").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r6") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s6").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r7") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s7").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r8") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s8").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | </script> |
| | | @} |
| | |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | |
| | | <input hidden id="role" value="${role}"> |
| | | <div class="ibox-title"> |
| | | <h5>门店管理</h5> |
| | | </div> |
| | |
| | | height: 33px; |
| | | } |
| | | </style> |
| | | <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 class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="role" value="${role}"> |
| | | @if(role=='1'){ |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | <#input id="name" name="门店名称" type="text"/> |
| | | <#input id="phone" name="联系电话" type="text"/> |
| | | <#input id="address" name="门店地址" type="text"/> |
| | | <#input id="time" name="营业时间" type="text"/> |
| | | <#input id="intro" name="门店介绍" type="text"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店地址:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="address" name="address" type="text" onchange="TCarInfoDlg.searchByStationName(this,1)"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10" style="margin-left: 397px;width: 70%;" > |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <div hidden id="longitude"></div> |
| | | <div hidden id="latitude"></div> |
| | | |
| | | <#input id="time" name="营业时间" type="text"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店介绍:</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="introduce" style="width: 617px; height: 180px;"></textarea> |
| | | </div> |
| | | </div> |
| | | <#input id="userName" name="店长姓名" type="text"/> |
| | | <#input id="userPhone" name="店长手机号" type="text"/> |
| | | <#avatar id="img" name="门店封面(推荐像素722*360px)" /> |
| | |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | couponInfoDlg.goodsPicArray.push(file); |
| | | TCarInfoDlg.goodsPicArray.push(file); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | couponInfoDlg.goodsPicArray = couponInfoDlg.goodsPicArray.filter(item => { |
| | | TCarInfoDlg.goodsPicArray = TCarInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | |
| | | @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 class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="id" value="${item.id}"> |
| | | <input hidden id="role" value="${role}"> |
| | | @if(role=='1'){ |
| | | <div class="form-group" id="provinceCode"> |
| | | <label class="col-sm-3 control-label">所在省:</label> |
| | | <div class="col-sm-9"> |
| | |
| | | <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> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | <#input id="name" name="门店名称" type="text" value="${item.name}"/> |
| | | <#input id="phone" name="联系电话" type="text" value="${item.phone}"/> |
| | | <#input id="address" name="门店地址" type="text" value="${item.address}"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店地址:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="address" name="address" type="text" value="${item.address}" onchange="TCarInfoDlg.searchByStationName(this,1)"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10" style="margin-left: 397px;width: 70%;" > |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <#input id="time" name="营业时间" type="text" value="${time}"/> |
| | | <#input id="intro" name="门店介绍" type="text" value="${item.introduce}"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店介绍:</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="introduce" style="width: 617px; height: 180px;">${item.introduce}</textarea> |
| | | </div> |
| | | </div> |
| | | <#input id="userName" name="管理员姓名" type="text" value="${city.name}"/> |
| | | <#input id="userPhone" name="管理员手机号" type="text" value="${city.account}"/> |
| | | <#avatar id="img" name="门店封面(推荐像素722*360px)" avatarImg="${item.coverDrawing}"/> |
| | |
| | | }); |
| | | </script> |
| | | <script type="application/javascript"> |
| | | |
| | | </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"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在省 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="pCode" onchange="TCompetition.oneChange(this)"> |
| | | <option value="">全部</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在市 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="cCode"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="shopName" name="门店名称" /> |
| | | </div> |
| | | |
| | | <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"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCompetition.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="上架" icon="fa-plus" clickFun="TCompetition.updateState(1)"/> |
| | | <#button name="下架" icon="fa-edit" clickFun="TCompetition.updateState(2)" space="true"/> |
| | | <#button name="查看详情" icon="fa-remove" clickFun="TCompetition.info()" space="true"/> |
| | | </div> |
| | | <#table id="TCompetitionTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShopEvaluation/tShop.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#createTime' |
| | | ,range: true |
| | | ,lang:"en" |
| | | }); |
| | | </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: 32px; |
| | | text-align: center; |
| | | } |
| | | .avatar { |
| | | width: 100px; |
| | | height: 100px; |
| | | display: block; |
| | | } |
| | | |
| | | .col-sm-12 { |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .col-sm-12 select { |
| | | height: 33px; |
| | | } |
| | | </style> |
| | | <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 class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="role" value="${role}"> |
| | | @if(role=='1'){ |
| | | <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.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="TCarInfoDlg.oneChangeNext(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="account" name="account"> |
| | | <option value="">选择账号</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | <#input id="name" name="门店名称" type="text"/> |
| | | <#input id="phone" name="联系电话" type="text"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店地址:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="address" name="address" type="text" onchange="TCarInfoDlg.searchByStationName(this,1)"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10" style="margin-left: 397px;width: 70%;" > |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <div hidden id="longitude"></div> |
| | | <div hidden id="latitude"></div> |
| | | |
| | | <#input id="time" name="营业时间" type="text"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店介绍:</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="introduce" style="width: 617px; height: 180px;"></textarea> |
| | | </div> |
| | | </div> |
| | | <#input id="userName" name="店长姓名" type="text"/> |
| | | <#input id="userPhone" name="店长手机号" type="text"/> |
| | | <#avatar id="img" name="门店封面(推荐像素722*360px)" /> |
| | | <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: 5%">*实景图片(请上传不超过五张图片): </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=""> |
| | | </div> |
| | | </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="TCarInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_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> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | }); |
| | | |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | props: { |
| | | // 数量限制 |
| | | limit: { |
| | | type: Number, |
| | | default: 2 |
| | | }, |
| | | }, |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | TCarInfoDlg.goodsPicArray.push(file); |
| | | }, |
| | | beforeAvatarUpload(file) { |
| | | const isLt2M = file.size / 1024 / 1024 < 10; |
| | | if (!isLt2M) { |
| | | this.$message.error('上传图片大小不能超过 10MB!'); |
| | | } |
| | | return isLt2M; |
| | | }, |
| | | handleRemove(file, fileList) { |
| | | TCarInfoDlg.goodsPicArray = TCarInfoDlg.goodsPicArray.filter(item => { |
| | | return item.uid != file.uid; |
| | | }); |
| | | }, |
| | | }, |
| | | created() { |
| | | }, |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @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 class="form-horizontal" id="carInfoForm"> |
| | | <#label id="name" name="所在省" type="text" value="${name1}"/> |
| | | <#label id="name" name="所在市" type="text" value="${name2}"/> |
| | | <#label id="name" name="所属门店" type="text" value="${item.shopName}"/> |
| | | <#label id="name" name="评价用户" type="text" value="${item.name}"/> |
| | | <#label id="name" name="评价时间" type="text" value="${item.time}"/> |
| | | <#label id="name" name="总体评分" type="text" value="${item.score}"/> |
| | | <#label id="name" name="评价内容" type="text" value="${item.content}"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">评价图片:</label> |
| | | <div class="col-sm-9"> |
| | | @for(o in imgs){ |
| | | <img src=${o} style="width: 163px;height: 96px;"> |
| | | @} |
| | | </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="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | }); |
| | | </script> |
| | | <script type="application/javascript"> |
| | | |
| | | </script> |
| | | @} |
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="${id}"> |
| | | @if(welfarePicture==null){ |
| | | <#avatar id="welfarePicture" name="福利图片"/> |
| | | @} |
| | | @if(welfarePicture!=null){ |
| | | <#avatar id="welfarePicture" name="福利图片" avatarImg="${welfarePicture}"/> |
| | | @} |
| | | @if(welfarePicture==12321){ |
| | | <div class="form-group"> |
| | | <div class="col-sm-4"> |
| | | <div id="welfarePicturePreId"> |
| | | <div><img width="700px" height="800px" id="img" src="${welfarePicture}" ></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <input type="hidden" id="welfarePicture"> |
| | | </div> |
| | | <div class="col-sm-2" style="margin-left: 280px"> |
| | | <div class="head-scu-btn upload-btn webuploader-container" id="welfarePictureBtnId"><div class="webuploader-pick"> |
| | | <i class="fa fa-upload"></i> Upload |
| | | </div><div id="rt_rt_1h6lka0hk9mucj87vf1t21qk31" style="position: absolute; inset: 0px auto auto 0px; width: 82px; height: 28px; overflow: hidden;"><input type="file" name="file" class="webuploader-element-invisible" accept="image/gif,image/jpg,image/jpeg,image/bmp,image/png"><label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255);"></label></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="TCarInfoDlg.saveImg()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_info.js"></script> |
| | | <script> |
| | | </script> |
| | | <script type="application/javascript"> |
| | | </script> |
| | | @} |
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="${id}"> |
| | | <input hidden id="s1" value="${c1.isOpen}"> |
| | | <input hidden id="s2" value="${c2.isOpen}"> |
| | | <input hidden id="s3" value="${c3.isOpen}"> |
| | | <input hidden id="s4" value="${c4.isOpen}"> |
| | | <input hidden id="s5" value="${c5.isOpen}"> |
| | | <input hidden id="s6" value="${c6.isOpen}"> |
| | | <input hidden id="s7" value="${c7.isOpen}"> |
| | | <input hidden id="s8" value="${c8.isOpen}"> |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 报名玩湃课程:<input type="radio" name="r1" value="1">开启 <input type="radio" name="r1" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px1" value="${c1.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c1==null){ |
| | | <#avatar id="c1" name="背景图" /> |
| | | @} |
| | | @if(c1!=null){ |
| | | <#avatar id="c1" name="背景图" avatarImg="${c1.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 预约场地:<input type="radio" name="r2" value="1">开启 <input type="radio" name="r2" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px2" value="${c2.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c2==null){ |
| | | <#avatar id="c2" name="背景图" /> |
| | | @} |
| | | @if(c2!=null){ |
| | | <#avatar id="c2" name="背景图" avatarImg="${c2.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 报名赛事及活动:<input type="radio" name="r3" value="1">开启 <input type="radio" name="r3" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px3" value="${c3.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c3==null){ |
| | | <#avatar id="c3" name="背景图" /> |
| | | @} |
| | | @if(c3!=null){ |
| | | <#avatar id="c3" name="背景图" avatarImg="${c3.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 免费福利:<input type="radio" name="r4" value="1">开启 <input type="radio" name="r4" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px4" value="${c4.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c4==null){ |
| | | <#avatar id="c4" name="背景图" /> |
| | | @} |
| | | @if(c4!=null){ |
| | | <#avatar id="c4" name="背景图" avatarImg="${c4.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 线上课得积分:<input type="radio" name="r5" value="1">开启 <input type="radio" name="r5" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px5" value="${c5.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c5==null){ |
| | | <#avatar id="c5" name="背景图" /> |
| | | @} |
| | | @if(c5!=null){ |
| | | <#avatar id="c5" name="背景图" avatarImg="${c5.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 购买优惠门票:<input type="radio" name="r6" value="1">开启 <input type="radio" name="r6" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px6" value="${c6.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c6==null){ |
| | | <#avatar id="c6" name="背景图" /> |
| | | @} |
| | | @if(c6!=null){ |
| | | <#avatar id="c6" name="背景图" avatarImg="${c6.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 看视频得奖励:<input type="radio" name="r7" value="1">开启 <input type="radio" name="r7" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px7" value="${c7.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c7==null){ |
| | | <#avatar id="c7" name="背景图" /> |
| | | @} |
| | | @if(c7!=null){ |
| | | <#avatar id="c7" name="背景图" avatarImg="${c7.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 智慧球场:<input type="radio" name="r8" value="1">开启 <input type="radio" name="r8" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px8" value="${c8.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c8==null){ |
| | | <#avatar id="c8" name="背景图" /> |
| | | @} |
| | | @if(c8!=null){ |
| | | <#avatar id="c8" name="背景图" avatarImg="${c8.backgroundImage}"/> |
| | | @} |
| | | </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="TCarInfoDlg.saveAllImg()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_info.js"></script> |
| | | |
| | | <script> |
| | | </script> |
| | | <script type="application/javascript"> |
| | | window.onload = function(){ |
| | | var OBJradio=document.getElementsByName("r1") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s1").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r2") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s2").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r3") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s3").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r4") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s4").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r5") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s5").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r6") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s6").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r7") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s7").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r8") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s8").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; |
| | | } |
| | | |
| | | .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; |
| | | } |
| | | </style> |
| | | <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 class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="role" value="${role}"> |
| | | @if(role=='1'){ |
| | | <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.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="TCarInfoDlg.oneChangeNext(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="account" name="account"> |
| | | <option value="">选择账号</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | <#input id="name" name="门店名称" type="text"/> |
| | | <#input id="phone" name="联系电话" type="text"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店地址:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="address" name="address" type="text" onchange="TCarInfoDlg.searchByStationName(this,1)"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10" style="margin-left: 397px;width: 70%;" > |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <#input id="time" name="营业时间" type="text"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店介绍:</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="introduce" style="width: 617px; height: 180px;"></textarea> |
| | | </div> |
| | | </div> |
| | | <#input id="userName" name="店长姓名" type="text"/> |
| | | <#input id="userPhone" name="店长手机号" type="text"/> |
| | | <#avatar id="img" name="门店封面(推荐像素722*360px)" /> |
| | | <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: 5%">*实景图片(请上传不超过五张图片): </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=""> |
| | | </div> |
| | | </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="TCarInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_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> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | }); |
| | | |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | props: { |
| | | // 数量限制 |
| | | limit: { |
| | | type: Number, |
| | | default: 2 |
| | | }, |
| | | }, |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | couponInfoDlg.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() { |
| | | }, |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @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 class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="id" value="${item.id}"> |
| | | <input hidden id="role" value="${role}"> |
| | | @if(role=='1'){ |
| | | <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> |
| | | @} |
| | | </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="TCarInfoDlg.oneChangeNext(this)"> |
| | | <option value="">选择市</option> |
| | | @for(obj in list1){ |
| | | <option value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${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="account" name="account"> |
| | | <option value="">选择账号</option> |
| | | @for(obj in list2){ |
| | | <option value="${obj.id}" ${obj.id == item.cityManagerId ? 'selected=selected' : ''}>${obj.name}-${obj.phone}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | <#input id="name" name="门店名称" type="text" value="${item.name}"/> |
| | | <#input id="phone" name="联系电话" type="text" value="${item.phone}"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店地址:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="address" name="address" type="text" value="${item.address}" onchange="TCarInfoDlg.searchByStationName(this,1)"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10" style="margin-left: 397px;width: 70%;" > |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <#input id="time" name="营业时间" type="text" value="${time}"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店介绍:</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="introduce" style="width: 617px; height: 180px;">${item.introduce}</textarea> |
| | | </div> |
| | | </div> |
| | | <#input id="userName" name="管理员姓名" type="text" value="${city.name}"/> |
| | | <#input id="userPhone" name="管理员手机号" type="text" value="${city.account}"/> |
| | | <#avatar id="img" name="门店封面(推荐像素722*360px)" avatarImg="${item.coverDrawing}"/> |
| | | <#input id="imgOne" name="实景照片" type="text" value="${item.realPicture}"/> |
| | | |
| | | |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | @if(type==1){ |
| | | <#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/tShop/tShop_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | }); |
| | | </script> |
| | | <script type="application/javascript"> |
| | | |
| | | </script> |
| | | @} |
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="${id}"> |
| | | @if(welfarePicture==null){ |
| | | <#avatar id="welfarePicture" name="福利图片"/> |
| | | @} |
| | | @if(welfarePicture!=null){ |
| | | <#avatar id="welfarePicture" name="福利图片" avatarImg="${welfarePicture}"/> |
| | | @} |
| | | @if(welfarePicture==12321){ |
| | | <div class="form-group"> |
| | | <div class="col-sm-4"> |
| | | <div id="welfarePicturePreId"> |
| | | <div><img width="700px" height="800px" id="img" src="${welfarePicture}" ></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <input type="hidden" id="welfarePicture"> |
| | | </div> |
| | | <div class="col-sm-2" style="margin-left: 280px"> |
| | | <div class="head-scu-btn upload-btn webuploader-container" id="welfarePictureBtnId"><div class="webuploader-pick"> |
| | | <i class="fa fa-upload"></i> Upload |
| | | </div><div id="rt_rt_1h6lka0hk9mucj87vf1t21qk31" style="position: absolute; inset: 0px auto auto 0px; width: 82px; height: 28px; overflow: hidden;"><input type="file" name="file" class="webuploader-element-invisible" accept="image/gif,image/jpg,image/jpeg,image/bmp,image/png"><label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255);"></label></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="TCarInfoDlg.saveImg()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_info.js"></script> |
| | | <script> |
| | | </script> |
| | | <script type="application/javascript"> |
| | | </script> |
| | | @} |
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="${id}"> |
| | | <input hidden id="s1" value="${c1.isOpen}"> |
| | | <input hidden id="s2" value="${c2.isOpen}"> |
| | | <input hidden id="s3" value="${c3.isOpen}"> |
| | | <input hidden id="s4" value="${c4.isOpen}"> |
| | | <input hidden id="s5" value="${c5.isOpen}"> |
| | | <input hidden id="s6" value="${c6.isOpen}"> |
| | | <input hidden id="s7" value="${c7.isOpen}"> |
| | | <input hidden id="s8" value="${c8.isOpen}"> |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 报名玩湃课程:<input type="radio" name="r1" value="1">开启 <input type="radio" name="r1" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px1" value="${c1.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c1==null){ |
| | | <#avatar id="c1" name="背景图" /> |
| | | @} |
| | | @if(c1!=null){ |
| | | <#avatar id="c1" name="背景图" avatarImg="${c1.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 预约场地:<input type="radio" name="r2" value="1">开启 <input type="radio" name="r2" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px2" value="${c2.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c2==null){ |
| | | <#avatar id="c2" name="背景图" /> |
| | | @} |
| | | @if(c2!=null){ |
| | | <#avatar id="c2" name="背景图" avatarImg="${c2.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 报名赛事及活动:<input type="radio" name="r3" value="1">开启 <input type="radio" name="r3" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px3" value="${c3.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c3==null){ |
| | | <#avatar id="c3" name="背景图" /> |
| | | @} |
| | | @if(c3!=null){ |
| | | <#avatar id="c3" name="背景图" avatarImg="${c3.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 免费福利:<input type="radio" name="r4" value="1">开启 <input type="radio" name="r4" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px4" value="${c4.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c4==null){ |
| | | <#avatar id="c4" name="背景图" /> |
| | | @} |
| | | @if(c4!=null){ |
| | | <#avatar id="c4" name="背景图" avatarImg="${c4.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 线上课得积分:<input type="radio" name="r5" value="1">开启 <input type="radio" name="r5" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px5" value="${c5.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c5==null){ |
| | | <#avatar id="c5" name="背景图" /> |
| | | @} |
| | | @if(c5!=null){ |
| | | <#avatar id="c5" name="背景图" avatarImg="${c5.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 购买优惠门票:<input type="radio" name="r6" value="1">开启 <input type="radio" name="r6" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px6" value="${c6.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c6==null){ |
| | | <#avatar id="c6" name="背景图" /> |
| | | @} |
| | | @if(c6!=null){ |
| | | <#avatar id="c6" name="背景图" avatarImg="${c6.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 看视频得奖励:<input type="radio" name="r7" value="1">开启 <input type="radio" name="r7" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px7" value="${c7.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c7==null){ |
| | | <#avatar id="c7" name="背景图" /> |
| | | @} |
| | | @if(c7!=null){ |
| | | <#avatar id="c7" name="背景图" avatarImg="${c7.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 智慧球场:<input type="radio" name="r8" value="1">开启 <input type="radio" name="r8" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px8" value="${c8.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c8==null){ |
| | | <#avatar id="c8" name="背景图" /> |
| | | @} |
| | | @if(c8!=null){ |
| | | <#avatar id="c8" name="背景图" avatarImg="${c8.backgroundImage}"/> |
| | | @} |
| | | </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="TCarInfoDlg.saveAllImg()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_info.js"></script> |
| | | |
| | | <script> |
| | | </script> |
| | | <script type="application/javascript"> |
| | | window.onload = function(){ |
| | | var OBJradio=document.getElementsByName("r1") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s1").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r2") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s2").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r3") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s3").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r4") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s4").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r5") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s5").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r6") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s6").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r7") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s7").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r8") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s8").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <input hidden id="role" value="${role}"> |
| | | <div class="ibox-title"> |
| | | <h5>场地管理</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | @if(role=='1'){ |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在省 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="pCode" onchange="TSite.oneChange(this)"> |
| | | <option value="">全部</option> |
| | | @for(obj in list){ |
| | | <option value="${obj.code}">${obj.name}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | @if(role=='1'){ |
| | | <div class="col-sm-3"> |
| | | <div class="input-group"> |
| | | <div class="input-group-btn open"> |
| | | <button data-toggle="dropdown" class="btn btn-white dropdown-toggle" type="button" aria-expanded="true"> |
| | | 所在市 |
| | | </button> |
| | | </div> |
| | | <select class="form-control" id="cCode"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | <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"> |
| | | <#NameCon id="shopName" name="门店名称" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TCompetition.resetSearch()" space="true"/> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="添加" icon="fa-plus" clickFun="TCompetition.openAddTCompetition()"/> |
| | | <#button name="编辑" icon="fa-edit" clickFun="TCompetition.openTCompetitionDetail()" space="true"/> |
| | | <#button name="冻结" icon="fa-remove" clickFun="TCompetition.freeze()" space="true"/> |
| | | <#button name="解冻" icon="fa-remove" clickFun="TCompetition.unfreeze()" space="true"/> |
| | | <#button name="查看详情" icon="fa-remove" clickFun="TCompetition.info()" space="true"/> |
| | | <#button name="重置密码" icon="fa-remove" clickFun="TCompetition.reload()" space="true"/> |
| | | <#button name="免费福利" icon="fa-remove" clickFun="TCompetition.gift()" space="true"/> |
| | | <#button name="首页设置" icon="fa-remove" clickFun="TCompetition.indexSet()" space="true"/> |
| | | |
| | | </div> |
| | | <#table id="TCompetitionTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tSite/tSite.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#createTime' |
| | | ,range: true |
| | | ,lang:"en" |
| | | }); |
| | | </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: 32px; |
| | | text-align: center; |
| | | } |
| | | .avatar { |
| | | width: 100px; |
| | | height: 100px; |
| | | display: block; |
| | | } |
| | | |
| | | .col-sm-12 { |
| | | margin-top: 20px; |
| | | } |
| | | |
| | | .col-sm-12 select { |
| | | height: 33px; |
| | | } |
| | | </style> |
| | | <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 class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="role" value="${role}"> |
| | | @if(role=='1'){ |
| | | <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.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="TCarInfoDlg.oneChangeNext(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="account" name="account"> |
| | | <option value="">选择账号</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | <#input id="name" name="门店名称" type="text"/> |
| | | <#input id="phone" name="联系电话" type="text"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店地址:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="address" name="address" type="text" onchange="TCarInfoDlg.searchByStationName(this,1)"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10" style="margin-left: 397px;width: 70%;" > |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <#input id="time" name="营业时间" type="text"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店介绍:</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="introduce" style="width: 617px; height: 180px;"></textarea> |
| | | </div> |
| | | </div> |
| | | <#input id="userName" name="店长姓名" type="text"/> |
| | | <#input id="userPhone" name="店长手机号" type="text"/> |
| | | <#avatar id="img" name="门店封面(推荐像素722*360px)" /> |
| | | <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: 5%">*实景图片(请上传不超过五张图片): </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=""> |
| | | </div> |
| | | </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="TCarInfoDlg.addSubmit()"/> |
| | | <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_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> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | }); |
| | | |
| | | var vue2 = new Vue({ |
| | | el: '#app1', |
| | | props: { |
| | | // 数量限制 |
| | | limit: { |
| | | type: Number, |
| | | default: 2 |
| | | }, |
| | | }, |
| | | data: { |
| | | autoUpload: true,//自动上传 |
| | | imageUrl1: '',//模型数据,用于上传图片完成后图片预览 |
| | | dialogVisible: false |
| | | }, |
| | | methods: { |
| | | handleAvatarSuccess(res, file) { |
| | | couponInfoDlg.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() { |
| | | }, |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @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 class="form-horizontal" id="carInfoForm"> |
| | | <input hidden id="id" value="${item.id}"> |
| | | <input hidden id="role" value="${role}"> |
| | | @if(role=='1'){ |
| | | <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> |
| | | @} |
| | | </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="TCarInfoDlg.oneChangeNext(this)"> |
| | | <option value="">选择市</option> |
| | | @for(obj in list1){ |
| | | <option value="${obj.code}" ${obj.code == item.cityCode ? 'selected=selected' : ''}>${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="account" name="account"> |
| | | <option value="">选择账号</option> |
| | | @for(obj in list2){ |
| | | <option value="${obj.id}" ${obj.id == item.cityManagerId ? 'selected=selected' : ''}>${obj.name}-${obj.phone}</option> |
| | | @} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | @} |
| | | <#input id="name" name="门店名称" type="text" value="${item.name}"/> |
| | | <#input id="phone" name="联系电话" type="text" value="${item.phone}"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店地址:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" id="address" name="address" type="text" value="${item.address}" onchange="TCarInfoDlg.searchByStationName(this,1)"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-10" style="margin-left: 397px;width: 70%;" > |
| | | <!-- 创建地图容器--> |
| | | <div id="container" style="height: 500px;" ></div> |
| | | </div> |
| | | <#input id="time" name="营业时间" type="text" value="${time}"/> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">门店介绍:</label> |
| | | <div class="col-sm-9"> |
| | | <textarea id="introduce" style="width: 617px; height: 180px;">${item.introduce}</textarea> |
| | | </div> |
| | | </div> |
| | | <#input id="userName" name="管理员姓名" type="text" value="${city.name}"/> |
| | | <#input id="userPhone" name="管理员手机号" type="text" value="${city.account}"/> |
| | | <#avatar id="img" name="门店封面(推荐像素722*360px)" avatarImg="${item.coverDrawing}"/> |
| | | <#input id="imgOne" name="实景照片" type="text" value="${item.realPicture}"/> |
| | | |
| | | |
| | | </div> |
| | | <div class="row btn-group-m-t"> |
| | | <div class="col-sm-10 col-sm-offset-5"> |
| | | @if(type==1){ |
| | | <#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/tShop/tShop_info.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#time', |
| | | range:true |
| | | }); |
| | | </script> |
| | | <script type="application/javascript"> |
| | | |
| | | </script> |
| | | @} |
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="${id}"> |
| | | @if(welfarePicture==null){ |
| | | <#avatar id="welfarePicture" name="福利图片"/> |
| | | @} |
| | | @if(welfarePicture!=null){ |
| | | <#avatar id="welfarePicture" name="福利图片" avatarImg="${welfarePicture}"/> |
| | | @} |
| | | @if(welfarePicture==12321){ |
| | | <div class="form-group"> |
| | | <div class="col-sm-4"> |
| | | <div id="welfarePicturePreId"> |
| | | <div><img width="700px" height="800px" id="img" src="${welfarePicture}" ></div> |
| | | </div> |
| | | </div> |
| | | |
| | | <input type="hidden" id="welfarePicture"> |
| | | </div> |
| | | <div class="col-sm-2" style="margin-left: 280px"> |
| | | <div class="head-scu-btn upload-btn webuploader-container" id="welfarePictureBtnId"><div class="webuploader-pick"> |
| | | <i class="fa fa-upload"></i> Upload |
| | | </div><div id="rt_rt_1h6lka0hk9mucj87vf1t21qk31" style="position: absolute; inset: 0px auto auto 0px; width: 82px; height: 28px; overflow: hidden;"><input type="file" name="file" class="webuploader-element-invisible" accept="image/gif,image/jpg,image/jpeg,image/bmp,image/png"><label style="opacity: 0; width: 100%; height: 100%; display: block; cursor: pointer; background: rgb(255, 255, 255);"></label></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="TCarInfoDlg.saveImg()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_info.js"></script> |
| | | <script> |
| | | </script> |
| | | <script type="application/javascript"> |
| | | </script> |
| | | @} |
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="${id}"> |
| | | <input hidden id="s1" value="${c1.isOpen}"> |
| | | <input hidden id="s2" value="${c2.isOpen}"> |
| | | <input hidden id="s3" value="${c3.isOpen}"> |
| | | <input hidden id="s4" value="${c4.isOpen}"> |
| | | <input hidden id="s5" value="${c5.isOpen}"> |
| | | <input hidden id="s6" value="${c6.isOpen}"> |
| | | <input hidden id="s7" value="${c7.isOpen}"> |
| | | <input hidden id="s8" value="${c8.isOpen}"> |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 报名玩湃课程:<input type="radio" name="r1" value="1">开启 <input type="radio" name="r1" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px1" value="${c1.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c1==null){ |
| | | <#avatar id="c1" name="背景图" /> |
| | | @} |
| | | @if(c1!=null){ |
| | | <#avatar id="c1" name="背景图" avatarImg="${c1.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 预约场地:<input type="radio" name="r2" value="1">开启 <input type="radio" name="r2" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px2" value="${c2.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c2==null){ |
| | | <#avatar id="c2" name="背景图" /> |
| | | @} |
| | | @if(c2!=null){ |
| | | <#avatar id="c2" name="背景图" avatarImg="${c2.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 报名赛事及活动:<input type="radio" name="r3" value="1">开启 <input type="radio" name="r3" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px3" value="${c3.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c3==null){ |
| | | <#avatar id="c3" name="背景图" /> |
| | | @} |
| | | @if(c3!=null){ |
| | | <#avatar id="c3" name="背景图" avatarImg="${c3.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 免费福利:<input type="radio" name="r4" value="1">开启 <input type="radio" name="r4" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px4" value="${c4.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c4==null){ |
| | | <#avatar id="c4" name="背景图" /> |
| | | @} |
| | | @if(c4!=null){ |
| | | <#avatar id="c4" name="背景图" avatarImg="${c4.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 线上课得积分:<input type="radio" name="r5" value="1">开启 <input type="radio" name="r5" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px5" value="${c5.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c5==null){ |
| | | <#avatar id="c5" name="背景图" /> |
| | | @} |
| | | @if(c5!=null){ |
| | | <#avatar id="c5" name="背景图" avatarImg="${c5.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 购买优惠门票:<input type="radio" name="r6" value="1">开启 <input type="radio" name="r6" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px6" value="${c6.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c6==null){ |
| | | <#avatar id="c6" name="背景图" /> |
| | | @} |
| | | @if(c6!=null){ |
| | | <#avatar id="c6" name="背景图" avatarImg="${c6.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div class="row"> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 看视频得奖励:<input type="radio" name="r7" value="1">开启 <input type="radio" name="r7" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px7" value="${c7.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c7==null){ |
| | | <#avatar id="c7" name="背景图" /> |
| | | @} |
| | | @if(c7!=null){ |
| | | <#avatar id="c7" name="背景图" avatarImg="${c7.backgroundImage}"/> |
| | | @} |
| | | </div> |
| | | <div class="col-lg-6" style=""> |
| | | <div class="form-group" style="margin-left: 96px"> |
| | | <label class="col-sm-4 control-label" > |
| | | 智慧球场:<input type="radio" name="r8" value="1">开启 <input type="radio" name="r8" value="0">关闭 |
| | | </label> |
| | | </div> |
| | | <div class="form-group"> |
| | | <label class="col-sm-3 control-label">排序:</label> |
| | | <div class="col-sm-9"> |
| | | <input class="form-control" style="width: 200px;" type="text" id="px8" value="${c8.sort}"> |
| | | </div> |
| | | </div> |
| | | @if(c8==null){ |
| | | <#avatar id="c8" name="背景图" /> |
| | | @} |
| | | @if(c8!=null){ |
| | | <#avatar id="c8" name="背景图" avatarImg="${c8.backgroundImage}"/> |
| | | @} |
| | | </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="TCarInfoDlg.saveAllImg()"/> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tShop/tShop_info.js"></script> |
| | | |
| | | <script> |
| | | </script> |
| | | <script type="application/javascript"> |
| | | window.onload = function(){ |
| | | var OBJradio=document.getElementsByName("r1") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s1").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r2") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s2").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r3") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s3").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r4") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s4").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r5") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s5").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r6") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s6").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r7") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s7").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio=document.getElementsByName("r8") |
| | | for(i=0;i<OBJradio.length;i++){//循环查找这个radio |
| | | if($("#s8").val()==OBJradio[i].value){//判断是否与radio的值相同 |
| | | OBJradio[i].checked=true//修改选中状态 |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | </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> |
| | | <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> |
| | | <#button name="添加" icon="fa-plus" clickFun="TSite.openAddTSite()"/> |
| | | <#button name="编辑" icon="fa-edit" clickFun="TSite.openTSiteDetail()" space="true"/> |
| | | <#button name="删除" icon="fa-remove" clickFun="TSite.del()" space="true"/> |
| | | </div> |
| | | <#table id="TSiteTable"/> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/modular/system/tSiteType/tSiteType.js"></script> |
| | | <script> |
| | | laydate.render({ |
| | | elem: '#createTime' |
| | | ,range: true |
| | | ,lang:"en" |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =$("#language").val() |
| | | var language =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '标题', field: 'title', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: '内容', field: 'content', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: '发布者', field: 'createrName', align: 'center', valign: 'middle', sortable: true}, |
| | | {title: language==1?'创建时间':(language==2?'Creation time':'Waktu penciptaan'), field: 'createtime', align: 'center', valign: 'middle', sortable: true} |
| | | {title: '公告名称', field: 'name', visible: true,align: 'center', valign: 'middle'}, |
| | | {title: '发布时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle', }, |
| | | {title: '排序', field: 'sort', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'upOrDown', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data) { |
| | | return {0:"已下架",1:"已上架"}[data] |
| | | }}, |
| | | ]; |
| | | }; |
| | | |
| | |
| | | /** |
| | | * 点击添加通知 |
| | | */ |
| | | Notice.openAddNotice = function () { |
| | | Notice.openAdd = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'添加':(language==2?'Add':'Tambahkan'), |
| | | area: ['800px', '500px'], //宽高 |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/notice/notice_add' |
| | | content: Feng.ctxPath + '/tNotice/notice_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'详情':(language==2?'details':'details'), |
| | | area: ['800px', '420px'], //宽高 |
| | | title: language==1?'编辑':(language==2?'details':'details'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/notice/notice_update/' + Notice.seItem.id |
| | | content: Feng.ctxPath + '/tNotice/notice_update/' + Notice.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | Notice.info = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'详情':(language==2?'details':'details'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tNotice/notice_info/' + Notice.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | Notice.updateType = function (e) { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tNotice/updateType", function (data) { |
| | | if(language==1){ |
| | | Feng.success("操作成功!"); |
| | | } |
| | | Notice.table.refresh(); |
| | | }, function (data) { |
| | | if(language==1){ |
| | | Feng.error("操作失败!" + data.responseJSON.message + "!"); |
| | | } |
| | | }); |
| | | ajax.set("id", Notice.seItem.id); |
| | | ajax.set("state", e); |
| | | ajax.start(); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | |
| | | if (this.check()) { |
| | | |
| | | var operation = function(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/notice/delete", function (data) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tNotice/delete", function (data) { |
| | | if(language==1){ |
| | | Feng.success("删除成功!"); |
| | | }else if(language==2){ |
| | |
| | | Feng.error("Hapus gagal!" + data.responseJSON.message + "!"); |
| | | } |
| | | }); |
| | | ajax.set("noticeId", Notice.seItem.id); |
| | | ajax.set("id", Notice.seItem.id); |
| | | ajax.start(); |
| | | }; |
| | | |
| | | Feng.confirm("是否删除通知 " + Notice.seItem.title + "?", operation); |
| | | Feng.confirm("是否删除该公告? ", operation); |
| | | } |
| | | }; |
| | | |
| | |
| | | */ |
| | | Notice.search = function () { |
| | | var queryData = {}; |
| | | queryData['condition'] = $("#condition").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['type'] = $("#type").val(); |
| | | Notice.table.refresh({query: queryData}); |
| | | }; |
| | | Notice.research = function () { |
| | | $("#name").val(''); |
| | | $("#type").val(''); |
| | | Notice.search() |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = Notice.initColumn(); |
| | | var table = new BSTable(Notice.id, "/notice/list", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | var table = new BSTable(Notice.id, "/tNotice/list", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | Notice.table = table.init(); |
| | | }); |
| | |
| | | /** |
| | | * 初始化通知详情对话框 |
| | | */ |
| | | var language =$("#language").val() |
| | | var language =1 |
| | | var NoticeInfoDlg = { |
| | | noticeInfoData: {}, |
| | | editor: null, |
| | | validateFields: { |
| | | title: { |
| | | name: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '标题不能为空' |
| | | message: '公告名称不能为空' |
| | | } |
| | | } |
| | | }, |
| | | sort: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '排序不能为空' |
| | | } |
| | | } |
| | | } |
| | |
| | | * 收集数据 |
| | | */ |
| | | NoticeInfoDlg.collectData = function () { |
| | | this.noticeInfoData['content'] = NoticeInfoDlg.editor.txt.html(); |
| | | this.noticeInfoData['content'] = NoticeInfoDlg.editor.txt; |
| | | this.set('id').set('title'); |
| | | } |
| | | |
| | |
| | | NoticeInfoDlg.addSubmit = function () { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | if (!this.validate()) { |
| | | return; |
| | | } |
| | | |
| | | let text = NoticeInfoDlg.editor.getContent(); |
| | | console.log(text) |
| | | if(text==""){ |
| | | Feng.info("请输入公告内容") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/notice/add", function (data) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tNotice/add", function (data) { |
| | | Feng.success("添加成功!"); |
| | | window.parent.Notice.table.refresh(); |
| | | NoticeInfoDlg.close(); |
| | |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.noticeInfoData); |
| | | ajax.set("name",$("#name").val()); |
| | | ajax.set("text",text); |
| | | ajax.set("sort",$("#sort").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | |
| | | if (!this.validate()) { |
| | | return; |
| | | } |
| | | |
| | | let text = NoticeInfoDlg.editor.getContent(); |
| | | console.log(text) |
| | | if(text==""){ |
| | | Feng.info("请输入公告内容") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/notice/update", function (data) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tNotice/update", function (data) { |
| | | Feng.success("修改成功!"); |
| | | window.parent.Notice.table.refresh(); |
| | | NoticeInfoDlg.close(); |
| | |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.noticeInfoData); |
| | | ajax.set("name",$("#name").val()); |
| | | ajax.set("text",text); |
| | | ajax.set("sort",$("#sort").val()); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | |
| | | Feng.initValidator("noticeInfoForm", NoticeInfoDlg.validateFields); |
| | | |
| | | //初始化编辑器 |
| | | var E = window.wangEditor; |
| | | var editor = new E('#editor'); |
| | | editor.create(); |
| | | editor.txt.html($("#contentVal").val()); |
| | | NoticeInfoDlg.editor = editor; |
| | | NoticeInfoDlg.editor = UE.getEditor('editor'); |
| | | }); |
| | |
| | | return {1:"全部用户",2:"仅限年度会员参与",3:"仅限学员参与"}[data] |
| | | } |
| | | }, |
| | | {title: '状态', field: 'status', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | formatter:function (data) { |
| | | return {1:"未开始",2:"已开始",3:"已结束",4:"已取消"}[data] |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | function currentTime(timestamp){ |
| | |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/TCompetition/TCompetition_update/' + TCompetition.seItem.id |
| | | content: Feng.ctxPath + '/tCompetition/tCompetition_update/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.info = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCompetition/tCompetition_info/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.user = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCompetition/tCompetition_user/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | |
| | | */ |
| | | TCompetition.search = function () { |
| | | var queryData = {}; |
| | | queryData['provinceCode'] = $("#pCode").val(); |
| | | queryData['cityCode'] = $("#cCode").val(); |
| | | queryData['shopName'] = $("#shopName").val(); |
| | | queryData['eventName'] = $("#eventName").val(); |
| | | queryData['time'] = $("#createTime").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | queryData['registerCondition'] = $("#registerCondition").val(); |
| | | TCompetition.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TCompetition.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/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(); |
| | | } |
| | | TCompetition.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#shopName").val(""); |
| | | $("#eventName").val(""); |
| | | $("#createTime").val(""); |
| | | $("#state").val(""); |
| | | $("#registerCondition").val(""); |
| | | TCompetition.search(); |
| | | }; |
| | | |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var TCompetition = { |
| | | id: "TCompetitionTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '性别', field: 'sex', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '身份证号', field: 'idCard', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | formatter:function (data) { |
| | | return {1:"正常",2:"正常",3:"已取消"}[data] |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | 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 |
| | | } |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCompetition.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCompetition.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加车辆管理 |
| | | */ |
| | | TCompetition.openAddTCompetition = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCompetition/tCompetition_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看车辆管理详情 |
| | | */ |
| | | TCompetition.openTCompetitionDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCompetition/tCompetition_update/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.info = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCompetition/tCompetition_info/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | TCompetition.delete = function () { |
| | | if (this.check()) { |
| | | var nickname = TCompetition.seItem.carLicensePlate; |
| | | if (nickname == "" || nickname == null || nickname == undefined){ |
| | | nickname = "该车辆"; |
| | | }else{ |
| | | nickname = "【"+nickname+"】"; |
| | | } |
| | | swal({ |
| | | title: language==1?"您是否确认删除" + nickname + "?":(language==2?"Are you sure to delete the" + nickname + "?":"Apakah Anda pasti akan menghapus" + nickname + "?"), |
| | | text: language==1?"请谨慎操作!":(language==2?' Please operate with caution!':'Harap beroperasi dengan hati -hati!'), |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: language==1?"删除":(language==2?'Delete':'Hapus'), |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/TCompetition/delete", function (data) { |
| | | if(language==1){ |
| | | swal("删除成功", "您已经成功删除了" + nickname + "。", "success"); |
| | | }else if(language==2){ |
| | | swal("Delete succeeded!", "You have successfully deleted it" + nickname + "。", "success"); |
| | | }else { |
| | | swal("Hapus berhasil!", "Anda berhasil menghapus" + nickname + "。", "success"); |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | if(language==1){ |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | }else if(language==2){ |
| | | swal("Failed to delete", data.responseJSON.message + "!", "warning"); |
| | | }else { |
| | | swal("Hapus Gagal", data.responseJSON.message + "!", "warning"); |
| | | } |
| | | |
| | | }); |
| | | ajax.set("TCompetitionId",TCompetition.seItem.id); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | |
| | | TCompetition.carInsurance = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'车辆保险':(language==2?'Vehicle insurance':'Asuransi kendaraan'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/TCompetition/carInsurance?carId=' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCompetition.search = function () { |
| | | var queryData = {}; |
| | | queryData['provinceCode'] = $("#pCode").val(); |
| | | queryData['cityCode'] = $("#cCode").val(); |
| | | queryData['shopName'] = $("#shopName").val(); |
| | | queryData['eventName'] = $("#eventName").val(); |
| | | queryData['time'] = $("#createTime").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | queryData['registerCondition'] = $("#registerCondition").val(); |
| | | TCompetition.table.refresh({query: queryData}); |
| | | }; |
| | | TCompetition.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/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(); |
| | | } |
| | | TCompetition.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#shopName").val(""); |
| | | $("#eventName").val(""); |
| | | $("#createTime").val(""); |
| | | $("#state").val(""); |
| | | $("#registerCondition").val(""); |
| | | TCompetition.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | var table = new BSTable(TCompetition.id, "/tCompetition/listUser/"+$("#id").val(), defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TCompetition.table = table.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 下载模板 |
| | | */ |
| | | TCompetition.uploadCarModel = function () { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/uploadCarModel"; |
| | | } |
| | | |
| | | var agreement = function(){ |
| | | this.init = function(){ |
| | | //模拟上传excel |
| | | $("#uploadEventBtn").unbind("click").bind("click",function(){ |
| | | $("#uploadEventFile").click(); |
| | | }); |
| | | }; |
| | | } |
| | | /** |
| | | * 导入合同 |
| | | */ |
| | | TCompetition.exporTCompetition = function () { |
| | | var uploadEventFile = $("#uploadEventFile").val(); |
| | | if(uploadEventFile == ''){ |
| | | if(language==1){ |
| | | Feng.info("请选择Excel,再上传"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select Excel and upload"); |
| | | }else { |
| | | Feng.info("Silakan pilih Excel dan upload"); |
| | | } |
| | | }else if(uploadEventFile.lastIndexOf(".xls")<0){//可判断以.xls和.xlsx结尾的excel |
| | | if(language==1){ |
| | | Feng.info("只能上传Excel文件"); |
| | | }else if(language==2){ |
| | | Feng.info("Only Excel files can be uploaded"); |
| | | }else { |
| | | Feng.info("Hanya berkas Excel yang dapat diunggah"); |
| | | } |
| | | }else{ |
| | | var url = Feng.ctxPath + '/TCompetition/exporTCompetition'; |
| | | var file = document.querySelector('input[name=file]').files[0]; |
| | | var reader = new FileReader(); |
| | | if (file) { |
| | | var formData = new FormData(); |
| | | formData.append("myfile", file); |
| | | this.sendAjaxRequest(url, 'POST', formData); |
| | | } |
| | | } |
| | | } |
| | | TCompetition.sendAjaxRequest = function(url,type,data){ |
| | | $.ajax({ |
| | | url : url, |
| | | type : type, |
| | | data : data, |
| | | success : function(result) { |
| | | if(result.code==500) { |
| | | Feng.info(result.message); |
| | | }else { |
| | | if(language==1){ |
| | | Feng.success("导入成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("SUCCESSFUL IMPORT!"); |
| | | }else { |
| | | Feng.success("Import berhasil!"); |
| | | } |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, |
| | | error : function() { |
| | | if(language==1){ |
| | | Feng.error("excel上传失败!"); |
| | | }else if(language==2){ |
| | | Feng.error("Uploading excel Fails. Procedure!"); |
| | | }else { |
| | | Feng.error("Gagal mengunggah excel!"); |
| | | } |
| | | }, |
| | | cache : false, |
| | | contentType : false, |
| | | processData : false |
| | | }); |
| | | }; |
| | | |
| | | var agreement; |
| | | $(function(){ |
| | | agreement = new agreement(); |
| | | agreement.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 导出车辆操作 |
| | | */ |
| | | TCompetition.ouTCompetition = function () { |
| | | var operation = function() { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/ouTCompetition"; |
| | | }; |
| | | if(language==1){ |
| | | Feng.confirm("是否确认导出车辆信息?", operation); |
| | | }else if(language==2){ |
| | | Feng.confirm("Are you sure to export vehicle information?", operation); |
| | | }else { |
| | | Feng.confirm("Apakah Anda pasti akan mengekspor informasi kendaraan?", operation); |
| | | } |
| | | } |
| | |
| | | /** |
| | | * 初始化车辆管理详情对话框 |
| | | */ |
| | | var language=$("#language").val(); |
| | | var language=1; |
| | | var TCarInfoDlg = { |
| | | tCarInfoData : {}, |
| | | validateFields: { |
| | |
| | | * 关闭此对话框 |
| | | */ |
| | | TCarInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TCar.layerIndex); |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | } |
| | | |
| | | /** |
| | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | var roleType = $("#roleType").val(); //1=平台 2=分公司 3=加盟商 |
| | | var companyType = $("input[name='companyType']:checked").val(); |
| | | if (1 == roleType){ |
| | | if (2 == companyType){ |
| | | var oneId = $("#oneId").val(); |
| | | if ("" == oneId){ |
| | | if(language==1){ |
| | | Feng.info("所属分公司不能为空!"); |
| | | }else if(language==2){ |
| | | Feng.info("The subordinate branch cannot be empty!"); |
| | | }else { |
| | | Feng.info("Cabang subordinat tidak dapat kosong!"); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | var serverBox =[]; |
| | | $('input[name="serverBox"]:checked').each(function(){ |
| | | serverBox.push($(this).val()); |
| | | }); |
| | | if (serverBox.length == 0){ |
| | | if(language==1){ |
| | | Feng.info("请选择经营业务"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select business"); |
| | | }else { |
| | | Feng.info("Pilih bisnis"); |
| | | } |
| | | |
| | | |
| | | |
| | | var pCode = $("#pCode").val(); |
| | | if(pCode==""){ |
| | | Feng.info("请选择省"); |
| | | return; |
| | | } |
| | | var carPhoto = $("#carPhoto").valueOf(); |
| | | if ("" == carPhoto){ |
| | | if(language==1){ |
| | | Feng.info("请上传车辆照片"); |
| | | }else if(language==2){ |
| | | Feng.info("Please upload a photo of the vehicle"); |
| | | }else { |
| | | Feng.info("Silakan mengunggah foto kendaraan"); |
| | | } |
| | | |
| | | var cCode = $("#cCode").val(); |
| | | if(cCode==""){ |
| | | Feng.info("请选择市"); |
| | | return; |
| | | } |
| | | var drivingLicensePhoto = $("#drivingLicensePhoto").valueOf(); |
| | | if ("" == drivingLicensePhoto){ |
| | | if(language==1){ |
| | | Feng.info("请上传行驶证照片"); |
| | | }else if(language==2){ |
| | | Feng.info("Please upload a photo of your vehicle. Please upload a photo of your driving license"); |
| | | }else { |
| | | Feng.info("Silakan mengunggah foto kendaraanmu. Silakan mengunggah foto dari lisensi mengemudi Anda"); |
| | | } |
| | | |
| | | var shopId = $("#shopId").val(); |
| | | var name = $("#name").val(); |
| | | if(name==""){ |
| | | Feng.info("请输入赛事名称"); |
| | | return; |
| | | } |
| | | var startTime = $("#startTime").val(); |
| | | console.log(startTime) |
| | | if(startTime==""){ |
| | | Feng.info("请选择开始时间"); |
| | | return; |
| | | } |
| | | var endTime = $("#endTime").val(); |
| | | if(endTime==""){ |
| | | Feng.info("请选择结束时间"); |
| | | 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(); |
| | | var playPaiCoin = $("#playPaiCoin").val(); |
| | | var classPrice = $("#classPrice").val(); |
| | | var address = $("#address").val(); |
| | | if(address==""){ |
| | | Feng.info("请输入参加地点"); |
| | | return; |
| | | } |
| | | var applicantsNumber = $("#applicantsNumber").val(); |
| | | if(applicantsNumber==""){ |
| | | Feng.info("请输入报名人数"); |
| | | return; |
| | | } |
| | | var baseNumber = $("#baseNumber").val(); |
| | | let realName = document.querySelector('input[name="realName"]:checked').value; |
| | | var introduction = $("#introduction").val(); |
| | | if(introduction==""){ |
| | | Feng.info("请输入赛事简介"); |
| | | return; |
| | | } |
| | | |
| | | var coverDrawing = $("#coverDrawing").val(); |
| | | var coverDrawing = $("#coverDrawing").val(); |
| | | var registrationNotes = $("#registrationNotes").val() |
| | | if(registrationNotes==""){ |
| | | Feng.info("请上传报名须知图片"); |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/add", function(data){ |
| | | if(data.status == 200){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/add", function(data){ |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("添加成功!"); |
| | | }else if(language==2){ |
| | |
| | | }else { |
| | | Feng.success("Sangat berhasil ditambah!"); |
| | | } |
| | | window.parent.TCar.table.refresh(); |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.set("serverBox",serverBox.toString()); |
| | | ajax.set("zcModel",$("#zcModel").val()); |
| | | ajax.set("kcModel",$("#kcModel").val()); |
| | | ajax.set("roleType",roleType); |
| | | if (1 == roleType){ |
| | | ajax.set("companyType",companyType); |
| | | ajax.set("oneId",$("#oneId").val()); |
| | | ajax.set("twoId",$("#twoId").val()); |
| | | ajax.set("franchiseeId",0); |
| | | } else if (2 == roleType) { |
| | | ajax.set("franchiseeId",$("#franchiseeId").val()); |
| | | ajax.set("companyType",0); |
| | | ajax.set("oneId",0); |
| | | ajax.set("twoId",0); |
| | | }else if (3 == roleType){ |
| | | ajax.set("franchiseeId",0); |
| | | ajax.set("companyType",0); |
| | | ajax.set("oneId",0); |
| | | ajax.set("twoId",0); |
| | | } |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("storeId",shopId); |
| | | ajax.set("name",name); |
| | | 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("playPaiCoin",playPaiCoin); |
| | | ajax.set("classPrice",classPrice); |
| | | ajax.set("address",address); |
| | | ajax.set("applicantsNumber",applicantsNumber); |
| | | ajax.set("baseNumber",baseNumber); |
| | | ajax.set("realName",realName); |
| | | ajax.set("coverDrawing",coverDrawing); |
| | | ajax.set("introduction",introduction); |
| | | ajax.set("imgs",introduction); |
| | | ajax.set("registrationNotes",registrationNotes); |
| | | ajax.set("longitude", $("#longitude").val()); |
| | | ajax.set("latitude", $("#latitude").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | |
| | | return ; |
| | | } |
| | | |
| | | var roleType = $("#roleType").val(); //1=平台 2=分公司 3=加盟商 |
| | | var companyType = $("input[name='companyType']:checked").val(); |
| | | if (1 == roleType){ |
| | | if (2 == companyType){ |
| | | var oneId = $("#oneId").val(); |
| | | if ("" == oneId){ |
| | | if(language==1){ |
| | | Feng.info("所属分公司不能为空!"); |
| | | }else if(language==2){ |
| | | Feng.info("The subordinate branch cannot be empty!"); |
| | | }else { |
| | | Feng.info("Cabang subordinat tidak dapat kosong!"); |
| | | } |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | var serverBox =[]; |
| | | $('input[name="serverBox"]:checked').each(function(){ |
| | | serverBox.push($(this).val()); |
| | | }); |
| | | if (serverBox.length == 0){ |
| | | if(language==1){ |
| | | Feng.info("请选择经营业务"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select business"); |
| | | }else { |
| | | Feng.info("Pilih bisnis"); |
| | | } |
| | | var pCode = $("#pCode").val(); |
| | | if(pCode==""){ |
| | | Feng.info("请选择省"); |
| | | return; |
| | | } |
| | | var carPhoto = $("#carPhoto").valueOf(); |
| | | if ("" == carPhoto){ |
| | | if(language==1){ |
| | | Feng.info("请上传车辆照片"); |
| | | }else if(language==2){ |
| | | Feng.info("Please upload a photo of the vehicle"); |
| | | }else { |
| | | Feng.info("Silakan mengunggah foto kendaraan"); |
| | | } |
| | | var cCode = $("#cCode").val(); |
| | | if(cCode==""){ |
| | | Feng.info("请选择市"); |
| | | return; |
| | | } |
| | | var drivingLicensePhoto = $("#drivingLicensePhoto").valueOf(); |
| | | if ("" == drivingLicensePhoto){ |
| | | if(language==1){ |
| | | Feng.info("请上传行驶证照片"); |
| | | }else if(language==2){ |
| | | Feng.info("Please upload a photo of your vehicle. Please upload a photo of your driving license"); |
| | | }else { |
| | | Feng.info("Silakan mengunggah foto kendaraanmu. Silakan mengunggah foto dari lisensi mengemudi Anda"); |
| | | } |
| | | var shopId = $("#shopId").val(); |
| | | var name = $("#name").val(); |
| | | if(name==""){ |
| | | Feng.info("请输入赛事名称"); |
| | | return; |
| | | } |
| | | var startTime = $("#startTime").val(); |
| | | console.log(startTime) |
| | | if(startTime==""){ |
| | | Feng.info("请选择开始时间"); |
| | | return; |
| | | } |
| | | var endTime = $("#endTime").val(); |
| | | if(endTime==""){ |
| | | Feng.info("请选择结束时间"); |
| | | 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(); |
| | | var playPaiCoin = $("#playPaiCoin").val(); |
| | | var classPrice = $("#classPrice").val(); |
| | | var address = $("#address").val(); |
| | | if(address==""){ |
| | | Feng.info("请输入参加地点"); |
| | | return; |
| | | } |
| | | var applicantsNumber = $("#applicantsNumber").val(); |
| | | if(applicantsNumber==""){ |
| | | Feng.info("请输入报名人数"); |
| | | return; |
| | | } |
| | | var baseNumber = $("#baseNumber").val(); |
| | | let realName = document.querySelector('input[name="realName"]:checked').value; |
| | | var introduction = $("#introduction").val(); |
| | | if(introduction==""){ |
| | | Feng.info("请输入赛事简介"); |
| | | return; |
| | | } |
| | | |
| | | var coverDrawing = $("#coverDrawing").val(); |
| | | var coverDrawing = $("#coverDrawing").val(); |
| | | var registrationNotes = $("#registrationNotes").val() |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/update", function(data){ |
| | | if(data.status == 200){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/update", function(data){ |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("修改成功!"); |
| | | }else if(language==2){ |
| | |
| | | }else { |
| | | Feng.success("Mengubah dengan sukses!"); |
| | | } |
| | | window.parent.TCar.table.refresh(); |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.set("serverBox",serverBox.toString()); |
| | | ajax.set("zcModel",$("#zcModel").val()); |
| | | ajax.set("kcModel",$("#kcModel").val()); |
| | | ajax.set("roleType",roleType); |
| | | if (1 == roleType){ |
| | | ajax.set("companyType",companyType); |
| | | ajax.set("oneId",$("#oneId").val()); |
| | | ajax.set("twoId",$("#twoId").val()); |
| | | ajax.set("franchiseeId",0); |
| | | } else if (2 == roleType) { |
| | | ajax.set("franchiseeId",$("#franchiseeId").val()); |
| | | ajax.set("companyType",0); |
| | | ajax.set("oneId",0); |
| | | ajax.set("twoId",0); |
| | | }else if (3 == roleType){ |
| | | ajax.set("franchiseeId",0); |
| | | ajax.set("companyType",0); |
| | | ajax.set("oneId",0); |
| | | ajax.set("twoId",0); |
| | | } |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("storeId",shopId); |
| | | ajax.set("name",name); |
| | | 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("playPaiCoin",playPaiCoin); |
| | | ajax.set("classPrice",classPrice); |
| | | ajax.set("address",address); |
| | | ajax.set("applicantsNumber",applicantsNumber); |
| | | ajax.set("baseNumber",baseNumber); |
| | | ajax.set("realName",realName); |
| | | ajax.set("coverDrawing",coverDrawing); |
| | | ajax.set("introduction",introduction); |
| | | ajax.set("imgs",introduction); |
| | | ajax.set("registrationNotes",registrationNotes); |
| | | ajax.set("longitude", $("#longitude").val()); |
| | | ajax.set("latitude", $("#latitude").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("carPhoto"); |
| | | var carPhoto = new $WebUpload("coverDrawing"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("registrationNotes"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | TCarInfoDlg.searchByStationName(); |
| | | }); |
| | | |
| | | /** |
| | |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TCarInfoDlg.oneChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/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(); |
| | | } |
| | | |
| | | TCarInfoDlg.oneChangeNext = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/oneChangeNext", 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>"; |
| | | }); |
| | | $("#shopId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | |
| | | */ |
| | | TCarInfoDlg.brandChange = function (e) { |
| | | var carBrandId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCar/brandChange", function(data){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/brandChange", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择车辆类型</option>'; |
| | |
| | | $("#kcModelDiv").hide(); |
| | | } |
| | | } |
| | | var map = new AMap.Map('container', { |
| | | resizeEnable: true, // 允许缩放 |
| | | zoom: 15 // 设置地图的缩放级别,0 - 20 |
| | | }); |
| | | var marker; |
| | | //搜索地图 |
| | | TCarInfoDlg.searchByStationName = function(e,type){ |
| | | var keyword="成都"; |
| | | if(type==2){ |
| | | keyword = $(e).parent().prev().find("input").val(); |
| | | }else { |
| | | if($("#address").val()!=null && $("#address").val()!=''){ |
| | | keyword = $("#address").val(); |
| | | } |
| | | } |
| | | type=1; |
| | | AMap.plugin('AMap.Geocoder', function() { |
| | | var geocoder = new AMap.Geocoder(); |
| | | console.log(geocoder) |
| | | console.log(keyword) |
| | | geocoder.getLocation(keyword, function(status, result) { |
| | | console.log(status,result) |
| | | if (status === 'complete' && result.info === 'OK') { |
| | | // 经纬度 |
| | | var lng = result.geocodes[0].location.lng; |
| | | var lat = result.geocodes[0].location.lat; |
| | | $("#longitude").val(lng) |
| | | $("#latitude").val(lat) |
| | | // 地图实例 |
| | | map = new AMap.Map('container', { |
| | | resizeEnable: true, // 允许缩放 |
| | | center: [lng, lat], // 设置地图的中心点 |
| | | zoom: 15 // 设置地图的缩放级别,0 - 20 |
| | | }); |
| | | //地图画点 |
| | | //addMarker(lng,lat); |
| | | if(type==1 || type==2){ |
| | | showInfoClick(); |
| | | if(lng == null){ |
| | | }else{ |
| | | addMarker(lng,lat); |
| | | } |
| | | }else{ |
| | | addMarker(lng,lat); |
| | | } |
| | | } else { |
| | | console.log('定位失败!'); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | } |
| | | //地图点击事件 |
| | | function showInfoClick(){ |
| | | map.on('click', function (e) { |
| | | addMarker(e.lnglat.getLng(),e.lnglat.getLat()); |
| | | }); |
| | | } |
| | | //删除点 |
| | | function removeMarkers(){ |
| | | if(marker!=null){ |
| | | map.remove(marker); |
| | | } |
| | | |
| | | } |
| | | // 实例化点标记 |
| | | function addMarker(lon,lat) { |
| | | removeMarkers(); |
| | | marker = new AMap.Marker({ |
| | | map: map, |
| | | position: new AMap.LngLat(lon, lat), // 经纬度 |
| | | }); |
| | | //加经纬度 |
| | | $("#lon").val(lon); |
| | | $("#lat").val(lat); |
| | | var lnglatXY = [lon, lat];//地图上所标点的坐标 |
| | | AMap.service('AMap.Geocoder',function() {//回调函数 |
| | | geocoder = new AMap.Geocoder({ |
| | | }); |
| | | geocoder.getAddress(lnglatXY, function (status, result) { |
| | | if (status === 'complete' && result.info === 'OK') { |
| | | //获得了有效的地址信息: |
| | | //即,result.regeocode.formattedAddress |
| | | // alert(result.regeocode.formattedAddress) |
| | | //document.getElementById("address").value=result.regeocode.formattedAddress;//将获取到的地址信息赋值给文本框,保存进数据库 |
| | | |
| | | var address = result.regeocode.formattedAddress; |
| | | var city = result.regeocode.addressComponent.city; |
| | | var province = result.regeocode.addressComponent.province; |
| | | var district = result.regeocode.addressComponent.district; |
| | | $("#address").val(address); |
| | | } else { |
| | | //获取地址失败 |
| | | } |
| | | }); |
| | | }) |
| | | } |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var TCompetition = { |
| | | id: "TCompetitionTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '所在省', field: 'province', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '所在市', field: 'city', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '举办门店', field: 'storeName', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '赛事名称', field: 'name', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '开始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '结束时间', field: 'endTime', visible: true, align: 'center', valign: 'middle',width:'5%', |
| | | }, |
| | | {title: '报名条件', field: 'registerCondition', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | formatter:function (data) { |
| | | return {1:"全部用户",2:"仅限年度会员参与",3:"仅限学员参与"}[data] |
| | | } |
| | | }, |
| | | {title: '状态', field: 'auditStatus', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | formatter:function (data) { |
| | | return {1:"待审核",3:"未通过"}[data] |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | 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 |
| | | } |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCompetition.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCompetition.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加车辆管理 |
| | | */ |
| | | TCompetition.openAddTCompetition = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCompetitionAudit/tCompetition_update/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看车辆管理详情 |
| | | */ |
| | | TCompetition.openTCompetitionDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.load(1,{ |
| | | 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" >' + |
| | | ' <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="r1" value="2" checked> 通过 <input type="radio" name="r1" value="3" > 拒绝 '+ |
| | | ' </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="text" style="width: 460px; height: 138px;"></textarea> '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>' |
| | | , btn: ['关闭', '保存'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | ,load:1 |
| | | , yes: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | btn2:function () { |
| | | let audit = document.querySelector('input[name="r1"]:checked').value; |
| | | let text = $("#text").val() |
| | | if(audit==3){ |
| | | if(text==''){ |
| | | Feng.info("请输入拒绝理由") |
| | | return false; |
| | | } |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetitionAudit/audit", function (data) { |
| | | if (data.code == 200) { |
| | | Feng.success("操作成功!"); |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | } else if(data=="repeat"){ |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | Feng.error("请勿重复操作"); |
| | | }else { |
| | | return Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("操作失败!") |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | return Feng.error("操作失败!"); |
| | | }); |
| | | ajax.set("id", TCompetition.seItem.id); |
| | | ajax.set("audit", audit); |
| | | ajax.set("text", text); |
| | | ajax.start(); |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.info = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCompetition/tCompetition_info/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.user = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCompetition/tCompetition_user/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | TCompetition.delete = function () { |
| | | if (this.check()) { |
| | | var nickname = TCompetition.seItem.carLicensePlate; |
| | | if (nickname == "" || nickname == null || nickname == undefined){ |
| | | nickname = "该车辆"; |
| | | }else{ |
| | | nickname = "【"+nickname+"】"; |
| | | } |
| | | swal({ |
| | | title: language==1?"您是否确认删除" + nickname + "?":(language==2?"Are you sure to delete the" + nickname + "?":"Apakah Anda pasti akan menghapus" + nickname + "?"), |
| | | text: language==1?"请谨慎操作!":(language==2?' Please operate with caution!':'Harap beroperasi dengan hati -hati!'), |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: language==1?"删除":(language==2?'Delete':'Hapus'), |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/TCompetition/delete", function (data) { |
| | | if(language==1){ |
| | | swal("删除成功", "您已经成功删除了" + nickname + "。", "success"); |
| | | }else if(language==2){ |
| | | swal("Delete succeeded!", "You have successfully deleted it" + nickname + "。", "success"); |
| | | }else { |
| | | swal("Hapus berhasil!", "Anda berhasil menghapus" + nickname + "。", "success"); |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | if(language==1){ |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | }else if(language==2){ |
| | | swal("Failed to delete", data.responseJSON.message + "!", "warning"); |
| | | }else { |
| | | swal("Hapus Gagal", data.responseJSON.message + "!", "warning"); |
| | | } |
| | | |
| | | }); |
| | | ajax.set("TCompetitionId",TCompetition.seItem.id); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | |
| | | TCompetition.carInsurance = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'车辆保险':(language==2?'Vehicle insurance':'Asuransi kendaraan'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/TCompetition/carInsurance?carId=' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCompetition.search = function () { |
| | | var queryData = {}; |
| | | queryData['provinceCode'] = $("#pCode").val(); |
| | | queryData['cityCode'] = $("#cCode").val(); |
| | | queryData['shopName'] = $("#shopName").val(); |
| | | queryData['eventName'] = $("#eventName").val(); |
| | | queryData['time'] = $("#createTime").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | queryData['registerCondition'] = $("#registerCondition").val(); |
| | | TCompetition.table.refresh({query: queryData}); |
| | | }; |
| | | TCompetition.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/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(); |
| | | } |
| | | TCompetition.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#shopName").val(""); |
| | | $("#eventName").val(""); |
| | | $("#createTime").val(""); |
| | | $("#state").val(""); |
| | | $("#registerCondition").val(""); |
| | | TCompetition.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | var table = new BSTable(TCompetition.id, "/tCompetitionAudit/list", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TCompetition.table = table.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 下载模板 |
| | | */ |
| | | TCompetition.uploadCarModel = function () { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/uploadCarModel"; |
| | | } |
| | | |
| | | var agreement = function(){ |
| | | this.init = function(){ |
| | | //模拟上传excel |
| | | $("#uploadEventBtn").unbind("click").bind("click",function(){ |
| | | $("#uploadEventFile").click(); |
| | | }); |
| | | }; |
| | | } |
| | | /** |
| | | * 导入合同 |
| | | */ |
| | | TCompetition.exporTCompetition = function () { |
| | | var uploadEventFile = $("#uploadEventFile").val(); |
| | | if(uploadEventFile == ''){ |
| | | if(language==1){ |
| | | Feng.info("请选择Excel,再上传"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select Excel and upload"); |
| | | }else { |
| | | Feng.info("Silakan pilih Excel dan upload"); |
| | | } |
| | | }else if(uploadEventFile.lastIndexOf(".xls")<0){//可判断以.xls和.xlsx结尾的excel |
| | | if(language==1){ |
| | | Feng.info("只能上传Excel文件"); |
| | | }else if(language==2){ |
| | | Feng.info("Only Excel files can be uploaded"); |
| | | }else { |
| | | Feng.info("Hanya berkas Excel yang dapat diunggah"); |
| | | } |
| | | }else{ |
| | | var url = Feng.ctxPath + '/TCompetition/exporTCompetition'; |
| | | var file = document.querySelector('input[name=file]').files[0]; |
| | | var reader = new FileReader(); |
| | | if (file) { |
| | | var formData = new FormData(); |
| | | formData.append("myfile", file); |
| | | this.sendAjaxRequest(url, 'POST', formData); |
| | | } |
| | | } |
| | | } |
| | | TCompetition.sendAjaxRequest = function(url,type,data){ |
| | | $.ajax({ |
| | | url : url, |
| | | type : type, |
| | | data : data, |
| | | success : function(result) { |
| | | if(result.code==500) { |
| | | Feng.info(result.message); |
| | | }else { |
| | | if(language==1){ |
| | | Feng.success("导入成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("SUCCESSFUL IMPORT!"); |
| | | }else { |
| | | Feng.success("Import berhasil!"); |
| | | } |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, |
| | | error : function() { |
| | | if(language==1){ |
| | | Feng.error("excel上传失败!"); |
| | | }else if(language==2){ |
| | | Feng.error("Uploading excel Fails. Procedure!"); |
| | | }else { |
| | | Feng.error("Gagal mengunggah excel!"); |
| | | } |
| | | }, |
| | | cache : false, |
| | | contentType : false, |
| | | processData : false |
| | | }); |
| | | }; |
| | | |
| | | var agreement; |
| | | $(function(){ |
| | | agreement = new agreement(); |
| | | agreement.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 导出车辆操作 |
| | | */ |
| | | TCompetition.ouTCompetition = function () { |
| | | var operation = function() { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/ouTCompetition"; |
| | | }; |
| | | if(language==1){ |
| | | Feng.confirm("是否确认导出车辆信息?", operation); |
| | | }else if(language==2){ |
| | | Feng.confirm("Are you sure to export vehicle information?", operation); |
| | | }else { |
| | | Feng.confirm("Apakah Anda pasti akan mengekspor informasi kendaraan?", operation); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var TCompetition = { |
| | | id: "TCompetitionTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '姓名', field: 'name', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '性别', field: 'sex', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '联系电话', field: 'phone', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '身份证号', field: 'idCard', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | }, |
| | | {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle',width:'8%', |
| | | formatter:function (data) { |
| | | return {1:"正常",2:"正常",3:"已取消"}[data] |
| | | } |
| | | }, |
| | | ]; |
| | | }; |
| | | 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 |
| | | } |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCompetition.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCompetition.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加车辆管理 |
| | | */ |
| | | TCompetition.openAddTCompetition = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCompetition/tCompetition_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看车辆管理详情 |
| | | */ |
| | | TCompetition.openTCompetitionDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCompetition/tCompetition_update/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.info = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCompetition/tCompetition_info/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | TCompetition.delete = function () { |
| | | if (this.check()) { |
| | | var nickname = TCompetition.seItem.carLicensePlate; |
| | | if (nickname == "" || nickname == null || nickname == undefined){ |
| | | nickname = "该车辆"; |
| | | }else{ |
| | | nickname = "【"+nickname+"】"; |
| | | } |
| | | swal({ |
| | | title: language==1?"您是否确认删除" + nickname + "?":(language==2?"Are you sure to delete the" + nickname + "?":"Apakah Anda pasti akan menghapus" + nickname + "?"), |
| | | text: language==1?"请谨慎操作!":(language==2?' Please operate with caution!':'Harap beroperasi dengan hati -hati!'), |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: language==1?"删除":(language==2?'Delete':'Hapus'), |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/TCompetition/delete", function (data) { |
| | | if(language==1){ |
| | | swal("删除成功", "您已经成功删除了" + nickname + "。", "success"); |
| | | }else if(language==2){ |
| | | swal("Delete succeeded!", "You have successfully deleted it" + nickname + "。", "success"); |
| | | }else { |
| | | swal("Hapus berhasil!", "Anda berhasil menghapus" + nickname + "。", "success"); |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | if(language==1){ |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | }else if(language==2){ |
| | | swal("Failed to delete", data.responseJSON.message + "!", "warning"); |
| | | }else { |
| | | swal("Hapus Gagal", data.responseJSON.message + "!", "warning"); |
| | | } |
| | | |
| | | }); |
| | | ajax.set("TCompetitionId",TCompetition.seItem.id); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | |
| | | TCompetition.carInsurance = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'车辆保险':(language==2?'Vehicle insurance':'Asuransi kendaraan'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/TCompetition/carInsurance?carId=' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCompetition.search = function () { |
| | | var queryData = {}; |
| | | queryData['provinceCode'] = $("#pCode").val(); |
| | | queryData['cityCode'] = $("#cCode").val(); |
| | | queryData['shopName'] = $("#shopName").val(); |
| | | queryData['eventName'] = $("#eventName").val(); |
| | | queryData['time'] = $("#createTime").val(); |
| | | queryData['state'] = $("#state").val(); |
| | | queryData['registerCondition'] = $("#registerCondition").val(); |
| | | TCompetition.table.refresh({query: queryData}); |
| | | }; |
| | | TCompetition.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/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(); |
| | | } |
| | | TCompetition.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#shopName").val(""); |
| | | $("#eventName").val(""); |
| | | $("#createTime").val(""); |
| | | $("#state").val(""); |
| | | $("#registerCondition").val(""); |
| | | TCompetition.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | var table = new BSTable(TCompetition.id, "/tCompetition/listUser/"+$("#id").val(), defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TCompetition.table = table.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 下载模板 |
| | | */ |
| | | TCompetition.uploadCarModel = function () { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/uploadCarModel"; |
| | | } |
| | | |
| | | var agreement = function(){ |
| | | this.init = function(){ |
| | | //模拟上传excel |
| | | $("#uploadEventBtn").unbind("click").bind("click",function(){ |
| | | $("#uploadEventFile").click(); |
| | | }); |
| | | }; |
| | | } |
| | | /** |
| | | * 导入合同 |
| | | */ |
| | | TCompetition.exporTCompetition = function () { |
| | | var uploadEventFile = $("#uploadEventFile").val(); |
| | | if(uploadEventFile == ''){ |
| | | if(language==1){ |
| | | Feng.info("请选择Excel,再上传"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select Excel and upload"); |
| | | }else { |
| | | Feng.info("Silakan pilih Excel dan upload"); |
| | | } |
| | | }else if(uploadEventFile.lastIndexOf(".xls")<0){//可判断以.xls和.xlsx结尾的excel |
| | | if(language==1){ |
| | | Feng.info("只能上传Excel文件"); |
| | | }else if(language==2){ |
| | | Feng.info("Only Excel files can be uploaded"); |
| | | }else { |
| | | Feng.info("Hanya berkas Excel yang dapat diunggah"); |
| | | } |
| | | }else{ |
| | | var url = Feng.ctxPath + '/TCompetition/exporTCompetition'; |
| | | var file = document.querySelector('input[name=file]').files[0]; |
| | | var reader = new FileReader(); |
| | | if (file) { |
| | | var formData = new FormData(); |
| | | formData.append("myfile", file); |
| | | this.sendAjaxRequest(url, 'POST', formData); |
| | | } |
| | | } |
| | | } |
| | | TCompetition.sendAjaxRequest = function(url,type,data){ |
| | | $.ajax({ |
| | | url : url, |
| | | type : type, |
| | | data : data, |
| | | success : function(result) { |
| | | if(result.code==500) { |
| | | Feng.info(result.message); |
| | | }else { |
| | | if(language==1){ |
| | | Feng.success("导入成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("SUCCESSFUL IMPORT!"); |
| | | }else { |
| | | Feng.success("Import berhasil!"); |
| | | } |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, |
| | | error : function() { |
| | | if(language==1){ |
| | | Feng.error("excel上传失败!"); |
| | | }else if(language==2){ |
| | | Feng.error("Uploading excel Fails. Procedure!"); |
| | | }else { |
| | | Feng.error("Gagal mengunggah excel!"); |
| | | } |
| | | }, |
| | | cache : false, |
| | | contentType : false, |
| | | processData : false |
| | | }); |
| | | }; |
| | | |
| | | var agreement; |
| | | $(function(){ |
| | | agreement = new agreement(); |
| | | agreement.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 导出车辆操作 |
| | | */ |
| | | TCompetition.ouTCompetition = function () { |
| | | var operation = function() { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/ouTCompetition"; |
| | | }; |
| | | if(language==1){ |
| | | Feng.confirm("是否确认导出车辆信息?", operation); |
| | | }else if(language==2){ |
| | | Feng.confirm("Are you sure to export vehicle information?", operation); |
| | | }else { |
| | | Feng.confirm("Apakah Anda pasti akan mengekspor informasi kendaraan?", operation); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 初始化车辆管理详情对话框 |
| | | */ |
| | | var language=1; |
| | | var TCarInfoDlg = { |
| | | tCarInfoData : {}, |
| | | validateFields: { |
| | | carBrandId: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'请选择车辆品牌':(language==2?"Please select the vehicle brand":"Silakan pilih tanda kendaraan") |
| | | } |
| | | } |
| | | }, |
| | | carModelId: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'请选择车辆类型':(language==2?"Please select the vehicle type":"Silakan pilih tipe kendaraan") |
| | | } |
| | | } |
| | | }, |
| | | zcModel: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'请选择摩托车车型':(language==2?"Please select a motorcycle model":"Silakan pilih model motor") |
| | | } |
| | | } |
| | | }, |
| | | carColor: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'车辆颜色不能为空':(language==2?"The vehicle color cannot be empty.":"Warna kendaraan tidak bisa kosong.") |
| | | } |
| | | } |
| | | }, |
| | | drivingLicenseNumber: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'行驶证编号不能为空':(language==2?"The driving license number cannot be empty":"Nomor SIM Tidak Bisa Kosong") |
| | | } |
| | | } |
| | | }, |
| | | annualInspectionTime: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'年检到期时间不能为空':(language==2?"The annual inspection expiration time cannot be empty":"Waktu kedaluwarsa inspeksi tahunan tidak bisa kosong") |
| | | } |
| | | } |
| | | }, |
| | | commercialInsuranceTime: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: language==1?'商业保险到期时间不能为空':(language==2?"The commercial insurance expiration time cannot be empty":"Waktu kedaluwarsa asuransi komersial tidak bisa kosong") |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TCarInfoDlg.validate = function () { |
| | | $('#carInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#carInfoForm').bootstrapValidator('validate'); |
| | | return $("#carInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TCarInfoDlg.clearData = function() { |
| | | this.tCarInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.set = function(key, val) { |
| | | this.tCarInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TCarInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TCarInfoDlg.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'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TCarInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | |
| | | |
| | | var pCode = $("#pCode").val(); |
| | | if(pCode==""){ |
| | | Feng.info("请选择省"); |
| | | return; |
| | | } |
| | | var cCode = $("#cCode").val(); |
| | | if(cCode==""){ |
| | | Feng.info("请选择市"); |
| | | return; |
| | | } |
| | | var shopId = $("#shopId").val(); |
| | | var name = $("#name").val(); |
| | | if(name==""){ |
| | | Feng.info("请输入赛事名称"); |
| | | return; |
| | | } |
| | | var startTime = $("#startTime").val(); |
| | | console.log(startTime) |
| | | if(startTime==""){ |
| | | Feng.info("请选择开始时间"); |
| | | return; |
| | | } |
| | | var endTime = $("#endTime").val(); |
| | | if(endTime==""){ |
| | | Feng.info("请选择结束时间"); |
| | | 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(); |
| | | var playPaiCoin = $("#playPaiCoin").val(); |
| | | var classPrice = $("#classPrice").val(); |
| | | var address = $("#address").val(); |
| | | if(address==""){ |
| | | Feng.info("请输入参加地点"); |
| | | return; |
| | | } |
| | | var applicantsNumber = $("#applicantsNumber").val(); |
| | | if(applicantsNumber==""){ |
| | | Feng.info("请输入报名人数"); |
| | | return; |
| | | } |
| | | var baseNumber = $("#baseNumber").val(); |
| | | let realName = document.querySelector('input[name="realName"]:checked').value; |
| | | var introduction = $("#introduction").val(); |
| | | if(introduction==""){ |
| | | Feng.info("请输入赛事简介"); |
| | | return; |
| | | } |
| | | |
| | | var coverDrawing = $("#coverDrawing").val(); |
| | | var coverDrawing = $("#coverDrawing").val(); |
| | | var registrationNotes = $("#registrationNotes").val() |
| | | if(registrationNotes==""){ |
| | | Feng.info("请上传报名须知图片"); |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/add", function(data){ |
| | | 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.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("storeId",shopId); |
| | | ajax.set("name",name); |
| | | 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("playPaiCoin",playPaiCoin); |
| | | ajax.set("classPrice",classPrice); |
| | | ajax.set("address",address); |
| | | ajax.set("applicantsNumber",applicantsNumber); |
| | | ajax.set("baseNumber",baseNumber); |
| | | ajax.set("realName",realName); |
| | | ajax.set("coverDrawing",coverDrawing); |
| | | ajax.set("introduction",introduction); |
| | | ajax.set("imgs",introduction); |
| | | ajax.set("registrationNotes",registrationNotes); |
| | | ajax.set("longitude", $("#longitude").val()); |
| | | ajax.set("latitude", $("#latitude").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TCarInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | var pCode = $("#pCode").val(); |
| | | if(pCode==""){ |
| | | Feng.info("请选择省"); |
| | | return; |
| | | } |
| | | var cCode = $("#cCode").val(); |
| | | if(cCode==""){ |
| | | Feng.info("请选择市"); |
| | | return; |
| | | } |
| | | var shopId = $("#shopId").val(); |
| | | var name = $("#name").val(); |
| | | if(name==""){ |
| | | Feng.info("请输入赛事名称"); |
| | | return; |
| | | } |
| | | var startTime = $("#startTime").val(); |
| | | console.log(startTime) |
| | | if(startTime==""){ |
| | | Feng.info("请选择开始时间"); |
| | | return; |
| | | } |
| | | var endTime = $("#endTime").val(); |
| | | if(endTime==""){ |
| | | Feng.info("请选择结束时间"); |
| | | 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(); |
| | | var playPaiCoin = $("#playPaiCoin").val(); |
| | | var classPrice = $("#classPrice").val(); |
| | | var address = $("#address").val(); |
| | | if(address==""){ |
| | | Feng.info("请输入参加地点"); |
| | | return; |
| | | } |
| | | var applicantsNumber = $("#applicantsNumber").val(); |
| | | if(applicantsNumber==""){ |
| | | Feng.info("请输入报名人数"); |
| | | return; |
| | | } |
| | | var baseNumber = $("#baseNumber").val(); |
| | | let realName = document.querySelector('input[name="realName"]:checked').value; |
| | | var introduction = $("#introduction").val(); |
| | | if(introduction==""){ |
| | | Feng.info("请输入赛事简介"); |
| | | return; |
| | | } |
| | | |
| | | var coverDrawing = $("#coverDrawing").val(); |
| | | var coverDrawing = $("#coverDrawing").val(); |
| | | var registrationNotes = $("#registrationNotes").val() |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/update", function(data){ |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("修改成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Modify successfully!"); |
| | | }else { |
| | | Feng.success("Mengubah dengan sukses!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("storeId",shopId); |
| | | ajax.set("name",name); |
| | | 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("playPaiCoin",playPaiCoin); |
| | | ajax.set("classPrice",classPrice); |
| | | ajax.set("address",address); |
| | | ajax.set("applicantsNumber",applicantsNumber); |
| | | ajax.set("baseNumber",baseNumber); |
| | | ajax.set("realName",realName); |
| | | ajax.set("coverDrawing",coverDrawing); |
| | | ajax.set("introduction",introduction); |
| | | ajax.set("imgs",introduction); |
| | | ajax.set("registrationNotes",registrationNotes); |
| | | ajax.set("longitude", $("#longitude").val()); |
| | | ajax.set("latitude", $("#latitude").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("1"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("1"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("1"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | TCarInfoDlg.searchByStationName(); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | TCarInfoDlg.oneChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/oneChange", 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>"; |
| | | }); |
| | | $("#twoId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TCarInfoDlg.oneChange = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/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(); |
| | | } |
| | | |
| | | TCarInfoDlg.oneChangeNext = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/oneChangeNext", 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>"; |
| | | }); |
| | | $("#shopId").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | | */ |
| | | TCarInfoDlg.companyTypeClick = function (e) { |
| | | if (1 == e){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == e){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 车辆品牌改变时执行 |
| | | */ |
| | | TCarInfoDlg.brandChange = function (e) { |
| | | var carBrandId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/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(); |
| | | } |
| | | |
| | | /** |
| | | * 专车服务被点击 |
| | | */ |
| | | TCarInfoDlg.zcServerClick = function () { |
| | | var serverBox1 = $('#serverBox1').prop('checked'); |
| | | if (serverBox1){ |
| | | $("#zcModelDiv").show(); |
| | | } else { |
| | | $("#zcModelDiv").hide(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 跨城服务被点击 |
| | | */ |
| | | TCarInfoDlg.kcServerClick = function () { |
| | | var serverBox3 = $('#serverBox3').prop('checked'); |
| | | if (serverBox3){ |
| | | $("#kcModelDiv").show(); |
| | | } else { |
| | | $("#kcModelDiv").hide(); |
| | | } |
| | | } |
| | | var map = new AMap.Map('container', { |
| | | resizeEnable: true, // 允许缩放 |
| | | zoom: 15 // 设置地图的缩放级别,0 - 20 |
| | | }); |
| | | var marker; |
| | | //搜索地图 |
| | | TCarInfoDlg.searchByStationName = function(e,type){ |
| | | var keyword="成都"; |
| | | if(type==2){ |
| | | keyword = $(e).parent().prev().find("input").val(); |
| | | }else { |
| | | if($("#address").val()!=null && $("#address").val()!=''){ |
| | | keyword = $("#address").val(); |
| | | } |
| | | } |
| | | type=1; |
| | | AMap.plugin('AMap.Geocoder', function() { |
| | | var geocoder = new AMap.Geocoder(); |
| | | console.log(geocoder) |
| | | console.log(keyword) |
| | | geocoder.getLocation(keyword, function(status, result) { |
| | | console.log(status,result) |
| | | if (status === 'complete' && result.info === 'OK') { |
| | | // 经纬度 |
| | | var lng = result.geocodes[0].location.lng; |
| | | var lat = result.geocodes[0].location.lat; |
| | | $("#longitude").val(lng) |
| | | $("#latitude").val(lat) |
| | | // 地图实例 |
| | | map = new AMap.Map('container', { |
| | | resizeEnable: true, // 允许缩放 |
| | | center: [lng, lat], // 设置地图的中心点 |
| | | zoom: 15 // 设置地图的缩放级别,0 - 20 |
| | | }); |
| | | //地图画点 |
| | | //addMarker(lng,lat); |
| | | if(type==1 || type==2){ |
| | | showInfoClick(); |
| | | if(lng == null){ |
| | | }else{ |
| | | addMarker(lng,lat); |
| | | } |
| | | }else{ |
| | | addMarker(lng,lat); |
| | | } |
| | | } else { |
| | | console.log('定位失败!'); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | } |
| | | //地图点击事件 |
| | | function showInfoClick(){ |
| | | map.on('click', function (e) { |
| | | addMarker(e.lnglat.getLng(),e.lnglat.getLat()); |
| | | }); |
| | | } |
| | | //删除点 |
| | | function removeMarkers(){ |
| | | if(marker!=null){ |
| | | map.remove(marker); |
| | | } |
| | | |
| | | } |
| | | // 实例化点标记 |
| | | function addMarker(lon,lat) { |
| | | removeMarkers(); |
| | | marker = new AMap.Marker({ |
| | | map: map, |
| | | position: new AMap.LngLat(lon, lat), // 经纬度 |
| | | }); |
| | | //加经纬度 |
| | | $("#lon").val(lon); |
| | | $("#lat").val(lat); |
| | | var lnglatXY = [lon, lat];//地图上所标点的坐标 |
| | | AMap.service('AMap.Geocoder',function() {//回调函数 |
| | | geocoder = new AMap.Geocoder({ |
| | | }); |
| | | geocoder.getAddress(lnglatXY, function (status, result) { |
| | | if (status === 'complete' && result.info === 'OK') { |
| | | //获得了有效的地址信息: |
| | | //即,result.regeocode.formattedAddress |
| | | // alert(result.regeocode.formattedAddress) |
| | | //document.getElementById("address").value=result.regeocode.formattedAddress;//将获取到的地址信息赋值给文本框,保存进数据库 |
| | | |
| | | var address = result.regeocode.formattedAddress; |
| | | var city = result.regeocode.addressComponent.city; |
| | | var province = result.regeocode.addressComponent.province; |
| | | var district = result.regeocode.addressComponent.district; |
| | | $("#address").val(address); |
| | | } else { |
| | | //获取地址失败 |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | |
| | | */ |
| | | TCoupon.openChange = function () { |
| | | if (this.check()){ |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '编辑', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCouponManage/tCouponManage_add' |
| | | let id = TCoupon.seItem.id |
| | | let name = TCoupon.seItem.name |
| | | let quantityIssued = TCoupon.seItem.quantityIssued |
| | | let pickUpQuantity = TCoupon.seItem.pickUpQuantity |
| | | let illustrate = TCoupon.seItem.illustrate |
| | | let hasPickQty = TCoupon.seItem.hasPickQty |
| | | var index = layer.load(1,{ |
| | | 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" >' + |
| | | ' <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' + |
| | | ' <label class="form-control" id="name" >'+name+'</label> '+ |
| | | ' </div>\n' + |
| | | ' </div>\n'+ |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">发放数量:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="form-control" id="num" value="'+quantityIssued+'" > '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">限领数量:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="form-control" id="num1" value="'+pickUpQuantity+'" > '+ |
| | | ' </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 class="form-control" id="text" >'+illustrate+'</textarea> '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>' |
| | | , btn: ['关闭', '保存'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | ,load:1 |
| | | , yes: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | btn2:function () { |
| | | let num = $("#num").val() |
| | | if(num==''){ |
| | | Feng.info("请输入发放数量") |
| | | return false; |
| | | } |
| | | let num1 = $("#num1").val() |
| | | if(num1==''){ |
| | | Feng.info("请输入限领数量") |
| | | return false; |
| | | } |
| | | let text = $("#text").val() |
| | | if(text==''){ |
| | | Feng.info("请输入优惠券说明") |
| | | return false; |
| | | } |
| | | |
| | | if(num<hasPickQty){ |
| | | Feng.info("发放数量不能小于已领取数量") |
| | | return false; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/update", function (data) { |
| | | if (data.code == 200) { |
| | | Feng.success("操作成功!"); |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | } else if(data=="repeat"){ |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | Feng.error("请勿重复操作"); |
| | | }else { |
| | | return Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("操作失败!") |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | return Feng.error("操作失败!"); |
| | | }); |
| | | ajax.set("id", id); |
| | | ajax.set("num", num); |
| | | ajax.set("num1", num1); |
| | | ajax.set("text", text); |
| | | ajax.start(); |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | |
| | | /** |
| | | * 上架 |
| | | */ |
| | | TCoupon.onShelf = function () { |
| | | |
| | | |
| | | }; |
| | | |
| | | |
| | | /** |
| | |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCouponManage/coupon_detail/' + TCoupon.seItem.id |
| | |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCoupon.onShelf = function (e) { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/onShelf", function(data){ |
| | | if(data.code==200){ |
| | | Feng.success("操作成功!") |
| | | TCoupon.table.refresh(); |
| | | } |
| | | },function(data){ |
| | | Feng.error("操作失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",TCoupon.seItem.id) |
| | | ajax.set("type",e) |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | |
| | | var couponInfoDlg = { |
| | | couponInfoData: {}, |
| | | goodsPicArray: [], //商品图片数组 |
| | | goodsCover: '' //商品封面图 |
| | | goodsCover: '', //商品封面图 |
| | | storeIds: [], |
| | | }; |
| | | |
| | | /** |
| | |
| | | |
| | | var num = 0; |
| | | couponInfoDlg.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" + |
| | |
| | | " </div>"; |
| | | $("#cityDemo").append($(a)); |
| | | getProvince(num); |
| | | num=num+1 |
| | | } |
| | | |
| | | |
| | | couponInfoDlg.selecUserOpt = function (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){ |
| | | 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 idValue = row.find('#id').val(); |
| | | var index = this.storeIds.indexOf(idValue.toString()); |
| | | if (index !== -1) { |
| | | this.storeIds.splice(index, 1); |
| | | } |
| | | $(e).parent().parent().remove(); |
| | | console.log('storeIds',this.storeIds) |
| | | } |
| | | |
| | | |
| | | couponInfoDlg.delete = function (o) { |
| | |
| | | */ |
| | | couponInfoDlg.addSubmit = function () { |
| | | |
| | | var resultData = {}; |
| | | // 用户权限 |
| | | var userType = $('#userType').val(); |
| | | var cityIds = []; |
| | | // 优惠券名称 |
| | | var couponName = $('#name').val; |
| | | var couponName = $('#name').val(); |
| | | // 优惠券类型 |
| | | var prescription = $('#prescription').val(); |
| | | // 说明 |
| | |
| | | // 有效期 |
| | | var periodOfValidity = $('#periodOfValidity').val(); |
| | | |
| | | if (userType === '1'){ |
| | | // 平台管理员 |
| | | // 兑换方式:积分+现金 |
| | | let exchangeMethod = $(':radio[name="exchangeMethod"]:checked').val(); |
| | | let exchangeMethod = $(':radio[name="exchangeMethod"]:checked').val(); |
| | | |
| | | if (exchangeMethod === 1){ |
| | | var requiredCash = $('#requiredCash').val(); |
| | | |
| | | var company = $('#company').val(); |
| | | if (company === '2'){ |
| | | var myselect=document.getElementById('cityData'); |
| | | var seCity = myselect.options[myselect.selectedIndex].value; |
| | | if (seCity === null || seCity === undefined || seCity === ''){ |
| | | return Feng.error('请选中一个省市'); |
| | | } |
| | | if (exchangeMethod === 2){ |
| | | var requiredCash = $('#requiredCash').val; |
| | | |
| | | cityIds.push(seCity); |
| | | if (this.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); |
| | | } |
| | | } |
| | | } |
| | | if (exchangeMethod === 3){ |
| | | |
| | | } |
| | | var goodImg = this.goodsCover; |
| | | var goodImgs = this.goodsPicArray; |
| | | // 适用范围 全国+指定城市+指定门店 |
| | | let company = $(':radio[name="company"]:checked').val() |
| | | if (company === 2){ |
| | | |
| | | } |
| | | if (company === 3){ |
| | | |
| | | } |
| | | |
| | | commitAJAX(resultData); |
| | | } |
| | | if (userType === '2'){ |
| | | // 城市管理员 |
| | | |
| | | if (company === '3'){ |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | function commitAJAX(obj){ |
| | | console.log('11111111') |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/commitData", function (data) { |
| | |
| | | }, function (data) { |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("dataResult", JSON.parse(obj)); |
| | | ajax.set("userType",1); |
| | | ajax.set("cityManagerId",1); |
| | | ajax.set("couponName",couponName); |
| | | ajax.set("prescription",prescription); |
| | | ajax.set("condition",$('#conditionalAmount').val()); |
| | | ajax.set("subtraction",$('#deductionAmount').val()); |
| | | ajax.set("discount",$('#voucherAmount').val()); |
| | | ajax.set("experience",$('#experienceName').val()); |
| | | ajax.set("illustrate",illustrate); |
| | | ajax.set("distributionMethod",distributionMethod); |
| | | ajax.set("requiredPoints",requiredPoints); |
| | | ajax.set("requiredCash",requiredCash); |
| | | ajax.set("userGroup",userGroup); |
| | | ajax.set("quantityIssued",quantityIssued); |
| | | ajax.set("pickUpQuantity",pickUpQuantity); |
| | | ajax.set("periodOfValidity",periodOfValidity); |
| | | ajax.set("exchangeMethod",exchangeMethod); |
| | | ajax.set("goodImg",this.goodsCover); |
| | | ajax.set("goodImgs",this.goodsPicArray); |
| | | ajax.set("company",$('#company').val()); |
| | | ajax.set("cityIds",cityIds); |
| | | ajax.set("storeIds",this.storeIds); |
| | | ajax.start(); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | $(function () { |
| | | getProvince(null); |
| | | radio1(); |
| | | var OBJradio = document.getElementsByName("prescription") |
| | | for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio |
| | | if ($("#t1").val() == OBJradio[i].value) {//判断是否与radio的值相同 |
| | | OBJradio[i].checked = true//修改选中状态 |
| | | } |
| | | } |
| | | |
| | | var OBJradio = document.getElementsByName("distributionMethod") |
| | | for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio |
| | | if ($("#t2").val() == OBJradio[i].value) {//判断是否与radio的值相同 |
| | | OBJradio[i].checked = true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio = document.getElementsByName("exchangeMethod") |
| | | for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio |
| | | if ($("#t3").val() == OBJradio[i].value) {//判断是否与radio的值相同 |
| | | OBJradio[i].checked = true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio = document.getElementsByName("userGroup") |
| | | for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio |
| | | if ($("#t4").val() == OBJradio[i].value) {//判断是否与radio的值相同 |
| | | OBJradio[i].checked = true//修改选中状态 |
| | | } |
| | | } |
| | | var OBJradio = document.getElementsByName("company") |
| | | for (i = 0; i < OBJradio.length; i++) {//循环查找这个radio |
| | | if ($("#t5").val() == OBJradio[i].value) {//判断是否与radio的值相同 |
| | | OBJradio[i].checked = true//修改选中状态 |
| | | } |
| | | } |
| | | if($("#t5").val() ==2){ |
| | | $("#citySelect").show(); |
| | | } |
| | | if($("#t5").val() ==3){ |
| | | $("#storeSelect").show(); |
| | | } |
| | | if($("#t1").val()==1){ |
| | | console.log(1) |
| | | $("#conditionalAmount").val($("#one").val()) |
| | | $("#deductionAmount").val($("#two").val()) |
| | | } |
| | | if($("#t1").val()==2){ |
| | | radio2() |
| | | $("#voucherAmount").val($("#one").val()) |
| | | } |
| | | if($("#t1").val()==3){ |
| | | console.log(3) |
| | | $("#experienceName").val($("#three").val()) |
| | | } |
| | | |
| | | var userType = $('#userType').val(); |
| | | if (userType === '1'){ |
| | | // 兑换方式 |
New file |
| | |
| | | /** |
| | | * 管理初始化 |
| | | */ |
| | | var TCoupon = { |
| | | id: "TCouponTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCoupon.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: 'phone', visible: true, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '使用状态', field: 'status', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row, index) { |
| | | return {2: "已使用", 1: "未使用"}[value] |
| | | }}, |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCoupon.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCoupon.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加 |
| | | */ |
| | | TCoupon.openAdd = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCouponManage/coupon_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 点击编辑 |
| | | */ |
| | | TCoupon.openChange = function () { |
| | | if (this.check()){ |
| | | let id = TCoupon.seItem.id |
| | | let name = TCoupon.seItem.name |
| | | let quantityIssued = TCoupon.seItem.quantityIssued |
| | | let pickUpQuantity = TCoupon.seItem.pickUpQuantity |
| | | let illustrate = TCoupon.seItem.illustrate |
| | | let hasPickQty = TCoupon.seItem.hasPickQty |
| | | var index = layer.load(1,{ |
| | | 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" >' + |
| | | ' <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' + |
| | | ' <label class="form-control" id="name" >'+name+'</label> '+ |
| | | ' </div>\n' + |
| | | ' </div>\n'+ |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">发放数量:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="form-control" id="num" value="'+quantityIssued+'" > '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' <div class="form-group">\n' + |
| | | ' <label class="col-sm-3 control-label">限领数量:</label>\n' + |
| | | ' <div class="col-sm-9">\n' + |
| | | ' <input class="form-control" id="num1" value="'+pickUpQuantity+'" > '+ |
| | | ' </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 class="form-control" id="text" >'+illustrate+'</textarea> '+ |
| | | ' </div>\n' + |
| | | ' </div>\n' + |
| | | ' </div>' + |
| | | ' </div>' + |
| | | '</div>' |
| | | , btn: ['关闭', '保存'] |
| | | , btnAlign: 'c' //按钮居中 |
| | | , shade: 0.5 //不显示遮罩 |
| | | ,load:1 |
| | | , yes: function () { |
| | | layer.closeAll(); |
| | | }, |
| | | btn2:function () { |
| | | let num = $("#num").val() |
| | | if(num==''){ |
| | | Feng.info("请输入发放数量") |
| | | return false; |
| | | } |
| | | let num1 = $("#num1").val() |
| | | if(num1==''){ |
| | | Feng.info("请输入限领数量") |
| | | return false; |
| | | } |
| | | let text = $("#text").val() |
| | | if(text==''){ |
| | | Feng.info("请输入优惠券说明") |
| | | return false; |
| | | } |
| | | |
| | | if(num<hasPickQty){ |
| | | Feng.info("发放数量不能小于已领取数量") |
| | | return false; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/update", function (data) { |
| | | if (data.code == 200) { |
| | | Feng.success("操作成功!"); |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | } else if(data=="repeat"){ |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | Feng.error("请勿重复操作"); |
| | | }else { |
| | | return Feng.error(data.msg); |
| | | } |
| | | }, function (data) { |
| | | Feng.error("操作失败!") |
| | | window.location.reload(); |
| | | window.parent.layer.closeAll(); |
| | | return Feng.error("操作失败!"); |
| | | }); |
| | | ajax.set("id", id); |
| | | ajax.set("num", num); |
| | | ajax.set("num1", num1); |
| | | ajax.set("text", text); |
| | | ajax.start(); |
| | | layer.closeAll(); |
| | | } |
| | | }); |
| | | |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 上架 |
| | | */ |
| | | |
| | | |
| | | /** |
| | | * 下架 |
| | | */ |
| | | TCoupon.offShelf = function () { |
| | | |
| | | |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 打开查看详情 |
| | | */ |
| | | TCoupon.openDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCouponManage/coupon_detail/' + TCoupon.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 打开领取记录 |
| | | */ |
| | | TCoupon.openCollectionRecord = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['800px', '420px'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCouponManage/coupon_record/' + TCoupon.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCoupon.updateType = function () { |
| | | if (this.check()) { |
| | | if(TCoupon.seItem.status==2){ |
| | | Feng.info("该券已核销") |
| | | return false; |
| | | } |
| | | var ajax = new $ax(Feng.ctxPath + "/tCouponManage/updateType", function(data){ |
| | | if(data.code==200){ |
| | | Feng.success("核销成功!") |
| | | TCoupon.table.refresh(); |
| | | } |
| | | },function(data){ |
| | | Feng.error("核销失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",TCoupon.seItem.id) |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TCoupon.search = function () { |
| | | var queryData = {}; |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['type'] = $("#type").val(); |
| | | queryData['phone'] = $("#state").val(); |
| | | TCoupon.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 重置搜索 |
| | | */ |
| | | TCoupon.resetSearch = function () { |
| | | $("#name").val(''); |
| | | $("#type").val(''); |
| | | $("#phone").val(''); |
| | | TCoupon.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCoupon.initColumn(); |
| | | var table = new BSTable(TCoupon.id, "/tCouponManage/listRecord?id="+$("#id").val(), defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TCoupon.table = table.init(); |
| | | }); |
| | |
| | | id: "TStoreProvinceTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | layerIndex: -1, |
| | | storeList: [] |
| | | }; |
| | | |
| | | /** |
| | |
| | | */ |
| | | TStoreProvince.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {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'}, |
| | |
| | | }; |
| | | |
| | | |
| | | function storeOfClosePage(){ |
| | | parent.layer.close(window.parent.couponInfoDlg.layerIndex); |
| | | TStoreProvince.storeOfClosePage = function (){ |
| | | parent.layer.close(parent.layer.getFrameIndex(window.frameElement.id)); |
| | | } |
| | | |
| | | function saveSelectStores(){ |
| | | 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.couponInfoDlg.selecUserOpt(arr); |
| | | TStoreProvince.storeOfClosePage(); |
| | | |
| | | } |
| | | |
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 TCompetition = { |
| | | id: "TCompetitionTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '商品类型', field: 'province', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '商品名称', field: 'city', 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: 'state', visible: true, align: 'center', valign: 'middle' |
| | | |
| | | }, |
| | | {title: '用户人群', field: 'state', visible: true, align: 'center', valign: 'middle' |
| | | |
| | | }, |
| | | {title: '发放数量', field: 'state', visible: true, align: 'center', valign: 'middle' |
| | | |
| | | }, |
| | | {title: '限领数量', field: 'state', visible: true, align: 'center', valign: 'middle' |
| | | |
| | | }, |
| | | {title: '已领数量', field: 'state', visible: true, align: 'center', valign: 'middle' |
| | | |
| | | }, |
| | | {title: '已兑换数量', field: 'state', visible: true, align: 'center', valign: 'middle' |
| | | |
| | | }, |
| | | {title: '排序', field: 'state', visible: true, align: 'center', valign: 'middle' |
| | | |
| | | }, |
| | | {title: '活动状态', field: 'state', visible: true, align: 'center', valign: 'middle' |
| | | |
| | | }, |
| | | {title: '可售状态', field: 'state', visible: true, align: 'center', valign: 'middle' |
| | | |
| | | }, |
| | | ]; |
| | | }; |
| | | 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 |
| | | } |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCompetition.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCompetition.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加车辆管理 |
| | | */ |
| | | TCompetition.openAddTCompetition = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '添加', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tGoods/tGoods_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看车辆管理详情 |
| | | */ |
| | | TCompetition.openTCompetitionDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tCity/tCity_update/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | TCompetition.delete = function () { |
| | | if (this.check()) { |
| | | var nickname = TCompetition.seItem.carLicensePlate; |
| | | if (nickname == "" || nickname == null || nickname == undefined){ |
| | | nickname = "该车辆"; |
| | | }else{ |
| | | nickname = "【"+nickname+"】"; |
| | | } |
| | | swal({ |
| | | title: language==1?"您是否确认删除" + nickname + "?":(language==2?"Are you sure to delete the" + nickname + "?":"Apakah Anda pasti akan menghapus" + nickname + "?"), |
| | | text: language==1?"请谨慎操作!":(language==2?' Please operate with caution!':'Harap beroperasi dengan hati -hati!'), |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: language==1?"删除":(language==2?'Delete':'Hapus'), |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/TCompetition/delete", function (data) { |
| | | if(language==1){ |
| | | swal("删除成功", "您已经成功删除了" + nickname + "。", "success"); |
| | | }else if(language==2){ |
| | | swal("Delete succeeded!", "You have successfully deleted it" + nickname + "。", "success"); |
| | | }else { |
| | | swal("Hapus berhasil!", "Anda berhasil menghapus" + nickname + "。", "success"); |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | if(language==1){ |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | }else if(language==2){ |
| | | swal("Failed to delete", data.responseJSON.message + "!", "warning"); |
| | | }else { |
| | | swal("Hapus Gagal", data.responseJSON.message + "!", "warning"); |
| | | } |
| | | |
| | | }); |
| | | ajax.set("TCompetitionId",TCompetition.seItem.id); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | TCompetition.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/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(); |
| | | } |
| | | |
| | | TCompetition.freeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/freeze", function (data) { |
| | | Feng.success("冻结成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("冻结失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.unfreeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/unfreeze", function (data) { |
| | | Feng.success("解冻成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("解冻失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.reload = function () { |
| | | if (this.check()) { |
| | | let id = this.seItem.id |
| | | var operation = function(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/pwd", function (data) { |
| | | Feng.success("重置成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("重置失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.start(); |
| | | } |
| | | Feng.confirm("确认重置密码?重置后密码为:a123456", operation); |
| | | } |
| | | |
| | | }; |
| | | |
| | | TCompetition.carInsurance = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'车辆保险':(language==2?'Vehicle insurance':'Asuransi kendaraan'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/TCompetition/carInsurance?carId=' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCompetition.search = function () { |
| | | var queryData = {}; |
| | | queryData['provinceCode'] = $("#pCode").val(); |
| | | queryData['cityCode'] = $("#cCode").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | TCompetition.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TCompetition.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#name").val(""); |
| | | $("#phone").val(""); |
| | | TCompetition.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | var table = new BSTable(TCompetition.id, "/tCity/list", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TCompetition.table = table.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 下载模板 |
| | | */ |
| | | TCompetition.uploadCarModel = function () { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/uploadCarModel"; |
| | | } |
| | | |
| | | var agreement = function(){ |
| | | this.init = function(){ |
| | | //模拟上传excel |
| | | $("#uploadEventBtn").unbind("click").bind("click",function(){ |
| | | $("#uploadEventFile").click(); |
| | | }); |
| | | }; |
| | | } |
| | | /** |
| | | * 导入合同 |
| | | */ |
| | | TCompetition.exporTCompetition = function () { |
| | | var uploadEventFile = $("#uploadEventFile").val(); |
| | | if(uploadEventFile == ''){ |
| | | if(language==1){ |
| | | Feng.info("请选择Excel,再上传"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select Excel and upload"); |
| | | }else { |
| | | Feng.info("Silakan pilih Excel dan upload"); |
| | | } |
| | | }else if(uploadEventFile.lastIndexOf(".xls")<0){//可判断以.xls和.xlsx结尾的excel |
| | | if(language==1){ |
| | | Feng.info("只能上传Excel文件"); |
| | | }else if(language==2){ |
| | | Feng.info("Only Excel files can be uploaded"); |
| | | }else { |
| | | Feng.info("Hanya berkas Excel yang dapat diunggah"); |
| | | } |
| | | }else{ |
| | | var url = Feng.ctxPath + '/TCompetition/exporTCompetition'; |
| | | var file = document.querySelector('input[name=file]').files[0]; |
| | | var reader = new FileReader(); |
| | | if (file) { |
| | | var formData = new FormData(); |
| | | formData.append("myfile", file); |
| | | this.sendAjaxRequest(url, 'POST', formData); |
| | | } |
| | | } |
| | | } |
| | | TCompetition.sendAjaxRequest = function(url,type,data){ |
| | | $.ajax({ |
| | | url : url, |
| | | type : type, |
| | | data : data, |
| | | success : function(result) { |
| | | if(result.code==500) { |
| | | Feng.info(result.message); |
| | | }else { |
| | | if(language==1){ |
| | | Feng.success("导入成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("SUCCESSFUL IMPORT!"); |
| | | }else { |
| | | Feng.success("Import berhasil!"); |
| | | } |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, |
| | | error : function() { |
| | | if(language==1){ |
| | | Feng.error("excel上传失败!"); |
| | | }else if(language==2){ |
| | | Feng.error("Uploading excel Fails. Procedure!"); |
| | | }else { |
| | | Feng.error("Gagal mengunggah excel!"); |
| | | } |
| | | }, |
| | | cache : false, |
| | | contentType : false, |
| | | processData : false |
| | | }); |
| | | }; |
| | | |
| | | var agreement; |
| | | $(function(){ |
| | | agreement = new agreement(); |
| | | agreement.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 导出车辆操作 |
| | | */ |
| | | TCompetition.ouTCompetition = function () { |
| | | var operation = function() { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/ouTCompetition"; |
| | | }; |
| | | if(language==1){ |
| | | Feng.confirm("是否确认导出车辆信息?", operation); |
| | | }else if(language==2){ |
| | | Feng.confirm("Are you sure to export vehicle information?", operation); |
| | | }else { |
| | | Feng.confirm("Apakah Anda pasti akan mengekspor informasi kendaraan?", operation); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 初始化车辆管理详情对话框 |
| | | */ |
| | | var language=1; |
| | | var TCarInfoDlg = { |
| | | tCarInfoData : {}, |
| | | validateFields: { |
| | | }, |
| | | goodsPicArray:[], |
| | | storeIds: [], |
| | | |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TCarInfoDlg.validate = function () { |
| | | $('#carInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#carInfoForm').bootstrapValidator('validate'); |
| | | return $("#carInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TCarInfoDlg.clearData = function() { |
| | | this.tCarInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.set = function(key, val) { |
| | | this.tCarInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TCarInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TCarInfoDlg.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; |
| | | } |
| | | TCarInfoDlg.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(); |
| | | TCarInfoDlg.storeIds.splice(TCarInfoDlg.storeIds.indexOf(value), 1) |
| | | $(e).parent().parent().remove(); |
| | | console.log('storeIds',TCarInfoDlg.storeIds) |
| | | } |
| | | TCarInfoDlg.delete = function (o) { |
| | | $(o).parent("div").remove() |
| | | } |
| | | var num = 0; |
| | | TCarInfoDlg.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=\"TCarInfoDlg.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(); |
| | | } |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TCarInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/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.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TCarInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode==''){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode==''){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("管理员姓名不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("管理员手机号不能为空") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/update", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("改账号已经存在"); |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("修改成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Modify successfully!"); |
| | | }else { |
| | | Feng.success("Mengubah dengan sukses!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | getProvince(null); |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("cover"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | TCarInfoDlg.editor = UE.getEditor('editor'); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | TCarInfoDlg.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(); |
| | | } |
| | | |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | | */ |
| | | TCarInfoDlg.companyTypeClick = function (e) { |
| | | if (1 == e){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == e){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 车辆品牌改变时执行 |
| | | */ |
| | | TCarInfoDlg.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(); |
| | | } |
| | | |
| | | /** |
| | | * 专车服务被点击 |
| | | */ |
| | | TCarInfoDlg.zcServerClick = function () { |
| | | var serverBox1 = $('#serverBox1').prop('checked'); |
| | | if (serverBox1){ |
| | | $("#zcModelDiv").show(); |
| | | } else { |
| | | $("#zcModelDiv").hide(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 跨城服务被点击 |
| | | */ |
| | | TCarInfoDlg.kcServerClick = function () { |
| | | var serverBox3 = $('#serverBox3').prop('checked'); |
| | | if (serverBox3){ |
| | | $("#kcModelDiv").show(); |
| | | } else { |
| | | $("#kcModelDiv").hide(); |
| | | } |
| | | } |
New file |
| | |
| | | var map = new AMap.Map('container',{ |
| | | resizeEnable: true, |
| | | zoom:10 |
| | | }); |
| | | |
| | | |
| | | var value = ""; |
| | | map.getCity( |
| | | callback=function (result) { |
| | | value = result.city; |
| | | drawBounds(); |
| | | } |
| | | ); |
| | | |
| | | |
| | | var mouseTool = new AMap.MouseTool(map); |
| | | //监听draw事件可获取画好的覆盖物 |
| | | var overlays = []; |
| | | var name = null; |
| | | var coordinate = '';//存储坐标 |
| | | var objs = {//存储各种类型的覆盖物对象 |
| | | "polyline":[], |
| | | "polygon":[], |
| | | "rectangle":[], |
| | | "circle":[] |
| | | }; |
| | | var editors = []; |
| | | mouseTool.on('draw',function(e){ |
| | | overlays.push(e.obj); |
| | | |
| | | switch (name) { |
| | | case 'polyline':{//折线图 |
| | | var polyline = e.obj.getPath(); |
| | | getCoordinate(polyline); |
| | | objs.polyline.push(e.obj); |
| | | break; |
| | | } |
| | | case 'polygon':{//多边形 |
| | | var polygon = e.obj.getPath(); |
| | | getCoordinate(polygon); |
| | | objs.polygon.push(e.obj); |
| | | break; |
| | | } |
| | | case 'rectangle':{//矩形 |
| | | var rectangle = e.obj.getPath(); |
| | | getCoordinate(rectangle); |
| | | objs.rectangle.push(e.obj); |
| | | break; |
| | | } |
| | | case 'circle':{//圆形 |
| | | var center = e.obj.getCenter(); |
| | | var radius = e.obj.getRadius(); |
| | | if(radius > 5000){ |
| | | Feng.error("创建电子围栏失败,圆半径不能大于5000米"); |
| | | return; |
| | | } |
| | | coordinate += center.lng + ',' + center.lat + ';' + radius + "_"; |
| | | objs.circle.push(e.obj); |
| | | break; |
| | | } |
| | | } |
| | | }) |
| | | |
| | | |
| | | var district = null; |
| | | var polygons=[]; |
| | | function drawBounds() { |
| | | if(value == ''){ |
| | | value = '北京市'; |
| | | } |
| | | |
| | | //加载行政区划插件 |
| | | if(!district){ |
| | | //实例化DistrictSearch |
| | | var opts = { |
| | | subdistrict: 0, //获取边界不需要返回下级行政区 |
| | | extensions: 'all', //返回行政区边界坐标组等具体信息 |
| | | level: 'district' //查询行政级别为 市 |
| | | }; |
| | | district = new AMap.DistrictSearch(opts); |
| | | } |
| | | //行政区查询 |
| | | district.setLevel(document.getElementById('level').value) |
| | | district.search(value, function(status, result) { |
| | | map.remove(polygons)//清除上次结果 |
| | | polygons = []; |
| | | var bounds = result.districtList[0].boundaries; |
| | | if (bounds) { |
| | | for (var i = 0, l = bounds.length; i < l; i++) { |
| | | //生成行政区划polygon |
| | | var polygon = new AMap.Polygon({ |
| | | strokeWeight: 1, |
| | | path: bounds[i], |
| | | fillOpacity: 0.4, |
| | | fillColor: '#80d8ff', |
| | | strokeColor: '#0091ea' |
| | | }); |
| | | polygons.push(polygon); |
| | | } |
| | | } |
| | | map.add(polygons) |
| | | map.setFitView(polygons);//视口自适应 |
| | | }); |
| | | } |
| | | |
| | | document.getElementById('find').onclick = function () { |
| | | value = document.getElementById('district').value; |
| | | if(value == ''){ |
| | | value = "北京市"; |
| | | } |
| | | drawBounds() |
| | | }; |
| | | document.getElementById('district').onkeydown = function(e) { |
| | | if (e.keyCode === 13) { |
| | | value = document.getElementById('district').value; |
| | | if(value == ''){ |
| | | value = "北京市"; |
| | | } |
| | | drawBounds(); |
| | | return false; |
| | | } |
| | | return true; |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | //处理坐标结果 |
| | | function getCoordinate(arr){ |
| | | var str = ''; |
| | | for(var i = 0; i < arr.length; i++){ |
| | | var lng = arr[i].lng; |
| | | var lat = arr[i].lat; |
| | | str += lng + ',' + lat + ';'; |
| | | } |
| | | coordinate += str.substring(0, str.length - 1) + "_"; |
| | | } |
| | | |
| | | |
| | | function draw(type){ |
| | | switch(type){ |
| | | case 'marker':{ |
| | | mouseTool.marker({ |
| | | //同Marker的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | case 'polyline':{ |
| | | mouseTool.polyline({ |
| | | strokeColor:'#80d8ff' |
| | | //同Polyline的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | case 'polygon':{ |
| | | mouseTool.polygon({ |
| | | fillColor:'#00b0ff', |
| | | strokeColor:'#80d8ff' |
| | | //同Polygon的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | case 'rectangle':{ |
| | | mouseTool.rectangle({ |
| | | fillColor:'#00b0ff', |
| | | strokeColor:'#80d8ff' |
| | | //同Polygon的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | case 'circle':{ |
| | | mouseTool.circle({ |
| | | fillColor:'#00b0ff', |
| | | strokeColor:'#80d8ff' |
| | | //同Circle的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | var radios = document.getElementsByName('func'); |
| | | for(var i=0;i<radios.length;i+=1){ |
| | | radios[i].onchange = function(e){ |
| | | draw(e.target.value) |
| | | name = e.target.value; |
| | | } |
| | | } |
| | | // draw('marker') |
| | | |
| | | document.getElementById('clear').onclick = function(){ |
| | | map.remove(overlays) |
| | | overlays = []; |
| | | coordinate = ''; |
| | | objs.circle = []; |
| | | objs.rectangle = []; |
| | | objs.polygon = []; |
| | | objs.polyline = []; |
| | | closeEdit(); |
| | | } |
| | | document.getElementById('close').onclick = function(){ |
| | | mouseTool.close()//关闭,并清除覆盖物 |
| | | for(var i=0;i<radios.length;i+=1){ |
| | | radios[i].checked = false; |
| | | } |
| | | closeEdit(); |
| | | } |
| | | |
| | | |
| | | //点击提交处理函数 |
| | | function submitCoordinate(){ |
| | | var name = $('#addressName').val(); |
| | | if('' == name){ |
| | | Feng.error('请填写地址名称'); |
| | | return; |
| | | } |
| | | if('' == coordinate){ |
| | | Feng.error('请在地图上规划区域'); |
| | | return; |
| | | } |
| | | coordinate = coordinate.substring(0, coordinate.length - 1); |
| | | |
| | | } |
| | | |
| | | function editAll() { |
| | | coordinate = ''; |
| | | editors = []; |
| | | //折线 |
| | | for(var i in objs.polyline){ |
| | | var polyline = objs.polyline[i]; |
| | | var polyEditor = new AMap.PolyEditor(map, polyline) |
| | | polyEditor.on('addnode', function(event) { |
| | | // log.info('触发事件:addnode') |
| | | }) |
| | | |
| | | polyEditor.on('adjust', function(event) { |
| | | // log.info('触发事件:adjust') |
| | | }) |
| | | |
| | | polyEditor.on('removenode', function(event) { |
| | | // log.info('触发事件:removenode') |
| | | }) |
| | | |
| | | polyEditor.on('end', function(e) { |
| | | var polyline = e.target.getPath(); |
| | | getCoordinate(polyline); |
| | | }) |
| | | editors.push(polyEditor); |
| | | polyEditor.open(); |
| | | } |
| | | |
| | | //多边形 |
| | | for(var i in objs.polygon){ |
| | | var polygon = objs.polygon[i]; |
| | | var polyEditor = new AMap.PolyEditor(map, polygon) |
| | | |
| | | polyEditor.on('addnode', function(event) { |
| | | // log.info('触发事件:addnode') |
| | | }) |
| | | |
| | | polyEditor.on('adjust', function(event) { |
| | | // log.info('触发事件:adjust') |
| | | }) |
| | | |
| | | polyEditor.on('removenode', function(event) { |
| | | // log.info('触发事件:removenode') |
| | | }) |
| | | |
| | | polyEditor.on('end', function(e) { |
| | | var polygon = e.target.getPath(); |
| | | getCoordinate(polygon); |
| | | }) |
| | | editors.push(polyEditor); |
| | | polyEditor.open(); |
| | | } |
| | | |
| | | |
| | | //矩形 |
| | | for(var i in objs.rectangle){ |
| | | var rectangle = objs.rectangle[i]; |
| | | var rectangleEditor = new AMap.RectangleEditor(map, rectangle) |
| | | |
| | | rectangleEditor.on('adjust', function(event) { |
| | | // log.info('触发事件:adjust') |
| | | }) |
| | | |
| | | rectangleEditor.on('end', function(e) { |
| | | var polygon = e.target.getPath(); |
| | | getCoordinate(polygon); |
| | | }) |
| | | editors.push(rectangleEditor); |
| | | rectangleEditor.open(); |
| | | } |
| | | |
| | | //圆形 |
| | | for(var i in objs.circle){ |
| | | var circle = objs.circle[i]; |
| | | var circleEditor = new AMap.CircleEditor(map, circle) |
| | | |
| | | circleEditor.on('move', function(event) { |
| | | // log.info('触发事件:move') |
| | | }) |
| | | |
| | | circleEditor.on('adjust', function(e) { |
| | | var radius = e.target.getRadius(); |
| | | if(radius > 5000){ |
| | | Feng.error("创建电子围栏失败,圆半径不能大于5000米"); |
| | | return; |
| | | } |
| | | }) |
| | | |
| | | circleEditor.on('end', function(e) { |
| | | var center = e.target.getCenter(); |
| | | var radius = e.target.getRadius(); |
| | | coordinate += center.lng + ',' + center.lat + ';' + radius + "_"; |
| | | }) |
| | | editors.push(circleEditor); |
| | | circleEditor.open(); |
| | | } |
| | | } |
| | | |
| | | |
| | | function closeEdit() { |
| | | for(var i in editors){ |
| | | var editor = editors[i]; |
| | | editor.close(); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 跨城站点管理管理初始化 |
| | | */ |
| | | var TSite = { |
| | | id: "TSiteTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TSite.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键ID', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '省', field: 'province', visible: true, align: 'center', valign: 'middle',width:'20%', |
| | | }, |
| | | {title: '市', field: 'city', 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: 'type', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data) { |
| | | return{1:"赠送积分", 2:"兑换商品",3:"完成课后练习",4:"观看教学视频"}[data] |
| | | } |
| | | }, |
| | | {title: '积分明细', field: 'integral', visible: true, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '变动类型', field: 'category', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data) { |
| | | return{1:"增加", 2:"减少"}[data] |
| | | } |
| | | }, |
| | | {title: '时间', field: 'insertTime', visible: true, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: '备注', field: 'remark', visible: true, align: 'center', valign: 'middle', |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TSite.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TSite.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | TSite.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(); |
| | | } |
| | | /** |
| | | * 点击添加跨城站点管理 |
| | | */ |
| | | let language =1 |
| | | TSite.openAdd = function () { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'赠送积分':(language==2?'Add':'Tambahkan'), |
| | | area: ['50%', '50%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tIntegral/tIntegral_add' |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看跨城站点管理详情 |
| | | */ |
| | | TSite.openTSiteDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'编辑':(language==2?'Edit':'Edit'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tSite/tSite_update/' + TSite.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 操作跨城站点管理 |
| | | */ |
| | | TSite.opt = function (type) { |
| | | if (this.check()) { |
| | | var name = TSite.seItem.name; |
| | | if (name == "" || name == null || name == undefined) { |
| | | name = "该站点"; |
| | | } else { |
| | | name = "【" + name + "】"; |
| | | } |
| | | var str = ""; |
| | | var text = "请谨慎操作!"; |
| | | var title = "请谨慎操作!"; |
| | | if (1 == type){ |
| | | str = "删除"; |
| | | title = "您是否确认删除"+name+"?"; |
| | | text = "请谨慎操作,删除后数据无法恢复!"; |
| | | } else if (2 == type){ |
| | | str = "冻结"; |
| | | title = "您是否确认冻结"+name+"?"; |
| | | } else if (3 == type){ |
| | | str = "解冻"; |
| | | title = "您是否确认解冻"+name+"?"; |
| | | } |
| | | if (1 == type){ |
| | | if (TSite.seItem.lineNum != "" && TSite.seItem.lineNum != null && TSite.seItem.lineNum > 0) { |
| | | swal("删除失败", "该站点还有关联线路!", "warning"); |
| | | return; |
| | | } |
| | | } |
| | | if(2 == type){ |
| | | if (TSite.seItem.state != 1) { |
| | | swal("冻结失败", "【正常】状态下才能执行此操作!", "warning"); |
| | | return; |
| | | } |
| | | } |
| | | if (3 == type){ |
| | | if (TSite.seItem.state != 2){ |
| | | swal("解冻失败", "【冻结】状态下才能执行此操作!", "warning"); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | swal({ |
| | | title: title, |
| | | text: text, |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: str, |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/tSite/opt", function (data) { |
| | | swal(str+"成功", "您已经"+str+"了" + name + "。", "success"); |
| | | TSite.table.refresh(); |
| | | }, function (data) { |
| | | swal(str+"失败", data.responseJSON.message + "!", "warning"); |
| | | }); |
| | | ajax.set("tSiteId",TSite.seItem.id); |
| | | ajax.set("optType", type); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 查询跨城站点管理列表 |
| | | */ |
| | | TSite.search = function () { |
| | | var queryData = {}; |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['type'] = $("#type").val(); |
| | | queryData['category'] = $("#category").val(); |
| | | queryData['time'] = $("#time").val(); |
| | | TSite.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TSite.resetSearch = function () { |
| | | $("#name").val(''); |
| | | $("#phone").val(''); |
| | | $("#type").val(''); |
| | | $("#category").val(''); |
| | | $("#time").val(''); |
| | | TSite.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TSite.initColumn(); |
| | | var table = new BSTable(TSite.id, "/tIntegral/list", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TSite.table = table.init(); |
| | | }); |
New file |
| | |
| | | /** |
| | | * 初始化跨城站点管理详情对话框 |
| | | */ |
| | | var TSiteInfoDlg = { |
| | | tSiteInfoData : {}, |
| | | validateFields: { |
| | | name: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '站点名称不能为空' |
| | | } |
| | | } |
| | | }, |
| | | provinceCode: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '请选择站点所属省' |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TSiteInfoDlg.validate = function () { |
| | | $('#siteInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#siteInfoForm').bootstrapValidator('validate'); |
| | | return $("#siteInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TSiteInfoDlg.clearData = function() { |
| | | this.tSiteInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TSiteInfoDlg.set = function(key, val) { |
| | | this.tSiteInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TSiteInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TSiteInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TSite.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TSiteInfoDlg.collectData = function() { |
| | | this |
| | | .set('id') |
| | | .set('name') |
| | | .set('province') |
| | | .set('provinceCode') |
| | | .set('city') |
| | | .set('cityCode') |
| | | .set('district') |
| | | .set('districtCode') |
| | | .set('state') |
| | | .set('insertTime') |
| | | .set('insertUserId'); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TSiteInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | var name = $("#name").val(); |
| | | var provinceCode = $("#provinceCode").val(); |
| | | var cityCode = $("#cityCode").val(); |
| | | var districtCode = $("#districtCode").val(); |
| | | if ("" == provinceCode){ |
| | | Feng.error("请选择所属城市"); |
| | | return; |
| | | } |
| | | var subArr=[]; |
| | | $(".areaValueClass").each(function () { |
| | | subArr.push({ |
| | | id:$(this).find("input[name*='id']").val(), |
| | | areaType:$(this).find("input[name*='areaType1']").val(), |
| | | time:$(this).find("input[name*='time']").val(), |
| | | name:$(this).find("input[name*='name']").val(), |
| | | province:$(this).find("input[name*='province1']").val(), |
| | | provinceCode:$(this).find("input[name*='provinceCode1']").val(), |
| | | city:$(this).find("input[name*='city1']").val(), |
| | | cityCode:$(this).find("input[name*='cityCode1']").val(), |
| | | district:$(this).find("input[name*='district1']").val(), |
| | | districtCode:$(this).find("input[name*='districtCode1']").val(), |
| | | coordinate:$(this).find("input[name*='coordinate1']").val(), |
| | | }) |
| | | }); |
| | | if(subArr.length <= 0){ |
| | | Feng.error("请至少填写一条站点区域"); |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tSite/add", function(data){ |
| | | if(data.status == 200){ |
| | | Feng.success("添加成功!"); |
| | | window.parent.TSite.table.refresh(); |
| | | TSiteInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("name",name); |
| | | ajax.set("provinceCode",provinceCode); |
| | | ajax.set("province",$("#provinceCode option:selected").text()); |
| | | if ("" != cityCode && null != cityCode && undefined != cityCode){ |
| | | ajax.set("cityCode",cityCode); |
| | | ajax.set("city",$("#cityCode option:selected").text()); |
| | | } |
| | | if ("" != districtCode && null != districtCode && undefined != districtCode){ |
| | | ajax.set("districtCode",$("#districtCode").val()); |
| | | ajax.set("district",$("#districtCode option:selected").text()); |
| | | } |
| | | ajax.set("subArr",JSON.stringify(subArr)); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TSiteInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | var name = $("#name").val(); |
| | | var provinceCode = $("#provinceCode").val(); |
| | | var cityCode = $("#cityCode").val(); |
| | | var districtCode = $("#districtCode").val(); |
| | | if ("" == provinceCode){ |
| | | Feng.error("请选择所属城市"); |
| | | return; |
| | | } |
| | | var subArr=[]; |
| | | $(".areaValueClass").each(function () { |
| | | subArr.push({ |
| | | id:$(this).find("input[name*='id']").val(), |
| | | areaType:$(this).find("input[name*='areaType1']").val(), |
| | | time:$(this).find("input[name*='time']").val(), |
| | | name:$(this).find("input[name*='name']").val(), |
| | | province:$(this).find("input[name*='province1']").val(), |
| | | provinceCode:$(this).find("input[name*='provinceCode1']").val(), |
| | | city:$(this).find("input[name*='city1']").val(), |
| | | cityCode:$(this).find("input[name*='cityCode1']").val(), |
| | | district:$(this).find("input[name*='district1']").val(), |
| | | districtCode:$(this).find("input[name*='districtCode1']").val(), |
| | | coordinate:$(this).find("input[name*='coordinate1']").val(), |
| | | }) |
| | | }); |
| | | if(subArr.length <= 0){ |
| | | Feng.error("请至少填写一条站点区域"); |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tSite/update", function(data){ |
| | | Feng.success("修改成功!"); |
| | | window.parent.TSite.table.refresh(); |
| | | TSiteInfoDlg.close(); |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.set("name",name); |
| | | ajax.set("provinceCode",provinceCode); |
| | | ajax.set("province",$("#provinceCode option:selected").text()); |
| | | if ("" != cityCode && null != cityCode && undefined != cityCode){ |
| | | ajax.set("cityCode",cityCode); |
| | | ajax.set("city",$("#cityCode option:selected").text()); |
| | | } |
| | | if ("" != districtCode && null != districtCode && undefined != districtCode){ |
| | | ajax.set("districtCode",$("#districtCode").val()); |
| | | ajax.set("district",$("#districtCode option:selected").text()); |
| | | } |
| | | ajax.set("subArr",JSON.stringify(subArr)); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("siteInfoForm", TSiteInfoDlg.validateFields); |
| | | }); |
| | | |
| | | |
| | | //省改变 |
| | | TSiteInfoDlg.provinceChange = function (e) { |
| | | var provinceCode=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompany/change", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择市</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Please select a city</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih Kota</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cityCode").empty().append(content); |
| | | $("#districtCode").empty().append('<option value="">选择区</option>'); |
| | | } |
| | | }); |
| | | ajax.set("code",provinceCode); |
| | | ajax.start(); |
| | | } |
| | | //市改变 |
| | | TSiteInfoDlg.cityChange = function (e) { |
| | | var cityCode=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompany/change", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择区</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Please select a city</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih Kota</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#districtCode").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("code",cityCode); |
| | | ajax.start(); |
| | | } |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | | */ |
| | | TSiteInfoDlg.areaTypeClick = function (e) { |
| | | if (1 == e){//行政区域 |
| | | $("#areaType1Div").show(); |
| | | $("#areaType2Div").hide(); |
| | | } else if (2 == e){ |
| | | $("#areaType2Div").show(); |
| | | $("#areaType1Div").hide(); |
| | | } |
| | | } |
| | | |
| | | //站点区域省改变 |
| | | TSiteInfoDlg.provinceChange1 = function (e) { |
| | | var provinceCode=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompany/change", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择市</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Please select a city</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih Kota</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#cityCode1").empty().append(content); |
| | | $("#districtCode1").empty().append('<option value="">选择区</option>'); |
| | | } |
| | | }); |
| | | ajax.set("code",provinceCode); |
| | | ajax.start(); |
| | | } |
| | | //站点区域市改变 |
| | | TSiteInfoDlg.cityChange1 = function (e) { |
| | | var cityCode=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompany/change", function(data){ |
| | | if(data!=null){ |
| | | if(language==1){ |
| | | var content='<option value="">选择区</option>'; |
| | | }else if(language==2){ |
| | | var content='<option value="">Please select a city</option>'; |
| | | }else { |
| | | var content='<option value="">Pilih Kota</option>'; |
| | | } |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.code+"'>"+v.name+"</option>"; |
| | | }); |
| | | $("#districtCode1").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("code",cityCode); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 添加区域 |
| | | */ |
| | | TSiteInfoDlg.addArea = function () { |
| | | var areaName = $("#areaName").val(); |
| | | if ("" == areaName || null == areaName){ |
| | | Feng.error("区域名称不能为空"); |
| | | return; |
| | | } |
| | | var areaType = $("input[name='areaType']:checked").val(); |
| | | var b = false; |
| | | $(".areaValueClass").each(function () { |
| | | var areaType1 = $(this).find("input[name*='areaType1']").val(); |
| | | if(areaType != areaType1){ |
| | | b = true; |
| | | return |
| | | } |
| | | }); |
| | | if(b){ |
| | | Feng.error("电子围栏和行政区域不能混合使用"); |
| | | return; |
| | | } |
| | | |
| | | if (1 == areaType){ |
| | | var provinceCode1 = $("#provinceCode1").val(); |
| | | var province1 = $("#provinceCode1 option:selected").text(); |
| | | var cityCode1 = $("#cityCode1").val(); |
| | | var city1 = $("#cityCode1 option:selected").text(); |
| | | var districtCode1 = $("#districtCode1").val(); |
| | | var district1 = $("#districtCode1 option:selected").text(); |
| | | if ("" == provinceCode1){ |
| | | Feng.error("请选择行政区域所属省"); |
| | | return; |
| | | } |
| | | }else if (2 == areaType) { |
| | | if("" == coordinate){ |
| | | Feng.error('请在地图上规划区域'); |
| | | return; |
| | | } |
| | | } |
| | | var subArr=[]; |
| | | $(".areaValueClass").each(function () { |
| | | subArr.push({ |
| | | areaType:$(this).find("input[name*='areaType1']").val(), |
| | | time:$(this).find("input[name*='time']").val(), |
| | | name:$(this).find("input[name*='name']").val(), |
| | | province:$(this).find("input[name*='province1']").val(), |
| | | provinceCode:$(this).find("input[name*='provinceCode1']").val(), |
| | | city:$(this).find("input[name*='city1']").val(), |
| | | cityCode:$(this).find("input[name*='cityCode1']").val(), |
| | | district:$(this).find("input[name*='district1']").val(), |
| | | districtCode:$(this).find("input[name*='districtCode1']").val(), |
| | | coordinate:$(this).find("input[name*='coordinate1']").val(), |
| | | }) |
| | | }); |
| | | var str = '<tr class="areaValueClass">' + |
| | | // '<td>' + (subArr.length+1) + '</td>' + |
| | | '<td style="text-align: center;">' + |
| | | '<input type="hidden" id="areaType1" name="areaType1" value="'+areaType+'">' + |
| | | '<input type="hidden" id="time" name="time" value="'+getNowFormatDate()+'">' + getNowFormatDate() + '</td>' + |
| | | |
| | | '<td style="text-align: center;">' + |
| | | '<input type="hidden" id="name" name="name" value="'+areaName+'">' + |
| | | '<input type="hidden" id="provinceCode1" name="provinceCode1" value="'+provinceCode1+'">' + |
| | | '<input type="hidden" id="province1" name="province1" value="'+province1+'">' + |
| | | '<input type="hidden" id="cityCode1" name="cityCode1" value="'+cityCode1+'">' + |
| | | '<input type="hidden" id="city1" name="city1" value="'+city1+'">' + |
| | | '<input type="hidden" id="districtCode1" name="districtCode1" value="'+districtCode1+'">' + |
| | | '<input type="hidden" id="district1" name="district1" value="'+district1+'">' + |
| | | '<input type="hidden" id="coordinate1" name="coordinate1" value="'+coordinate+'">' + areaName + '</td>' + |
| | | |
| | | '<td style="text-align: center;"><button onclick="deleteSub(this)">移除</button></td></tr>'; |
| | | $("#areaValue").append(str); |
| | | |
| | | //清除电子围栏数据 |
| | | $("#clear").click(); |
| | | } |
| | | //删除数据 |
| | | function deleteSub(e) { |
| | | $(e).parent().parent().remove(); |
| | | } |
| | |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | var role =$("#role").val() |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '省', field: 'province', visible: true, align: 'center', valign: 'middle' |
| | | {title: '省', field: 'province', visible: role==1?true:false, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '市', field: 'city', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '所属账号', field: 'account', visible: true, align: 'center', valign: 'middle' |
| | | {title: '市', field: 'city', visible: role==1?true:false, align: 'center', valign: 'middle'}, |
| | | {title: '所属账号', field: 'account', visible: role==1?true:false, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '门店名称', field: 'name', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | |
| | | */ |
| | | var language=1; |
| | | var TCarInfoDlg = { |
| | | goodsPicArray: [], |
| | | tCarInfoData : {}, |
| | | validateFields: { |
| | | } |
| | |
| | | Feng.info("请上传门店封面") |
| | | return; |
| | | } |
| | | |
| | | let imgOne = $("#imgOne").val() |
| | | |
| | | if(imgOne==''){ |
| | | var goodImgs = this.goodsPicArray; |
| | | 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 ajax = new $ax(Feng.ctxPath + "/tShop/add", function(data){ |
| | | if(data=="5001"){ |
| | |
| | | ajax.set("realPicture",imgOne); |
| | | ajax.start(); |
| | | } |
| | | var map = new AMap.Map('container', { |
| | | resizeEnable: true, // 允许缩放 |
| | | zoom: 15 // 设置地图的缩放级别,0 - 20 |
| | | }); |
| | | var marker; |
| | | //搜索地图 |
| | | TCarInfoDlg.searchByStationName = function(e,type){ |
| | | var keyword="成都"; |
| | | if(type==2){ |
| | | keyword = $(e).parent().prev().find("input").val(); |
| | | }else { |
| | | if($("#address").val()!=null && $("#address").val()!=''){ |
| | | keyword = $("#address").val(); |
| | | } |
| | | } |
| | | type=1; |
| | | AMap.plugin('AMap.Geocoder', function() { |
| | | var geocoder = new AMap.Geocoder(); |
| | | console.log(geocoder) |
| | | console.log(keyword) |
| | | geocoder.getLocation(keyword, function(status, result) { |
| | | console.log(status,result) |
| | | if (status === 'complete' && result.info === 'OK') { |
| | | // 经纬度 |
| | | var lng = result.geocodes[0].location.lng; |
| | | var lat = result.geocodes[0].location.lat; |
| | | $("#longitude").val(lng) |
| | | $("#latitude").val(lat) |
| | | // 地图实例 |
| | | map = new AMap.Map('container', { |
| | | resizeEnable: true, // 允许缩放 |
| | | center: [lng, lat], // 设置地图的中心点 |
| | | zoom: 15 // 设置地图的缩放级别,0 - 20 |
| | | }); |
| | | //地图画点 |
| | | //addMarker(lng,lat); |
| | | if(type==1 || type==2){ |
| | | showInfoClick(); |
| | | if(lng == null){ |
| | | }else{ |
| | | addMarker(lng,lat); |
| | | } |
| | | }else{ |
| | | addMarker(lng,lat); |
| | | } |
| | | } else { |
| | | console.log('定位失败!'); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | } |
| | | //地图点击事件 |
| | | function showInfoClick(){ |
| | | map.on('click', function (e) { |
| | | addMarker(e.lnglat.getLng(),e.lnglat.getLat()); |
| | | }); |
| | | } |
| | | //删除点 |
| | | function removeMarkers(){ |
| | | if(marker!=null){ |
| | | map.remove(marker); |
| | | } |
| | | |
| | | } |
| | | // 实例化点标记 |
| | | function addMarker(lon,lat) { |
| | | removeMarkers(); |
| | | marker = new AMap.Marker({ |
| | | map: map, |
| | | position: new AMap.LngLat(lon, lat), // 经纬度 |
| | | }); |
| | | //加经纬度 |
| | | $("#lon").val(lon); |
| | | $("#lat").val(lat); |
| | | var lnglatXY = [lon, lat];//地图上所标点的坐标 |
| | | AMap.service('AMap.Geocoder',function() {//回调函数 |
| | | geocoder = new AMap.Geocoder({ |
| | | }); |
| | | geocoder.getAddress(lnglatXY, function (status, result) { |
| | | if (status === 'complete' && result.info === 'OK') { |
| | | //获得了有效的地址信息: |
| | | //即,result.regeocode.formattedAddress |
| | | // alert(result.regeocode.formattedAddress) |
| | | //document.getElementById("address").value=result.regeocode.formattedAddress;//将获取到的地址信息赋值给文本框,保存进数据库 |
| | | |
| | | var address = result.regeocode.formattedAddress; |
| | | var city = result.regeocode.addressComponent.city; |
| | | var province = result.regeocode.addressComponent.province; |
| | | var district = result.regeocode.addressComponent.district; |
| | | $("#address").val(address); |
| | | } else { |
| | | //获取地址失败 |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | |
| | | //地图搜索 |
| | | TCarInfoDlg.searchByStationName(); |
| | | }); |
| | | |
| | | /** |
New file |
| | |
| | | /** |
| | | * 车辆管理管理初始化 |
| | | */ |
| | | var TCompetition = { |
| | | id: "TCompetitionTable", //表格id |
| | | seItem: null, //选中的条目 |
| | | table: null, |
| | | layerIndex: -1 |
| | | }; |
| | | var language =1 |
| | | var role =$("#role").val() |
| | | /** |
| | | * 初始化表格的列 |
| | | */ |
| | | TCompetition.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '省', field: 'pname', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '市', field: 'cname', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '门店名称', field: 'shopName', 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: 'score', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | {title: '评价时间', field: 'time', visible: true, align: 'center', valign: 'middle' |
| | | }, |
| | | ]; |
| | | }; |
| | | 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 |
| | | } |
| | | /** |
| | | * 检查是否选中 |
| | | */ |
| | | TCompetition.check = function () { |
| | | var selected = $('#' + this.id).bootstrapTable('getSelections'); |
| | | if(selected.length == 0){ |
| | | Feng.info("请先选中表格中的某一记录!"); |
| | | return false; |
| | | }else{ |
| | | TCompetition.seItem = selected[0]; |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 点击添加车辆管理 |
| | | */ |
| | | TCompetition.updateState = function (e) { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tShopEvaluation/updateState", function (data) { |
| | | if(data.code==200){ |
| | | Feng.success("操作成功") |
| | | }else{ |
| | | Feng.error("操作失败") |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | |
| | | }); |
| | | ajax.set("id",TCompetition.seItem.id); |
| | | ajax.set("state",e); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看车辆管理详情 |
| | | */ |
| | | TCompetition.openTCompetitionDetail = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'编辑', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_update/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.info = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShopEvaluation/tShop_info/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.gift = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'免费福利', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_gift/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | TCompetition.indexSet = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title:'首页设置', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tShop/tShop_indexSet/' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 删除车辆管理 |
| | | */ |
| | | TCompetition.delete = function () { |
| | | if (this.check()) { |
| | | var nickname = TCompetition.seItem.carLicensePlate; |
| | | if (nickname == "" || nickname == null || nickname == undefined){ |
| | | nickname = "该车辆"; |
| | | }else{ |
| | | nickname = "【"+nickname+"】"; |
| | | } |
| | | swal({ |
| | | title: language==1?"您是否确认删除" + nickname + "?":(language==2?"Are you sure to delete the" + nickname + "?":"Apakah Anda pasti akan menghapus" + nickname + "?"), |
| | | text: language==1?"请谨慎操作!":(language==2?' Please operate with caution!':'Harap beroperasi dengan hati -hati!'), |
| | | type: "warning", |
| | | showCancelButton: true, |
| | | confirmButtonColor: "#DD6B55", |
| | | confirmButtonText: language==1?"删除":(language==2?'Delete':'Hapus'), |
| | | closeOnConfirm: true |
| | | }, function () { |
| | | var ajax = new $ax(Feng.ctxPath + "/TCompetition/delete", function (data) { |
| | | if(language==1){ |
| | | swal("删除成功", "您已经成功删除了" + nickname + "。", "success"); |
| | | }else if(language==2){ |
| | | swal("Delete succeeded!", "You have successfully deleted it" + nickname + "。", "success"); |
| | | }else { |
| | | swal("Hapus berhasil!", "Anda berhasil menghapus" + nickname + "。", "success"); |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | if(language==1){ |
| | | swal("删除失败", data.responseJSON.message + "!", "warning"); |
| | | }else if(language==2){ |
| | | swal("Failed to delete", data.responseJSON.message + "!", "warning"); |
| | | }else { |
| | | swal("Hapus Gagal", data.responseJSON.message + "!", "warning"); |
| | | } |
| | | |
| | | }); |
| | | ajax.set("TCompetitionId",TCompetition.seItem.id); |
| | | ajax.start(); |
| | | }); |
| | | } |
| | | }; |
| | | TCompetition.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/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(); |
| | | } |
| | | TCompetition.oneChangeNext = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/oneChangeNext", 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>"; |
| | | }); |
| | | $("#account").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | |
| | | TCompetition.freeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/freeze", function (data) { |
| | | Feng.success("冻结成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("冻结失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.unfreeze = function () { |
| | | if (this.check()) { |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/unfreeze", function (data) { |
| | | Feng.success("解冻成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("解冻失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",this.seItem.id); |
| | | ajax.start(); |
| | | } |
| | | }; |
| | | TCompetition.reload = function () { |
| | | if (this.check()) { |
| | | let id = this.seItem.id |
| | | var operation = function(){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tCity/pwd", function (data) { |
| | | Feng.success("重置成功!"); |
| | | TCompetition.table.refresh(); |
| | | }, function (data) { |
| | | Feng.error("重置失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.start(); |
| | | } |
| | | Feng.confirm("确认重置密码?重置后密码为:a123456", operation); |
| | | } |
| | | |
| | | }; |
| | | |
| | | TCompetition.carInsurance = function () { |
| | | if (this.check()) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: language==1?'车辆保险':(language==2?'Vehicle insurance':'Asuransi kendaraan'), |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/TCompetition/carInsurance?carId=' + TCompetition.seItem.id |
| | | }); |
| | | this.layerIndex = index; |
| | | } |
| | | }; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询车辆管理列表 |
| | | */ |
| | | TCompetition.search = function () { |
| | | var queryData = {}; |
| | | queryData['provinceCode'] = $("#pCode").val(); |
| | | queryData['cityCode'] = $("#cCode").val(); |
| | | queryData['name'] = $("#name").val(); |
| | | queryData['phone'] = $("#phone").val(); |
| | | queryData['shopName'] = $("#shopName").val(); |
| | | TCompetition.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | TCompetition.resetSearch = function () { |
| | | $("#pCode").val(""); |
| | | $("#cCode").val(""); |
| | | $("#name").val(""); |
| | | $("#phone").val(""); |
| | | $("#shopName").val(""); |
| | | TCompetition.search(); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCompetition.initColumn(); |
| | | var table = new BSTable(TCompetition.id, "/tShopEvaluation/list", defaultColunms); |
| | | table.setPaginationType("server"); |
| | | TCompetition.table = table.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 下载模板 |
| | | */ |
| | | TCompetition.uploadCarModel = function () { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/uploadCarModel"; |
| | | } |
| | | |
| | | var agreement = function(){ |
| | | this.init = function(){ |
| | | //模拟上传excel |
| | | $("#uploadEventBtn").unbind("click").bind("click",function(){ |
| | | $("#uploadEventFile").click(); |
| | | }); |
| | | }; |
| | | } |
| | | /** |
| | | * 导入合同 |
| | | */ |
| | | TCompetition.exporTCompetition = function () { |
| | | var uploadEventFile = $("#uploadEventFile").val(); |
| | | if(uploadEventFile == ''){ |
| | | if(language==1){ |
| | | Feng.info("请选择Excel,再上传"); |
| | | }else if(language==2){ |
| | | Feng.info("Please select Excel and upload"); |
| | | }else { |
| | | Feng.info("Silakan pilih Excel dan upload"); |
| | | } |
| | | }else if(uploadEventFile.lastIndexOf(".xls")<0){//可判断以.xls和.xlsx结尾的excel |
| | | if(language==1){ |
| | | Feng.info("只能上传Excel文件"); |
| | | }else if(language==2){ |
| | | Feng.info("Only Excel files can be uploaded"); |
| | | }else { |
| | | Feng.info("Hanya berkas Excel yang dapat diunggah"); |
| | | } |
| | | }else{ |
| | | var url = Feng.ctxPath + '/TCompetition/exporTCompetition'; |
| | | var file = document.querySelector('input[name=file]').files[0]; |
| | | var reader = new FileReader(); |
| | | if (file) { |
| | | var formData = new FormData(); |
| | | formData.append("myfile", file); |
| | | this.sendAjaxRequest(url, 'POST', formData); |
| | | } |
| | | } |
| | | } |
| | | TCompetition.sendAjaxRequest = function(url,type,data){ |
| | | $.ajax({ |
| | | url : url, |
| | | type : type, |
| | | data : data, |
| | | success : function(result) { |
| | | if(result.code==500) { |
| | | Feng.info(result.message); |
| | | }else { |
| | | if(language==1){ |
| | | Feng.success("导入成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("SUCCESSFUL IMPORT!"); |
| | | }else { |
| | | Feng.success("Import berhasil!"); |
| | | } |
| | | } |
| | | TCompetition.table.refresh(); |
| | | }, |
| | | error : function() { |
| | | if(language==1){ |
| | | Feng.error("excel上传失败!"); |
| | | }else if(language==2){ |
| | | Feng.error("Uploading excel Fails. Procedure!"); |
| | | }else { |
| | | Feng.error("Gagal mengunggah excel!"); |
| | | } |
| | | }, |
| | | cache : false, |
| | | contentType : false, |
| | | processData : false |
| | | }); |
| | | }; |
| | | |
| | | var agreement; |
| | | $(function(){ |
| | | agreement = new agreement(); |
| | | agreement.init(); |
| | | }); |
| | | |
| | | /** |
| | | * 导出车辆操作 |
| | | */ |
| | | TCompetition.ouTCompetition = function () { |
| | | var operation = function() { |
| | | window.location.href = Feng.ctxPath + "/TCompetition/ouTCompetition"; |
| | | }; |
| | | if(language==1){ |
| | | Feng.confirm("是否确认导出车辆信息?", operation); |
| | | }else if(language==2){ |
| | | Feng.confirm("Are you sure to export vehicle information?", operation); |
| | | }else { |
| | | Feng.confirm("Apakah Anda pasti akan mengekspor informasi kendaraan?", operation); |
| | | } |
| | | } |
New file |
| | |
| | | /** |
| | | * 初始化车辆管理详情对话框 |
| | | */ |
| | | var language=1; |
| | | var TCarInfoDlg = { |
| | | goodsPicArray: [], |
| | | tCarInfoData : {}, |
| | | validateFields: { |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TCarInfoDlg.validate = function () { |
| | | $('#carInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#carInfoForm').bootstrapValidator('validate'); |
| | | return $("#carInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | | * 清除数据 |
| | | */ |
| | | TCarInfoDlg.clearData = function() { |
| | | this.tCarInfoData = {}; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.set = function(key, val) { |
| | | this.tCarInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; |
| | | return this; |
| | | } |
| | | |
| | | /** |
| | | * 设置对话框中的数据 |
| | | * |
| | | * @param key 数据的名称 |
| | | * @param val 数据的具体值 |
| | | */ |
| | | TCarInfoDlg.get = function(key) { |
| | | return $("#" + key).val(); |
| | | } |
| | | |
| | | /** |
| | | * 关闭此对话框 |
| | | */ |
| | | TCarInfoDlg.close = function() { |
| | | parent.layer.close(window.parent.TCompetition.layerIndex); |
| | | } |
| | | |
| | | /** |
| | | * 收集数据 |
| | | */ |
| | | TCarInfoDlg.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'); |
| | | } |
| | | |
| | | TCarInfoDlg.oneChange = function (e) { |
| | | console.log(111) |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tCompetition/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(); |
| | | } |
| | | TCarInfoDlg.oneChangeNext = function (e) { |
| | | var oneId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/oneChangeNext", 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>"; |
| | | }); |
| | | $("#account").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("oneId",oneId); |
| | | ajax.start(); |
| | | } |
| | | TCarInfoDlg.saveImg = function () { |
| | | var id=$("#id").val(); |
| | | var img=$("#welfarePicture").val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/saveImg", function(data){ |
| | | if(data.code == 200){ |
| | | Feng.success("保存成功") |
| | | } |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("img",img); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 提交添加 |
| | | */ |
| | | TCarInfoDlg.addSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let account = $("#account").val() |
| | | if(account==''){ |
| | | Feng.info("请选择所属账号") |
| | | return; |
| | | } |
| | | |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode=='' && $("#role")=="1"){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode=='' && $("#role")=="1"){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("门店名称不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("联系电话不能为空") |
| | | return; |
| | | } |
| | | |
| | | let address = $("#address").val() |
| | | |
| | | if(address==''){ |
| | | Feng.info("请输入地址") |
| | | return; |
| | | } |
| | | let time = $("#time").val() |
| | | |
| | | if(time==''){ |
| | | Feng.info("请填写营业时间") |
| | | return; |
| | | } |
| | | let intro = $("#intro").val() |
| | | |
| | | if(intro==''){ |
| | | Feng.info("请填写门店介绍") |
| | | return; |
| | | } |
| | | let userName = $("#userName").val() |
| | | |
| | | if(userName==''){ |
| | | Feng.info("请输入店长姓名") |
| | | return; |
| | | } |
| | | let userPhone = $("#userPhone").val() |
| | | |
| | | if(userPhone==''){ |
| | | Feng.info("请输入店长手机号") |
| | | return; |
| | | } |
| | | let img = $("#img").val() |
| | | |
| | | if(img==''){ |
| | | Feng.info("请上传门店封面") |
| | | return; |
| | | } |
| | | var goodImgs = this.goodsPicArray; |
| | | 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 ajax = new $ax(Feng.ctxPath + "/tShop/add", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("该店长手机号已经存在!") |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("添加成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Successfully added!"); |
| | | }else { |
| | | Feng.success("Sangat berhasil ditambah!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | |
| | | },function(data){ |
| | | Feng.error("添加失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set(this.tCarInfoData); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.set("cityManagerId",account); |
| | | ajax.set("address",address); |
| | | ajax.set("time",time); |
| | | ajax.set("introduce",intro); |
| | | ajax.set("userName",userName); |
| | | ajax.set("userPhone",userPhone); |
| | | ajax.set("coverDrawing",img); |
| | | ajax.set("realPicture",imgOne); |
| | | ajax.start(); |
| | | } |
| | | var map = new AMap.Map('container', { |
| | | resizeEnable: true, // 允许缩放 |
| | | zoom: 15 // 设置地图的缩放级别,0 - 20 |
| | | }); |
| | | var marker; |
| | | //搜索地图 |
| | | TCarInfoDlg.searchByStationName = function(e,type){ |
| | | var keyword="成都"; |
| | | if(type==2){ |
| | | keyword = $(e).parent().prev().find("input").val(); |
| | | }else { |
| | | if($("#address").val()!=null && $("#address").val()!=''){ |
| | | keyword = $("#address").val(); |
| | | } |
| | | } |
| | | type=1; |
| | | AMap.plugin('AMap.Geocoder', function() { |
| | | var geocoder = new AMap.Geocoder(); |
| | | console.log(geocoder) |
| | | console.log(keyword) |
| | | geocoder.getLocation(keyword, function(status, result) { |
| | | console.log(status,result) |
| | | if (status === 'complete' && result.info === 'OK') { |
| | | // 经纬度 |
| | | var lng = result.geocodes[0].location.lng; |
| | | var lat = result.geocodes[0].location.lat; |
| | | $("#longitude").val(lng) |
| | | $("#latitude").val(lat) |
| | | // 地图实例 |
| | | map = new AMap.Map('container', { |
| | | resizeEnable: true, // 允许缩放 |
| | | center: [lng, lat], // 设置地图的中心点 |
| | | zoom: 15 // 设置地图的缩放级别,0 - 20 |
| | | }); |
| | | //地图画点 |
| | | //addMarker(lng,lat); |
| | | if(type==1 || type==2){ |
| | | showInfoClick(); |
| | | if(lng == null){ |
| | | }else{ |
| | | addMarker(lng,lat); |
| | | } |
| | | }else{ |
| | | addMarker(lng,lat); |
| | | } |
| | | } else { |
| | | console.log('定位失败!'); |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | } |
| | | //地图点击事件 |
| | | function showInfoClick(){ |
| | | map.on('click', function (e) { |
| | | addMarker(e.lnglat.getLng(),e.lnglat.getLat()); |
| | | }); |
| | | } |
| | | //删除点 |
| | | function removeMarkers(){ |
| | | if(marker!=null){ |
| | | map.remove(marker); |
| | | } |
| | | |
| | | } |
| | | // 实例化点标记 |
| | | function addMarker(lon,lat) { |
| | | removeMarkers(); |
| | | marker = new AMap.Marker({ |
| | | map: map, |
| | | position: new AMap.LngLat(lon, lat), // 经纬度 |
| | | }); |
| | | //加经纬度 |
| | | $("#lon").val(lon); |
| | | $("#lat").val(lat); |
| | | var lnglatXY = [lon, lat];//地图上所标点的坐标 |
| | | AMap.service('AMap.Geocoder',function() {//回调函数 |
| | | geocoder = new AMap.Geocoder({ |
| | | }); |
| | | geocoder.getAddress(lnglatXY, function (status, result) { |
| | | if (status === 'complete' && result.info === 'OK') { |
| | | //获得了有效的地址信息: |
| | | //即,result.regeocode.formattedAddress |
| | | // alert(result.regeocode.formattedAddress) |
| | | //document.getElementById("address").value=result.regeocode.formattedAddress;//将获取到的地址信息赋值给文本框,保存进数据库 |
| | | |
| | | var address = result.regeocode.formattedAddress; |
| | | var city = result.regeocode.addressComponent.city; |
| | | var province = result.regeocode.addressComponent.province; |
| | | var district = result.regeocode.addressComponent.district; |
| | | $("#address").val(address); |
| | | } else { |
| | | //获取地址失败 |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | | /** |
| | | * 提交修改 |
| | | */ |
| | | TCarInfoDlg.editSubmit = function() { |
| | | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | let pCode = $("#pCode").val() |
| | | let cCode = $("#cCode").val() |
| | | let account = $("#account").val() |
| | | if(account==''){ |
| | | Feng.info("请选择所属账号") |
| | | return; |
| | | } |
| | | |
| | | let name = $("#name").val() |
| | | let phone = $("#phone").val() |
| | | |
| | | if(pCode=='' && $("#role")=="1"){ |
| | | Feng.info("请选择省") |
| | | return; |
| | | } |
| | | if(cCode=='' && $("#role")=="1"){ |
| | | Feng.info("请选择市") |
| | | return; |
| | | } |
| | | if(name==''){ |
| | | Feng.info("门店名称不能为空") |
| | | return; |
| | | } |
| | | if(phone==''){ |
| | | Feng.info("联系电话不能为空") |
| | | return; |
| | | } |
| | | |
| | | let address = $("#address").val() |
| | | |
| | | if(address==''){ |
| | | Feng.info("请输入地址") |
| | | return; |
| | | } |
| | | let time = $("#time").val() |
| | | |
| | | if(time==''){ |
| | | Feng.info("请填写营业时间") |
| | | return; |
| | | } |
| | | let intro = $("#intro").val() |
| | | |
| | | if(intro==''){ |
| | | Feng.info("请填写门店介绍") |
| | | return; |
| | | } |
| | | let userName = $("#userName").val() |
| | | |
| | | if(userName==''){ |
| | | Feng.info("请输入店长姓名") |
| | | return; |
| | | } |
| | | let userPhone = $("#userPhone").val() |
| | | |
| | | if(userPhone==''){ |
| | | Feng.info("请输入店长手机号") |
| | | return; |
| | | } |
| | | let img = $("#img").val() |
| | | |
| | | |
| | | let imgOne = $("#imgOne").val() |
| | | |
| | | if(imgOne==''){ |
| | | Feng.info("请上传实景图") |
| | | return; |
| | | } |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/update", function(data){ |
| | | if(data=="5001"){ |
| | | Feng.error("该店长手机号已经存在!") |
| | | }else |
| | | if(data.code == 200){ |
| | | if(language==1){ |
| | | Feng.success("修改成功!"); |
| | | }else if(language==2){ |
| | | Feng.success("Modify successfully!"); |
| | | }else { |
| | | Feng.success("Mengubah dengan sukses!"); |
| | | } |
| | | window.parent.TCompetition.table.refresh(); |
| | | TCarInfoDlg.close(); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("修改失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("provinceCode",pCode); |
| | | ajax.set("cityCode",cCode); |
| | | ajax.set("name",name); |
| | | ajax.set("phone",phone); |
| | | ajax.set("cityManagerId",account); |
| | | ajax.set("address",address); |
| | | ajax.set("time",time); |
| | | ajax.set("introduce",intro); |
| | | ajax.set("userName",userName); |
| | | ajax.set("userPhone",userPhone); |
| | | ajax.set("coverDrawing",img); |
| | | ajax.set("realPicture",imgOne); |
| | | ajax.set("id",$("#id").val()); |
| | | ajax.start(); |
| | | } |
| | | |
| | | $(function() { |
| | | Feng.initValidator("carInfoForm", TCarInfoDlg.validateFields); |
| | | // 初始化图片上传 |
| | | var carPhoto = new $WebUpload("c1"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c2"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c3"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c4"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c5"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c6"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c7"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("c8"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var carPhoto = new $WebUpload("img"); |
| | | carPhoto.setUploadBarId("progressBar"); |
| | | carPhoto.init(); |
| | | var drivingLicensePhoto = new $WebUpload("drivingLicensePhoto"); |
| | | drivingLicensePhoto.setUploadBarId("progressBar"); |
| | | drivingLicensePhoto.init(); |
| | | |
| | | //地图搜索 |
| | | TCarInfoDlg.searchByStationName(); |
| | | }); |
| | | |
| | | /** |
| | | * 选择分公司后执行 |
| | | */ |
| | | TCarInfoDlg.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(); |
| | | } |
| | | |
| | | /** |
| | | * 类型改变执行 |
| | | * @param e |
| | | */ |
| | | TCarInfoDlg.companyTypeClick = function (e) { |
| | | if (1 == e){ |
| | | $(".companyDiv").hide(); |
| | | } else if (2 == e){ |
| | | $(".companyDiv").show(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 车辆品牌改变时执行 |
| | | */ |
| | | TCarInfoDlg.saveAllImg = function (e) { |
| | | var id = $("#id").val() |
| | | var px1 = $("#px1").val() |
| | | var px2 = $("#px2").val() |
| | | var px3 = $("#px3").val() |
| | | var px4 = $("#px4").val() |
| | | var px5 = $("#px5").val() |
| | | var px6 = $("#px6").val() |
| | | var px7 = $("#px7").val() |
| | | var px8 = $("#px8").val() |
| | | var c1 = $("#c1").val() |
| | | var c2 = $("#c2").val() |
| | | var c3 = $("#c3").val() |
| | | var c4 = $("#c4").val() |
| | | var c5 = $("#c5").val() |
| | | var c6 = $("#c6").val() |
| | | var c7 = $("#7").val() |
| | | var c8 = $("#c8").val() |
| | | var r1 = document.querySelector('input[name="r1"]').checked; |
| | | var r2 = document.querySelector('input[name="r2"]').checked; |
| | | var r3 = document.querySelector('input[name="r3"]').checked; |
| | | var r4 = document.querySelector('input[name="r4"]').checked; |
| | | var r5 = document.querySelector('input[name="r5"]').checked; |
| | | var r6 = document.querySelector('input[name="r6"]').checked; |
| | | var r7 = document.querySelector('input[name="r7"]').checked; |
| | | var r8 = document.querySelector('input[name="r8"]').checked; |
| | | if(r1){ |
| | | r1 =1 |
| | | }else{ |
| | | r1=0 |
| | | } |
| | | if(r2){ |
| | | r2 =1 |
| | | }else{ |
| | | r2=0 |
| | | } |
| | | if(r3){ |
| | | r3 =1 |
| | | }else{ |
| | | r3=0 |
| | | } |
| | | if(r4){ |
| | | r4 =1 |
| | | }else{ |
| | | r4=0 |
| | | } |
| | | if(r5){ |
| | | r5 =1 |
| | | }else{ |
| | | r5=0 |
| | | } |
| | | if(r6){ |
| | | r6 =1 |
| | | }else{ |
| | | r6=0 |
| | | } |
| | | if(r7){ |
| | | r7 =1 |
| | | }else{ |
| | | r7=0 |
| | | } |
| | | if(r8){ |
| | | r8 =1 |
| | | }else{ |
| | | r8=0 |
| | | } |
| | | |
| | | var ajax = new $ax(Feng.ctxPath + "/tShop/saveImgAll", function(data){ |
| | | if(data.code == 200){ |
| | | Feng.success("保存成功!"); |
| | | }else{ |
| | | Feng.error(data.msg); |
| | | } |
| | | },function(data){ |
| | | Feng.error("保存失败!" + data.responseJSON.message + "!"); |
| | | |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("px1",px1); |
| | | ajax.set("px2",px2); |
| | | ajax.set("px3",px3); |
| | | ajax.set("px4",px4); |
| | | ajax.set("px5",px5); |
| | | ajax.set("px6",px6); |
| | | ajax.set("px7",px7); |
| | | ajax.set("px8",px8); |
| | | ajax.set("c1",c1); |
| | | ajax.set("c2",c2); |
| | | ajax.set("c3",c3); |
| | | ajax.set("c4",c4); |
| | | ajax.set("c5",c5); |
| | | ajax.set("c6",c6); |
| | | ajax.set("c7",c7); |
| | | ajax.set("c8",c8); |
| | | ajax.set("r1",r1); |
| | | ajax.set("r2",r2); |
| | | ajax.set("r3",r3); |
| | | ajax.set("r4",r4); |
| | | ajax.set("r5",r5); |
| | | ajax.set("r6",r6); |
| | | ajax.set("r7",r7); |
| | | ajax.set("r8",r8); |
| | | ajax.start(); |
| | | } |
| | | |
| | | /** |
| | | * 专车服务被点击 |
| | | */ |
| | | TCarInfoDlg.zcServerClick = function () { |
| | | var serverBox1 = $('#serverBox1').prop('checked'); |
| | | if (serverBox1){ |
| | | $("#zcModelDiv").show(); |
| | | } else { |
| | | $("#zcModelDiv").hide(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 跨城服务被点击 |
| | | */ |
| | | TCarInfoDlg.kcServerClick = function () { |
| | | var serverBox3 = $('#serverBox3').prop('checked'); |
| | | if (serverBox3){ |
| | | $("#kcModelDiv").show(); |
| | | } else { |
| | | $("#kcModelDiv").hide(); |
| | | } |
| | | } |
| | |
| | | }, |
| | | {title: '场地责任险有效期', field: 'lineNum', visible: true, align: 'center', valign: 'middle', |
| | | }, |
| | | {title: language==1?'状态':(language==2?'State':'Status'), field: 'state', visible: true, align: 'center', valign: 'middle', |
| | | {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle', |
| | | formatter:function (data) { |
| | | return {1:"上架中",2:"下架中"}[data] |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | |
| | | return true; |
| | | } |
| | | }; |
| | | |
| | | TSite.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(); |
| | | } |
| | | /** |
| | | * 点击添加跨城站点管理 |
| | | */ |
New file |
| | |
| | | var map = new AMap.Map('container',{ |
| | | resizeEnable: true, |
| | | zoom:10 |
| | | }); |
| | | |
| | | |
| | | var value = ""; |
| | | map.getCity( |
| | | callback=function (result) { |
| | | value = result.city; |
| | | drawBounds(); |
| | | } |
| | | ); |
| | | |
| | | |
| | | var mouseTool = new AMap.MouseTool(map); |
| | | //监听draw事件可获取画好的覆盖物 |
| | | var overlays = []; |
| | | var name = null; |
| | | var coordinate = '';//存储坐标 |
| | | var objs = {//存储各种类型的覆盖物对象 |
| | | "polyline":[], |
| | | "polygon":[], |
| | | "rectangle":[], |
| | | "circle":[] |
| | | }; |
| | | var editors = []; |
| | | mouseTool.on('draw',function(e){ |
| | | overlays.push(e.obj); |
| | | |
| | | switch (name) { |
| | | case 'polyline':{//折线图 |
| | | var polyline = e.obj.getPath(); |
| | | getCoordinate(polyline); |
| | | objs.polyline.push(e.obj); |
| | | break; |
| | | } |
| | | case 'polygon':{//多边形 |
| | | var polygon = e.obj.getPath(); |
| | | getCoordinate(polygon); |
| | | objs.polygon.push(e.obj); |
| | | break; |
| | | } |
| | | case 'rectangle':{//矩形 |
| | | var rectangle = e.obj.getPath(); |
| | | getCoordinate(rectangle); |
| | | objs.rectangle.push(e.obj); |
| | | break; |
| | | } |
| | | case 'circle':{//圆形 |
| | | var center = e.obj.getCenter(); |
| | | var radius = e.obj.getRadius(); |
| | | if(radius > 5000){ |
| | | Feng.error("创建电子围栏失败,圆半径不能大于5000米"); |
| | | return; |
| | | } |
| | | coordinate += center.lng + ',' + center.lat + ';' + radius + "_"; |
| | | objs.circle.push(e.obj); |
| | | break; |
| | | } |
| | | } |
| | | }) |
| | | |
| | | |
| | | var district = null; |
| | | var polygons=[]; |
| | | function drawBounds() { |
| | | if(value == ''){ |
| | | value = '北京市'; |
| | | } |
| | | |
| | | //加载行政区划插件 |
| | | if(!district){ |
| | | //实例化DistrictSearch |
| | | var opts = { |
| | | subdistrict: 0, //获取边界不需要返回下级行政区 |
| | | extensions: 'all', //返回行政区边界坐标组等具体信息 |
| | | level: 'district' //查询行政级别为 市 |
| | | }; |
| | | district = new AMap.DistrictSearch(opts); |
| | | } |
| | | //行政区查询 |
| | | district.setLevel(document.getElementById('level').value) |
| | | district.search(value, function(status, result) { |
| | | map.remove(polygons)//清除上次结果 |
| | | polygons = []; |
| | | var bounds = result.districtList[0].boundaries; |
| | | if (bounds) { |
| | | for (var i = 0, l = bounds.length; i < l; i++) { |
| | | //生成行政区划polygon |
| | | var polygon = new AMap.Polygon({ |
| | | strokeWeight: 1, |
| | | path: bounds[i], |
| | | fillOpacity: 0.4, |
| | | fillColor: '#80d8ff', |
| | | strokeColor: '#0091ea' |
| | | }); |
| | | polygons.push(polygon); |
| | | } |
| | | } |
| | | map.add(polygons) |
| | | map.setFitView(polygons);//视口自适应 |
| | | }); |
| | | } |
| | | |
| | | document.getElementById('find').onclick = function () { |
| | | value = document.getElementById('district').value; |
| | | if(value == ''){ |
| | | value = "北京市"; |
| | | } |
| | | drawBounds() |
| | | }; |
| | | document.getElementById('district').onkeydown = function(e) { |
| | | if (e.keyCode === 13) { |
| | | value = document.getElementById('district').value; |
| | | if(value == ''){ |
| | | value = "北京市"; |
| | | } |
| | | drawBounds(); |
| | | return false; |
| | | } |
| | | return true; |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | //处理坐标结果 |
| | | function getCoordinate(arr){ |
| | | var str = ''; |
| | | for(var i = 0; i < arr.length; i++){ |
| | | var lng = arr[i].lng; |
| | | var lat = arr[i].lat; |
| | | str += lng + ',' + lat + ';'; |
| | | } |
| | | coordinate += str.substring(0, str.length - 1) + "_"; |
| | | } |
| | | |
| | | |
| | | function draw(type){ |
| | | switch(type){ |
| | | case 'marker':{ |
| | | mouseTool.marker({ |
| | | //同Marker的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | case 'polyline':{ |
| | | mouseTool.polyline({ |
| | | strokeColor:'#80d8ff' |
| | | //同Polyline的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | case 'polygon':{ |
| | | mouseTool.polygon({ |
| | | fillColor:'#00b0ff', |
| | | strokeColor:'#80d8ff' |
| | | //同Polygon的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | case 'rectangle':{ |
| | | mouseTool.rectangle({ |
| | | fillColor:'#00b0ff', |
| | | strokeColor:'#80d8ff' |
| | | //同Polygon的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | case 'circle':{ |
| | | mouseTool.circle({ |
| | | fillColor:'#00b0ff', |
| | | strokeColor:'#80d8ff' |
| | | //同Circle的Option设置 |
| | | }); |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | var radios = document.getElementsByName('func'); |
| | | for(var i=0;i<radios.length;i+=1){ |
| | | radios[i].onchange = function(e){ |
| | | draw(e.target.value) |
| | | name = e.target.value; |
| | | } |
| | | } |
| | | // draw('marker') |
| | | |
| | | document.getElementById('clear').onclick = function(){ |
| | | map.remove(overlays) |
| | | overlays = []; |
| | | coordinate = ''; |
| | | objs.circle = []; |
| | | objs.rectangle = []; |
| | | objs.polygon = []; |
| | | objs.polyline = []; |
| | | closeEdit(); |
| | | } |
| | | document.getElementById('close').onclick = function(){ |
| | | mouseTool.close()//关闭,并清除覆盖物 |
| | | for(var i=0;i<radios.length;i+=1){ |
| | | radios[i].checked = false; |
| | | } |
| | | closeEdit(); |
| | | } |
| | | |
| | | |
| | | //点击提交处理函数 |
| | | function submitCoordinate(){ |
| | | var name = $('#addressName').val(); |
| | | if('' == name){ |
| | | Feng.error('请填写地址名称'); |
| | | return; |
| | | } |
| | | if('' == coordinate){ |
| | | Feng.error('请在地图上规划区域'); |
| | | return; |
| | | } |
| | | coordinate = coordinate.substring(0, coordinate.length - 1); |
| | | |
| | | } |
| | | |
| | | function editAll() { |
| | | coordinate = ''; |
| | | editors = []; |
| | | //折线 |
| | | for(var i in objs.polyline){ |
| | | var polyline = objs.polyline[i]; |
| | | var polyEditor = new AMap.PolyEditor(map, polyline) |
| | | polyEditor.on('addnode', function(event) { |
| | | // log.info('触发事件:addnode') |
| | | }) |
| | | |
| | | polyEditor.on('adjust', function(event) { |
| | | // log.info('触发事件:adjust') |
| | | }) |
| | | |
| | | polyEditor.on('removenode', function(event) { |
| | | // log.info('触发事件:removenode') |
| | | }) |
| | | |
| | | polyEditor.on('end', function(e) { |
| | | var polyline = e.target.getPath(); |
| | | getCoordinate(polyline); |
| | | }) |
| | | editors.push(polyEditor); |
| | | polyEditor.open(); |
| | | } |
| | | |
| | | //多边形 |
| | | for(var i in objs.polygon){ |
| | | var polygon = objs.polygon[i]; |
| | | var polyEditor = new AMap.PolyEditor(map, polygon) |
| | | |
| | | polyEditor.on('addnode', function(event) { |
| | | // log.info('触发事件:addnode') |
| | | }) |
| | | |
| | | polyEditor.on('adjust', function(event) { |
| | | // log.info('触发事件:adjust') |
| | | }) |
| | | |
| | | polyEditor.on('removenode', function(event) { |
| | | // log.info('触发事件:removenode') |
| | | }) |
| | | |
| | | polyEditor.on('end', function(e) { |
| | | var polygon = e.target.getPath(); |
| | | getCoordinate(polygon); |
| | | }) |
| | | editors.push(polyEditor); |
| | | polyEditor.open(); |
| | | } |
| | | |
| | | |
| | | //矩形 |
| | | for(var i in objs.rectangle){ |
| | | var rectangle = objs.rectangle[i]; |
| | | var rectangleEditor = new AMap.RectangleEditor(map, rectangle) |
| | | |
| | | rectangleEditor.on('adjust', function(event) { |
| | | // log.info('触发事件:adjust') |
| | | }) |
| | | |
| | | rectangleEditor.on('end', function(e) { |
| | | var polygon = e.target.getPath(); |
| | | getCoordinate(polygon); |
| | | }) |
| | | editors.push(rectangleEditor); |
| | | rectangleEditor.open(); |
| | | } |
| | | |
| | | //圆形 |
| | | for(var i in objs.circle){ |
| | | var circle = objs.circle[i]; |
| | | var circleEditor = new AMap.CircleEditor(map, circle) |
| | | |
| | | circleEditor.on('move', function(event) { |
| | | // log.info('触发事件:move') |
| | | }) |
| | | |
| | | circleEditor.on('adjust', function(e) { |
| | | var radius = e.target.getRadius(); |
| | | if(radius > 5000){ |
| | | Feng.error("创建电子围栏失败,圆半径不能大于5000米"); |
| | | return; |
| | | } |
| | | }) |
| | | |
| | | circleEditor.on('end', function(e) { |
| | | var center = e.target.getCenter(); |
| | | var radius = e.target.getRadius(); |
| | | coordinate += center.lng + ',' + center.lat + ';' + radius + "_"; |
| | | }) |
| | | editors.push(circleEditor); |
| | | circleEditor.open(); |
| | | } |
| | | } |
| | | |
| | | |
| | | function closeEdit() { |
| | | for(var i in editors){ |
| | | var editor = editors[i]; |
| | | editor.close(); |
| | | } |
| | | } |
cloud-server-management/src/main/webapp/static/modular/system/tSiteType/tSiteType.js
cloud-server-management/src/main/webapp/static/modular/system/tSiteType/tSiteType_info.js
cloud-server-other/src/main/java/com/dsh/other/controller/SiteController.java
cloud-server-other/src/main/java/com/dsh/other/controller/StoreController.java
cloud-server-other/src/main/java/com/dsh/other/controller/StoredValueConfigController.java
cloud-server-other/src/main/java/com/dsh/other/controller/TRegionController.java
cloud-server-other/src/main/java/com/dsh/other/entity/Region.java
cloud-server-other/src/main/java/com/dsh/other/feignclient/SiteClient.java
cloud-server-other/src/main/java/com/dsh/other/feignclient/model/BillingDataRequestVo.java
cloud-server-other/src/main/java/com/dsh/other/mapper/RegionMapper.java
cloud-server-other/src/main/java/com/dsh/other/mapper/SiteBookingMapper.java
cloud-server-other/src/main/java/com/dsh/other/model/BillingRequestOfType.java
cloud-server-other/src/main/java/com/dsh/other/model/CityDataAndProvinceDataVo.java
cloud-server-other/src/main/java/com/dsh/other/model/RequestOfTypeVo.java
cloud-server-other/src/main/java/com/dsh/other/service/IRegionService.java
cloud-server-other/src/main/java/com/dsh/other/service/ISiteBookingService.java
cloud-server-other/src/main/java/com/dsh/other/service/impl/RegionServiceImpl.java
cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteBookingServiceImpl.java
cloud-server-other/src/main/java/com/dsh/other/service/impl/SiteServiceImpl.java
cloud-server-other/src/main/resources/mapper/RegionMapper.xml
cloud-server-other/src/main/resources/mapper/SiteBookingMapper.xml |