2025-12-18社保分账接口更新
This commit is contained in:
@@ -12,6 +12,7 @@ import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.SuperNodeContext;
|
||||
import com.seeyon.apps.jync_file.kit.PropKit;
|
||||
import com.seeyon.apps.jync_file.util.HeaderUtil;
|
||||
import com.seeyon.apps.jync_file.util.ParamNewUtil;
|
||||
import com.seeyon.apps.jync_file.util.ParamUtil;
|
||||
import com.seeyon.apps.jync_file.util.ProtUtil;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
@@ -58,8 +59,8 @@ public class TongyongshukuanNode extends ACommonSuperNode {
|
||||
context.setNeedSave(true);
|
||||
String summaryId = formDataVo.getColSummary().getId()+"";
|
||||
try {
|
||||
ParamUtil paramUtil = new ParamUtil();
|
||||
JSONObject jsonObject = paramUtil.getTongyongshoukuanParam(formDataVo,summaryId);
|
||||
ParamNewUtil paramNewUtil = new ParamNewUtil();
|
||||
JSONObject jsonObject = paramNewUtil.getTongyongshoukuanParam(formDataVo,summaryId);
|
||||
JSONObject headerer = HeaderUtil.getHeader();
|
||||
log.info(headerer.toString());
|
||||
String url = PropKit.getProp(PropKit.GENERALBILLURL);
|
||||
|
||||
@@ -32,8 +32,10 @@ public class StrKit {
|
||||
|
||||
public static String str(Object o, boolean null2Str) {
|
||||
if(o == null && null2Str) {
|
||||
System.out.println("结果为空,转换成空字符串");
|
||||
return "";
|
||||
}
|
||||
System.out.println("结果不为空将object转换成字符串");
|
||||
return str(o);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.seeyon.apps.jync_file.kit.form;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
|
||||
import org.apache.commons.logging.Log;
|
||||
|
||||
import com.seeyon.apps.jync_file.kit.StrKit;
|
||||
@@ -48,15 +49,18 @@ public class CAP4FormKit {
|
||||
if(bean == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
FormTableBean table = bean.getFormTable();
|
||||
if(table == null) {
|
||||
return null;
|
||||
}
|
||||
FormFieldBean field = table.getFieldBeanByDisplay(disPlay);
|
||||
if(field == null) {
|
||||
System.out.println("不存在"+disPlay+"字段");
|
||||
LOGGER.info("字段不存在:" + disPlay);
|
||||
return null;
|
||||
}
|
||||
System.out.println("存在此字段,字段名称为:"+field.getName());
|
||||
return bean.getFieldValue(field.getName());
|
||||
}
|
||||
|
||||
@@ -68,6 +72,7 @@ public class CAP4FormKit {
|
||||
|
||||
public static String getFieldStrValue(FormDataBean bean, String disPlay) {
|
||||
Object value = getFieldValue(bean, disPlay);
|
||||
System.out.println("返回结果是否为空:"+value);
|
||||
return StrKit.str(value, true);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,861 @@
|
||||
package com.seeyon.apps.jync_file.util;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.ext.workflow.vo.FieldDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.ctpenumnew.manager.EnumManager;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ParamNewUtil {
|
||||
|
||||
private static final Log log = Log.get(ParamUtil.class);
|
||||
|
||||
private EnumManager enumManagerNew;
|
||||
|
||||
public void setEnumManagerNew(EnumManager enumManagerNew) {
|
||||
this.enumManagerNew = enumManagerNew;
|
||||
}
|
||||
|
||||
public EnumManager getEnumManagerNew() {
|
||||
if (enumManagerNew == null) {
|
||||
enumManagerNew = (EnumManager) AppContext.getBean("enumManagerNew");
|
||||
}
|
||||
return enumManagerNew;
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪酬分账参数封装
|
||||
* @param formDataVo
|
||||
* @param summaryId
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public JSONObject getXinChouFenZhangParam(FormDataVo formDataVo, String summaryId) throws NoSuchFieldException {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
Map<String, List<FormDataVo>> subFormMaps = formDataVo.getSubFormMap();
|
||||
List<FormDataVo> subFormMap = subFormMaps.get("分账明细表");
|
||||
List<Object> istrue = new ArrayList<Object>();
|
||||
FieldDataVo isbearidVo = formDataVo.getFieldData("支付公司是否成本承担公司");
|
||||
String isbearid = "";
|
||||
if(isbearidVo!=null){
|
||||
isbearid = isbearidVo.getDbValue().toString();
|
||||
}
|
||||
|
||||
String isbear = "";
|
||||
if("".equals(isbearid)){
|
||||
isbear = "否";
|
||||
}else {
|
||||
isbear = getEnumManagerNew().getEnumItem(Long.parseLong(isbearid)).getLabel();
|
||||
}
|
||||
for (FormDataVo subFormDataVo : subFormMap) {
|
||||
FieldDataVo bipNoVo = subFormDataVo.getFieldData("BIP单据号");
|
||||
String bipNo = "";
|
||||
if(bipNoVo!=null){
|
||||
bipNo = bipNoVo.getStringValue();
|
||||
istrue.add(bipNo);
|
||||
}
|
||||
JSONObject subjson = new JSONObject();
|
||||
FieldDataVo psndoccodeVo = subFormDataVo.getFieldData("分账收款人编码");
|
||||
String psndoccode = "";
|
||||
if(psndoccodeVo!=null){
|
||||
psndoccode = psndoccodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("psndoccode", psndoccode);
|
||||
FieldDataVo businessdateVo = formDataVo.getFieldData("单据日期");
|
||||
String businessdate = "";
|
||||
if(businessdateVo!=null){
|
||||
businessdate = businessdateVo.getStringValue();
|
||||
}
|
||||
subjson.put("businessdate", businessdate);
|
||||
JSONArray data = new JSONArray();
|
||||
JSONObject jsondata = new JSONObject();
|
||||
FieldDataVo scommentVo = formDataVo.getFieldData("摘要内容");
|
||||
String scomment = "";
|
||||
if(scommentVo!=null){
|
||||
scomment = scommentVo.getStringValue();
|
||||
}
|
||||
jsondata.put("scomment", scomment);
|
||||
FieldDataVo field0120Vo = subFormDataVo.getFieldData("摘要内容");
|
||||
String field0120 = "";
|
||||
if(field0120Vo!=null){
|
||||
field0120 = field0120Vo.getStringValue();
|
||||
}
|
||||
jsondata.put("field0120", field0120);
|
||||
FieldDataVo field0121Vo = subFormDataVo.getFieldData("分账税额");
|
||||
String field0121 = "";
|
||||
if(field0121Vo!=null){
|
||||
field0121 = field0121Vo.getStringValue();
|
||||
}
|
||||
jsondata.put("field0121", field0121);
|
||||
FieldDataVo field0119Vo = subFormDataVo.getFieldData("分账行无税金额");
|
||||
String field0119 = "";
|
||||
if(field0119Vo!=null){
|
||||
field0119 = field0119Vo.getStringValue();
|
||||
}
|
||||
jsondata.put("field0119", field0119);
|
||||
FieldDataVo moneyVo = subFormDataVo.getFieldData("分账原币金额");
|
||||
String money = "";
|
||||
if(moneyVo!=null){
|
||||
money = moneyVo.getStringValue();
|
||||
}
|
||||
jsondata.put("money", money);
|
||||
FieldDataVo jsfsVo = formDataVo.getFieldData("结算方式编号");
|
||||
String jsfs = "";
|
||||
if(jsfsVo!=null){
|
||||
jsfs = jsfsVo.getStringValue();
|
||||
}
|
||||
jsondata.put("jsfs", jsfs);
|
||||
FieldDataVo kmdlVo = formDataVo.getFieldData("科目大类编号");
|
||||
String kmdl = "";
|
||||
if(kmdlVo!=null){
|
||||
kmdl = kmdlVo.getStringValue();
|
||||
}
|
||||
jsondata.put("kmdl", kmdl);
|
||||
FieldDataVo szxmVo = formDataVo.getFieldData("收支项目编号");
|
||||
String szxm = "";
|
||||
if(szxmVo!=null){
|
||||
szxm = szxmVo.getStringValue();
|
||||
}
|
||||
jsondata.put("szxm",szxm);
|
||||
jsondata.put("fkyw", "OA");
|
||||
data.add(jsondata);
|
||||
subjson.put("data", data);
|
||||
if("是".equals(isbear)) {
|
||||
FieldDataVo orgcodeVo = subFormDataVo.getFieldData("分账组织编码");
|
||||
String orgcode = "";
|
||||
if(orgcodeVo!=null){
|
||||
orgcode = orgcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("orgcode",orgcode);
|
||||
FieldDataVo fkbankcodeVo = subFormDataVo.getFieldData("分账付款银行账号");
|
||||
String fkbankcode = "";
|
||||
if(fkbankcodeVo!=null){
|
||||
fkbankcode = fkbankcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("fkbankcode", fkbankcode);
|
||||
}else {
|
||||
FieldDataVo orgcodeVo = formDataVo.getFieldData("主表支付公司编码");
|
||||
String orgcode = "";
|
||||
if(orgcodeVo!=null){
|
||||
orgcode = orgcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("orgcode", orgcode);
|
||||
FieldDataVo fkbankcodeVo = formDataVo.getFieldData("付款银行账号");
|
||||
String fkbankcode = "";
|
||||
if(fkbankcodeVo!=null){
|
||||
fkbankcode = fkbankcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("fkbankcode",fkbankcode);
|
||||
}
|
||||
FieldDataVo skbankcodeVo = subFormDataVo.getFieldData("分账收款银行账号");
|
||||
String skbankcode = "";
|
||||
if(skbankcodeVo!=null){
|
||||
skbankcode = skbankcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("skbankcode", skbankcode);
|
||||
subjson.put("path", "/seeyon/cst/flowInfo.do?summaryId="+summaryId);
|
||||
FieldDataVo oabillcodeVo = subFormDataVo.getFieldData("分账单据流水号");
|
||||
String oabillcode = "";
|
||||
if(oabillcodeVo!=null){
|
||||
oabillcode = oabillcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("oabillcode", oabillcode);
|
||||
FieldDataVo field0006Vo = formDataVo.getFieldData("原始单据数");
|
||||
String field0006 = "";
|
||||
if(field0006Vo!=null){
|
||||
field0006 = field0006Vo.getStringValue();
|
||||
}
|
||||
subjson.put("field0006", field0006);
|
||||
FieldDataVo suppliercodeVo = subFormDataVo.getFieldData("分账收款人编码");
|
||||
String suppliercode = "";
|
||||
if(suppliercodeVo!=null){
|
||||
suppliercode = suppliercodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("suppliercode", suppliercode);
|
||||
FieldDataVo ytVo = formDataVo.getFieldData("摘要内容");
|
||||
String yt = "";
|
||||
if(ytVo!=null){
|
||||
yt = ytVo.getStringValue();
|
||||
}
|
||||
subjson.put("yt", yt);
|
||||
FieldDataVo busitypecodeIdVo = formDataVo.getFieldData("业务流程");
|
||||
String busitypecodeId = "";
|
||||
if(busitypecodeIdVo!=null){
|
||||
busitypecodeId = busitypecodeIdVo.getDbValue().toString();
|
||||
}
|
||||
String busitypecodeCode = getEnumManagerNew().getEnumItem(Long.parseLong(busitypecodeId)).getEnumItemCode();
|
||||
String busitypecode = busitypecodeCode.substring(5);
|
||||
subjson.put("busitypecode", busitypecode);
|
||||
FieldDataVo wldxidVo = subFormDataVo.getFieldData("业务流程");
|
||||
String wldxid = "";
|
||||
if(wldxidVo!=null){
|
||||
wldxid = wldxidVo.getDbValue().toString();
|
||||
}
|
||||
String wldxCode = getEnumManagerNew().getEnumItem(Long.parseLong(wldxid)).getEnumItemCode();
|
||||
String wldxvalue = wldxCode.substring(5);
|
||||
subjson.put("wldx", wldxvalue);
|
||||
subjson.put("fklx", "D3");
|
||||
jsonArray.add(subjson);
|
||||
}
|
||||
jsonObject.put("data", jsonArray);
|
||||
if(istrue.size()==subFormMap.size()) {
|
||||
jsonObject = new JSONObject();
|
||||
}
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通用分账参数封装-新
|
||||
* @param formDataVo
|
||||
* @param summaryId
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public JSONObject getTongYongFenZhangParam(FormDataVo formDataVo,String summaryId) throws NoSuchFieldException {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
Map<String, List<FormDataVo>> subFormMaps = formDataVo.getSubFormMap();
|
||||
List<FormDataVo> subFormMap = subFormMaps.get("分账明细表");
|
||||
|
||||
FieldDataVo isbearidVo = formDataVo.getFieldData("支付公司是否成本承担公司");
|
||||
String isbearid = "";
|
||||
if(isbearidVo!=null){
|
||||
isbearid = isbearidVo.getStringValue();
|
||||
}
|
||||
String isbear = "";
|
||||
if("".equals(isbearid)){
|
||||
isbear = "否";
|
||||
}else {
|
||||
isbear = getEnumManagerNew().getEnumItem(Long.parseLong(isbearid)).getLabel();
|
||||
}
|
||||
for (FormDataVo subFormDataVo : subFormMap) {
|
||||
FieldDataVo numVo = subFormDataVo.getFieldData("分账原币金额");
|
||||
String num = "";
|
||||
if(numVo!=null){
|
||||
num = numVo.getStringValue();
|
||||
}
|
||||
if("0".equals(num)) {
|
||||
FieldDataVo fieldDataVo = subFormDataVo.getFieldData("分账收款人编码");
|
||||
log.info("分账原币金额为0,跳过处理:"+ fieldDataVo.getStringValue());
|
||||
continue;
|
||||
}
|
||||
JSONObject subjson = new JSONObject();
|
||||
FieldDataVo psndoccodeVo = subFormDataVo.getFieldData("分账收款人编码");
|
||||
String psndoccode = "";
|
||||
if(psndoccodeVo!=null){
|
||||
psndoccode = psndoccodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("psndoccode", psndoccode);
|
||||
FieldDataVo businessdateVo = formDataVo.getFieldData("单据日期");
|
||||
String businessdate = "";
|
||||
if(businessdateVo!=null){
|
||||
businessdate = businessdateVo.getStringValue();
|
||||
}
|
||||
subjson.put("businessdate", businessdate);
|
||||
JSONArray data = new JSONArray();
|
||||
JSONObject jsondata = new JSONObject();
|
||||
FieldDataVo scommentVo = formDataVo.getFieldData("摘要内容");
|
||||
String scomment = "";
|
||||
if(scommentVo!=null){
|
||||
scomment = scommentVo.getStringValue();
|
||||
}
|
||||
jsondata.put("scomment", scomment);
|
||||
FieldDataVo field0120Vo = subFormDataVo.getFieldData("分账税率");
|
||||
String field0120 = "";
|
||||
if(field0120Vo!=null){
|
||||
field0120 = field0120Vo.getStringValue();
|
||||
}
|
||||
jsondata.put("field0120", field0120);
|
||||
FieldDataVo field0121Vo = subFormDataVo.getFieldData("分账税额");
|
||||
String field0121 = "";
|
||||
if(field0121Vo!=null){
|
||||
field0121 = field0121Vo.getStringValue();
|
||||
}
|
||||
jsondata.put("field0121", field0121);
|
||||
FieldDataVo field0119Vo = subFormDataVo.getFieldData("分账行无税金额");
|
||||
String field0119 = "";
|
||||
if(field0119Vo!=null){
|
||||
field0119 = field0119Vo.getStringValue();
|
||||
}
|
||||
jsondata.put("field0119", field0119);
|
||||
FieldDataVo moneyVo = subFormDataVo.getFieldData("分账原币金额");
|
||||
String money = "";
|
||||
if(moneyVo!=null){
|
||||
money = moneyVo.getStringValue();
|
||||
}
|
||||
jsondata.put("money", money);
|
||||
FieldDataVo jsfsVo = formDataVo.getFieldData("结算方式编号");
|
||||
String jsfs = "";
|
||||
if(jsfsVo!=null){
|
||||
jsfs = jsfsVo.getStringValue();
|
||||
}
|
||||
jsondata.put("jsfs",jsfs);
|
||||
FieldDataVo kmdlVo = formDataVo.getFieldData("科目大类编号");
|
||||
String kmdl = "";
|
||||
if(kmdlVo!=null){
|
||||
kmdl = kmdlVo.getStringValue();
|
||||
}
|
||||
jsondata.put("kmdl", kmdl);
|
||||
FieldDataVo szxmVo = formDataVo.getFieldData("收支项目编号");
|
||||
String szxm = "";
|
||||
if(szxmVo!=null){
|
||||
szxm = szxmVo.getStringValue();
|
||||
}
|
||||
jsondata.put("szxm", szxm);
|
||||
jsondata.put("fkyw", "OA");
|
||||
data.add(jsondata);
|
||||
subjson.put("data", data);
|
||||
if("是".equals(isbear)) {
|
||||
FieldDataVo orgcodeVo = subFormDataVo.getFieldData("分账组织编码");
|
||||
String orgcode = "";
|
||||
if(orgcodeVo!=null){
|
||||
orgcode = orgcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("orgcode",orgcode);
|
||||
FieldDataVo fkbankcodeVo = subFormDataVo.getFieldData("分账付款银行账号");
|
||||
String fkbankcode = "";
|
||||
if(fkbankcodeVo!=null){
|
||||
fkbankcode = fkbankcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("fkbankcode", fkbankcode);
|
||||
}else {
|
||||
FieldDataVo orgcodeVo = formDataVo.getFieldData("主表支付公司编码");
|
||||
String orgcode = "";
|
||||
if(orgcodeVo!=null){
|
||||
orgcode = orgcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("orgcode", orgcode);
|
||||
FieldDataVo fkbankcodeVo = formDataVo.getFieldData("付款银行账号");
|
||||
String fkbankcode = "";
|
||||
if(fkbankcodeVo!=null){
|
||||
fkbankcode = fkbankcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("fkbankcode", fkbankcode);
|
||||
}
|
||||
FieldDataVo skbankcodeVo = subFormDataVo.getFieldData("分账收款银行账号");
|
||||
String skbankcode = "";
|
||||
if(skbankcodeVo!=null){
|
||||
skbankcode = skbankcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("skbankcode", skbankcode);
|
||||
subjson.put("path", "/seeyon/cst/flowInfo.do?summaryId="+summaryId);
|
||||
FieldDataVo oabillcodeVo = subFormDataVo.getFieldData("分账单据流水号");
|
||||
String oabillcode = "";
|
||||
if(oabillcodeVo!=null){
|
||||
oabillcode = oabillcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("oabillcode", oabillcode);
|
||||
FieldDataVo field0006Vo = formDataVo.getFieldData("分账单据流水号");
|
||||
String field0006 = "";
|
||||
if(field0006Vo!=null){
|
||||
field0006 = field0006Vo.getStringValue();
|
||||
}
|
||||
subjson.put("field0006", field0006);
|
||||
FieldDataVo suppliercodeVo = subFormDataVo.getFieldData("分账单据流水号");
|
||||
String suppliercode = "";
|
||||
if(suppliercodeVo!=null){
|
||||
suppliercode = suppliercodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("suppliercode", suppliercode);
|
||||
FieldDataVo ytVo = formDataVo.getFieldData("分账单据流水号");
|
||||
String yt = "";
|
||||
if(ytVo!=null){
|
||||
yt = ytVo.getStringValue();
|
||||
}
|
||||
subjson.put("yt", yt);
|
||||
FieldDataVo busitypecodeIdVo = formDataVo.getFieldData("业务流程");
|
||||
String busitypecodeId = "";
|
||||
if(ytVo!=null){
|
||||
busitypecodeId = busitypecodeIdVo.getDbValue().toString();
|
||||
}
|
||||
String busitypecodeCode = getEnumManagerNew().getEnumItem(Long.parseLong(busitypecodeId)).getEnumItemCode();
|
||||
String busitypecode = busitypecodeCode.substring(5);
|
||||
subjson.put("busitypecode", busitypecode);
|
||||
FieldDataVo wldxidVo = subFormDataVo.getFieldData("往来对象");
|
||||
String wldxid = "";
|
||||
if(wldxidVo!=null) {
|
||||
wldxid = wldxidVo.getDbValue().toString();
|
||||
}
|
||||
String wldxCode = getEnumManagerNew().getEnumItem(Long.parseLong(wldxid)).getEnumItemCode();
|
||||
String wldxvalue = wldxCode.substring(5);
|
||||
subjson.put("wldx", wldxvalue);
|
||||
subjson.put("fklx", "D3");
|
||||
jsonArray.add(subjson);
|
||||
}
|
||||
jsonObject.put("data", jsonArray);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 社保分账参数封装
|
||||
* @param formDataVo
|
||||
* @param summaryId
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public JSONObject getSheBaoFenZhangParam( FormDataVo formDataVo,String summaryId) throws IOException, NoSuchFieldException {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
Map<String, List<FormDataVo>> subFormMaps = formDataVo.getSubFormMap();
|
||||
List<FormDataVo> subFormMap = subFormMaps.get("分账明细表");
|
||||
List<Object> istrue = new ArrayList<Object>();
|
||||
FieldDataVo isbearidVo = formDataVo.getFieldData("支付公司是否成本承担公司");
|
||||
String isbearid = "";
|
||||
if(isbearidVo!=null){
|
||||
isbearid = isbearidVo.getDbValue().toString();
|
||||
}
|
||||
String isbear = "";
|
||||
if("".equals(isbearid)){
|
||||
isbear = "否";
|
||||
}else {
|
||||
isbear = getEnumManagerNew().getEnumItem(Long.parseLong(isbearid)).getLabel();
|
||||
}
|
||||
FieldDataVo isunitidVo = formDataVo.getFieldData("是否同一收款单位");
|
||||
String isunitid = "";
|
||||
if(isunitidVo!=null){
|
||||
isunitid = isunitidVo.getDbValue().toString();
|
||||
}
|
||||
String isunit = "";
|
||||
if("".equals(isunitid)){
|
||||
isunit = "是";
|
||||
}else {
|
||||
isunit = getEnumManagerNew().getEnumItem(Long.parseLong(isunitid)).getLabel();
|
||||
}
|
||||
if("是".equals(isunit) && "否".equals(isbear)) {
|
||||
JSONObject subjson = new JSONObject();
|
||||
FieldDataVo psndoccodeVo = formDataVo.getFieldData("收款单位编码");
|
||||
String psndoccode = "";
|
||||
if(psndoccodeVo!=null){
|
||||
psndoccode = psndoccodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("psndoccode", psndoccode);
|
||||
FieldDataVo businessdateVo = formDataVo.getFieldData("单据日期");
|
||||
String businessdate = "";
|
||||
if(businessdateVo!=null){
|
||||
businessdate = businessdateVo.getStringValue();
|
||||
}
|
||||
subjson.put("businessdate", businessdate);
|
||||
JSONArray data = new JSONArray();
|
||||
JSONObject jsondata = new JSONObject();
|
||||
FieldDataVo scommentVo = formDataVo.getFieldData("摘要内容");
|
||||
String scomment = "";
|
||||
if(scommentVo!=null){
|
||||
scomment = scommentVo.getStringValue();
|
||||
}
|
||||
jsondata.put("scomment", scomment);
|
||||
jsondata.put("field0120", "0");
|
||||
jsondata.put("field0121", "0");
|
||||
FieldDataVo moneyVo = formDataVo.getFieldData("合计分账支付");
|
||||
String money = "";
|
||||
if(moneyVo!=null){
|
||||
money = moneyVo.getStringValue();
|
||||
}
|
||||
jsondata.put("money", money);
|
||||
FieldDataVo jsfsVo = formDataVo.getFieldData("结算方式编号");
|
||||
String jsfs = "";
|
||||
if(jsfsVo!=null){
|
||||
jsfs = jsfsVo.getStringValue();
|
||||
}
|
||||
jsondata.put("jsfs", jsfs);
|
||||
FieldDataVo kmdlVo = formDataVo.getFieldData("科目大类编号");
|
||||
String kmdl = "";
|
||||
if(kmdlVo!=null){
|
||||
kmdl = kmdlVo.getStringValue();
|
||||
}
|
||||
jsondata.put("kmdl", kmdl);
|
||||
FieldDataVo szxmVo = formDataVo.getFieldData("收支项目编号");
|
||||
String szxm = "";
|
||||
if(szxmVo!=null){
|
||||
szxm = szxmVo.getStringValue();
|
||||
}
|
||||
jsondata.put("szxm", szxm);
|
||||
jsondata.put("field0119","0");
|
||||
jsondata.put("fkyw", "OA");
|
||||
data.add(jsondata);
|
||||
subjson.put("data", data);
|
||||
jsondata.put("szxm", szxm);
|
||||
FieldDataVo orgcodeVo = formDataVo.getFieldData("主表支付公司编码");
|
||||
String orgcode = "";
|
||||
if(orgcodeVo!=null){
|
||||
orgcode = orgcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("orgcode", orgcode);
|
||||
FieldDataVo fkbankcodeVo = formDataVo.getFieldData("付款银行账号");
|
||||
String fkbankcode = "";
|
||||
if(fkbankcodeVo!=null){
|
||||
fkbankcode = fkbankcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("fkbankcode", fkbankcode);
|
||||
FieldDataVo skbankcodeVo = formDataVo.getFieldData("收款银行账号");
|
||||
String skbankcode = "";
|
||||
if(skbankcodeVo!=null){
|
||||
skbankcode = skbankcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("skbankcode", skbankcode);
|
||||
subjson.put("path", "/seeyon/cst/flowInfo.do?summaryId="+summaryId);
|
||||
FieldDataVo oabillcodeVo = formDataVo.getFieldData("单据流水号");
|
||||
String oabillcode = "";
|
||||
if(oabillcodeVo!=null){
|
||||
oabillcode = oabillcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("oabillcode",oabillcode);
|
||||
FieldDataVo field0006Vo = formDataVo.getFieldData("原始单据数");
|
||||
String field0006 = "";
|
||||
if(field0006Vo!=null){
|
||||
field0006 = field0006Vo.getStringValue();
|
||||
}
|
||||
subjson.put("field0006", field0006);
|
||||
FieldDataVo suppliercodeVo = formDataVo.getFieldData("收款单位编码");
|
||||
String suppliercode = "";
|
||||
if(suppliercodeVo!=null){
|
||||
suppliercode = suppliercodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("suppliercode", suppliercode);
|
||||
FieldDataVo ytVo = formDataVo.getFieldData("摘要内容");
|
||||
String yt = "";
|
||||
if(ytVo!=null){
|
||||
yt = ytVo.getStringValue();
|
||||
}
|
||||
subjson.put("yt", yt);
|
||||
|
||||
FieldDataVo wldxidVo = formDataVo.getFieldData("表头往来对象");
|
||||
String wldxid = "";
|
||||
if(wldxidVo!=null){
|
||||
wldxid = wldxidVo.getDbValue().toString();
|
||||
}
|
||||
String wldxCode = getEnumManagerNew().getEnumItem(Long.parseLong(wldxid)).getEnumItemCode();
|
||||
String wldxvalue = wldxCode.substring(5);
|
||||
subjson.put("wldx", wldxvalue);
|
||||
subjson.put("fklx", "D3");
|
||||
jsonArray.add(subjson);
|
||||
}else {
|
||||
for (FormDataVo subFormDataVo : subFormMap) {
|
||||
FieldDataVo bipNoVo = subFormDataVo.getFieldData("BIP单据号");
|
||||
if(bipNoVo!=null){
|
||||
istrue.add(bipNoVo.getStringValue());
|
||||
}
|
||||
JSONObject subjson = new JSONObject();
|
||||
if("否".equals(isunit)) {
|
||||
FieldDataVo psndoccodeVo = subFormDataVo.getFieldData("分账收款人编码");
|
||||
String psndoccode = "";
|
||||
if(psndoccodeVo!=null){
|
||||
psndoccode = psndoccodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("psndoccode", psndoccode);
|
||||
subjson.put("suppliercode", psndoccode);
|
||||
FieldDataVo skbankcodeVo = subFormDataVo.getFieldData("分账收款银行账号");
|
||||
String skbankcode = "";
|
||||
if(skbankcodeVo!=null){
|
||||
skbankcode = skbankcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("skbankcode", skbankcode);
|
||||
|
||||
}else {
|
||||
FieldDataVo psndoccodeVo = formDataVo.getFieldData("收款单位编码");
|
||||
String psndoccode = "";
|
||||
if(psndoccodeVo!=null){
|
||||
psndoccode = psndoccodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("psndoccode", psndoccode);
|
||||
subjson.put("suppliercode", psndoccode);
|
||||
FieldDataVo skbankcodeVo = formDataVo.getFieldData("收款银行账号");
|
||||
String skbankcode = "";
|
||||
if(skbankcodeVo!=null){
|
||||
skbankcode = skbankcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("skbankcode",skbankcode);
|
||||
|
||||
}
|
||||
FieldDataVo businessdateVo = formDataVo.getFieldData("单据日期");
|
||||
String businessdate = "";
|
||||
if(businessdateVo!=null){
|
||||
businessdate = businessdateVo.getStringValue();
|
||||
}
|
||||
subjson.put("businessdate", businessdate);
|
||||
JSONArray data = new JSONArray();
|
||||
JSONObject jsondata = new JSONObject();
|
||||
FieldDataVo scommentVo = formDataVo.getFieldData("摘要内容");
|
||||
String scomment = "";
|
||||
if(scommentVo!=null){
|
||||
scomment = scommentVo.getStringValue();
|
||||
}
|
||||
jsondata.put("scomment", scomment);
|
||||
FieldDataVo field0120Vo = subFormDataVo.getFieldData("分账税率");
|
||||
String field0120 = "";
|
||||
if(field0120Vo!=null){
|
||||
field0120 = field0120Vo.getStringValue();
|
||||
}
|
||||
jsondata.put("field0120",field0120);
|
||||
FieldDataVo field0121Vo = subFormDataVo.getFieldData("分账税额");
|
||||
String field0121 = "";
|
||||
if(field0121Vo!=null){
|
||||
field0121 = field0121Vo.getStringValue();
|
||||
}
|
||||
jsondata.put("field0121",field0121);
|
||||
FieldDataVo field0119Vo = subFormDataVo.getFieldData("分账行无税金额");
|
||||
String field0119 = "";
|
||||
if(field0119Vo!=null){
|
||||
field0119 = field0119Vo.getStringValue();
|
||||
}
|
||||
jsondata.put("field0119", field0119);
|
||||
FieldDataVo moneyVo = subFormDataVo.getFieldData("分账原币金额");
|
||||
String money = "";
|
||||
if(moneyVo!=null){
|
||||
money = moneyVo.getStringValue();
|
||||
}
|
||||
jsondata.put("money", money);
|
||||
FieldDataVo jsfsVo = formDataVo.getFieldData("结算方式编号");
|
||||
String jsfs = "";
|
||||
if(jsfsVo!=null){
|
||||
jsfs = jsfsVo.getStringValue();
|
||||
}
|
||||
jsondata.put("jsfs", jsfs);
|
||||
FieldDataVo kmdlVo = formDataVo.getFieldData("科目大类编号");
|
||||
String kmdl = "";
|
||||
if(kmdlVo!=null){
|
||||
kmdl = kmdlVo.getStringValue();
|
||||
}
|
||||
jsondata.put("kmdl", kmdl);
|
||||
FieldDataVo szxmVo = formDataVo.getFieldData("收支项目编号");
|
||||
String szxm = "";
|
||||
if(szxmVo!=null){
|
||||
szxm = szxmVo.getStringValue();
|
||||
}
|
||||
jsondata.put("szxm", szxm);
|
||||
jsondata.put("fkyw", "OA");
|
||||
data.add(jsondata);
|
||||
subjson.put("data", data);
|
||||
if("是".equals(isbear)) {
|
||||
FieldDataVo orgcodeVo = subFormDataVo.getFieldData("分账组织编码");
|
||||
String orgcode = "";
|
||||
if(orgcodeVo!=null){
|
||||
orgcode = orgcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("orgcode", orgcode);
|
||||
FieldDataVo fkbankcodeVo = subFormDataVo.getFieldData("分账付款银行账号");
|
||||
String fkbankcode = "";
|
||||
if(fkbankcodeVo!=null){
|
||||
fkbankcode = fkbankcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("fkbankcode", fkbankcode);
|
||||
}
|
||||
else {
|
||||
FieldDataVo orgcodeVo = formDataVo.getFieldData("主表支付公司编码");
|
||||
String orgcode = "";
|
||||
if(orgcodeVo!=null){
|
||||
orgcode = orgcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("orgcode", orgcode);
|
||||
FieldDataVo fkbankcodeVo = formDataVo.getFieldData("付款银行账号");
|
||||
String fkbankcode = "";
|
||||
if(fkbankcodeVo!=null){
|
||||
fkbankcode = fkbankcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("fkbankcode", fkbankcode);
|
||||
}
|
||||
subjson.put("path", "/seeyon/cst/flowInfo.do?summaryId="+summaryId);
|
||||
FieldDataVo oabillcodeVo = subFormDataVo.getFieldData("分账单据流水号");
|
||||
String oabillcode = "";
|
||||
if(oabillcodeVo!=null){
|
||||
oabillcode = oabillcodeVo.getStringValue();
|
||||
}
|
||||
subjson.put("oabillcode", oabillcode);
|
||||
FieldDataVo field0006Vo = formDataVo.getFieldData("原始单据数");
|
||||
String field0006 = "";
|
||||
if(field0006Vo!=null){
|
||||
field0006 = field0006Vo.getStringValue();
|
||||
}
|
||||
subjson.put("field0006", field0006);
|
||||
FieldDataVo ytVo = formDataVo.getFieldData("摘要内容");
|
||||
String yt = "";
|
||||
if(ytVo!=null){
|
||||
yt = ytVo.getStringValue();
|
||||
}
|
||||
subjson.put("yt", yt);
|
||||
//业务流程
|
||||
String wldxid = "";
|
||||
FieldDataVo wldxidVo = subFormDataVo.getFieldData("往来对象");
|
||||
if(wldxidVo!=null){
|
||||
wldxid = wldxidVo.getDbValue().toString();
|
||||
}
|
||||
String wldxCode = getEnumManagerNew().getEnumItem(Long.parseLong(wldxid)).getEnumItemCode();
|
||||
String wldxvalue = wldxCode.substring(5);
|
||||
subjson.put("wldx", wldxvalue);
|
||||
subjson.put("fklx", "D3");
|
||||
jsonArray.add(subjson);
|
||||
}
|
||||
}
|
||||
|
||||
jsonObject.put("data", jsonArray);
|
||||
if(istrue.size()==subFormMap.size()) {
|
||||
jsonObject = new JSONObject();
|
||||
}
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪酬分账终止参数
|
||||
* @param formDataVo
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public JSONObject getXinChouFenZhangStopParam(FormDataVo formDataVo) throws NoSuchFieldException {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
// System.out.println("设置终止参数");
|
||||
FieldDataVo billcodeVo = formDataVo.getFieldData("NC单据编号");
|
||||
String billcode = "";
|
||||
if(billcodeVo!=null){
|
||||
billcode = billcodeVo.getStringValue();
|
||||
}
|
||||
// String billcode = CAP4FormKit.getFieldStrValue(master, "NC单据编号");
|
||||
jsonObject.put("billcode", billcode);
|
||||
jsonObject.put("status", "0");
|
||||
log.info("终止参数:"+jsonObject);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 社保分账终止参数
|
||||
* @param formDataVo
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public JSONObject getSheBaoFenZhangStopParam( FormDataVo formDataVo) throws NoSuchFieldException {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
FieldDataVo billcodeVo = formDataVo.getFieldData("BIP单据编号");
|
||||
String billcode = "";
|
||||
if(billcodeVo!=null){
|
||||
billcode = billcodeVo.getStringValue();
|
||||
}
|
||||
jsonObject.put("compose_pk", billcode);
|
||||
jsonObject.put("status", 1);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* 薪酬分账结束参数
|
||||
* @param formDataVo
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public JSONObject getXinChouFenZhangEndParam(FormDataVo formDataVo) throws NoSuchFieldException {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
FieldDataVo billcodeVo = formDataVo.getFieldData("NC单据编号");
|
||||
String billcode = "";
|
||||
if(billcodeVo!=null){
|
||||
billcode = billcodeVo.getStringValue();
|
||||
}
|
||||
jsonObject.put("billcode", billcode);
|
||||
jsonObject.put("status", "1");
|
||||
log.info("流程结束参数:"+jsonObject);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 社保分账结束参数
|
||||
* @param formDataVo
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public JSONObject getSheBaoFenZhangEndParam(FormDataVo formDataVo) throws NoSuchFieldException {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
FieldDataVo billcodeVo = formDataVo.getFieldData("BIP单据编号");
|
||||
String billcode = "";
|
||||
if(billcodeVo!=null){
|
||||
billcode = billcodeVo.getStringValue();
|
||||
}
|
||||
jsonObject.put("compose_pk", billcode);
|
||||
jsonObject.put("status", 2);
|
||||
log.info("流程结束参数:"+jsonObject);
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通用收款参数
|
||||
* @param formDataVo
|
||||
* @return
|
||||
* @throws IOException
|
||||
*/
|
||||
public JSONObject getTongyongshoukuanParam(FormDataVo formDataVo,String summaryId) throws NoSuchFieldException {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
// jsonObject.put("oabillcode", CAP4FormKit.getFieldStrValue(master, "单据流水号"));
|
||||
jsonObject.put("oabillcode", formDataVo.getFieldData("单据流水号")!=null?formDataVo.getFieldData("单据流水号").getStringValue():"");
|
||||
jsonObject.put("path", "/seeyon/cst/flowInfo.do?summaryId="+summaryId);
|
||||
// jsonObject.put("financialOrg", CAP4FormKit.getFieldStrValue(master, "BIP公司编号"));
|
||||
jsonObject.put("financialOrg", formDataVo.getFieldData("BIP公司编号")!=null?formDataVo.getFieldData("BIP公司编号").getStringValue():"");
|
||||
// jsonObject.put("billDate", CAP4FormKit.getFieldStrValue(master, "单据日期"));
|
||||
jsonObject.put("billDate", formDataVo.getFieldData("单据日期")!=null?formDataVo.getFieldData("单据日期").getStringValue():"");
|
||||
// jsonObject.put("customer", CAP4FormKit.getFieldStrValue(master, "客商编号"));
|
||||
jsonObject.put("customer", formDataVo.getFieldData("客商编号")!=null?formDataVo.getFieldData("客商编号").getStringValue():"");
|
||||
// jsonObject.put("paymentAccount", CAP4FormKit.getFieldStrValue(master, "付款银行账号"));
|
||||
jsonObject.put("paymentAccount", formDataVo.getFieldData("付款银行账号")!=null?formDataVo.getFieldData("付款银行账号").getStringValue():"");
|
||||
// jsonObject.put("settlementMethod", CAP4FormKit.getFieldStrValue(master, "结算方式编码"));
|
||||
jsonObject.put("settlementMethod", formDataVo.getFieldData("结算方式编码")!=null?formDataVo.getFieldData("结算方式编码").getStringValue():"");
|
||||
// jsonObject.put("recAccount", CAP4FormKit.getFieldStrValue(master, "收款银行账号"));
|
||||
jsonObject.put("recAccount", formDataVo.getFieldData("收款银行账号")!=null?formDataVo.getFieldData("收款银行账号").getStringValue():"");
|
||||
// jsonObject.put("psndoc", CAP4FormKit.getFieldStrValue(master, "业务员编码"));
|
||||
jsonObject.put("psndoc", formDataVo.getFieldData("业务员编码")!=null?formDataVo.getFieldData("业务员编码").getStringValue():"");
|
||||
// String sklxId = CAP4FormKit.getFieldStrValue(master, "收款类型");
|
||||
String sklxId = formDataVo.getFieldData("收款类型")!=null?formDataVo.getFieldData("收款类型").getDbValue()+"":"";
|
||||
String sklxCode = getEnumManagerNew().getEnumItem(Long.parseLong(sklxId)).getEnumItemCode();
|
||||
jsonObject.put("sklx",sklxCode);
|
||||
// jsonObject.put("def29", CAP4FormKit.getFieldStrValue(master, "摘要"));
|
||||
jsonObject.put("def29", formDataVo.getFieldData("摘要")!=null?formDataVo.getFieldData("摘要").getStringValue():"");
|
||||
// jsonObject.put("prepay", CAP4FormKit.getFieldStrValue(master, "收款性质"));
|
||||
jsonObject.put("prepay", formDataVo.getFieldData("收款性质")!=null?formDataVo.getFieldData("收款性质").getStringValue():"");
|
||||
|
||||
//该超级节点存在多流程共用情况,通过不同变量,兼容不同表单的数据域
|
||||
String subName =formDataVo.getFieldData("明细表名称")!=null?formDataVo.getFieldData("明细表名称").getStringValue():"";
|
||||
// StringUtils.isEmpty(formDataVo.getFieldData("明细表名称")!=null?formDataVo.getFieldData("明细表名称").getStringValue():"")?"通用收费明细":CAP4FormKit.getFieldStrValue(master, "明细表名称");
|
||||
subName = StringUtils.isEmpty(subName)?"通用收费明细":subName;
|
||||
List<FormDataVo> subFormDataVos = formDataVo.getSubFormMap().get(subName);
|
||||
// List<FormDataSubBean> formDataSubBeans = CAP4FormKit.getSubBeans(master,subName);
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
for (FormDataVo subFormDataVo : subFormDataVos) {
|
||||
JSONObject items = new JSONObject();
|
||||
//该超级节点存在多流程共用情况,通过不同变量,兼容不同表单的数据域
|
||||
String skywName =formDataVo.getFieldData("明细表名称")!=null?formDataVo.getFieldData("明细表名称").getStringValue():"";
|
||||
// StringUtils.isEmpty(CAP4FormKit.getFieldStrValue(master, "收款业务类型名称"))?"收款业务类型编码":CAP4FormKit.getFieldStrValue(master, "收款业务类型名称");
|
||||
skywName = StringUtils.isEmpty(skywName)?"收款业务类型编码":skywName;
|
||||
|
||||
// items.put("skyw", CAP4FormKit.getSubFieldValue(formDataSubBean, skywName));
|
||||
items.put("skyw", subFormDataVo.getFieldData(skywName)!=null?subFormDataVo.getFieldData(skywName).getStringValue():"");
|
||||
// items.put("money", CAP4FormKit.getSubFieldValue(formDataSubBean, "本次收款金额"));
|
||||
items.put("money", subFormDataVo.getFieldData("本次收款金额")!=null?subFormDataVo.getFieldData("本次收款金额").getStringValue():"");
|
||||
// items.put("field0120", CAP4FormKit.getSubFieldValue(formDataSubBean, "税率"));
|
||||
items.put("field0120", subFormDataVo.getFieldData("税率")!=null?subFormDataVo.getFieldData("税率").getStringValue():"");
|
||||
// items.put("field0121", CAP4FormKit.getSubFieldValue(formDataSubBean, "税额"));
|
||||
items.put("field0121", subFormDataVo.getFieldData("税额")!=null?subFormDataVo.getFieldData("税额").getStringValue():"");
|
||||
// items.put("field0119", CAP4FormKit.getSubFieldValue(formDataSubBean, "无税金额"));
|
||||
items.put("field0119", subFormDataVo.getFieldData("无税金额")!=null?subFormDataVo.getFieldData("无税金额").getStringValue():"");
|
||||
// String subjectCode = CAP4FormKit.getSubFieldValue(formDataSubBean, "科目大类编码").toString();
|
||||
String subjectCode =subFormDataVo.getFieldData("科目大类编码")!=null?subFormDataVo.getFieldData("科目大类编码").getStringValue():"";
|
||||
subjectCode = subjectCode.substring(5);
|
||||
items.put("subjectCode", subjectCode);//科目大类01-应收款项,02-预收款项
|
||||
// items.put("scomment", CAP4FormKit.getSubFieldValue(formDataSubBean, "备注"));
|
||||
items.put("scomment", subFormDataVo.getFieldData("备注")!=null?subFormDataVo.getFieldData("备注").getStringValue():"");
|
||||
// items.put("szxm", CAP4FormKit.getSubFieldValue(formDataSubBean, "收支项目编码"));
|
||||
items.put("szxm",subFormDataVo.getFieldData("收支项目编码")!=null?subFormDataVo.getFieldData("收支项目编码").getStringValue():"");
|
||||
jsonArray.add(items);
|
||||
}
|
||||
jsonObject.put("items", jsonArray);
|
||||
// System.out.println("通用收款参数:"+jsonObject);
|
||||
// String str = SystemEnvironment.getApplicationFolder();
|
||||
// String date = DateUtil.format(new Date(), "yyyyMMddHHmmss");
|
||||
// FileUtils.writeStringToFile(new File(str+"/bipjson/"+date.substring(0,4)+"/"+date.substring(5,6)+"/"+date.substring(7,8)+"/TYSK_" + date + ".json"), jsonObject.toString(), "UTF-8");
|
||||
return jsonObject;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,94 @@
|
||||
package com.seeyon.apps.jync_fz.event;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.seeyon.apps.bip.constants.BipConstants;
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.workflow.constants.WorkFlowType;
|
||||
import com.seeyon.apps.common.workflow.event.ACommonWorkflowEvent;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.WorkflowEventContext;
|
||||
import com.seeyon.apps.jync_file.kit.PropKit;
|
||||
import com.seeyon.apps.jync_file.util.HeaderUtil;
|
||||
import com.seeyon.apps.jync_file.util.ParamNewUtil;
|
||||
import com.seeyon.apps.jync_file.util.ParamUtil;
|
||||
import com.seeyon.apps.jync_file.util.ProtUtil;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.constants.ApplicationCategoryEnum;
|
||||
import com.seeyon.ctp.workflow.event.AbstractWorkflowEvent;
|
||||
import com.seeyon.ctp.workflow.event.WorkflowEventData;
|
||||
import com.seeyon.ctp.workflow.event.WorkflowEventResult;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class NewSheBaoFenZhangEvent extends ACommonWorkflowEvent {
|
||||
|
||||
private static final Log log = Log.get(NewSheBaoFenZhangEvent.class);
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return "newSheBaoFenZhangEvent";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return "新OA社保分账单流程终止监听";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return BipConstants.getPluginId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFormParse() {
|
||||
return "json";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public WorkFlowType[] getTypes() {
|
||||
return new WorkFlowType[] { WorkFlowType.onBeforeStop };
|
||||
}
|
||||
|
||||
@Override
|
||||
protected WorkflowEventContext proceed(String request, FormDataVo formDataVo, WorkFlowType workFlowType, FormDataMasterBean formDataMasterBean) throws Exception {
|
||||
WorkflowEventContext context = new WorkflowEventContext();
|
||||
context.setNeedSave(true);
|
||||
System.out.println("进入终止操作");
|
||||
try {
|
||||
JSONObject headerer = HeaderUtil.getHeader();
|
||||
ParamNewUtil paramNewUtil = new ParamNewUtil();
|
||||
JSONObject jsonObject = paramNewUtil.getSheBaoFenZhangStopParam(formDataVo);
|
||||
log.info("接口终止,参数记录:"+jsonObject);
|
||||
String url = PropKit.getProp(PropKit.SBFZCANCELURL);
|
||||
context.setUrl(url);
|
||||
log.info("映射参数:"+request);
|
||||
context.setRequest(jsonObject.toString());
|
||||
JSONObject res = ProtUtil.doPost(jsonObject, url, headerer);
|
||||
context.setResponse(res.toString());
|
||||
if(res.isEmpty()) {
|
||||
context.setSuccess(false);
|
||||
context.setErrMsg("请求失败");
|
||||
return context;
|
||||
}
|
||||
String status = res.getString("status");
|
||||
if(!"1".equals(status)) {
|
||||
context.setSuccess(false);
|
||||
context.setErrMsg(res.getString("msg"));
|
||||
return context;
|
||||
}
|
||||
}catch (Exception e) {
|
||||
context.setSuccess(false);
|
||||
context.setErrMsg(e.getMessage());
|
||||
return context;
|
||||
}
|
||||
context.setSuccess(true);
|
||||
context.setErrMsg("请求成功");
|
||||
return context;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -4,9 +4,9 @@ import cn.hutool.log.Log;
|
||||
import com.seeyon.apps.bip.constants.BipConstants;
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.workflow.constants.WorkFlowType;
|
||||
import com.seeyon.apps.common.workflow.event.ACommonWorkflowEvent;
|
||||
import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.WorkflowEventContext;
|
||||
import com.seeyon.apps.jync_file.util.ParamNewUtil;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
@@ -15,25 +15,23 @@ import com.seeyon.apps.jync_file.util.HeaderUtil;
|
||||
import com.seeyon.apps.jync_file.util.ParamUtil;
|
||||
import com.seeyon.apps.jync_file.util.ProtUtil;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
import com.seeyon.ctp.common.constants.ApplicationCategoryEnum;
|
||||
import com.seeyon.ctp.workflow.event.AbstractWorkflowEvent;
|
||||
import com.seeyon.ctp.workflow.event.WorkflowEventData;
|
||||
import com.seeyon.ctp.workflow.event.WorkflowEventResult;
|
||||
|
||||
public class SheBaoFenZhangEvent extends ACommonWorkflowEvent {
|
||||
import java.util.Map;
|
||||
|
||||
//public class SheBaoFenZhangEvent extends ACommonWorkflowEvent {
|
||||
public class SheBaoFenZhangEvent extends AbstractWorkflowEvent {
|
||||
|
||||
private static final Log log = Log.get(SheBaoFenZhangEvent.class);
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
|
||||
@Override
|
||||
public String getPluginId() {
|
||||
return BipConstants.getPluginId();
|
||||
public SheBaoFenZhangEvent() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFormParse() {
|
||||
return "json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorkFlowType[] getTypes() {
|
||||
return new WorkFlowType[] { WorkFlowType.onBeforeStop };
|
||||
public ApplicationCategoryEnum getAppName() {
|
||||
return ApplicationCategoryEnum.form;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -46,40 +44,73 @@ public class SheBaoFenZhangEvent extends ACommonWorkflowEvent {
|
||||
return "OA社保分账单流程监听";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected WorkflowEventContext proceed(String request, FormDataVo formDataVo, WorkFlowType workFlowType, FormDataMasterBean formDataMasterBean) throws Exception {
|
||||
WorkflowEventContext context = new WorkflowEventContext();
|
||||
// ConfigVo configVo = cstConfigApi.getConfig(getPluginId());
|
||||
context.setNeedSave(true);
|
||||
public WorkflowEventResult onBeforeStop(WorkflowEventData data) {
|
||||
WorkflowEventResult workflowEventResult = new WorkflowEventResult();
|
||||
System.out.println("进入终止操作");
|
||||
try {
|
||||
Map<String, Object> map = data.getBusinessData();
|
||||
FormDataMasterBean master = (FormDataMasterBean)map.get("formDataBean");
|
||||
JSONObject headerer = HeaderUtil.getHeader();
|
||||
ParamUtil paramUtil = new ParamUtil();
|
||||
JSONObject jsonObject = paramUtil.getSheBaoFenZhangStopParam(formDataVo);
|
||||
log.info("接口终止,参数记录:"+jsonObject);
|
||||
String url = PropKit.getProp(PropKit.SBFZCANCELURL);
|
||||
context.setUrl(url);
|
||||
context.setRequest(jsonObject.toString());
|
||||
JSONObject res = ProtUtil.doPost(jsonObject, url, headerer);
|
||||
context.setResponse(res.toString());
|
||||
if(res.isEmpty()) {
|
||||
context.setSuccess(false);
|
||||
context.setErrMsg("请求失败");
|
||||
return context;
|
||||
}
|
||||
log.info("全量参数:"+master.getId()+master.getFieldBeanByFieldName("BIP单据编号")+master.getFormTable());
|
||||
System.out.println("直接输出field0065的数据:"+master.getFieldValue("field0065"));
|
||||
JSONObject jsonObject = paramUtil.getSheBaoFenZhangStopParam(master);
|
||||
log.info("接口终止,参数记录:" + jsonObject);
|
||||
JSONObject res = ProtUtil.doPost(jsonObject, PropKit.getProp("sbfzCancelUrl"), headerer);
|
||||
if (res.isEmpty()) {
|
||||
workflowEventResult.setAlertMessage("请求失败");
|
||||
return workflowEventResult;
|
||||
} else {
|
||||
String status = res.getString("status");
|
||||
if(!"1".equals(status)) {
|
||||
context.setSuccess(false);
|
||||
context.setErrMsg(res.getString("msg"));
|
||||
return context;
|
||||
if (!"1".equals(status)) {
|
||||
workflowEventResult.setAlertMessage(res.getString("msg"));
|
||||
return workflowEventResult;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}catch (Exception e) {
|
||||
context.setSuccess(false);
|
||||
context.setErrMsg(e.getMessage());
|
||||
return context;
|
||||
}
|
||||
context.setSuccess(true);
|
||||
context.setErrMsg("请求成功");
|
||||
return context;
|
||||
} catch (Exception var10) {
|
||||
var10.printStackTrace();
|
||||
workflowEventResult.setAlertMessage("终止异常:"+var10.getMessage());
|
||||
return workflowEventResult;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// protected WorkflowEventContext proceed(String request, FormDataVo formDataVo, WorkFlowType workFlowType, FormDataMasterBean formDataMasterBean) throws Exception {
|
||||
// WorkflowEventContext context = new WorkflowEventContext();
|
||||
//// ConfigVo configVo = cstConfigApi.getConfig(getPluginId());
|
||||
// context.setNeedSave(true);
|
||||
// System.out.println("进入终止操作");
|
||||
// try {
|
||||
// JSONObject headerer = HeaderUtil.getHeader();
|
||||
// ParamUtil paramUtil = new ParamUtil();
|
||||
// JSONObject jsonObject = paramUtil.getSheBaoFenZhangStopParam(formDataVo);
|
||||
// log.info("接口终止,参数记录:"+jsonObject);
|
||||
// String url = PropKit.getProp(PropKit.SBFZCANCELURL);
|
||||
// context.setUrl(url);
|
||||
// context.setRequest(jsonObject.toString());
|
||||
// JSONObject res = ProtUtil.doPost(jsonObject, url, headerer);
|
||||
// context.setResponse(res.toString());
|
||||
// if(res.isEmpty()) {
|
||||
// context.setSuccess(false);
|
||||
// context.setErrMsg("请求失败");
|
||||
// return context;
|
||||
// }
|
||||
// String status = res.getString("status");
|
||||
// if(!"1".equals(status)) {
|
||||
// context.setSuccess(false);
|
||||
// context.setErrMsg(res.getString("msg"));
|
||||
// return context;
|
||||
// }
|
||||
// }catch (Exception e) {
|
||||
// context.setSuccess(false);
|
||||
// context.setErrMsg(e.getMessage());
|
||||
// return context;
|
||||
// }
|
||||
// context.setSuccess(true);
|
||||
// context.setErrMsg("请求成功");
|
||||
// return context;
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.WorkflowEventContext;
|
||||
import com.seeyon.apps.jync_file.kit.PropKit;
|
||||
import com.seeyon.apps.jync_file.util.HeaderUtil;
|
||||
import com.seeyon.apps.jync_file.util.ParamNewUtil;
|
||||
import com.seeyon.apps.jync_file.util.ParamUtil;
|
||||
import com.seeyon.apps.jync_file.util.ProtUtil;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
@@ -53,8 +54,8 @@ public class XinChouFenZhangEvent extends ACommonWorkflowEvent {
|
||||
System.out.println("进入终止操作");
|
||||
try {
|
||||
JSONObject headerer = HeaderUtil.getHeader();
|
||||
ParamUtil paramUtil = new ParamUtil();
|
||||
JSONObject jsonObject = paramUtil.getXinChouFenZhangStopParam(formDataVo);
|
||||
ParamNewUtil paramNewUtil = new ParamNewUtil();
|
||||
JSONObject jsonObject = paramNewUtil.getXinChouFenZhangStopParam(formDataVo);
|
||||
log.info("接口终止,参数记录:"+jsonObject);
|
||||
String url = PropKit.getProp(PropKit.XCFZCANCELURL);
|
||||
context.setUrl(url);
|
||||
|
||||
@@ -16,19 +16,21 @@ import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.SuperNodeContext;
|
||||
import com.seeyon.apps.jync_file.kit.PropKit;
|
||||
import com.seeyon.apps.jync_file.util.HeaderUtil;
|
||||
import com.seeyon.apps.jync_file.util.ParamNewUtil;
|
||||
import com.seeyon.apps.jync_file.util.ParamUtil;
|
||||
import com.seeyon.apps.jync_file.util.ProtUtil;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.ctpenumnew.manager.EnumManager;
|
||||
|
||||
|
||||
public class SheBaoFenZhangNode extends ACommonSuperNode {
|
||||
|
||||
private static Log log = Log.get(SheBaoFenZhangNode.class);
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
@Override
|
||||
public String getNodeId() {
|
||||
return "SheBaoFenZhangNode";
|
||||
return "sheBaoFenZhangNode";
|
||||
}
|
||||
@Override
|
||||
public String getNodeName() {
|
||||
@@ -69,16 +71,16 @@ public class SheBaoFenZhangNode extends ACommonSuperNode {
|
||||
// 进入超级审核节点
|
||||
SuperNodeContext context = new SuperNodeContext();
|
||||
context.setNeedSave(true);
|
||||
System.out.println("开始处理单据SheBaoFenZhangNode");
|
||||
System.out.println("开始处理单据sheBaoFenZhangNode");
|
||||
// 封装推送接口参数调用接口
|
||||
try {
|
||||
JSONObject headerer = HeaderUtil.getHeader();
|
||||
ParamUtil paramUtil = new ParamUtil();
|
||||
ParamNewUtil paramNewUtil = new ParamNewUtil();
|
||||
ColSummary summary = formDataVo.getColSummary();
|
||||
JSONObject jsonObject = paramUtil.getSheBaoFenZhangParam(formDataVo,summary+"");
|
||||
JSONObject jsonObject = paramNewUtil.getSheBaoFenZhangParam(formDataVo,summary.getId()+"");
|
||||
context.setRequest(jsonObject.toString());
|
||||
if(jsonObject.size()==0) {
|
||||
JSONObject endJsonObject = paramUtil.getSheBaoFenZhangEndParam(formDataVo);
|
||||
JSONObject endJsonObject = paramNewUtil.getSheBaoFenZhangEndParam(formDataVo);
|
||||
context.setRequest(endJsonObject.toString());
|
||||
log.info("接口流程结束,参数记录:"+endJsonObject);
|
||||
String url = PropKit.getProp(PropKit.SBFZCANCELURL);
|
||||
@@ -96,7 +98,8 @@ public class SheBaoFenZhangNode extends ACommonSuperNode {
|
||||
context.setErrMsg("流程状态改变失败");
|
||||
}
|
||||
}
|
||||
String url = PropKit.getProp(PropKit.TRANSFORMURL);
|
||||
// String url = PropKit.getProp(PropKit.TRANSFORMURL);
|
||||
String url = PropKit.getProp(PropKit.SBFZCANCELURL);
|
||||
context.setUrl(url);
|
||||
JSONObject res = ProtUtil.doPost(jsonObject,url , headerer);
|
||||
context.setResponse(res.toString());
|
||||
@@ -123,7 +126,7 @@ public class SheBaoFenZhangNode extends ACommonSuperNode {
|
||||
if("".equals(isbearid)){
|
||||
isbear = "否";
|
||||
}else {
|
||||
isbear = getEnumManagerNew().getEnumItem(Long.parseLong(isbearid)).getLabel();
|
||||
isbear = isbearid;
|
||||
}
|
||||
FieldDataVo isunitidVo = formDataVo.getFieldData("是否同一收款单位");
|
||||
String isunitid = "";
|
||||
@@ -134,7 +137,7 @@ public class SheBaoFenZhangNode extends ACommonSuperNode {
|
||||
if("".equals(isunit)){
|
||||
isunit = "是";
|
||||
}else {
|
||||
isunit = getEnumManagerNew().getEnumItem(Long.parseLong(isunitid)).getLabel();
|
||||
isunit = isunitid;
|
||||
}
|
||||
if(!("是".equals(isunit) && "否".equals(isbear))){
|
||||
int i = 0;
|
||||
@@ -145,7 +148,7 @@ public class SheBaoFenZhangNode extends ACommonSuperNode {
|
||||
}
|
||||
}
|
||||
formDataVo.getNewFieldDataMap().put("BIP返回结果", "推送BIP成功:"+msg);
|
||||
JSONObject endJsonObject = paramUtil.getSheBaoFenZhangEndParam(formDataVo);
|
||||
JSONObject endJsonObject = paramNewUtil.getSheBaoFenZhangEndParam(formDataVo);
|
||||
log.info("接口流程结束,参数记录:"+endJsonObject);
|
||||
String endurl = PropKit.getProp(PropKit.SBFZCANCELURL);
|
||||
JSONObject EndRes = ProtUtil.doPost(endJsonObject, endurl, headerer);
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.SuperNodeContext;
|
||||
import com.seeyon.apps.jync_file.kit.PropKit;
|
||||
import com.seeyon.apps.jync_file.util.HeaderUtil;
|
||||
import com.seeyon.apps.jync_file.util.ParamUtil;
|
||||
import com.seeyon.apps.jync_file.util.ParamNewUtil;
|
||||
import com.seeyon.apps.jync_file.util.ProtUtil;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
@@ -70,9 +70,9 @@ public class TongYongFenZhangNode extends ACommonSuperNode {
|
||||
// 封装推送接口参数调用接口
|
||||
try {
|
||||
JSONObject headerer = HeaderUtil.getHeader();
|
||||
ParamUtil paramUtil = new ParamUtil();
|
||||
ParamNewUtil paramNewUtil = new ParamNewUtil();
|
||||
ColSummary colSummary = formDataVo.getColSummary();
|
||||
JSONObject jsonObject = paramUtil.getTongYongFenZhangParam(formDataVo,colSummary.getId()+"");
|
||||
JSONObject jsonObject = paramNewUtil.getTongYongFenZhangParam(formDataVo,colSummary.getId()+"");
|
||||
context.setRequest(jsonObject.toString());
|
||||
String url = PropKit.getProp(PropKit.TRANSFORMURL);
|
||||
context.setUrl(url);
|
||||
|
||||
@@ -15,7 +15,7 @@ import com.seeyon.apps.ext.workflow.vo.FormDataVo;
|
||||
import com.seeyon.apps.ext.workflow.vo.SuperNodeContext;
|
||||
import com.seeyon.apps.jync_file.kit.PropKit;
|
||||
import com.seeyon.apps.jync_file.util.HeaderUtil;
|
||||
import com.seeyon.apps.jync_file.util.ParamUtil;
|
||||
import com.seeyon.apps.jync_file.util.ParamNewUtil;
|
||||
import com.seeyon.apps.jync_file.util.ProtUtil;
|
||||
import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
@@ -59,12 +59,12 @@ public class XinChouFenZhangNode extends ACommonSuperNode {
|
||||
// 封装推送接口参数调用接口
|
||||
try {
|
||||
JSONObject headerer = HeaderUtil.getHeader();
|
||||
ParamUtil paramUtil = new ParamUtil();
|
||||
ParamNewUtil paramNewUtil = new ParamNewUtil();
|
||||
ColSummary summary = formDataVo.getColSummary();
|
||||
JSONObject jsonObject = paramUtil.getXinChouFenZhangParam(formDataVo,summary.getId()+"");
|
||||
JSONObject jsonObject = paramNewUtil.getXinChouFenZhangParam(formDataVo,summary.getId()+"");
|
||||
context.setRequest(jsonObject.toString());
|
||||
if(jsonObject.size()==0) {
|
||||
JSONObject endJsonObject = paramUtil.getXinChouFenZhangEndParam(formDataVo);
|
||||
JSONObject endJsonObject = paramNewUtil.getXinChouFenZhangEndParam(formDataVo);
|
||||
log.info("接口流程结束,参数记录:"+endJsonObject);
|
||||
JSONObject EndRes = ProtUtil.doPost(endJsonObject, PropKit.getProp(PropKit.XCFZCANCELURL), headerer);
|
||||
if(EndRes.isEmpty()) {
|
||||
@@ -101,7 +101,7 @@ public class XinChouFenZhangNode extends ACommonSuperNode {
|
||||
subFormDataVo.getNewFieldDataMap().put("BIP单据号", bipNo[1].substring(0,bipNo[1].length()-3));
|
||||
}
|
||||
formDataVo.getNewFieldDataMap().put("BIP返回结果", "推送BIP成功:"+msg);
|
||||
JSONObject endJsonObject = paramUtil.getXinChouFenZhangEndParam(formDataVo);
|
||||
JSONObject endJsonObject = paramNewUtil.getXinChouFenZhangEndParam(formDataVo);
|
||||
log.info("接口流程结束,参数记录:"+endJsonObject);
|
||||
JSONObject EndRes = ProtUtil.doPost(endJsonObject, PropKit.getProp(PropKit.XCFZCANCELURL), headerer);
|
||||
if(EndRes.isEmpty()) {
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.seeyon.apps.src_finereport;
|
||||
|
||||
import com.seeyon.apps.common.plugin.api.APluginInfoApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.src_finereport.constans.FineReportConstants;
|
||||
|
||||
|
||||
public class FineReportPluginApi extends APluginInfoApi {
|
||||
public FineReportPluginApi() {
|
||||
}
|
||||
|
||||
public String getPluginId() {
|
||||
System.out.println(FineReportConstants.getPluginId());
|
||||
return FineReportConstants.getPluginId();
|
||||
}
|
||||
|
||||
public String getCreateUser() {
|
||||
return "橙阳科技";
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return "帆软集成管理";
|
||||
}
|
||||
|
||||
public boolean syncOrg() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public ConfigVo getDefaultConfig() {
|
||||
ConfigVo configVo = new ConfigVo();
|
||||
FineReportConstants[] var2 = FineReportConstants.values();
|
||||
int var3 = var2.length;
|
||||
|
||||
for(int var4 = 0; var4 < var3; ++var4) {
|
||||
FineReportConstants value = var2[var4];
|
||||
if (value != FineReportConstants.plugin) {
|
||||
configVo.getDevParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getProdParams().put(value.name(), value.getDefaultValue());
|
||||
configVo.getParamMap().put(value.name(), value.getDescription());
|
||||
}
|
||||
}
|
||||
|
||||
return configVo;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.seeyon.apps.src_finereport.constans;
|
||||
|
||||
public enum FineReportConstants {
|
||||
|
||||
plugin("src_finereport", "插件ID"),
|
||||
fineReportUrl("/webroot/decision", "帆软单点登录地址"),
|
||||
url("https://bi.hbsxly.com", "帆软地址");
|
||||
|
||||
private String defaultValue;
|
||||
private String description;
|
||||
|
||||
private FineReportConstants(String defaultValue, String description) {
|
||||
this.defaultValue = defaultValue;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDefaultValue() {
|
||||
return this.defaultValue;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return this.description;
|
||||
}
|
||||
|
||||
public static String getPluginId() {
|
||||
return plugin.defaultValue;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.seeyon.apps.src_finereport.sso;
|
||||
|
||||
import cn.hutool.log.Log;
|
||||
import com.seeyon.apps.common.config.ICstConfigApi;
|
||||
import com.seeyon.apps.common.plugin.vo.ConfigVo;
|
||||
import com.seeyon.apps.src_finereport.constans.FineReportConstants;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.controller.BaseController;
|
||||
import com.seeyon.ctp.organization.manager.OrgManager;
|
||||
import com.seeyon.ctp.util.annotation.Inject;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public class FineReportesso extends BaseController {
|
||||
|
||||
private static Log log = Log.get(FineReportesso.class);
|
||||
|
||||
@Inject
|
||||
private ICstConfigApi cstConfigApi;
|
||||
|
||||
private OrgManager orgManager;
|
||||
public void setOrgManager(OrgManager orgManager) {this.orgManager = orgManager; }
|
||||
public OrgManager getOrgManager() {
|
||||
if (orgManager == null) {orgManager = (OrgManager) AppContext.getBean("orgManager");}return orgManager;
|
||||
}
|
||||
|
||||
public ConfigVo getFineReportConfig() {
|
||||
return cstConfigApi.getConfig(getPluginId());
|
||||
}
|
||||
|
||||
public String getPluginId() {
|
||||
return FineReportConstants.getPluginId();
|
||||
}
|
||||
|
||||
public ModelAndView index(HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
ConfigVo configVo = getFineReportConfig();
|
||||
// 获取当前请求连接中的ticket
|
||||
String ticket = request.getParameter("ticket");
|
||||
String fineReportUrl = configVo.getParamVal(FineReportConstants.fineReportUrl.name());
|
||||
System.out.println(fineReportUrl);
|
||||
String url = configVo.getParamVal(FineReportConstants.url.name());
|
||||
System.out.println(url);
|
||||
if(fineReportUrl != null && fineReportUrl.contains("?")){
|
||||
url = url+fineReportUrl+"&ticket="+ticket;
|
||||
}else{
|
||||
url = url+fineReportUrl+"?ticket="+ticket;
|
||||
}
|
||||
// 跳转前记录跳转链接到log中
|
||||
log.info(url);
|
||||
response.sendRedirect(url);
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,241 @@
|
||||
package com.seeyon.apps.src_finereport.util;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpStatus;
|
||||
import org.apache.commons.httpclient.NameValuePair;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.client.methods.HttpGet;
|
||||
import org.apache.http.client.methods.HttpPost;
|
||||
import org.apache.http.entity.StringEntity;
|
||||
import org.apache.http.impl.client.DefaultHttpClient;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
|
||||
import java.io.*;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLDecoder;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public class HttpRequestUtils {
|
||||
/**
|
||||
* post请求
|
||||
*
|
||||
* @param url
|
||||
* url地址
|
||||
* @param jsonParam
|
||||
* 参数
|
||||
* @param needResponse
|
||||
* 需要返回结果
|
||||
* @return
|
||||
*/
|
||||
public static String httpPost(String url, JSONObject jsonParam,
|
||||
boolean needResponse) {
|
||||
// post请求返回结果
|
||||
DefaultHttpClient httpClient = new DefaultHttpClient();
|
||||
String jsonResult = null;
|
||||
HttpPost method = new HttpPost(url);
|
||||
try {
|
||||
if (null != jsonParam) {
|
||||
// 解决中文乱码问题
|
||||
StringEntity entity = new StringEntity(jsonParam.toString(),
|
||||
"utf-8");
|
||||
entity.setContentEncoding("UTF-8");
|
||||
entity.setContentType("application/json");
|
||||
method.setEntity(entity);
|
||||
}
|
||||
HttpResponse result = httpClient.execute(method);
|
||||
url = URLDecoder.decode(url, "UTF-8");
|
||||
/** 请求发送成功,并得到响应 **/
|
||||
if (result.getStatusLine().getStatusCode() == 200) {
|
||||
String str = "";
|
||||
try {
|
||||
/** 读取服务器返回过来的json字符串数据 **/
|
||||
str = EntityUtils.toString(result.getEntity());
|
||||
if (!needResponse) {
|
||||
return null;
|
||||
}
|
||||
/** 把json字符串转换成json对象 **/
|
||||
jsonResult = str;
|
||||
} catch (Exception e) {
|
||||
System.out.println("post请求提交失败:" + url);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.out.println("post请求提交失败:" + url);
|
||||
}
|
||||
return jsonResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送get请求
|
||||
*
|
||||
* @param url
|
||||
* 路径
|
||||
* @return
|
||||
*/
|
||||
public static String httpGet(String url) {
|
||||
// get请求返回结果
|
||||
JSONObject jsonObject = null;
|
||||
String strResult = "";
|
||||
try {
|
||||
DefaultHttpClient client = new DefaultHttpClient();
|
||||
// 发送get请求
|
||||
HttpGet request = new HttpGet(url);
|
||||
HttpResponse response = client.execute(request);
|
||||
/** 请求发送成功,并得到响应 **/
|
||||
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
|
||||
/** 读取服务器返回过来的json字符串数据 **/
|
||||
strResult = EntityUtils.toString(response.getEntity());
|
||||
/** 把json字符串转换成json对象 **/
|
||||
url = URLDecoder.decode(url, "UTF-8");
|
||||
} else {
|
||||
System.out.println("get请求提交失败:" + url);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.out.println("get请求提交失败:" + url);
|
||||
}
|
||||
return strResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* 向指定 URL 发送POST方法的请求
|
||||
*
|
||||
* @param url
|
||||
* 发送请求的 URL
|
||||
* @param param
|
||||
* 请求参数,请求参数应该是 name1=value1&name2=value2 的形式。
|
||||
* @return 所代表远程资源的响应结果
|
||||
*/
|
||||
public static String sendPost(String url, JSONObject param) {
|
||||
PrintWriter out = null;
|
||||
BufferedReader in = null;
|
||||
String result = "";
|
||||
try {
|
||||
URL realUrl = new URL(url);
|
||||
// 打开和URL之间的连接
|
||||
URLConnection conn = realUrl.openConnection();
|
||||
// 设置通用的请求属性
|
||||
conn.setRequestProperty("accept", "*/*");
|
||||
conn.setRequestProperty("connection", "Keep-Alive");
|
||||
conn.setRequestProperty("user-agent",
|
||||
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;SV1)");
|
||||
// 发送POST请求必须设置如下两行
|
||||
conn.setDoOutput(true);
|
||||
conn.setDoInput(true);
|
||||
// 获取URLConnection对象对应的输出流
|
||||
out = new PrintWriter(conn.getOutputStream());
|
||||
StringEntity entity = new StringEntity(param.toString(), "utf-8");
|
||||
// 发送请求参数
|
||||
out.print(entity);
|
||||
// flush输出流的缓冲
|
||||
out.flush();
|
||||
// 定义BufferedReader输入流来读取URL的响应
|
||||
in = new BufferedReader(
|
||||
new InputStreamReader(conn.getInputStream()));
|
||||
String line;
|
||||
while ((line = in.readLine()) != null) {
|
||||
result += line;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println("发送 POST 请求出现异常!" + e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
// 使用finally块来关闭输出流、输入流
|
||||
finally {
|
||||
try {
|
||||
if (out != null) {
|
||||
out.close();
|
||||
}
|
||||
if (in != null) {
|
||||
in.close();
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static String doPost(String url, Map<String, String> params,
|
||||
String charset) {
|
||||
StringBuffer response = new StringBuffer();
|
||||
HttpClient client = new HttpClient();
|
||||
PostMethod method = new PostMethod(url);
|
||||
// 设置Http Post数据
|
||||
method.setRequestHeader("Content-Type",
|
||||
"application/x-www-form-urlencoded;charset=" + charset);
|
||||
if (params != null) {
|
||||
Set<String> keySet = params.keySet();
|
||||
NameValuePair[] param = new NameValuePair[keySet.size()];
|
||||
int i = 0;
|
||||
for (String key : keySet) {
|
||||
param[i] = new NameValuePair(key, params.get(key));
|
||||
i++;
|
||||
}
|
||||
method.setRequestBody(param);
|
||||
}
|
||||
InputStream responseBodyStream = null;
|
||||
InputStreamReader streamReader = null;
|
||||
BufferedReader reader = null;
|
||||
try {
|
||||
client.executeMethod(method);
|
||||
if (method.getStatusCode() == HttpStatus.SC_OK) {
|
||||
responseBodyStream = method.getResponseBodyAsStream();
|
||||
streamReader = new InputStreamReader(responseBodyStream,
|
||||
charset);
|
||||
reader = new BufferedReader(streamReader);
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
response.append(line);
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
} finally {
|
||||
try {
|
||||
responseBodyStream.close();
|
||||
streamReader.close();
|
||||
reader.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
method.releaseConnection();
|
||||
}
|
||||
return response.toString();
|
||||
}
|
||||
|
||||
public static String transport(String url, String message) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
try {
|
||||
URL urls = new URL(url);
|
||||
HttpURLConnection uc = (HttpURLConnection) urls.openConnection();
|
||||
uc.setRequestMethod("POST");
|
||||
uc.setRequestProperty("content-type",
|
||||
"application/x-www-form-urlencoded");
|
||||
uc.setRequestProperty("charset", "UTF-8");
|
||||
uc.setDoOutput(true);
|
||||
uc.setDoInput(true);
|
||||
uc.setReadTimeout(10000);
|
||||
uc.setConnectTimeout(10000);
|
||||
OutputStream os = uc.getOutputStream();
|
||||
DataOutputStream dos = new DataOutputStream(os);
|
||||
dos.write(message.getBytes("utf-8"));
|
||||
dos.flush();
|
||||
os.close();
|
||||
BufferedReader in = new BufferedReader(new InputStreamReader(
|
||||
uc.getInputStream(), "utf-8"));
|
||||
String readLine = "";
|
||||
while ((readLine = in.readLine()) != null) {
|
||||
sb.append(readLine);
|
||||
}
|
||||
in.close();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import com.seeyon.cap4.form.bean.FormDataMasterBean;
|
||||
import com.seeyon.ctp.common.AppContext;
|
||||
import com.seeyon.ctp.common.SystemEnvironment;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.NumberFormat;
|
||||
import java.text.ParseException;
|
||||
@@ -29,6 +30,10 @@ public class FileDataValidateNode extends ACommonSuperNode {
|
||||
|
||||
private static Log log = Log.get(FileDataValidateNode.class);
|
||||
|
||||
// 定义常量:保留小数位数(金额计算建议6位,最终展示2位)
|
||||
final int CALC_SCALE = 6;
|
||||
final int SHOW_SCALE = 2;
|
||||
|
||||
protected ICstConfigApi cstConfigApi = (ICstConfigApi) AppContext.getBean("cstConfigApi");
|
||||
|
||||
@Override
|
||||
@@ -76,56 +81,82 @@ public class FileDataValidateNode extends ACommonSuperNode {
|
||||
// 创建DDZXX对象
|
||||
JSONArray DDZXXS = new JSONArray();
|
||||
|
||||
// 税率判断
|
||||
// 税率判断 & 金额计算逻辑
|
||||
String taxRes = "";
|
||||
double zje = 0;
|
||||
double sj = 0;
|
||||
double bhsje = 0;
|
||||
// 初始化所有金额为 BigDecimal.ZERO,避免空指针
|
||||
BigDecimal zje = BigDecimal.ZERO;
|
||||
BigDecimal sj = BigDecimal.ZERO;
|
||||
BigDecimal bhsje = BigDecimal.ZERO;
|
||||
for(String filePath : filePaths){
|
||||
JSONArray jsonArray = fileUtil.getFileContent(filePath);
|
||||
context.setResponse(jsonArray.toString());
|
||||
log.info("处理文件:{},文件内容长度:{}", filePath, jsonArray.size());
|
||||
// System.out.println("获取附件内容"+jsonArray);
|
||||
for(int i = 0 ; i < jsonArray.size();i++){
|
||||
JSONObject fileJson = jsonArray.getJSONObject(i);
|
||||
JSONArray SPS = fileJson.getJSONArray("SPS");
|
||||
log.info(SPS.size()+"批量开票文件行数");
|
||||
log.info("当前批次开票文件行数:{}", SPS.size());
|
||||
for (int n = 0 ; n < SPS.size() ; n++){
|
||||
JSONObject SP = SPS.getJSONObject(n);
|
||||
// String SPBM = SP.getString("SPBM");
|
||||
// String XMMC = SP.getString("XMMC");
|
||||
String SL = SP.getString("SL");
|
||||
// List<String> taxRates = hxinvoiceDao.getTaxRateByTaxItemCode(SPBM);
|
||||
// if(!taxRates.contains(SL)){
|
||||
// List<String> listWithoutDuplicates = new ArrayList<>(new HashSet<>(taxRates));
|
||||
// taxRes = taxRes+SPBM+XMMC+"税率不在"+listWithoutDuplicates.toString()+"中、";
|
||||
// }
|
||||
// 获取当前金额
|
||||
String JE = SP.getString("JE");
|
||||
// 忽略千分位
|
||||
if(JE.contains(",")){
|
||||
// 1. 解析金额 JE(处理千分位、异常兜底)
|
||||
BigDecimal jeBig;
|
||||
try {
|
||||
NumberFormat format = NumberFormat.getInstance(Locale.US); // 使用美国格式(千分位是逗号)
|
||||
NumberFormat format = NumberFormat.getInstance(Locale.US);
|
||||
Number number = format.parse(JE);
|
||||
double decimalValue = number.doubleValue();
|
||||
zje = zje +decimalValue;
|
||||
jeBig = new BigDecimal(number.toString()).setScale(2, RoundingMode.HALF_UP);
|
||||
} catch (ParseException e) {
|
||||
context.back("金额填写异常,请检查金额字段是否为为数字格式");
|
||||
log.info("解析失败: " + e.getMessage());
|
||||
String errorMsg = "第" + (i+1) + "批次第" + (n+1) + "行金额解析失败:" + JE;
|
||||
log.error(errorMsg, e);
|
||||
context.back("金额填写异常,行号:" + (n+1) + ",请检查金额字段是否为数字格式");
|
||||
return context;
|
||||
}
|
||||
}else{
|
||||
// 当前金额转换成小数
|
||||
zje = zje +Double.parseDouble(JE);
|
||||
// 2. 累加总金额 zje
|
||||
zje = zje.add(jeBig);
|
||||
// 3. 解析税率 SL 并计算不含税金额 bhsje = JE/(1+SL)
|
||||
BigDecimal slBig;
|
||||
try {
|
||||
slBig = new BigDecimal(SL);
|
||||
} catch (NumberFormatException e) {
|
||||
String errorMsg = "第" + (i+1) + "批次第" + (n+1) + "行税率解析失败:" + SL;
|
||||
log.error(errorMsg, e);
|
||||
context.back("税率填写异常,行号:" + (n+1) + ",请检查税率字段是否为数字格式");
|
||||
return context;
|
||||
}
|
||||
// 计算 1+税率,避免分母为0
|
||||
BigDecimal denominator = BigDecimal.ONE.add(slBig);
|
||||
if (denominator.compareTo(BigDecimal.ZERO) == 0) {
|
||||
String errorMsg = "第" + (i+1) + "批次第" + (n+1) + "行税率异常(1+税率=0):" + SL;
|
||||
log.error(errorMsg);
|
||||
context.back("税率异常,行号:" + (n+1) + ",税率不能为-1");
|
||||
return context ;
|
||||
}
|
||||
|
||||
bhsje = bhsje + (Double.parseDouble(JE)/(1+Double.parseDouble(SL)));
|
||||
// 计算不含税金额:JE/(1+SL),指定精度和四舍五入
|
||||
BigDecimal currentBhsje = jeBig.divide(denominator, CALC_SCALE, RoundingMode.HALF_UP);
|
||||
bhsje = bhsje.add(currentBhsje);
|
||||
|
||||
// 4. 计算税金:JE - 不含税金额 (等价于 不含税金额*税率,更精准)
|
||||
BigDecimal currentSj = jeBig.subtract(currentBhsje);
|
||||
sj = sj.add(currentSj);
|
||||
|
||||
// bhsje = bhsje + (Double.parseDouble(JE)/(1+Double.parseDouble(SL)));
|
||||
// sj = sj+(Double.parseDouble(JE)*Double.parseDouble(SL));
|
||||
}
|
||||
}
|
||||
}
|
||||
// 最终结果保留2位小数(符合财务展示规范)
|
||||
BigDecimal finalZje = zje.setScale(SHOW_SCALE, RoundingMode.HALF_UP);
|
||||
BigDecimal finalBhsje = bhsje.setScale(SHOW_SCALE, RoundingMode.HALF_UP);
|
||||
BigDecimal finalSj = sj.setScale(SHOW_SCALE, RoundingMode.HALF_UP);
|
||||
|
||||
// if(taxRes.length()==0){
|
||||
formDataVo.getNewFieldDataMap().put("总金额合计", nf.format(zje));
|
||||
formDataVo.getNewFieldDataMap().put("税金合计", nf.format(zje-bhsje));
|
||||
formDataVo.getNewFieldDataMap().put("不含税金额合计", nf.format(bhsje));
|
||||
// 填充结果到表单
|
||||
formDataVo.getNewFieldDataMap().put("总金额合计", nf.format(finalZje));
|
||||
formDataVo.getNewFieldDataMap().put("税金合计", nf.format(finalSj));
|
||||
formDataVo.getNewFieldDataMap().put("不含税金额合计", nf.format(finalBhsje));
|
||||
context.success("成功", false);
|
||||
// }else{
|
||||
// taxRes = taxRes.substring(0,taxRes.length()-1)+"请重新填写";
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<plugin>
|
||||
<id>src_finereport</id>
|
||||
<name>帆软集成管理</name>
|
||||
<category>20251207</category>
|
||||
</plugin>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans default-autowire="byName">
|
||||
<bean name="/fineReportesso.do" class="com.seeyon.apps.src_finereport.sso.FineReportesso" />
|
||||
</beans>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
<beans default-autowire="byName">
|
||||
<bean id="fineReportPluginApi" class="com.seeyon.apps.src_finereport.FineReportPluginApi" />
|
||||
</beans>
|
||||
@@ -3,4 +3,5 @@
|
||||
<beans default-autowire="byName">
|
||||
<bean id="xinChouFenZhangEvent" class="com.seeyon.apps.jync_fz.event.XinChouFenZhangEvent" />
|
||||
<bean id="sheBaoFenZhangEvent" class="com.seeyon.apps.jync_fz.event.SheBaoFenZhangEvent" />
|
||||
<bean id="newSheBaoFenZhangEvent" class="com.seeyon.apps.jync_fz.event.NewSheBaoFenZhangEvent" />
|
||||
</beans>
|
||||
Reference in New Issue
Block a user