记得上下班打卡 | 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
return storePrefix + "/placingOrder/activityList";
}
@GetMapping("/addNewActivity")
public String addNewActivity()
{
public String addNewActivity(ModelMap mmap) {
mmap.put("platformUrl", platformUrl);
return storePrefix + "/placingOrder/addNewActivity";
}
@GetMapping("/activityStoreList")
......
......@@ -55,7 +55,7 @@ public class GoblinSelfZhengzaiController extends BaseController {
@RequestParam(value = "createdAt", required = false) String ct) {
LocalDateTime now = LocalDateTime.now();
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) {
if (item.getStatus() != 7) {
if (now.isBefore(item.getStartTime())) {
......@@ -94,9 +94,8 @@ public class GoblinSelfZhengzaiController extends BaseController {
@ApiOperation("修改活动-正在下单")
@ApiResponse(code = 200, message = "接口返回对象参数")
@ResponseBody
public ResponseDto<String> purchasingUpdate(GoblinStoreZhengzaiParam goblinStoreZhengzaiParam) {
goblinZhengzaiMarketService.zhengzaiUpdate(goblinStoreZhengzaiParam.getMarketId(), goblinStoreZhengzaiParam.getName(), goblinStoreZhengzaiParam.getPerformanceId(), goblinStoreZhengzaiParam.getPerformanceImg(), goblinStoreZhengzaiParam.getStartTime(), goblinStoreZhengzaiParam.getEndTime());
return ResponseDto.success();
public ResponseDto<Boolean> purchasingUpdate(GoblinStoreZhengzaiParam goblinStoreZhengzaiParam) {
return goblinZhengzaiMarketService.zhengzaiUpdate(goblinStoreZhengzaiParam.getMarketId(), goblinStoreZhengzaiParam.getName(), goblinStoreZhengzaiParam.getPerformanceId(), goblinStoreZhengzaiParam.getPerformanceImg(), goblinStoreZhengzaiParam.getStartTime(), goblinStoreZhengzaiParam.getEndTime());
}
@PostMapping("zhengzai/details")
......@@ -111,12 +110,24 @@ public class GoblinSelfZhengzaiController extends BaseController {
@PostMapping("zhengzai/store")
@ApiOperation("活动详情-正在下单-新增店铺")
@ApiOperation("活动详情-正在下单-新增/修改店铺")
@ApiResponse(code = 200, message = "接口返回对象参数")
public ResponseDto<Boolean> purchasingStore(@RequestBody List<GoblinInsertZhengzaiParam> 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")
// @ApiOperation("活动详情-正在下单-修改店铺")
// @ApiResponse(code = 200, message = "接口返回对象参数")
......
......@@ -101,6 +101,13 @@ public interface IGoblinZhengzaiMarketService {
*/
ResponseDto<Boolean> zhengzaiStore(List<GoblinInsertZhengzaiParam> params);
/**
* 删除正在下单 可参与活动店铺
*
* @return
*/
ResponseDto<Boolean> zhengzaiDelStore(String marketId ,String storeId);
/**
* 编辑正在下单 可参与活动店铺
*
......
......@@ -119,11 +119,17 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
@Override
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();
String SelfMarketId = IDGenerator.nextTimeId2();
selfMarketing.setSelfMarketId(SelfMarketId);
selfMarketing.setName(purchaseName);
selfMarketing.setPerformanceId(performanceId);
selfMarketing.setPerformanceImg(img);
selfMarketing.setType(GoblinStatusConst.MarketingStatus.SELF_TYPE_ZHENGZAI.getValue());
selfMarketing.setStartTime(LocalDateTime.parse(st, DTF_YMD_HMS));
selfMarketing.setEndTime(LocalDateTime.parse(et, DTF_YMD_HMS));
......@@ -147,9 +153,19 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
@Override
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();
selfMarketing.setSelfMarketId(marketId);
selfMarketing.setName(purchaseName);
selfMarketing.setPerformanceImg(img);
selfMarketing.setType(GoblinStatusConst.MarketingStatus.SELF_TYPE_ZHENGZAI.getValue());
selfMarketing.setStartTime(LocalDateTime.parse(st, DTF_YMD_HMS));
selfMarketing.setEndTime(LocalDateTime.parse(et, DTF_YMD_HMS));
......@@ -173,7 +189,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
@Override
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();
BeanUtils.copyProperties(bean, vo);
vo.setStartTime(DateUtil.Formatter.yyyyMMddHHmmss.format(bean.getStartTime()));
......@@ -209,6 +225,7 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
entity.setSelfMarketId(marketId);
entity.setStoreId(storeId);
entity.setShowTime(LocalDateTime.parse(showTime, DTF_YMD_HMS));
entity.setCreatedAt(LocalDateTime.now());
if (goblinRedisUtils.getZhengzaiRelation(storeId).contains(marketId)) {
return ResponseDto.failure("禁止重复添加");
}
......@@ -264,6 +281,28 @@ public class GoblinZhengzaiMarketServiceImpl implements IGoblinZhengzaiMarketSer
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
public ResponseDto<Boolean> zhengzaiStoreUpdate(List<GoblinInsertZhengzaiParam> params) {
for (GoblinInsertZhengzaiParam item : params) {
......
......@@ -45,6 +45,21 @@ public class GoblinRedisUtils {
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 {
*/
private String performanceId;
/**
* 演出id
*/
private String performanceImg;
/**
* 营销名称
*/
......
......@@ -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_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
where a.self_market_id = #{marketId}
GROUP BY b.store_id
where a.self_market_id = #{marketId} and b.del_tag = 0
GROUP BY b.store_id ORDER BY b.created_at asc
</select>
<select id="getZhengzaiStoreDetails" resultMap="goblinZhengzaiStoreDetailsDtoResult">
......@@ -69,10 +69,9 @@ GROUP BY b.store_id
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)
as 'store_count'
from goblin_self_marketing as gsm left join goblin_marketing_zhengzai_relation gmzr on gsm.self_market_id =
gmzr.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
<where>
del_flag = 0
gsm.del_flag = 0
<if test="purchaseName != null and purchaseName!=''">and gsm.name like concat('%', #{purchaseName}, '%')
'%'
</if>
......
......@@ -49,8 +49,12 @@ public class SweetPerformanceServiceImpl extends ServiceImpl<SweetPerformanceMap
Environment environment;
@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 {
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"; //离线地址
SweetPerformanceShow show = SweetPerformanceShow.getNew();
show.setArId(IDGenerator.nextTimeId2());
......@@ -63,8 +67,8 @@ public class SweetPerformanceServiceImpl extends ServiceImpl<SweetPerformanceMap
show.setStatus(0);
show.setOfflineUrl(offlineUrl);
show.setFileSize(fileSize);
show.setTimeStart(LocalDateTime.parse(timeStart,DTF_YMD_HMS));
show.setTimeEnd(LocalDateTime.parse(timeEnd,DTF_YMD_HMS));
show.setTimeStart(LocalDateTime.parse(timeStart, DTF_YMD_HMS));
show.setTimeEnd(LocalDateTime.parse(timeEnd, DTF_YMD_HMS));
//redis
List<SweetPerformanceShow> performanceARList = redisUtils.getPerformanceAR();
performanceARList.add(show);
......@@ -82,6 +86,11 @@ public class SweetPerformanceServiceImpl extends ServiceImpl<SweetPerformanceMap
@Override
public ResponseDto<Boolean> change(SweetPerformanceShowParam show) {
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();
//修改redis
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