Commit 1922961f by Sxy

fix: 代码规范

parent 9cf1636a
...@@ -11,7 +11,7 @@ class OplogCtl extends CtlBase { ...@@ -11,7 +11,7 @@ class OplogCtl extends CtlBase {
async initNewInstance(qobj) { async initNewInstance(qobj) {
const u = uuidv4(); const u = uuidv4();
const aid = u.replace(/\-/g, ''); const aid = u.replace(/-/g, '');
const rd = { name: '', appid: aid }; const rd = { name: '', appid: aid };
return system.getResult(rd); return system.getResult(rd);
} }
......
...@@ -50,11 +50,9 @@ class Dao { ...@@ -50,11 +50,9 @@ class Dao {
whereParam.transaction = t; whereParam.transaction = t;
const result = await this.model.destroy(whereParam); const result = await this.model.destroy(whereParam);
return result return result
} }
const result = await this.model.destroy(whereParam); const result = await this.model.destroy(whereParam);
return result return result
} }
async delete(qobj, t) { async delete(qobj, t) {
let en = null; let en = null;
...@@ -186,7 +184,6 @@ class Dao { ...@@ -186,7 +184,6 @@ class Dao {
} }
const result = await this.model.bulkCreate(ids); const result = await this.model.bulkCreate(ids);
return result; return result;
} }
async updateByWhere(setObj, whereObj, t) { async updateByWhere(setObj, whereObj, t) {
......
...@@ -101,8 +101,8 @@ class DbFactory { ...@@ -101,8 +101,8 @@ class DbFactory {
// throw err; // throw err;
// }); // });
// 同步模型 // 同步模型
if (settings.env == 'dev') { // if (settings.env == 'dev') {
} // }
return this.db; return this.db;
} }
} }
......
...@@ -28,12 +28,12 @@ class DeliverDao extends Dao { ...@@ -28,12 +28,12 @@ class DeliverDao extends Dao {
qc.raw = true; qc.raw = true;
const type = qobj.bizpath.split('/')[1]; const type = qobj.bizpath.split('/')[1];
if (type === 'deliveryManagement') { if (type === 'deliveryManagement') {
qc.where.product_code = qc.where.product_code = (
(product_code && [system.SERVICECODE.EDI, system.SERVICECODE.ICP].includes(product_code)) (product_code && [system.SERVICECODE.EDI, system.SERVICECODE.ICP].includes(product_code))
? product_code ? product_code
: { : {
$in: [system.SERVICECODE.EDI, system.SERVICECODE.ICP], $in: [system.SERVICECODE.EDI, system.SERVICECODE.ICP],
}; });
switch (qobj.bizpath) { switch (qobj.bizpath) {
...@@ -58,12 +58,12 @@ class DeliverDao extends Dao { ...@@ -58,12 +58,12 @@ class DeliverDao extends Dao {
break; break;
} }
} else if (type === 'annualReport') { } else if (type === 'annualReport') {
qc.where.product_code = qc.where.product_code = (
(product_code && [system.SERVICECODE.ICPANNUALREPORT, system.SERVICECODE.EDIANNUALREPORT].includes(product_code)) (product_code && [system.SERVICECODE.ICPANNUALREPORT, system.SERVICECODE.EDIANNUALREPORT].includes(product_code))
? product_code ? product_code
: { : {
$in: [system.SERVICECODE.EDIANNUALREPORT, system.SERVICECODE.ICPANNUALREPORT], $in: [system.SERVICECODE.EDIANNUALREPORT, system.SERVICECODE.ICPANNUALREPORT],
}; });
// ---- 兼容 年报 状态 未申报、已申报 start // ---- 兼容 年报 状态 未申报、已申报 start
let status; let status;
......
...@@ -84,8 +84,9 @@ function buildValue(value, cryptStr) { ...@@ -84,8 +84,9 @@ function buildValue(value, cryptStr) {
})); }));
} }
if (newValue.proposerInfo.businessInformation) { if (newValue.proposerInfo.businessInformation) {
newValue.proposerInfo.businessInformation.fixedTelephone = newValue.proposerInfo.businessInformation.fixedTelephone = (
cryptStr(newValue.proposerInfo.businessInformation.fixedTelephone); cryptStr(newValue.proposerInfo.businessInformation.fixedTelephone)
);
} }
} }
if (newValue.shareholderData) { if (newValue.shareholderData) {
......
...@@ -10,7 +10,7 @@ class CachSearchesSve { ...@@ -10,7 +10,7 @@ class CachSearchesSve {
} }
getUUID() { getUUID() {
const uuid = uuidv4(); const uuid = uuidv4();
const u = uuid.replace(/\-/g, ''); const u = uuid.replace(/-/g, '');
return u; return u;
} }
async buildCacheRtn(pageValues) { async buildCacheRtn(pageValues) {
......
...@@ -22,7 +22,7 @@ class ServiceBase { ...@@ -22,7 +22,7 @@ class ServiceBase {
} }
getUUID() { getUUID() {
const uuid = uuidv4(); const uuid = uuidv4();
const u = uuid.replace(/\-/g, ''); const u = uuid.replace(/-/g, '');
return u; return u;
} }
static getDaoName(ClassObj) { static getDaoName(ClassObj) {
......
...@@ -7,7 +7,7 @@ class AuthUtils { ...@@ -7,7 +7,7 @@ class AuthUtils {
} }
getUUID() { getUUID() {
const uuid = uuidv4(); const uuid = uuidv4();
const u = uuid.replace(/\-/g, ''); const u = uuid.replace(/-/g, '');
return u; return u;
} }
/** /**
......
...@@ -23,9 +23,9 @@ class ExecClient { ...@@ -23,9 +23,9 @@ class ExecClient {
FetchPostCmd(subData, url) { FetchPostCmd(subData, url) {
const data = JSON.stringify(subData); const data = JSON.stringify(subData);
const cmd = this.cmdPostPattern.replace( const cmd = this.cmdPostPattern.replace(
/\{data\}/g, /{data}/g,
data, data,
).replace(/\{url\}/g, url); ).replace(/{url}/g, url);
console.log(cmd); console.log(cmd);
return cmd; return cmd;
} }
...@@ -43,7 +43,7 @@ class ExecClient { ...@@ -43,7 +43,7 @@ class ExecClient {
} }
FetchGetCmd(subData, url) { FetchGetCmd(subData, url) {
const cmd = this.cmdGetPattern.replace(/\{data\}/g, subData).replace(/\{url\}/g, url); const cmd = this.cmdGetPattern.replace(/{data}/g, subData).replace(/{url}/g, url);
console.log(cmd); console.log(cmd);
return cmd; return cmd;
} }
......
...@@ -5,7 +5,7 @@ const system = require('../system'); ...@@ -5,7 +5,7 @@ const system = require('../system');
class LogClient { class LogClient {
getUUID() { getUUID() {
const uuid = uuidv4(); const uuid = uuidv4();
const u = uuid.replace(/\-/g, ''); const u = uuid.replace(/-/g, '');
return u; return u;
} }
async log(pobj, req, rtninfo, errinfo) { async log(pobj, req, rtninfo, errinfo) {
...@@ -25,3 +25,4 @@ class LogClient { ...@@ -25,3 +25,4 @@ class LogClient {
} }
} }
module.exports = LogClient; module.exports = LogClient;
...@@ -14,8 +14,8 @@ class RestClient { ...@@ -14,8 +14,8 @@ class RestClient {
this.cmdPostPattern5 = 'curl -k --data \'{data}\' {url}'; this.cmdPostPattern5 = 'curl -k --data \'{data}\' {url}';
} }
FetchGetCmd(subData, url) { FetchGetCmd(subData, url) {
const cmd = this.cmdGetPattern.replace(/\{\-G\}/g, '-G').replace(/\{data\}/g, subData) const cmd = this.cmdGetPattern.replace(/{-G}/g, '-G').replace(/{data}/g, subData)
.replace(/\{url\}/g, url); .replace(/{url}/g, url);
return cmd; return cmd;
} }
FetchPostCmd(subData, url) { FetchPostCmd(subData, url) {
...@@ -52,7 +52,7 @@ class RestClient { ...@@ -52,7 +52,7 @@ class RestClient {
return cmd; return cmd;
} }
FetchGetCmd3(url) { FetchGetCmd3(url) {
const cmd = this.cmdGetPattern3.replace(/\{\-G\}/g, '-G').replace(/\{url\}/g, url); const cmd = this.cmdGetPattern3.replace(/{-G}/g, '-G').replace(/{url}/g, url);
return cmd; return cmd;
} }
FetchPostCmd4(subData, url) { FetchPostCmd4(subData, url) {
...@@ -73,7 +73,7 @@ class RestClient { ...@@ -73,7 +73,7 @@ class RestClient {
} }
FetchDownLoadCmd(outfname, url) { FetchDownLoadCmd(outfname, url) {
// console.log(this.cmdPattern); // console.log(this.cmdPattern);
const cmd = this.cmdDownLoadFilePattern.replace(/\{fileName\}/g, outfname).replace(/\{url\}/g, url); const cmd = this.cmdDownLoadFilePattern.replace(/{fileName}/g, outfname).replace(/{url}/g, url);
return cmd; return cmd;
} }
async exec(cmd) { async exec(cmd) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment