【泛微流程接口】代码优化-增加时间判空

This commit is contained in:
tanfengling@x-ri.com 2025-10-30 16:02:33 +08:00
parent eccdb9b4ea
commit 3f53315824
1 changed files with 61 additions and 15 deletions

View File

@ -332,8 +332,11 @@ public class FWImpl {
if(payname != null){ if(payname != null){
kxmc = payname.getString("name"); kxmc = payname.getString("name");
} }
String fkrq = null;
Date paydate = payEntry.getDate("paydate");//fkrq Date paydate = payEntry.getDate("paydate");//fkrq
String fkrq = sdf.format(paydate); if(paydate != null){
fkrq = sdf.format(paydate);
}
BigDecimal fkbl = payEntry.getBigDecimal("payrate");//fkbl BigDecimal fkbl = payEntry.getBigDecimal("payrate");//fkbl
BigDecimal fkje = payEntry.getBigDecimal("payamount");//fkje BigDecimal fkje = payEntry.getBigDecimal("payamount");//fkje
boolean sfyf = payEntry.getBoolean("isprepay");//fkje boolean sfyf = payEntry.getBoolean("isprepay");//fkje
@ -938,10 +941,16 @@ public class FWImpl {
BigDecimal sl = billentry.getBigDecimal("qty"); BigDecimal sl = billentry.getBigDecimal("qty");
BigDecimal bhsdj = billentry.getBigDecimal("qty"); BigDecimal bhsdj = billentry.getBigDecimal("qty");
BigDecimal je = billentry.getBigDecimal("amount"); BigDecimal je = billentry.getBigDecimal("amount");
String scrq = null;
Date producedate = billentry.getDate("producedate"); Date producedate = billentry.getDate("producedate");
String scrq = sdf.format(producedate); if(producedate != null){
scrq = sdf.format(producedate);
}
String yxjzsj = null;
Date expirydate = billentry.getDate("expirydate"); Date expirydate = billentry.getDate("expirydate");
String yxjzsj = sdf.format(expirydate); if(expirydate != null){
yxjzsj = sdf.format(expirydate);
}
String drph = null; String drph = null;
DynamicObject lot = billentry.getDynamicObject("lot"); DynamicObject lot = billentry.getDynamicObject("lot");
if(lot != null){ if(lot != null){
@ -1213,8 +1222,11 @@ public class FWImpl {
String number = tqq9_dept.getString("number"); String number = tqq9_dept.getString("number");
cjbm = FWUtils.getFwOrgNumberByKdOrgNumber(number); cjbm = FWUtils.getFwOrgNumberByKdOrgNumber(number);
} }
String cjrq = null;
Date applydate = bill.getDate("applydate"); Date applydate = bill.getDate("applydate");
String cjrq = sdf.format(applydate); if(applydate != null){
cjrq = sdf.format(applydate);
}
DynamicObject settleorg = bill.getDynamicObject("settleorg"); DynamicObject settleorg = bill.getDynamicObject("settleorg");
String orgNumber = settleorg.getString("number"); String orgNumber = settleorg.getString("number");
String ywgz = FWUtils.getFwOrgNumberByKdOrgNumber(orgNumber); String ywgz = FWUtils.getFwOrgNumberByKdOrgNumber(orgNumber);
@ -1514,8 +1526,11 @@ public class FWImpl {
String number = tqq9_dept.getString("number"); String number = tqq9_dept.getString("number");
cjbm = FWUtils.getFwOrgNumberByKdOrgNumber(number); cjbm = FWUtils.getFwOrgNumberByKdOrgNumber(number);
} }
String cjrq = null;
Date changebizdate = bill.getDate("changebizdate"); Date changebizdate = bill.getDate("changebizdate");
String cjrq = sdf.format(changebizdate); if(changebizdate != null){
cjrq = sdf.format(changebizdate);
}
DynamicObject org = bill.getDynamicObject("org"); DynamicObject org = bill.getDynamicObject("org");
String orgnumber = org.getString("number"); String orgnumber = org.getString("number");
String ywgz = FWUtils.getFwOrgNumberByKdOrgNumber(orgnumber); String ywgz = FWUtils.getFwOrgNumberByKdOrgNumber(orgnumber);
@ -1525,8 +1540,11 @@ public class FWImpl {
if("CGT001".equals(tqq9_cgyt)){ if("CGT001".equals(tqq9_cgyt)){
cgyt = 1; cgyt = 1;
} }
String yjfhsj = null;
Date tqq9_datefield = bill.getDate("tqq9_datefield"); Date tqq9_datefield = bill.getDate("tqq9_datefield");
String yjfhsj = sdf.format(tqq9_datefield); if(tqq9_datefield != null){
yjfhsj = sdf.format(tqq9_datefield);
}
int fktj = 0; int fktj = 0;
DynamicObject paycondition = bill.getDynamicObject("paycondition"); DynamicObject paycondition = bill.getDynamicObject("paycondition");
if(paycondition != null){ if(paycondition != null){
@ -2171,10 +2189,16 @@ public class FWImpl {
}else if ("C".equals(bizmode)){ }else if ("C".equals(bizmode)){
ywms = 2; ywms = 2;
} }
String htksrq = null;
Date biztimebegin = bill.getDate("biztimebegin"); Date biztimebegin = bill.getDate("biztimebegin");
String htksrq = sdf.format(biztimebegin); if(biztimebegin != null){
htksrq = sdf.format(biztimebegin);
}
String htjsrq = null;
Date biztimeend = bill.getDate("biztimeend"); Date biztimeend = bill.getDate("biztimeend");
String htjsrq = sdf.format(biztimeend); if(biztimeend != null){
htjsrq = sdf.format(biztimeend);
}
int htzt = 0; int htzt = 0;
DynamicObject contparties = bill.getDynamicObject("contparties"); DynamicObject contparties = bill.getDynamicObject("contparties");
String contpartiesNumber = contparties.getString("number"); String contpartiesNumber = contparties.getString("number");
@ -2239,10 +2263,16 @@ public class FWImpl {
if("1".equals(tqq9_rulestype)){ if("1".equals(tqq9_rulestype)){
gzlx = 1; gzlx = 1;
} }
String flkssj = null;
Date tqq9_startdate = rule.getDate("tqq9_startdate"); Date tqq9_startdate = rule.getDate("tqq9_startdate");
String flkssj = sdf.format(tqq9_startdate); if(tqq9_startdate != null){
flkssj = sdf.format(tqq9_startdate);
}
String fljssj = null;
Date tqq9_enddate = rule.getDate("tqq9_enddate"); Date tqq9_enddate = rule.getDate("tqq9_enddate");
String fljssj = sdf.format(tqq9_enddate); if(tqq9_enddate != null){
fljssj = sdf.format(tqq9_enddate);
}
BigDecimal ygbl = rule.getBigDecimal("tqq9_estimatepro"); BigDecimal ygbl = rule.getBigDecimal("tqq9_estimatepro");
BigDecimal mbcgje = rule.getBigDecimal("tqq9_targetamount"); BigDecimal mbcgje = rule.getBigDecimal("tqq9_targetamount");
String flpp = ""; String flpp = "";
@ -2616,10 +2646,16 @@ public class FWImpl {
}else if ("C".equals(bizmode)){ }else if ("C".equals(bizmode)){
ywms = 2; ywms = 2;
} }
String htksrq = null;
Date biztimebegin = bill.getDate("biztimebegin"); Date biztimebegin = bill.getDate("biztimebegin");
String htksrq = sdf.format(biztimebegin); if(biztimebegin != null){
htksrq = sdf.format(biztimebegin);
}
String htjsrq = null;
Date biztimeend = bill.getDate("biztimeend"); Date biztimeend = bill.getDate("biztimeend");
String htjsrq = sdf.format(biztimeend); if(biztimeend != null){
htjsrq = sdf.format(biztimeend);
}
int htzt = 0; int htzt = 0;
DynamicObject contparties = bill.getDynamicObject("contparties"); DynamicObject contparties = bill.getDynamicObject("contparties");
String contpartiesNumber = contparties.getString("number"); String contpartiesNumber = contparties.getString("number");
@ -2684,10 +2720,16 @@ public class FWImpl {
if("1".equals(tqq9_rulestype)){ if("1".equals(tqq9_rulestype)){
gzlx = 1; gzlx = 1;
} }
String flkssj = null;
Date tqq9_startdate = rule.getDate("tqq9_startdate"); Date tqq9_startdate = rule.getDate("tqq9_startdate");
String flkssj = sdf.format(tqq9_startdate); if(tqq9_startdate != null){
flkssj = sdf.format(tqq9_startdate);
}
String fljssj = null;
Date tqq9_enddate = rule.getDate("tqq9_enddate"); Date tqq9_enddate = rule.getDate("tqq9_enddate");
String fljssj = sdf.format(tqq9_enddate); if(tqq9_enddate != null){
fljssj = sdf.format(tqq9_enddate);
}
BigDecimal ygbl = rule.getBigDecimal("tqq9_estimatepro"); BigDecimal ygbl = rule.getBigDecimal("tqq9_estimatepro");
BigDecimal mbcgje = rule.getBigDecimal("tqq9_targetamount"); BigDecimal mbcgje = rule.getBigDecimal("tqq9_targetamount");
String flpp = ""; String flpp = "";
@ -3742,8 +3784,12 @@ public class FWImpl {
//批号 //批号
String ph = entry.getString("lotnumber"); String ph = entry.getString("lotnumber");
//生产日期 //生产日期
String scrq = null;
Date producedate = entry.getDate("producedate"); Date producedate = entry.getDate("producedate");
String scrq = sdf.format(producedate); if(producedate != null){
scrq = sdf.format(producedate);
}
//短缺数量 //短缺数量
BigDecimal dqsl = entry.getBigDecimal("qty"); BigDecimal dqsl = entry.getBigDecimal("qty");
//短缺承担方 //短缺承担方