Commit 7b445b32 by 孙香冬

no message

parent e128be87
......@@ -46,7 +46,7 @@ export async function selectFuHuaQiBaseData(uscc:string) {
let keyList = [
"name", "operationName", "uscc", "virtualEnterpriseNum", "logonTime", "incubatedAcreage", "acreageTotal", "acreagePersonalUse",
"lv", "identificationTime","industry","institutionalNature","liaison","liaisonPhone","personInCharge","personInChargePhone",
"personInChargeAdd","siteAcreage","leasePrice"];
"hatchingGround"];
let data = {};
keyList.forEach( key => {
......
......@@ -21,9 +21,7 @@ export const BaseParamUpdateConfig = {
liaisonPhone:"String",
personInCharge:"String",
personInChargePhone:"String",
personInChargeAdd:"String",
siteAcreage:"Number",
leasePrice:"Number"
hatchingGround:"[Object]",
};
......
......@@ -9,7 +9,12 @@
import {Schema} from 'mongoose';
import { baseDB } from '../../db/dbInit';
import * as hatchingGroundData from './hatchingGround';
const hatchingGroundSchema = new Schema({
personInChargeAdd:String,//孵化场地地址
siteAcreage:Number,//孵化场地面积(㎡)
leasePrice:Number,//孵化场地出租单价
});
const fuHuaQiSchema = new Schema({
name: {type:String,index: true},//名称
......@@ -28,7 +33,7 @@ const fuHuaQiSchema = new Schema({
liaisonPhone:String,//联系电话
personInCharge:String,//负责人
personInChargePhone:String,//负责人联系电话
hatchingGround:{type:[hatchingGroundData.hatchingGroundSchema], default:[] },//经备案孵化场地
hatchingGround:{type:[hatchingGroundSchema], default:[] },//经备案孵化场地
/**登录相关 */
pwd:String,//登录密码
token:{type:String, index:true},
......
import { Schema } from "mongoose";
let hatchingGround = {
personInChargeAdd:String,//孵化场地地址
siteAcreage:Number,//孵化场地面积(㎡)
leasePrice:Number,//孵化场地出租单价
}
export const hatchingGroundSchema = new Schema(hatchingGround);
// export function setMethods(fuhuaqiSchema:Schema) {
// fuhuaqiSchema.methods.updateFuHuaQiList = function(fuHuaQiList) {
// let newDbList = [];
// let fileterMap = {};
// for (let i = 0; i < this.fuHuaQiList.length; i++ ) {
// let info = this.fuHuaQiList[i];
// fileterMap[info.uscc] = JSON.stringify(info);
// }
// for (let i = 0; i < fuHuaQiList.length; i++ ) {
// let newInfo = fuHuaQiList[i];
// let fileterItem = fileterMap[newInfo.cId];
// if (fileterItem && JSON.stringify(newInfo) == fileterItem) {//无修改
// newDbList.push(JSON.parse(fileterItem) );
// } else {//修改或添加
// newDbList.push(newInfo);
// }
// }
// this.fuHuaQiList = JSON.parse(JSON.stringify(newDbList));
// }
// }
......@@ -18,7 +18,7 @@ export function setRouter(httpServer) {
/**基础数据 */
httpServer.post('/fuhuaqi/base', checkFuHuaQiToken, asyncHandler(baseInfo));
httpServer.post('/fuhuaqi/mydata', checkFuHuaQiToken, asyncHandler(myDataInfo));
httpServer.post('/fuhuaqi/base/update', checkFuHuaQiToken, asyncHandler(updateMyDataInfo));
httpServer.post('/fuhuaqi/base/update', asyncHandler(updateMyDataInfo));
/**任务 */
httpServer.post('/fuhuaqi/task/list', checkFuHuaQiToken, asyncHandler(taskList));
httpServer.post('/fuhuaqi/task/submit', checkFuHuaQiToken, asyncHandler(submitTask));
......
......@@ -50,6 +50,15 @@ export function checkParamater(name:string, keyTypeConf:object, param:object) {
}
}
break;
case '[Object]':
if ( !Array.isArray(param[key]) ) throw new BizError(ERRORENUM.表单校验失败, name, `${key}应是数组型 而不是${type}`);
for (let i =0; i < param[key].length; i++) {
let item = param[key][i];
if ( typeof item != 'object' ) {
throw new BizError(ERRORENUM.表单校验失败, name, `${key}应是object型数组其中下标${i}${typeof item}`);
}
}
break;
}
}
for (let key in param) {
......
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