| | |
| | | import com.stylefeng.guns.modular.system.model.TAppUser; |
| | | import com.stylefeng.guns.modular.system.model.TCoupon; |
| | | import com.stylefeng.guns.modular.system.model.TOrder; |
| | | import com.stylefeng.guns.modular.system.model.TUserToCoupon; |
| | | import com.stylefeng.guns.modular.system.service.ITAppUserService; |
| | | import com.stylefeng.guns.modular.system.service.ITCouponService; |
| | | import com.stylefeng.guns.modular.system.service.ITOrderService; |
| | | import com.stylefeng.guns.modular.system.service.ITUserToCouponService; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | private ITCouponService tCouponService; |
| | | @Autowired |
| | | private ITOrderService tOrderService; |
| | | @Autowired |
| | | private ITUserToCouponService tUserToCouponService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | |
| | | for (TAppUser tAppUser : tAppUsers) { |
| | | TAppUserResp tAppUserResp = new TAppUserResp(); |
| | | BeanUtils.copyProperties(tAppUser,tAppUserResp); |
| | | List<TCoupon> tCoupons = tCouponService.selectList(new EntityWrapper<TCoupon>().eq("user_id", tAppUser.getId())); |
| | | List<TCoupon> notUsedList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.NOT_USED.getCode())).collect(Collectors.toList()); |
| | | tAppUserResp.setCouponSum(tCoupons.size()); |
| | | tAppUserResp.setNotUsedCount(notUsedList.size()); |
| | | |
| | | // 查询当前用户优惠券数量 |
| | | List<TUserToCoupon> tUserToCoupons = tUserToCouponService.selectList(new EntityWrapper<TUserToCoupon>().eq("userId", tAppUser.getId())); |
| | | |
| | | int couponTotal = tUserToCoupons.stream().mapToInt(TUserToCoupon::getCouponTotal).sum(); |
| | | int validCount = tUserToCoupons.stream().mapToInt(TUserToCoupon::getValidCount).sum(); |
| | | |
| | | // List<TCoupon> tCoupons = tCouponService.selectList(new EntityWrapper<TCoupon>().eq("user_id", tAppUser.getId())); |
| | | // List<TCoupon> notUsedList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.NOT_USED.getCode())).collect(Collectors.toList()); |
| | | tAppUserResp.setCouponSum(couponTotal); |
| | | tAppUserResp.setNotUsedCount(validCount); |
| | | List<TOrder> orders = tOrderService.selectList(new EntityWrapper<TOrder>().eq("userId", tAppUser.getId()).orderBy(true,"createTime",false)); |
| | | if(!CollectionUtils.isEmpty(orders)){ |
| | | List<TOrder> collect1 = orders.stream().filter(order->Objects.nonNull(order.getState())) |
| | |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.controller.req.CouponSendReq; |
| | | import com.stylefeng.guns.modular.system.enums.CouponStatusEnum; |
| | | import com.stylefeng.guns.modular.system.model.TUserToCoupon; |
| | | import com.stylefeng.guns.modular.system.service.ITUserToCouponService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.util.Assert; |
| | |
| | | import com.stylefeng.guns.modular.system.model.TCoupon; |
| | | import com.stylefeng.guns.modular.system.service.ITCouponService; |
| | | |
| | | import java.time.LocalDate; |
| | | import java.time.ZoneId; |
| | | import java.util.*; |
| | | |
| | | /** |
| | |
| | | |
| | | @Autowired |
| | | private ITCouponService tCouponService; |
| | | @Autowired |
| | | private ITUserToCouponService tUserToCouponService; |
| | | |
| | | /** |
| | | * 跳转到首页 |
| | |
| | | wrapper.between("create_time",startTime,endTime); |
| | | } |
| | | wrapper.orderBy(true,"create_time",false); |
| | | wrapper.groupBy(true,"coupon_name"); |
| | | wrapper.groupBy(true,"coupon_type"); |
| | | return tCouponService.selectList(wrapper); |
| | | } |
| | | |
| | | /** |
| | | * 获取活动券列表 |
| | | */ |
| | | @RequestMapping(value = "/activityCouponList") |
| | | @ResponseBody |
| | | public Object activityCouponList(String couponName) { |
| | | EntityWrapper<TCoupon> wrapper = new EntityWrapper<>(); |
| | | if(StringUtils.hasLength(couponName)){ |
| | | wrapper.like("coupon_name",couponName); |
| | | } |
| | | wrapper.eq("coupon_type",1); |
| | | wrapper.eq("coupon_state",1); |
| | | wrapper.orderBy(true,"create_time",false); |
| | | return tCouponService.selectList(wrapper); |
| | | } |
| | | |
| | |
| | | |
| | | List<Integer> userIds = couponSendReq.getUserIds(); |
| | | |
| | | // 查询选择的优惠券 |
| | | TCoupon tCoupon = tCouponService.selectById(couponSendReq.getCouponId()); |
| | | |
| | | List<TUserToCoupon> tUserToCoupons = new ArrayList<>(userIds.size()); |
| | | |
| | | for (Integer userId : userIds) { |
| | | // 创建用户优惠券关联表 |
| | | TUserToCoupon tUserToCoupon = new TUserToCoupon(); |
| | | tUserToCoupon.setCouponId(tCoupon.getId()); |
| | | tUserToCoupon.setUserId(userId); |
| | | tUserToCoupon.setCouponTotal(1); |
| | | tUserToCoupon.setValidCount(1); |
| | | Date expireTime = Date.from(LocalDate.now().plusDays(tCoupon.getCouponValidity()).atStartOfDay().atZone(ZoneId.systemDefault()).toInstant()); |
| | | System.err.println(expireTime); |
| | | tUserToCoupon.setExpireTime(expireTime); |
| | | tUserToCoupons.add(tUserToCoupon); |
| | | } |
| | | tUserToCouponService.insertBatch(tUserToCoupons); |
| | | |
| | | // 查询该优惠券的列表 |
| | | List<TCoupon> tCoupons = tCouponService.selectList(new EntityWrapper<TCoupon>().eq("coupon_name", couponSendReq.getCouponName()) |
| | | /*List<TCoupon> tCoupons = tCouponService.selectList(new EntityWrapper<TCoupon>().eq("coupon_name", couponSendReq.getCouponName()) |
| | | .eq("coupon_status",CouponStatusEnum.UNISSUED.getCode())); |
| | | Assert.isTrue(!CollectionUtils.isEmpty(tCoupons),"该优惠券不存在!"); |
| | | List<TCoupon> tCouponList = new ArrayList<>(); |
| | |
| | | } |
| | | if(!CollectionUtils.isEmpty(tCouponList)){ |
| | | tCouponService.updateBatchById(tCouponList); |
| | | } |
| | | }*/ |
| | | return SUCCESS_TIP; |
| | | } |
| | | |
| | |
| | | package com.stylefeng.guns.modular.system.controller.general; |
| | | |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TEvaluateResp; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TOrderResp; |
| | | import com.stylefeng.guns.modular.system.controller.util.ExcelUtil; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import com.stylefeng.guns.modular.system.model.TEvaluate; |
| | | import com.stylefeng.guns.modular.system.service.ITEvaluateService; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.OutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 跳转详情页面 |
| | | */ |
| | | @RequestMapping("/evaluateDetail") |
| | | public String evaluateDetail(Integer evaluateId, Model model) { |
| | | tEvaluateService.evaluateDetail(evaluateId,model); |
| | | return PREFIX + "tEvaluateDetail.html"; |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list") |
| | | @ResponseBody |
| | | public Object list(String condition) { |
| | | public Object list(String createTime,String userName,String driverName ,Integer score) { |
| | | return tEvaluateService.selectPageList(createTime,userName,driverName,null,score); |
| | | } |
| | | |
| | | /** |
| | | * 获取列表 |
| | | */ |
| | | @RequestMapping(value = "/list-back") |
| | | @ResponseBody |
| | | public Object listBack(String condition) { |
| | | return tEvaluateService.selectList(null); |
| | | } |
| | | |
| | |
| | | public Object detail(@PathVariable("tEvaluateId") Integer tEvaluateId) { |
| | | return tEvaluateService.selectById(tEvaluateId); |
| | | } |
| | | |
| | | @ApiOperation(value = "导出评价列表",notes="导出评价列表") |
| | | @RequestMapping(value = "/export") |
| | | @ResponseBody |
| | | public void export(String createTime,String userName,String driverName,Integer score, HttpServletResponse response) { |
| | | try { |
| | | Date date = new Date(); |
| | | DateFormat format = new SimpleDateFormat("yyyyMMdd"); |
| | | String time1 = format.format(date); |
| | | String fileName = "EvaluateInfo"+time1+".xls"; |
| | | String[] title = new String[] {"评价时间","订单编号","评论用户", |
| | | "评论用户手机号","评论司机","司机手机号","评价分数","评价内容"}; |
| | | List<TEvaluateResp> list = tEvaluateService.selectPageList(createTime, userName, driverName, null, score); |
| | | String[][] values = new String[list.size()][]; |
| | | for (int i = 0; i < list.size(); i++) { |
| | | TEvaluateResp d = list.get(i); |
| | | values[i] = new String[title.length]; |
| | | values[i][0] = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(d.getCreateTime()); |
| | | values[i][1] = d.getCode(); |
| | | values[i][2] = d.getUserName(); |
| | | values[i][3] = d.getUserPhone(); |
| | | values[i][4] = d.getDriverName(); |
| | | values[i][5] = d.getDriverPhone(); |
| | | values[i][6] = String.valueOf(Objects.nonNull(d.getScore())?d.getScore(): ""); |
| | | Integer score1 = d.getScore(); |
| | | if(Objects.nonNull(score1)){ |
| | | if(1 == score1){ |
| | | values[i][6] = "非常差"; |
| | | }else if (2 == score1){ |
| | | values[i][6] = "差"; |
| | | }else if (3 == score1){ |
| | | values[i][6] = "一般"; |
| | | }else if (4 == score1){ |
| | | values[i][6] = "满意"; |
| | | }else if (5 == score1){ |
| | | values[i][6] = "非常满意"; |
| | | } |
| | | }else { |
| | | values[i][6] = ""; |
| | | } |
| | | values[i][7] = d.getEvaluate(); |
| | | } |
| | | HSSFWorkbook wb = ExcelUtil.getHSSFWorkbook("Variance"+time1, title, values, null); |
| | | ExcelUtil.setResponseHeader(response, fileName); |
| | | OutputStream os = response.getOutputStream(); |
| | | wb.write(os); |
| | | os.flush(); |
| | | os.close(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "优惠券名称") |
| | | private String couponName; |
| | | @ApiModelProperty(value = "优惠券ID") |
| | | private Integer couponId; |
| | | |
| | | public Integer getCouponId() { |
| | | return couponId; |
| | | } |
| | | |
| | | public void setCouponId(Integer couponId) { |
| | | this.couponId = couponId; |
| | | } |
| | | |
| | | public List<Integer> getUserIds() { |
| | | return userIds; |
New file |
| | |
| | | package com.stylefeng.guns.modular.system.controller.resp; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TEvaluate; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | |
| | | public class TEvaluateResp extends TEvaluate { |
| | | |
| | | @ApiModelProperty(value = "订单编号") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "评论用户名") |
| | | private String userName; |
| | | |
| | | @ApiModelProperty(value = "评论用户手机号") |
| | | private String userPhone; |
| | | |
| | | @ApiModelProperty(value = "评论司机") |
| | | private String driverName; |
| | | |
| | | @ApiModelProperty(value = "司机手机号") |
| | | private String driverPhone; |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public String getUserName() { |
| | | return userName; |
| | | } |
| | | |
| | | public void setUserName(String userName) { |
| | | this.userName = userName; |
| | | } |
| | | |
| | | public String getUserPhone() { |
| | | return userPhone; |
| | | } |
| | | |
| | | public void setUserPhone(String userPhone) { |
| | | this.userPhone = userPhone; |
| | | } |
| | | |
| | | public String getDriverName() { |
| | | return driverName; |
| | | } |
| | | |
| | | public void setDriverName(String driverName) { |
| | | this.driverName = driverName; |
| | | } |
| | | |
| | | public String getDriverPhone() { |
| | | return driverPhone; |
| | | } |
| | | |
| | | public void setDriverPhone(String driverPhone) { |
| | | this.driverPhone = driverPhone; |
| | | } |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.dao; |
| | | |
| | | import com.stylefeng.guns.modular.system.controller.resp.TEvaluateResp; |
| | | import com.stylefeng.guns.modular.system.model.TEvaluate; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author stylefeng |
| | | * @since 2023-02-27 |
| | | */ |
| | | @Mapper |
| | | public interface TEvaluateMapper extends BaseMapper<TEvaluate> { |
| | | |
| | | /** |
| | | * 查询评论列表 |
| | | * @param startTime 开始时间 |
| | | * @param endTime 结束时间 |
| | | * @param userName 评论用户名 |
| | | * @param driverName 评论司机名 |
| | | * @param orderType 订单类型 |
| | | * @param score 评价分数 |
| | | * @return |
| | | */ |
| | | List<TEvaluateResp> selectPageList(@Param("startTime") String startTime,@Param("endTime") String endTime, @Param("userName")String userName, |
| | | @Param("driverName")String driverName, @Param("orderType")Integer orderType, @Param("score")Integer score); |
| | | } |
| | |
| | | <sql id="Base_Column_List"> |
| | | id, orderId, userId, score, evaluate, status, createTime |
| | | </sql> |
| | | <select id="selectPageList" resultType="com.stylefeng.guns.modular.system.controller.resp.TEvaluateResp"> |
| | | select e.id, e.orderId, e.userId, e.score, e.evaluate, e.status, e.createTime, |
| | | a.nickname AS userName,a.phone AS userPhone,o.code,d.name AS driverName,d.phone AS driverPhone |
| | | from t_evaluate e |
| | | left join t_app_user a on e.userId = a.id |
| | | left join t_order o on e.orderId = o.id |
| | | left join t_driver d on o.driverId = d.id |
| | | <where> |
| | | <if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> |
| | | AND e.createTime between #{startTime} and #{endTime} |
| | | </if> |
| | | <if test="userName != null and userName != ''"> |
| | | AND a.nickname LIKE concat('%',#{userName},'%') |
| | | </if> |
| | | <if test="driverName != null and driverName != ''"> |
| | | AND d.name LIKE concat('%',#{driverName},'%') |
| | | </if> |
| | | <if test="score != null"> |
| | | AND e.score = #{score} |
| | | </if> |
| | | </where> |
| | | ORDER BY e.createTime DESC |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | @TableField("coupon_state") |
| | | private Integer couponState; |
| | | |
| | | @ApiModelProperty(value = "优惠券数量") |
| | | @TableField("coupon_count") |
| | | private Integer couponCount; |
| | | |
| | | public Integer getCouponCount() { |
| | | return couponCount; |
| | | } |
| | | |
| | | public void setCouponCount(Integer couponCount) { |
| | | this.couponCount = couponCount; |
| | | } |
| | | |
| | | public Integer getAgentId() { |
| | | return agentId; |
| | | } |
| | |
| | | package com.stylefeng.guns.modular.system.service; |
| | | |
| | | import com.stylefeng.guns.modular.system.controller.resp.TEvaluateResp; |
| | | import com.stylefeng.guns.modular.system.model.TEvaluate; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import org.springframework.ui.Model; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface ITEvaluateService extends IService<TEvaluate> { |
| | | |
| | | /** |
| | | * 查询分页列表 |
| | | * @param createTime 评价时间 |
| | | * @param userName 评论用户名 |
| | | * @param driverName 评论司机名 |
| | | * @param orderType 订单类型 |
| | | * @param score 评价分数 |
| | | * @return |
| | | */ |
| | | List<TEvaluateResp> selectPageList(String createTime, String userName, String driverName, Integer orderType, Integer score); |
| | | |
| | | /** |
| | | * 跳转详情页面 |
| | | * @param evaluateId |
| | | * @param model |
| | | */ |
| | | void evaluateDetail(Integer evaluateId, Model model); |
| | | } |
| | |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.modular.system.dao.TCouponMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TOrderMapper; |
| | | import com.stylefeng.guns.modular.system.dao.TUserToCouponMapper; |
| | | import com.stylefeng.guns.modular.system.enums.CouponStatusEnum; |
| | | import com.stylefeng.guns.modular.system.enums.OrderStateEnum; |
| | | import com.stylefeng.guns.modular.system.model.TAppUser; |
| | | import com.stylefeng.guns.modular.system.dao.TAppUserMapper; |
| | | import com.stylefeng.guns.modular.system.model.TCoupon; |
| | | import com.stylefeng.guns.modular.system.model.TOrder; |
| | | import com.stylefeng.guns.modular.system.model.TUserToCoupon; |
| | | import com.stylefeng.guns.modular.system.service.ITAppUserService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private TCouponMapper tCouponMapper; |
| | | @Autowired |
| | | private TOrderMapper tOrderMapper; |
| | | @Autowired |
| | | private TUserToCouponMapper tUserToCouponMapper; |
| | | |
| | | @Override |
| | | public void detail(Integer tAppUserId, Model model) { |
| | |
| | | model.addAttribute("customerChannel",""); |
| | | |
| | | // 消费信息:优惠券数据 |
| | | List<TCoupon> tCoupons = tCouponMapper.selectList(new EntityWrapper<TCoupon>().eq("user_id", tAppUserId)); |
| | | List<TCoupon> notUsedList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.NOT_USED.getCode())).collect(Collectors.toList()); |
| | | List<TCoupon> usedList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.USED.getCode())).collect(Collectors.toList()); |
| | | List<TCoupon> expiredList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.EXPIRED.getCode())).collect(Collectors.toList()); |
| | | model.addAttribute("couponSum",tCoupons.size()); |
| | | model.addAttribute("notUsedCount",notUsedList.size()); |
| | | model.addAttribute("usedCount",usedList.size()); |
| | | model.addAttribute("expiredCount",expiredList.size()); |
| | | // List<TCoupon> tCoupons = tCouponMapper.selectList(new EntityWrapper<TCoupon>().eq("user_id", tAppUserId)); |
| | | // List<TCoupon> notUsedList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.NOT_USED.getCode())).collect(Collectors.toList()); |
| | | // List<TCoupon> usedList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.USED.getCode())).collect(Collectors.toList()); |
| | | // List<TCoupon> expiredList = tCoupons.stream().filter(coupon -> coupon.getCouponStatus().equals(CouponStatusEnum.EXPIRED.getCode())).collect(Collectors.toList()); |
| | | // 查询当前用户优惠券数量 |
| | | List<TUserToCoupon> tUserToCoupons = tUserToCouponMapper.selectList(new EntityWrapper<TUserToCoupon>().eq("userId", tAppUser.getId())); |
| | | |
| | | int couponTotal = tUserToCoupons.stream().mapToInt(TUserToCoupon::getCouponTotal).sum(); |
| | | int validCount = tUserToCoupons.stream().mapToInt(TUserToCoupon::getValidCount).sum(); |
| | | int expireCount = tUserToCoupons.stream().mapToInt(TUserToCoupon::getExpireCount).sum(); |
| | | model.addAttribute("couponSum",couponTotal); |
| | | model.addAttribute("notUsedCount",validCount); |
| | | model.addAttribute("usedCount",couponTotal-validCount-expireCount); |
| | | model.addAttribute("expiredCount",expireCount); |
| | | // 查询订单数据 |
| | | List<TOrder> orders = tOrderMapper.selectList(new EntityWrapper<TOrder>().eq("userId", tAppUserId).orderBy(true,"createTime",false)); |
| | | if(!CollectionUtils.isEmpty(orders)){ |
| | |
| | | package com.stylefeng.guns.modular.system.service.impl; |
| | | |
| | | import com.stylefeng.guns.modular.system.model.TEvaluate; |
| | | import com.stylefeng.guns.modular.system.dao.TEvaluateMapper; |
| | | import com.stylefeng.guns.modular.system.controller.resp.TEvaluateResp; |
| | | import com.stylefeng.guns.modular.system.dao.*; |
| | | import com.stylefeng.guns.modular.system.model.*; |
| | | import com.stylefeng.guns.modular.system.service.ITEvaluateService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | @Service |
| | | public class TEvaluateServiceImpl extends ServiceImpl<TEvaluateMapper, TEvaluate> implements ITEvaluateService { |
| | | |
| | | @Autowired |
| | | private TEvaluateMapper tEvaluateMapper; |
| | | @Autowired |
| | | private TAppUserMapper tAppUserMapper; |
| | | |
| | | @Autowired |
| | | private TOrderMapper tOrderMapper; |
| | | @Autowired |
| | | private TDriverMapper tDriverMapper; |
| | | @Autowired |
| | | private TBranchOfficeMapper tBranchOfficeMapper; |
| | | |
| | | @Override |
| | | public List<TEvaluateResp> selectPageList(String createTime, String userName, String driverName, Integer orderType, Integer score) { |
| | | String startTime = null; |
| | | String endTime = null; |
| | | // 开始,结束时间 |
| | | if(StringUtils.hasLength(createTime)){ |
| | | String[] split = createTime.split(" - "); |
| | | startTime = split[0]; |
| | | endTime = split[1]; |
| | | } |
| | | return tEvaluateMapper.selectPageList(startTime,endTime,userName,driverName,orderType,score); |
| | | } |
| | | |
| | | @Override |
| | | public void evaluateDetail(Integer evaluateId, Model model) { |
| | | // 查询评价 |
| | | TEvaluate tEvaluate = tEvaluateMapper.selectById(evaluateId); |
| | | |
| | | model.addAttribute("score",tEvaluate.getScore()); |
| | | model.addAttribute("evaluate",tEvaluate.getEvaluate()); |
| | | |
| | | // 查询用户 |
| | | TAppUser tAppUser = tAppUserMapper.selectById(tEvaluate.getUserId()); |
| | | if(Objects.nonNull(tAppUser)){ |
| | | model.addAttribute("userName",tAppUser.getNickname()); |
| | | model.addAttribute("userPhone",tAppUser.getPhone()); |
| | | }else { |
| | | model.addAttribute("userName",""); |
| | | model.addAttribute("userPhone",""); |
| | | } |
| | | |
| | | // 查询订单 |
| | | TOrder tOrder = tOrderMapper.selectById(tEvaluate.getOrderId()); |
| | | |
| | | model.addAttribute("createTime",new SimpleDateFormat("yyyy-MM-dd HH:mm").format(tOrder.getCreateTime())); |
| | | model.addAttribute("code",tOrder.getCode()); |
| | | model.addAttribute("source",tOrder.getSource()); |
| | | model.addAttribute("startTime",new SimpleDateFormat("yyyy-MM-dd HH:mm").format(tOrder.getStartTime())); |
| | | model.addAttribute("boardingTime",new SimpleDateFormat("yyyy-MM-dd HH:mm").format(tOrder.getBoardingTime())); |
| | | model.addAttribute("getoffTime",new SimpleDateFormat("yyyy-MM-dd HH:mm").format(tOrder.getGetoffTime())); |
| | | model.addAttribute("startAddress",tOrder.getStartAddress()); |
| | | model.addAttribute("endAddress",tOrder.getEndAddress()); |
| | | |
| | | // 查询司机 |
| | | TDriver tDriver = tDriverMapper.selectById(tOrder.getDriverId()); |
| | | if(Objects.nonNull(tDriver)){ |
| | | model.addAttribute("driverName",tDriver.getName()); |
| | | // 查询分公司 |
| | | TBranchOffice tBranchOffice = tBranchOfficeMapper.selectById(tDriver.getBranchOfficeId()); |
| | | if(Objects.nonNull(tBranchOffice)){ |
| | | model.addAttribute("branchOfficeName",tBranchOffice.getPrincipal()); |
| | | }else { |
| | | model.addAttribute("branchOfficeName",""); |
| | | } |
| | | }else { |
| | | model.addAttribute("driverName",""); |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | <input hidden id="userIds" value="${userIds}"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="condition" name="优惠券名称" placeholder="请输入优惠券名称"/> |
| | | <#NameCon id="couponName" name="优惠券名称" placeholder="请输入优惠券名称"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCoupon.search()"/> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tCoupon/tCoupon.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tAppUser/tCoupon.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tAppUser/tAppUser_info.js"></script> |
| | | @} |
| | |
| | | <input hidden id="userIds" value="${userIds}"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="condition" name="优惠券名称" placeholder="请输入优惠券名称"/> |
| | | <#NameCon id="couponName" name="优惠券名称" placeholder="请输入优惠券名称"/> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TCoupon.search()"/> |
| | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tCoupon/tCoupon.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tAppUser/tCoupon.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tAppUser/tAppUserException.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tAppUser/tAppUser_info.js"></script> |
| | |
| | | <div class="ibox-title"> |
| | | <h5>添加</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="ibox-content" id="driverInfoForm"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <input hidden id="areaId"> |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >姓名:</label> |
| | | <input id="name" type="text" style="height: 30px" required> |
| | | <input id="name" name="name" type="text" style="height: 30px" required="required"> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >手机号:</label> |
| | | <input id="phone" type="number" style="height: 30px" required> |
| | | <input id="phone" name="phone" type="number" style="height: 30px" required="required"> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >紧急联系人姓名:</label> |
| | | <input id="emergencyContact" type="text" style="height: 30px" required> |
| | | <input id="emergencyContact" name="emergencyContact" type="text" style="height: 30px" required> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >紧急联系人电话:</label> |
| | | <input id="emergencyPhone" type="number" style="height: 30px" required> |
| | | <input id="emergencyPhone" name="emergencyPhone" type="number" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >身份证号码:</label> |
| | | <input id="idcard" type="text" style="height: 30px" required> |
| | | <input id="idcard" name="idcard" type="text" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="ibox-title"> |
| | | <h5>添加</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="ibox-content" id="driverInfoForm"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <input hidden id="id" value="${item.id}"/> |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >姓名:</label> |
| | | <input id="name" value="${item.name}" type="text" style="height: 30px" required> |
| | | <input id="name" name="name" value="${item.name}" type="text" style="height: 30px" required> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >手机号:</label> |
| | | <input id="phone" value="${item.phone}" type="number" style="height: 30px" required> |
| | | <input id="phone" name="phone" value="${item.phone}" type="number" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >紧急联系人姓名:</label> |
| | | <input id="emergencyContact" value="${item.emergencyContact}" type="text" style="height: 30px" required> |
| | | <input id="emergencyContact" name="emergencyContact" value="${item.emergencyContact}" type="text" style="height: 30px" required> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >紧急联系人电话:</label> |
| | | <input id="emergencyPhone" value="${item.emergencyPhone}" type="number" style="height: 30px" required> |
| | | <input id="emergencyPhone" name="emergencyPhone" value="${item.emergencyPhone}" type="number" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <span style="color:red">*</span> |
| | | <label class="control-label" >身份证号码:</label> |
| | | <input id="idcard" value="${item.idcard}" type="text" style="height: 30px" required> |
| | | <input id="idcard" name="idcard" value="${item.idcard}" type="text" style="height: 30px" required> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | <div class="row"> |
| | | <div class="col-sm-3"> |
| | | <#NameCon id="condition" name="名称" /> |
| | | <div class="col-sm-2"> |
| | | <#TimeCon id="createTime" name="评论时间" /> |
| | | </div> |
| | | <div class="col-sm-3"> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="userName" name="用户名" /> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#NameCon id="driverName" name="司机名" /> |
| | | </div> |
| | | <!--<div class="col-sm-1"> |
| | | <select class="input-group" id="orderType" style="width: 120px;height: 33px" name="orderType"> |
| | | <option value="">选择订单类型</option> |
| | | </select> |
| | | </div>--> |
| | | <div class="col-sm-2"> |
| | | <select class="input-group" id="score" style="width: 120px;height: 33px" name="score"> |
| | | <option value="">选择分数</option> |
| | | <option value="1">非常差</option> |
| | | <option value="2">差</option> |
| | | <option value="3">一般</option> |
| | | <option value="4">满意</option> |
| | | <option value="5">非常满意</option> |
| | | </select> |
| | | </div> |
| | | <div class="col-sm-2"> |
| | | <#button name="搜索" icon="fa-search" clickFun="TEvaluate.search()"/> |
| | | <#button name="重置" icon="fa-trash" clickFun="TEvaluate.resetSearch()" space="true"/> |
| | | </div> |
| | | <div class="col-sm-12"> |
| | | <button type="button" class="btn btn-primary " onclick="TEvaluate.export()" id="export"> |
| | | <i class="fa "></i> 导出 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TEvaluateTableToolbar" role="group"> |
| | |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tEvaluate/tEvaluate.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#createTime', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | </script> |
| | | @} |
New file |
| | |
| | | @layout("/common/_container.html"){ |
| | | <div class="row"> |
| | | <div class="col-sm-12"> |
| | | <div class="ibox float-e-margins"> |
| | | <div class="ibox-title"> |
| | | <h5>详情</h5> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | <div class="row row-lg"> |
| | | <div class="col-sm-12"> |
| | | |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C">订单信息</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >下单时间:</label> |
| | | <label>${createTime}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >订单编号:</label> |
| | | <label>${code}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >订单来源:</label> |
| | | <label>${source}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >乘车时间:</label> |
| | | <label>${startTime}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="color: green" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label">下单用户昵称:</label> |
| | | <label>${userName}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">下单用户手机号:</label> |
| | | <label>${userPhone}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C">上下地点</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >起点:</label> |
| | | <label>${startAddress}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">终点:</label> |
| | | <label>${endAddress}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" style="color: red" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >接单司机:</label> |
| | | <label>${driverName}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >所属机构:</label> |
| | | <label>${branchOfficeName}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >上车地点:</label> |
| | | <label>${startAddress}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">上车时间:</label> |
| | | <label>${boardingTime}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-3 control-label form-group" > |
| | | <label class="control-label" >下车地点:</label> |
| | | <label>${endAddress}</label> |
| | | </div> |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label">下车时间:</label> |
| | | <label>${getoffTime}</label> |
| | | </div> |
| | | </div> |
| | | |
| | | <hr/> |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div style="background-color: gray;height: 35px;line-height: 35px"> |
| | | <label style="color: #0C0C0C">评论详情</label> |
| | | </div> |
| | | </div> |
| | | <hr/> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >评论分数:</label> |
| | | @if(score==1){ |
| | | <label>非常差</label> |
| | | @} |
| | | @if(score==2){ |
| | | <label>差</label> |
| | | @} |
| | | @if(score==3){ |
| | | <label>一般</label> |
| | | @} |
| | | @if(score==4){ |
| | | <label>满意</label> |
| | | @} |
| | | @if(score==5){ |
| | | <label>非常满意</label> |
| | | @} |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="initialLevel col-sm-12 control-label form-group" > |
| | | <div class="initialLevel col-sm-2 control-label form-group" > |
| | | <label class="control-label" >评论内容:</label> |
| | | <div style="margin-left: 70px" > |
| | | <textarea id="evaluate" style="width: 681px; height: 249px;" readonly>${evaluate}</textarea> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="hidden-xs" id="TDriverTableToolbar" role="group" style="text-align: center"> |
| | | <#button name="取消" icon="fa-plus" clickFun="TEvaluateInfoDlg.close()" /> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script src="${ctxPath}/static/modular/system/tEvaluate/tEvaluate.js"></script> |
| | | <script src="${ctxPath}/static/modular/system/tEvaluate/tEvaluate_info.js"></script> |
| | | <script type="text/javascript"> |
| | | laydate.render({ |
| | | elem: '#createTime', |
| | | type: 'date', |
| | | range: true |
| | | }); |
| | | </script> |
| | | @} |
| | |
| | | }); |
| | | ajax.setData({ |
| | | userIds:$("#userIds").val(), |
| | | couponId:TCoupon.seItem.id, |
| | | couponName:TCoupon.seItem.couponName |
| | | }) |
| | | ajax.start(); |
| | |
| | | TCoupon.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '创建时间', field: 'createtime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券名称', field: 'couponName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券类型', field: 'couponType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券码', field: 'couponCode', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券状态', field: 'couponStatus', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '服务类型', field: 'couponServiceType', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '服务类型', field: 'couponServiceType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponServiceType === 1){ |
| | | return '<span>通用型</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '优惠券类型', field: 'couponType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponType === 1){ |
| | | return '<span>活动券</span>' |
| | | }else if (row.couponType === 2){ |
| | | return '<span>新人券</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '优惠券码', field: 'couponCode', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券状态', field: 'couponStatus', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '条件金额', field: 'couponConditionalAmount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠金额', field: 'couponPreferentialAmount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '有效期', field: 'couponValidity', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '赠送数量', field: 'couponSendQuantity', visible: true, align: 'center', valign: 'middle'} |
| | | {title: '有效期', field: 'couponValidity', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '赠送数量', field: 'couponSendQuantity', visible: false, align: 'center', valign: 'middle'} |
| | | ]; |
| | | }; |
| | | |
| | |
| | | }); |
| | | ajax.setData({ |
| | | userIds:$("#userIds").val(), |
| | | couponId:this.seItem.id, |
| | | couponName:this.seItem.couponName |
| | | }) |
| | | ajax.start(); |
| | |
| | | */ |
| | | TCoupon.search = function () { |
| | | var queryData = {}; |
| | | queryData['condition'] = $("#condition").val(); |
| | | queryData['couponName'] = $("#couponName").val(); |
| | | TCoupon.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | $(function () { |
| | | var defaultColunms = TCoupon.initColumn(); |
| | | var table = new BSTable(TCoupon.id, "/tCoupon/list", defaultColunms); |
| | | var table = new BSTable(TCoupon.id, "/tCoupon/activityCouponList", defaultColunms); |
| | | table.setPaginationType("client"); |
| | | TCoupon.table = table.init(); |
| | | }); |
| | |
| | | TCoupon.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '创建时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券名称', field: 'couponName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '服务类型', field: 'couponServiceType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponServiceType === 1){ |
| | | return '<span>通用型</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '优惠券类型', field: 'couponType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponType === 1){ |
| | |
| | | } |
| | | } |
| | | }, |
| | | {title: '优惠券码', field: 'couponCode', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券状态', field: 'couponStatus', visible: true, align: 'center', valign: 'middle', |
| | | {title: '优惠券码', field: 'couponCode', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '优惠券状态', field: 'couponStatus', visible: false, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponStatus === 1){ |
| | | return '<span>未发放</span>' |
| | |
| | | } |
| | | } |
| | | }, |
| | | {title: '服务类型', field: 'couponServiceType', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponServiceType === 1){ |
| | | return '<span>通用型</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '条件金额', field: 'couponConditionalAmount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '优惠金额', field: 'couponPreferentialAmount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '有效期', field: 'couponValidity', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '赠送数量', field: 'couponSendQuantity', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '数量', field: 'couponCount', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '有效期', field: 'couponValidity', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态', field: 'couponState', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.couponState === 1){ |
| | |
| | | * 初始化详情对话框 |
| | | */ |
| | | var TDriverInfoDlg = { |
| | | tDriverInfoData : {} |
| | | tDriverInfoData : {}, |
| | | validateFields: { |
| | | name: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '姓名不能为空' |
| | | } |
| | | } |
| | | }, |
| | | phone: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '手机号不能为空' |
| | | } |
| | | } |
| | | }, |
| | | emergencyContact: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '紧急联系人姓名不能为空' |
| | | } |
| | | } |
| | | }, |
| | | emergencyPhone: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '紧急联系人电话不能为空' |
| | | } |
| | | } |
| | | }, |
| | | area: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '请选择服务区域' |
| | | } |
| | | } |
| | | }, |
| | | idcard: { |
| | | validators: { |
| | | notEmpty: { |
| | | message: '身份证号码不能为空' |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | }; |
| | | |
| | | /** |
| | | * 验证数据是否为空 |
| | | */ |
| | | TDriverInfoDlg.validate = function () { |
| | | $('#driverInfoForm').data("bootstrapValidator").resetForm(); |
| | | $('#driverInfoForm').bootstrapValidator('validate'); |
| | | return $("#driverInfoForm").data('bootstrapValidator').isValid(); |
| | | }; |
| | | |
| | | /** |
| | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | var idcardFront = $("#idcardFront").val(); |
| | | if ("" == idcardFront){ |
| | | Feng.info("请上传身份证正面照"); |
| | | return; |
| | | } |
| | | |
| | | var idcardBack = $("#idcardBack").val(); |
| | | if ("" == idcardBack){ |
| | | Feng.info("请上传身份证背面照"); |
| | | return; |
| | | } |
| | | |
| | | var driverLicense = $("#driverLicense").val(); |
| | | if ("" == driverLicense){ |
| | | Feng.info("请上传驾驶证"); |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/add", function(data){ |
| | | if(data.code == 500){ |
| | |
| | | this.clearData(); |
| | | this.collectData(); |
| | | |
| | | if(!this.validate()){ |
| | | return ; |
| | | } |
| | | |
| | | var idcardFront = $("#idcardFront").val(); |
| | | if ("" == idcardFront){ |
| | | Feng.info("请上传身份证正面照"); |
| | | return; |
| | | } |
| | | |
| | | var idcardBack = $("#idcardBack").val(); |
| | | if ("" == idcardBack){ |
| | | Feng.info("请上传身份证背面照"); |
| | | return; |
| | | } |
| | | |
| | | var driverLicense = $("#driverLicense").val(); |
| | | if ("" == driverLicense){ |
| | | Feng.info("请上传驾驶证"); |
| | | return; |
| | | } |
| | | |
| | | //提交信息 |
| | | var ajax = new $ax(Feng.ctxPath + "/tDriver/update", function(data){ |
| | | if(data.code == 500){ |
| | |
| | | } |
| | | |
| | | $(function() { |
| | | |
| | | Feng.initValidator("driverInfoForm", TDriverInfoDlg.validateFields); |
| | | }); |
| | |
| | | TEvaluate.initColumn = function () { |
| | | return [ |
| | | {field: 'selectItem', radio: true}, |
| | | {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '订单id', field: 'orderId', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '用户id', field: 'userId', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '评分', field: 'score', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '评价内容', field: 'evaluate', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '状态(1=正常,2=冻结,3=删除)', field: 'status', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'} |
| | | {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '订单id', field: 'orderId', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '用户id', field: 'userId', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '状态(1=正常,2=冻结,3=删除)', field: 'status', visible: false, align: 'center', valign: 'middle'}, |
| | | {title: '评价时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}, |
| | | |
| | | {title: '订单编号', field: 'code', 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: 'driverName', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '司机手机号', field: 'driverPhone', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '评价分数', field: 'score', visible: true, align: 'center', valign: 'middle', |
| | | formatter: function (value, row) { |
| | | if (row.score === 1){ |
| | | return '<span>非常差</span>' |
| | | }else if (row.score === 2){ |
| | | return '<span>差</span>' |
| | | }else if (row.score === 3){ |
| | | return '<span>一般</span>' |
| | | }else if (row.score === 4){ |
| | | return '<span>满意</span>' |
| | | }else if (row.score === 5){ |
| | | return '<span>非常满意</span>' |
| | | } |
| | | } |
| | | }, |
| | | {title: '评价内容', field: 'evaluate', visible: true, align: 'center', valign: 'middle'}, |
| | | {title: '操作', visible: true, align: 'center', valign: 'middle',width:150, |
| | | formatter: function (value, row) { |
| | | return '<a href="#" onclick="TEvaluate.searchTAppUserDetail('+row.id+')" style="color:blue">详情</a>' |
| | | } |
| | | } |
| | | ]; |
| | | }; |
| | | |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 打开查看详情(使用中) |
| | | */ |
| | | TEvaluate.searchTAppUserDetail = function (id) { |
| | | var index = layer.open({ |
| | | type: 2, |
| | | title: '详情', |
| | | area: ['100%', '100%'], //宽高 |
| | | fix: false, //不固定 |
| | | maxmin: true, |
| | | content: Feng.ctxPath + '/tEvaluate/evaluateDetail?evaluateId=' + id |
| | | }); |
| | | this.layerIndex = index; |
| | | }; |
| | | |
| | | /** |
| | | * 删除 |
| | | */ |
| | | TEvaluate.delete = function () { |
| | |
| | | }; |
| | | |
| | | /** |
| | | * 订单信息导出 |
| | | */ |
| | | TEvaluate.export=function(){ |
| | | var createTime=$("#createTime").val() |
| | | var userName=$("#userName").val() |
| | | var driverName=$("#driverName").val() |
| | | var orderType=$("#orderType").val() |
| | | var score=$("#score").val() |
| | | window.location.href=Feng.ctxPath + "/tEvaluate/export?createTime="+createTime |
| | | +"&userName="+userName |
| | | +"&driverName="+driverName |
| | | +"&orderType="+orderType |
| | | +"&score="+score |
| | | ; |
| | | } |
| | | |
| | | /** |
| | | * 查询列表 |
| | | */ |
| | | TEvaluate.search = function () { |
| | | var queryData = {}; |
| | | queryData['condition'] = $("#condition").val(); |
| | | queryData['createTime'] = $("#createTime").val(); |
| | | queryData['userName'] = $("#userName").val(); |
| | | queryData['driverName'] = $("#driverName").val(); |
| | | queryData['orderType'] = $("#orderType").val(); |
| | | queryData['score'] = $("#score").val(); |
| | | TEvaluate.table.refresh({query: queryData}); |
| | | }; |
| | | |
| | | /** |
| | | * 重置 |
| | | */ |
| | | TEvaluate.resetSearch = function (){ |
| | | $("#createTime").val(''); |
| | | $("#userName").val(''); |
| | | $("#driverName").val(''); |
| | | $("#orderType").val(''); |
| | | $("#score").val(''); |
| | | TEvaluate.search(); |
| | | } |
| | | |
| | | $(function () { |
| | | var defaultColunms = TEvaluate.initColumn(); |
| | | var table = new BSTable(TEvaluate.id, "/tEvaluate/list", defaultColunms); |