记得上下班打卡 | git大法好,push需谨慎

Commit 6d58cb3a authored by 胡佳晨's avatar 胡佳晨

提交 验票子账号设置

parent 67c3f04e
package com.liquidnet.service.kylin.service.partner; package com.liquidnet.service.kylin.service.partner;
import com.github.pagehelper.PageInfo;
import com.liquidnet.service.kylin.dao.ChildPerformanceDao;
import com.liquidnet.service.kylin.entity.KylinCheckUserPerformances; import com.liquidnet.service.kylin.entity.KylinCheckUserPerformances;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
...@@ -16,8 +18,10 @@ import java.util.List; ...@@ -16,8 +18,10 @@ import java.util.List;
public interface IKylinCheckUserPerformancesPartnerService extends IService<KylinCheckUserPerformances> { public interface IKylinCheckUserPerformancesPartnerService extends IService<KylinCheckUserPerformances> {
// 已配置列表 // 已配置列表
PageInfo<ChildPerformanceDao> childPerformanceList(String merchantId,String checkUserId);
// 未配置列表 // 未配置列表
PageInfo<ChildPerformanceDao> unChildPerformanceList(String merchantId,String checkUserId);
// 添加配置 // 添加配置
String setPerformance(List<String> performanceIds,String checkUserId); String setPerformance(List<String> performanceIds,String checkUserId);
......
package com.liquidnet.service.kylin.dao; package com.liquidnet.service.kylin.dao;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ChildDetailsDao { public class ChildDetailsDao {
@ApiModelProperty(value = "主键id") @ApiModelProperty(value = "主键id")
......
package com.liquidnet.service.kylin.dao; package com.liquidnet.service.kylin.dao;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ChildListDao { public class ChildListDao {
@ApiModelProperty(value = "主键id") @ApiModelProperty(value = "主键id")
......
package com.liquidnet.service.kylin.dao;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
public class ChildPerformanceDao {
@ApiModelProperty(value = "主键id")
private String performancesId;
@ApiModelProperty(value = "主键id")
private String title;
@ApiModelProperty(value = "姓名/昵称")
private String timeStart;
@ApiModelProperty(value = "手机号")
private String timeEnd;
@ApiModelProperty(value = "手机号")
private String canDownTime;
}
...@@ -17,7 +17,7 @@ import java.util.List; ...@@ -17,7 +17,7 @@ import java.util.List;
*/ */
public interface KylinCheckUserMapper extends BaseMapper<KylinCheckUser> { public interface KylinCheckUserMapper extends BaseMapper<KylinCheckUser> {
List<ChildListDao> childSimpleList(String merchantId,String name); List<ChildListDao> childSimpleList(String merchantId,String mobile);
ChildDetailsDao childDetails(String merchantId, String checkUserId); ChildDetailsDao childDetails(String merchantId, String checkUserId);
} }
package com.liquidnet.service.kylin.mapper; package com.liquidnet.service.kylin.mapper;
import com.liquidnet.service.kylin.dao.ChildListDao;
import com.liquidnet.service.kylin.dao.ChildPerformanceDao;
import com.liquidnet.service.kylin.entity.KylinCheckUserPerformances; import com.liquidnet.service.kylin.entity.KylinCheckUserPerformances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
/** /**
* <p> * <p>
* 验票用户可看演出表 Mapper 接口 * 验票用户可看演出表 Mapper 接口
...@@ -13,4 +17,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -13,4 +17,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/ */
public interface KylinCheckUserPerformancesMapper extends BaseMapper<KylinCheckUserPerformances> { public interface KylinCheckUserPerformancesMapper extends BaseMapper<KylinCheckUserPerformances> {
List<ChildPerformanceDao> childPerformanceList(String merchantId,String checkUserId);
List<ChildPerformanceDao> unChildPerformanceList(String merchantId,String checkUserId);
} }
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
FROM kylin_check_user FROM kylin_check_user
<where> <where>
merchant_id=#{merchantId} merchant_id=#{merchantId}
<if test="title !=''"> <if test="mobile !=null and mobile !='' ">
AND `name` LIKE concat('%', #{name}, '%') AND `mobile` LIKE concat('%', #{mobile}, '%')
</if> </if>
</where> </where>
</select> </select>
......
...@@ -2,100 +2,47 @@ ...@@ -2,100 +2,47 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.liquidnet.service.kylin.mapper.KylinCheckUserPerformancesMapper"> <mapper namespace="com.liquidnet.service.kylin.mapper.KylinCheckUserPerformancesMapper">
<!-- 第三方演出列表 (不包含退票信息) -->
<select id="partnerPerformanceList" parameterType="java.util.Map" resultMap="partnerPerformanceListResult"> <resultMap id="childPerformanceDaoResult" type="com.liquidnet.service.kylin.dao.ChildPerformanceDao">
<result column="performances_id" property="performancesId"/>
<result column="title" property="title"/>
<result column="time_start" property="timeStart"/>
<result column="time_end" property="timeEnd"/>
<result column="can_down_time" property="canDownTime"/>
</resultMap>
<!-- 第三方 验票员已配置 演出 -->
<select id="childPerformanceList" parameterType="java.util.Map" resultMap="childPerformanceDaoResult">
SELECT SELECT
p.performances_id , p.performances_id ,
p.title , p.title ,
p.time_start , p.time_start ,
p.time_end p.time_end,
cup.can_down_time
FROM FROM
kylin_performances AS p kylin_performances AS p
LEFT JOIN kylin_check_user_performances AS cup ON cup.performance_id = p.performances_id LEFT JOIN kylin_check_user_performances AS cup ON cup.performance_id = p.performances_id
LEFT JOIN kylin_performance_relations AS pr ON pr.performance_id = p.performances_id LEFT JOIN kylin_performance_relations AS pr ON pr.performance_id = p.performances_id
<where> <where>
pr.merchant_id = #{merchantId} AND cup.check_user_id = #{checkUserId} pr.merchant_id = #{merchantId} AND cup.check_user_id = #{checkUserId}
<if test="title!=''">
AND title LIKE concat('%', #{title}, '%')
</if>
</where> </where>
ORDER BY #{orderItem} #{orderSc}
</select> </select>
<!-- 第三方演出列表 (不包含退票信息) --> <!-- 第三方 验票员未配置 演出 -->
<select id="partnerPerformanceList" parameterType="java.util.Map" resultMap="partnerPerformanceListResult"> <!-- 第三方 验票员已配置 演出 -->
<select id="unChildPerformanceList" parameterType="java.util.Map" resultMap="childPerformanceDaoResult">
SELECT SELECT
p.performances_id , p.performances_id ,
p.title , p.title ,
p.time_start , p.time_start ,
p.time_end , p.time_end,
IFNULL(t.total_general , 0) AS 'total_general' , cup.can_down_time
IFNULL(ot.sale_general , 0) AS 'sale_general' ,
IFNULL(ot.total_sale_price , 0) AS 'total_sale_price' ,
IFNULL(
(
t.total_general - ot.sale_general
) ,
0
) AS 'surplus_general' ,
ps.`status` ,
p.type,
ps.audit_status ,
p.reject_txt ,
p.created_at
FROM FROM
kylin_performances AS p kylin_performances AS p
LEFT JOIN kylin_performance_status AS ps ON p.performances_id = ps.performance_id LEFT JOIN kylin_check_user_performances AS cup ON cup.performance_id = p.performances_id
LEFT JOIN kylin_performance_relations AS pr ON p.performances_id = pr.performance_id LEFT JOIN kylin_performance_relations AS pr ON pr.performance_id = p.performances_id
LEFT JOIN(
SELECT
ttr.performance_id ,
ts.ticket_id ,
sum(ts.total_general) AS 'total_general'
FROM
kylin_ticket_status AS ts
LEFT JOIN kylin_ticket_relations AS tr ON tr.ticket_id = ts.ticket_id
LEFT JOIN kylin_ticket_time_relation AS ttr ON tr.times_id = ttr.times_id
GROUP BY ttr.performance_id
) AS t ON p.performances_id = t.performance_id
LEFT JOIN(
SELECT
sum(ot.number) AS 'sale_general' ,
sum(ot.price_actual) AS 'total_sale_price' ,
ote.performance_id AS 'performance_id'
FROM
kylin_order_tickets AS ot
LEFT JOIN kylin_order_ticket_status AS ots ON ots.order_id = ot.order_tickets_id
LEFT JOIN kylin_order_ticket_entities AS ote ON ote.order_id = ot.order_tickets_id
WHERE
ots.`status` = 0
OR ots.`status` = 1
GROUP BY ote.performance_id
) AS ot ON ot.performance_id = p.performances_id
<where> <where>
<if test="title!=''"> pr.merchant_id = #{merchantId} AND cup.check_user_id = #{checkUserId}
AND title LIKE concat('%', #{title}, '%')
</if>
<if test="status !='0'">
<if test="status!='-2'">
AND ps.STATUS = #{status}
</if>
<if test="auditStatus!='-2'">
AND ps.audit_status = #{auditStatus}
</if>
<if test="timeStart!=''">
AND p.time_start BETWEEN #{timeStart} AND #{timeEnd}
</if>
<if test="stopSellDay!='-2'">
AND p.time_end BETWEEN #{stopSellTime} AND NOW()
</if>
</if>
<if test="status=='0'">
AND ps.STATUS = #{status}
</if>
AND pr.merchant_id = #{merchantId}
</where> </where>
ORDER BY #{orderItem} #{orderSc}
</select> </select>
</mapper> </mapper>
package com.liquidnet.service.kylin.controller.partner; package com.liquidnet.service.kylin.controller.partner;
import org.springframework.web.bind.annotation.RequestMapping; import com.github.pagehelper.PageInfo;
import com.liquidnet.service.base.ResponseDto;
import org.springframework.web.bind.annotation.RestController; import com.liquidnet.service.kylin.dao.ChildDetailsDao;
import com.liquidnet.service.kylin.dao.ChildListDao;
import com.liquidnet.service.kylin.dto.vo.KylinBuyNoticeVo;
import com.liquidnet.service.kylin.service.impl.partner.KylinBuyNoticePartnerServiceImpl;
import com.liquidnet.service.kylin.service.impl.partner.KylinCheckUserPartnerServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
/** /**
* <p> * <p>
...@@ -13,8 +22,69 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -13,8 +22,69 @@ import org.springframework.web.bind.annotation.RestController;
* @author liquidnet * @author liquidnet
* @since 2021-05-21 * @since 2021-05-21
*/ */
@Api(tags = "第三方-验票账号")
@RestController @RestController
@RequestMapping("partner/checkUser") @RequestMapping("partner/checkUser")
public class KylinCheckUserPartnerController { public class KylinCheckUserPartnerController {
@Autowired
private KylinCheckUserPartnerServiceImpl checkUserPartnerService;
@PostMapping(value = "")
@ApiOperation(value = "创建验票账号", position = 1)
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<String> create(@RequestParam("merchantId") String merchantId,
@RequestParam("name") String name,
@RequestParam("pwd") String pwd,
@RequestParam("mobile") String mobile) {
return checkUserPartnerService.create(merchantId, name, pwd, mobile);
}
@DeleteMapping(value = "")
@ApiOperation(value = "删除验票账号", position = 1)
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<String> del(@RequestParam("merchantId") String merchantId,
@RequestParam("checkUserId") String checkUserId) {
return checkUserPartnerService.del(merchantId, checkUserId);
}
@PutMapping(value = "")
@ApiOperation(value = "修改验票账号", position = 1)
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<String> change(@RequestParam("merchantId") String merchantId,
@RequestParam("checkUserId") String checkUserId,
@RequestParam("name") String name,
@RequestParam("pwd") String pwd,
@RequestParam("mobile") String mobile) {
return checkUserPartnerService.change(merchantId, checkUserId, name, pwd, mobile);
}
@GetMapping(value = "list")
@ApiOperation(value = "验票账号列表", position = 1)
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<PageInfo<ChildListDao>> getCheckUserList(@RequestParam("merchantId") String merchantId,
@RequestParam(value = "mobile" , required = false) String mobile,
@RequestParam("page") int page,
@RequestParam("size") int size) {
PageInfo<ChildListDao> result = checkUserPartnerService.getCheckUserList(merchantId,mobile,page,size);
if (null == result) {
return ResponseDto.failure("查询失败");
} else {
return ResponseDto.success(result);
}
}
@GetMapping(value = "details")
@ApiOperation(value = "验票账号详情", position = 1)
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<ChildDetailsDao> details(@RequestParam("merchantId") String merchantId,
@RequestParam("checkUserId") String checkUserId) {
ResponseDto<ChildDetailsDao> result = checkUserPartnerService.details(merchantId,checkUserId);
if (null == result) {
return ResponseDto.failure("查询失败");
} else {
return result;
}
}
} }
...@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.service.impl.partner; ...@@ -3,6 +3,7 @@ package com.liquidnet.service.kylin.service.impl.partner;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.liquidnet.commons.lang.util.IDGenerator;
import com.liquidnet.service.base.ErrorMapping; import com.liquidnet.service.base.ErrorMapping;
import com.liquidnet.service.base.ResponseDto; import com.liquidnet.service.base.ResponseDto;
import com.liquidnet.service.kylin.dao.ChildDetailsDao; import com.liquidnet.service.kylin.dao.ChildDetailsDao;
...@@ -52,7 +53,7 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser ...@@ -52,7 +53,7 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser
KylinCheckUser checkUser = new KylinCheckUser(); KylinCheckUser checkUser = new KylinCheckUser();
checkUser.setUpdatedAt(LocalDateTime.now()); checkUser.setUpdatedAt(LocalDateTime.now());
checkUser.setStatus(0); checkUser.setStatus(0);
checkUserMapper.update(checkUser, new UpdateWrapper<KylinCheckUser>().eq("checkUserId", checkUserId)); checkUserMapper.update(checkUser, new UpdateWrapper<KylinCheckUser>().eq("check_user_id", checkUserId));
return ResponseDto.success("删除成功"); return ResponseDto.success("删除成功");
} catch (Exception e) { } catch (Exception e) {
return ResponseDto.failure(ErrorMapping.get(20102)); return ResponseDto.failure(ErrorMapping.get(20102));
...@@ -66,6 +67,7 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser ...@@ -66,6 +67,7 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser
checkUser.setName(name); checkUser.setName(name);
checkUser.setPwd(DigestUtils.md5DigestAsHex(pwd.getBytes())); checkUser.setPwd(DigestUtils.md5DigestAsHex(pwd.getBytes()));
checkUser.setMobile(mobile); checkUser.setMobile(mobile);
checkUser.setCheckUserId(IDGenerator.nextSnowId().toString());
checkUser.setCreatedAt(LocalDateTime.now()); checkUser.setCreatedAt(LocalDateTime.now());
checkUser.setMerchantId(merchantId); checkUser.setMerchantId(merchantId);
checkUser.setStatus(1); checkUser.setStatus(1);
...@@ -84,7 +86,7 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser ...@@ -84,7 +86,7 @@ public class KylinCheckUserPartnerServiceImpl extends ServiceImpl<KylinCheckUser
checkUser.setPwd(DigestUtils.md5DigestAsHex(pwd.getBytes())); checkUser.setPwd(DigestUtils.md5DigestAsHex(pwd.getBytes()));
checkUser.setMobile(mobile); checkUser.setMobile(mobile);
checkUser.setUpdatedAt(LocalDateTime.now()); checkUser.setUpdatedAt(LocalDateTime.now());
checkUserMapper.update(checkUser, new UpdateWrapper<KylinCheckUser>().eq("checkUserId", checkUserId).eq("merchantId", merchantId)); checkUserMapper.update(checkUser, new UpdateWrapper<KylinCheckUser>().eq("check_user_id", checkUserId).eq("merchant_id", merchantId));
return ResponseDto.success("修改成功"); return ResponseDto.success("修改成功");
} catch (Exception e) { } catch (Exception e) {
return ResponseDto.failure(ErrorMapping.get(20103)); return ResponseDto.failure(ErrorMapping.get(20103));
......
package com.liquidnet.service.kylin.service.impl.partner; package com.liquidnet.service.kylin.service.impl.partner;
import com.github.pagehelper.PageInfo;
import com.liquidnet.service.kylin.dao.ChildPerformanceDao;
import com.liquidnet.service.kylin.entity.KylinCheckUserPerformances; import com.liquidnet.service.kylin.entity.KylinCheckUserPerformances;
import com.liquidnet.service.kylin.mapper.KylinCheckUserPerformancesMapper; import com.liquidnet.service.kylin.mapper.KylinCheckUserPerformancesMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liquidnet.service.kylin.service.partner.IKylinCheckUserPerformancesPartnerService; import com.liquidnet.service.kylin.service.partner.IKylinCheckUserPerformancesPartnerService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* <p> * <p>
* 验票用户可看演出表 服务实现类 * 验票用户可看演出表 服务实现类
...@@ -17,4 +21,23 @@ import org.springframework.stereotype.Service; ...@@ -17,4 +21,23 @@ import org.springframework.stereotype.Service;
@Service @Service
public class KylinCheckUserPerformancesPartnerServiceImpl extends ServiceImpl<KylinCheckUserPerformancesMapper, KylinCheckUserPerformances> implements IKylinCheckUserPerformancesPartnerService { public class KylinCheckUserPerformancesPartnerServiceImpl extends ServiceImpl<KylinCheckUserPerformancesMapper, KylinCheckUserPerformances> implements IKylinCheckUserPerformancesPartnerService {
@Override
public PageInfo<ChildPerformanceDao> childPerformanceList(String merchantId, String checkUserId) {
return null;
}
@Override
public PageInfo<ChildPerformanceDao> unChildPerformanceList(String merchantId, String checkUserId) {
return null;
}
@Override
public String setPerformance(List<String> performanceIds, String checkUserId) {
return null;
}
@Override
public String delPerformance(List<String> performanceIds, String checkUserId) {
return null;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment