|
|
@@ -2,12 +2,15 @@ package com.yuexiu.secp.read.controller; |
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
|
|
|
|
|
|
|
import com.sie.iot.base.bean.RedisMessageContentBean; |
|
|
import com.sie.iot.common.bean.PaginationRequestData; |
|
|
import com.sie.iot.common.bean.PaginationRequestData; |
|
|
import com.sie.iot.common.bean.ResponseData; |
|
|
import com.sie.iot.common.bean.ResponseData; |
|
|
import com.sie.iot.common.iotenum.ResponseMsgCode; |
|
|
import com.sie.iot.common.iotenum.ResponseMsgCode; |
|
|
import com.sie.iot.common.model.inter.IBaseCommon; |
|
|
import com.sie.iot.common.model.inter.IBaseCommon; |
|
|
|
|
|
import com.sie.iot.common.secure.annotation.CheckToken; |
|
|
import com.sie.iot.common.services.CommonAbstractService; |
|
|
import com.sie.iot.common.services.CommonAbstractService; |
|
|
import com.sie.iot.component.exception.GushenRuntimeException; |
|
|
import com.sie.iot.component.exception.GushenRuntimeException; |
|
|
|
|
|
import com.sie.iot.distribute.transation.annotation.DistrTransMessageParam; |
|
|
import com.siefw.hibernate.core.paging.Pagination; |
|
|
import com.siefw.hibernate.core.paging.Pagination; |
|
|
import com.yuexiu.secp.read.dto.AdvertDto; |
|
|
import com.yuexiu.secp.read.dto.AdvertDto; |
|
|
import com.yuexiu.secp.read.model.entities.AdvertEntity; |
|
|
import com.yuexiu.secp.read.model.entities.AdvertEntity; |
|
|
@@ -23,10 +26,10 @@ import org.springframework.validation.annotation.Validated; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
@Validated |
|
|
@Validated |
|
|
@Api(value = "测试", tags = "测试-用户") |
|
|
|
|
|
|
|
|
@Api(value = "广告", tags = "广告-维护") |
|
|
@RestController |
|
|
@RestController |
|
|
@Slf4j |
|
|
@Slf4j |
|
|
@RequestMapping("/advert/advertMaintenance") |
|
|
|
|
|
|
|
|
@RequestMapping("/advertController") |
|
|
public class AdvertController extends CommonAbstractService { |
|
|
public class AdvertController extends CommonAbstractService { |
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(AdvertController.class); |
|
|
private static final Logger LOGGER = LoggerFactory.getLogger(AdvertController.class); |
|
|
|
|
|
|
|
|
@@ -39,8 +42,9 @@ public class AdvertController extends CommonAbstractService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ApiOperation("获取广告维护表分页列表") |
|
|
@ApiOperation("获取广告维护表分页列表") |
|
|
@PostMapping(value = "/findAdvertInfo") |
|
|
|
|
|
public ResponseData<Pagination<AdvertEntityRo>> findTestUsersPagination(@RequestBody PaginationRequestData<AdvertDto> paginationRequestData) { |
|
|
|
|
|
|
|
|
@PostMapping(value = "/findAdvertInfoPagination") |
|
|
|
|
|
@CheckToken |
|
|
|
|
|
public ResponseData<Pagination<AdvertEntityRo>> findAdvertInfoPagination(@RequestBody PaginationRequestData<AdvertDto> paginationRequestData) { |
|
|
Integer pageIndex = paginationRequestData.getPageIndex(); |
|
|
Integer pageIndex = paginationRequestData.getPageIndex(); |
|
|
Integer pageRows = paginationRequestData.getPageRows(); |
|
|
Integer pageRows = paginationRequestData.getPageRows(); |
|
|
AdvertDto advertDto = paginationRequestData.getParams(); |
|
|
AdvertDto advertDto = paginationRequestData.getParams(); |
|
|
@@ -50,34 +54,37 @@ public class AdvertController extends CommonAbstractService { |
|
|
Pagination<AdvertEntityRo> pagination = iAdvertServer.findAdvertPagination(jsonObject, pageIndex, pageRows, paginationRequestData.getOrderByBean()); |
|
|
Pagination<AdvertEntityRo> pagination = iAdvertServer.findAdvertPagination(jsonObject, pageIndex, pageRows, paginationRequestData.getOrderByBean()); |
|
|
return ResponseData.data(pagination); |
|
|
return ResponseData.data(pagination); |
|
|
} catch (Exception e) { |
|
|
} catch (Exception e) { |
|
|
LOGGER.error(" find - AdvertInfo error:"+e); |
|
|
|
|
|
|
|
|
LOGGER.error(" find - AdvertInfoPagination error:"+e); |
|
|
throw new GushenRuntimeException(ResponseMsgCode.ERROR.msgCode, e); |
|
|
throw new GushenRuntimeException(ResponseMsgCode.ERROR.msgCode, e); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ApiOperation(value = "保存或者更新广告列表") |
|
|
@ApiOperation(value = "保存或者更新广告列表") |
|
|
@PostMapping(value = "/saveOrUpdateAdvertInfo") |
|
|
@PostMapping(value = "/saveOrUpdateAdvertInfo") |
|
|
|
|
|
@CheckToken |
|
|
public ResponseData saveOrUpdateAdvertInfo(@RequestBody AdvertEntity advertEntity) { |
|
|
public ResponseData saveOrUpdateAdvertInfo(@RequestBody AdvertEntity advertEntity) { |
|
|
log.info("保存 参数:{}",advertEntity); |
|
|
log.info("保存 参数:{}",advertEntity); |
|
|
iAdvertServer.saveOrUpdateAdvertInfo(advertEntity); |
|
|
iAdvertServer.saveOrUpdateAdvertInfo(advertEntity); |
|
|
return ResponseData.success(); |
|
|
return ResponseData.success(); |
|
|
} |
|
|
} |
|
|
@ApiOperation(value = "根据广告表 advertId 查询详细") |
|
|
|
|
|
@PostMapping(value = "/findById") |
|
|
|
|
|
public ResponseData findById(@RequestParam Long advertId){ |
|
|
|
|
|
|
|
|
@ApiOperation(value = "根据广告表 id 查询详细") |
|
|
|
|
|
@GetMapping(value = "/findById") |
|
|
|
|
|
@CheckToken |
|
|
|
|
|
public ResponseData findById(@RequestParam Long id){ |
|
|
try { |
|
|
try { |
|
|
log.info("根据 primaryKey 查询广告详细 id:{}", advertId); |
|
|
|
|
|
AdvertEntity entity = iAdvertServer.findById(advertId); |
|
|
|
|
|
|
|
|
log.info("根据 primaryKey 查询广告详细 id:{}", id); |
|
|
|
|
|
AdvertEntity entity = iAdvertServer.findById(id); |
|
|
return ResponseData.data(entity); |
|
|
return ResponseData.data(entity); |
|
|
}catch (Exception e){ |
|
|
}catch (Exception e){ |
|
|
throw new GushenRuntimeException(ResponseMsgCode.ERROR.msgCode, e); |
|
|
throw new GushenRuntimeException(ResponseMsgCode.ERROR.msgCode, e); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@ApiOperation(value = "根据广告表 advertId 删除") |
|
|
|
|
|
@PostMapping(value = "/delete") |
|
|
|
|
|
public ResponseData deleteById(@RequestParam Long advertId){ |
|
|
|
|
|
log.info("根据 id 删除 参数:{}",advertId); |
|
|
|
|
|
AdvertEntity advertEntity = iAdvertServer.findById(advertId); |
|
|
|
|
|
|
|
|
@ApiOperation(value = "根据广告表 id 删除") |
|
|
|
|
|
@GetMapping(value = "/delete") |
|
|
|
|
|
@CheckToken |
|
|
|
|
|
public ResponseData deleteById(@RequestParam Long id){ |
|
|
|
|
|
log.info("根据 id 删除 参数:{}",id); |
|
|
|
|
|
AdvertEntity advertEntity = iAdvertServer.findById(id); |
|
|
if (advertEntity != null) { |
|
|
if (advertEntity != null) { |
|
|
advertEntity.setDeleteFlag(1); |
|
|
advertEntity.setDeleteFlag(1); |
|
|
} |
|
|
} |
|
|
@@ -85,18 +92,20 @@ public class AdvertController extends CommonAbstractService { |
|
|
return ResponseData.success(); |
|
|
return ResponseData.success(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// @ApiOperation(value = "广告申请流程使用") |
|
|
|
|
|
// @PostMapping(value = "/setCommit") |
|
|
|
|
|
// public ResponseData setCommit(@RequestBody AdvertEntity advertEntity,@RequestParam String processDefinitionKey) { |
|
|
|
|
|
// log.info("广告维护申请流程 参数:{}", advertEntity); |
|
|
|
|
|
// iAdvertServer.doCommit(advertEntity,processDefinitionKey); |
|
|
|
|
|
// return ResponseData.success(); |
|
|
|
|
|
// } |
|
|
|
|
|
// @ApiOperation(value = "广告流程回调使用") |
|
|
|
|
|
// @PostMapping(value = "/updateAdvertState") |
|
|
|
|
|
// public ResponseData updateAdvertState(@DistrTransMessageParam Long msgId, RedisMessageContentBean redisMessageContentBean) { |
|
|
|
|
|
// log.info("广告维护申请流程回调 参数:{}", redisMessageContentBean); |
|
|
|
|
|
// iAdvertServer.updateAdvertState(msgId,redisMessageContentBean); |
|
|
|
|
|
// return ResponseData.success(); |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
@ApiOperation(value = "广告申请流程使用") |
|
|
|
|
|
@PostMapping(value = "/doCommit") |
|
|
|
|
|
@CheckToken |
|
|
|
|
|
public ResponseData doCommit(@RequestBody AdvertEntity advertEntity,@RequestParam String processDefinitionKey) { |
|
|
|
|
|
log.info("广告维护申请流程 参数:{}", advertEntity); |
|
|
|
|
|
iAdvertServer.doCommit(advertEntity,processDefinitionKey); |
|
|
|
|
|
return ResponseData.success(); |
|
|
|
|
|
} |
|
|
|
|
|
@ApiOperation(value = "广告流程回调使用") |
|
|
|
|
|
@PostMapping(value = "/updateAdvertState") |
|
|
|
|
|
@CheckToken |
|
|
|
|
|
public ResponseData updateAdvertState(@DistrTransMessageParam Long msgId, RedisMessageContentBean redisMessageContentBean) { |
|
|
|
|
|
log.info("广告维护申请流程回调 参数:{}", redisMessageContentBean); |
|
|
|
|
|
iAdvertServer.updateAdvertState(msgId,redisMessageContentBean); |
|
|
|
|
|
return ResponseData.success(); |
|
|
|
|
|
} |
|
|
} |
|
|
} |