Commit 2838eb48 by lixinming

no message

parent e4a48e0c
File added
...@@ -50,7 +50,7 @@ export async function createFinancingInfo(uscc:string, param) { ...@@ -50,7 +50,7 @@ export async function createFinancingInfo(uscc:string, param) {
let dataBaseInfo = await findFinancingInfoByTaskIdAndSucc(TaskId, param.uscc); let dataBaseInfo = await findFinancingInfoByTaskIdAndSucc(TaskId, param.uscc);
if ( dataBaseInfo&& dataBaseInfo.uscc) throw new BizError(ERRORENUM.该企业当月数据已存在, `${param.uscc}的融资信息已经存在`); if ( dataBaseInfo&& dataBaseInfo.uscc) throw new BizError(ERRORENUM.该企业当月数据已存在, `${param.uscc}的融资信息已经存在`);
await createFinancing(uscc, TaskId, enterpriseInfo.uscc, enterpriseInfo.logonTime, param); await createFinancing(uscc, TaskId, enterpriseInfo.uscc, enterpriseInfo.logonTime,enterpriseInfo.industry || [], param);
return {isSuccess:true}; return {isSuccess:true};
} }
...@@ -73,7 +73,7 @@ export async function updateFinancingInfo(uscc:string, param) { ...@@ -73,7 +73,7 @@ export async function updateFinancingInfo(uscc:string, param) {
fuHuaQiInvestmentAmount:param.fuHuaQiInvestmentAmount, fuHuaQiInvestmentAmount:param.fuHuaQiInvestmentAmount,
fuHuaQiInvestmentStyle:param.fuHuaQiInvestmentStyle, fuHuaQiInvestmentStyle:param.fuHuaQiInvestmentStyle,
}; };
checkParamater(subCheckName, {fuHuaQiInvestmentAmount:"String", fuHuaQiInvestmentStyle:"String"}, subCheckData); checkParamater(subCheckName, {fuHuaQiInvestmentAmount:"Number", fuHuaQiInvestmentStyle:"Number"}, subCheckData);
} else { } else {
param.fuHuaQiInvestmentAmount = 0; param.fuHuaQiInvestmentAmount = 0;
param.fuHuaQiInvestmentStyle = 0; param.fuHuaQiInvestmentStyle = 0;
...@@ -196,8 +196,8 @@ export async function financingList(monthData:string, fuHuaQiName:string, indust ...@@ -196,8 +196,8 @@ export async function financingList(monthData:string, fuHuaQiName:string, indust
dataBaseList.forEach( info => { dataBaseList.forEach( info => {
let changeData:any = extractData(FinancingListConfig, info, true); let changeData:any = extractData(FinancingListConfig, info, true);
changeData.fuhuaqiUscc = usccMap[changeData.fuhuaqiUscc] || ""; changeData.fuhuaqiUscc = usccMap[info.fuHuaQiUscc] || "";
changeData.industry = changeEnumValue(INDUSTRY, changeData.industry); changeData.industry = changeEnumValue(INDUSTRY, info.industry);
dataList.push(changeData); dataList.push(changeData);
}); });
......
...@@ -86,7 +86,7 @@ export async function getMonthByUscc(uscc:string) { ...@@ -86,7 +86,7 @@ export async function getMonthByUscc(uscc:string) {
let dataBaseInfo = await monthData.findMonthTableByTaskId(TaskId); let dataBaseInfo = await monthData.findMonthTableByTaskId(TaskId);
if ( !dataBaseInfo.isUpdate ) throw new BizError(ERRORENUM.未找到数据, `未找到${uscc}的月度报表` ); if ( !dataBaseInfo.isUpdate ) throw new BizError(ERRORENUM.未找到数据, `未找到${uscc}的月度报表` );
let data = extractData(MonthConfig, dataBaseInfo); let data = extractData(MonthConfig, dataBaseInfo, false);
return { data }; return { data };
} }
......
...@@ -123,7 +123,7 @@ export async function logout(uscc:string):Promise<object> { ...@@ -123,7 +123,7 @@ export async function logout(uscc:string):Promise<object> {
let count = await fuhuaqiData.findFuHuaQiUserCount(selectParam); let count = await fuhuaqiData.findFuHuaQiUserCount(selectParam);
let dataList = []; let dataList = [];
dataBaseList.forEach( info => { dataBaseList.forEach( info => {
let changeData = extractData(FuHuaQiListConfig, info); let changeData = extractData(FuHuaQiListConfig, info, true);
const Count = enterpriseMap[info.uscc] || 0; const Count = enterpriseMap[info.uscc] || 0;
dataList.push(changeData); dataList.push(changeData);
}); });
......
...@@ -23,7 +23,6 @@ export async function login(loginId:string, pwd:string) { ...@@ -23,7 +23,6 @@ export async function login(loginId:string, pwd:string) {
if(!userInfo) throw new BizError(ERRORENUM.账号不存在, loginId); if(!userInfo) throw new BizError(ERRORENUM.账号不存在, loginId);
let checkPwd = getPwdMd5(userInfo.loginId, pwd); let checkPwd = getPwdMd5(userInfo.loginId, pwd);
console.log(loginId, checkPwd);//todo 后面删除
if (userInfo.pwd != checkPwd) throw new BizError(ERRORENUM.密码错误); if (userInfo.pwd != checkPwd) throw new BizError(ERRORENUM.密码错误);
const Token = getToken(loginId); const Token = getToken(loginId);
......
...@@ -85,7 +85,7 @@ export async function updateFinancingDraftLock(taskId:string) { ...@@ -85,7 +85,7 @@ export async function updateFinancingDraftLock(taskId:string) {
* @param taskId 任务id 格式遵循tool中getTaskId * @param taskId 任务id 格式遵循tool中getTaskId
* @param param 所添加表单 需要提前验证 * @param param 所添加表单 需要提前验证
*/ */
export async function createFinancing(fuHuaQiUscc:string, taskId:string, uscc:string, logonTime:number, param) { export async function createFinancing(fuHuaQiUscc:string, taskId:string, uscc:string, logonTime:number,industry, param) {
let addInfo = Object.assign({fuHuaQiUscc, taskId, uscc, logonTime, createTime:new Date().valueOf()}, param); let addInfo = Object.assign({fuHuaQiUscc, taskId, uscc, logonTime, createTime:new Date().valueOf()}, param);
if (logonTime) addInfo.logonTime = logonTime; if (logonTime) addInfo.logonTime = logonTime;
await financingModel.create(addInfo); await financingModel.create(addInfo);
......
...@@ -32,7 +32,7 @@ export function checkParamater(name:string, keyTypeConf:object, param:object, sk ...@@ -32,7 +32,7 @@ export function checkParamater(name:string, keyTypeConf:object, param:object, sk
if ( skipKeys && skipKeys.indexOf(key) > -1 && !param[key]) { if ( skipKeys && skipKeys.indexOf(key) > -1 && !param[key]) {
continue; continue;
} }
if ( !param[key] ) throw new BizError(ERRORENUM.表单校验失败, name, `缺失${key}字段`); if ( typeof param[key] != 'boolean' && !param[key] ) throw new BizError(ERRORENUM.表单校验失败, name, `缺失${key}字段`);
let type = typeof param[key]; let type = typeof param[key];
switch(keyTypeConf[key]) { switch(keyTypeConf[key]) {
case 'Number': case 'Number':
......
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