1.WMS入库生产商校验
This commit is contained in:
parent
9d7ca50f1f
commit
5c56f0ca36
|
|
@ -6,6 +6,7 @@ import com.drew.lang.annotations.NotNull;
|
|||
import com.google.gson.Gson;
|
||||
import kd.bos.dataentity.OperateOption;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.botp.runtime.ConvertOperationResult;
|
||||
import kd.bos.entity.botp.runtime.PushArgs;
|
||||
|
|
@ -199,8 +200,28 @@ public class WMSPurInController {
|
|||
Date expirationDate = detail1.getDate("expirationDate");//失效期
|
||||
String batch = detail1.getString("batch");//批次
|
||||
String registrationCode = detail1.getString("registrationCode");//注册证号
|
||||
String licenceCode = detail1.getString("licenceCode");//生产许可证
|
||||
String producer = detail1.getString("producer");//生产厂商
|
||||
if (StringUtils.isNotBlank(producer)) {
|
||||
DynamicObject tqq9_proxyandfactory = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, producer).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_proxyandfactory == null) {
|
||||
if (!producer.contains("#")) {
|
||||
errormsg = "没有找到有效的生产商:" + producer;
|
||||
resultExt = ApiResultExt.errorRetrun(entityType, errormsg, error, resultExt);
|
||||
} else {
|
||||
String[] split = producer.split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
DynamicObject tqq9_proxyandfactory1 = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_proxyandfactory1 == null) {
|
||||
errormsg = "没有找到有效的生产商:" + split[i];
|
||||
resultExt = ApiResultExt.errorRetrun(entityType, errormsg, error, resultExt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(registrationCode)) {
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, registrationCode).and("status", QCP.equals, "C")});
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, registrationCode).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
//新建注册证
|
||||
if (tqq9_registration == null) {
|
||||
if (!registrationCode.contains("#")) {
|
||||
|
|
@ -209,7 +230,7 @@ public class WMSPurInController {
|
|||
} else {
|
||||
String[] split = registrationCode.split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
DynamicObject tqq9_registration1 = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C")});
|
||||
DynamicObject tqq9_registration1 = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_registration1 == null) {
|
||||
errormsg = "没有找到有效的注册证:" + split[i];
|
||||
resultExt = ApiResultExt.errorRetrun(entityType, errormsg, error, resultExt);
|
||||
|
|
@ -217,6 +238,18 @@ public class WMSPurInController {
|
|||
}
|
||||
}
|
||||
tqq9_registration = BusinessDataServiceHelper.newDynamicObject("tqq9_registration");
|
||||
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||
String[] supplier = producer.split("#");
|
||||
String[] supno = licenceCode.split("#");
|
||||
int maxLength = Math.max(supplier.length, supno.length);
|
||||
for (int i = 0; i < maxLength; i++) {
|
||||
// 获取当前的 supplier 和 supno,避免越界
|
||||
String currentSupplier = (i < supplier.length) ? supplier[i] : ""; // 或者null
|
||||
String currentSupno = (i < supno.length) ? supno[i] : ""; // 或者null
|
||||
// 将数据设置到集合中
|
||||
tqq9_entry.get(i).set("tqq9_e_supplier", currentSupplier);
|
||||
tqq9_entry.get(i).set("tqq9_e_supno", currentSupno);
|
||||
}
|
||||
tqq9_registration.set("number", registrationCode);
|
||||
tqq9_registration.set("name", registrationCode);
|
||||
tqq9_registration.set("tqq9_startdate", manufactureDate);
|
||||
|
|
@ -253,8 +286,6 @@ public class WMSPurInController {
|
|||
}
|
||||
}
|
||||
}
|
||||
String licenceCode = detail1.getString("licenceCode");//生产许可证
|
||||
String producer = detail1.getString("producer");//生产厂商
|
||||
detailObject.put("entryId", entryId);
|
||||
detailObject.put("wmsDetailId", wmsDetailId);
|
||||
detailObject.put("uniqueCode", uniqueCode);
|
||||
|
|
@ -465,8 +496,28 @@ public class WMSPurInController {
|
|||
Date expirationDate = detail1.getDate("expirationDate");//失效期
|
||||
String batch = detail1.getString("batch");//批次
|
||||
String registrationCode = detail1.getString("registrationCode");//注册证号
|
||||
String licenceCode = detail1.getString("licenceCode");//生产许可证
|
||||
String producer = detail1.getString("producer");//生产厂商
|
||||
if (StringUtils.isNotBlank(producer)) {
|
||||
DynamicObject tqq9_proxyandfactory = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, producer).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_proxyandfactory == null) {
|
||||
if (!producer.contains("#")) {
|
||||
errormsg = "没有找到有效的生产商:" + producer;
|
||||
resultExt = ApiResultExt.errorRetrun(entityType, errormsg, error, resultExt);
|
||||
} else {
|
||||
String[] split = producer.split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
DynamicObject tqq9_proxyandfactory1 = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_proxyandfactory1 == null) {
|
||||
errormsg = "没有找到有效的生产商:" + split[i];
|
||||
resultExt = ApiResultExt.errorRetrun(entityType, errormsg, error, resultExt);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(registrationCode)) {
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, registrationCode).and("status", QCP.equals, "C")});
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, registrationCode).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
//新建注册证
|
||||
if (tqq9_registration == null) {
|
||||
if (!registrationCode.contains("#")) {
|
||||
|
|
@ -475,7 +526,7 @@ public class WMSPurInController {
|
|||
} else {
|
||||
String[] split = registrationCode.split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
DynamicObject tqq9_registration1 = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C")});
|
||||
DynamicObject tqq9_registration1 = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_registration1 == null) {
|
||||
errormsg = "没有找到有效的注册证:" + split[i];
|
||||
resultExt = ApiResultExt.errorRetrun(entityType, errormsg, error, resultExt);
|
||||
|
|
@ -483,6 +534,18 @@ public class WMSPurInController {
|
|||
}
|
||||
}
|
||||
tqq9_registration = BusinessDataServiceHelper.newDynamicObject("tqq9_registration");
|
||||
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||
String[] supplier = producer.split("#");
|
||||
String[] supno = licenceCode.split("#");
|
||||
int maxLength = Math.max(supplier.length, supno.length);
|
||||
for (int i = 0; i < maxLength; i++) {
|
||||
// 获取当前的 supplier 和 supno,避免越界
|
||||
String currentSupplier = (i < supplier.length) ? supplier[i] : ""; // 或者null
|
||||
String currentSupno = (i < supno.length) ? supno[i] : ""; // 或者null
|
||||
// 将数据设置到集合中
|
||||
tqq9_entry.get(i).set("tqq9_e_supplier", currentSupplier);
|
||||
tqq9_entry.get(i).set("tqq9_e_supno", currentSupno);
|
||||
}
|
||||
tqq9_registration.set("number", registrationCode);
|
||||
tqq9_registration.set("name", registrationCode);
|
||||
tqq9_registration.set("tqq9_startdate", manufactureDate);
|
||||
|
|
@ -519,8 +582,6 @@ public class WMSPurInController {
|
|||
}
|
||||
}
|
||||
}
|
||||
String licenceCode = detail1.getString("licenceCode");//生产许可证
|
||||
String producer = detail1.getString("producer");//生产厂商
|
||||
detailObject.put("entryId", entryId);
|
||||
detailObject.put("uniqueCode", uniqueCode);
|
||||
detailObject.put("quantity", quantity);
|
||||
|
|
@ -768,8 +829,32 @@ public class WMSPurInController {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(key2)) {
|
||||
DynamicObject tqq9_proxyandfactory = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, key2).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_proxyandfactory == null) {
|
||||
if (!key2.contains("#")) {
|
||||
errormsg = errormsg.append(";").append("没有找到有效的生产商:" + key2);
|
||||
response.setMessage(errormsg.substring(1));
|
||||
response.setCode("-1");
|
||||
response.setFlag("failure");
|
||||
return CustomApiResult.success(wmsXmlReturn);
|
||||
} else {
|
||||
String[] split = key2.split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
DynamicObject tqq9_proxyandfactory1 = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_proxyandfactory1 == null) {
|
||||
errormsg = errormsg.append(";").append("没有找到有效的生产商:" + split[i]);
|
||||
response.setMessage(errormsg.substring(1));
|
||||
response.setCode("-1");
|
||||
response.setFlag("failure");
|
||||
return CustomApiResult.success(wmsXmlReturn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(key1)) {
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, key1).and("status", QCP.equals, "C")});
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, key1).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
//新建注册证
|
||||
if (tqq9_registration == null) {
|
||||
if (!key1.contains("#")) {
|
||||
|
|
@ -781,7 +866,7 @@ public class WMSPurInController {
|
|||
} else {
|
||||
String[] split = key1.split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
DynamicObject tqq9_registration1 = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C")});
|
||||
DynamicObject tqq9_registration1 = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_registration1 == null) {
|
||||
errormsg = errormsg.append(";").append("没有找到有效的注册证:" + split[i]);
|
||||
response.setMessage(errormsg.substring(1));
|
||||
|
|
@ -792,6 +877,19 @@ public class WMSPurInController {
|
|||
}
|
||||
}
|
||||
tqq9_registration = BusinessDataServiceHelper.newDynamicObject("tqq9_registration");
|
||||
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||
String[] supplier = key2.split("#");
|
||||
String[] supno = key3.split("#");
|
||||
int maxLength = Math.max(supplier.length, supno.length);
|
||||
for (int i = 0; i < maxLength; i++) {
|
||||
// 获取当前的 supplier 和 supno,避免越界
|
||||
String currentSupplier = (i < supplier.length) ? supplier[i] : ""; // 或者null
|
||||
String currentSupno = (i < supno.length) ? supno[i] : ""; // 或者null
|
||||
// 将数据设置到集合中
|
||||
DynamicObject dynamicObject = tqq9_entry.addNew();
|
||||
dynamicObject.set("tqq9_e_supplier", currentSupplier);
|
||||
dynamicObject.set("tqq9_e_supno", currentSupno);
|
||||
}
|
||||
tqq9_registration.set("number", key1);
|
||||
tqq9_registration.set("name", key1);
|
||||
tqq9_registration.set("tqq9_startdate", productDate);
|
||||
|
|
@ -881,8 +979,32 @@ public class WMSPurInController {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(key2)) {
|
||||
DynamicObject tqq9_proxyandfactory = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, key2).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_proxyandfactory == null) {
|
||||
if (!key2.contains("#")) {
|
||||
errormsg = errormsg.append(";").append("没有找到有效的生产商:" + key2);
|
||||
response.setMessage(errormsg.substring(1));
|
||||
response.setCode("-1");
|
||||
response.setFlag("failure");
|
||||
return CustomApiResult.success(wmsXmlReturn);
|
||||
} else {
|
||||
String[] split = key2.split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
DynamicObject tqq9_proxyandfactory1 = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_proxyandfactory1 == null) {
|
||||
errormsg = errormsg.append(";").append("没有找到有效的生产商:" + split[i]);
|
||||
response.setMessage(errormsg.substring(1));
|
||||
response.setCode("-1");
|
||||
response.setFlag("failure");
|
||||
return CustomApiResult.success(wmsXmlReturn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(key1)) {
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, key1).and("status", QCP.equals, "C")});
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, key1).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
//新建注册证
|
||||
if (tqq9_registration == null) {
|
||||
if (!key1.contains("#")) {
|
||||
|
|
@ -894,7 +1016,7 @@ public class WMSPurInController {
|
|||
} else {
|
||||
String[] split = key1.split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
DynamicObject tqq9_registration1 = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C")});
|
||||
DynamicObject tqq9_registration1 = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_registration1 == null) {
|
||||
errormsg = errormsg.append(";").append("没有找到有效的注册证:" + split[i]);
|
||||
response.setMessage(errormsg.substring(1));
|
||||
|
|
@ -905,6 +1027,18 @@ public class WMSPurInController {
|
|||
}
|
||||
}
|
||||
tqq9_registration = BusinessDataServiceHelper.newDynamicObject("tqq9_registration");
|
||||
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||
String[] supplier = key2.split("#");
|
||||
String[] supno = key3.split("#");
|
||||
int maxLength = Math.max(supplier.length, supno.length);
|
||||
for (int i = 0; i < maxLength; i++) {
|
||||
// 获取当前的 supplier 和 supno,避免越界
|
||||
String currentSupplier = (i < supplier.length) ? supplier[i] : ""; // 或者null
|
||||
String currentSupno = (i < supno.length) ? supno[i] : ""; // 或者null
|
||||
// 将数据设置到集合中
|
||||
tqq9_entry.get(i).set("tqq9_e_supplier", currentSupplier);
|
||||
tqq9_entry.get(i).set("tqq9_e_supno", currentSupno);
|
||||
}
|
||||
tqq9_registration.set("number", key1);
|
||||
tqq9_registration.set("name", key1);
|
||||
tqq9_registration.set("tqq9_startdate", productDate);
|
||||
|
|
@ -1253,8 +1387,32 @@ public class WMSPurInController {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(key2)) {
|
||||
DynamicObject tqq9_proxyandfactory = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, key2).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_proxyandfactory == null) {
|
||||
if (!key2.contains("#")) {
|
||||
errormsg = errormsg.append(";").append("没有找到有效的生产商:" + key2);
|
||||
response.setMessage(errormsg.substring(1));
|
||||
response.setCode("-1");
|
||||
response.setFlag("failure");
|
||||
return CustomApiResult.success(wmsXmlReturn);
|
||||
} else {
|
||||
String[] split = key2.split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
DynamicObject tqq9_proxyandfactory1 = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_proxyandfactory1 == null) {
|
||||
errormsg = errormsg.append(";").append("没有找到有效的生产商:" + split[i]);
|
||||
response.setMessage(errormsg.substring(1));
|
||||
response.setCode("-1");
|
||||
response.setFlag("failure");
|
||||
return CustomApiResult.success(wmsXmlReturn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(key1)) {
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, key1).and("status", QCP.equals, "C")});
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, key1).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
//新建注册证
|
||||
if (tqq9_registration == null) {
|
||||
if (!key1.contains("#")) {
|
||||
|
|
@ -1266,7 +1424,7 @@ public class WMSPurInController {
|
|||
} else {
|
||||
String[] split = key1.split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
DynamicObject tqq9_registration1 = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C")});
|
||||
DynamicObject tqq9_registration1 = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_registration1 == null) {
|
||||
errormsg = errormsg.append(";").append("没有找到有效的注册证:" + split[i]);
|
||||
response.setMessage(errormsg.substring(1));
|
||||
|
|
@ -1277,6 +1435,18 @@ public class WMSPurInController {
|
|||
}
|
||||
}
|
||||
tqq9_registration = BusinessDataServiceHelper.newDynamicObject("tqq9_registration");
|
||||
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||
String[] supplier = key2.split("#");
|
||||
String[] supno = key3.split("#");
|
||||
int maxLength = Math.max(supplier.length, supno.length);
|
||||
for (int i = 0; i < maxLength; i++) {
|
||||
// 获取当前的 supplier 和 supno,避免越界
|
||||
String currentSupplier = (i < supplier.length) ? supplier[i] : ""; // 或者null
|
||||
String currentSupno = (i < supno.length) ? supno[i] : ""; // 或者null
|
||||
// 将数据设置到集合中
|
||||
tqq9_entry.get(i).set("tqq9_e_supplier", currentSupplier);
|
||||
tqq9_entry.get(i).set("tqq9_e_supno", currentSupno);
|
||||
}
|
||||
tqq9_registration.set("number", key1);
|
||||
tqq9_registration.set("name", key1);
|
||||
tqq9_registration.set("tqq9_startdate", productDate);
|
||||
|
|
@ -1366,8 +1536,32 @@ public class WMSPurInController {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(key2)) {
|
||||
DynamicObject tqq9_proxyandfactory = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, key2).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_proxyandfactory == null) {
|
||||
if (!key2.contains("#")) {
|
||||
errormsg = errormsg.append(";").append("没有找到有效的生产商:" + key2);
|
||||
response.setMessage(errormsg.substring(1));
|
||||
response.setCode("-1");
|
||||
response.setFlag("failure");
|
||||
return CustomApiResult.success(wmsXmlReturn);
|
||||
} else {
|
||||
String[] split = key2.split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
DynamicObject tqq9_proxyandfactory1 = BusinessDataServiceHelper.loadSingle("tqq9_proxyandfactory", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_proxyandfactory1 == null) {
|
||||
errormsg = errormsg.append(";").append("没有找到有效的生产商:" + split[i]);
|
||||
response.setMessage(errormsg.substring(1));
|
||||
response.setCode("-1");
|
||||
response.setFlag("failure");
|
||||
return CustomApiResult.success(wmsXmlReturn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(key1)) {
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, key1).and("status", QCP.equals, "C")});
|
||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, key1).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
//新建注册证
|
||||
if (tqq9_registration == null) {
|
||||
if (!key1.contains("#")) {
|
||||
|
|
@ -1379,7 +1573,7 @@ public class WMSPurInController {
|
|||
} else {
|
||||
String[] split = key1.split("#");
|
||||
for (int i = 0; i < split.length; i++) {
|
||||
DynamicObject tqq9_registration1 = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C")});
|
||||
DynamicObject tqq9_registration1 = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("number", QCP.equals, split[i]).and("status", QCP.equals, "C").and("enable", QCP.equals, "1")});
|
||||
if (tqq9_registration1 == null) {
|
||||
errormsg = errormsg.append(";").append("没有找到有效的注册证:" + split[i]);
|
||||
response.setMessage(errormsg.substring(1));
|
||||
|
|
@ -1390,6 +1584,18 @@ public class WMSPurInController {
|
|||
}
|
||||
}
|
||||
tqq9_registration = BusinessDataServiceHelper.newDynamicObject("tqq9_registration");
|
||||
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||
String[] supplier = key2.split("#");
|
||||
String[] supno = key3.split("#");
|
||||
int maxLength = Math.max(supplier.length, supno.length);
|
||||
for (int i = 0; i < maxLength; i++) {
|
||||
// 获取当前的 supplier 和 supno,避免越界
|
||||
String currentSupplier = (i < supplier.length) ? supplier[i] : ""; // 或者null
|
||||
String currentSupno = (i < supno.length) ? supno[i] : ""; // 或者null
|
||||
// 将数据设置到集合中
|
||||
tqq9_entry.get(i).set("tqq9_e_supplier", currentSupplier);
|
||||
tqq9_entry.get(i).set("tqq9_e_supno", currentSupno);
|
||||
}
|
||||
tqq9_registration.set("number", key1);
|
||||
tqq9_registration.set("name", key1);
|
||||
tqq9_registration.set("tqq9_startdate", productDate);
|
||||
|
|
|
|||
Loading…
Reference in New Issue