fix:
1.发运明细单保存生成储运汇总
2.内审预算单上传附件
(cherry picked from commit 1986782dc4
)
This commit is contained in:
parent
8969e35ee9
commit
0396aab3e5
@ -24,58 +24,20 @@ import static com.yem.wm.es.contractamtlist.util.FunUtil.getShipBills;
|
|||||||
* @description: 出运明细单
|
* @description: 出运明细单
|
||||||
* @date 2023/10/18
|
* @date 2023/10/18
|
||||||
*/
|
*/
|
||||||
public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn
|
public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn {
|
||||||
{
|
|
||||||
@Override
|
@Override
|
||||||
public void onPreparePropertys(PreparePropertysEventArgs e)
|
public void onPreparePropertys(PreparePropertysEventArgs e) {
|
||||||
{
|
e.getFieldKeys().addAll(this.billEntityType.getAllFields().keySet());
|
||||||
e.getFieldKeys().add("yem_businesssort");
|
|
||||||
e.getFieldKeys().add("yem_ifgift");
|
|
||||||
e.getFieldKeys().add("yem_materiel");
|
|
||||||
e.getFieldKeys().add("yem_resourcescode");
|
|
||||||
e.getFieldKeys().add("yem_milltype");
|
|
||||||
e.getFieldKeys().add("yem_materialname");
|
|
||||||
e.getFieldKeys().add("yem_materialenname");
|
|
||||||
e.getFieldKeys().add("yem_specification");
|
|
||||||
e.getFieldKeys().add("yem_unit");
|
|
||||||
e.getFieldKeys().add("yem_needqty");
|
|
||||||
e.getFieldKeys().add("yem_sapricepriceclause");
|
|
||||||
e.getFieldKeys().add("yem_sapriceclausebase");
|
|
||||||
e.getFieldKeys().add("yem_saamtpriceclause");
|
|
||||||
e.getFieldKeys().add("yem_samtpriceclauseba");
|
|
||||||
e.getFieldKeys().add("yem_baseunit");
|
|
||||||
e.getFieldKeys().add("yem_baseqty");
|
|
||||||
e.getFieldKeys().add("yem_storageqty");
|
|
||||||
e.getFieldKeys().add("yem_vehicleno");
|
|
||||||
e.getFieldKeys().add("yem_contractno");
|
|
||||||
e.getFieldKeys().add("id");
|
|
||||||
e.getFieldKeys().add("yem_accessorytype");
|
|
||||||
e.getFieldKeys().add("yem_volvotype");
|
|
||||||
e.getFieldKeys().add("yem_accesmaterial");
|
|
||||||
e.getFieldKeys().add("yem_acunit");
|
|
||||||
e.getFieldKeys().add("yem_acallqty");
|
|
||||||
e.getFieldKeys().add("yem_saleorderno_p");
|
|
||||||
e.getFieldKeys().add("yem_arrearsamt");
|
|
||||||
e.getFieldKeys().add("yem_arrearsamtapply");
|
|
||||||
|
|
||||||
e.getFieldKeys().add("yem_es_materialinfo");
|
|
||||||
e.getFieldKeys().add("yem_billtype");
|
|
||||||
e.getFieldKeys().add("yem_qty");
|
|
||||||
e.getFieldKeys().add("yem_resourcenog");
|
|
||||||
e.getFieldKeys().add("yem_es_salesorder_z");
|
|
||||||
e.getFieldKeys().add("yem_iouamount");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAddValidators(AddValidatorsEventArgs e)
|
public void onAddValidators(AddValidatorsEventArgs e) {
|
||||||
{
|
|
||||||
super.onAddValidators(e);
|
super.onAddValidators(e);
|
||||||
// e.addValidator(new ShippingDetailAuditValidator());
|
// e.addValidator(new ShippingDetailAuditValidator());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void endOperationTransaction(EndOperationTransactionArgs e)
|
public void endOperationTransaction(EndOperationTransactionArgs e) {
|
||||||
{
|
|
||||||
DynamicObject[] dataEntities = e.getDataEntities();
|
DynamicObject[] dataEntities = e.getDataEntities();
|
||||||
for (DynamicObject dataEntitie : dataEntities) {
|
for (DynamicObject dataEntitie : dataEntities) {
|
||||||
dataEntitie = BusinessDataServiceHelper.loadSingle(dataEntitie.getPkValue(), dataEntitie.getDynamicObjectType().getName());
|
dataEntitie = BusinessDataServiceHelper.loadSingle(dataEntitie.getPkValue(), dataEntitie.getDynamicObjectType().getName());
|
||||||
@ -89,8 +51,7 @@ public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn
|
|||||||
* @description 审核时生成出运汇总分录
|
* @description 审核时生成出运汇总分录
|
||||||
* @author power
|
* @author power
|
||||||
*/
|
*/
|
||||||
public static void collect(DynamicObject dataEntitie)
|
public static void collect(DynamicObject dataEntitie) {
|
||||||
{
|
|
||||||
DynamicObjectCollection materialinfos = dataEntitie.getDynamicObjectCollection("yem_es_materialinfo");
|
DynamicObjectCollection materialinfos = dataEntitie.getDynamicObjectCollection("yem_es_materialinfo");
|
||||||
DynamicObjectCollection followcars = dataEntitie.getDynamicObjectCollection("yem_es_salesorder_p");
|
DynamicObjectCollection followcars = dataEntitie.getDynamicObjectCollection("yem_es_salesorder_p");
|
||||||
DynamicObjectCollection collects = dataEntitie.getDynamicObjectCollection("yem_es_salesorder_total");
|
DynamicObjectCollection collects = dataEntitie.getDynamicObjectCollection("yem_es_salesorder_total");
|
||||||
@ -99,12 +60,13 @@ public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn
|
|||||||
if (StringUtil.isNotEmpty(materialinfo.getString("yem_businesssort"))) {
|
if (StringUtil.isNotEmpty(materialinfo.getString("yem_businesssort"))) {
|
||||||
String businesssort = materialinfo.getString("yem_businesssort");
|
String businesssort = materialinfo.getString("yem_businesssort");
|
||||||
|
|
||||||
if ("Z".equals(businesssort)) {
|
boolean yemIfgift = materialinfo.getBoolean("yem_ifgift");
|
||||||
|
if ("Z".equals(businesssort)&&!yemIfgift) {
|
||||||
DynamicObjectCollection completemachines = materialinfo.getDynamicObjectCollection("yem_es_salesorder_z");
|
DynamicObjectCollection completemachines = materialinfo.getDynamicObjectCollection("yem_es_salesorder_z");
|
||||||
for (DynamicObject completemachine : completemachines) {
|
for (DynamicObject completemachine : completemachines) {
|
||||||
DynamicObject newEntryEntity = collects.addNew();
|
DynamicObject newEntryEntity = collects.addNew();
|
||||||
|
|
||||||
newEntryEntity.set("yem_isgifit_tl", materialinfo.getBoolean("yem_ifgift"));
|
newEntryEntity.set("yem_isgifit_tl", yemIfgift);
|
||||||
newEntryEntity.set("yem_classification_tl", businesssort);
|
newEntryEntity.set("yem_classification_tl", businesssort);
|
||||||
if (materialinfo.getDynamicObject("yem_materiel") != null) {
|
if (materialinfo.getDynamicObject("yem_materiel") != null) {
|
||||||
newEntryEntity.set("yem_accesmaterial_tl", materialinfo.getLong("yem_materiel.id"));
|
newEntryEntity.set("yem_accesmaterial_tl", materialinfo.getLong("yem_materiel.id"));
|
||||||
@ -155,10 +117,10 @@ public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn
|
|||||||
newEntryEntity.set("yem_impactprice1", materialinfo.getString("yem_impactprice"));
|
newEntryEntity.set("yem_impactprice1", materialinfo.getString("yem_impactprice"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ("P".equals(businesssort)) {
|
if ("P".equals(businesssort)&&!yemIfgift) {
|
||||||
DynamicObject newEntryEntity = collects.addNew();
|
DynamicObject newEntryEntity = collects.addNew();
|
||||||
|
|
||||||
newEntryEntity.set("yem_isgifit_tl", materialinfo.getBoolean("yem_ifgift"));
|
newEntryEntity.set("yem_isgifit_tl", yemIfgift);
|
||||||
newEntryEntity.set("yem_classification_tl", businesssort);
|
newEntryEntity.set("yem_classification_tl", businesssort);
|
||||||
if (materialinfo.getDynamicObject("yem_materiel") != null) {
|
if (materialinfo.getDynamicObject("yem_materiel") != null) {
|
||||||
newEntryEntity.set("yem_accesmaterial_tl", materialinfo.getLong("yem_materiel.id"));
|
newEntryEntity.set("yem_accesmaterial_tl", materialinfo.getLong("yem_materiel.id"));
|
||||||
@ -202,6 +164,59 @@ public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn
|
|||||||
newEntryEntity.set("yem_constractioid_tl", materialinfo.getLong("id"));
|
newEntryEntity.set("yem_constractioid_tl", materialinfo.getLong("id"));
|
||||||
newEntryEntity.set("yem_constracteyid_tl", materialinfo.getLong("yem_sourceentryid"));
|
newEntryEntity.set("yem_constracteyid_tl", materialinfo.getLong("yem_sourceentryid"));
|
||||||
|
|
||||||
|
// 汇总影响调拨价
|
||||||
|
newEntryEntity.set("yem_impactprice1", materialinfo.getString("yem_impactprice"));
|
||||||
|
}
|
||||||
|
if (yemIfgift){
|
||||||
|
DynamicObject newEntryEntity = collects.addNew();
|
||||||
|
|
||||||
|
newEntryEntity.set("yem_isgifit_tl", yemIfgift);
|
||||||
|
newEntryEntity.set("yem_classification_tl", businesssort);
|
||||||
|
if (materialinfo.getDynamicObject("yem_materiel") != null) {
|
||||||
|
newEntryEntity.set("yem_accesmaterial_tl", materialinfo.getLong("yem_materiel.id"));
|
||||||
|
}
|
||||||
|
if (materialinfo.getDynamicObject("yem_resourcenog") != null) {
|
||||||
|
newEntryEntity.set("yem_resource_tl", materialinfo.getLong("yem_resourcenog.id"));
|
||||||
|
}
|
||||||
|
if (materialinfo.getDynamicObject("yem_productmodel") != null) {
|
||||||
|
newEntryEntity.set("yem_basicmodel_tl", materialinfo.getLong("yem_productmodel.id"));
|
||||||
|
}
|
||||||
|
if (StringUtil.isNotEmpty(materialinfo.getString("yem_materialname"))) {
|
||||||
|
newEntryEntity.set("yem_materialname_tl", materialinfo.getString("yem_materialname"));
|
||||||
|
}
|
||||||
|
if (StringUtil.isNotEmpty(materialinfo.getString("yem_materialenname"))) {
|
||||||
|
newEntryEntity.set("yem_materialenname_tl", materialinfo.getString("yem_materialenname"));
|
||||||
|
}
|
||||||
|
if (StringUtil.isNotEmpty(materialinfo.getString("yem_specification"))) {
|
||||||
|
newEntryEntity.set("yem_specification_tl", materialinfo.getString("yem_specification"));
|
||||||
|
}
|
||||||
|
if (materialinfo.getDynamicObject("yem_unit") != null) {
|
||||||
|
newEntryEntity.set("yem_acunit_tl", materialinfo.getLong("yem_unit.id"));
|
||||||
|
}
|
||||||
|
newEntryEntity.set("yem_qty_tl", materialinfo.getBigDecimal("yem_qty"));
|
||||||
|
newEntryEntity.set("yem_constractqty_tl", materialinfo.getBigDecimal("yem_needqty"));
|
||||||
|
//销售单价(价格条款)
|
||||||
|
newEntryEntity.set("yem_sapepeclause_tl", materialinfo.getBigDecimal("yem_sapricepriceclause"));
|
||||||
|
newEntryEntity.set("yem_sapecebase_tl", materialinfo.getBigDecimal("yem_sapriceclausebase"));
|
||||||
|
//销售金额(价格条款)
|
||||||
|
newEntryEntity.set("yem_saamtpecle_tl", materialinfo.getBigDecimal("yem_saamtpriceclause"));
|
||||||
|
newEntryEntity.set("yem_samtpeceba_tl", materialinfo.getBigDecimal("yem_samtpriceclauseba"));
|
||||||
|
|
||||||
|
if (materialinfo.getDynamicObject("yem_baseunit") != null) {
|
||||||
|
newEntryEntity.set("yem_unitfieldbase_tl", materialinfo.getLong("yem_baseunit.id"));
|
||||||
|
}
|
||||||
|
newEntryEntity.set("yem_qtybase_tl", materialinfo.getBigDecimal("yem_baseqty"));
|
||||||
|
newEntryEntity.set("yem_storageqty_tl", materialinfo.getBigDecimal("yem_storageqty"));
|
||||||
|
|
||||||
|
if (materialinfo.getDynamicObject("yem_materiel")!=null) {
|
||||||
|
newEntryEntity.set("yem_zjnumber_tl", materialinfo.getLong("yem_materiel.id"));
|
||||||
|
}
|
||||||
|
if (StringUtil.isNotEmpty(materialinfo.getString("yem_contractno"))) {
|
||||||
|
newEntryEntity.set("yem_constratnb_tl", materialinfo.getString("yem_contractno"));
|
||||||
|
}
|
||||||
|
newEntryEntity.set("yem_constractioid_tl", materialinfo.getLong("id"));
|
||||||
|
newEntryEntity.set("yem_constracteyid_tl", materialinfo.getLong("yem_sourceentryid"));
|
||||||
|
|
||||||
// 汇总影响调拨价
|
// 汇总影响调拨价
|
||||||
newEntryEntity.set("yem_impactprice1", materialinfo.getString("yem_impactprice"));
|
newEntryEntity.set("yem_impactprice1", materialinfo.getString("yem_impactprice"));
|
||||||
}
|
}
|
||||||
@ -252,8 +267,7 @@ public class ShippingDetailsAuditOp extends AbstractOperationServicePlugIn
|
|||||||
* @time 2023/11/9 14:24
|
* @time 2023/11/9 14:24
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static void arrearsAmt(DynamicObject dataEntity)
|
public static void arrearsAmt(DynamicObject dataEntity) {
|
||||||
{
|
|
||||||
String sourceBillType = dataEntity.getString("yem_sourcebilltype");
|
String sourceBillType = dataEntity.getString("yem_sourcebilltype");
|
||||||
long sourceBillId = dataEntity.getLong("yem_sourcebillid");
|
long sourceBillId = dataEntity.getLong("yem_sourcebillid");
|
||||||
DynamicObject saleOrder = BusinessDataServiceHelper.loadSingle(sourceBillId, sourceBillType);
|
DynamicObject saleOrder = BusinessDataServiceHelper.loadSingle(sourceBillId, sourceBillType);
|
||||||
|
@ -40,10 +40,19 @@ public class IntAuditBuSaAttachmentsContractOp extends AbstractOperationServiceP
|
|||||||
if (dataEntitie.getBoolean("yem_whethercontract")){
|
if (dataEntitie.getBoolean("yem_whethercontract")){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String selectfield = DynamicObjectUtil.getSelectfields("yem_es_salesorder", false);
|
DynamicObject loadSingle = BusinessDataServiceHelper.loadSingle("yem_es_salesorder", DynamicObjectUtil.getSelectfields("yem_es_salesorder", false)
|
||||||
DynamicObject loadSingle = BusinessDataServiceHelper.loadSingle("yem_es_salesorder", selectfield
|
|
||||||
, new QFilter[]{new QFilter("id", QCP.equals, dataEntitie.getLong("yem_sourcebillid"))});
|
, new QFilter[]{new QFilter("id", QCP.equals, dataEntitie.getLong("yem_sourcebillid"))});
|
||||||
|
if (loadSingle == null) {
|
||||||
|
DynamicObject salesorder = BusinessDataServiceHelper.loadSingle("yem_es_xsalesorder", DynamicObjectUtil.getSelectfields("yem_es_xsalesorder", false)
|
||||||
|
, new QFilter[]{new QFilter("id", QCP.equals, dataEntitie.getLong("yem_sourcebillid"))});
|
||||||
|
if (salesorder != null) {
|
||||||
|
// DynamicObject yemExportcontractnum = BusinessDataServiceHelper.loadSingle("yem_es_salesorder", DynamicObjectUtil.getSelectfields("yem_es_salesorder", false)
|
||||||
|
// , new QFilter[]{new QFilter("billno", QCP.equals, salesorder.getString("yem_exportcontractnum"))});
|
||||||
|
uploadAttachment(dataEntitie, salesorder);
|
||||||
|
}
|
||||||
|
}else {
|
||||||
uploadAttachment(dataEntitie, loadSingle);
|
uploadAttachment(dataEntitie, loadSingle);
|
||||||
|
}
|
||||||
dataEntitie.set("yem_whethercontract",true);
|
dataEntitie.set("yem_whethercontract",true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user