|
@@ -186,7 +186,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
// 节点定义--------------------------------
|
|
// 节点定义--------------------------------
|
|
|
|
|
|
|
|
/* 工程信息 */
|
|
/* 工程信息 */
|
|
|
- function GongCXX(CRCvals) {
|
|
|
|
|
|
|
+ function GongCXX(md5Str) {
|
|
|
const xmlxStr = isGLYun() ? '施工' : '养护';
|
|
const xmlxStr = isGLYun() ? '施工' : '养护';
|
|
|
const attrs = [
|
|
const attrs = [
|
|
|
{ name: '项目编号', value: getValueByKey(info, 'projNum'), minLen: 1 },
|
|
{ name: '项目编号', value: getValueByKey(info, 'projNum'), minLen: 1 },
|
|
@@ -203,7 +203,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
{ name: '设计单位', value: getValueByKey(info, 'designUnit') },
|
|
{ name: '设计单位', value: getValueByKey(info, 'designUnit') },
|
|
|
{ name: '计税方式', value: valueMap[getValueByKey(info, 'taxMode')] },
|
|
{ name: '计税方式', value: valueMap[getValueByKey(info, 'taxMode')] },
|
|
|
{name: '文件类型', value: isBidInvitation ? 1 : (isControl ? 2 : 3)}, // 1=工程量清单;2=招标控制价;3=投标报价;
|
|
{name: '文件类型', value: isBidInvitation ? 1 : (isControl ? 2 : 3)}, // 1=工程量清单;2=招标控制价;3=投标报价;
|
|
|
- { name: '数据校验码', value: md5(CRCvals.join('')) },
|
|
|
|
|
|
|
+ { name: '数据校验码', value: md5Str },
|
|
|
{ name: '标准版本号', value: '1.0' },
|
|
{ name: '标准版本号', value: '1.0' },
|
|
|
{ name: 'GUID', value: projectData.GUID }
|
|
{ name: 'GUID', value: projectData.GUID }
|
|
|
];
|
|
];
|
|
@@ -751,7 +751,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/* 组装建设项目数据 */
|
|
/* 组装建设项目数据 */
|
|
|
- function setupConstruction() {
|
|
|
|
|
|
|
+ async function setupConstruction() {
|
|
|
const rootNode = new Element('浙江交通建设工程');
|
|
const rootNode = new Element('浙江交通建设工程');
|
|
|
const zhaoTBXX = new Element('招投标信息');
|
|
const zhaoTBXX = new Element('招投标信息');
|
|
|
const gongLGCSJ = new Element('公路工程数据');
|
|
const gongLGCSJ = new Element('公路工程数据');
|
|
@@ -770,7 +770,7 @@ INTERFACE_EXPORT = (() => {
|
|
|
gongLGCHZ.children.push(gongLGCHZBT);
|
|
gongLGCHZ.children.push(gongLGCHZBT);
|
|
|
|
|
|
|
|
// 组装标段数据
|
|
// 组装标段数据
|
|
|
- projectData.children.forEach((tender, index) => {
|
|
|
|
|
|
|
+ projectData.children.forEach( (tender, index) => {
|
|
|
billSeq = 1;
|
|
billSeq = 1;
|
|
|
mainMaterialSeq = 1;
|
|
mainMaterialSeq = 1;
|
|
|
rationSeq = 1;
|
|
rationSeq = 1;
|
|
@@ -790,7 +790,8 @@ INTERFACE_EXPORT = (() => {
|
|
|
});
|
|
});
|
|
|
gongLGCSJ.children.push(gongLGCHZ);
|
|
gongLGCSJ.children.push(gongLGCHZ);
|
|
|
|
|
|
|
|
- const gongCXX = new GongCXX(CRCvals);
|
|
|
|
|
|
|
+ const md5Str = await md5(CRCvals.join(''));
|
|
|
|
|
+ const gongCXX = new GongCXX(md5Str);
|
|
|
rootNode.children = [gongCXX, zhaoTBXX, gongLGCSJ];
|
|
rootNode.children = [gongCXX, zhaoTBXX, gongLGCSJ];
|
|
|
|
|
|
|
|
const suffix = INTERFACE_CONFIG[areaKey]['fileSuffix'][exportKind];
|
|
const suffix = INTERFACE_CONFIG[areaKey]['fileSuffix'][exportKind];
|
|
@@ -801,13 +802,15 @@ INTERFACE_EXPORT = (() => {
|
|
|
}];
|
|
}];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- return setupConstruction(projectData);
|
|
|
|
|
|
|
+ return await setupConstruction(projectData);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
async function md5(message) {
|
|
async function md5(message) {
|
|
|
const msgUint8 = new TextEncoder().encode(message); // 将字符串转换为UTF-8编码的字节
|
|
const msgUint8 = new TextEncoder().encode(message); // 将字符串转换为UTF-8编码的字节
|
|
|
- const hashBuffer = await crypto.subtle.digest('MD5', msgUint8); // 计算MD5哈希
|
|
|
|
|
|
|
+ // const hashBuffer = await crypto.subtle.digest('MD5', msgUint8); // 计算MD5哈希
|
|
|
|
|
+ const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8); // 计算MD5哈希
|
|
|
|
|
+ // const hashBuffer = await crypto.subtle.digest('md5', msgUint8); // 计算MD5哈希
|
|
|
const hashArray = Array.from(new Uint8Array(hashBuffer)); // 转换成数组
|
|
const hashArray = Array.from(new Uint8Array(hashBuffer)); // 转换成数组
|
|
|
const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join(''); // 转换成16进制字符串
|
|
const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join(''); // 转换成16进制字符串
|
|
|
return hashHex;
|
|
return hashHex;
|