Commit 320b36ba by guojuxing

Merge remote-tracking branch 'origin/developer' into developer

parents f715f533 84c46ab8
......@@ -253,8 +253,11 @@ public class PlatformBrandApiServiceImpl implements PlatformBrandApiService {
Integer pageSize) {
PageHelper.startPage(pageNum, pageSize);
TabPlatformBrand brand = this.platformBrandService.getByBrandName(brandName);
if (brand == null) {
return ServiceResponse.success(new Page<>());
}
com.github.pagehelper.Page<TabPlatformBrandRef> brandRefPage = this.platformBrandRefService
.listByPlatformBrandRef(brand == null ? null : brand.getPlatformBrandId());
.listByPlatformBrandRef(brand.getPlatformBrandId());
Page<PlatformBrandRefDTO> page = PageHelperUtils.changePageHelperToCurrentPage(brandRefPage,
PlatformBrandRefDTO.class);
if (CollectionUtils.isNotEmpty(page.getResult())) {
......
......@@ -16,16 +16,19 @@ import com.gic.enterprise.dto.DictDTO;
import com.gic.enterprise.entity.TabRiskMode;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.response.EnterpriseServiceResponse;
import com.gic.enterprise.service.*;
import com.gic.enterprise.service.AuditLogApiService;
import com.gic.enterprise.service.DictApiService;
import com.gic.enterprise.service.RiskModeApiService;
import com.gic.enterprise.service.RiskModeService;
import com.gic.redis.data.util.RedisUtil;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.util.Date;
import java.util.HashMap;
......@@ -43,6 +46,8 @@ import java.util.stream.Collectors;
@Service("riskModeApiService")
public class RiskModeApiServiceImpl implements RiskModeApiService {
private Logger logger = LogManager.getLogger(RiskModeApiServiceImpl.class);
@Autowired
private DictApiService dictApiService;
@Autowired
......@@ -98,6 +103,7 @@ public class RiskModeApiServiceImpl implements RiskModeApiService {
@Override
public ServiceResponse<Void> auditCallback(String json) {
logger.info("审批回调:{}", json);
JSONObject jsonObject = JSON.parseObject(json);
Integer auditResult = jsonObject.getInteger("auditResult");
Integer riskModeId = jsonObject.getInteger("riskModeId");
......@@ -116,7 +122,6 @@ public class RiskModeApiServiceImpl implements RiskModeApiService {
}
@Override
@Transactional(rollbackFor = Exception.class)
public ServiceResponse<Void> applyRiskMode(Integer enterpriseId, Integer userId, Integer duration, String applyReason) {
if (duration == null) {
return EnterpriseServiceResponse.failure(ErrorCode.PARAMETER_ERROR);
......@@ -156,9 +161,6 @@ public class RiskModeApiServiceImpl implements RiskModeApiService {
auditLogDTO.setExtraInfo(JSON.toJSONString(map));
auditLogDTO.setAuditType(AuditTypeEnum.RISK_MODE.getCode());
ServiceResponse<Void> serviceResponse = auditLogApiService.apply(auditLogDTO);
if (!serviceResponse.isSuccess()) {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
return serviceResponse;
}
}
\ No newline at end of file
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