合同获取标准价优化
This commit is contained in:
ljw 2025-01-06 19:04:14 +08:00 committed by 25655
parent aeb01e979c
commit 4f4270e97e

View File

@ -53,21 +53,19 @@ public class ClientUtils {
if (!yem_linetype.equals("add")) { if (!yem_linetype.equals("add")) {
boolean tor = true; boolean tor = true;
DynamicObjectCollection yemMulticonfig = temp.getDynamicObjectCollection("yem_multiconfig"); DynamicObjectCollection yemMulticonfig = temp.getDynamicObjectCollection("yem_multiconfig");
if (!yemMulticonfig.isEmpty()) { if (!yemMulticonfig.isEmpty()){
for (DynamicObject dynamicObject : yemMulticonfig) { for (DynamicObject dynamicObject : yemMulticonfig) {
String yemLinetypes = dynamicObject.getString("yem_linetypes"); String yemLinetypes = dynamicObject.getString("yem_linetypes");
if ("add".equals(yemLinetypes)) { if ("add".equals(yemLinetypes)){
tor = false; tor= false;
} }
} }
} }
if (tor) { if (tor){
rowInfo++; rowInfo++;
continue; continue;
} }
} }
} else {
yem_linetype = "add";
} }
//多功能配置分录行获取 //多功能配置分录行获取
DynamicObjectCollection multiconfig = null; DynamicObjectCollection multiconfig = null;
@ -160,21 +158,19 @@ public class ClientUtils {
} }
} }
} }
if ("yem_es_xsalesorder".equals(models.getDataEntityType().getName())) { if ("yem_es_xsalesorder".equals(models.getDataEntityType().getName())){
int multiconfigIndex = 0; int multiconfigIndex = 0;
if (!multiconfig.isEmpty()) { if (!multiconfig.isEmpty()) {
for (DynamicObject dc : multiconfig) { for (DynamicObject dc : multiconfig) {
if ("add".equals(dc.getString("yem_linetypes"))) { if ("add".equals(dc.getString("yem_linetypes"))){
long configentryid = dc.getLong("yem_configentryid"); long configentryid = dc.getLong("yem_configentryid");
BigDecimal configentry = dataMap.get(configentryid) == null ? BigDecimal.ZERO : dataMap.get(configentryid).setScale(2); BigDecimal configentry = dataMap.get(configentryid) == null ? BigDecimal.ZERO : dataMap.get(configentryid).setScale(2);
models.setValue("yem_marketraisepribase", configentry, multiconfigIndex, rowInfo); models.setValue("yem_marketraisepribase", configentry, multiconfigIndex, rowInfo);
multiconfigIndex++; multiconfigIndex++;
} else {
multiconfigIndex++;
} }
} }
} }
} else { }else {
setPriceNow(multiconfig, dataMap, rowInfo, models); setPriceNow(multiconfig, dataMap, rowInfo, models);
} }
} }
@ -206,7 +202,7 @@ public class ClientUtils {
else if (("yem_im_clientdeman_zj".equals(yem_billtype) || "yem_im_inclientdeman_zj".equals(yem_billtype) else if (("yem_im_clientdeman_zj".equals(yem_billtype) || "yem_im_inclientdeman_zj".equals(yem_billtype)
|| ("yem_es_salesorder_ZJ".equals(yem_billtype)) || "yem_es_salesorder_nmzj".equals(yem_billtype) || ("yem_es_salesorder_ZJ".equals(yem_billtype)) || "yem_es_salesorder_nmzj".equals(yem_billtype)
|| "yem_es_xsalesorder_zj".equals(yem_billtype) || "yem_es_xsalesorder_nmzj".equals(yem_billtype)) || "yem_es_xsalesorder_zj".equals(yem_billtype) || "yem_es_xsalesorder_nmzj".equals(yem_billtype))
&& "P".equals(businesssort) && yem_linetype.equals("add")) { && "P".equals(businesssort) && !yem_linetype.equals("add")) {
// else if (("yem_im_clientdeman_zj".equals(yem_billtype) || "yem_im_inclientdeman_zj".equals(yem_billtype) || ("yem_es_salesorder_ZJ".equals(yem_billtype)) || "yem_es_salesorder_nmzj".equals(yem_billtype)) && "P".equals(businesssort)) { // else if (("yem_im_clientdeman_zj".equals(yem_billtype) || "yem_im_inclientdeman_zj".equals(yem_billtype) || ("yem_es_salesorder_ZJ".equals(yem_billtype)) || "yem_es_salesorder_nmzj".equals(yem_billtype)) && "P".equals(businesssort)) {
pjFindPrice(yem_exrate, info, pjDatas, rowInfo, list, materials, models, yemBdProductsid); pjFindPrice(yem_exrate, info, pjDatas, rowInfo, list, materials, models, yemBdProductsid);
} }
@ -216,7 +212,7 @@ public class ClientUtils {
else if (("yem_im_clientdema_pj".equals(yem_billtype) || "yem_im_inclientdema_pj".equals(yem_billtype) else if (("yem_im_clientdema_pj".equals(yem_billtype) || "yem_im_inclientdema_pj".equals(yem_billtype)
|| "yem_es_salesorder_PJ".equals(yem_billtype) || "yem_es_salesorder_nmpj".equals(yem_billtype) || "yem_es_salesorder_PJ".equals(yem_billtype) || "yem_es_salesorder_nmpj".equals(yem_billtype)
|| "yem_es_xsalesorder_pj".equals(yem_billtype) || "yem_es_xsalesorder_nmpj".equals(yem_billtype)) || "yem_es_xsalesorder_pj".equals(yem_billtype) || "yem_es_xsalesorder_nmpj".equals(yem_billtype))
&& "P".equals(businesssort) && yem_linetype.equals("add")) { && "P".equals(businesssort)&& !yem_linetype.equals("add")) {
pjFindPrice(yem_exrate, info, pjDatas, rowInfo, list, materials, models, yemBdProductsid); pjFindPrice(yem_exrate, info, pjDatas, rowInfo, list, materials, models, yemBdProductsid);
} }
rowInfo++; rowInfo++;
@ -370,15 +366,7 @@ public class ClientUtils {
* 获取标准价中 给当前行标准销售加价赋值 * 获取标准价中 给当前行标准销售加价赋值
*/ */
public static void setPriceNow(DynamicObjectCollection multiconfig, Map<Long, BigDecimal> dataMap, int rowInfo, IDataModel models) { public static void setPriceNow(DynamicObjectCollection multiconfig, Map<Long, BigDecimal> dataMap, int rowInfo, IDataModel models) {
int multiconfigIndex = 0;
if (!multiconfig.isEmpty()) {
for (DynamicObject dc : multiconfig) {
long configentryid = dc.getLong("yem_configentryid");
BigDecimal configentry = dataMap.get(configentryid) == null ? BigDecimal.ZERO : dataMap.get(configentryid).setScale(2);
models.setValue("yem_marketraisepribase", configentry, multiconfigIndex, rowInfo);
multiconfigIndex++;
}
}
} }
/** /**
@ -2011,13 +1999,13 @@ public class ClientUtils {
int rowCount = model.getEntryRowCount("yem_es_materialinfo"); int rowCount = model.getEntryRowCount("yem_es_materialinfo");
for (int i = 0; i < rowCount; i++) { for (int i = 0; i < rowCount; i++) {
DynamicObject d = c.get(i); DynamicObject d = c.get(i);
if (string.equals("yem_es_xsalesorder")) { if (string.equals("yem_es_xsalesorder")){
String yemLinetype = d.getString("yem_linetype"); String yemLinetype = d.getString("yem_linetype");
if (!"add".equals(yemLinetype)) { if (!"add".equals(yemLinetype)){
continue; continue;
} }
} }
if (!"Z".equals(d.getString("yem_businesssort"))) { if (!"Z".equals(d.getString("yem_businesssort"))){
continue; continue;
} }
DynamicObjectCollection subC = d.getDynamicObjectCollection("yem_multiconfig"); DynamicObjectCollection subC = d.getDynamicObjectCollection("yem_multiconfig");