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

Commit 97448026 authored by GaoHu's avatar GaoHu

控制小程序上下架

parent 4cd6adcd
...@@ -5,12 +5,18 @@ import com.liquidnet.client.admin.common.core.page.TableDataInfo; ...@@ -5,12 +5,18 @@ import com.liquidnet.client.admin.common.core.page.TableDataInfo;
import com.liquidnet.client.admin.zhengzai.smile.dto.ShowSort; import com.liquidnet.client.admin.zhengzai.smile.dto.ShowSort;
import com.liquidnet.client.admin.zhengzai.smile.dto.SmilePriceParam; import com.liquidnet.client.admin.zhengzai.smile.dto.SmilePriceParam;
import com.liquidnet.client.admin.zhengzai.smile.dto.SmileShowParam; import com.liquidnet.client.admin.zhengzai.smile.dto.SmileShowParam;
import com.liquidnet.client.admin.zhengzai.smile.dto.TakeByPerId;
import com.liquidnet.client.admin.zhengzai.smile.service.ISmileShowService; import com.liquidnet.client.admin.zhengzai.smile.service.ISmileShowService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/** /**
* @author TT * @author TT
*/ */
...@@ -41,6 +47,13 @@ public class SmileShowController { ...@@ -41,6 +47,13 @@ public class SmileShowController {
return smileShowService.sort(showSort); return smileShowService.sort(showSort);
} }
@PutMapping("/upTakeByPerId")
@ApiOperation("演出上下架[1:下架,0:上架]")
public AjaxResult upTakeByPerId(@RequestBody TakeByPerId takeByPerId) {
return smileShowService.upTakeByPerId(takeByPerId.getPerId(), takeByPerId.getType());
}
@PostMapping("/price") @PostMapping("/price")
@ApiOperation("个人打款打款") @ApiOperation("个人打款打款")
public AjaxResult price(@RequestBody SmilePriceParam smilePriceParam) { public AjaxResult price(@RequestBody SmilePriceParam smilePriceParam) {
...@@ -55,7 +68,7 @@ public class SmileShowController { ...@@ -55,7 +68,7 @@ public class SmileShowController {
@GetMapping("/updateRedis") @GetMapping("/updateRedis")
@ApiOperation("修改原保存演出id的数据类型,分支dev_0507kids 部署完执行接口(演出列表重复问题修复也可以运行此接口)") @ApiOperation("修改原保存演出id的数据类型,分支dev_0507kids 部署完执行接口(演出列表重复问题修复也可以运行此接口)")
public AjaxResult updateRedis(){ public AjaxResult updateRedis() {
return smileShowService.updateRedis(); return smileShowService.updateRedis();
} }
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
width: 800px; width: 800px;
padding-top: 20px; padding-top: 20px;
} }
#addClassify .selectClassify { #addClassify .selectClassify {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -161,6 +161,11 @@ ...@@ -161,6 +161,11 @@
align: 'center', align: 'center',
formatter: function (value, row, index) { formatter: function (value, row, index) {
var actions = []; var actions = [];
if (row.type===1){
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="upTakeByPerId(\'' + row.performancesId + '\',\'' + 0 + '\')"><i class="fa fa-edit"></i>上架</a> ');
}else {
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="upTakeByPerId(\'' + row.performancesId + '\',\'' + 1 + '\')"><i class="fa fa-edit"></i>下架</a> ');
}
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="toPop(\'' + row.performancesId + '\')"><i class="fa fa-edit"></i>设置票提</a> '); actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="toPop(\'' + row.performancesId + '\')"><i class="fa fa-edit"></i>设置票提</a> ');
// actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="editPop(\'' + row.performancesId + '\')"><i class="fa fa-edit"></i>编辑票提</a> '); // actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="editPop(\'' + row.performancesId + '\')"><i class="fa fa-edit"></i>编辑票提</a> ');
actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="toDetail(\'' + row.performancesId + '\')"><i class="fa fa-edit"></i>查看</a> '); actions.push('<a class="btn btn-success btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="toDetail(\'' + row.performancesId + '\')"><i class="fa fa-edit"></i>查看</a> ');
...@@ -189,6 +194,24 @@ ...@@ -189,6 +194,24 @@
}); });
} }
/*上下架*/
function upTakeByPerId(id,type) {
let postData = {
perId: id,
type: type
}
$.ajax({
type: 'put',
url: ctx + 'smile/show/upTakeByPerId',
headers: {"Content-Type": "application/json;charset=UTF-8"},
data: JSON.stringify(postData),
success: function (e) {
// alert(e.msg)
location.reload();
}
});
}
/* 跳转详情 */ /* 跳转详情 */
function toDetail(id) { function toDetail(id) {
window.localStorage.setItem('performancesId', id); window.localStorage.setItem('performancesId', id);
......
...@@ -76,6 +76,12 @@ public class ShowVo implements Serializable { ...@@ -76,6 +76,12 @@ public class ShowVo implements Serializable {
@ApiModelProperty(value = "演出打款状态") @ApiModelProperty(value = "演出打款状态")
private String status; private String status;
/**
* 上下架状态【0:上架,1:下架】
*/
@ApiModelProperty(value = "演出打款状态")
private int type;
/** /**
* 顺序 * 顺序
*/ */
...@@ -137,6 +143,7 @@ public class ShowVo implements Serializable { ...@@ -137,6 +143,7 @@ public class ShowVo implements Serializable {
this.setOpen(kylinPerformancesDto.getOpen() == null ? BigDecimal.valueOf(0) : kylinPerformancesDto.getOpen()); this.setOpen(kylinPerformancesDto.getOpen() == null ? BigDecimal.valueOf(0) : kylinPerformancesDto.getOpen());
this.setPerformancesId(kylinPerformancesDto.getPerformancesId()); this.setPerformancesId(kylinPerformancesDto.getPerformancesId());
this.setTimeEnd(kylinPerformancesDto.getTimeEnd()); this.setTimeEnd(kylinPerformancesDto.getTimeEnd());
this.setType(kylinPerformancesDto.getType());
return this; return this;
} }
} }
...@@ -72,4 +72,5 @@ public interface ISmileShowService extends IService<SmileSchool> { ...@@ -72,4 +72,5 @@ public interface ISmileShowService extends IService<SmileSchool> {
void exportData(ServletOutputStream servletOutputStream, String performancesId); void exportData(ServletOutputStream servletOutputStream, String performancesId);
AjaxResult upTakeByPerId(String perId, Integer type);
} }
...@@ -20,6 +20,7 @@ import com.liquidnet.client.admin.zhengzai.smile.service.ISmileShowService; ...@@ -20,6 +20,7 @@ import com.liquidnet.client.admin.zhengzai.smile.service.ISmileShowService;
import com.liquidnet.client.admin.zhengzai.smile.utils.SmileRedisUtils; import com.liquidnet.client.admin.zhengzai.smile.utils.SmileRedisUtils;
import com.liquidnet.service.galaxy.utils.ObjectUtil; import com.liquidnet.service.galaxy.utils.ObjectUtil;
import com.liquidnet.service.goblin.constant.SmileRedisConst; import com.liquidnet.service.goblin.constant.SmileRedisConst;
import com.liquidnet.service.goblin.dto.vo.SmileAgentVo;
import com.liquidnet.service.kylin.dao.TicketAndStatusDao; import com.liquidnet.service.kylin.dao.TicketAndStatusDao;
import com.liquidnet.service.kylin.dao.report.KylinPerformancesDto; import com.liquidnet.service.kylin.dao.report.KylinPerformancesDto;
import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo; import com.liquidnet.service.kylin.dto.vo.mongo.KylinPerformanceVo;
...@@ -128,8 +129,8 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc ...@@ -128,8 +129,8 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
kylinPerformancesMapper.updateCommentByPer(showSort.getSort(), showSort.getPerformancesId()); kylinPerformancesMapper.updateCommentByPer(showSort.getSort(), showSort.getPerformancesId());
log.info("redis show key:{}", showSort.getPerformancesId()); log.info("redis show key:{}", showSort.getPerformancesId());
//判断该演出是否修改过票提 //判断该演出是否修改过票提
if (smileRedisUtils.getShowIds().stream().anyMatch(showId -> showSort.getPerformancesId().equals(showId))) { List<String> showIds = smileRedisUtils.getShowIds();
List<String> showIds = smileRedisUtils.getShowIds(); if (showIds.contains(showSort.getPerformancesId())) {
showIds.remove(showSort.getPerformancesId()); showIds.remove(showSort.getPerformancesId());
showIds.add(0, showSort.getPerformancesId()); showIds.add(0, showSort.getPerformancesId());
smileRedisUtils.setShowIds(showIds); smileRedisUtils.setShowIds(showIds);
...@@ -577,6 +578,35 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc ...@@ -577,6 +578,35 @@ public class SmileShowServiceImpl extends ServiceImpl<SmileSchoolMapper, SmileSc
writer.finish(); writer.finish();
} }
@Override
public AjaxResult upTakeByPerId(String perId, Integer type) {
//是否设置过票提
LambdaQueryWrapper<SmileAgent> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(SmileAgent::getPerformanceId, perId);
queryWrapper.eq(SmileAgent::getDelTag, 0);
List<SmileAgent> smileAgents = smileAgentMapper.selectList(queryWrapper);
boolean tag = true;
for (SmileAgent smileAgent : smileAgents) {
if (smileRedisUtils.getAgent(smileAgent.getPerformanceId(), smileAgent.getTicketId()) != null) {
tag = false;
break;
}
}
if (tag) {
return AjaxResult.warn("还未设置票提!");
}
List<String> showIds = smileRedisUtils.getShowIds();
if (type.equals(1)) {
showIds.remove(perId);
} else {
showIds.add(perId);
}
smileRedisUtils.setShowIds(showIds);
smileAgentMapper.upTakeByPerId(perId, type);
return AjaxResult.success();
}
private List<List<String>> head(List<String> ticketList) { private List<List<String>> head(List<String> ticketList) {
List<List<String>> headTitles = new ArrayList<>(); List<List<String>> headTitles = new ArrayList<>();
String basicInfo = "代理数据"; String basicInfo = "代理数据";
......
...@@ -67,4 +67,9 @@ public class KylinPerformancesDto implements Serializable, Cloneable { ...@@ -67,4 +67,9 @@ public class KylinPerformancesDto implements Serializable, Cloneable {
* 演出状态 * 演出状态
*/ */
private int status; private int status;
/**
* 上下架标识【1:下架,0:上架】
*/
private int type;
} }
...@@ -727,10 +727,12 @@ GROUP BY user_mobile,tickets_id; ...@@ -727,10 +727,12 @@ GROUP BY user_mobile,tickets_id;
kp.`comment`, kp.`comment`,
IFNULL( map.`open`, 0 ) AS OPEN, IFNULL( map.`open`, 0 ) AS OPEN,
IFNULL( map.price, 0 ) AS totalSalePrice, IFNULL( map.price, 0 ) AS totalSalePrice,
kps.`status` kps.`status`,
sa.type
FROM FROM
kylin_performances AS kp kylin_performances AS kp
LEFT JOIN kylin_performance_status AS kps ON kps.performance_id = kp.performances_id LEFT JOIN kylin_performance_status AS kps ON kps.performance_id = kp.performances_id
LEFT JOIN smile_agent AS sa ON sa.performance_id = kp.performances_id
LEFT JOIN ( LEFT JOIN (
SELECT SELECT
kk.performance_id, kk.performance_id,
......
...@@ -46,6 +46,11 @@ public class SmileAgent implements Serializable { ...@@ -46,6 +46,11 @@ public class SmileAgent implements Serializable {
*/ */
private BigDecimal ordCarry; private BigDecimal ordCarry;
/**
* 上下架 0:下架,1:上架
*/
private Integer type;
/** /**
* 删除标识 0未删除1已删除 * 删除标识 0未删除1已删除
*/ */
......
...@@ -31,4 +31,6 @@ public interface SmileAgentMapper extends BaseMapper<SmileAgent> { ...@@ -31,4 +31,6 @@ public interface SmileAgentMapper extends BaseMapper<SmileAgent> {
List<SmileAgent> selectAgentCarryGtZeroByPerId(@Param("performancesId")String performancesId); List<SmileAgent> selectAgentCarryGtZeroByPerId(@Param("performancesId")String performancesId);
List<ShowBaseVoDto> selectMapByPerId(@Param("performancesId") String performancesId); List<ShowBaseVoDto> selectMapByPerId(@Param("performancesId") String performancesId);
void upTakeByPerId(@Param("perId") String perId,@Param("type") Integer type);
} }
...@@ -121,4 +121,10 @@ ...@@ -121,4 +121,10 @@
sukotr.ticket_id sukotr.ticket_id
</select> </select>
<update id="upTakeByPerId">
update smile_agent
set type = #{type}
where performance_id = #{perId}
</update>
</mapper> </mapper>
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