|
|
@@ -1,5 +1,6 @@
|
|
|
package com.lightinit.hsdataportal.impl;
|
|
|
|
|
|
+import com.lightinit.hsdataportal.common.GateWayUtils;
|
|
|
import com.lightinit.hsdataportal.common.OrderNumberUtils;
|
|
|
import com.lightinit.hsdataportal.dictionary.*;
|
|
|
import com.lightinit.hsdataportal.entity.*;
|
|
|
@@ -33,6 +34,12 @@ public class MicroappServiceImpl implements IMicroappService {
|
|
|
private OrderGoodsMapper orderGoodsMapper;
|
|
|
@Autowired
|
|
|
private ResourceViewTimesMapper resourceViewTimesMapper;
|
|
|
+ @Autowired
|
|
|
+ private UserMapper userMapper ;
|
|
|
+ @Autowired
|
|
|
+ private PublishInfoMapper publishInfoMapper ;
|
|
|
+ @Autowired
|
|
|
+ private ResourceMapper resourceMapper ;
|
|
|
/**
|
|
|
* 开放列表
|
|
|
* @param inputModel
|
|
|
@@ -94,7 +101,7 @@ public class MicroappServiceImpl implements IMicroappService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public ResultState doApply(MicroappApplyModel inputModel) {
|
|
|
+ public ResultState doApply(MicroappApplyModel inputModel) throws Exception {
|
|
|
DynamicDataContextHolder.setCustomerType(DynamicDataContextHolder.DEFAULT);
|
|
|
ResultState<Long> resultState = new ResultState<Long>();
|
|
|
ResourceAuth resourceAuth = new ResourceAuth();
|
|
|
@@ -103,6 +110,8 @@ public class MicroappServiceImpl implements IMicroappService {
|
|
|
inputModel.setCreatedAt(date);
|
|
|
inputModel.setApplyTime(date);
|
|
|
PublishSetting publishSetting = publishSettingMapper.selectByPrimaryKey(inputModel.getPublishSettingId());
|
|
|
+ PublishInfoWithBLOBs publishInfoWithBLOBs = publishInfoMapper.selectByPrimaryKey(publishSetting.getPublishInfoId());
|
|
|
+ Resource resource = resourceMapper.selectByPrimaryKey(publishInfoWithBLOBs.getResourceId());
|
|
|
if(inputModel.getPlatformType().equals(DicPlatformType.OPEN)){//开放平台
|
|
|
if(inputModel.getOpenType().equals(DicResourceOpenType.UNCONDITIONAL)) {//无条件开放
|
|
|
inputModel.setAuditResult(DicResourceAuthAuditResult.AUTHORIZATION_SUCCESS);//授权成功
|
|
|
@@ -229,6 +238,8 @@ public class MicroappServiceImpl implements IMicroappService {
|
|
|
resultState.setStateCode(ResultStateCode.INVALID_DATA);
|
|
|
resultState.setMsg("数据插入失败");
|
|
|
}
|
|
|
+ User user = userMapper.selectByPrimaryKey(inputModel.getApplier());
|
|
|
+ GateWayUtils.gatewayAuthAddMic(resource.getOutId2(),user.getUsername(),user.getUsername()+"添加授权") ;
|
|
|
// resultState.setData(inputModel.getId());
|
|
|
return resultState;
|
|
|
}
|