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

Commit f5b042c6 authored by 胡佳晨's avatar 胡佳晨

修改退款

parent a701c1a8
......@@ -43,6 +43,16 @@ public class SweetManualController {
return sweetManualService.getManualList(page, size, name);
}
@GetMapping("details")
@ApiOperation("宣传手册详情")
@ApiImplicitParams({
@ApiImplicitParam(type = "query", dataType = "String", name = "manualId", value = "手册id"),
})
public ResponseDto<SweetManualDto> details(@RequestParam(required = false) String manualId) {
return sweetManualService.details(manualId);
}
@PostMapping("changeRelease")
@ApiOperation("修改是否发布")
@ApiImplicitParams({
......
......@@ -20,5 +20,7 @@ public interface SweetManualMapper extends BaseMapper<SweetManual> {
List<SweetManualDto> getManualList(Map<String,Object> map);
SweetManualDto getManualDetails(Map<String,Object> map);
List<SweetManualAppletDto> getManualAppletDto();
}
......@@ -22,6 +22,8 @@ public interface ISweetManualService extends IService<SweetManual> {
ResponseDto<PageInfo<SweetManualDto>> getManualList(int page, int size, String name);
ResponseDto<SweetManualDto> details( String manualId);
//关闭开启
ResponseDto<Boolean> changeStatus(String manualId, String performancesId, Integer status);
......
......@@ -68,6 +68,29 @@ public class SweetManualServiceImpl extends ServiceImpl<SweetManualMapper, Sweet
return ResponseDto.success(pageInfoTmp);
}
@Override
public ResponseDto<SweetManualDto> details(String manualId) {
SweetManualDto vo;
try {
HashMap<String, Object> map = CollectionUtil.mapStringObject();
map.put("manualId", manualId);
vo = sweetManualMapper.getManualDetails(map);
if (vo.getStatus() >= 6 && vo.getStatus() != 7) {
if (DateUtil.compareStrDay(vo.getTimeSell(), DateUtil.getNowTime()) > 0) {//未开始
vo.setStatus(9);
} else if (DateUtil.compareStrDay(vo.getTimeStop(), DateUtil.getNowTime()) < 0) {//已结束
vo.setStatus(10);
} else {
vo.setStatus(6);
}
}
} catch (Exception e) {
e.printStackTrace();
return ResponseDto.failure(ErrorMapping.get(20104));
}
return ResponseDto.success(vo);
}
@Override
public ResponseDto<Boolean> changeStatus(String manualId, String performancesId, Integer status) {
try {
......
......@@ -69,6 +69,41 @@
ORDER BY p.created_at desc
</select>
<!-- 电子手册详情 -->
<select id="getManualDetails" parameterType="java.util.Map" resultMap="partnerPerformanceListResult">
SELECT IFNULL(sm.manual_id, 0) as 'manual_id',
p.performances_id,
p.title,
p.time_start,
p.time_end,
ps.status,
t.time_sell,
t.time_stop,
IFNULL(sm.status, 0) as 'manualStatus',
IFNULL(sm.is_release, 0) as 'is_release'
FROM kylin_performances AS p
LEFT JOIN kylin_performance_status AS ps ON p.performances_id = ps.performance_id
LEFT JOIN kylin_performance_relations AS pr ON p.performances_id = pr.performance_id
LEFT JOIN sweet_manual AS sm ON p.performances_id = sm.performance_id
LEFT JOIN(
SELECT ttr.performance_id,
MIN(
DATE_SUB(
t.time_start,
INTERVAL pay_countdown_minute MINUTE
)
) AS 'time_sell',
MAX(t.time_end) AS 'time_stop'
FROM kylin_ticket_status AS ts
LEFT JOIN kylin_ticket_relations AS tr ON tr.ticket_id = ts.ticket_id
LEFT JOIN kylin_tickets AS t ON t.tickets_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
where sm.manual_id = #{manualId}
ORDER BY p.created_at desc
</select>
<select id="getManualAppletList" resultMap="getManualAppletListResult">
select manual_id, performances_id, title, field_id, city_name, time_start, time_end
......
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