【其他出入库盘盈盘亏提交泛微】增加盘盈入库,盘亏出库推送泛微
This commit is contained in:
parent
59b6e0e966
commit
e3de30c57a
|
|
@ -0,0 +1,60 @@
|
||||||
|
package tqq9.lc123.cloud.app.plugin.operate.im;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.entity.operate.result.OperationResult;
|
||||||
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||||
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
||||||
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import tqq9.lc123.cloud.app.plugin.trd.FWImpl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他入库申请单提交泛微
|
||||||
|
*/
|
||||||
|
public class OtherInApplySubmitToFwOp extends AbstractOperationServicePlugIn {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
||||||
|
super.afterExecuteOperationTransaction(e);
|
||||||
|
OperationResult operationResult = this.getOperationResult();
|
||||||
|
List<Object> successPkIds = operationResult.getSuccessPkIds();
|
||||||
|
for (Object successPkId : successPkIds) {
|
||||||
|
DynamicObject bill = BusinessDataServiceHelper.loadSingle(successPkId, "tqq9_otherinapply");
|
||||||
|
DynamicObject tqq9_biztype = bill.getDynamicObject("biztype");
|
||||||
|
if (tqq9_biztype != null) {
|
||||||
|
//调拨入库不推送泛微
|
||||||
|
String biztypenumber = tqq9_biztype.getString("number");
|
||||||
|
if ("605".equals(biztypenumber)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String resultStr = FWImpl.pushFwOtherInApply(bill);
|
||||||
|
if (StringUtils.isNotBlank(resultStr)) {
|
||||||
|
JSONObject resultObj = JSONObject.parseObject(resultStr);
|
||||||
|
String code = resultObj.getString("code");
|
||||||
|
if ("SUCCESS".equals(code)) {
|
||||||
|
JSONObject data = resultObj.getJSONObject("data");
|
||||||
|
if (data != null) {
|
||||||
|
String requestid = data.getString("requestid");
|
||||||
|
bill.set("tqq9_fwrequestid", requestid);
|
||||||
|
bill.set("tqq9_fwstate", "B");
|
||||||
|
SaveServiceHelper.save(new DynamicObject[]{bill});
|
||||||
|
}
|
||||||
|
String tqq9_fwrequestid = bill.getString("tqq9_fwrequestid");
|
||||||
|
if (StringUtils.isNotBlank(tqq9_fwrequestid)) {//驳回后提交修改泛微审批状态
|
||||||
|
bill.set("tqq9_fwstate", "B");
|
||||||
|
SaveServiceHelper.save(new DynamicObject[]{bill});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -13,7 +13,8 @@ import tqq9.lc123.cloud.app.plugin.trd.FWImpl;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 其他入库申请单提交泛微
|
* 其他入库单提交推送泛微
|
||||||
|
* 只推盘盈
|
||||||
*/
|
*/
|
||||||
public class OtherInSubmitToFwOp extends AbstractOperationServicePlugIn {
|
public class OtherInSubmitToFwOp extends AbstractOperationServicePlugIn {
|
||||||
|
|
||||||
|
|
@ -23,16 +24,16 @@ public class OtherInSubmitToFwOp extends AbstractOperationServicePlugIn {
|
||||||
OperationResult operationResult = this.getOperationResult();
|
OperationResult operationResult = this.getOperationResult();
|
||||||
List<Object> successPkIds = operationResult.getSuccessPkIds();
|
List<Object> successPkIds = operationResult.getSuccessPkIds();
|
||||||
for (Object successPkId : successPkIds) {
|
for (Object successPkId : successPkIds) {
|
||||||
DynamicObject bill = BusinessDataServiceHelper.loadSingle(successPkId, "tqq9_otherinapply");
|
DynamicObject bill = BusinessDataServiceHelper.loadSingle(successPkId, "im_otherinbill");
|
||||||
DynamicObject tqq9_biztype = bill.getDynamicObject("biztype");
|
DynamicObject tqq9_biztype = bill.getDynamicObject("biztype");
|
||||||
if (tqq9_biztype != null) {
|
if (tqq9_biztype != null) {
|
||||||
//调拨入库不推送泛微
|
//推送泛微盘盈
|
||||||
String biztypenumber = tqq9_biztype.getString("number");
|
String biztypenumber = tqq9_biztype.getString("number");
|
||||||
if ("605".equals(biztypenumber)) {
|
if (!"350".equals(biztypenumber)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String resultStr = FWImpl.pushFwOtherInApply(bill);
|
String resultStr = FWImpl.pushFwOtherIn(bill);
|
||||||
if (StringUtils.isNotBlank(resultStr)) {
|
if (StringUtils.isNotBlank(resultStr)) {
|
||||||
JSONObject resultObj = JSONObject.parseObject(resultStr);
|
JSONObject resultObj = JSONObject.parseObject(resultStr);
|
||||||
String code = resultObj.getString("code");
|
String code = resultObj.getString("code");
|
||||||
|
|
@ -52,9 +53,5 @@ public class OtherInSubmitToFwOp extends AbstractOperationServicePlugIn {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
package tqq9.lc123.cloud.app.plugin.operate.im;
|
||||||
|
|
||||||
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import kd.bos.dataentity.entity.DynamicObject;
|
||||||
|
import kd.bos.entity.operate.result.OperationResult;
|
||||||
|
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||||
|
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
||||||
|
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||||
|
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import tqq9.lc123.cloud.app.plugin.trd.FWImpl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他出库申请单提交泛微
|
||||||
|
*/
|
||||||
|
public class OtherOutApplySubmitToFwOp extends AbstractOperationServicePlugIn {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void afterExecuteOperationTransaction(AfterOperationArgs e) {
|
||||||
|
super.afterExecuteOperationTransaction(e);
|
||||||
|
OperationResult operationResult = this.getOperationResult();
|
||||||
|
List<Object> successPkIds = operationResult.getSuccessPkIds();
|
||||||
|
for (Object successPkId : successPkIds) {
|
||||||
|
DynamicObject bill = BusinessDataServiceHelper.loadSingle(successPkId, "tqq9_otheroutapply");
|
||||||
|
DynamicObject tqq9_biztype = bill.getDynamicObject("tqq9_biztype");
|
||||||
|
if(tqq9_biztype != null){
|
||||||
|
//样品 礼品 拍照 展会 四类不推泛微
|
||||||
|
String biztypenumber = tqq9_biztype.getString("number");
|
||||||
|
if("613".equals(biztypenumber) || "614".equals(biztypenumber) ||"615".equals(biztypenumber) ||"616".equals(biztypenumber)){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String resultStr = FWImpl.pushFwOtherOutApply(bill);
|
||||||
|
if(StringUtils.isNotBlank(resultStr)){
|
||||||
|
JSONObject resultObj = JSONObject.parseObject(resultStr);
|
||||||
|
String code = resultObj.getString("code");
|
||||||
|
if("SUCCESS".equals(code)){
|
||||||
|
JSONObject data = resultObj.getJSONObject("data");
|
||||||
|
if(data != null){
|
||||||
|
String requestid = data.getString("requestid");
|
||||||
|
bill.set("tqq9_fwrequestid", requestid);
|
||||||
|
bill.set("tqq9_fwstate", "B");
|
||||||
|
SaveServiceHelper.save(new DynamicObject[]{bill});
|
||||||
|
}
|
||||||
|
String tqq9_fwrequestid = bill.getString("tqq9_fwrequestid");
|
||||||
|
if (StringUtils.isNotBlank(tqq9_fwrequestid)) {//驳回后提交修改泛微审批状态
|
||||||
|
bill.set("tqq9_fwstate", "B");
|
||||||
|
SaveServiceHelper.save(new DynamicObject[]{bill});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -13,7 +13,8 @@ import tqq9.lc123.cloud.app.plugin.trd.FWImpl;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 其他出库申请单提交泛微
|
* 其他出库单推送泛微
|
||||||
|
* 只推盘亏
|
||||||
*/
|
*/
|
||||||
public class OtherOutSubmitToFwOp extends AbstractOperationServicePlugIn {
|
public class OtherOutSubmitToFwOp extends AbstractOperationServicePlugIn {
|
||||||
|
|
||||||
|
|
@ -24,16 +25,16 @@ public class OtherOutSubmitToFwOp extends AbstractOperationServicePlugIn {
|
||||||
OperationResult operationResult = this.getOperationResult();
|
OperationResult operationResult = this.getOperationResult();
|
||||||
List<Object> successPkIds = operationResult.getSuccessPkIds();
|
List<Object> successPkIds = operationResult.getSuccessPkIds();
|
||||||
for (Object successPkId : successPkIds) {
|
for (Object successPkId : successPkIds) {
|
||||||
DynamicObject bill = BusinessDataServiceHelper.loadSingle(successPkId, "tqq9_otheroutapply");
|
DynamicObject bill = BusinessDataServiceHelper.loadSingle(successPkId, "im_otheroutbill");
|
||||||
DynamicObject tqq9_biztype = bill.getDynamicObject("tqq9_biztype");
|
DynamicObject tqq9_biztype = bill.getDynamicObject("biztype");
|
||||||
if(tqq9_biztype != null){
|
if(tqq9_biztype != null){
|
||||||
//样品 礼品 拍照 展会 四类不推泛微
|
//推泛微盘亏
|
||||||
String biztypenumber = tqq9_biztype.getString("number");
|
String biztypenumber = tqq9_biztype.getString("number");
|
||||||
if("613".equals(biztypenumber) || "614".equals(biztypenumber) ||"615".equals(biztypenumber) ||"616".equals(biztypenumber)){
|
if("351".equals(biztypenumber)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
String resultStr = FWImpl.pushFwOtherOutApply(bill);
|
String resultStr = FWImpl.pushFwOtherOut(bill);
|
||||||
if(StringUtils.isNotBlank(resultStr)){
|
if(StringUtils.isNotBlank(resultStr)){
|
||||||
JSONObject resultObj = JSONObject.parseObject(resultStr);
|
JSONObject resultObj = JSONObject.parseObject(resultStr);
|
||||||
String code = resultObj.getString("code");
|
String code = resultObj.getString("code");
|
||||||
|
|
@ -54,6 +55,4 @@ public class OtherOutSubmitToFwOp extends AbstractOperationServicePlugIn {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue