Commit c2ab6ae7 by 王悦

add 分页

parent b0889fc9
...@@ -19,8 +19,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -19,8 +19,8 @@ class UtilsNeedService extends AppServiceBase {
/** /**
* 提交需求 * 提交需求
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
*/ */
async submitNeed(pobj, actionBody) { async submitNeed(pobj, actionBody) {
if (!actionBody.intentionBizId) { if (!actionBody.intentionBizId) {
...@@ -75,7 +75,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -75,7 +75,7 @@ class UtilsNeedService extends AppServiceBase {
} }
var self = this; var self = this;
pobj.actionType = "receiveIcpFeedback"; pobj.actionType = "receiveIcpFeedback";
// 2020 0803 lin 修改; // 2020 0803 lin 修改;
if (pobj.intentionStatus) { if (pobj.intentionStatus) {
// 如果需求当前字段为5(已关闭)则通知fq // 如果需求当前字段为5(已关闭)则通知fq
if (pobj.intentionStatus == 5) { if (pobj.intentionStatus == 5) {
...@@ -129,7 +129,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -129,7 +129,7 @@ class UtilsNeedService extends AppServiceBase {
/** /**
* 获取需求详情 * 获取需求详情
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody needNo 需求号 * @param {*} actionBody needNo 需求号
*/ */
async getItemByNeedNo(pobj, actionBody) { async getItemByNeedNo(pobj, actionBody) {
...@@ -142,7 +142,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -142,7 +142,7 @@ class UtilsNeedService extends AppServiceBase {
} }
/** /**
* 获取需求详情 * 获取需求详情
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody needNo 需求号 * @param {*} actionBody needNo 需求号
*/ */
async getItemByChannelNeedNo(pobj, actionBody) { async getItemByChannelNeedNo(pobj, actionBody) {
...@@ -155,7 +155,7 @@ class UtilsNeedService extends AppServiceBase { ...@@ -155,7 +155,7 @@ class UtilsNeedService extends AppServiceBase {
} }
/** /**
* 获取需求详情 * 获取需求详情
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody bizId 渠道方案号 * @param {*} actionBody bizId 渠道方案号
*/ */
async getItemByChannelSolutionNo(pobj, actionBody) { async getItemByChannelSolutionNo(pobj, actionBody) {
...@@ -168,8 +168,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -168,8 +168,8 @@ class UtilsNeedService extends AppServiceBase {
} }
/** /**
* 关闭需求 * 关闭需求
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
*/ */
async needClose(pobj, actionBody) { async needClose(pobj, actionBody) {
if (!actionBody.intentionBizId) { if (!actionBody.intentionBizId) {
...@@ -187,8 +187,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -187,8 +187,8 @@ class UtilsNeedService extends AppServiceBase {
/** /**
* icp关闭需求 * icp关闭需求
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
*/ */
async needCloseIcp(pobj, actionBody) { async needCloseIcp(pobj, actionBody) {
if (!actionBody.channelNeedNo) { if (!actionBody.channelNeedNo) {
...@@ -473,8 +473,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -473,8 +473,8 @@ class UtilsNeedService extends AppServiceBase {
/** /**
* 2020 0827 lin 新增 4.1 用户在公司宝前端提交需求 * 2020 0827 lin 新增 4.1 用户在公司宝前端提交需求
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
*/ */
async submitIcpIntention(pobj, actionBody) { async submitIcpIntention(pobj, actionBody) {
// 校验文档上必填字段 // 校验文档上必填字段
...@@ -503,8 +503,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -503,8 +503,8 @@ class UtilsNeedService extends AppServiceBase {
/** /**
* 2020 0827 lin 新增 4.2 需求列表查询 * 2020 0827 lin 新增 4.2 需求列表查询
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
*/ */
async queryIntentionList(pobj, actionBody) { async queryIntentionList(pobj, actionBody) {
var aliResult = await self.aliclient.reqbyget({ action: "QueryIntentionList", reqbody: actionBody, apiVersion: "2019-05-08" }); var aliResult = await self.aliclient.reqbyget({ action: "QueryIntentionList", reqbody: actionBody, apiVersion: "2019-05-08" });
...@@ -517,8 +517,8 @@ class UtilsNeedService extends AppServiceBase { ...@@ -517,8 +517,8 @@ class UtilsNeedService extends AppServiceBase {
/** /**
* 2020 0827 lin 新增 4.3 用户需求确认 未测试 * 2020 0827 lin 新增 4.3 用户需求确认 未测试
* @param {*} pobj * @param {*} pobj
* @param {*} actionBody * @param {*} actionBody
*/ */
async confirmIcpIntention(pobj, actionBody) { async confirmIcpIntention(pobj, actionBody) {
if (!actionBody.intentionBizId) { if (!actionBody.intentionBizId) {
...@@ -540,37 +540,45 @@ class UtilsNeedService extends AppServiceBase { ...@@ -540,37 +540,45 @@ class UtilsNeedService extends AppServiceBase {
// if (!pobj.actionBody.userFeedBack) { // if (!pobj.actionBody.userFeedBack) {
// return system.getResult(null, "actionBody.userFeedBack can not be empty,100494"); // return system.getResult(null, "actionBody.userFeedBack can not be empty,100494");
// } // }
let res = await this.aliclient.reqbyget({ pobj.actionBody.data = [];
action: "QueryTradeIntentionUserList", reqbody: { await this.queryByAli(pobj,1);
Begin: pobj.actionBody.Begin ? pobj.actionBody.Begin : "", pobj.actionType = "getUnCreated";
End: pobj.actionBody.End ? pobj.actionBody.End : "", let reqUrl = this.centerOrderUrl + "action/need/springBoard";
}, apiVersion: "2019-05-08" let result = await this.restPostUrl(pobj, reqUrl);
}); if (result.status == 0) {
if (res.status == 0){ pobj.actionBody = {
pobj.actionType = "getUnCreated"; type:"tmjy"
pobj.actionBody.data = res.data.Data; };
let reqUrl = this.centerOrderUrl + "action/need/springBoard"; for (let item of result.data){
let result = await this.restPostUrl(pobj, reqUrl); pobj.actionBody.intentionBizId=item.BizId;
if (result.status == 0) { pobj.actionBody.mobile=item.Mobile?item.Mobile:"";
pobj.actionBody = { pobj.actionBody.userName=item.UserName?item.UserName:"";
type:"tmjy" pobj.notes=`${item.RegisterNumber?"RegisterNumber:"+item.RegisterNumber:""}${item.Classification?"Classification:"+item.Classification:""}`;
}; let res = await this.submitNeed(JSON.parse(JSON.stringify(pobj)),{intentionBizId:item.BizId});
for (let item of result.data){ console.log(res)
pobj.actionBody.intentionBizId=item.BizId; }
pobj.actionBody.mobile=item.Mobile?item.Mobile:""; return system.getResultSuccess();
pobj.actionBody.userName=item.UserName?item.UserName:"";
pobj.notes=`${item.RegisterNumber?"RegisterNumber:"+item.RegisterNumber:""}${item.Classification?"Classification:"+item.Classification:""}`;
let res = await this.submitNeed(JSON.parse(JSON.stringify(pobj)),{intentionBizId:item.BizId});
console.log(res)
}
return system.getResultSuccess();
}else { }else {
return system.getResultFail(result.status,result.msg); return system.getResultFail(result.status,result.msg);
} }
}
return system.getResultFail(res.status,res.msg); return system.getResultFail(res.status,res.msg);
} }
async queryByAli(pobj,page){
let res = await this.aliclient.reqbyget({
action: "QueryTradeIntentionUserList", reqbody: {
Begin: pobj.actionBody.Begin ? pobj.actionBody.Begin : "",
End: pobj.actionBody.End ? pobj.actionBody.End : "",
PageNum: page,
PageSize: 10,
}, apiVersion: "2019-05-08"
});
if (res.status == 0) {
pobj.actionBody.data.push(...res.data.Data);
if (page < res.data.TotalPageNum){
await this.queryByAli(pobj,page+1)
}
}
}
async testsymq(pobj) { async testsymq(pobj) {
var a = null; var a = null;
try { try {
......
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