Compare commits
No commits in common. "db2ccb8c3b2489a12f76a3babd330e574187b78a" and "481bc10d430f1452d23676bbe9cff0e5be302571" have entirely different histories.
db2ccb8c3b
...
481bc10d43
@ -9,15 +9,8 @@
|
|||||||
|
|
||||||
#### 安装教程
|
#### 安装教程
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### 使用说明
|
#### 使用说明
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### 参与贡献
|
#### 参与贡献
|
||||||
|
|
||||||
@ -30,7 +23,7 @@
|
|||||||
#### 特技
|
#### 特技
|
||||||
|
|
||||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
||||||
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
||||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
||||||
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
||||||
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
||||||
|
@ -17,13 +17,6 @@
|
|||||||
<maven-compiler-target.version>1.8</maven-compiler-target.version>
|
<maven-compiler-target.version>1.8</maven-compiler-target.version>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.jayway.jsonpath</groupId>
|
|
||||||
<artifactId>json-path</artifactId>
|
|
||||||
<version>2.4.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
@ -8,7 +8,6 @@ public class GatedgeApplication {
|
|||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(GatedgeApplication.class, args);
|
SpringApplication.run(GatedgeApplication.class, args);
|
||||||
System.out.println("服务启动成功");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,19 +2,16 @@ package com.gatedge.jindie.controller;
|
|||||||
|
|
||||||
import com.gatedge.jindie.entity.Entity;
|
import com.gatedge.jindie.entity.Entity;
|
||||||
import com.gatedge.jindie.entity.EntityItem;
|
import com.gatedge.jindie.entity.EntityItem;
|
||||||
|
import com.gatedge.jindie.entity.EntityVO;
|
||||||
import com.gatedge.jindie.result.ActionResult;
|
import com.gatedge.jindie.result.ActionResult;
|
||||||
import com.gatedge.jindie.result.ListResult;
|
import com.gatedge.jindie.result.ListResult;
|
||||||
import com.gatedge.jindie.result.ResponseBodyMessage;
|
|
||||||
import com.gatedge.jindie.result.ResultBuilder;
|
import com.gatedge.jindie.result.ResultBuilder;
|
||||||
import com.gatedge.jindie.service.SealedQuotationService;
|
import com.gatedge.jindie.service.SealedQuotationService;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.util.ArrayList;
|
||||||
import java.util.Base64;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -30,14 +27,9 @@ import java.util.Map;
|
|||||||
@RequestMapping("/admin/")
|
@RequestMapping("/admin/")
|
||||||
public class SealedQuotationController {
|
public class SealedQuotationController {
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(SealedQuotationController.class);
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SealedQuotationService sealedQuotationService;
|
private SealedQuotationService sealedQuotationService;
|
||||||
|
|
||||||
private ResponseBodyMessage responseBodyMessage;
|
|
||||||
//记录单据编号,用于上传到单据附件管理
|
|
||||||
private String UploadFbillNo;
|
|
||||||
|
|
||||||
@GetMapping("login")
|
@GetMapping("login")
|
||||||
public ActionResult login(@RequestParam("FBILLNO") String FBILLNO, @RequestParam("Username") String username, @RequestParam("Password") String password) {
|
public ActionResult login(@RequestParam("FBILLNO") String FBILLNO, @RequestParam("Username") String username, @RequestParam("Password") String password) {
|
||||||
sealedQuotationService.login(FBILLNO, username, password);
|
sealedQuotationService.login(FBILLNO, username, password);
|
||||||
@ -69,33 +61,4 @@ public class SealedQuotationController {
|
|||||||
Map<String, Object> map = sealedQuotationService.saveData(params);
|
Map<String, Object> map = sealedQuotationService.saveData(params);
|
||||||
return ResultBuilder.buildEntitySuccess(map);
|
return ResultBuilder.buildEntitySuccess(map);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/upload")
|
|
||||||
public ResponseBodyMessage upload(@RequestParam("file") MultipartFile file,
|
|
||||||
@RequestParam("FBILLNO1") String Fbillno) throws IOException {
|
|
||||||
// 获取文件名
|
|
||||||
String fileName = file.getOriginalFilename();
|
|
||||||
// 获取文件内容并转换为 Base64 编码
|
|
||||||
String fileBase64 = Base64.getEncoder().encodeToString(file.getBytes());
|
|
||||||
|
|
||||||
System.out.println("文件名为:" + fileName);
|
|
||||||
System.out.println("文件抓取BASE64值:" + fileBase64);
|
|
||||||
System.out.println("单据编号 :" + Fbillno);
|
|
||||||
|
|
||||||
// 调用服务层方法处理文件上传逻辑
|
|
||||||
String FIDrestful = sealedQuotationService.InterId(Fbillno);
|
|
||||||
System.out.println("文件获取FID值:" + FIDrestful);
|
|
||||||
|
|
||||||
// 调用服务层方法上传文件
|
|
||||||
ResponseBodyMessage responseBodyMessage = sealedQuotationService.uploadFile(FIDrestful, fileName, fileBase64, Fbillno);
|
|
||||||
System.out.println("解析JSON数据:" + responseBodyMessage.getMessage());
|
|
||||||
|
|
||||||
return responseBodyMessage;
|
|
||||||
}
|
|
||||||
@GetMapping("/CreateFile")
|
|
||||||
public ListResult CreateFile(@RequestParam String Fbillno) {
|
|
||||||
List<EntityItem> data = null;
|
|
||||||
|
|
||||||
return ResultBuilder.buildEntitySuccess(data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,61 +0,0 @@
|
|||||||
package com.gatedge.jindie.entity;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author ligoudan
|
|
||||||
* @create 2025-04-09 19:08
|
|
||||||
* 相应JSON的反应实体类
|
|
||||||
*/
|
|
||||||
public class FileEntityItem {
|
|
||||||
@JsonProperty("FATTACHMENTNAME")
|
|
||||||
private String FATTACHMENTNAME;//文件名
|
|
||||||
|
|
||||||
@JsonProperty("FATTACHMENTSIZE")
|
|
||||||
private String FATTACHMENTSIZE;//文件大小
|
|
||||||
|
|
||||||
@JsonProperty("FCREATETIME")
|
|
||||||
private String FCREATETIME;
|
|
||||||
|
|
||||||
@JsonProperty("FID")
|
|
||||||
private String FID;
|
|
||||||
|
|
||||||
public FileEntityItem(String FATTACHMENTNAME, String FATTACHMENTSIZE, String FCREATETIME, String FID) {
|
|
||||||
this.FATTACHMENTNAME = FATTACHMENTNAME;
|
|
||||||
this.FATTACHMENTSIZE = FATTACHMENTSIZE;
|
|
||||||
this.FCREATETIME = FCREATETIME;
|
|
||||||
this.FID = FID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFATTACHMENTNAME() {
|
|
||||||
return FATTACHMENTNAME;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFATTACHMENTNAME(String FATTACHMENTNAME) {
|
|
||||||
this.FATTACHMENTNAME = FATTACHMENTNAME;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFATTACHMENTSIZE() {
|
|
||||||
return FATTACHMENTSIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFATTACHMENTSIZE(String FATTACHMENTSIZE) {
|
|
||||||
this.FATTACHMENTSIZE = FATTACHMENTSIZE;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFCREATETIME() {
|
|
||||||
return FCREATETIME;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFCREATETIME(String FCREATETIME) {
|
|
||||||
this.FCREATETIME = FCREATETIME;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getFID() {
|
|
||||||
return FID;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFID(String FID) {
|
|
||||||
this.FID = FID;
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,32 +0,0 @@
|
|||||||
package com.gatedge.jindie.result;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author 李天华
|
|
||||||
* @create 2024-12-24 9:43
|
|
||||||
* 文件上传的返回JSON实体类
|
|
||||||
*/
|
|
||||||
public class ResponseBodyMessage {
|
|
||||||
private int status; //状态码
|
|
||||||
private String message;
|
|
||||||
|
|
||||||
public ResponseBodyMessage(int status, String message) {
|
|
||||||
this.status = status;
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(int status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getMessage() {
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setMessage(String message) {
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,8 +3,6 @@ package com.gatedge.jindie.service;
|
|||||||
import com.gatedge.jindie.entity.Entity;
|
import com.gatedge.jindie.entity.Entity;
|
||||||
import com.gatedge.jindie.entity.EntityItem;
|
import com.gatedge.jindie.entity.EntityItem;
|
||||||
import com.gatedge.jindie.entity.EntityVO;
|
import com.gatedge.jindie.entity.EntityVO;
|
||||||
import com.gatedge.jindie.entity.FileEntityItem;
|
|
||||||
import com.gatedge.jindie.result.ResponseBodyMessage;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -51,13 +49,4 @@ public interface SealedQuotationService {
|
|||||||
|
|
||||||
|
|
||||||
Boolean loginChack(Map<String, String> params);
|
Boolean loginChack(Map<String, String> params);
|
||||||
|
|
||||||
//获取单据内码
|
|
||||||
String InterId(String FBillNo);
|
|
||||||
|
|
||||||
//根据获取到的单据内码FID,对单据进行附件上传
|
|
||||||
ResponseBodyMessage uploadFile(String FID, String fileName, String fileBase64, String FBillNo);
|
|
||||||
|
|
||||||
//根据单据编号,查询已经上传的附件
|
|
||||||
List<FileEntityItem> queryFiles(String FBillNo);
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package com.gatedge.jindie.service.impl;
|
package com.gatedge.jindie.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
import com.fasterxml.jackson.core.type.TypeReference;
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
@ -9,12 +8,8 @@ import com.fasterxml.jackson.databind.ObjectMapper;
|
|||||||
import com.gatedge.jindie.entity.Entity;
|
import com.gatedge.jindie.entity.Entity;
|
||||||
import com.gatedge.jindie.entity.EntityItem;
|
import com.gatedge.jindie.entity.EntityItem;
|
||||||
import com.gatedge.jindie.entity.EntityVO;
|
import com.gatedge.jindie.entity.EntityVO;
|
||||||
import com.gatedge.jindie.entity.FileEntityItem;
|
|
||||||
import com.gatedge.jindie.result.ResponseBodyMessage;
|
|
||||||
import com.gatedge.jindie.service.SealedQuotationService;
|
import com.gatedge.jindie.service.SealedQuotationService;
|
||||||
|
|
||||||
import com.jayway.jsonpath.JsonPath;
|
|
||||||
import javafx.collections.ObservableArray;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpEntity;
|
import org.springframework.http.HttpEntity;
|
||||||
import org.springframework.http.HttpHeaders;
|
import org.springframework.http.HttpHeaders;
|
||||||
@ -24,11 +19,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import java.time.format.DateTimeFormatter;
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,19 +38,10 @@ public class SealedQuotationServiceImpl implements SealedQuotationService {
|
|||||||
//主表
|
//主表
|
||||||
private String Primary_Meter="Fid,FBILLNO,FProjectName,FSrcBillNo,FSupplierId.FNumber,FSupplierName,FOpenDate,FPriceStatus,FQuoteDate,FExpiryDate,FContact,FPhone,FMail,FCurrId.FName,FIsIncludedTax,FDATE,FBuyer.FName,FCheckerId,FDocumentStatus";
|
private String Primary_Meter="Fid,FBILLNO,FProjectName,FSrcBillNo,FSupplierId.FNumber,FSupplierName,FOpenDate,FPriceStatus,FQuoteDate,FExpiryDate,FContact,FPhone,FMail,FCurrId.FName,FIsIncludedTax,FDATE,FBuyer.FName,FCheckerId,FDocumentStatus";
|
||||||
private String Detailed_List="FEntity_FEntryID, FMATERIALID.FNumber,FMaterialId.FName, FUnitID.FName,FQty, FPrice, FTaxRate, FTaxPrice,FNote,FPayConditionId.FName";
|
private String Detailed_List="FEntity_FEntryID, FMATERIALID.FNumber,FMaterialId.FName, FUnitID.FName,FQty, FPrice, FTaxRate, FTaxPrice,FNote,FPayConditionId.FName";
|
||||||
//查询表单的FID
|
|
||||||
private String UploadPrimary_Meter = "FID";
|
|
||||||
|
|
||||||
private String QUERY_DATA_URL="http://192.168.61.20:18081/K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc";
|
private String QUERY_DATA_URL="http://1.14.142.111:9090/K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc";
|
||||||
private String SAVA_DATA_URL="http://192.168.61.20:18081/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc";
|
private String SAVA_DATA_URL="http://1.14.142.111:9090/k3cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc";
|
||||||
|
|
||||||
private String UploadFile = "http://192.168.61.20:18081/K3Cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.Save.common.kdsvc";
|
|
||||||
//查询单据FID的Url
|
|
||||||
private String QueryInterId = "http://192.168.61.20:18081/K3Cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc";
|
|
||||||
//查询单据上传附件
|
|
||||||
private String QueryFilesUrl = "http://192.168.61.20:18081/K3Cloud/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc";
|
|
||||||
//查询单据上传附件的主键
|
|
||||||
private String QueryFiles = "FID,FATTACHMENTNAME,FATTACHMENTSIZE,FCREATETIME";
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void login(String FBILLNO, String username, String password) {
|
public void login(String FBILLNO, String username, String password) {
|
||||||
@ -169,6 +151,7 @@ public class SealedQuotationServiceImpl implements SealedQuotationService {
|
|||||||
entityItem.setFSEQ(String.valueOf(FSEQ));
|
entityItem.setFSEQ(String.valueOf(FSEQ));
|
||||||
FSEQ++;
|
FSEQ++;
|
||||||
result.add(entityItem);
|
result.add(entityItem);
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
System.err.println("Invalid JSON array format.");
|
System.err.println("Invalid JSON array format.");
|
||||||
@ -193,10 +176,10 @@ public class SealedQuotationServiceImpl implements SealedQuotationService {
|
|||||||
data.put("IsAutoSubmitAndAudit",isAutoAdjustField);
|
data.put("IsAutoSubmitAndAudit",isAutoAdjustField);
|
||||||
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
String format = simpleDateFormat.format(new Date());
|
String format = simpleDateFormat.format(new Date());
|
||||||
params.put("FQuoteDate",format);
|
data.put("FQuoteDate",format);
|
||||||
if (isAutoAdjustField.equals("true")) {
|
if (isAutoAdjustField.equals("true")) {
|
||||||
data.put("FIsConfirm",true);
|
data.put("FIsConfirm",true);
|
||||||
params.put("FConfirmDate",format);
|
data.put("FConfirmDate",true);
|
||||||
}
|
}
|
||||||
data.put("Model",params);
|
data.put("Model",params);
|
||||||
|
|
||||||
@ -232,7 +215,7 @@ public class SealedQuotationServiceImpl implements SealedQuotationService {
|
|||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
// String url = "http://192.168.61.20:18081/K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc";
|
// String url = "http://1.14.142.111:9090/K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc";
|
||||||
HttpEntity<String> requestEntity = new HttpEntity<>(jsonData, headers);
|
HttpEntity<String> requestEntity = new HttpEntity<>(jsonData, headers);
|
||||||
System.out.println(jsonData);
|
System.out.println(jsonData);
|
||||||
// 发送POST请求
|
// 发送POST请求
|
||||||
@ -248,19 +231,47 @@ public class SealedQuotationServiceImpl implements SealedQuotationService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String SAVA_API(String apiCookie, Map<String, Object> data,String url) {
|
||||||
|
// 设置请求头信息
|
||||||
|
HttpHeaders headers = new HttpHeaders();
|
||||||
|
headers.set("Content-Type", "application/json");
|
||||||
|
headers.set("kdservice-sessionid", apiCookie);
|
||||||
|
|
||||||
|
// 设置请求参数
|
||||||
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
|
String jsonData = null;
|
||||||
|
try {
|
||||||
|
jsonData = objectMapper.writeValueAsString(data);
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
// String url = "http://1.14.142.111:9090/K3CLOUD/Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.ExecuteBillQuery.common.kdsvc";
|
||||||
|
HttpEntity<String> requestEntity = new HttpEntity<>(jsonData, headers);
|
||||||
|
|
||||||
|
// 发送POST请求
|
||||||
|
ResponseEntity<String> responseEntity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, String.class);
|
||||||
|
|
||||||
|
// 获取返回信息
|
||||||
|
String response = responseEntity.getBody();
|
||||||
|
if (Objects.equals(response, "[]")) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public String loginAPI(String apiCookie) {
|
public String loginAPI(String apiCookie) {
|
||||||
Map<String, Object> params = new HashMap<>();
|
Map<String, Object> params = new HashMap<>();
|
||||||
// params.put("acctID", "63e200975197e2");
|
params.put("acctID", "63e200975197e2");
|
||||||
params.put("acctID", "639130a0cbb6ae");
|
params.put("Username", "王扶民");
|
||||||
params.put("Username", "ERP1");
|
|
||||||
// params.put("Username", "王扶民");
|
|
||||||
params.put("Password", "888888");
|
params.put("Password", "888888");
|
||||||
params.put("Lcid", "2052");
|
params.put("Lcid", "2052");
|
||||||
// 设置请求头信息
|
// 设置请求头信息
|
||||||
HttpHeaders headers = new HttpHeaders();
|
HttpHeaders headers = new HttpHeaders();
|
||||||
headers.set("Content-Type", "application/json");
|
headers.set("Content-Type", "application/json");
|
||||||
if (apiCookie != null) {
|
if (apiCookie != null) {
|
||||||
headers.set("kdservice-sessionid", "95db4c18-10cd-420c-a0eb-96e2ee2db7f8");
|
headers.set("kdservice-sessionid", "54f0d8ff-00a7-4db0-992b-cfe9abed566e");
|
||||||
}
|
}
|
||||||
// 设置请求参数
|
// 设置请求参数
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
ObjectMapper objectMapper = new ObjectMapper();
|
||||||
@ -270,25 +281,16 @@ public class SealedQuotationServiceImpl implements SealedQuotationService {
|
|||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
String url = "http://192.168.61.20:18081/K3Cloud/Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc";
|
String url = "http://1.14.142.111:9090/K3Cloud/Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc";
|
||||||
// String url = "http://1.14.142.111:9090/K3Cloud/Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc";
|
|
||||||
HttpEntity<String> requestEntity = new HttpEntity<>(jsonData, headers);
|
HttpEntity<String> requestEntity = new HttpEntity<>(jsonData, headers);
|
||||||
|
|
||||||
// 发送POST请求
|
// 发送POST请求
|
||||||
ResponseEntity<String> responseEntity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, String.class);
|
ResponseEntity<String> responseEntity = restTemplate.exchange(url, HttpMethod.POST, requestEntity, String.class);
|
||||||
|
|
||||||
HttpHeaders headersResponse = responseEntity.getHeaders();
|
|
||||||
List<String> list = headersResponse.get("Set-Cookie");
|
|
||||||
// 获取返回信息
|
// 获取返回信息
|
||||||
String sessionId = null;
|
String response = responseEntity.getBody();
|
||||||
String str = list.get(0);
|
Map<String, Object> resultMap = JSON.parseObject(response);
|
||||||
Pattern pattern = Pattern.compile("kdservice-sessionid=(.*?);");
|
return resultMap.get("KDSVCSessionId").toString();
|
||||||
Matcher matcher = pattern.matcher(str);
|
|
||||||
if (matcher.find()) {
|
|
||||||
sessionId = matcher.group(1);
|
|
||||||
System.out.println(sessionId); // 输出:d57b692d-9358-4242-a6ee-553d6f6b3b4f
|
|
||||||
}
|
|
||||||
return sessionId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -329,136 +331,4 @@ public class SealedQuotationServiceImpl implements SealedQuotationService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String InterId(String FBillNo) {
|
|
||||||
Map<String, Object> data = new HashMap<>();
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
|
||||||
params.put("FormId","kafe2f22a0498441f9109c31cf5586da5");
|
|
||||||
params.put("FieldKeys",UploadPrimary_Meter);
|
|
||||||
params.put("FilterString", "FBILLNO like'%" + FBillNo + "'");
|
|
||||||
data.put("data", params);
|
|
||||||
String api = loginAPI(null);
|
|
||||||
loginAPI(api);
|
|
||||||
String input = API(api,data,QueryInterId);
|
|
||||||
if (input != null) {
|
|
||||||
//截取字符串,去掉[[]]
|
|
||||||
input = input.substring(2, input.length() - 2);
|
|
||||||
}
|
|
||||||
return input;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ResponseBodyMessage uploadFile(String FID, String fileName, String fileBase64, String FBillNo) {
|
|
||||||
// 创建最外层的Map
|
|
||||||
Map<String, Object> rootMap = new HashMap<>();
|
|
||||||
// 创建内部的data Map
|
|
||||||
Map<String, Object> dataMap = new HashMap<>();
|
|
||||||
// 创建Model Map
|
|
||||||
Map<String, Object> modelMap = new HashMap<>();
|
|
||||||
// 创建FCreateMen Map
|
|
||||||
Map<String, Object> createMenMap = new HashMap<>();
|
|
||||||
//获取文件后缀名
|
|
||||||
String extension = getFileExtensionWithDot(fileName);
|
|
||||||
//获取当前时间
|
|
||||||
LocalDateTime currentDateTime = LocalDateTime.now();
|
|
||||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
|
||||||
String formattedDateTime = currentDateTime.format(formatter);
|
|
||||||
|
|
||||||
|
|
||||||
createMenMap.put("FUserID", "100746");
|
|
||||||
|
|
||||||
// 填充Model Map
|
|
||||||
modelMap.put("FAttachmentName", fileName);//文件名
|
|
||||||
modelMap.put("FBillType", "kafe2f22a0498441f9109c31cf5586da5");//单据类型
|
|
||||||
modelMap.put("FInterID", FID);//单据FID
|
|
||||||
modelMap.put("FBillNo", FBillNo);//单据编号
|
|
||||||
modelMap.put("FAttachment", fileBase64);//文件BASE64
|
|
||||||
modelMap.put("FFILESTORAGE", 0);
|
|
||||||
modelMap.put("FExtName", extension);
|
|
||||||
modelMap.put("FEntryinterId", "-1");//单据头附件
|
|
||||||
modelMap.put("FEntrykey", " ");//单据头附近,要传一个空格
|
|
||||||
modelMap.put("FaliasFileName", fileName);
|
|
||||||
modelMap.put("FCreateMen", createMenMap);
|
|
||||||
modelMap.put("FCreateTime",formattedDateTime);
|
|
||||||
|
|
||||||
// 填充data Map
|
|
||||||
dataMap.put("Model", modelMap);
|
|
||||||
|
|
||||||
// 填充最外层的Map
|
|
||||||
rootMap.put("FormId", "BOS_Attachment");
|
|
||||||
rootMap.put("data", dataMap);
|
|
||||||
String api = loginAPI(null);
|
|
||||||
loginAPI(api);
|
|
||||||
String Json =API(api,rootMap,UploadFile);
|
|
||||||
System.out.println("22上传的:"+Json);
|
|
||||||
Boolean Success = JsonPath.read(Json,"$.Result.ResponseStatus.IsSuccess");
|
|
||||||
if(Success){
|
|
||||||
return new ResponseBodyMessage(1,"附件上传成功");
|
|
||||||
}else {
|
|
||||||
String message = JsonPath.read(Json,"$.Result.ResponseStatus.Errors[0].Message");
|
|
||||||
return new ResponseBodyMessage(0,"附件上传失败,失败原因:"+message);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<FileEntityItem> queryFiles(String FBillNo) {
|
|
||||||
Map<String, Object> data = new HashMap<>();
|
|
||||||
Map<String, Object> params = new HashMap<>();
|
|
||||||
params.put("FormId","BOS_Attachment");
|
|
||||||
params.put("FieldKeys",QueryFiles);
|
|
||||||
params.put("FilterString", "FBILLNO like'%" + FBillNo + "'");
|
|
||||||
params.put("OrderString", "");
|
|
||||||
params.put("TopRowCount", "0");
|
|
||||||
params.put("StartRow", "0");
|
|
||||||
params.put("Limit", "100");
|
|
||||||
String api = loginAPI(null);
|
|
||||||
loginAPI(api);
|
|
||||||
String json = API(api,data,QueryFilesUrl);
|
|
||||||
List<FileEntityItem> result = new ArrayList<>();
|
|
||||||
if (json != null) {
|
|
||||||
//可能返回的是个集合,需要处理一下
|
|
||||||
try {
|
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
JsonNode jsonArray = objectMapper.readTree(json);
|
|
||||||
if (jsonArray.isArray()) {
|
|
||||||
int FSEQ=1;
|
|
||||||
for (JsonNode jsonItem : jsonArray) {
|
|
||||||
String input = jsonItem.toString();
|
|
||||||
input = input.substring(1, input.length() - 1); // 截取字符串,去掉 "[[" 和 "]]"
|
|
||||||
String[] parts = input.split(",");
|
|
||||||
List<String> list = new ArrayList<>();
|
|
||||||
for (String part : parts) {
|
|
||||||
String cleanedPart = part.replaceAll("[\"\\s+]", ""); // 去掉多余的双引号和空格
|
|
||||||
list.add(cleanedPart);
|
|
||||||
}
|
|
||||||
FileEntityItem entityItem = new FileEntityItem(list.get(3),list.get(2),list.get(1),list.get(0));
|
|
||||||
//entityItem.setFSEQ(String.valueOf(FSEQ));
|
|
||||||
FSEQ++;
|
|
||||||
result.add(entityItem);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
System.err.println("Invalid JSON array format.");
|
|
||||||
}
|
|
||||||
} catch (JsonProcessingException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取文件后缀名的方法
|
|
||||||
* @param fileName 文件名
|
|
||||||
* @return 文件后缀名,如果没有后缀名返回 null
|
|
||||||
*/
|
|
||||||
public static String getFileExtensionWithDot(String fileName) {
|
|
||||||
int dotIndex = fileName.lastIndexOf(".");
|
|
||||||
if (dotIndex != -1 && dotIndex != 0) {
|
|
||||||
return fileName.substring(dotIndex);
|
|
||||||
} else {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,3 @@
|
|||||||
server:
|
server:
|
||||||
port: 10002
|
port: 10002
|
||||||
spring:
|
|
||||||
servlet:
|
|
||||||
multipart:
|
|
||||||
max-file-size: 100MB
|
|
||||||
max-request-size: 100MB
|
|
||||||
|
6
node_modules/.package-lock.json
generated
vendored
6
node_modules/.package-lock.json
generated
vendored
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "TianDaMFBJ_Test",
|
|
||||||
"lockfileVersion": 3,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {}
|
|
||||||
}
|
|
6
package-lock.json
generated
6
package-lock.json
generated
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "TianDaMFBJ_Test",
|
|
||||||
"lockfileVersion": 3,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {}
|
|
||||||
}
|
|
@ -1 +0,0 @@
|
|||||||
shamefully-flatten=true
|
|
@ -1,10 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "tdtest",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"private": true,
|
|
||||||
"devDependencies": {
|
|
||||||
"@vue/cli-plugin-babel": "~5.0.0",
|
|
||||||
"@vue/cli-plugin-eslint": "~5.0.0",
|
|
||||||
"@vue/cli-service": "~5.0.0"
|
|
||||||
}
|
|
||||||
}
|
|
11502
vue/package-lock.json
generated
11502
vue/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -10,15 +10,15 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"core-js": "^3.8.3",
|
"core-js": "^3.8.3",
|
||||||
"element-ui": "^2.15.14",
|
"element-ui": "^2.15.13",
|
||||||
"js-cookie": "^3.0.5",
|
"js-cookie": "^3.0.5",
|
||||||
"vue": "^3.5.13",
|
"vue": "^2.6.14",
|
||||||
"vue-router": "^4.5.0",
|
"vue-router": "^3.5.1",
|
||||||
"vuex": "^4.1.0"
|
"vuex": "^3.6.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.12.16",
|
"@babel/core": "^7.12.16",
|
||||||
"@vue/cli-plugin-babel": "^5.0.8",
|
"@vue/cli-plugin-babel": "~5.0.0",
|
||||||
"@vue/cli-plugin-router": "~5.0.0",
|
"@vue/cli-plugin-router": "~5.0.0",
|
||||||
"@vue/cli-plugin-vuex": "~5.0.0",
|
"@vue/cli-plugin-vuex": "~5.0.0",
|
||||||
"@vue/cli-service": "~5.0.0",
|
"@vue/cli-service": "~5.0.0",
|
||||||
|
7721
vue/pnpm-lock.yaml
generated
7721
vue/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,7 @@
|
|||||||
// import Vue from "vue";
|
import Vue from "vue";
|
||||||
// import VueRouter from "vue-router";
|
import VueRouter from "vue-router";
|
||||||
import { createApp } from 'vue';
|
|
||||||
import { createRouter, createWebHistory } from 'vue-router';
|
|
||||||
|
|
||||||
//Vue.use(VueRouter);
|
Vue.use(VueRouter);
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
@ -26,9 +24,8 @@ const routes = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const router = createRouter({
|
const router = new VueRouter({
|
||||||
history: createWebHistory(),
|
routes,
|
||||||
routes
|
});
|
||||||
})
|
|
||||||
|
|
||||||
export default router;
|
export default router;
|
||||||
|
@ -7,14 +7,6 @@
|
|||||||
<el-button v-if="view" type="primary" @click="saveData('true')">
|
<el-button v-if="view" type="primary" @click="saveData('true')">
|
||||||
{{ '提交' }}
|
{{ '提交' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-upload
|
|
||||||
class="upload-demo"
|
|
||||||
action="/api/upload"
|
|
||||||
:on-success="onSuccess"
|
|
||||||
multiple
|
|
||||||
:file-list="fileList">
|
|
||||||
<el-button size="small" type="primary">点击上传</el-button>
|
|
||||||
</el-upload>
|
|
||||||
</div>
|
</div>
|
||||||
<el-divider></el-divider>
|
<el-divider></el-divider>
|
||||||
<el-form ref="ContractSalaryForm" :rules="rules" :model="ruleFrom" :label-position="labelPosition"
|
<el-form ref="ContractSalaryForm" :rules="rules" :model="ruleFrom" :label-position="labelPosition"
|
||||||
@ -264,7 +256,6 @@ export default {
|
|||||||
return {
|
return {
|
||||||
labelPosition: 'right',
|
labelPosition: 'right',
|
||||||
list: [],
|
list: [],
|
||||||
fileList: [],
|
|
||||||
data: {
|
data: {
|
||||||
FormId: "kafe2f22a0498441f9109c31cf5586da5",
|
FormId: "kafe2f22a0498441f9109c31cf5586da5",
|
||||||
FieldKeys: '',
|
FieldKeys: '',
|
||||||
@ -342,21 +333,6 @@ export default {
|
|||||||
computed: {},
|
computed: {},
|
||||||
watch: {},
|
watch: {},
|
||||||
methods: {
|
methods: {
|
||||||
// 文件上传对返回的Json数据进行解析
|
|
||||||
onSuccess(response,file,fileList){
|
|
||||||
if(response.status == 0){
|
|
||||||
this.$message({
|
|
||||||
message:response.message,
|
|
||||||
type: 'error'
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
this.$message({
|
|
||||||
message:response.message,
|
|
||||||
type: 'success'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
updatePrice(row) {
|
updatePrice(row) {
|
||||||
row.FTaxPrice = (Number(row.FPrice == "" ? 0 : row.FPrice) * (1 + (Number(row.FTaxRate == "" ? 0 : row.FTaxRate) / 100))).toFixed(2);
|
row.FTaxPrice = (Number(row.FPrice == "" ? 0 : row.FPrice) * (1 + (Number(row.FTaxRate == "" ? 0 : row.FTaxRate) / 100))).toFixed(2);
|
||||||
console.log(row)
|
console.log(row)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user