Commit 3bc1054d by 孙亚楠

dd

parent d14817f3
...@@ -19,6 +19,7 @@ class ActionAPI extends APIBase { ...@@ -19,6 +19,7 @@ class ActionAPI extends APIBase {
this.oorderdeliverSve = system.getObject("service.order.oorderdeliverSve"); this.oorderdeliverSve = system.getObject("service.order.oorderdeliverSve");
this.oorderstatusSve = system.getObject("service.order.oorderstatusSve"); this.oorderstatusSve = system.getObject("service.order.oorderstatusSve");
this.oprocessSve = system.getObject("service.product.oprocessSve"); this.oprocessSve = system.getObject("service.product.oprocessSve");
this.obusinessmenDao = system.getObject("service.order.obusinessmenDao");
} }
/** /**
* 接口跳转 * 接口跳转
...@@ -67,6 +68,9 @@ class ActionAPI extends APIBase { ...@@ -67,6 +68,9 @@ class ActionAPI extends APIBase {
case "allProcess": // 查询业务进度 case "allProcess": // 查询业务进度
opResult = await this.oprocessSve.allNames(action_body); opResult = await this.oprocessSve.allNames(action_body);
break; break;
case "queryObusinessmen": //查询个体工商户信息
opResult = await this.obusinessmenDao.queryObusinessmen(action_body);
break;
//******************************************************************** */ //******************************************************************** */
......
...@@ -8,6 +8,20 @@ class ObusinessmenService extends ServiceBase { ...@@ -8,6 +8,20 @@ class ObusinessmenService extends ServiceBase {
super("order", ServiceBase.getDaoName(ObusinessmenService)); super("order", ServiceBase.getDaoName(ObusinessmenService));
} }
/**
* 根据ID查记录
* @param {*} params
* @Id 个体户ID
*/
async queryObusinessmen(params){
try {
let obj = await this.findById(this.trim(params.id));
return system.getResult(obj);
} catch (error) {
console.log(error);
return system.getResult(`系统错误 错误信息 ${error}`);
}
}
} }
......
...@@ -19,6 +19,9 @@ class OorderstatusService extends ServiceBase { ...@@ -19,6 +19,9 @@ class OorderstatusService extends ServiceBase {
this.oproductprocessDao = system.getObject("db.product.oproductprocessDao"); this.oproductprocessDao = system.getObject("db.product.oproductprocessDao");
this.BUSI_TYPE=1; //个体公商户类型 this.BUSI_TYPE=1; //个体公商户类型
this.ISBANK=true; //银行开户 this.ISBANK=true; //银行开户
this.TAXTYPE=[1,2]; //个税和增值税类别集合
this.PALTFORM_DELIVER_AUDIT_SUCCESS_CODE ="1150"; //平台交付审核成功状态码
this.PALTFORM_DELIVER_AUDIT_FILE_CODE ="1140"; //平台交付审核失败状态码
} }
/***************************************以下是订单处理的分发器***************************************************************** */ /***************************************以下是订单处理的分发器***************************************************************** */
...@@ -39,12 +42,15 @@ class OorderstatusService extends ServiceBase { ...@@ -39,12 +42,15 @@ class OorderstatusService extends ServiceBase {
} }
let _orderStatus = await this.getOrderProcessStatus(_order.id, _order.status); let _orderStatus = await this.getOrderProcessStatus(_order.id, _order.status);
let nextList = JSON.parse(_orderStatus.next_status); let nextList = JSON.parse(_orderStatus.next_status);
_orderStatus.next_status = next_status;
let flag = false; let flag = false;
let nextNames = []; let nextNames = [];
let nextName = "";
for (var nextItem of nextList) { for (var nextItem of nextList) {
nextNames.push(nextItem.next_name); nextNames.push(nextItem.next_name);
if(nextItem.next_status == params.status) { if(nextItem.next_status == params.status) {
flag = true; flag = true;
nextName = nextItem.next_name;
break; break;
} }
} }
...@@ -54,6 +60,8 @@ class OorderstatusService extends ServiceBase { ...@@ -54,6 +60,8 @@ class OorderstatusService extends ServiceBase {
} }
params._order = _order; params._order = _order;
params._orderStatus = _orderStatus;
params.nextName = nextName;
//调用对应的方法 TODO SOMETHING ..... //调用对应的方法 TODO SOMETHING .....
// 调用func // 调用func
...@@ -271,6 +279,71 @@ class OorderstatusService extends ServiceBase { ...@@ -271,6 +279,71 @@ class OorderstatusService extends ServiceBase {
} }
} }
/**
* 平台交付审核(审核成功OR失败)
* @param {*} params
*/
async platformDeliverAudit(params) {
//参数验证
if (!params.id) {
return system.getResult(null, `参数错误 订单ID不能为空`);
}
if (!params.status) {
return system.getResult(null, `参数错误 订单状态不能为空`);
}
let oorderDeliverProperty = {};
if(this.trim(params.status)==this.PALTFORM_DELIVER_AUDIT_SUCCESS_CODE){ //成功
if (!params.audit_remark) {
return system.getResult(null, `参数错误 交付审核备注不能为空`);
}
if (!params.deliver_content) {
return system.getResult(null, `参数错误 交付内容注不能为空`);
}
if (!params.deliver_mail_addr) {
return system.getResult(null, `参数错误 交付地址不能为空`);
}
if (!params.deliver_mail_to) {
return system.getResult(null, `参数错误 收件人不能为空`);
}
if (!params.deliver_mail_mobile) {
return system.getResult(null, `参数错误 联系电话不能为空`);
}
oorderDeliverProperty.audit_remark=this.trim(audit_remark);
oorderDeliverProperty.deliver_content=this.trim(deliver_content);
oorderDeliverProperty.deliver_mail_addr=this.trim(deliver_mail_addr);
oorderDeliverProperty.deliver_mail_to=this.trim(deliver_mail_to);
oorderDeliverProperty.deliver_mail_mobile=this.trim(deliver_mail_mobile);
}else if(this.trim(params.status)==this.PALTFORM_DELIVER_AUDIT_FILE_CODE){//失败
// todo somthing...
oorderDeliverProperty.audit_result=params.nextName;
if(!this.trim(params.audit_remark)){
return system.getResult(null, `参数错误 交付审核备注不能为空`);
}
oorderDeliverProperty.audit_remark=this.trim(params.audit_remark);
}else{
return system.getResult(null, `参数错误 非法的订单状态`);
}
let orderProperty = {};
orderProperty.id=params.id;
orderProperty.status = this.trim(params.status);
try {
let self = this;
await this.db.transaction(async t => {
//更新交付orderdeliver记录
await self.oorderdeliverDao.create(oorderDeliverProperty, t);
//更新oorder订单记录
await self.dao.update(orderProperty, t);
});
return system.getResultSuccess();
} catch (error) {
console.log(error);
return system.getResult(null, `系统错误 错误信息 ${error}`);
}
}
/**********************************以下是交付商订单业务处理******************************************************** */ /**********************************以下是交付商订单业务处理******************************************************** */
...@@ -633,24 +706,32 @@ class OorderstatusService extends ServiceBase { ...@@ -633,24 +706,32 @@ class OorderstatusService extends ServiceBase {
return system.getResult(null,`参数错误 状态码不能为空`); return system.getResult(null,`参数错误 状态码不能为空`);
} }
if(!params.tax_reg_day){ if(!params.common_tax_ladder){
return system.getResult(null,`参数错误 税务登记日不能为空`); return system.getResult(null,`参数错误 普票个税阶梯不能为空`);
} }
if(!params.tax_org){ if(!params.common_other_ladder){
return system.getResult(null,`参数错误 税务机构名称不能为空`); return system.getResult(null,`参数错误 普票增值税、附加税阶梯不能为空`);
} }
if(!params.ca_img){ if(!params.special_tax_ladder){
return system.getResult(null,`参数错误 CA照片不能为空`); return system.getResult(null,`参数错误 专票个税阶梯不能为空`);
} }
if(!params.tax_gov_file){ if(!params.special_other_ladder){
return system.getResult(null,`参数错误 税务报道官方文件不能为空`); return system.getResult(null,`参数错误 专票增值税、附加税阶梯不能为空`);
}
if(!params.add_value_up_type && this.TAXTYPE.indexOf(Number(params.add_value_up_type)) == -1){
return system.getResult(null,`参数错误 增值税累计类型不能为空`);
}
if(!params.tax_up_type && this.TAXTYPE.indexOf(Number(params.tax_up_type)) == -1){
return system.getResult(null,`参数错误 个税累计类型不能为空`);
} }
let _obusinessmenProperty = {}; let _obusinessmenProperty = {};
_obusinessmenProperty.tax_reg_day = this.trim(params.tax_reg_day); _obusinessmenProperty.common_tax_ladder = this.trim(params.common_tax_ladder);
_obusinessmenProperty.tax_org = this.trim(params.tax_org); _obusinessmenProperty.common_other_ladder = this.trim(params.common_other_ladder);
_obusinessmenProperty.ca_img = this.trim(params.ca_img); _obusinessmenProperty.special_tax_ladder = this.trim(params.special_tax_ladder);
_obusinessmenProperty.tax_gov_file = this.trim(params.tax_gov_file); _obusinessmenProperty.special_other_ladder = this.trim(params.special_other_ladder);
_obusinessmenProperty.add_value_up_type = this.trim(params.add_value_up_type);
_obusinessmenProperty.tax_up_type = this.trim(params.tax_up_type);
let _order = params._order; let _order = params._order;
let orderProperty = {}; let orderProperty = {};
...@@ -668,6 +749,40 @@ class OorderstatusService extends ServiceBase { ...@@ -668,6 +749,40 @@ class OorderstatusService extends ServiceBase {
} }
} }
/**
* 交付商提交审核
* @param {*} params
* @id 订单ID
* @status String 下一个订单状态
*/
async submitAudit(params){
let _order = params._order;
_order.status = this.trim(params.status);
try {
let res = await _order.save();
return system.getResult(res);
} catch (error) {
console.log(error);
return system.getResult(error);
}
}
/**
* 交付商邮寄
* @param {*} params
* @id String 订单ID
* @status String 订单状态
*/
async mailed(params){
try {
} catch (error) {
}
}
......
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