定时任务回写bip销售订单
This commit is contained in:
parent
e0732a29e5
commit
5c088e03f6
|
@ -119,7 +119,22 @@ public class ErpSaleOrderToBIPBackgroupWorkPlugin implements IBackgroundWorkPlug
|
||||||
|
|
||||||
|
|
||||||
// 获取未推送合同销售订单更新的销售发票信息;
|
// 获取未推送合同销售订单更新的销售发票信息;
|
||||||
String sql = " select so_saleinvoice_b.cfirstbid,csaleinvoicebid from so_saleinvoice,so_saleinvoice_b where so_saleinvoice.csaleinvoiceid=so_saleinvoice_b.csaleinvoiceid and so_saleinvoice.fstatusflag=2 and nvl(so_saleinvoice_b.vbdef10,'N') in ('~','N') and nvl(so_saleinvoice.vdef13,'~') not in ('~') ";
|
String sql = " select '1' as flag,so_saleinvoice_b.cfirstbid,csaleinvoicebid " +
|
||||||
|
"from so_saleinvoice,so_saleinvoice_b " +
|
||||||
|
"where so_saleinvoice.csaleinvoiceid=so_saleinvoice_b.csaleinvoiceid " +
|
||||||
|
"and so_saleinvoice.fstatusflag=2 " +
|
||||||
|
"and nvl(so_saleinvoice_b.vbdef10,'N') in ('~','N') " +
|
||||||
|
"and nvl(so_saleinvoice.vdef13,'~') not in ('~') " +
|
||||||
|
"union all " +
|
||||||
|
"select " +
|
||||||
|
"'2' as flag, " +
|
||||||
|
"ic_saleout_b.cfirstbillbid as cfirstbid, " +
|
||||||
|
"ic_saleout_b.cgeneralbid as csaleinvoicebid " +
|
||||||
|
"from ic_saleout_h, " +
|
||||||
|
"ic_saleout_b " +
|
||||||
|
"where ic_saleout_h.cgeneralhid = ic_saleout_b.cgeneralhid " +
|
||||||
|
"and nvl(ic_saleout_b.vbdef4,'N') in ('~','N') " +
|
||||||
|
"and ic_saleout_b.cfirsttype = '30'";
|
||||||
|
|
||||||
List<Map<String, String>> l_pk = (List<Map<String, String>>) new BaseDAO().executeQuery(sql.toString(), new MapListProcessor());
|
List<Map<String, String>> l_pk = (List<Map<String, String>>) new BaseDAO().executeQuery(sql.toString(), new MapListProcessor());
|
||||||
if (l_pk.isEmpty()) {
|
if (l_pk.isEmpty()) {
|
||||||
|
@ -128,7 +143,6 @@ public class ErpSaleOrderToBIPBackgroupWorkPlugin implements IBackgroundWorkPlug
|
||||||
|
|
||||||
for (Map<String, String> map : l_pk) {
|
for (Map<String, String> map : l_pk) {
|
||||||
|
|
||||||
|
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
sb.append(" select so_saleinvoice_b.csaleinvoicebid,so_saleorder.vdef9,so_saleorder_b.vbdef11,so_saleorder_exe.ntotalarmny as totalaccrued ,so_saleorder_exe.ntotalinvoicenum as billqty, NVL(so_saleorder_exe.ntotaloutnum, 0) as totaloutqty ");
|
sb.append(" select so_saleinvoice_b.csaleinvoicebid,so_saleorder.vdef9,so_saleorder_b.vbdef11,so_saleorder_exe.ntotalarmny as totalaccrued ,so_saleorder_exe.ntotalinvoicenum as billqty, NVL(so_saleorder_exe.ntotaloutnum, 0) as totaloutqty ");
|
||||||
sb.append(" from so_saleorder_exe,so_saleinvoice_b,so_saleinvoice,so_saleorder_b,so_saleorder ");
|
sb.append(" from so_saleorder_exe,so_saleinvoice_b,so_saleinvoice,so_saleorder_b,so_saleorder ");
|
||||||
|
@ -177,10 +191,20 @@ public class ErpSaleOrderToBIPBackgroupWorkPlugin implements IBackgroundWorkPlug
|
||||||
String resultString = doSendHttp(custUpdateUrl, "POST", tokenParam, "", headers, js_apct_detail.toJSONString());
|
String resultString = doSendHttp(custUpdateUrl, "POST", tokenParam, "", headers, js_apct_detail.toJSONString());
|
||||||
Map updateMap = gson.fromJson(resultString, Map.class);
|
Map updateMap = gson.fromJson(resultString, Map.class);
|
||||||
String updateSql = "";
|
String updateSql = "";
|
||||||
|
//用标志位flag判断来源(1:销售发票,2:出库单)
|
||||||
|
String flag = map.get("flag");
|
||||||
if (StringUtils.equals("200", updateMap.get("code").toString())) {// 保存更新成功后需要更新日志表
|
if (StringUtils.equals("200", updateMap.get("code").toString())) {// 保存更新成功后需要更新日志表
|
||||||
|
if("1".equals(flag)){
|
||||||
updateSql = "update so_saleinvoice_b set vbdef10='Y' where csaleinvoiceid='" + map.get("csaleinvoicebid") + "'";
|
updateSql = "update so_saleinvoice_b set vbdef10='Y' where csaleinvoiceid='" + map.get("csaleinvoicebid") + "'";
|
||||||
|
}else{
|
||||||
|
updateSql = "update ic_saleout_b set vbdef4='Y' where cgeneralbid='" + map.get("csaleinvoicebid") + "'";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if("1".equals(flag)) {
|
||||||
updateSql = "update so_saleinvoice_b set vbdef10='N' where csaleinvoiceid='" + map.get("csaleinvoicebid") + "'";
|
updateSql = "update so_saleinvoice_b set vbdef10='N' where csaleinvoiceid='" + map.get("csaleinvoicebid") + "'";
|
||||||
|
}else{
|
||||||
|
updateSql = "update ic_saleout_b set vbdef4='N' where cgeneralbid='" + map.get("csaleinvoicebid") + "'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
getSuperDMO().executeUpdateSQL(updateSql);
|
getSuperDMO().executeUpdateSQL(updateSql);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue