新增:利元亨现场3方接口交互代码提交
This commit is contained in:
@@ -1,18 +1,19 @@
|
||||
package com.sdm.pbs.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.sdm.common.common.SdmResponse;
|
||||
import com.sdm.outbridge.entity.ViewLyricconfig;
|
||||
import com.sdm.outbridge.service.lyric.IViewLyricConfigService;
|
||||
import com.sdm.pbs.model.entity.SimulationCommandPlaceholder;
|
||||
import com.sdm.pbs.service.ISimulationCommandPlaceholderService;
|
||||
import com.sdm.outbridge.mode.FreelinkAndDingdingInformReq;
|
||||
import com.sdm.outbridge.mode.GetProcessDataReq;
|
||||
import com.sdm.outbridge.mode.HkUploadFileReq;
|
||||
import com.sdm.outbridge.service.lyric.LyricIntegrateService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Slf4j
|
||||
@RestController
|
||||
@@ -20,24 +21,113 @@ import java.util.List;
|
||||
@Tag(name = "测试外部模块系统交互", description = "测试外部模块系统交互")
|
||||
public class TestSecondDbController {
|
||||
|
||||
/*利元亨现场对接接口方法*/
|
||||
@Autowired
|
||||
private ISimulationCommandPlaceholderService simulationCommandPlaceholderService;
|
||||
|
||||
@Autowired
|
||||
private IViewLyricConfigService viewLyricConfigService;
|
||||
private LyricIntegrateService lyricIntegrateService;
|
||||
|
||||
|
||||
@GetMapping("/testSec")
|
||||
@Operation(summary = "测试多数据源")
|
||||
public SdmResponse<String> testSec() {
|
||||
// 查询主数据源
|
||||
List<SimulationCommandPlaceholder> placeholders = simulationCommandPlaceholderService.lambdaQuery().list();
|
||||
// 查询从数据源
|
||||
List<ViewLyricconfig> seconds = viewLyricConfigService.lambdaQuery().list();
|
||||
System.out.println(JSONObject.toJSONString(placeholders));
|
||||
System.out.println(JSONObject.toJSONString(seconds));
|
||||
return SdmResponse.success(JSONObject.toJSONString(seconds));
|
||||
// mock
|
||||
@PostMapping("/getHkUserInfo")
|
||||
@Operation(summary = "mock获取海葵用户信息")
|
||||
public SdmResponse getHkUserInfo(@RequestBody Map<String,Object> map) {
|
||||
String jobNo = map.get("jobNo").toString();
|
||||
SdmResponse hkCloudSimpleUserInfo = lyricIntegrateService.getHKCloudSimpleUserInfo(jobNo);
|
||||
return hkCloudSimpleUserInfo;
|
||||
}
|
||||
|
||||
@PostMapping("/uploadHkFile")
|
||||
@Operation(summary = "mock上传海葵文件")
|
||||
public SdmResponse uploadHkFile(@RequestBody Map<String,Object> map) {
|
||||
// todo mock
|
||||
HkUploadFileReq mockReq = new HkUploadFileReq();
|
||||
mockReq.setFilePower("2456236750149124114");
|
||||
mockReq.setWaterMarkFlag(false);
|
||||
mockReq.setWaterMarkContent("spdm");
|
||||
mockReq.setSysId(1691399963692630016L);
|
||||
mockReq.setFormId(1847115435993071616L);
|
||||
mockReq.setComponentInstId(8000004142460000204L);
|
||||
mockReq.setTableName("oa_three_d_review");
|
||||
mockReq.setColumnName("simulation_table");
|
||||
//上面的暂时定就传上面mock的参数。下面是项目号和工位号,jobNo,上传的文件,压缩成zip的 根据实际情况赋值
|
||||
mockReq.setXmh("3176");
|
||||
mockReq.setGwh("02-98");
|
||||
String jobNo = map.get("jobNo").toString();
|
||||
List<String> files = new ArrayList<>();
|
||||
files.add("D:\\PTC\\01-spdm\\spdmTest1220.zip");
|
||||
mockReq.setFiles(files);
|
||||
SdmResponse sdmResponse = lyricIntegrateService.uploadHkFile(jobNo, mockReq);
|
||||
return sdmResponse;
|
||||
}
|
||||
|
||||
@PostMapping("/getProcessData")
|
||||
@Operation(summary = "mock获取工位流程实列号")
|
||||
public SdmResponse getProcessData(@RequestBody GetProcessDataReq req ) {
|
||||
SdmResponse sdmResponse = lyricIntegrateService.getProcessData(req);
|
||||
return sdmResponse;
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/pushFreeLinkMsg")
|
||||
@Operation(summary = "mock推送消息")
|
||||
public SdmResponse pushFreeLinkMsg(@RequestBody FreelinkAndDingdingInformReq req ) {
|
||||
SdmResponse sdmResponse = lyricIntegrateService.pushFreeLinkMsg(req);
|
||||
return sdmResponse;
|
||||
}
|
||||
|
||||
@PostMapping("/queryTodoAttachments")
|
||||
@Operation(summary = "mock查询代办附件")
|
||||
public SdmResponse queryTodoAttachments(@RequestBody Map map ) {
|
||||
Integer todoId = (Integer) map.get("todoId");
|
||||
SdmResponse sdmResponse = lyricIntegrateService.queryTodoAttachments(todoId);
|
||||
return sdmResponse;
|
||||
}
|
||||
|
||||
|
||||
// /*现场查询视图的方法mock */
|
||||
// @GetMapping("/getTodoInfoDm") no usages
|
||||
// @Operation(summary = "查询代办")
|
||||
// public SdmResponse<List<LyricVTodoEmulationInfoDM>> getTodoInfoDm() {
|
||||
// // 查询从数据源
|
||||
// List<LyricVTodoEmulationInfoDM> todoInfoList = lyricVTodoInfoService.lambdaQuery().last(lastSql: "limit 2").list();
|
||||
// return SdmResponse.success(todoInfoList);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/getPdtDm") no usages
|
||||
// @Operation(summary = "查询项目Pdt")
|
||||
// public SdmResponse<List<LyricVPdtToDM>> getPdtDm() {
|
||||
// // 查询从数据源
|
||||
// List<LyricVPdtToDM> lyricVPdtToDMList = LyricVPdtDmService.lambdaQuery().last(lastSql: "limit 2").list();
|
||||
// return SdmResponse.success(lyricVPdtToDMList);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/getMain") no usages
|
||||
// @Operation(summary = "查询主计划")
|
||||
// public SdmResponse<List<LyricVMainPlanDM>> getMain() {
|
||||
// // 查询从数据源
|
||||
// List<LyricVMainPlanDM> mainPlanDMSList = lyricVMainPlanDMService.lambdaQuery().last(lastSql: "limit 2").list();
|
||||
// return SdmResponse.success(mainPlanDMSList);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/getProductLine") no usages
|
||||
// @Operation(summary = "查询产线信息")
|
||||
// public SdmResponse<List<LyricVProductionLineToDM>> getProductLine() {
|
||||
// // 查询从数据源
|
||||
// List<LyricVProductionLineToDM> productionLineToDMList = lyricVProductionLineToDmService
|
||||
// .lambdaQuery().last(lastSql: "limit 2").list();
|
||||
// return SdmResponse.success(productionLineToDMList);
|
||||
// }
|
||||
//
|
||||
// @GetMapping("/getProjectInfo") no usages
|
||||
// @Operation(summary = "查询项目信息")
|
||||
// public SdmResponse<List<LyricVProjectToDM>> getProjectInfo() {
|
||||
// // 查询从数据源
|
||||
// List<LyricVProjectToDM> projectToDmList = LyricVProjectToDmService
|
||||
// .lambdaQuery().last(lastSql: "limit 3").list();
|
||||
// return SdmResponse.success(projectToDmList);
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user