fix:报关对比日志定时任务问题处理
This commit is contained in:
parent
a9b0deebb5
commit
ac07c89372
@ -112,75 +112,78 @@ public class CusdecToDeclaredocxTask extends AbstractTask {
|
|||||||
String yemCaCusdec = DynamicObjectUtil.getSelectfields("yem_ca_cusdec", false);
|
String yemCaCusdec = DynamicObjectUtil.getSelectfields("yem_ca_cusdec", false);
|
||||||
DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle("yem_ca_cusdec", yemCaCusdec
|
DynamicObject dynamicObject = BusinessDataServiceHelper.loadSingle("yem_ca_cusdec", yemCaCusdec
|
||||||
, new QFilter[]{new QFilter("id", QCP.equals, yemCustomsdocumentid)});
|
, new QFilter[]{new QFilter("id", QCP.equals, yemCustomsdocumentid)});
|
||||||
|
String yemCusdecstatusname = "";
|
||||||
if (dynamicObject != null) {
|
if (dynamicObject != null) {
|
||||||
String yemCusdecstatusname = dynamicObject.getString("yem_cusdecstatusname");//申报状态
|
yemCusdecstatusname = dynamicObject.getString("yem_cusdecstatusname");//申报状态
|
||||||
declaredocx.set("yem_declarationstatus", yemCusdecstatusname);
|
declaredocx.set("yem_declarationstatus", yemCusdecstatusname);
|
||||||
if ("结关".equals(yemCusdecstatusname)) {
|
|
||||||
extracted(Long.valueOf(declaredocx.getPkValue().toString()));
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
declaredocx.set("yem_customsdocumentid", 0);
|
declaredocx.set("yem_customsdocumentid", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveServiceHelper.update(declaredocx);
|
SaveServiceHelper.update(declaredocx);
|
||||||
SaveServiceHelper.save(new DynamicObject[]{declaredocx});
|
SaveServiceHelper.save(new DynamicObject[]{declaredocx});
|
||||||
|
if ("结关".equals(yemCusdecstatusname)) {
|
||||||
|
extracted(Long.valueOf(declaredocx.getPkValue().toString()));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//出口报关单分录
|
//出口报关单分录
|
||||||
DynamicObjectCollection dynamicObjectCollection = declaredocx.getDynamicObjectCollection("yem_es_declare_ec");
|
DynamicObjectCollection dynamicObjectCollection = declaredocx.getDynamicObjectCollection("yem_es_declare_ec");
|
||||||
//结算币别
|
//结算币别
|
||||||
DynamicObject yemCurrency = declaredocx.getDynamicObject("yem_currency");
|
DynamicObject yemCurrency = declaredocx.getDynamicObject("yem_currency");
|
||||||
String aLong = "";
|
String aLong = "";
|
||||||
if (yemCurrency != null) {
|
if (yemCurrency != null) {
|
||||||
aLong = yemCurrency.getString("number");
|
aLong = yemCurrency.getString("number");
|
||||||
}
|
}
|
||||||
//单据编号
|
//单据编号
|
||||||
String declaredocxbillno = declaredocx.getString("billno");
|
String declaredocxbillno = declaredocx.getString("billno");
|
||||||
int i = dynamicObjectCollection.size();
|
int i = dynamicObjectCollection.size();
|
||||||
String seq = "";
|
String seq = "";
|
||||||
for (DynamicObject object : dynamicObjectCollection) {
|
for (DynamicObject object : dynamicObjectCollection) {
|
||||||
//海关商品编码
|
//海关商品编码
|
||||||
DynamicObject yemCusboxgoods = object.getDynamicObject("yem_cushscode");
|
DynamicObject yemCusboxgoods = object.getDynamicObject("yem_cushscode");
|
||||||
String billno = "";
|
String billno = "";
|
||||||
if (yemCusboxgoods != null) {
|
if (yemCusboxgoods != null) {
|
||||||
billno = yemCusboxgoods.getString("number");
|
billno = yemCusboxgoods.getString("number");
|
||||||
}
|
}
|
||||||
//报关名称
|
//报关名称
|
||||||
String yemDecmatericalname = object.getString("yem_decmatericalname");
|
String yemDecmatericalname = object.getString("yem_decmatericalname");
|
||||||
//数量
|
//数量
|
||||||
BigDecimal yemCusqty = object.getBigDecimal("yem_cusqty");
|
BigDecimal yemCusqty = object.getBigDecimal("yem_cusqty");
|
||||||
//单价
|
//单价
|
||||||
BigDecimal yemCusconsalesprice = object.getBigDecimal("yem_cusconsalesprice");
|
BigDecimal yemCusconsalesprice = object.getBigDecimal("yem_cusconsalesprice");
|
||||||
//金额
|
//金额
|
||||||
BigDecimal yemCusamount = object.getBigDecimal("yem_cusamount");
|
BigDecimal yemCusamount = object.getBigDecimal("yem_cusamount");
|
||||||
//拼接KEY + "-" + billno
|
//拼接KEY + "-" + billno
|
||||||
String yemErroriskey = billno + "-" + yemDecmatericalname + "-" + yemCusqty + "-" + yemCusconsalesprice + "-" + yemCusamount + "-" + aLong;
|
String yemErroriskey = billno + "-" + yemDecmatericalname + "-" + yemCusqty + "-" + yemCusconsalesprice + "-" + yemCusamount + "-" + aLong;
|
||||||
DynamicObject dynamicObject = maps.get(yemErroriskey);
|
DynamicObject dynamicObject = maps.get(yemErroriskey);
|
||||||
if (dynamicObject != null) {
|
if (dynamicObject != null) {
|
||||||
i = i - 1;
|
i = i - 1;
|
||||||
} else {
|
} else {
|
||||||
seq = seq + object.getString("seq") + ",";
|
seq = seq + object.getString("seq") + ",";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (i != 0) {
|
if (i != 0) {
|
||||||
extracted(data, "出口报关报关单号【" + declaredocxbillno + "】,第" + seq + "行未匹配到单一窗口报关单;\n", id, declaredocxbillno, yemBillno);
|
extracted(data, "出口报关报关单号【" + declaredocxbillno + "】,第" + seq + "行未匹配到单一窗口报关单;\n", id, declaredocxbillno, yemBillno);
|
||||||
} else {
|
} else {
|
||||||
String yemCusdecstatusname = user.getString("yem_cusdecstatusname");//申报状态
|
String yemCusdecstatusname = user.getString("yem_cusdecstatusname");//申报状态
|
||||||
Date yemFiedatets = user.getDate("yem_fiedatets");//出口日期
|
Date yemFiedatets = user.getDate("yem_fiedatets");//出口日期
|
||||||
extracted(data, "出口报关报关单号【" + declaredocxbillno + "】成功匹配单一窗口报关单;\n", id, declaredocxbillno, yemBillno);
|
extracted(data, "出口报关报关单号【" + declaredocxbillno + "】成功匹配单一窗口报关单;\n", id, declaredocxbillno, yemBillno);
|
||||||
declaredocx.set("yem_declarationstatus", yemCusdecstatusname);
|
declaredocx.set("yem_declarationstatus", yemCusdecstatusname);
|
||||||
declaredocx.set("yem_customsnumber", yemEntryid);
|
declaredocx.set("yem_customsnumber", yemEntryid);
|
||||||
declaredocx.set("yem_exportdate", yemFiedatets);
|
declaredocx.set("yem_exportdate", yemFiedatets);
|
||||||
declaredocx.set("yem_customsdocumentid", id);
|
declaredocx.set("yem_customsdocumentid", id);
|
||||||
BigDecimal exchangeRate = YEM.getExchangeRate(declaredocx.getDynamicObject("yem_exratetable")
|
BigDecimal exchangeRate = YEM.getExchangeRate(declaredocx.getDynamicObject("yem_exratetable")
|
||||||
, declaredocx.getDynamicObject("yem_currencybase")
|
, declaredocx.getDynamicObject("yem_currencybase")
|
||||||
, declaredocx.getDynamicObject("yem_usdcurrency")
|
, declaredocx.getDynamicObject("yem_usdcurrency")
|
||||||
, yemFiedatets);
|
, yemFiedatets);
|
||||||
declaredocx.set("exchangeRate",exchangeRate);
|
declaredocx.set("yem_usbexrate", exchangeRate);
|
||||||
if ("结关".equals(yemCusdecstatusname) && !YEM.isEmpty(yemFiedatets)) {
|
|
||||||
extracted(Long.valueOf(declaredocx.getPkValue().toString()));
|
SaveServiceHelper.update(declaredocx);
|
||||||
}
|
SaveServiceHelper.save(new DynamicObject[]{declaredocx});
|
||||||
SaveServiceHelper.update(declaredocx);
|
if ("结关".equals(yemCusdecstatusname) && !YEM.isEmpty(yemFiedatets)) {
|
||||||
SaveServiceHelper.save(new DynamicObject[]{declaredocx});
|
extracted(Long.valueOf(declaredocx.getPkValue().toString()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user