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

Commit 5972bdcc authored by 胡佳晨's avatar 胡佳晨

Merge branch 'hjc_ar_ac' into pre

parents a5c7faf1 529ab013
...@@ -122,8 +122,8 @@ public class LocalAdminController extends BaseController ...@@ -122,8 +122,8 @@ public class LocalAdminController extends BaseController
return storePrefix + "/placingOrder/activityList"; return storePrefix + "/placingOrder/activityList";
} }
@GetMapping("/addNewActivity") @GetMapping("/addNewActivity")
public String addNewActivity() public String addNewActivity(ModelMap mmap) {
{ mmap.put("platformUrl", platformUrl);
return storePrefix + "/placingOrder/addNewActivity"; return storePrefix + "/placingOrder/addNewActivity";
} }
@GetMapping("/activityStoreList") @GetMapping("/activityStoreList")
......
...@@ -55,7 +55,7 @@ public class GoblinSelfZhengzaiController extends BaseController { ...@@ -55,7 +55,7 @@ public class GoblinSelfZhengzaiController extends BaseController {
@RequestParam(value = "createdAt", required = false) String ct) { @RequestParam(value = "createdAt", required = false) String ct) {
LocalDateTime now = LocalDateTime.now(); LocalDateTime now = LocalDateTime.now();
PageHelper.startPage(page, size); PageHelper.startPage(page, size);
List<GoblinSelfMarketingDto> list = goblinZhengzaiMarketService.zhengzaiList(page, size,purchaseName, status, st, et, ct).getData(); List<GoblinSelfMarketingDto> list = goblinZhengzaiMarketService.zhengzaiList(page, size, purchaseName, status, st, et, ct).getData();
for (GoblinSelfMarketingDto item : list) { for (GoblinSelfMarketingDto item : list) {
if (item.getStatus() != 7) { if (item.getStatus() != 7) {
if (now.isBefore(item.getStartTime())) { if (now.isBefore(item.getStartTime())) {
...@@ -94,9 +94,8 @@ public class GoblinSelfZhengzaiController extends BaseController { ...@@ -94,9 +94,8 @@ public class GoblinSelfZhengzaiController extends BaseController {
@ApiOperation("修改活动-正在下单") @ApiOperation("修改活动-正在下单")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
@ResponseBody @ResponseBody
public ResponseDto<String> purchasingUpdate(GoblinStoreZhengzaiParam goblinStoreZhengzaiParam) { public ResponseDto<Boolean> purchasingUpdate(GoblinStoreZhengzaiParam goblinStoreZhengzaiParam) {
goblinZhengzaiMarketService.zhengzaiUpdate(goblinStoreZhengzaiParam.getMarketId(), goblinStoreZhengzaiParam.getName(), goblinStoreZhengzaiParam.getPerformanceId(), goblinStoreZhengzaiParam.getPerformanceImg(), goblinStoreZhengzaiParam.getStartTime(), goblinStoreZhengzaiParam.getEndTime()); return goblinZhengzaiMarketService.zhengzaiUpdate(goblinStoreZhengzaiParam.getMarketId(), goblinStoreZhengzaiParam.getName(), goblinStoreZhengzaiParam.getPerformanceId(), goblinStoreZhengzaiParam.getPerformanceImg(), goblinStoreZhengzaiParam.getStartTime(), goblinStoreZhengzaiParam.getEndTime());
return ResponseDto.success();
} }
@PostMapping("zhengzai/details") @PostMapping("zhengzai/details")
...@@ -111,12 +110,24 @@ public class GoblinSelfZhengzaiController extends BaseController { ...@@ -111,12 +110,24 @@ public class GoblinSelfZhengzaiController extends BaseController {
@PostMapping("zhengzai/store") @PostMapping("zhengzai/store")
@ApiOperation("活动详情-正在下单-新增店铺") @ApiOperation("活动详情-正在下单-新增/修改店铺")
@ApiResponse(code = 200, message = "接口返回对象参数") @ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<Boolean> purchasingStore(@RequestBody List<GoblinInsertZhengzaiParam> params) { public ResponseDto<Boolean> purchasingStore(@RequestBody List<GoblinInsertZhengzaiParam> params) {
return goblinZhengzaiMarketService.zhengzaiStore(params); return goblinZhengzaiMarketService.zhengzaiStore(params);
} }
@PostMapping("zhengzai/store/del")
@ApiOperation("活动详情-正在下单-删除店铺")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ApiImplicitParams({
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "marketId", value = "活动id", example = "1"),
@ApiImplicitParam(type = "form", required = true, dataType = "String", name = "storeId", value = "店铺id", example = "0"),
})
public ResponseDto<Boolean> zhengzaiDelStore(@RequestParam(value = "marketId") @Valid String marketId,
@RequestParam(value = "storeId") @Valid String storeId) {
return goblinZhengzaiMarketService.zhengzaiDelStore(marketId, storeId);
}
// @PostMapping("zhengzai/store/update") // @PostMapping("zhengzai/store/update")
// @ApiOperation("活动详情-正在下单-修改店铺") // @ApiOperation("活动详情-正在下单-修改店铺")
// @ApiResponse(code = 200, message = "接口返回对象参数") // @ApiResponse(code = 200, message = "接口返回对象参数")
......
...@@ -101,6 +101,13 @@ public interface IGoblinZhengzaiMarketService { ...@@ -101,6 +101,13 @@ public interface IGoblinZhengzaiMarketService {
*/ */
ResponseDto<Boolean> zhengzaiStore(List<GoblinInsertZhengzaiParam> params); ResponseDto<Boolean> zhengzaiStore(List<GoblinInsertZhengzaiParam> params);
/**
* 删除正在下单 可参与活动店铺
*
* @return
*/
ResponseDto<Boolean> zhengzaiDelStore(String marketId ,String storeId);
/** /**
* 编辑正在下单 可参与活动店铺 * 编辑正在下单 可参与活动店铺
* *
......
...@@ -119,11 +119,17 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -119,11 +119,17 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
@Override @Override
public ResponseDto<String> zhengzaiInsert(String purchaseName, String performanceId, String img, String st, String et) { public ResponseDto<String> zhengzaiInsert(String purchaseName, String performanceId, String img, String st, String et) {
int count = goblinSelfMarketingMapper.selectCount(Wrappers.lambdaUpdate(GoblinSelfMarketing.class).eq(GoblinSelfMarketing::getPerformanceId, performanceId).eq(GoblinSelfMarketing::getDelFlag, 0));
if (count > 0) {
return ResponseDto.failure("该演出已关联活动");
}
GoblinSelfMarketing selfMarketing = GoblinSelfMarketing.getNew(); GoblinSelfMarketing selfMarketing = GoblinSelfMarketing.getNew();
String SelfMarketId = IDGenerator.nextTimeId2(); String SelfMarketId = IDGenerator.nextTimeId2();
selfMarketing.setSelfMarketId(SelfMarketId); selfMarketing.setSelfMarketId(SelfMarketId);
selfMarketing.setName(purchaseName); selfMarketing.setName(purchaseName);
selfMarketing.setPerformanceId(performanceId); selfMarketing.setPerformanceId(performanceId);
selfMarketing.setPerformanceImg(img);
selfMarketing.setType(GoblinStatusConst.MarketingStatus.SELF_TYPE_ZHENGZAI.getValue()); selfMarketing.setType(GoblinStatusConst.MarketingStatus.SELF_TYPE_ZHENGZAI.getValue());
selfMarketing.setStartTime(LocalDateTime.parse(st, DTF_YMD_HMS)); selfMarketing.setStartTime(LocalDateTime.parse(st, DTF_YMD_HMS));
selfMarketing.setEndTime(LocalDateTime.parse(et, DTF_YMD_HMS)); selfMarketing.setEndTime(LocalDateTime.parse(et, DTF_YMD_HMS));
...@@ -147,9 +153,19 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -147,9 +153,19 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
@Override @Override
public ResponseDto<Boolean> zhengzaiUpdate(String marketId, String purchaseName, String performanceId, String img, String st, String et) { public ResponseDto<Boolean> zhengzaiUpdate(String marketId, String purchaseName, String performanceId, String img, String st, String et) {
// GoblinSelfMarketingVo data =goblinRedisUtils.getSelfMarket(marketId);
// if(data.getPerformanceId().equals(performanceId)){
//
// }else {
int count = goblinSelfMarketingMapper.selectCount(Wrappers.lambdaUpdate(GoblinSelfMarketing.class).eq(GoblinSelfMarketing::getPerformanceId, performanceId).ne(GoblinSelfMarketing::getSelfMarketId,marketId).eq(GoblinSelfMarketing::getDelFlag, 0));
if (count > 0) {
return ResponseDto.failure("该演出已关联活动");
}
// }
GoblinSelfMarketing selfMarketing = GoblinSelfMarketing.getNew(); GoblinSelfMarketing selfMarketing = GoblinSelfMarketing.getNew();
selfMarketing.setSelfMarketId(marketId); selfMarketing.setSelfMarketId(marketId);
selfMarketing.setName(purchaseName); selfMarketing.setName(purchaseName);
selfMarketing.setPerformanceImg(img);
selfMarketing.setType(GoblinStatusConst.MarketingStatus.SELF_TYPE_ZHENGZAI.getValue()); selfMarketing.setType(GoblinStatusConst.MarketingStatus.SELF_TYPE_ZHENGZAI.getValue());
selfMarketing.setStartTime(LocalDateTime.parse(st, DTF_YMD_HMS)); selfMarketing.setStartTime(LocalDateTime.parse(st, DTF_YMD_HMS));
selfMarketing.setEndTime(LocalDateTime.parse(et, DTF_YMD_HMS)); selfMarketing.setEndTime(LocalDateTime.parse(et, DTF_YMD_HMS));
...@@ -173,7 +189,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -173,7 +189,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
@Override @Override
public ResponseDto<GoblinSelfMarketingVo> zhengzaiDetails(String marketId) { public ResponseDto<GoblinSelfMarketingVo> zhengzaiDetails(String marketId) {
GoblinSelfMarketing bean = goblinSelfMarketingMapper.selectOne(Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, marketId)); GoblinSelfMarketing bean = goblinSelfMarketingMapper.selectOne(Wrappers.lambdaUpdate(GoblinSelfMarketing.getNew()).eq(GoblinSelfMarketing::getSelfMarketId, marketId).eq(GoblinSelfMarketing::getDelFlag, 0));
GoblinSelfMarketingVo vo = GoblinSelfMarketingVo.getNew(); GoblinSelfMarketingVo vo = GoblinSelfMarketingVo.getNew();
BeanUtils.copyProperties(bean, vo); BeanUtils.copyProperties(bean, vo);
vo.setStartTime(DateUtil.Formatter.yyyyMMddHHmmss.format(bean.getStartTime())); vo.setStartTime(DateUtil.Formatter.yyyyMMddHHmmss.format(bean.getStartTime()));
...@@ -209,6 +225,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -209,6 +225,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
entity.setSelfMarketId(marketId); entity.setSelfMarketId(marketId);
entity.setStoreId(storeId); entity.setStoreId(storeId);
entity.setShowTime(LocalDateTime.parse(showTime, DTF_YMD_HMS)); entity.setShowTime(LocalDateTime.parse(showTime, DTF_YMD_HMS));
entity.setCreatedAt(LocalDateTime.now());
if (goblinRedisUtils.getZhengzaiRelation(storeId).contains(marketId)) { if (goblinRedisUtils.getZhengzaiRelation(storeId).contains(marketId)) {
return ResponseDto.failure("禁止重复添加"); return ResponseDto.failure("禁止重复添加");
} }
...@@ -264,6 +281,28 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer ...@@ -264,6 +281,28 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
return ResponseDto.success(); return ResponseDto.success();
} }
@Override
public ResponseDto<Boolean> zhengzaiDelStore(String marketId, String storeId) {
try {
GoblinMarketingZhengzaiRelation entity = GoblinMarketingZhengzaiRelation.getNew();
entity.setDelTag(1);
entity.setUpdatedAt(LocalDateTime.now());
entity.setStoreId(storeId);
entity.setSelfMarketId(marketId);
//mysql
goblinMarketingZhengzaiRelationMapper.update(entity, Wrappers.lambdaUpdate(GoblinMarketingZhengzaiRelation.getNew()).eq(GoblinMarketingZhengzaiRelation::getSelfMarketId, marketId).eq(GoblinMarketingZhengzaiRelation::getStoreId, storeId));
//mongo
goblinMongoUtils.delZhengzaiRelation(marketId, storeId);
//redis
goblinRedisUtils.delZhengzaiRelation(marketId, storeId);
goblinRedisUtils.delStoreSelfRelation(marketId, storeId);
return ResponseDto.success();
} catch (Exception e) {
e.printStackTrace();
return ResponseDto.failure("删除失败");
}
}
@Override @Override
public ResponseDto<Boolean> zhengzaiStoreUpdate(List<GoblinInsertZhengzaiParam> params) { public ResponseDto<Boolean> zhengzaiStoreUpdate(List<GoblinInsertZhengzaiParam> params) {
for (GoblinInsertZhengzaiParam item : params) { for (GoblinInsertZhengzaiParam item : params) {
......
...@@ -45,6 +45,21 @@ public class GoblinRedisUtils { ...@@ -45,6 +45,21 @@ public class GoblinRedisUtils {
redisDataSourceUtil.getRedisGoblinUtil().del(redisKey); redisDataSourceUtil.getRedisGoblinUtil().del(redisKey);
} }
/**
* 删除店铺活动
*
* @param selfMarketId
*/
public GoblinSelfMarketingVo getSelfMarket(String selfMarketId) {
String redisKey = GoblinRedisConst.REDIS_GOBLIN_SELF_MARKET.concat(selfMarketId);
Object obj = redisDataSourceUtil.getRedisGoblinUtil().get(redisKey);
if(obj==null){
return GoblinSelfMarketingVo.getNew();
}else{
return (GoblinSelfMarketingVo) obj;
}
}
/** /**
* 正在下单 可参加商户 * 正在下单 可参加商户
* *
......
...@@ -36,6 +36,11 @@ public class GoblinSelfMarketing implements Serializable, Cloneable { ...@@ -36,6 +36,11 @@ public class GoblinSelfMarketing implements Serializable, Cloneable {
*/ */
private String performanceId; private String performanceId;
/**
* 演出id
*/
private String performanceImg;
/** /**
* 营销名称 * 营销名称
*/ */
......
...@@ -50,8 +50,8 @@ from goblin_self_marketing as a ...@@ -50,8 +50,8 @@ from goblin_self_marketing as a
inner join goblin_marketing_zhengzai_relation as b on a.self_market_id = b.self_market_id inner join goblin_marketing_zhengzai_relation as b on a.self_market_id = b.self_market_id
inner join goblin_store_info as c on c.store_id = b.store_id inner join goblin_store_info as c on c.store_id = b.store_id
left join goblin_marketing_zhengzai as d on d.store_id = b.store_id and d.self_market_id = b.self_market_id left join goblin_marketing_zhengzai as d on d.store_id = b.store_id and d.self_market_id = b.self_market_id
where a.self_market_id = #{marketId} where a.self_market_id = #{marketId} and b.del_tag = 0
GROUP BY b.store_id GROUP BY b.store_id ORDER BY b.created_at asc
</select> </select>
<select id="getZhengzaiStoreDetails" resultMap="goblinZhengzaiStoreDetailsDtoResult"> <select id="getZhengzaiStoreDetails" resultMap="goblinZhengzaiStoreDetailsDtoResult">
...@@ -69,10 +69,9 @@ GROUP BY b.store_id ...@@ -69,10 +69,9 @@ GROUP BY b.store_id
select select
gsm.mid,gsm.name,gsm.performance_id,gsm.performance_img,gsm.created_at,gsm.updated_at,gsm.type,gsm.status,gsm.start_time,gsm.end_time,gsm.self_market_id,gsm.describes,count(gmzr.store_id) gsm.mid,gsm.name,gsm.performance_id,gsm.performance_img,gsm.created_at,gsm.updated_at,gsm.type,gsm.status,gsm.start_time,gsm.end_time,gsm.self_market_id,gsm.describes,count(gmzr.store_id)
as 'store_count' as 'store_count'
from goblin_self_marketing as gsm left join goblin_marketing_zhengzai_relation gmzr on gsm.self_market_id = from goblin_self_marketing as gsm left join goblin_marketing_zhengzai_relation gmzr on gsm.self_market_id = gmzr.self_market_id and gmzr.del_tag !=1
gmzr.self_market_id
<where> <where>
del_flag = 0 gsm.del_flag = 0
<if test="purchaseName != null and purchaseName!=''">and gsm.name like concat('%', #{purchaseName}, '%') <if test="purchaseName != null and purchaseName!=''">and gsm.name like concat('%', #{purchaseName}, '%')
'%' '%'
</if> </if>
......
...@@ -49,8 +49,12 @@ public class SweetPerformanceServiceImpl extends ServiceImpl<SweetPerformanceMap ...@@ -49,8 +49,12 @@ public class SweetPerformanceServiceImpl extends ServiceImpl<SweetPerformanceMap
Environment environment; Environment environment;
@Override @Override
public ResponseDto<Boolean> add(String performanceId, String performanceName, String arName, String picOne, String picTwo, String arUrl, String timeStart, String timeEnd,String fileSize) { public ResponseDto<Boolean> add(String performanceId, String performanceName, String arName, String picOne, String picTwo, String arUrl, String timeStart, String timeEnd, String fileSize) {
try { try {
int count = sweetPerformanceMapper.selectCount(Wrappers.lambdaUpdate(SweetPerformanceShow.class).eq(SweetPerformanceShow::getPerformanceId, performanceId));
if (count > 0) {
return ResponseDto.failure("该演出已关联活动");
}
String offlineUrl = goblinUrl + "/goblin/inner/ar/data"; //离线地址 String offlineUrl = goblinUrl + "/goblin/inner/ar/data"; //离线地址
SweetPerformanceShow show = SweetPerformanceShow.getNew(); SweetPerformanceShow show = SweetPerformanceShow.getNew();
show.setArId(IDGenerator.nextTimeId2()); show.setArId(IDGenerator.nextTimeId2());
...@@ -63,8 +67,8 @@ public class SweetPerformanceServiceImpl extends ServiceImpl<SweetPerformanceMap ...@@ -63,8 +67,8 @@ public class SweetPerformanceServiceImpl extends ServiceImpl<SweetPerformanceMap
show.setStatus(0); show.setStatus(0);
show.setOfflineUrl(offlineUrl); show.setOfflineUrl(offlineUrl);
show.setFileSize(fileSize); show.setFileSize(fileSize);
show.setTimeStart(LocalDateTime.parse(timeStart,DTF_YMD_HMS)); show.setTimeStart(LocalDateTime.parse(timeStart, DTF_YMD_HMS));
show.setTimeEnd(LocalDateTime.parse(timeEnd,DTF_YMD_HMS)); show.setTimeEnd(LocalDateTime.parse(timeEnd, DTF_YMD_HMS));
//redis //redis
List<SweetPerformanceShow> performanceARList = redisUtils.getPerformanceAR(); List<SweetPerformanceShow> performanceARList = redisUtils.getPerformanceAR();
performanceARList.add(show); performanceARList.add(show);
...@@ -82,6 +86,11 @@ public class SweetPerformanceServiceImpl extends ServiceImpl<SweetPerformanceMap ...@@ -82,6 +86,11 @@ public class SweetPerformanceServiceImpl extends ServiceImpl<SweetPerformanceMap
@Override @Override
public ResponseDto<Boolean> change(SweetPerformanceShowParam show) { public ResponseDto<Boolean> change(SweetPerformanceShowParam show) {
try { try {
int count = sweetPerformanceMapper.selectCount(Wrappers.lambdaUpdate(SweetPerformanceShow.class).eq(SweetPerformanceShow::getPerformanceId, show.getPerformanceId()).ne(SweetPerformanceShow::getArId, show.getArId()));
if (count > 0) {
return ResponseDto.failure("该演出已关联活动");
}
String id = show.getArId(); String id = show.getArId();
//修改redis //修改redis
List<SweetPerformanceShow> performanceARList = redisUtils.getPerformanceAR(); List<SweetPerformanceShow> performanceARList = redisUtils.getPerformanceAR();
......
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