|
@@ -5,16 +5,22 @@ import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
+import com.sooka.apply.domain.IntDetailed;
|
|
|
+import com.sooka.apply.mapper.IntRecordMapper;
|
|
|
import com.sooka.common.core.text.Convert;
|
|
|
import com.sooka.common.utils.DateUtils;
|
|
|
import com.sooka.common.utils.uuid.UUID;
|
|
|
+import com.sooka.framework.util.ShiroUtils;
|
|
|
import com.util.NumberUtils;
|
|
|
+import com.util.SecretKeyUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.sooka.system.mapper.TUInterfaceinfoMapper;
|
|
|
import com.sooka.system.domain.TUInterfaceinfo;
|
|
|
import com.sooka.system.service.ITUInterfaceinfoService;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 【请填写功能名称】Service业务层处理
|
|
@@ -25,8 +31,10 @@ import com.sooka.system.service.ITUInterfaceinfoService;
|
|
|
@Service
|
|
|
public class TUInterfaceinfoServiceImpl implements ITUInterfaceinfoService
|
|
|
{
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private TUInterfaceinfoMapper tUInterfaceinfoMapper;
|
|
|
+ @Resource
|
|
|
+ private IntRecordMapper intRecordMapper;
|
|
|
|
|
|
/**
|
|
|
* 查询【请填写功能名称】
|
|
@@ -37,7 +45,33 @@ public class TUInterfaceinfoServiceImpl implements ITUInterfaceinfoService
|
|
|
@Override
|
|
|
public TUInterfaceinfo selectTUInterfaceinfoById(String id)
|
|
|
{
|
|
|
- return tUInterfaceinfoMapper.selectTUInterfaceinfoById(id);
|
|
|
+// String str = SecretKeyUtil.AESEncode("3fc674da58", "123/政数局/2022-10-20 - 2022-10-29/b29c94d72ee74c6d94b573d90020ea59");
|
|
|
+// System.out.println("解密后的明文是:" + SecretKeyUtil.AESDncode("3fc674da58", str));
|
|
|
+ Long deptId = ShiroUtils.getSysUser().getDept().getDeptId();
|
|
|
+ String deptName = ShiroUtils.getSysUser().getDept().getDeptName();
|
|
|
+ TUInterfaceinfo tuInterfaceinfo = tUInterfaceinfoMapper.selectTUInterfaceinfoById(id);
|
|
|
+ IntDetailed intDetailed = intRecordMapper.selectIntDetailedByIntId(id);
|
|
|
+ if(intDetailed == null){
|
|
|
+ IntDetailed detailed = new IntDetailed();
|
|
|
+ String purpose = "";
|
|
|
+ String shrareType = tuInterfaceinfo.getShareType();
|
|
|
+ switch (shrareType){
|
|
|
+ case "share_type_2":
|
|
|
+ purpose = "市归集接口申请密钥";
|
|
|
+ break;
|
|
|
+ case "share_type_3":
|
|
|
+ purpose = "省上报接口申请密钥";
|
|
|
+ }
|
|
|
+ String secretKey = SecretKeyUtil.AESEncode("3fc674da58", deptId + "/" + deptName + "/2022-12-02 - 2099-12-31/" + id);
|
|
|
+ detailed.setIntId(id);
|
|
|
+ detailed.setPurpose(purpose);
|
|
|
+ detailed.setSecretKey(secretKey);
|
|
|
+ intRecordMapper.insertIntDetailed(detailed);
|
|
|
+ tuInterfaceinfo.setSecretKey(secretKey);
|
|
|
+ }else {
|
|
|
+ tuInterfaceinfo.setSecretKey(intDetailed.getSecretKey());
|
|
|
+ }
|
|
|
+ return tuInterfaceinfo;
|
|
|
}
|
|
|
|
|
|
/**
|