From 89c36365eda5cdd23de2338f1c28a5b250ea7b34 Mon Sep 17 00:00:00 2001 From: 44323 <443237572@qq.com> Date: 星期一, 25 九月 2023 17:12:59 +0800 Subject: [PATCH] 后台代码 --- cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/CoursePackagePaymentController.java | 49 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/CancelClassesVO.java | 6 cloud-server-account/src/main/java/com/dsh/account/entity/TStudent.java | 2 cloud-server-course/src/main/java/com/dsh/course/feignclient/account/model/Student.java | 2 cloud-server-activity/src/main/resources/mapper/IntroduceUserMapper.xml | 25 cloud-server-other/pom.xml | 2 cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_addStudent.html | 142 + cloud-server-management/src/main/webapp/static/modular/system/introduce/introduce_user.js | 64 cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceVO.java | 4 cloud-server-course/src/main/java/com/dsh/course/model/CancelClassesQuery.java | 6 cloud-server-management/src/main/webapp/static/modular/system/introduce/introduce_info.js | 482 ++++++ cloud-server-activity/src/main/java/com/dsh/activity/service/impl/IntroduceUserServiceImpl.java | 33 cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce_edit.html | 110 + cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceQuery.java | 2 cloud-server-course/src/main/java/com/dsh/course/model/CancelClassesVO.java | 7 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceUser.java | 29 cloud-server-activity/src/main/java/com/dsh/activity/controller/IntroduceRewardsController.java | 42 cloud-server-management/src/main/java/com/dsh/course/feignClient/account/StudentClient.java | 36 cloud-server-account/src/main/java/com/dsh/account/controller/CoachController.java | 11 cloud-server-management/src/main/webapp/WEB-INF/view/system/finance/CancelledClasses.html | 3 cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce_user.html | 69 cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentConfigController.java | 9 cloud-server-management/src/main/webapp/static/modular/system/finance/cancelledClasses.js | 61 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAppUserController.java | 84 cloud-server-activity/src/main/resources/mapper/IntroduceRewardsMapper.xml | 32 cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce.html | 6 cloud-server-account/src/main/resources/mapper/RechargeRecordsMapper.xml | 17 cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TIntroductionCourtesyController.java | 86 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceVO.java | 4 cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackagePaymentConfigClient.java | 9 cloud-server-activity/src/main/java/com/dsh/activity/service/IntroduceRewardsService.java | 6 cloud-server-account/src/main/java/com/dsh/account/model/AdvertisementChangeStateDTO.java | 15 cloud-server-course/src/main/resources/mapper/CoursePackagePaymentConfigMapper.xml | 6 cloud-server-course/src/main/java/com/dsh/course/model/TAppUser.java | 165 ++ cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceUserQuery.java | 20 cloud-server-course/src/main/java/com/dsh/course/feignclient/account/AppUserClient.java | 12 cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceUserQuery.java | 20 cloud-server-management/src/main/webapp/static/modular/system/introduce/introduce.js | 400 ++-- cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java | 181 + cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java | 12 cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce_add.html | 99 + cloud-server-activity/src/main/java/com/dsh/activity/service/IntroduceUserService.java | 19 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/RechargeRecordsVO.java | 2 cloud-server-activity/src/main/java/com/dsh/activity/mapper/IntroduceUserMapper.java | 25 cloud-server-course/src/main/java/com/dsh/course/controller/CancelledClassesController.java | 59 cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser.html | 4 cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment_info.js | 1225 +++++++-------- cloud-server-management/src/main/webapp/WEB-INF/view/system/cpPayment/cpPayment_add.html | 8 cloud-server-account/src/main/java/com/dsh/account/controller/AppUserController.java | 18 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/CancelClassesQuery.java | 6 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TCoursePackagePayment.java | 162 ++ cloud-server-activity/src/main/java/com/dsh/activity/service/impl/IntroduceRewardsServiceImpl.java | 15 cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment.js | 126 + cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/IntroduceClient.java | 53 cloud-server-management/src/main/java/com/dsh/course/feignClient/account/AppUserClient.java | 15 cloud-server-course/src/main/java/com/dsh/course/feignclient/account/model/Coach.java | 3 cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceUser.java | 28 cloud-server-management/src/main/webapp/static/modular/system/appUser/tAppUser.js | 144 + cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/IntroduceRewards.java | 92 + cloud-server-activity/src/main/resources/mapper/BodySideAppointmentsMapper.xml | 2 cloud-server-account/src/main/java/com/dsh/account/mapper/TAppUserMapper.java | 3 cloud-server-activity/src/main/java/com/dsh/activity/mapper/IntroduceRewardsMapper.java | 4 cloud-server-activity/src/main/java/com/dsh/activity/entity/IntroduceRewards.java | 4 cloud-server-course/src/main/resources/mapper/CancelledClassesMapper.xml | 25 cloud-server-account/src/main/resources/mapper/TAppUserMapper.xml | 12 cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java | 5 cloud-server-account/src/main/java/com/dsh/account/model/vo/RechargeRecordsVO.java | 2 cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackagePaymentClient.java | 7 cloud-server-course/src/main/java/com/dsh/course/feignclient/account/CoachClient.java | 12 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceQuery.java | 2 cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TStudent.java | 2 cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_info.html | 6 cloud-server-account/src/main/java/com/dsh/account/service/TAppUserService.java | 8 cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_edit.html | 24 74 files changed, 3,302 insertions(+), 1,190 deletions(-) diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/AppUserController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/AppUserController.java index 9fb0168..1ceb07a 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/controller/AppUserController.java +++ b/cloud-server-account/src/main/java/com/dsh/account/controller/AppUserController.java @@ -53,6 +53,24 @@ /** + * 根据用户id获取用户信息 + * @param appUserId + * @return + */ + @ResponseBody + @PostMapping("/base/appUser/queryAppUser1") + public TAppUser queryAppUser1(@RequestBody Integer appUserId){ + TAppUser appUser = appUserService.getById(appUserId); + return appUser; + } + /** + * 冻结/解冻 1=解冻 2=冻结 + */ + @RequestMapping("/base/appUser/changeState") + public Object changeState(@RequestBody AdvertisementChangeStateDTO dto){ + return appUserService.changeState(dto); + } + /** * 后台添加 */ @RequestMapping("/base/appUser/addAppUser1") diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/CoachController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/CoachController.java index 0f714f0..ee2a874 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/controller/CoachController.java +++ b/cloud-server-account/src/main/java/com/dsh/account/controller/CoachController.java @@ -21,6 +21,17 @@ /** + * 根据名称模糊搜索数据 + * @param name + * @return + */ + @PostMapping("/coach/queryCoachListByName") + @ResponseBody + public List<Coach> queryCoachListByName(String name){ + return service.list(new QueryWrapper<Coach>().like("name",name)); + } + + /** * 获取教练列表数据 */ @ResponseBody diff --git a/cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java b/cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java index 292ef63..8be82ce 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java +++ b/cloud-server-account/src/main/java/com/dsh/account/controller/StudentController.java @@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.dsh.account.dto.*; +import com.dsh.account.entity.Coach; import com.dsh.account.entity.GiftSearchDto; import com.dsh.account.entity.TStudent; import com.dsh.account.feignclient.course.CoursePaymentClient; @@ -37,7 +38,16 @@ @Autowired private TokenUtil tokenUtil; - + /** + * 添加学员 + * @return + */ + @RequestMapping("/base/student/addStudent") + public Object addStudent(@RequestBody TStudent student){ + student.setInsertTime(new Date()); + student.setIsDefault(1); + return studentService.save(student); + } /** * 获取用户学员列表 * @param appUserId diff --git a/cloud-server-account/src/main/java/com/dsh/account/entity/TStudent.java b/cloud-server-account/src/main/java/com/dsh/account/entity/TStudent.java index 51a20a0..5e44d75 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/entity/TStudent.java +++ b/cloud-server-account/src/main/java/com/dsh/account/entity/TStudent.java @@ -51,7 +51,7 @@ * 生日 */ @TableField("birthday") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date birthday; /** * 性别(1=男,2=女) diff --git a/cloud-server-account/src/main/java/com/dsh/account/mapper/TAppUserMapper.java b/cloud-server-account/src/main/java/com/dsh/account/mapper/TAppUserMapper.java index 2563388..9457534 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/mapper/TAppUserMapper.java +++ b/cloud-server-account/src/main/java/com/dsh/account/mapper/TAppUserMapper.java @@ -7,6 +7,7 @@ import com.dsh.account.model.vo.QueryAppUserVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import org.springframework.web.bind.annotation.PathVariable; import java.util.List; @@ -31,4 +32,6 @@ List<QueryAppUserVO> listAll(@Param("query") QueryAppUser query); List<SelectDto> getSelects(@Param("studentIds") List<Integer> studentIds); + + int changeState(@Param("ids") List<Integer> ids,@Param("state") Integer state); } diff --git a/cloud-server-account/src/main/java/com/dsh/account/model/AdvertisementChangeStateDTO.java b/cloud-server-account/src/main/java/com/dsh/account/model/AdvertisementChangeStateDTO.java new file mode 100644 index 0000000..02eba61 --- /dev/null +++ b/cloud-server-account/src/main/java/com/dsh/account/model/AdvertisementChangeStateDTO.java @@ -0,0 +1,15 @@ +package com.dsh.account.model; + +import lombok.Data; + +import java.util.List; + +/** + * 广告管理更改状态DTO + */ +@Data +public class AdvertisementChangeStateDTO { + private List<Integer> ids; + // 1 = 上架 2 = 下架 + private Integer state; +} diff --git a/cloud-server-account/src/main/java/com/dsh/account/model/vo/RechargeRecordsVO.java b/cloud-server-account/src/main/java/com/dsh/account/model/vo/RechargeRecordsVO.java index 03ae858..6753749 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/model/vo/RechargeRecordsVO.java +++ b/cloud-server-account/src/main/java/com/dsh/account/model/vo/RechargeRecordsVO.java @@ -27,7 +27,7 @@ private String provinceAndCity; private String name; private String phone; - private Date time; + private Date payTime; private BigDecimal amount; private Integer playPaiCoins; /** diff --git a/cloud-server-account/src/main/java/com/dsh/account/service/TAppUserService.java b/cloud-server-account/src/main/java/com/dsh/account/service/TAppUserService.java index 1d4aa55..05e650a 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/service/TAppUserService.java +++ b/cloud-server-account/src/main/java/com/dsh/account/service/TAppUserService.java @@ -3,10 +3,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.dsh.account.dto.SelectDto; 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.model.query.appUserQuery.QueryAppUser; import com.dsh.account.model.vo.DetailsListVo; import com.dsh.account.model.vo.QueryAppUserVO; @@ -147,4 +144,7 @@ List<SelectDto> getSelects(List<Integer> studentIds); + + Object changeState(AdvertisementChangeStateDTO dto); + } diff --git a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java index 20c6292..9dcdaca 100644 --- a/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java +++ b/cloud-server-account/src/main/java/com/dsh/account/service/impl/TAppUserServiceImpl.java @@ -169,6 +169,11 @@ } @Override + public Object changeState(AdvertisementChangeStateDTO dto) { + return appUserMapper.changeState(dto.getIds(),dto.getState()); + } + + @Override public ClassInfoVo queryUserOfStus(Integer id) { TAppUser tAppUser = this.baseMapper.selectById(id); ClassInfoVo classInfoVo = new ClassInfoVo(); diff --git a/cloud-server-account/src/main/resources/mapper/RechargeRecordsMapper.xml b/cloud-server-account/src/main/resources/mapper/RechargeRecordsMapper.xml index 0b729b0..d0099e1 100644 --- a/cloud-server-account/src/main/resources/mapper/RechargeRecordsMapper.xml +++ b/cloud-server-account/src/main/resources/mapper/RechargeRecordsMapper.xml @@ -4,30 +4,19 @@ <select id="rechargeList" resultType="com.dsh.account.model.vo.RechargeRecordsVO"> - select t1.id as id,t1.appUserId,t1.payTime as `time`,t1.amount as amount, - t1.playPaiCoins as playPaiCoins,CONCAT(t2.province,t2.city) as provinceAndCity, - t2.`name` as `name`,t2.phone as phone,t2.isVip as `type` from t_recharge_records3 t1 - left join t_app_user t2 on t2.id = t1.appUserId + select t1.*,t2.name,t2.phone from t_recharge_records t1 + left join t_app_user t2 on t1.appUserId = t2.id <where> - <if test="query.city!=null and query.city!= ''"> - and t2.city = #{query.city} - </if> - <if test="query.province!=null and query.province!= ''"> - and t2.province = #{query.province} - </if> <if test="query.name!=null and query.name!= ''"> AND t1.name LIKE concat('%',#{query.name},'%') </if> <if test="query.phone!=null and query.phone!= ''"> and t1.phone LIKE concat('%',#{query.phone},'%') </if> - <if test="query.type!=null and query.type!= ''"> - and t2.isVip = #{query.type} - </if> + <if test="sTime !=null and sTime!= '' and eTime !=null and eTime!= ''"> and t1.insertTime between #{sTime} and #{eTime} </if> - and t1.state != 3 </where> </select> </mapper> diff --git a/cloud-server-account/src/main/resources/mapper/TAppUserMapper.xml b/cloud-server-account/src/main/resources/mapper/TAppUserMapper.xml index 89b7af0..2168842 100644 --- a/cloud-server-account/src/main/resources/mapper/TAppUserMapper.xml +++ b/cloud-server-account/src/main/resources/mapper/TAppUserMapper.xml @@ -36,6 +36,18 @@ <update id="membershipEnd"> update t_app_user set isVip = 0 where isVip = 1 and now() >= vipEndTime </update> + <update id="changeState"> + update t_app_user set + state = #{state} + <where> + <if test="ids != null and ids.size()>0"> + AND t_app_user.id IN + <foreach collection="ids" separator="," item="id" open="(" close=")"> + #{id} + </foreach> + </if> + </where> + </update> <select id="listAll" resultType="com.dsh.account.model.vo.QueryAppUserVO"> select t1.* from t_app_user t1 <where> diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/controller/IntroduceRewardsController.java b/cloud-server-activity/src/main/java/com/dsh/activity/controller/IntroduceRewardsController.java index 362632e..4e7ea76 100644 --- a/cloud-server-activity/src/main/java/com/dsh/activity/controller/IntroduceRewardsController.java +++ b/cloud-server-activity/src/main/java/com/dsh/activity/controller/IntroduceRewardsController.java @@ -10,11 +10,13 @@ import com.dsh.activity.feignclient.other.model.Store; import com.dsh.activity.model.*; import com.dsh.activity.service.IntroduceRewardsService; +import com.dsh.activity.service.IntroduceUserService; import io.swagger.annotations.Api; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.text.Format; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; @@ -29,16 +31,48 @@ @Autowired private IntroduceRewardsService idrService; + @Autowired + private IntroduceUserService introduceUserService; private final SimpleDateFormat mat = new SimpleDateFormat("MM-dd HH:mm"); + /** - * 获取所有体测预约记录 + * 获取介绍有礼-参与用户记录表 + * @return + */ + @RequestMapping("/base/introduceUser/listAllUser") + public List<IntroduceUser> listAllUser(@RequestBody IntroduceUserQuery query){ + return introduceUserService.listAll(query); + } + /** + * 通过id获取介绍有礼 + * @return + */ + @RequestMapping("/base/introduce/getInfoById") + public IntroduceRewards getInfoById(@RequestBody Integer id){ + return idrService.getById(id); + + } + /** + * 获取介绍有礼记录表 * @return */ @RequestMapping("/base/introduce/listAll") public List<IntroduceVO> listAll(@RequestBody IntroduceQuery query){ - - return null; + Date date = new Date(); + List<IntroduceVO> introduceVOS = idrService.listAll(query); + for (IntroduceVO introduceVO : introduceVOS) { + Date startTime = introduceVO.getStartTime(); + Date endTime = introduceVO.getEndTime(); + if (date.after(startTime) && date.before(endTime)) { + introduceVO.setActivityState(1); + } else if (date.before(startTime)) { + introduceVO.setActivityState(2); + } else if (date.after(endTime)) { + introduceVO.setActivityState(3); + } + } + return introduceVOS; } /** * 增加/修改介绍有礼记录 @@ -46,9 +80,11 @@ */ @RequestMapping("/base/introduce/addIntroduce") public Object addIntroduce(@RequestBody IntroduceRewards introduceRewards){ + if (introduceRewards.getId()!=null){ return idrService.updateById(introduceRewards); }else { + introduceRewards.setInsertTime(new Date()); return idrService.save(introduceRewards); } } diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/entity/IntroduceRewards.java b/cloud-server-activity/src/main/java/com/dsh/activity/entity/IntroduceRewards.java index f8804a8..5477444 100644 --- a/cloud-server-activity/src/main/java/com/dsh/activity/entity/IntroduceRewards.java +++ b/cloud-server-activity/src/main/java/com/dsh/activity/entity/IntroduceRewards.java @@ -5,6 +5,7 @@ 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; @@ -57,11 +58,13 @@ * 开始时间 */ @TableField("startTime") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8") private Date startTime; /** * 结束时间 */ @TableField("endTime") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8") private Date endTime; /** * 赠送课时 @@ -77,6 +80,7 @@ * 添加时间 */ @TableField("insertTime") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date insertTime; diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/mapper/IntroduceRewardsMapper.java b/cloud-server-activity/src/main/java/com/dsh/activity/mapper/IntroduceRewardsMapper.java index 4a59bde..32fb114 100644 --- a/cloud-server-activity/src/main/java/com/dsh/activity/mapper/IntroduceRewardsMapper.java +++ b/cloud-server-activity/src/main/java/com/dsh/activity/mapper/IntroduceRewardsMapper.java @@ -2,6 +2,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.dsh.activity.entity.IntroduceRewards; +import com.dsh.activity.model.IntroduceQuery; +import com.dsh.activity.model.IntroduceVO; import org.apache.ibatis.annotations.Param; import java.util.List; @@ -17,4 +19,6 @@ public interface IntroduceRewardsMapper extends BaseMapper<IntroduceRewards> { Object changeState(@Param("ids") List<Integer> ids,@Param("state") Integer state); + + List<IntroduceVO> listAll(@Param("query")IntroduceQuery query, @Param("sTime")String sTime, @Param("eTime")String eTime); } diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/mapper/IntroduceUserMapper.java b/cloud-server-activity/src/main/java/com/dsh/activity/mapper/IntroduceUserMapper.java new file mode 100644 index 0000000..445ac46 --- /dev/null +++ b/cloud-server-activity/src/main/java/com/dsh/activity/mapper/IntroduceUserMapper.java @@ -0,0 +1,25 @@ +package com.dsh.activity.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.dsh.activity.entity.IntroduceRewards; +import com.dsh.activity.model.IntroduceQuery; +import com.dsh.activity.model.IntroduceUser; +import com.dsh.activity.model.IntroduceUserQuery; +import com.dsh.activity.model.IntroduceVO; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * <p> + * 介绍奖励 Mapper 接口 + * </p> + * + * @author jqs + * @since 2023-06-29 + */ +public interface IntroduceUserMapper extends BaseMapper<IntroduceUser> { + + + List<IntroduceUser> listAll(@Param("query") IntroduceUserQuery query); +} diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceQuery.java b/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceQuery.java index d4403c7..49bee23 100644 --- a/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceQuery.java +++ b/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceQuery.java @@ -10,7 +10,7 @@ // 省 private String province; // 市 - private String page; + private String city; // 状态 private Integer state; // 活动状态 diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceUser.java b/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceUser.java new file mode 100644 index 0000000..744dcbf --- /dev/null +++ b/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceUser.java @@ -0,0 +1,28 @@ +package com.dsh.activity.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 介绍有礼参与用户实体类 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class IntroduceUser { + private Integer id; + // 分享用户id + private Integer shareUsers; + private String shareUsersName; + private String shareUsersphone; + private String userName; + private Integer userId; + private String userPhone; + private Integer introduceRewards; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private Date registerTime; +} diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceUserQuery.java b/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceUserQuery.java new file mode 100644 index 0000000..2f840d5 --- /dev/null +++ b/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceUserQuery.java @@ -0,0 +1,20 @@ +package com.dsh.activity.model; + +import lombok.Data; + +/** + * 介绍有礼-参与用户列表查询Query + */ +@Data +public class IntroduceUserQuery { + // 介绍有礼id + private Integer introduceId; + // 分享用户姓名 + private String shareUsersName; + // 分享用户i淡化 + private String shareUsersphone; + // 被分享用户姓名 + private Integer userName; + // 被分享用户电话 + private Integer userPhone; +} diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceVO.java b/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceVO.java index 0ebc023..f00ce7c 100644 --- a/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceVO.java +++ b/cloud-server-activity/src/main/java/com/dsh/activity/model/IntroduceVO.java @@ -23,9 +23,9 @@ */ private Integer id; private String provinceAndCity; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date startTime; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date endTime; private Integer giveClass; private Integer number; diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/service/IntroduceRewardsService.java b/cloud-server-activity/src/main/java/com/dsh/activity/service/IntroduceRewardsService.java index 9d2457d..4949324 100644 --- a/cloud-server-activity/src/main/java/com/dsh/activity/service/IntroduceRewardsService.java +++ b/cloud-server-activity/src/main/java/com/dsh/activity/service/IntroduceRewardsService.java @@ -3,6 +3,10 @@ import com.baomidou.mybatisplus.extension.service.IService; import com.dsh.activity.entity.IntroduceRewards; import com.dsh.activity.model.IntroduceChangeStateDTO; +import com.dsh.activity.model.IntroduceQuery; +import com.dsh.activity.model.IntroduceVO; + +import java.util.List; /** * <p> @@ -15,4 +19,6 @@ public interface IntroduceRewardsService extends IService<IntroduceRewards> { Object changeState(IntroduceChangeStateDTO dto); + + List<IntroduceVO> listAll(IntroduceQuery query); } diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/service/IntroduceUserService.java b/cloud-server-activity/src/main/java/com/dsh/activity/service/IntroduceUserService.java new file mode 100644 index 0000000..c92262f --- /dev/null +++ b/cloud-server-activity/src/main/java/com/dsh/activity/service/IntroduceUserService.java @@ -0,0 +1,19 @@ +package com.dsh.activity.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.dsh.activity.entity.IntroduceRewards; +import com.dsh.activity.model.*; + +import java.util.List; + +/** + * <p> + * 介绍有礼-用户参与 服务类 + * </p> + * + */ +public interface IntroduceUserService extends IService<IntroduceUser> { + + + List<IntroduceUser> listAll(IntroduceUserQuery query); +} diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/IntroduceRewardsServiceImpl.java b/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/IntroduceRewardsServiceImpl.java index 4919961..0a0c701 100644 --- a/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/IntroduceRewardsServiceImpl.java +++ b/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/IntroduceRewardsServiceImpl.java @@ -4,9 +4,12 @@ import com.dsh.activity.entity.IntroduceRewards; import com.dsh.activity.mapper.IntroduceRewardsMapper; import com.dsh.activity.model.IntroduceChangeStateDTO; +import com.dsh.activity.model.IntroduceQuery; +import com.dsh.activity.model.IntroduceVO; import com.dsh.activity.service.IntroduceRewardsService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; import java.util.List; @@ -28,4 +31,16 @@ Integer state = dto.getState(); return introduceRewardsMapper.changeState(ids,state); } + + @Override + public List<IntroduceVO> listAll(IntroduceQuery query) { + + String STime = null; + String ETime = null; + if (StringUtils.hasLength(query.getTime())) { + STime = query.getTime().split(" - ")[0] + " 00:00:00"; + ETime = query.getTime().split(" - ")[1] + " 23:59:59"; + } + return introduceRewardsMapper.listAll(query,STime,ETime); + } } diff --git a/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/IntroduceUserServiceImpl.java b/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/IntroduceUserServiceImpl.java new file mode 100644 index 0000000..ecdcebd --- /dev/null +++ b/cloud-server-activity/src/main/java/com/dsh/activity/service/impl/IntroduceUserServiceImpl.java @@ -0,0 +1,33 @@ +package com.dsh.activity.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.dsh.activity.entity.IntroduceRewards; +import com.dsh.activity.mapper.IntroduceRewardsMapper; +import com.dsh.activity.mapper.IntroduceUserMapper; +import com.dsh.activity.model.*; +import com.dsh.activity.service.IntroduceRewardsService; +import com.dsh.activity.service.IntroduceUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.List; + +/** + * <p> + * 介绍有礼-参与用户 服务实现类 + * </p> + * + * @author jqs + * @since 2023-06-29 + */ +@Service +public class IntroduceUserServiceImpl extends ServiceImpl<IntroduceUserMapper, IntroduceUser> implements IntroduceUserService { + @Autowired + private IntroduceUserMapper introduceUserMapper; + + @Override + public List<IntroduceUser> listAll(IntroduceUserQuery query) { + return introduceUserMapper.listAll(query); + } +} diff --git a/cloud-server-activity/src/main/resources/mapper/BodySideAppointmentsMapper.xml b/cloud-server-activity/src/main/resources/mapper/BodySideAppointmentsMapper.xml index c222803..ac8ac7b 100644 --- a/cloud-server-activity/src/main/resources/mapper/BodySideAppointmentsMapper.xml +++ b/cloud-server-activity/src/main/resources/mapper/BodySideAppointmentsMapper.xml @@ -22,7 +22,7 @@ and t1.phone like concat('%',#{query.phone},'%') </if> <if test="query.parentName!=null and query.parentName!= ''"> - t1.parentName like concat('%',#{query.parentName},'%') + and t1.parentName like concat('%',#{query.parentName},'%') </if> <if test="query.state!=null and query.state!= ''"> and t1.status = #{query.state} diff --git a/cloud-server-activity/src/main/resources/mapper/IntroduceRewardsMapper.xml b/cloud-server-activity/src/main/resources/mapper/IntroduceRewardsMapper.xml index 95e3ae0..a33638f 100644 --- a/cloud-server-activity/src/main/resources/mapper/IntroduceRewardsMapper.xml +++ b/cloud-server-activity/src/main/resources/mapper/IntroduceRewardsMapper.xml @@ -15,4 +15,36 @@ </if> </where> </update> + <select id="listAll" resultType="com.dsh.activity.model.IntroduceVO"> + select t1.id,CONCAT(t1.province,t1.city) as provinceAndCity,t1.startTime,t1.endTime, + t1.giveClass,t1.state,t1.insertTime from t_introduce_rewards t1 + <where> + <if test="query.city!=null and query.city!= ''"> + and t1.cityCode = #{query.city} + </if> + <if test="query.province!=null and query.province!= ''"> + and t1.provinceCode = #{query.province} + </if> + <if test="query.activityState!=null and query.activityState!= ''"> + AND t1.state = #{query.activityState} + </if> + <if test="sTime !=null and sTime!= '' and eTime !=null and eTime!= ''"> + and t1.startTime between #{sTime} and #{eTime} + </if> + <if test="sTime !=null and sTime!= '' and eTime !=null and eTime!= ''"> + and t1.endTime between #{sTime} and #{eTime} + </if> + <choose> + <when test="query.state == 1"> + and NOW() between t1.startTime and t1.endTime + </when> + <when test="query.state == 2"> + and t1.endTime <= NOW() + </when> + <when test="query.state == 3"> + and t1.startTime >= NOW() + </when> + </choose> + </where> + </select> </mapper> diff --git a/cloud-server-activity/src/main/resources/mapper/IntroduceUserMapper.xml b/cloud-server-activity/src/main/resources/mapper/IntroduceUserMapper.xml new file mode 100644 index 0000000..8061e86 --- /dev/null +++ b/cloud-server-activity/src/main/resources/mapper/IntroduceUserMapper.xml @@ -0,0 +1,25 @@ +<?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.IntroduceUserMapper"> + + <select id="listAll" resultType="com.dsh.activity.model.IntroduceUser"> + select t1.* from t_introduce_user t1 + <where> + <if test="query.shareUsersName!=null and query.shareUsersName!= ''"> + and t1.shareUsersName like concat('%',#{query.shareUsersName},'%') + </if> + <if test="query.shareUsersphone!=null and query.shareUsersphone!= ''"> + and t1.shareUsersphone like concat('%',#{query.shareUsersphone},'%') + </if> + <if test="query.userName!=null and query.userName!= ''"> + and t1.userName like concat('%',#{query.userName},'%') + </if> + <if test="query.userPhone!=null and query.userPhone!= ''"> + and t1.userPhone like concat('%',#{query.userPhone},'%') + </if> + <if test="query.introduceId!=null and query.introduceId!= ''"> + and t1.introduceRewards = #{query.introduceId} + </if> + </where> + </select> +</mapper> diff --git a/cloud-server-course/src/main/java/com/dsh/course/controller/CancelledClassesController.java b/cloud-server-course/src/main/java/com/dsh/course/controller/CancelledClassesController.java index 50fdbb4..ce1da41 100644 --- a/cloud-server-course/src/main/java/com/dsh/course/controller/CancelledClassesController.java +++ b/cloud-server-course/src/main/java/com/dsh/course/controller/CancelledClassesController.java @@ -1,16 +1,26 @@ package com.dsh.course.controller; import com.dsh.course.entity.CancelledClasses; +import com.dsh.course.entity.CoursePackageScheduling; +import com.dsh.course.entity.TCoursePackagePayment; import com.dsh.course.feignclient.account.AppUserClient; import com.dsh.course.feignclient.account.CoachClient; +import com.dsh.course.feignclient.account.StudentClient; +import com.dsh.course.feignclient.account.model.Coach; +import com.dsh.course.feignclient.account.model.Student; import com.dsh.course.feignclient.other.StoreClient; import com.dsh.course.model.CancelClassesQuery; import com.dsh.course.model.CancelClassesVO; -import com.dsh.course.service.CancelledClassesService; +import com.dsh.course.service.*; import org.checkerframework.checker.units.qual.A; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.text.SimpleDateFormat; +import java.time.LocalTime; +import java.time.format.DateTimeFormatter; +import java.util.ArrayList; +import java.util.Date; import java.util.List; /** @@ -29,17 +39,62 @@ private AppUserClient appUserClient; @Autowired private CoachClient coachClient; + @Autowired + private StudentClient studentClient; + @Autowired + private TCoursePackageService coursePackageService; + @Autowired + private TCoursePackagePaymentService coursePackagePaymentService; + @Autowired + private ICoursePackageSchedulingService coursePackageSchedulingService; + /** * 获取消课记录 */ @ResponseBody @PostMapping("/cancelledClasses/listAll") public List<CancelClassesVO> listAll(@RequestBody CancelClassesQuery query){ + + List<CancelClassesVO> res = new ArrayList<>(); + if (!query.getStudentName().equals("")){ + List<Integer> s = new ArrayList<>(); + List<Student> students = studentClient.queryStudentListByName(query.getStudentName()); + if (students.size()==0){ + return new ArrayList<>(); + } + for (Student coach : students) { + s.add(coach.getId()); + } + query.setStudentIds(s); + } + if (!query.getCoachName().equals("")){ + List<Integer> c = new ArrayList<>(); + List<Coach> coaches = coachClient.queryCoachListByName(query.getCoachName()); + if (coaches.size()==0){ + return new ArrayList<>(); + } + for (Coach coach : coaches) { + c.add(coach.getId()); + } + query.setCoachIds(c); + } List<CancelClassesVO> result = cancelledClassesService.listAll(query); for (CancelClassesVO cancelClassesVO : result) { + CoursePackageScheduling byId1 = coursePackageSchedulingService.getById(cancelClassesVO.getCoursePackageSchedulingId()); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String string = format.format(byId1.getClassDate()); + String string1 = format.format(byId1.getEndDate()); + String hour = string1.substring(11, 13); + String minute = string1.substring(14, 16); + // 去除后三位 + String s = string.substring(0, string.length() - 3); + String temp = s+"-"+hour+":"+ minute; + cancelClassesVO.setStartAndEnd(temp); + TCoursePackagePayment byId = coursePackagePaymentService.getById(cancelClassesVO.getCoursePackagePaymentId()); cancelClassesVO.setStoreName(storeClient.queryStoreById(cancelClassesVO.getStoreId()).getName()); - cancelClassesVO.setStudentName(appUserClient.queryAppUser(cancelClassesVO.getStudentId()).getName()); + cancelClassesVO.setStudentName(studentClient.queryStudentById(byId.getStudentId()).getName()); cancelClassesVO.setCoachName(coachClient.queryCoachById(cancelClassesVO.getCoachId()).getName()); + } return result; } diff --git a/cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentConfigController.java b/cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentConfigController.java index dc5c9f3..7e95285 100644 --- a/cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentConfigController.java +++ b/cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentConfigController.java @@ -21,6 +21,15 @@ /** + * 根据主键id获取价格配置 + * @return + */ + @ResponseBody + @PostMapping("/coursePackagePaymentConfig/getById") + public CoursePackagePaymentConfig getById(@RequestBody Integer id){ + return coursePackagePaymentConfigService.getById(id); + } + /** * 添加数据 * @param coursePackagePaymentConfig */ diff --git a/cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java b/cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java index 7c6bc1d..5cb017b 100644 --- a/cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java +++ b/cloud-server-course/src/main/java/com/dsh/course/controller/CoursePackagePaymentController.java @@ -121,10 +121,119 @@ @Resource private CoursePackageSchedulingMapper coursePackageSchedulingMapper; - + @Autowired + private ICoursePackageSchedulingService coursePackageSchedulingService; private final SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm"); + /** + * 添加购课记录-后台 + * @return + */ + @RequestMapping("/base/coursePackagePayment/add") + public Object addCoursePackagePayment(@RequestBody TCoursePackagePayment packagePayment){ + packagePayment.setInsertTime(new Date()); + packagePayment.setInsertTime(new Date()); + Integer studentId = packagePayment.getStudentId(); + TCoursePackagePayment one = packagePaymentService.getOne(new QueryWrapper<TCoursePackagePayment>().eq("studentId", packagePayment) + .orderByDesc("insertTime") + .last("LIMIT 1")); + if (one!=null){ + Integer totalClassHours = one.getTotalClassHours(); + Integer absencesNumber = one.getAbsencesNumber(); + // 没有过期 + if (one.getUseTime().after(new Date())){ + packagePayment.setTotalClassHours(packagePayment.getClassHours()+one.getTotalClassHours()); + packagePayment.setLaveClassHours(packagePayment.getClassHours()+one.getLaveClassHours()); + packagePayment.setAbsencesNumber(one.getAbsencesNumber()); + } + packagePayment.setTotalClassHours(packagePayment.getClassHours()); + packagePayment.setLaveClassHours(packagePayment.getClassHours()); + packagePayment.setAbsencesNumber(one.getAbsencesNumber()); + }else{ + packagePayment.setTotalClassHours(packagePayment.getClassHours()); + packagePayment.setLaveClassHours(packagePayment.getClassHours()); + packagePayment.setAbsencesNumber(0); + } + // 生成排课数据 + TCoursePackage coursePackage = tcpService.getById(packagePayment.getCoursePackageId()); + //生成排课数据 + try { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date date = sdf1.parse(sdf.format(new Date()) + " 00:00:00"); + List<String> list = Arrays.asList(coursePackage.getClassWeeks().split(";")); + String value = coursePackage.getClassStartTime(); + String value1 = coursePackage.getClassEndTime(); + + String[] star = value.split(","); + String[] end = value1.split(","); + for (int i = 0; i < star.length; i++) { + // int index = star[i].indexOf(","); + // + // + // String result = value.substring(0, index).trim(); + String classStartTime = star[i]; + String[] split = classStartTime.split(":"); + // String value1 = en; + int index1 = value1.indexOf(","); + // String result1 = value.substring(0, index1).trim(); + String classEndTime = end[i]; + String[] split1 = classEndTime.split(":"); + Calendar s = Calendar.getInstance(); + s.setTime(date); + s.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 1); + s.set(Calendar.HOUR_OF_DAY, Integer.valueOf(split[0])); + s.set(Calendar.MINUTE, Integer.valueOf(split[1])); + s.set(Calendar.SECOND, 0); + + Calendar e = Calendar.getInstance(); + e.setTime(date); + e.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 13); + long timeInMillis = e.getTimeInMillis(); + + while (true){ + int w = s.get(Calendar.DAY_OF_WEEK); + WeekEnum weekEnum = WeekEnum.getWeekEnum(w); + if(list.contains(weekEnum.getChineseName())){ + Calendar classDate = Calendar.getInstance(); + classDate.setTime(s.getTime()); + classDate.set(Calendar.HOUR_OF_DAY, Integer.valueOf(split[0])); + classDate.set(Calendar.MINUTE, Integer.valueOf(split[1])); + classDate.set(Calendar.SECOND, 0); + + Calendar endDate = Calendar.getInstance(); + endDate.setTime(s.getTime()); + endDate.set(Calendar.HOUR_OF_DAY, Integer.valueOf(split1[0])); + endDate.set(Calendar.MINUTE, Integer.valueOf(split1[1])); + endDate.set(Calendar.SECOND, 0); + + CoursePackageScheduling coursePackageScheduling = new CoursePackageScheduling(); + coursePackageScheduling.setCoursePackageId(coursePackage.getId()); + coursePackageScheduling.setClassDate(classDate.getTime()); + coursePackageScheduling.setEndDate(endDate.getTime()); + coursePackageScheduling.setStatus(1); + coursePackageSchedulingService.save(coursePackageScheduling); + List<CoursePackageScheduling> list1 = coursePackageSchedulingService.list(new QueryWrapper<CoursePackageScheduling>() + .eq("coursePackageId", coursePackage.getId()) + .eq("classDate", classDate.getTime()) + .eq("endDate", endDate.getTime())); + if (list.size()+1>coursePackage.getMaxSubscribeNumber()){ + // 当前课包预约人数已满 + return 5001; + } + } + s.set(Calendar.DAY_OF_YEAR, s.get(Calendar.DAY_OF_YEAR) + 1); + if(s.getTimeInMillis() > timeInMillis){ + break; + } + } + } + } catch (ParseException e) { + e.printStackTrace(); + } + return packagePaymentService.save(packagePayment); + } /** * 手动支付 * @return @@ -144,12 +253,14 @@ List<CoursePackagePaymentVO> result = new ArrayList<>(); for (CoursePackagePaymentVO re : res) { if (re.getCashPayment()==null){ - String value = String.valueOf(re.getPlayPaiCoin()); - re.setCashPayment(new BigDecimal(value)); + if (re.getPlayPaiCoin()!=null){ + String value = String.valueOf(re.getPlayPaiCoin()); + re.setCashPayment(new BigDecimal(value)); + } } Store store = storeClient.queryStoreById(re.getStoreId()); - AppUser appUser = appUserClient.queryAppUser(re.getAppUserId()); + TAppUser appUser = appUserClient.queryAppUser1(re.getAppUserId()); Student student = studentClient.queryStudentById(re.getStudentId()); re.setPayStudent(student.getName()); re.setPayUser(appUser.getName()); @@ -173,42 +284,38 @@ } } } - - if (re.getPayType()==1){ - re.setBuyTypeName("微信支付"); - }else if(re.getPayType()==2){ - re.setBuyTypeName("支付宝支付"); - }else if(re.getPayType()==3){ - re.setBuyTypeName("玩湃币支付"); - }else if(re.getPayType()==4){ - re.setBuyTypeName("积分支付"); - }else if(re.getPayType()==5){ - re.setBuyTypeName("积分+微信支付"); - }else if(re.getPayType()==6){ - re.setBuyTypeName("积分+支付宝支付"); - }else if(re.getPayType()==7){ - re.setBuyTypeName("手动支付"+"-"+re.getBuyTypeName()); - } - // 如果支付用户类型为平台 则购买方式则为1线下购买 - if (re.getPayUserType()== 2){ - re.setBuyType(1); - }else{ - // 如果当前课包有折扣 则为3折扣购买 - if (discountService.list(new QueryWrapper<TCoursePackageDiscount>() - .eq("coursePackageId",re.getCoursePackageId()).eq("auditStatus",2)).size()>0){ - re.setBuyType(3); - re.setDiscountAmount(re.getOriginalPrice().subtract(re.getPayMoney())); - }else{ - re.setBuyType(2); + if (re.getPayType()!=null){ + if (re.getPayType()==1){ + re.setBuyTypeName("微信支付"); + }else if(re.getPayType()==2){ + re.setBuyTypeName("支付宝支付"); + }else if(re.getPayType()==3){ + re.setBuyTypeName("玩湃币支付"); + }else if(re.getPayType()==4){ + re.setBuyTypeName("积分支付"); + }else if(re.getPayType()==5){ + re.setBuyTypeName("积分+微信支付"); + }else if(re.getPayType()==6){ + re.setBuyTypeName("积分+支付宝支付"); + }else if(re.getPayType()==7){ + re.setBuyTypeName("手动支付"+"-"+re.getBuyTypeName()); } } - // 不为空则计算 - if (re.getUserCouponId()!=null){ + // 如果支付用户类型为管理员 则购买方式则为1线下购买 + if (re.getPayUserType()== 2){ + re.setBuyType(1); + }else{ + // 如果当前课包有折扣 则为3折扣购买 + if (discountService.list(new QueryWrapper<TCoursePackageDiscount>() + .eq("coursePackageId",re.getCoursePackageId()).eq("auditStatus",2)).size()>0){ + re.setBuyType(3); + re.setDiscountAmount(re.getOriginalPrice().subtract(re.getPayMoney())); + }else{ + re.setBuyType(2); + } + } } - // todo 计算优惠金额 -// Coupon coupon = couponClient.queryCouponById(re.getUserCouponId().intValue()); - } if (query.getPayStudent()== null || query.getPayStudent().equals("")){ if (query.getPayUser()== null || query.getPayUser().equals("")){ return res; @@ -1069,7 +1176,7 @@ @PostMapping("/base/coursePack/savePaymentCoursePackage") public boolean savePaymentCoursePackage(@RequestBody TCoursePackagePayment packagePayment){ - packagePayment.setInsertTime(new Date()); + return packagePaymentService.save(packagePayment); } diff --git a/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/AppUserClient.java b/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/AppUserClient.java index 233d34b..60510a1 100644 --- a/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/AppUserClient.java +++ b/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/AppUserClient.java @@ -3,8 +3,11 @@ import com.dsh.course.entity.dto.SelectDto; import com.dsh.course.feignclient.account.model.AppUser; import com.dsh.course.feignclient.account.model.TCourseInfoRecord; +import com.dsh.course.model.TAppUser; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; @@ -20,6 +23,15 @@ * @param appUserId * @return */ + + @PostMapping("/base/appUser/queryAppUser1") + TAppUser queryAppUser1(@RequestBody Integer appUserId); + + /** + * 根据用户id获取用户信息 + * @param appUserId + * @return + */ @PostMapping("/base/appUser/queryAppUser") AppUser queryAppUser(Integer appUserId); diff --git a/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/CoachClient.java b/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/CoachClient.java index bca45cd..a6b7eed 100644 --- a/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/CoachClient.java +++ b/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/CoachClient.java @@ -2,9 +2,12 @@ import com.dsh.course.feignclient.account.model.Coach; +import com.dsh.course.feignclient.account.model.Student; 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(value = "mb-cloud-account") public interface CoachClient { @@ -12,4 +15,13 @@ @PostMapping("/coach/queryCoachById") Coach queryCoachById(@RequestBody Integer id); + /** + * 根据名称模糊搜索数据 + * @param name + * @return + */ + @PostMapping("/coach/queryCoachListByName") + List<Coach> queryCoachListByName(String name); + + } diff --git a/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/model/Coach.java b/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/model/Coach.java index a961475..67e911a 100644 --- a/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/model/Coach.java +++ b/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/model/Coach.java @@ -2,6 +2,7 @@ import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.util.Date; @@ -55,6 +56,7 @@ /** * 生日 */ + @JsonFormat(pattern = "yyyy-MM-dd") private Date birthday; /** * 性别(1=男,2=女) @@ -99,6 +101,7 @@ /** * 添加时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") private Date insertTime; } diff --git a/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/model/Student.java b/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/model/Student.java index 9f62653..2f41ab3 100644 --- a/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/model/Student.java +++ b/cloud-server-course/src/main/java/com/dsh/course/feignclient/account/model/Student.java @@ -27,7 +27,7 @@ /** * 生日 */ - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date birthday; /** * 性别(1=男,2=女) diff --git a/cloud-server-course/src/main/java/com/dsh/course/model/CancelClassesQuery.java b/cloud-server-course/src/main/java/com/dsh/course/model/CancelClassesQuery.java index 728b3fc..46971a8 100644 --- a/cloud-server-course/src/main/java/com/dsh/course/model/CancelClassesQuery.java +++ b/cloud-server-course/src/main/java/com/dsh/course/model/CancelClassesQuery.java @@ -2,6 +2,8 @@ import lombok.Data; +import java.util.List; + /** * 消课记录列表查询Query */ @@ -15,4 +17,8 @@ private String courseName; // 消课时间 private String time; + // 教练ids + private List<Integer> coachIds; + // 学员ids + private List<Integer> studentIds; } diff --git a/cloud-server-course/src/main/java/com/dsh/course/model/CancelClassesVO.java b/cloud-server-course/src/main/java/com/dsh/course/model/CancelClassesVO.java index 2a3cfa2..07354cb 100644 --- a/cloud-server-course/src/main/java/com/dsh/course/model/CancelClassesVO.java +++ b/cloud-server-course/src/main/java/com/dsh/course/model/CancelClassesVO.java @@ -1,5 +1,6 @@ package com.dsh.course.model; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.util.Date; @@ -30,7 +31,13 @@ // 教练id private Integer coachId; // 消课时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8") private Date insertTime; private String courseName; private String startAndEnd; + private String voucher; + private Integer cancelledClassesNumber; + private Long coursePackagePaymentId; + private Long coursePackageSchedulingId; + } diff --git a/cloud-server-course/src/main/java/com/dsh/course/model/TAppUser.java b/cloud-server-course/src/main/java/com/dsh/course/model/TAppUser.java new file mode 100644 index 0000000..4db748b --- /dev/null +++ b/cloud-server-course/src/main/java/com/dsh/course/model/TAppUser.java @@ -0,0 +1,165 @@ +package com.dsh.course.model; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * <p> + * 用户信息 + * </p> + * + * @author administrator + * @since 2023-06-14 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("t_app_user") +public class TAppUser { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + /** + * 编号 + */ + @TableField("code") + private String code; + /** + * 姓名 + */ + @TableField("name") + private String name; + /** + * 电话 + */ + @TableField("phone") + private String phone; + /** + * 密码 + */ + @TableField("password") + private String password; + /** + * 生日 + */ + @TableField("birthday") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") + private Date birthday; + /** + * 性别(1=男,2=女) + */ + @TableField("gender") + private Integer gender; + /** + * 身高 + */ + @TableField("height") + private Double height; + /** + * 体重 + */ + @TableField("weight") + private Double weight; + /** + * bmi健康值 + */ + @TableField("bmi") + private Double bmi; + /** + * 身份证号 + */ + @TableField("idCard") + private String idCard; + /** + * 微信openid + */ + @TableField("openid") + private String openid; + /** + * 省 + */ + @TableField("province") + private String province; + /** + * 省编号 + */ + @TableField("provinceCode") + private String provinceCode; + /** + * 市 + */ + @TableField("city") + private String city; + /** + * 市编号 + */ + @TableField("cityCode") + private String cityCode; + /** + * 是否是年度会员(0=否,1=是) + */ + @TableField("isVip") + private Integer isVip; + /** + * 会员有效期 + */ + @TableField("vipEndTime") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date vipEndTime; + /** + * 会员等级id + */ + @TableField("viplevelId") + private Integer viplevelId; + /** + * 推荐用户id + */ + @TableField("referralUserId") + private Integer referralUserId; + /** + * 销售员id + */ + @TableField("salesmanUserId") + private Integer salesmanUserId; + /** + * 状态(1=正常,2=冻结,3=删除) + */ + @TableField("state") + private Integer state; + /** + * 剩余积分 + */ + @TableField("integral") + private Integer integral; + /** + * 玩湃币 + */ + @TableField("playPaiCoins") + private Integer playPaiCoins; + /** + * 用户头像 + */ + @TableField("headImg") + private String headImg; + /** + * 添加时间 + */ + @TableField("insertTime") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date insertTime; + + +} diff --git a/cloud-server-course/src/main/resources/mapper/CancelledClassesMapper.xml b/cloud-server-course/src/main/resources/mapper/CancelledClassesMapper.xml index d3b7939..eaee487 100644 --- a/cloud-server-course/src/main/resources/mapper/CancelledClassesMapper.xml +++ b/cloud-server-course/src/main/resources/mapper/CancelledClassesMapper.xml @@ -7,22 +7,31 @@ t1.*, t2.name, CONCAT(t2.province, t2.city) AS provinceAndCity, - t2.storeId, - CONCAT(t3.classDate, t3.endDate) AS startAndEnd + t2.storeId,t2.coachId, + t2.name as courseName,t2.coachId,t3.studentId FROM t_cancelled_classes t1 - LEFT JOIN - t_course_package t2 ON t1.coursePackageId = t2.id - LEFT JOIN (SELECT id,classDate,endDate FROM t_course_package_scheduling - ) t3 - ON t1.coursePackageSchedulingId = t3.id + LEFT JOIN t_course_package t2 ON t1.coursePackageId = t2.id + inner join t_course_package_payment t3 on t1.coursePackagePaymentId = t3.id <where> <if test="query.courseName!=null and query.courseName!= ''"> - and t5.name = #{query.courseName} + and t2.name = #{query.courseName} </if> <if test="sTime !=null and sTime!= '' and eTime !=null and eTime!= ''"> and t1.insertTime between #{sTime} and #{eTime} </if> + <if test="query.studentIds != null and query.studentIds.size()>0"> + AND t3.studentId IN + <foreach collection="query.studentIds" separator="," item="id" open="(" close=")"> + #{id} + </foreach> + </if> + <if test="query.coachIds != null and query.coachIds.size()>0"> + AND t2.coachId IN + <foreach collection="query.coachIds" separator="," item="id" open="(" close=")"> + #{id} + </foreach> + </if> </where> </select> diff --git a/cloud-server-course/src/main/resources/mapper/CoursePackagePaymentConfigMapper.xml b/cloud-server-course/src/main/resources/mapper/CoursePackagePaymentConfigMapper.xml index d9da3d6..42c3b49 100644 --- a/cloud-server-course/src/main/resources/mapper/CoursePackagePaymentConfigMapper.xml +++ b/cloud-server-course/src/main/resources/mapper/CoursePackagePaymentConfigMapper.xml @@ -12,11 +12,11 @@ <result column="playPaiCoin" property="playPaiCoin" /> </resultMap> <update id="changeState"> - update t_course_package_payment2 set + update t_course_package_payment set payStatus = 2,payUserName = #{payUserName},payType = 7,payUserId=#{payUserId} <where> <if test="ids != null and ids.size()>0"> - AND t_course_package_payment2.id IN + AND t_course_package_payment.id IN <foreach collection="ids" separator="," item="id" open="(" close=")"> #{id} </foreach> @@ -29,7 +29,7 @@ t1.payUserName as buyTypeName, CONCAT(t2.province,t2.city) as provinceAndCity,t2.coursePackageTypeId,t2.storeId,t2.name as coursePackage, t3.name as coursePackageType - from t_course_package_payment2 t1 + from t_course_package_payment t1 left join t_course_package t2 on t1.coursePackageId = t2.id left join t_course_package_type t3 on t2.coursePackageTypeId = t3.id <where> diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/AppUserClient.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/AppUserClient.java index 88eb6bf..0784709 100644 --- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/AppUserClient.java +++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/AppUserClient.java @@ -9,6 +9,8 @@ import com.dsh.course.dto.TStudentDto; import com.dsh.course.feignClient.account.model.QueryByNamePhone; import com.dsh.course.feignClient.account.model.TAppUser; +import com.dsh.course.feignClient.other.model.SiteChangeStateVO; +import com.dsh.guns.modular.system.model.AdvertisementChangeStateDTO; import com.dsh.guns.modular.system.model.TStudent; import com.dsh.guns.modular.system.model.dto.GiftSearchDto; import com.dsh.guns.modular.system.model.dto.SelectDto; @@ -21,6 +23,19 @@ @FeignClient("mb-cloud-account") public interface AppUserClient { + + /** + * 根据用户id获取用户信息 + * @param appUserId + * @return + */ + @PostMapping("/base/appUser/queryAppUser1") + TAppUser queryAppUser1(@RequestBody Integer appUserId); + /** + * 冻结/解冻 1=解冻 2=冻结 + */ + @RequestMapping("/base/appUser/changeState") + Object changeState(@RequestBody AdvertisementChangeStateDTO dto); /** * 后台添加 */ diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/StudentClient.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/StudentClient.java new file mode 100644 index 0000000..d9093f3 --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/account/StudentClient.java @@ -0,0 +1,36 @@ +package com.dsh.course.feignClient.account; + +import com.dsh.course.dto.CreateHistoryDto; +import com.dsh.course.dto.GetHistoryDto; +import com.dsh.course.dto.StudentSearch; +import com.dsh.course.dto.TStudentDto; +import com.dsh.course.feignClient.account.model.QueryAppUser; +import com.dsh.course.feignClient.account.model.QueryAppUserVO; +import com.dsh.course.feignClient.account.model.QueryByNamePhone; +import com.dsh.course.feignClient.account.model.TAppUser; +import com.dsh.guns.modular.system.model.TStudent; +import com.dsh.guns.modular.system.model.dto.GiftSearchDto; +import com.dsh.guns.modular.system.model.dto.SelectDto; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +@FeignClient("mb-cloud-account") +public interface StudentClient { + + /** + * 获取用户学员列表 + * @param appUserId + * @return + */ + @PostMapping("/student/queryStudentList") + List<TStudent> queryStudentList(@RequestBody Integer appUserId); + + /** + * 添加学员 + * @return + */ + @RequestMapping("/base/student/addStudent") + Object addStudent(@RequestBody TStudent student); +} diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/IntroduceClient.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/IntroduceClient.java new file mode 100644 index 0000000..0b2d7c1 --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/IntroduceClient.java @@ -0,0 +1,53 @@ +package com.dsh.course.feignClient.activity; + + +import com.dsh.course.feignClient.activity.model.*; +import com.dsh.guns.modular.system.model.*; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; + +import java.util.List; +import java.util.Map; + +/** + * 介绍有礼 + */ +@FeignClient(value = "mb-cloud-activity") +public interface IntroduceClient { + + + /** + * 获取介绍有礼-参与用户记录表 + * @return + */ + @RequestMapping("/base/introduceUser/listAllUser") + List<IntroduceUser> listAllUser(@RequestBody IntroduceUserQuery query); + /** + * 上/下架介绍有礼 type = 1上架 type=2下架 + * @return + */ + @RequestMapping("/base/introduce/changeState") + Object changeState(@RequestBody IntroduceChangeStateDTO dto); + /** + * 通过id获取介绍有礼 + * @return + */ + @RequestMapping("/base/introduce/getInfoById") + IntroduceRewards getInfoById(@RequestBody Integer id); + + /** + * 获取介绍有礼记录表 + * @return + */ + @RequestMapping("/base/introduce/listAll") + List<IntroduceVO> listAll(@RequestBody IntroduceQuery query); + /** + * 增加/修改介绍有礼记录 + * @return + */ + @RequestMapping("/base/introduce/addIntroduce") + Object addIntroduce(@RequestBody IntroduceRewards introduceRewards); + +} diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/IntroduceRewards.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/IntroduceRewards.java new file mode 100644 index 0000000..f0fcfa3 --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/activity/model/IntroduceRewards.java @@ -0,0 +1,92 @@ +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 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-06-29 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("t_introduce_rewards") +public class IntroduceRewards extends Model<IntroduceRewards> { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + /** + * 省 + */ + @TableField("province") + private String province; + /** + * 省编号 + */ + @TableField("provinceCode") + private String provinceCode; + /** + * 市 + */ + @TableField("city") + private String city; + /** + * 市编号 + */ + @TableField("cityCode") + private String cityCode; + /** + * 开始时间 + */ + @TableField("startTime") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8") + private Date startTime; + /** + * 结束时间 + */ + @TableField("endTime") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8") + private Date endTime; + /** + * 赠送课时 + */ + @TableField("giveClass") + private Integer giveClass; + /** + * 状态(1=正常,2=冻结,3=删除) + */ + @TableField("state") + private Integer state; + /** + * 添加时间 + */ + @TableField("insertTime") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private Date insertTime; + + + @Override + protected Serializable pkVal() { + return this.id; + } + +} diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackagePaymentClient.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackagePaymentClient.java index 76e484f..ab4fff6 100644 --- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackagePaymentClient.java +++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackagePaymentClient.java @@ -23,6 +23,13 @@ @FeignClient("mb-cloud-course") public interface CoursePackagePaymentClient { + + /** + * 添加购课记录-后台 + * @return + */ + @RequestMapping("/base/coursePackagePayment/add") + Object addCoursePackagePayment(@RequestBody com.dsh.guns.modular.system.model.TCoursePackagePayment coursePackagePayment); /** * 获取学员剩余课时 * @param id diff --git a/cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackagePaymentConfigClient.java b/cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackagePaymentConfigClient.java index 8f8663b..3a42a78 100644 --- a/cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackagePaymentConfigClient.java +++ b/cloud-server-management/src/main/java/com/dsh/course/feignClient/course/CoursePackagePaymentConfigClient.java @@ -3,6 +3,8 @@ import com.dsh.course.feignClient.course.model.CoursePackagePaymentConfig; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; @@ -13,7 +15,12 @@ */ @FeignClient("mb-cloud-course") public interface CoursePackagePaymentConfigClient { - + /** + * 根据主键id获取价格配置 + * @return + */ + @PostMapping("/coursePackagePaymentConfig/getById") + CoursePackagePaymentConfig getById(@RequestBody Integer id); /** * 添加数据 diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/CoursePackagePaymentController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/CoursePackagePaymentController.java index b271101..6e8ad57 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/CoursePackagePaymentController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/CoursePackagePaymentController.java @@ -15,6 +15,7 @@ import com.dsh.guns.config.UserExt; import com.dsh.guns.core.base.controller.BaseController; import com.dsh.guns.modular.system.model.*; +import com.dsh.guns.modular.system.model.TCoursePackagePayment; import com.dsh.guns.modular.system.service.ICityService; import com.dsh.guns.modular.system.service.ICoursePackageService; import com.dsh.guns.modular.system.service.IStoreService; @@ -24,10 +25,8 @@ import org.springframework.ui.Model; import org.springframework.web.bind.annotation.*; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; -import java.util.Map; +import java.math.BigDecimal; +import java.util.*; /** * 广告管理控制器 @@ -57,8 +56,7 @@ private CoursePackagePaymentConfigClient coursePackagePaymentConfigClient; @Autowired private CoursePackageClient coursePackageClient; - @Autowired - private SiteClient siteClient; + /** * 跳转到购课记录页面 */ @@ -87,24 +85,33 @@ * 添加购课记录 */ @ResponseBody - @RequestMapping(value = "/addCoursePackagePayment") - public ResultUtil addCoach(@RequestBody TCoursePackagePayment tCoursePackagePayment) { + @PostMapping(value = "/addCoursePackagePayment/{id}") + public ResultUtil addCoach(@RequestBody TCoursePackagePayment tCoursePackagePayment, @PathVariable("id")Integer id) { Integer objectId = UserExt.getUser().getObjectId(); + Integer objectType = UserExt.getUser().getObjectType(); + String name = UserExt.getUser().getName(); tCoursePackagePayment.setPayUserId(objectId); // 获取课包id Integer coursePackageId = tCoursePackagePayment.getCoursePackageId(); - List<TCoursePackageDiscount> list = coursePackageDiscountClient.queryByCoursePackageId(coursePackageId); TCoursePackageDiscount tCoursePackageDiscount1 = list.get(0); - Integer coursePackagePaymentConfigId = tCoursePackageDiscount1.getCoursePackagePaymentConfigId(); - List<CoursePackagePaymentConfig> coursePackagePaymentConfigs = coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(coursePackageId); - // 获取siteId 判断预约人数 - // todo + // 获取当前课包价格配置 + CoursePackagePaymentConfig coursePackagePaymentConfigs = coursePackagePaymentConfigClient.getById(id); Integer coursePackageId1 = tCoursePackagePayment.getCoursePackageId(); TCoursePackage tCoursePackage = coursePackageClient.queryById(coursePackageId1); - Integer siteId = tCoursePackage.getSiteId(); -// tCoursePackagePayment.setCashPayment(); -// tCoursePackagePayment.setPlayPaiCoin(); + Double cashPayment = coursePackagePaymentConfigs.getCashPayment(); + String c1 = Double.toString(cashPayment); + BigDecimal bigDecimal = new BigDecimal(c1); + tCoursePackagePayment.setCashPayment(bigDecimal); + Date currentDate = new Date(); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(currentDate); + calendar.add(Calendar.DAY_OF_MONTH, 20); + Date updatedDate = calendar.getTime(); + tCoursePackagePayment.setOriginalPrice(cashPayment); + tCoursePackagePayment.setUseTime(updatedDate); + tCoursePackagePayment.setPlayPaiCoin(coursePackagePaymentConfigs.getPlayPaiCoin()); + coursePackagePaymentClient.addCoursePackagePayment(tCoursePackagePayment); return ResultUtil.success("添加成功"); } /** @@ -117,7 +124,7 @@ } /** - * 获取列表 + * 手动支付 */ @RequestMapping(value = "/pay") @ResponseBody @@ -156,6 +163,14 @@ return storeClient.getStore(city); } + /** + * 根据课包id 获取课时规格 + */ + @RequestMapping(value = "/getCoursePackageConfig") + @ResponseBody + public List<CoursePackagePaymentConfig> getCoursePackageConfig(Integer id) { + return coursePackagePaymentConfigClient.queryCoursePackagePaymentConfigList(id); + } } diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAppUserController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAppUserController.java index 4eaf1b4..79b3940 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAppUserController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TAppUserController.java @@ -6,12 +6,14 @@ import com.dsh.course.feignClient.account.AppUserClient; import com.dsh.course.feignClient.account.CityManagerClient; import com.dsh.course.feignClient.account.StoreStaffClient; +import com.dsh.course.feignClient.account.StudentClient; import com.dsh.course.feignClient.account.model.*; import com.dsh.course.feignClient.activity.BodySideAppointmentClient; import com.dsh.course.feignClient.activity.model.BodySideAppointment; import com.dsh.course.feignClient.activity.model.QueryBodySideAppointment; import com.dsh.course.feignClient.activity.model.QueryBodySideAppointmentVO; import com.dsh.course.feignClient.other.StoreClient; +import com.dsh.course.feignClient.other.model.SiteChangeStateVO; import com.dsh.guns.config.UserExt; import com.dsh.guns.modular.system.model.*; import com.dsh.guns.modular.system.service.ICityService; @@ -56,7 +58,8 @@ private ICityService cityService; @Autowired private IRoleService roleService; - + @Autowired + private StudentClient studentClient; /** * 跳转体测预约管理首页 */ @@ -88,27 +91,12 @@ /** * 跳转体测预约管理添加页面 */ - @RequestMapping("/addStudent") - public String addStudent(Model model) { + @RequestMapping("/addStudent/{appUserId}") + public String addStudent(Model model,@PathVariable("appUserId") Integer appUserId) { Integer roleType = UserExt.getUser().getObjectType(); - List<CityManager> province = cityManagerClient.listAll(); - Set<String> seenNames = new HashSet<>(); - List<CityManager> result = new ArrayList<>(); - for (CityManager cityManager : province) { - if(!seenNames.contains(cityManager.getProvince())){ - result.add(cityManager); - seenNames.add(cityManager.getProvince()); - } - } - if (roleType == 2){ - Integer cityManagerId = UserExt.getUser().getObjectId(); - CityManager cityManager = cityManagerClient.queryCityManagerById(cityManagerId); - List<Store> stores = storeClient.getStoreByCityManagerId(cityManagerId); - model.addAttribute("stores",stores); - } - model.addAttribute("list",result); - - model.addAttribute("roleType",roleType); + TAppUser tAppUser = appUserClient.queryById(appUserId); + model.addAttribute("data",tAppUser); + model.addAttribute("name",tAppUser.getName()); return PREFIX + "TAppUser_addStudent.html"; } /** @@ -139,6 +127,13 @@ String format3 = format2.format(data.getVipEndTime()); model.addAttribute("vipEndTime",format3); } + if (data.getViplevelId()!=null){ + // todo创建会员等级表 + model.addAttribute("level","黄金"); + } + model.addAttribute("level","黄金"); + List<TStudent> tStudents = studentClient.queryStudentList(data.getId()); + model.addAttribute("students",tStudents); return PREFIX + "TAppUser_edit.html"; } @@ -197,49 +192,26 @@ Object o = appUserClient.addAppUser1(appUser); return o; } - /** - * 添加/修改体测预约记录 - */ - @ResponseBody - @RequestMapping(value = "/addBodySideAppointments") - public ResultUtil addBodySideAppointments(@RequestBody QueryBodySideAppointmentVO vo) { - Integer roleType = UserExt.getUser().getObjectType(); - // 获取当前登录人id - Integer cityManagerId = UserExt.getUser().getObjectId(); - if (roleType == 2){ - CityManager cityManager = cityManagerClient.queryCityManagerById(cityManagerId); - vo.setProvince(cityManager.getProvince()); - vo.setProvinceCode(cityManager.getProvinceCode()); - vo.setCity(cityManager.getCity()); - vo.setCityCode(cityManager.getCityCode()); - }else if (roleType == 3){ - TStoreStaff storeByStoreStaffId = storeStaffClient.getStoreByStoreStaffId(cityManagerId); - Store storeById = storeClient.getStoreById(storeByStoreStaffId.getStoreId()); - vo.setProvince(storeById.getProvince()); - vo.setProvinceCode(storeById.getProvinceCode()); - vo.setCity(storeById.getCity()); - vo.setCityCode(storeById.getCityCode()); - } - bodySideAppointmentClient.addBodySideAppointments(vo); - return ResultUtil.success("添加成功"); - } /** - * 添加/修改体测预约记录 + * 新增学员 + * @return */ + @RequestMapping("/addAppUserStudent") @ResponseBody - @RequestMapping(value = "/getInfoById") - public BodySideAppointment getInfoById(@RequestBody Integer id) { - return bodySideAppointmentClient.getInfoById(id); + public Object addAppUser(@RequestBody TStudent student){ + return studentClient.addStudent(student); } - /** - * 手动标记用户已经到店并完成体测 + * 上/下架 1为上架 2为下架 3为删除 + * + * @return */ + @RequestMapping("/changeState") @ResponseBody - @RequestMapping(value = "/changeState") - public Object changeState(@RequestBody List<Integer> ids) { - return bodySideAppointmentClient.changeState(ids); + public Object changeState(@RequestBody AdvertisementChangeStateDTO dto){ + appUserClient.changeState(dto); + return ResultUtil.success(); } } diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TIntroductionCourtesyController.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TIntroductionCourtesyController.java index 8b6d2ba..9f3ecf9 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TIntroductionCourtesyController.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TIntroductionCourtesyController.java @@ -2,17 +2,23 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.dsh.course.feignClient.account.model.TAppUser; +import com.dsh.course.feignClient.activity.IntroduceClient; +import com.dsh.course.feignClient.activity.model.IntroduceRewards; import com.dsh.course.feignClient.other.model.Banner; -import com.dsh.guns.modular.system.model.AdvertisementQuery; -import com.dsh.guns.modular.system.model.IntroduceQuery; -import com.dsh.guns.modular.system.model.TCity; +import com.dsh.guns.modular.system.model.*; import com.dsh.guns.modular.system.service.ICityService; +import com.dsh.guns.modular.system.util.ResultUtil; 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.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; +import java.text.SimpleDateFormat; import java.util.List; /** @@ -27,6 +33,20 @@ @Autowired private ICityService cityService; + @Autowired + private IntroduceClient introduceClient; + + /** + * 上/下架 1为上架 2为下架 + * + * @return + */ + @RequestMapping("/changeState") + @ResponseBody + public Object changeState(@RequestBody IntroduceChangeStateDTO dto){ + introduceClient.changeState(dto); + return ResultUtil.success(); + } /** * 介绍有礼列表页 @@ -38,36 +58,70 @@ return PREFIX + "introduce.html"; } /** + * 介绍有礼-参与用户列表页 + */ + @RequestMapping("/user/{id}") + public String index(Model model,@PathVariable("id")Integer id) { + // 介绍有礼id + model.addAttribute("id",id); + return PREFIX + "introduce_user.html"; + } + /** * 介绍有礼添加页 */ @RequestMapping("/add") public String add(Model model) { List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); + model.addAttribute("list",list); return PREFIX + "introduce_add.html"; } /** * 介绍有礼编辑页 */ - @RequestMapping("/update") - public String update(Model model) { - return PREFIX + "introduce_update.html"; - } - /** - * 介绍有礼-参与用户页 - */ - @RequestMapping("/joinUser") - public String joinUser(Model model) { - return PREFIX + "introduce_user.html"; + @RequestMapping("/update/{id}") + public String update(Model model, @PathVariable("id")Integer id) { + IntroduceRewards data = introduceClient.getInfoById(id); + List<TCity> list = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, 0)); + TCity province1 = cityService.getOne(new QueryWrapper<TCity>().eq("name", data.getProvince())); + List<TCity> city = cityService.list(new LambdaQueryWrapper<TCity>().eq(TCity::getParentId, province1.getId())); + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + String format1 = format.format(data.getStartTime()); + String format2 = format.format(data.getEndTime()); + model.addAttribute("data",data); + model.addAttribute("startTime",format1); + model.addAttribute("endTime",format2); + model.addAttribute("list",list); + model.addAttribute("city",city); + return PREFIX + "introduce_edit.html"; } + /** - * 获取介绍有利记录列表 + * 获取介绍有礼记录列表 */ @RequestMapping(value = "/listAll") @ResponseBody - public List<Banner> listAll(IntroduceQuery query) { + public List<IntroduceVO> listAll(IntroduceQuery query) { - return null; + return introduceClient.listAll(query); + } + + /** + * 获取介绍有礼记录列表 + */ + @RequestMapping(value = "/listAllUser") + @ResponseBody + public List<IntroduceUser> listAll(IntroduceUserQuery query) { + return introduceClient.listAllUser(query); + } + /** + * 新增介绍有礼记录表 + * @return + */ + @RequestMapping("/addIntroduce") + @ResponseBody + public Object addAppUser(@RequestBody IntroduceRewards introduceRewards){ + return introduceClient.addIntroduce(introduceRewards); } } diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/CancelClassesQuery.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/CancelClassesQuery.java index 3016dc7..27fd6a7 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/CancelClassesQuery.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/CancelClassesQuery.java @@ -2,6 +2,8 @@ import lombok.Data; +import java.util.List; + /** * 消课记录列表查询Query */ @@ -15,4 +17,8 @@ private String courseName; // 消课时间 private String time; + // 教练ids + private List<Integer> coachIds; + // 学员ids + private List<Integer> studentIds; } diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/CancelClassesVO.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/CancelClassesVO.java index 1e84649..e0a0f42 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/CancelClassesVO.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/CancelClassesVO.java @@ -1,5 +1,6 @@ package com.dsh.guns.modular.system.model; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.util.Date; @@ -30,7 +31,12 @@ // 教练id private Integer coachId; // 消课时间 + @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8") private Date insertTime; private String courseName; private String startAndEnd; + private String voucher; + private Integer cancelledClassesNumber; + private Long coursePackagePaymentId; + private Long coursePackageSchedulingId; } diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceQuery.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceQuery.java index 9319c9b..28e6a5e 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceQuery.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceQuery.java @@ -10,7 +10,7 @@ // 省 private String province; // 市 - private String page; + private String city; // 状态 private Integer state; // 活动状态 diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceUser.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceUser.java new file mode 100644 index 0000000..b4266b7 --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceUser.java @@ -0,0 +1,29 @@ +package com.dsh.guns.modular.system.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.models.auth.In; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; + +/** + * 介绍有礼参与用户实体类 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class IntroduceUser { + private Integer id; + // 分享用户id + private Integer shareUsers; + private String shareUsersName; + private String shareUsersphone; + private String userName; + private Integer userId; + private String userPhone; + private Integer introduceRewards; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private Date registerTime; +} diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceUserQuery.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceUserQuery.java new file mode 100644 index 0000000..48c9b9d --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceUserQuery.java @@ -0,0 +1,20 @@ +package com.dsh.guns.modular.system.model; + +import lombok.Data; + +/** + * 介绍有礼-参与用户列表查询Query + */ +@Data +public class IntroduceUserQuery { + // 介绍有礼id + private Integer introduceId; + // 分享用户姓名 + private String shareUsersName; + // 分享用户i淡化 + private String shareUsersphone; + // 被分享用户姓名 + private Integer userName; + // 被分享用户电话 + private Integer userPhone; +} diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceVO.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceVO.java index 3157bcb..ec328d0 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceVO.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/IntroduceVO.java @@ -23,9 +23,9 @@ */ private Integer id; private String provinceAndCity; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date startTime; - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private Date endTime; private Integer giveClass; private Integer number; diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/RechargeRecordsVO.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/RechargeRecordsVO.java index 19b668a..1b092e2 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/RechargeRecordsVO.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/RechargeRecordsVO.java @@ -27,7 +27,7 @@ private String provinceAndCity; private String name; private String phone; - private Date time; + private Date payTime; private BigDecimal amount; private Integer playPaiCoins; /** diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TCoursePackagePayment.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TCoursePackagePayment.java new file mode 100644 index 0000000..b716e68 --- /dev/null +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TCoursePackagePayment.java @@ -0,0 +1,162 @@ +package com.dsh.guns.modular.system.model; + +import com.baomidou.mybatisplus.annotation.*; +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.math.BigDecimal; +import java.util.Date; + +/** + * <p> + * 用户课程包购买记录 + * </p> + * + * @author administrator + * @since 2023-06-14 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@Accessors(chain = true) +@TableName("t_course_package_payment") +public class TCoursePackagePayment extends Model<TCoursePackagePayment>{ + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @TableId(value = "id", type = IdType.NONE) + @TableField(updateStrategy = FieldStrategy.NEVER) + private Long id; + /** + * 业务编号 + */ + @TableField("code") + private String code; + /** + * 用户id + */ + @TableField("appUserId") + private Integer appUserId; + /** + * 学员id + */ + @TableField("studentId") + private Integer studentId; + /** + * 课包id + */ + @TableField("coursePackageId") + private Integer coursePackageId; + /** + * 支付方式(1=微信,2=支付宝,3=玩湃币,4=积分,5=积分+微信,6=积分+支付宝) + */ + @TableField("payType") + private Integer payType; + /** + * 课时数 + */ + @TableField("classHours") + private Integer classHours; + /** + * 原价 + */ + @TableField("originalPrice") + private Double originalPrice; + /** + * 优惠券id + */ + @TableField("userCouponId") + private Long userCouponId; + /** + * 现金支付价格 + */ + @TableField("cashPayment") + private BigDecimal cashPayment; + /** + * 玩湃币价格/积分 + */ + @TableField("playPaiCoin") + private Integer playPaiCoin; + /** + * 总课时 + */ + @TableField("totalClassHours") + private Integer totalClassHours; + /** + * 剩余课时 + */ + @TableField("laveClassHours") + private Integer laveClassHours; + /** + * 缺课次数 + */ + @TableField("absencesNumber") + private Integer absencesNumber; + /** + * 退课课时 + */ + @TableField(exist = false) + private Integer dropoutsNumber; + /** + * 支付用户类型(1=用户,2=管理员) + */ + @TableField("payUserType") + private Integer payUserType; + /** + * 支付状态(1=待支付,2=已支付) + */ + @TableField("payStatus") + private Integer payStatus; + /** + * 第三方支付流水号 + */ + @TableField("orderNumber") + private String orderNumber; + /** + * 支付用户id + */ + @TableField("payUserId") + private Integer payUserId; + /** + * 课程状态(1=正常,2=已退课) + */ + @TableField("status") + private Integer status; + /** + * 退课时间 + */ + @TableField("withdrawalTime") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date withdrawalTime; + /** + * 退课凭证 + */ + @TableField("certificate") + private String certificate; + /** + * 状态(1=正常,2=冻结,3=删除) + */ + @TableField("state") + private Integer state; + /** + * 添加时间 + */ + @TableField("insertTime") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date insertTime; + + + @TableField("useTime") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date useTime; + + /** + * 平台手动支付时使用 + */ + @TableField("payUserName") + private String payUserName; +} diff --git a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TStudent.java b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TStudent.java index b9e0a44..a6f39a7 100644 --- a/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TStudent.java +++ b/cloud-server-management/src/main/java/com/dsh/guns/modular/system/model/TStudent.java @@ -52,7 +52,7 @@ * 生日 */ @TableField("birthday") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date birthday; /** * 性别(1=男,2=女) diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser.html index 1878689..b54ff42 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser.html @@ -96,9 +96,9 @@ <#button name="添加" icon="fa-plus" clickFun="TQuestion.openAdd()"/> <#button name="编辑" icon="fa-edit" clickFun="TQuestion.openChange()" space="true"/> <#button name="查看详情" icon="fa-edit" clickFun="TQuestion.openInfo()" space="true"/> - <#button name="冻结" icon="fa-check" clickFun="TQuestion.onShelf()" space="true"/> + <#button name="冻结" icon="fa-check" clickFun="TQuestion.offShelf()" space="true"/> <#button name="解冻" icon="fa-check" clickFun="TQuestion.onShelf()" space="true"/> - <#button name="添加学员" icon="fa-edit" clickFun="TQuestion.openChange()" space="true"/> + <#button name="添加学员" icon="fa-edit" clickFun="TQuestion.openAddStudent()" space="true"/> <#button name="查看学员信息" icon="fa-edit" clickFun="TQuestion.openChange()" space="true"/> </div> <#table id="TQuestionTable"/> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_addStudent.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_addStudent.html index 0c24cf2..6d5ba6e 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_addStudent.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_addStudent.html @@ -38,105 +38,123 @@ </style> <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=77b37f0753049c4e712ea79a24e0719c"></script> <div class="ibox float-e-margins"> - + <input hidden id="userId" value="${data.id}"> + <input hidden id="userName" value="${data.name}"> <div class="ibox-content"> <div class="form-horizontal" id="carInfoForm"> - @if(roleType == 1){ - <div class="form-group" id="provinceCode"> - <label class="col-sm-3 control-label">*所在省:</label> + <div class="form-group" > + <div class="col-sm-9" style="display: flex;"> + <h2>*所属用户:${name}</h2> + </div> + </div> + <div class="form-group" > + <label class="col-sm-3 control-label">*姓名:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" id="name" placeholder="请输入姓名" type="text"> + </div> + </div> + + <div class="form-group" > + <label class="col-sm-3 control-label">*生日:</label> + <div class="col-sm-9" style="display: flex"> + <input style="width: 300px;" placeholder="请选择" id="birthday" class="form-control" type="date"> + </div> + </div> + <div class="form-group" > + <label class="col-sm-3 control-label">*性别:</label> <div class="col-sm-9"> - <select style="width: 300px" class="form-control" id="pCode" name="pCode" onchange="TQuestion.oneChange()"> - <option value="">请选择省</option> - @for(obj in list){ - <option style="width: 300px" value="${obj.provinceCode}">${obj.province}</option> - @} + <select style="width: 300px" class="form-control" id="gender" name = "gender"> + <option value="" style="color: #b6b6b6" disabled selected>请选择性别</option> + <option value="1">男</option> + <option value="2">女</option> </select> </div> </div> - - <div class="form-group" id="cityCode"> - <label class="col-sm-3 control-label">*所在市:</label> - <div class="col-sm-9"> - <select style="width: 300px" class="form-control" id="cCode" name="cCode" onchange="TQuestion.oneChangeNext(this)"> - <option value="">请选择市</option> - </select> - </div> - </div> - @} - - @if(roleType != 3){ <div class="form-group" > - <label class="col-sm-3 control-label">*所属门店:</label> - <div class="col-sm-9"> - <select style="width: 300px" class="form-control" id="store" name="account"> - <option value="" style="color: #676A6C" disabled selected>请选择门店</option> - @if(roleType == 2){ - @for(obj in stores){ - <option style="width: 300px" value="${obj.id}">${obj.name}</option> - @} - @} - </select> - </div> - </div> - @} - - <div class="form-group" > - <label class="col-sm-3 control-label">*家长姓名:</label> + <label class="col-sm-3 control-label">*身高:</label> <div class="col-sm-9" style="display: flex;"> - <input style="width: 300px" class="form-control" id="parentName" placeholder="请输入家长姓名" type="text"> + <input style="width: 300px" class="form-control" id="height" placeholder="请输入身高" type="text"> + <span style="margin-left: 5px;margin-top: 5px">cm</span> </div> </div> - <div class="form-group" > - <label class="col-sm-3 control-label">*家长联系方式:</label> + <label class="col-sm-3 control-label">*体重:</label> <div class="col-sm-9" style="display: flex;"> - <input style="width: 300px" class="form-control" id="phone" placeholder="请输入家长联系方式" type="text"> + <input style="width: 300px" class="form-control" id="weight" placeholder="请输入体重" type="text"> + <span style="margin-left: 5px;margin-top: 5px">kg</span> </div> </div> - <div class="form-group" > - <label class="col-sm-3 control-label">*学员姓名:</label> + <label class="col-sm-3 control-label">*联系电话:</label> <div class="col-sm-9" style="display: flex;"> - <input style="width: 300px" class="form-control" id="learnerName" placeholder="请输入学员姓名" type="text"> + <input style="width: 300px" class="form-control" id="phone" placeholder="请输入联系电话" type="text"> </div> </div> - <div class="form-group" > - <label class="col-sm-3 control-label">*学员年龄:</label> + <label class="col-sm-3 control-label">*身份证号:</label> <div class="col-sm-9" style="display: flex;"> - <input style="width: 300px" class="form-control" id="learnerAge" placeholder="请输入学员年龄" type="text"> + <input style="width: 300px" class="form-control" id="idCard" placeholder="请输入身份证号" type="text"> </div> </div> - - <div class="form-group" > - <label class="col-sm-3 control-label">*学员生日:</label> + <div class="form-group"> + <label class="col-sm-3 control-label">*体测表:</label> <div class="col-sm-9" style="display: flex;"> - <input style="width: 300px" class="form-control" id="birthday" placeholder="请选择" type="date"> + <#avatar id="img" name="" avatarImg=""/><span id = "imgPX">推荐像素:宽度:780px</span> </div> </div> - - <div class="form-group" > - <label class="col-sm-3 control-label">*预约时间:</label> - <div class="col-sm-9" style="display: flex;"> - <input style="width: 300px" class="form-control" id="appointmentTime" placeholder="请选择" type="datetime-local"> - </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="TQuestion.addSubmit()"/> - <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TQuestion.close()"/> + <#button btnCss="info" name="提交" id="ensure" icon="fa-check" clickFun="TQuestion.addStudentSubmit()"/> + <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TQuestion.close()"/> </div> </div> + </div> </div> + </div> </div> -<script src="${ctxPath}/modular/system/bodySideAppointment/tBodySideAppointment.js"></script> +<script src="${ctxPath}/modular/system/appUser/tAppUser.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> + var vue2 = new Vue({ + el: '#app1', + props: { + // 数量限制 + limit: { + type: Number, + default: 2 + }, + }, + data: { + autoUpload: true,//自动上传 + imageUrl1: '',//模型数据,用于上传图片完成后图片预览 + dialogVisible: false + }, + methods: { + handleAvatarSuccess(res, file) { + TSite.goodsPicArray.push(res); + }, + beforeAvatarUpload(file) { + const isLt2M = file.size / 1024 / 1024 < 10; + if (!isLt2M) { + this.$message.error('上传图片大小不能超过 10MB!'); + } + return isLt2M; + }, + handleRemove(file, fileList) { + TSite.goodsPicArray = TSite.goodsPicArray.filter(item => { + return item.uid != file.uid; + }); + }, + }, + created() { + }, + }); +</script> @} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_edit.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_edit.html index 1fa75eb..32fada2 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_edit.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_edit.html @@ -95,6 +95,14 @@ <input style="width: 300px" class="form-control" value="${data.phone}" id="phone" placeholder="请输入联系电话" type="text"> </div> </div> + @if(type == 2){ + <div class="form-group" > + <label class="col-sm-3 control-label">*剩余积分:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" value="${data.integral}" id="integral" type="text"> + </div> + </div> + @} <div class="form-group"> <label class="col-sm-3 control-label">*销售人员:</label> <div class="col-sm-9"> @@ -116,22 +124,17 @@ </div> </div> <div class="form-group" > - <label class="col-sm-3 control-label">*性别:</label> - <div class="col-sm-9"> - <select style="width: 300px" class="form-control" id="viplevelId" name = "gender"> - <option value="" style="color: #b6b6b6" disabled selected>请选择性别</option> - <option value="1" ${data.viplevelId == 1 ? 'selected=selected' : ''}>青铜</option> - <option value="2" ${data.viplevelId == 2 ? 'selected=selected' : ''}>白银</option> - <option value="3" ${data.viplevelId == 3 ? 'selected=selected' : ''}>黄金</option> - </select> + <label class="col-sm-3 control-label">*会员等级:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" value="${level}" id="level" type="text"> </div> </div> </div> @} <div class="form-horizontal" id="carInfoForm2"> <h2>学员信息</h2> + @for(obj in students){ <div class="form-group" style="display: flex"> - @for(obj in students){ <label class="col-sm-3 control-label">*姓名:</label> <div class="col-sm-9"> <input style="width: 300px" class="form-control" value="${obj.name}" id="studentName" type="text"> @@ -141,8 +144,9 @@ <input style="width: 300px" class="form-control" value="${obj.phone}" id="studentPhone" type="text"> </div> <#button btnCss="info" name="查看详情" id="ensure" icon="fa-check" clickFun="TQuestion.studentInfo(${obj.id})"/> - @} </div> + @} + </div> <div class="row btn-group-m-t"> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_info.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_info.html index 1fa75eb..4e9aa18 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_info.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/appUser/TAppUser_info.html @@ -130,8 +130,9 @@ @} <div class="form-horizontal" id="carInfoForm2"> <h2>学员信息</h2> + + @for(obj in students){ <div class="form-group" style="display: flex"> - @for(obj in students){ <label class="col-sm-3 control-label">*姓名:</label> <div class="col-sm-9"> <input style="width: 300px" class="form-control" value="${obj.name}" id="studentName" type="text"> @@ -141,8 +142,9 @@ <input style="width: 300px" class="form-control" value="${obj.phone}" id="studentPhone" type="text"> </div> <#button btnCss="info" name="查看详情" id="ensure" icon="fa-check" clickFun="TQuestion.studentInfo(${obj.id})"/> - @} </div> + @} + </div> <div class="row btn-group-m-t"> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/cpPayment/cpPayment_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/cpPayment/cpPayment_add.html index b354ec4..a84ef53 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/cpPayment/cpPayment_add.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/cpPayment/cpPayment_add.html @@ -88,7 +88,7 @@ <div class="form-group" id="cityCode"> <label class="col-sm-3 control-label">所在市:</label> <div class="col-sm-9"> - <select style="width: 300px" class="form-control" id="cCode" name="cCode" > + <select style="width: 300px" class="form-control" id="cCode" name="cCode" onchange="TCompetition.threeChange(this)"> <option value="">选择市</option> </select> </div> @@ -115,7 +115,7 @@ <div class="form-group"> <label class="col-sm-3 control-label">*课包名称:</label> <div class="col-sm-9"> - <select style="width: 300px" class="form-control" id="coursePackageName" name="store" onchange="TCompetition.getCoursePackage(this)" > + <select style="width: 300px" class="form-control" id="coursePackageName" name="store" onchange="TCompetition.getCoursePackageConfig(this)" > <option value="">选择课包</option> </select> </div> @@ -150,7 +150,7 @@ <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="TCompetition.addSubmit()"/> - <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCarInfoDlg.close()"/> + <#button btnCss="danger" name="取消" id="cancel" icon="fa-eraser" clickFun="TCompetition.close()"/> </div> </div> @@ -158,7 +158,7 @@ </div> </div> -<script src="${ctxPath}/modular/system/cpPayment/cpPayment.js"></script> +<script src="${ctxPath}/modular/system/cpPayment/cpPayment_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"> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/finance/CancelledClasses.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/finance/CancelledClasses.html index d6aed34..5efb96e 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/finance/CancelledClasses.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/finance/CancelledClasses.html @@ -9,7 +9,6 @@ <div class="row row-lg"> <div class="col-sm-12"> <div class="row"> - <div class="col-sm-3"> <#TimeCon id="beginTime" name="有效期" isTime="false"/> </div> @@ -30,7 +29,7 @@ </div> </div> <div class="hidden-xs" id="TCompetitionTableToolbar" role="group"> - <#button name="消课记录" icon="fa-search" clickFun="TCompetition.updateState(1)"/> + <#button name="消课记录" icon="fa-search" clickFun="TCompetition.lookCancellationRecord()"/> </div> <div class="ibox-title"> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce.html index ece8ac6..9111e9d 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce.html @@ -63,9 +63,9 @@ </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.delete()" space="true"/> - <#button name="查看详情" icon="fa-remove" clickFun="TCompetition.info()" space="true"/> + <#button name="编辑" icon="fa-edit" clickFun="TCompetition.info()" space="true"/> + <#button name="上架" icon="fa-check" clickFun="TCompetition.onShelf()" space="true"/> + <#button name="下架" icon="fa-edit" clickFun="TCompetition.offShelf()" space="true"/> <#button name="参与用户" icon="fa-remove" clickFun="TCompetition.user()" space="true"/> </div> diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce_add.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce_add.html new file mode 100644 index 0000000..cfcc2bc --- /dev/null +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce_add.html @@ -0,0 +1,99 @@ +@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"> + <div class="form-group" id="provinceCode"> + <label class="col-sm-3 control-label">*所在省:</label> + <div class="col-sm-9"> + <select style="width: 300px" class="form-control" id="pCode" name="pCode" onchange="TCompetition.oneChange(this)"> + <option value="">请选择省</option> + @for(obj in list){ + <option style="width: 300px" value="${obj.code}">${obj.name}</option> + @} + </select> + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 control-label">*所在省:</label> + <div class="col-sm-9"> + <select style="width: 300px" class="form-control" id="cCode" name="pCode" > + <option value="">请选择省</option> + + </select> + </div> + </div> + <div class="form-group" > + <label class="col-sm-3 control-label">*开始时间:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" id="startTime" placeholder="请选择" type="datetime-local"> + </div> + </div> + <div class="form-group" > + <label class="col-sm-3 control-label">*结束时间:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" id="endTime" placeholder="请选择" type="datetime-local"> + </div> + </div> + <div class="form-group" > + <label class="col-sm-3 control-label">*赠送课时数:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" id="giveClass" placeholder="请输入赠送课时数" type="text"> + </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="TCompetition.addSubmit()"/> + <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TCompetition.close()"/> + </div> + </div> + </div> + </div> +</div> + +</div> + +<script src="${ctxPath}/modular/system/introduce/introduce_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"> + +@} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce_edit.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce_edit.html new file mode 100644 index 0000000..3b542af --- /dev/null +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce_edit.html @@ -0,0 +1,110 @@ +@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"> + <input hidden id="id" value="${data.id}"> + <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 style="width: 300px" class="form-control" id="pCode" name="pCode" onchange="TCompetition.oneChange(this)"> + <option value="">请选择省</option> + @for(obj in list){ + <option style="width: 300px" value="${obj.code}" ${obj.name == data.province ? '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 style="width: 300px" class="form-control" id="cCode" name="cCode" > + <option value="">请选择市</option> + @for(obj in city){ + <option style="width: 300px" value="${obj.code}" ${obj.name == data.city ? '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" style="display: flex;"> + <input style="width: 300px" class="form-control" value="${startTime}" id="startTime" type="datetime-local"> + </div> + </div> + <div class="form-group" > + <label class="col-sm-3 control-label">*结束时间:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" value="${endTime}" id="endTime" type="datetime-local"> + </div> + </div> + <div class="form-group" > + <label class="col-sm-3 control-label">*赠送课时数:</label> + <div class="col-sm-9" style="display: flex;"> + <input style="width: 300px" class="form-control" value="${data.giveClass}" id="giveClass" placeholder="请输入赠送课时数" type="text"> + </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="TCompetition.updateSubmit()"/> + <#button btnCss="danger" name="关闭" id="cancel" icon="fa-eraser" clickFun="TCompetition.close()"/> + </div> + </div> + </div> + </div> +</div> + +</div> + +<script src="${ctxPath}/modular/system/introduce/introduce_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"> + +@} diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce_user.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce_user.html new file mode 100644 index 0000000..d2fb521 --- /dev/null +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/introduce/introduce_user.html @@ -0,0 +1,69 @@ +@layout("/common/_container.html"){ +<style> + .data-item { + position: relative; + border: 1px solid #ccc; + padding: 10px; + margin-bottom: 10px; + display: flex; + align-items: center; + justify-content: center; + max-width: 200px; + margin-right: 10px; + } + + .delete-button { + position: absolute; + top: -10px; + right: -10px; + cursor: pointer; + color: black; + width: 20px; + height: 20px; + text-align: center; + line-height: 20px; + border-radius: 50%; + } +</style> +<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="shareUsersName" name="分享用户" /> + </div> + <div class="col-sm-3"> + <#NameCon id="shareUsersphone" name="分享用户联系方式" /> + </div> + <div class="col-sm-3"> + <#NameCon id="userName" name="被分享用户" /> + </div> + <div class="col-sm-3"> + <#NameCon id="userPhone" name="被分享用户联系方式" /> + </div> + <div class="col-sm-3"> + <#button name="搜索" icon="fa-search" clickFun="TCompetition.search()"/> + <#button name="重置" icon="fa-trash" clickFun="TCompetition.resetSearch()"/> + </div> + </div> + <#table id="TCompetitionTable"/> + </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="TCompetition.close()"/> + </div> + </div> + <input hidden id="id" value="${id}"> + </div> + </div> +</div> +<script src="${ctxPath}/modular/system/introduce/introduce_user.js"></script> +@} diff --git a/cloud-server-management/src/main/webapp/static/modular/system/appUser/tAppUser.js b/cloud-server-management/src/main/webapp/static/modular/system/appUser/tAppUser.js index bdeeb44..07704cd 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/appUser/tAppUser.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/appUser/tAppUser.js @@ -79,7 +79,7 @@ TQuestion.openChange = function () { var selected = $('#' + this.id).bootstrapTable('getSelections'); if(selected.length >1 ){ - Feng.info("只能选择一个问题进行编辑!"); + Feng.info("只能选择一个用户进行编辑!"); }else { if (this.check()){ var selected = $('#' + this.id).bootstrapTable('getSelections'); @@ -102,7 +102,7 @@ TQuestion.openInfo = function () { var selected = $('#' + this.id).bootstrapTable('getSelections'); if(selected.length >1 ){ - Feng.info("只能选择一个问题进行编辑!"); + Feng.info("只能选择一个用户进行查看!"); }else { if (this.check()){ var selected = $('#' + this.id).bootstrapTable('getSelections'); @@ -119,25 +119,63 @@ } }; /** + * 查看学员详情 + */ +TQuestion.studentInfo = function (e) { + var index = layer.open({ + type: 2, + title: '详情', + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/tStudent/tStudent_info/' + e + }); + this.layerIndex = index; +}; +/** + * 添加学员 + */ +TQuestion.openAddStudent = function (e) { + var selected = $('#' + this.id).bootstrapTable('getSelections'); + if(selected.length >1 ){ + Feng.info("只能选择一个用户进行添加学员!"); + }else { + if (this.check()) { + var index = layer.open({ + type: 2, + title: '详情', + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/appUser/addStudent/' + TQuestion.seItem.id + }); + this.layerIndex = index; + } + } +}; +/** * 上架 */ TQuestion.onShelf = function () { if (this.check()){ var selected = $('#' + this.id).bootstrapTable('getSelections'); - - var ids=[]; + const data1 = { + ids:[], + state:null + }; selected.forEach(function(obj) { var id = obj.id; - ids.push(id); + data1.ids.push(id); }); + data1.state = 1; $.ajax({ - url: Feng.ctxPath + "/bodySideAppointment/changeState", + url: Feng.ctxPath + "/appUser/changeState", type: "POST", contentType: "application/json", // 设置请求头的 Content-Type - data: JSON.stringify(ids), // 将数据转换为 JSON 字符串 + data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 success: function(response) { - Feng.success("修改成功!"); + Feng.success("解冻成功!"); TQuestion.search(); }, @@ -155,7 +193,6 @@ * 下架 */ TQuestion.offShelf = function () { - if (this.check()){ var selected = $('#' + this.id).bootstrapTable('getSelections'); const data1 = { @@ -167,13 +204,15 @@ data1.ids.push(id); }); data1.state = 2; + console.log("看看") + console.log(data1) $.ajax({ - url: Feng.ctxPath + "/bodySideAppointment/changeState", + url: Feng.ctxPath + "/appUser/changeState", type: "POST", contentType: "application/json", // 设置请求头的 Content-Type data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 success: function(response) { - Feng.success("修改成功!"); + Feng.success("冻结成功!"); TQuestion.search(); }, error: function(xhr, status, error) { @@ -332,6 +371,82 @@ }); }; +TQuestion.addStudentSubmit = function(){ + var data = { + appUserId:null, + phone:"", + name:"", + birthday:"", + sex:null, + idCard:"", + lateralSurface:"", + weight:null, + height:null, + state:1, + + }; + data.phone = $("#phone").val() + data.name = $("#name").val() + data.birthday = $("#birthday").val() + data.sex = $("#gender").val() + data.idCard = $("#idCard").val() + data.appUserId = $("#userId").val() + data.lateralSurface = $("#img").val() + data.weight = $("#weight").val() + data.height = $("#height").val() + + + + + if($("#learnerName").val()=='' ){ + Feng.info("请输入学员姓名") + return; + } + if($("#birthday").val()=='' ){ + Feng.info("请选择生日") + return; + } + if($("#gender").val()=='' ){ + Feng.info("请选择性别") + return; + } + if($("#height").val()==''){ + Feng.info("请输入身高") + return; + } + if($("#weight").val()==''){ + Feng.info("请输入体重") + return; + } + if($("#phone").val()=='' ){ + Feng.info("请输入联系方式") + return; + } + if($("#idCard").val()=='' ){ + Feng.info("请输入身份证号") + return; + } + if($("#img").val()=='' ){ + Feng.info("请上传体测表") + return; + } + + $.ajax({ + url: Feng.ctxPath + "/appUser/addAppUserStudent" , + type: "POST", + data: JSON.stringify(data), + contentType: "application/json", + success: function (response) { + window.parent.TQuestion.table.refresh(); + TQuestion.close(); + Feng.success("添加成功"); + }, + error: function (xhr, status, error) { + Feng.error("添加失败!" + error); + } + }); + +}; TQuestion.updateSubmit = function(){ var data = { id:null, @@ -438,10 +553,15 @@ TQuestion.search(null); }; - +function UploadFileFn(){ + $('#upFile').click(); +} $(function () { var defaultColunms = TQuestion.initColumn(); var table = new BSTable(TQuestion.id, "/appUser/listAll", defaultColunms); table.setPaginationType("client"); TQuestion.table = table.init(); + var carPhoto = new $WebUpload("img"); + carPhoto.setUploadBarId("progressBar"); + carPhoto.init(); }); diff --git a/cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment.js b/cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment.js index 4bfbcac..b88d861 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment.js @@ -8,13 +8,14 @@ layerIndex: -1 }; var role =$("#roleType").val() +var appUserId ; /** * 初始化表格的列 */ TCompetition.initColumn = function () { return [ {field: 'selectItem', checkbox: true}, - {title: 'id', field: 'id', visible: true, align: 'center', valign: 'middle'}, + {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, {title: '所在省市', field: 'provinceAndCity', visible: role==1?true:false, align: 'center', valign: 'middle'}, {title: '门店名称', field: 'storeName', visible: true, align: 'center', valign: 'middle'}, {title: '课包类型', field: 'coursePackageType', visible: true, align: 'center', valign: 'middle'}, @@ -237,12 +238,12 @@ }; TCompetition.addSubmit = function(){ var data = { - appUserId:"", - studentId:"", - coursePackageId:"", - payType:7, - classHours:"", - originalPrice:"", + appUserId:null, + studentId:null, + coursePackageId:null, + payType:null, + classHours:null, + originalPrice:null, cashPayment:null, playPaiCoin:null, totalClassHours:null, @@ -250,9 +251,9 @@ absencesNumber:null, payUserType:2, payStatus:1, - orderNumber:2, + orderNumber:null, payUserId:2, - status:null, + status:1, withdrawalTime:"", certificate:"", state:1, @@ -260,27 +261,31 @@ useTime:"", payUserName:"", }; - data.appUserId = appUserId + data.appUserId = appUserId; data.studentId = $("#student").val() data.coursePackageId = $("#coursePackageName").val() data.cashPayment = $("#cashPayment").val() data.playPaiCoin = $("#playPaiCoin").val() - - if($("#studentId").val()=='' ){ - Feng.info("请选择学员") - return; + data.classHours = $('#courseTime option:selected').text() + if (role == 1){ + if($("#studentId").val()=='' ){ + Feng.info("请选择学员") + return; + } + if($("#pCode").val()=='' ){ + Feng.info("请选择省") + return; + } + if($("#cCode").val()=='' ){ + Feng.info("请选择市") + return; + } } - if($("#pCode").val()=='' ){ - Feng.info("请选择省") - return; - } - if($("#cCode").val()=='' ){ - Feng.info("请选择市") - return; - } - if($("#store").val()==''){ - Feng.info("请选择门店") - return; + if (role!=3){ + if($("#store").val()==''){ + Feng.info("请选择门店") + return; + } } if($("#coursePackageType").val()=='' ){ Feng.info("请选择课包类型") @@ -290,30 +295,46 @@ Feng.info("请选择课包名称") return; } - if($("#courseTime").val()==''){ - Feng.info("请选择课时规格") + if (role == 1) { + if ($("#courseTime").val() == '') { + Feng.info("请选择课时规格") + return; + } + } + if($("#cashPayment").val()==''){ + Feng.info("请输入支付金额") return; } - if($("#cashPayment").val()=='' || $("#playPaiCoin").val()==''){ - Feng.info("请输入支付金额或请输入玩湃币支付") + if($("#playPaiCoin").val()==''){ + Feng.info("请输入玩湃币支付") return; } $.ajax({ - url: Feng.ctxPath + "/tSite/changeState", + url: Feng.ctxPath + "/cpPayment/addCoursePackagePayment/"+ $("#courseTime").val(), type: "POST", contentType: "application/json", // 设置请求头的 Content-Type - data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 + data: JSON.stringify(data), // 将数据转换为 JSON 字符串 success: function(response) { - Feng.success("上架成功!"); - TSite.search(); + if (response == "5001"){ + Feng.error("当前课包预约人数已满!") + }else{ + Feng.success("上架成功!"); + TCompetition.close(); + TCompetition.search(); + } }, error: function(xhr, status, error) { var errorMessage = xhr.responseText ? xhr.responseText : "上架失败!"; Feng.error("您的网络异常!"); } }); - }; +/** + * 关闭此对话框 + */ +TCompetition.close = function() { + parent.layer.close(window.parent.TCompetition.layerIndex); +} TCompetition.getCoursePackage = function (e) { var oneId=$(e).val(); console.log(oneId) @@ -328,6 +349,22 @@ } }); ajax.set("storeId",oneId); + ajax.start(); +}; +TCompetition.getCoursePackageConfig = function (e) { + var oneId=$(e).val(); + console.log(oneId) + var content = "<option value=''>请选择</option>"; + var ajax = new $ax(Feng.ctxPath + "/cpPayment/getCoursePackageConfig", function(data){ + if(data!=null){ + + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.classHours+"</option>"; + }); + $("#courseTime").empty().append(content); + } + }); + ajax.set("id",oneId); ajax.start(); }; TCompetition.twoChange = function (e) { @@ -345,23 +382,20 @@ ajax.set("oneId",oneId); ajax.start(); }; + TCompetition.threeChange = function (e) { - var oneId=e; - console.log("看看奥") - console.log(oneId) var content1 = "<option value=''>请选择门店</option>"; var ajax2=new $ax(Feng.ctxPath + "/cpPayment/getStore", function(data){ - console.log("看看返回数据") - console.log(data) $.each(data, function(k,v) { content1 += "<option value='"+v.id+"'>"+v.name+"</option>"; }); $("#store").empty().append(content1); }); - ajax2.set("city",oneId); + ajax2.set("city",e); ajax2.start(); }; -var appUserId ; + + TCompetition.getStudent = function () { var phone = $("#vipPhone").val(); var phoneRegex = /^1[3456789]\d{9}$/; @@ -408,7 +442,7 @@ fix: false, //不固定 maxmin: true, // todo 写用户管理路径 - content: Feng.ctxPath + '/cpPayment/add' + content: Feng.ctxPath + '/appUser/add' }); this.layerIndex = index; }, @@ -445,7 +479,7 @@ fix: false, //不固定 maxmin: true, // todo 写用户管理路径 - content: Feng.ctxPath + '/cpPayment/add' + content: Feng.ctxPath + '/appUser/addStudent/'+appUserId }); this.layerIndex = index; }, @@ -505,6 +539,7 @@ TCompetition.unfreeze = function () { if (this.check()) { var selected = $('#' + this.id).bootstrapTable('getSelections'); + console.log("看看选择") console.log(selected) const data1 = { @@ -512,8 +547,13 @@ payUserName:"" }; selected.forEach(function(obj) { + if (obj.payStatus == 2){ + Feng.error("订单已支付!不能再手动支付了") + return; + } var id = ""; id = obj.id; + console.log(obj.id); data1.ids.push(id); }); console.log(data1) diff --git a/cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment_info.js b/cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment_info.js index 2d4e403..1ab2025 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment_info.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/cpPayment/cpPayment_info.js @@ -1,713 +1,642 @@ /** - * 初始化车辆管理详情对话框 + * 车辆管理管理初始化 */ -var language=1; -var TCarInfoDlg = { - goodsPicArray: [], - tCarInfoData : {}, - validateFields: { +var TCompetition = { + id: "TCompetitionTable", //表格id + seItem: null, //选中的条目 + table: null, + layerIndex: -1 +}; +var role =$("#roleType").val() +var appUserId ; +/** + * 初始化表格的列 + */ +TCompetition.initColumn = function () { + return [ + {field: 'selectItem', checkbox: true}, + {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, + {title: '所在省市', field: 'provinceAndCity', visible: role==1?true:false, align: 'center', valign: 'middle'}, + {title: '门店名称', field: 'storeName', visible: true, align: 'center', valign: 'middle'}, + {title: '课包类型', field: 'coursePackageType', visible: true, align: 'center', valign: 'middle'}, + {title: '课包名称', field: 'coursePackage', visible: true, align: 'center', valign: 'middle'}, + {title: '购买用户', field: 'payUser', visible: true, align: 'center', valign: 'middle'}, + {title: '联系方式', field: 'phone', visible: true, align: 'center', valign: 'middle'}, + {title: '购课学员', field: 'payStudent', visible: true, align: 'center', valign: 'middle'}, + {title: '购买方式', field: 'buyType', visible: true, align: 'center', valign: 'middle', + formatter:function (data) { + return{1:"线下",2:"线上",3:"折扣"}[data] + } + }, + {title: '支付方式', field: 'buyTypeName', visible: true, align: 'center', valign: 'middle'}, + {title: '总金额', field: 'originalPrice', visible: true, align: 'center', valign: 'middle'}, + {title: '优惠金额', field: 'discountAmount', visible: true, align: 'center', valign: 'middle'}, + {title: '支付价格', field: 'cashPayment', visible: true, align: 'center', valign: 'middle'}, + {title: '支付状态', field: 'payStatus', visible: true, align: 'center', valign: 'middle', + formatter:function (data) { + return{1:"待支付",2:"已支付"}[data] + } + }, + {title: '赠送课时', field: 'giftClassHours', 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; } }; /** - * 验证数据是否为空 + * 点击添加车辆管理 */ -TCarInfoDlg.validate = function () { - $('#carInfoForm').data("bootstrapValidator").resetForm(); - $('#carInfoForm').bootstrapValidator('validate'); - return $("#carInfoForm").data('bootstrapValidator').isValid(); +TCompetition.openAddTCompetition = function () { + var index = layer.open({ + type: 2, + title: '添加', + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/cpPayment/add' + }); + this.layerIndex = index; }; /** - * 清除数据 + * 打开查看车辆管理详情 */ -TCarInfoDlg.clearData = function() { - this.tCarInfoData = {}; -} +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 + '/tShop/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; + } +}; /** - * 设置对话框中的数据 - * - * @param key 数据的名称 - * @param val 数据的具体值 + * 删除车辆管理 */ -TCarInfoDlg.set = function(key, val) { - this.tCarInfoData[key] = (typeof val == "undefined") ? $("#" + key).val() : val; - return this; -} +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"); + } -/** - * 设置对话框中的数据 - * - * @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) { + }); + ajax.set("TCompetitionId",TCompetition.seItem.id); + ajax.start(); + }); + } +}; +TCompetition.oneChange = function (e) { console.log(111) var oneId=$(e).val(); + console.log(oneId) + var content = "<option value=''>请选择</option>"; 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>"; + content += "<option value='"+v.name+"'>"+v.name+"</option>"; }); $("#cCode").empty().append(content); } }); ajax.set("oneId",oneId); ajax.start(); -} -TCarInfoDlg.oneChangeNext = function (e) { +}; + +TCompetition.nextStore = function (e) { var oneId=$(e).val(); - var ajax = new $ax(Feng.ctxPath + "/tShop/oneChangeNext", function(data){ + console.log(oneId) + var content = "<option value=''>请选择</option>"; + var ajax = new $ax(Feng.ctxPath + "/coursePackage/getCoursePackageByStoreId", 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); + $("#coursePackageType").empty().append(content); } }); - ajax.set("oneId",oneId); + ajax.set("storeId",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("保存成功") +}; +TCompetition.addSubmit = function(){ + var data = { + appUserId:null, + studentId:null, + coursePackageId:null, + payType:null, + classHours:null, + originalPrice:null, + cashPayment:null, + playPaiCoin:null, + totalClassHours:null, + laveClassHours:null, + absencesNumber:null, + payUserType:2, + payStatus:1, + orderNumber:null, + payUserId:2, + status:1, + withdrawalTime:"", + certificate:"", + state:1, + giftClassHours:null, + useTime:"", + payUserName:"", + }; + data.appUserId = appUserId; + data.studentId = $("#student").val() + data.coursePackageId = $("#coursePackageName").val() + data.cashPayment = $("#cashPayment").val() + data.playPaiCoin = $("#playPaiCoin").val() + data.classHours = $('#courseTime option:selected').text() + if (role == 1){ + if($("#studentId").val()=='' ){ + Feng.info("请选择学员") + return; } - }); - ajax.set("id",id); - ajax.set("img",img); - ajax.start(); -} - -/** - * 提交添加 - */ -TCarInfoDlg.addSubmit = function() { - - this.clearData(); - this.collectData(); - if(!this.validate()){ - return ; - } - - var OBJradio= $("input[name='type']:checked").val(); - if(OBJradio==2){ - let account = $("#account").val() - if(account==''){ - Feng.info("请选择所属运营商") + if($("#pCode").val()=='' ){ + Feng.info("请选择省") + return; + } + if($("#cCode").val()=='' ){ + Feng.info("请选择市") return; } } - let pCode = $("#pCode").val() - let cCode = $("#cCode").val() - - - 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",null); - 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("lat",$("#latitude").val()); - ajax.set("lon",$("#longitude").val()); - ajax.set("ids",$("#ids").val()); - ajax.set("type",OBJradio); - ajax.set("yyId",$("#account").val()); - 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() - var OBJradio= $("input[name='type']:checked").val(); - if(OBJradio==2){ - let account = $("#account").val() - if(account==''){ - Feng.info("请选择所属运营商") + if (role!=3){ + if($("#store").val()==''){ + Feng.info("请选择门店") return; } } - - let name = $("#name").val() - let phone = $("#phone").val() - - if(pCode=='' && $("#role")=="1"){ - Feng.info("请选择省") + if($("#coursePackageType").val()=='' ){ + Feng.info("请选择课包类型") return; } - if(cCode=='' && $("#role")=="1"){ - Feng.info("请选择市") + if($("#coursePackageName").val()==''){ + 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); + if (role == 1) { + if ($("#courseTime").val() == '') { + Feng.info("请选择课时规格") + return; } - },function(data){ - Feng.error("修改失败!" + data.responseJSON.message + "!"); + } + if($("#cashPayment").val()==''){ + Feng.info("请输入支付金额") + return; + } + if($("#playPaiCoin").val()==''){ + Feng.info("请输入玩湃币支付") + return; + } + $.ajax({ + url: Feng.ctxPath + "/cpPayment/addCoursePackagePayment/"+ $("#courseTime").val(), + type: "POST", + contentType: "application/json", // 设置请求头的 Content-Type + data: JSON.stringify(data), // 将数据转换为 JSON 字符串 + success: function(response) { + if (response == "5001"){ + Feng.error("当前课包预约人数已满!") + }else{ + Feng.success("上架成功!"); + TCompetition.close(); + window.parent.TCompetition.table.refresh(); + } + }, + error: function(xhr, status, error) { + var errorMessage = xhr.responseText ? xhr.responseText : "上架失败!"; + Feng.error("您的网络异常!"); + } }); - 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) { +TCompetition.close = function() { + parent.layer.close(window.parent.TCompetition.layerIndex); +} +TCompetition.getCoursePackage = function (e) { var oneId=$(e).val(); - var ajax = new $ax(Feng.ctxPath + "/tCity/onChange", function(data){ + console.log(oneId) + var content = "<option value=''>请选择</option>"; + var ajax = new $ax(Feng.ctxPath + "/coursePackage/getCoursePackageByType", 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>"; + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#coursePackageName").empty().append(content); + } + }); + ajax.set("storeId",oneId); + ajax.start(); +}; +TCompetition.getCoursePackageConfig = function (e) { + var oneId=$(e).val(); + console.log(oneId) + var content = "<option value=''>请选择</option>"; + var ajax = new $ax(Feng.ctxPath + "/cpPayment/getCoursePackageConfig", function(data){ + if(data!=null){ + + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.classHours+"</option>"; + }); + $("#courseTime").empty().append(content); + } + }); + ajax.set("id",oneId); + ajax.start(); +}; +TCompetition.twoChange = function (e) { + var oneId=e; + var content = "<option value=''>请选择</option>"; + var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function(data){ + if(data!=null){ + + $.each(data, function(k,v) { + content += "<option value='"+v.name+"'>"+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 + "!"); - +TCompetition.threeChange = function (e) { + var content1 = "<option value=''>请选择门店</option>"; + var ajax2=new $ax(Feng.ctxPath + "/cpPayment/getStore", function(data){ + $.each(data, function(k,v) { + content1 += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#store").empty().append(content1); }); - 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(); -} + ajax2.set("city",e); + ajax2.start(); +}; + + +TCompetition.getStudent = function () { + var phone = $("#vipPhone").val(); + var phoneRegex = /^1[3456789]\d{9}$/; + // 使用正则表达式进行验证 + if (!phoneRegex.test(phone)) { + Feng.error("手机号不合法"); + return; + } + // 回填省市 + var province; + var city; + var c; + var content = "<option value=''>请选择学员</option>"; + $.ajax({ + url: Feng.ctxPath + "/cpPayment/getUserByPhone/"+phone, + type: "GET", + contentType: "application/json", // 设置请求头的 Content-Type + success: function(response) { + console.log("==================="); + console.log(response) + if (response==""){ + let htmlStr = + '<div class="form-horizontal">' + + ' <div class="col-sm-11" style="padding: 20px;">' + + ' <div class="form-group">\n' + + ' <h2>验证失败,当前手机号未注册玩湃会员</h2>\n' + + ' </div>'; + + layer.open({ + type: 1 + , title: '提示' + , area: ['50%', '90%'] + , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset + , id: 'layerDemo' //防止重复弹出cge + , content: htmlStr + , btn: ['去添加', '关闭'] + , btnAlign: 'c' //按钮居中 + , shade: 0.5 //不显示遮罩 + , yes: function () { + var index = layer.open({ + type: 2, + title:'首页设置', + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + // todo 写用户管理路径 + content: Feng.ctxPath + '/appUser/add' + }); + this.layerIndex = index; + }, + }); + }else{ + province = response.province; + city = response.city; + appUserId = response.id; + var ajax1=new $ax(Feng.ctxPath + "/cpPayment/queryStudentList", function(data){ + + if (data.length==0){ + let htmlStr = + '<div class="form-horizontal">' + + ' <div class="col-sm-11" style="padding: 20px;">' + + ' <div class="form-group">\n' + + ' <h2>验证失败,当前用户未添加学员信息</h2>\n' + + ' </div>'; + + layer.open({ + type: 1 + , title: '提示' + , area: ['50%', '90%'] + , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset + , id: 'layerDemo' //防止重复弹出cge + , content: htmlStr + , btn: ['去添加', '关闭'] + , btnAlign: 'c' //按钮居中 + , shade: 0.5 //不显示遮罩 + , yes: function () { + var index = layer.open({ + type: 2, + title:'首页设置', + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + // todo 写用户管理路径 + content: Feng.ctxPath + '/appUser/addStudent/'+appUserId + }); + this.layerIndex = index; + }, + }); + } + $.each(data, function(k,v) { + content += "<option value='"+v.id+"'>"+v.name+"</option>"; + }); + $("#student").empty().append(content); + var provinceSelect = document.getElementById("pCode"); + for (var i = 0; i < provinceSelect.options.length; i++) { + var option = provinceSelect.options[i]; + if (option.text === province) { + option.selected = true; + console.log(option.value) + TCompetition.twoChange(option.value); + break; // 找到匹配的选项后,可以选择停止遍历 + } + } + + var content1 = "<option value=''>请选择门店</option>"; + var citySelect = document.getElementById("cCode"); + for (var i = 0; i < citySelect.options.length; i++) { + var option = citySelect.options[i]; + if (option.text === city) { + option.selected = true; + c = option.text; + + TCompetition.threeChange(c) + + break; // 找到匹配的选项后,可以选择停止遍历 + } + } + }); + ajax1.set("appUserId",appUserId); + ajax1.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 selected = $('#' + this.id).bootstrapTable('getSelections'); + console.log("看看选择") + console.log(selected) + const data1 = { + ids:[], + payUserName:"" + }; + selected.forEach(function(obj) { + var id = ""; + id = obj.id; + data1.ids.push(id); + }); + console.log(data1) + $.ajax({ + url: Feng.ctxPath + "/cpPayment/pay", + type: "POST", + contentType: "application/json", // 设置请求头的 Content-Type + data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 + success: function(response) { + Feng.success("支付成功!"); + TCompetition.table.refresh(); + }, + error: function(xhr, status, error) { + var errorMessage = xhr.responseText ? xhr.responseText : "上架失败!"; + Feng.error("您的网络异常!"); + } + }); + } +}; +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; + } +}; + + /** - * 专车服务被点击 + * 查询车辆管理列表 */ -TCarInfoDlg.zcServerClick = function () { - var serverBox1 = $('#serverBox1').prop('checked'); - if (serverBox1){ - $("#zcModelDiv").show(); - } else { - $("#zcModelDiv").hide(); +TCompetition.search = function () { + var queryData = {}; + if ($('#pCode option:selected').text()!="全部"){ + queryData['province'] = $('#pCode option:selected').text(); + }else{ + queryData['province'] = ""; } -} -/** - * 跨城服务被点击 - */ -TCarInfoDlg.kcServerClick = function () { - var serverBox3 = $('#serverBox3').prop('checked'); - if (serverBox3){ - $("#kcModelDiv").show(); - } else { - $("#kcModelDiv").hide(); - } -} + queryData['city'] = $("#cCode").val(); + queryData['coursePackageTypeId'] = $("#coursePackage").val(); + queryData['coursePackageTypeName'] = $("#coursePackageName").val(); + queryData['payStatus'] = $("#state").val(); + queryData['payUser'] = $("#payUser").val(); + queryData['payStudent'] = $("#payStudent").val(); + TCompetition.table.refresh({query: queryData}); +}; + +TCompetition.resetSearch = function () { + $("#pCode").val(""); + $("#cCode").val(""); + $("#coursePackage").val(""); + $("#coursePackageName").val(""); + $("#state").val(""); + $("#payUser").val(""); + $("#payStudent").val(""); + TCompetition.search(); +}; + +$(function () { + var defaultColunms = TCompetition.initColumn(); + var table = new BSTable(TCompetition.id, "/cpPayment/listAll", defaultColunms); + table.setPaginationType("client"); + TCompetition.table = table.init(); +}); + + diff --git a/cloud-server-management/src/main/webapp/static/modular/system/finance/cancelledClasses.js b/cloud-server-management/src/main/webapp/static/modular/system/finance/cancelledClasses.js index 9fec3d8..4b662dd 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/finance/cancelledClasses.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/finance/cancelledClasses.js @@ -16,6 +16,7 @@ return [ {field: 'selectItem', radio: true}, {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, + {title: '消课凭证', field: 'id', visible: false, align: 'center', valign: 'middle'}, {title: '所在省市', field: 'provinceAndCity', visible: objectType==1?true:false, align: 'center', valign: 'middle'}, {title: '上课门店', field: 'storeName', visible: true, align: 'center', valign: 'middle'}, {title: '学员姓名', field: 'studentName', visible: true, align: 'center', valign: 'middle'}, @@ -72,6 +73,52 @@ } }; +TCompetition.lookCancellationRecord = function(){ + if(this.check()){ + + let imgs = ClassRecord.seItem.cancelClasses.split(";"); + let htmlStr = + '<div class="form-horizontal">' + + ' <div class="col-sm-11" style="padding: 20px;">' + + ' <div class="form-group">\n' + + ' <label class="col-sm-8 control-label">课程名称:' + $("#name").text() + '</label>\n' + + ' </div>' + + ' <div class="form-group">\n' + + ' <label class="col-sm-8 control-label">*上传凭证(请上传小于5张图片):</label>\n' + + ' </div>' + + ' <div class="form-group">\n' + + ' <div class="col-sm-8" style="min-height: 200px;">\n' + + ' <div id="cancelClasses">'; + + for (let i = 0; i < imgs.length; i++) { + htmlStr += '<div><img src="' + imgs[i] + '" style="height: 150px;"/></div> '; + } + + htmlStr += '</div>' + + ' </div>\n' + + ' </div>' + + ' <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="deductClassHour" value="' + ClassRecord.seItem.deductClassHour + '" type="number" min="0">' + + ' </div>\n' + + ' </div>' + + ' </div>' + + '</div>'; + layer.open({ + type: 1 + , title: '查看消课记录' + , area: ['50%', '90%'] + , offset: 'auto' //具体配置参考:http://www.layui.com/doc/modules/layer.html#offset + , id: 'layerDemo' //防止重复弹出cge + , content: htmlStr + , btnAlign: 'c' //按钮居中 + , shade: 0.5 //不显示遮罩 + , yes: function () { + }, + }); + } +} /** * 点击添加车辆管理 */ @@ -298,13 +345,13 @@ * 查询车辆管理列表 */ TCompetition.search = function () { + console.log("看看啊") + console.log($("#coachName").val()) var queryData = {}; - queryData['province'] = $("#pCode").val(); - queryData['city'] = $("#cCode").val(); - queryData['name'] = $("#name").val(); - queryData['phone'] = $("#phone").val(); - queryData['time'] = $("#beginTime").val(); - queryData['type'] = $("#type").val(); + queryData['beginTime'] = $("#beginTime").val(); + queryData['studentName'] = $("#studentName").val(); + queryData['courseName'] = $("#courseName").val(); + queryData['coachName'] = $("#coachName").val(); TCompetition.table.refresh({query: queryData}); }; TCompetition.getAmount = function () { @@ -334,7 +381,7 @@ $(function () { var defaultColunms = TCompetition.initColumn(); var table = new BSTable(TCompetition.id, "/finance/cancelListAll", defaultColunms); - table.setPaginationType("server"); + table.setPaginationType("client"); TCompetition.table = table.init(); }); diff --git a/cloud-server-management/src/main/webapp/static/modular/system/introduce/introduce.js b/cloud-server-management/src/main/webapp/static/modular/system/introduce/introduce.js index 89541f1..ffff854 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/introduce/introduce.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/introduce/introduce.js @@ -13,18 +13,19 @@ */ TCompetition.initColumn = function () { return [ - {field: 'selectItem', radio: true}, - {title: '所在省市', field: 'provinceAndCity', 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: 'giveClass', visible: true, align: 'center', valign: 'middle',width:'8%',}, - {title: '参与次数', field: 'number', visible: true, align: 'center', valign: 'middle',width:'8%',}, - {title: '状态', field: 'state', visible: true, align: 'center', valign: 'middle',width:'8%', + {field: 'selectItem', checkbox: true}, + {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, + {title: '所在省市', field: 'provinceAndCity', visible: true, align: 'center', valign: 'middle',}, + {title: '开始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle',}, + {title: '结束时间', field: 'endTime', visible: true, align: 'center', valign: 'middle',}, + {title: '赠送课时数', field: 'giveClass', visible: true, align: 'center', valign: 'middle',}, + {title: '参与次数', field: 'number', visible: true, align: 'center', valign: 'middle',}, + {title: '状态', field: 'activityState', visible: true, align: 'center', valign: 'middle', formatter:function (data) { - return {1:"已开始",2:"已结束",3:"未开始"}[data] + return {1:"已开始",2:"未开始",3:"已结束"}[data] } }, - {title: '活动状态', field: 'activityState', visible: true, align: 'center', valign: 'middle',width:'8%', + {title: '活动状态', field: 'state', visible: true, align: 'center', valign: 'middle', formatter:function (data) { return {1:"已上架",2:"已下架"}[data] } @@ -78,6 +79,137 @@ } }; +TCompetition.addSubmit = function(){ + var data = { + id:null, + province:"", + provinceCode:"", + city:"", + cityCode:"", + startTime:"", + endTime:"", + giveClass:"", + state:1 + }; + data.province = $('#pCode option:selected').text(); + data.provinceCode = $("#pCode").val() + data.city = $('#cCode option:selected').text(); + data.cityCode = $("#cCode").val() + data.startTime = $("#startTime").val() + data.endTime = $("#endTime").val() + data.giveClass = $("#giveClass").val() + + + if($("#pCode").val()==''){ + Feng.info("请选择省") + return; + } + if($("#cCode").val()==''){ + Feng.info("请选择市") + return; + } + if($("#startTime").val()=='' ){ + Feng.info("请选择开始时间") + return; + } + if($("#endTime").val()=='' ){ + Feng.info("请选择结束时间") + return; + } + if($("#giveClass").val()=='' ){ + Feng.info("请输入赠送课时数") + return; + } + var date = new Date(data.endTime); + var date1 = new Date(data.startTime); + if (date<date1){ + Feng.error("开始时间必须小于等于结束时间!") + return; + } + + $.ajax({ + url: Feng.ctxPath + "/introduce/addIntroduce" , + type: "POST", + data: JSON.stringify(data), + contentType: "application/json", + success: function (response) { + if (response=="5001"){ + Feng.error("当前手机号 已被注册") + }else{ + window.parent.TCompetition.table.refresh(); + TQuestion.close(); + Feng.success("添加成功"); + } + }, + error: function (xhr, status, error) { + Feng.error("添加失败!" + error); + } + }); +}; +TCompetition.onShelf = function () { + if (this.check()){ + var selected = $('#' + this.id).bootstrapTable('getSelections'); + const data1 = { + ids:[], + state:null + }; + selected.forEach(function(obj) { + var id = obj.id; + data1.ids.push(id); + }); + data1.state = 1; + + $.ajax({ + url: Feng.ctxPath + "/introduce/changeState", + type: "POST", + contentType: "application/json", // 设置请求头的 Content-Type + data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 + success: function(response) { + Feng.success("上架成功!"); + TCompetition.search(); + }, + error: function(xhr, status, error) { + var errorMessage = xhr.responseText ? xhr.responseText : "上架失败!"; + } + }); + } +}; +/** + * 下架 + */ +TCompetition.offShelf = function () { + if (this.check()){ + var selected = $('#' + this.id).bootstrapTable('getSelections'); + const data1 = { + ids:[], + state:null + }; + selected.forEach(function(obj) { + var id = obj.id; + data1.ids.push(id); + }); + data1.state = 2; + $.ajax({ + url: Feng.ctxPath + "/introduce/changeState", + type: "POST", + contentType: "application/json", // 设置请求头的 Content-Type + data: JSON.stringify(data1), // 将数据转换为 JSON 字符串 + success: function(response) { + Feng.success("下架成功!"); + TCompetition.search(); + }, + error: function(xhr, status, error) { + var errorMessage = xhr.responseText ? xhr.responseText : "下架失败!"; + } + }); + } +}; +/** + * 关闭此对话框 + */ +TCompetition.close = function() { + parent.layer.close(window.parent.TCompetition.layerIndex); +} /** * 点击添加车辆管理 */ @@ -88,113 +220,51 @@ area: ['100%', '100%'], //宽高 fix: false, //不固定 maxmin: true, - content: Feng.ctxPath + '/tCompetition/tCompetition_add' + content: Feng.ctxPath + '/introduce/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.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"); - } - + var selected = $('#' + this.id).bootstrapTable('getSelections'); + if(selected.length >1 ){ + Feng.info("只能选择一条进行查看!"); + }else { + if (this.check()) { + var index = layer.open({ + type: 2, + title: '详情', + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/introduce/update/' + TCompetition.seItem.id }); - ajax.set("TCompetitionId",TCompetition.seItem.id); - ajax.start(); - }); + this.layerIndex = index; + } + } +}; +// 跳转参与用户页面 +TCompetition.user = function () { + var selected = $('#' + this.id).bootstrapTable('getSelections'); + if(selected.length >1 ){ + Feng.info("只能选择一条进行查看!"); + }else { + if (this.check()) { + var index = layer.open({ + type: 2, + title: '详情', + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/introduce/user/' + TCompetition.seItem.id + }); + this.layerIndex = index; + } } }; -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; - } -}; + @@ -206,22 +276,15 @@ queryData['province'] = $("#pCode").val(); queryData['city'] = $("#cCode").val(); queryData['activityState'] = $("#activityState").val(); - queryData['createTime'] = $("#createTime").val(); + queryData['time'] = $("#createTime").val(); queryData['state'] = $("#state").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>'; - } + var content='<option value="">选择市</option>'; $.each(data, function(k,v) { content += "<option value='"+v.code+"'>"+v.name+"</option>"; }); @@ -230,7 +293,7 @@ }); ajax.set("oneId",oneId); ajax.start(); -} +}; TCompetition.resetSearch = function () { $("#pCode").val(""); $("#cCode").val(""); @@ -243,109 +306,6 @@ $(function () { var defaultColunms = TCompetition.initColumn(); var table = new BSTable(TCompetition.id, "/introduce/listAll", defaultColunms); - table.setPaginationType("server"); + table.setPaginationType("client"); 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); - } -} \ No newline at end of file diff --git a/cloud-server-management/src/main/webapp/static/modular/system/introduce/introduce_info.js b/cloud-server-management/src/main/webapp/static/modular/system/introduce/introduce_info.js new file mode 100644 index 0000000..9bc1e5e --- /dev/null +++ b/cloud-server-management/src/main/webapp/static/modular/system/introduce/introduce_info.js @@ -0,0 +1,482 @@ +/** + * 车辆管理管理初始化 + */ +var TCompetition = { + id: "TCompetitionTable", //表格id + seItem: null, //选中的条目 + table: null, + layerIndex: -1 +}; +var language =1 +/** + * 初始化表格的列 + */ +TCompetition.initColumn = function () { + return [ + {field: 'selectItem', checkbox: true}, + {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, + {title: '所在省市', field: 'provinceAndCity', visible: true, align: 'center', valign: 'middle',}, + {title: '开始时间', field: 'startTime', visible: true, align: 'center', valign: 'middle',}, + {title: '结束时间', field: 'endTime', visible: true, align: 'center', valign: 'middle',}, + {title: '赠送课时数', field: 'giveClass', visible: true, align: 'center', valign: 'middle',}, + {title: '参与次数', field: 'number', visible: true, align: 'center', valign: 'middle',}, + {title: '状态', field: 'activityState', visible: true, align: 'center', valign: 'middle', + formatter:function (data) { + return {1:"已开始",2:"未开始",3:"已结束"}[data] + } + }, + {title: '活动状态', field: 'state', visible: true, align: 'center', valign: 'middle', + formatter:function (data) { + return {1:"已上架",2:"已下架"}[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.addSubmit = function(){ + var data = { + id:null, + province:"", + provinceCode:"", + city:"", + cityCode:"", + startTime:"", + endTime:"", + giveClass:"", + state:1 + }; + data.province = $('#pCode option:selected').text(); + data.provinceCode = $("#pCode").val() + data.city = $('#cCode option:selected').text(); + data.cityCode = $("#cCode").val() + data.startTime = $("#startTime").val().replace("T"," ") + data.endTime = $("#endTime").val().replace("T"," ") + data.giveClass = $("#giveClass").val() + + + if($("#pCode").val()==''){ + Feng.info("请选择省") + return; + } + if($("#cCode").val()==''){ + Feng.info("请选择市") + return; + } + if($("#startTime").val()=='' ){ + Feng.info("请选择开始时间") + return; + } + if($("#endTime").val()=='' ){ + Feng.info("请选择结束时间") + return; + } + if($("#giveClass").val()=='' ){ + Feng.info("请输入赠送课时数") + return; + } + var date = new Date(data.endTime); + var date1 = new Date(data.startTime); + if (date<date1){ + Feng.error("开始时间必须小于等于结束时间!") + return; + } + + $.ajax({ + url: Feng.ctxPath + "/introduce/addIntroduce" , + type: "POST", + data: JSON.stringify(data), + contentType: "application/json", + success: function (response) { + window.parent.TCompetition.table.refresh(); + TCompetition.close(); + Feng.success("添加成功"); + }, + error: function (xhr, status, error) { + Feng.error("添加失败!" + error); + } + }); +}; +TCompetition.updateSubmit = function(){ + var data = { + id:null, + province:"", + provinceCode:"", + city:"", + cityCode:"", + startTime:"", + endTime:"", + giveClass:"", + state:1 + }; + data.province = $('#pCode option:selected').text(); + data.provinceCode = $("#pCode").val() + data.city = $('#cCode option:selected').text(); + data.cityCode = $("#cCode").val() + data.startTime = $("#startTime").val().replace("T"," ") + data.endTime = $("#endTime").val().replace("T"," ") + data.giveClass = $("#giveClass").val() + data.id = $("#id").val() + + if($("#pCode").val()==''){ + Feng.info("请选择省") + return; + } + if($("#cCode").val()==''){ + Feng.info("请选择市") + return; + } + if($("#startTime").val()=='' ){ + Feng.info("请选择开始时间") + return; + } + if($("#endTime").val()=='' ){ + Feng.info("请选择结束时间") + return; + } + if($("#giveClass").val()=='' ){ + Feng.info("请输入赠送课时数") + return; + } + var date = new Date(data.endTime); + var date1 = new Date(data.startTime); + if (date<date1){ + Feng.error("开始时间必须小于等于结束时间!") + return; + } + + $.ajax({ + url: Feng.ctxPath + "/introduce/addIntroduce" , + type: "POST", + data: JSON.stringify(data), + contentType: "application/json", + success: function (response) { + window.parent.TCompetition.table.refresh(); + TCompetition.close(); + Feng.success("修改成功"); + }, + error: function (xhr, status, error) { + Feng.error("添加失败!" + error); + } + }); +}; +/** + * 上架 + */ + + +/** + * 关闭此对话框 + */ +TCompetition.close = function() { + parent.layer.close(window.parent.TCompetition.layerIndex); +} +/** + * 点击添加车辆管理 + */ +TCompetition.openAddTCompetition = function () { + var index = layer.open({ + type: 2, + title: '添加', + area: ['100%', '100%'], //宽高 + fix: false, //不固定 + maxmin: true, + content: Feng.ctxPath + '/introduce/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.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['province'] = $("#pCode").val(); + queryData['city'] = $("#cCode").val(); + queryData['activityState'] = $("#activityState").val(); + queryData['createTime'] = $("#createTime").val(); + queryData['state'] = $("#state").val(); + TCompetition.table.refresh({query: queryData}); +}; +TCompetition.oneChange = function (e) { + var oneId=$(e).val(); + var ajax = new $ax(Feng.ctxPath + "/tCompetition/onChange", function(data){ + if(data!=null){ + var content='<option value="">选择市</option>'; + $.each(data, function(k,v) { + content += "<option value='"+v.code+"'>"+v.name+"</option>"; + }); + $("#cCode").empty().append(content); + } + }); + ajax.set("oneId",oneId); + ajax.start(); +}; +TCompetition.resetSearch = function () { + $("#pCode").val(""); + $("#cCode").val(""); + $("#createTime").val(""); + $("#state").val(""); + $("#activityState").val(""); + TCompetition.search(); +}; + +$(function () { + var defaultColunms = TCompetition.initColumn(); + var table = new BSTable(TCompetition.id, "/introduce/listAll", defaultColunms); + table.setPaginationType("client"); + 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); + } +} \ No newline at end of file diff --git a/cloud-server-management/src/main/webapp/static/modular/system/introduce/introduce_user.js b/cloud-server-management/src/main/webapp/static/modular/system/introduce/introduce_user.js new file mode 100644 index 0000000..62a7c97 --- /dev/null +++ b/cloud-server-management/src/main/webapp/static/modular/system/introduce/introduce_user.js @@ -0,0 +1,64 @@ +/** + * 车辆管理管理初始化 + */ +var TCompetition = { + id: "TCompetitionTable", //表格id + seItem: null, //选中的条目 + table: null, + layerIndex: -1 +}; +var language =1 +/** + * 初始化表格的列 + */ +TCompetition.initColumn = function () { + return [ + {field: 'selectItem', checkbox: true}, + {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, + {title: '分享用户', field: 'shareUsersName', visible: true, align: 'center', valign: 'middle',}, + {title: '联系方式', field: 'shareUsersphone', visible: true, align: 'center', valign: 'middle',}, + {title: '被分享用户', field: 'userName', visible: true, align: 'center', valign: 'middle',}, + {title: '联系方式', field: 'userPhone', visible: true, align: 'center', valign: 'middle',}, + {title: '注册时间', field: 'registerTime', visible: true, align: 'center', valign: 'middle',} + ]; +}; + +/** + * 关闭此对话框 + */ +TCompetition.close = function() { + parent.layer.close(window.parent.TCompetition.layerIndex); +}; + +/** + * 查询车辆管理列表 + */ +TCompetition.search = function () { + var queryData = {}; + queryData['shareUsersName'] = $("#pCode").val(); + queryData['shareUsersphone'] = $("#cCode").val(); + queryData['userName'] = $("#activityState").val(); + queryData['userPhone'] = $("#createTime").val(); + queryData['introduceId'] = $("#id").val(); + TCompetition.table.refresh({query: queryData}); +}; + + +TCompetition.resetSearch = function () { + $("#shareUsersName").val(""); + $("#shareUsersphone").val(""); + $("#userName").val(""); + $("#userPhone").val(""); + TCompetition.search(); +}; + +$(function () { + var id = $("#id").val(); + var defaultColunms = TCompetition.initColumn(); + var table = new BSTable(TCompetition.id, "/introduce/listAllUser", defaultColunms); + table.setPaginationType("client"); + TCompetition.table = table.init(); +}); + + + diff --git a/cloud-server-other/pom.xml b/cloud-server-other/pom.xml index a516f3c..0e4e55e 100644 --- a/cloud-server-other/pom.xml +++ b/cloud-server-other/pom.xml @@ -6,7 +6,7 @@ <groupId>cn.mb.cloud</groupId> <artifactId>mb-cloud-parent</artifactId> <version>1.1.3</version> - <relativePath>../../cloud-server-parent/pom.xml</relativePath> + <relativePath>../cloud-server-parent/pom.xml</relativePath> </parent> <artifactId>mb-cloud-other</artifactId> <packaging>jar</packaging> -- Gitblit v1.7.1