处理单据体注册证号变更公用方法,排除基础资料物料
This commit is contained in:
parent
9faa25557f
commit
83fdb7af2d
|
|
@ -52,29 +52,47 @@ public class BaseDataPlugin extends AbstractFormPlugin implements Plugin {
|
||||||
ChangeData[] changeSet = e.getChangeSet();
|
ChangeData[] changeSet = e.getChangeSet();
|
||||||
ChangeData changeData = changeSet[0];
|
ChangeData changeData = changeSet[0];
|
||||||
int rowIndex = changeData.getRowIndex();
|
int rowIndex = changeData.getRowIndex();
|
||||||
|
String name = this.getModel().getDataEntity(true).getDataEntityType().getName();
|
||||||
|
|
||||||
if (StringUtils.equals("tqq9_registration", key)) {
|
//排斥物料
|
||||||
StringBuilder stringBuilder_supno = new StringBuilder();
|
if(!"bd_material".equals(name)){
|
||||||
StringBuilder stringBuilder_supplier = new StringBuilder();
|
if (StringUtils.equals("tqq9_registration", key)) {
|
||||||
DynamicObject newValue = (DynamicObject) changeData.getNewValue();
|
StringBuilder stringBuilder_supno = new StringBuilder();
|
||||||
if (newValue != null) {
|
StringBuilder stringBuilder_supplier = new StringBuilder();
|
||||||
//处理非医非消毒的问题
|
DynamicObject newValue = (DynamicObject) changeData.getNewValue();
|
||||||
boolean isFyfxd = false;//是否 非医非消毒
|
if (newValue != null) {
|
||||||
String tqq9_scxkzh = null;//生产许可证号
|
//处理非医非消毒的问题
|
||||||
String tqq9_sccsname = null;//生产厂商名称
|
boolean isFyfxd = false;//是否 非医非消毒
|
||||||
handleFyfxd(rowIndex, isFyfxd, tqq9_scxkzh, tqq9_sccsname);//处理非医非消毒的内容
|
String tqq9_scxkzh = null;//生产许可证号
|
||||||
if(isFyfxd){
|
String tqq9_sccsname = null;//生产厂商名称
|
||||||
//非医非消毒 取物料上的生产厂商名称和许可证号
|
handleFyfxd(rowIndex, isFyfxd, tqq9_scxkzh, tqq9_sccsname);//处理非医非消毒的内容
|
||||||
this.getModel().setValue("tqq9_licenseno", tqq9_scxkzh, rowIndex);
|
if(isFyfxd){
|
||||||
this.getModel().setValue("tqq9_cs", tqq9_sccsname, rowIndex);
|
//非医非消毒 取物料上的生产厂商名称和许可证号
|
||||||
}else{
|
this.getModel().setValue("tqq9_licenseno", tqq9_scxkzh, rowIndex);
|
||||||
String number = newValue.getString("number");
|
this.getModel().setValue("tqq9_cs", tqq9_sccsname, rowIndex);
|
||||||
if (number.contains("#")) {
|
}else{
|
||||||
String[] numbers = number.split("#");
|
String number = newValue.getString("number");
|
||||||
DynamicObject[] tqq9_registrations = BusinessDataServiceHelper.load("tqq9_registration",
|
if (number.contains("#")) {
|
||||||
"id,number,name,tqq9_entry.tqq9_e_supno,tqq9_entry.tqq9_e_supplier"
|
String[] numbers = number.split("#");
|
||||||
, new QFilter[]{new QFilter("number", QCP.in, numbers)});
|
DynamicObject[] tqq9_registrations = BusinessDataServiceHelper.load("tqq9_registration",
|
||||||
for (DynamicObject tqq9_registration : tqq9_registrations) {
|
"id,number,name,tqq9_entry.tqq9_e_supno,tqq9_entry.tqq9_e_supplier"
|
||||||
|
, new QFilter[]{new QFilter("number", QCP.in, numbers)});
|
||||||
|
for (DynamicObject tqq9_registration : tqq9_registrations) {
|
||||||
|
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||||
|
for (DynamicObject entry : tqq9_entry) {
|
||||||
|
String supno = entry.getString("tqq9_e_supno");//许可证
|
||||||
|
DynamicObject tqq9_e_supplier = entry.getDynamicObject("tqq9_e_supplier");//生产商
|
||||||
|
if (StringUtils.isNotBlank(supno)) {
|
||||||
|
stringBuilder_supno.append("#").append(supno);
|
||||||
|
}
|
||||||
|
if (tqq9_e_supplier != null) {
|
||||||
|
stringBuilder_supplier.append("#").append(tqq9_e_supplier.getString("name"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("id", QCP.equals, newValue.getLong("id"))});
|
||||||
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||||
for (DynamicObject entry : tqq9_entry) {
|
for (DynamicObject entry : tqq9_entry) {
|
||||||
String supno = entry.getString("tqq9_e_supno");//许可证
|
String supno = entry.getString("tqq9_e_supno");//许可证
|
||||||
|
|
@ -88,54 +106,54 @@ public class BaseDataPlugin extends AbstractFormPlugin implements Plugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
if (StringUtils.isNotBlank(stringBuilder_supno.toString())) {
|
||||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration", new QFilter[]{new QFilter("id", QCP.equals, newValue.getLong("id"))});
|
String substring = stringBuilder_supno.substring(1);
|
||||||
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
this.getModel().setValue("tqq9_licenseno", substring, rowIndex);
|
||||||
for (DynamicObject entry : tqq9_entry) {
|
}
|
||||||
String supno = entry.getString("tqq9_e_supno");//许可证
|
if (StringUtils.isNotBlank(stringBuilder_supplier.toString())) {
|
||||||
DynamicObject tqq9_e_supplier = entry.getDynamicObject("tqq9_e_supplier");//生产商
|
String substring = stringBuilder_supplier.substring(1);
|
||||||
if (StringUtils.isNotBlank(supno)) {
|
this.getModel().setValue("tqq9_cs", substring, rowIndex);
|
||||||
stringBuilder_supno.append("#").append(supno);
|
|
||||||
}
|
|
||||||
if (tqq9_e_supplier != null) {
|
|
||||||
stringBuilder_supplier.append("#").append(tqq9_e_supplier.getString("name"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(stringBuilder_supno.toString())) {
|
|
||||||
String substring = stringBuilder_supno.substring(1);
|
|
||||||
this.getModel().setValue("tqq9_licenseno", substring, rowIndex);
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(stringBuilder_supplier.toString())) {
|
|
||||||
String substring = stringBuilder_supplier.substring(1);
|
|
||||||
this.getModel().setValue("tqq9_cs", substring, rowIndex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (StringUtils.equals("tqq9_zczh", key)) {
|
||||||
if (StringUtils.equals("tqq9_zczh", key)) {
|
StringBuilder stringBuilder_supno = new StringBuilder();
|
||||||
StringBuilder stringBuilder_supno = new StringBuilder();
|
StringBuilder stringBuilder_supplier = new StringBuilder();
|
||||||
StringBuilder stringBuilder_supplier = new StringBuilder();
|
DynamicObject newValue = (DynamicObject) changeData.getNewValue();
|
||||||
DynamicObject newValue = (DynamicObject) changeData.getNewValue();
|
if (newValue != null) {
|
||||||
if (newValue != null) {
|
//处理非医非消毒的问题
|
||||||
//处理非医非消毒的问题
|
boolean isFyfxd = false;//是否 非医非消毒
|
||||||
boolean isFyfxd = false;//是否 非医非消毒
|
String tqq9_scxkzh = null;//生产许可证号
|
||||||
String tqq9_scxkzh = null;//生产许可证号
|
String tqq9_sccsname = null;//生产厂商名称
|
||||||
String tqq9_sccsname = null;//生产厂商名称
|
handleFyfxd(rowIndex, isFyfxd, tqq9_scxkzh, tqq9_sccsname);//处理非医非消毒的内容
|
||||||
handleFyfxd(rowIndex, isFyfxd, tqq9_scxkzh, tqq9_sccsname);//处理非医非消毒的内容
|
if(isFyfxd){
|
||||||
if(isFyfxd){
|
//非医非消毒 取物料上的生产厂商名称和许可证号
|
||||||
//非医非消毒 取物料上的生产厂商名称和许可证号
|
this.getModel().setValue("tqq9_licenseno", tqq9_scxkzh, rowIndex);
|
||||||
this.getModel().setValue("tqq9_licenseno", tqq9_scxkzh, rowIndex);
|
this.getModel().setValue("tqq9_cs", tqq9_sccsname, rowIndex);
|
||||||
this.getModel().setValue("tqq9_cs", tqq9_sccsname, rowIndex);
|
}else{
|
||||||
}else{
|
String number = newValue.getString("number");
|
||||||
String number = newValue.getString("number");
|
if (number.contains("#")) {
|
||||||
if (number.contains("#")) {
|
String[] numbers = number.split("#");
|
||||||
String[] numbers = number.split("#");
|
DynamicObject[] tqq9_registrations = BusinessDataServiceHelper.load("tqq9_registration",
|
||||||
DynamicObject[] tqq9_registrations = BusinessDataServiceHelper.load("tqq9_registration",
|
"id,number,name,tqq9_entry.tqq9_e_supno,tqq9_entry.tqq9_e_supplier"
|
||||||
"id,number,name,tqq9_entry.tqq9_e_supno,tqq9_entry.tqq9_e_supplier"
|
, new QFilter[]{new QFilter("number", QCP.in, numbers)});
|
||||||
, new QFilter[]{new QFilter("number", QCP.in, numbers)});
|
for (DynamicObject tqq9_registration : tqq9_registrations) {
|
||||||
for (DynamicObject tqq9_registration : tqq9_registrations) {
|
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||||
|
for (DynamicObject entry : tqq9_entry) {
|
||||||
|
String supno = entry.getString("tqq9_e_supno");//许可证
|
||||||
|
DynamicObject tqq9_e_supplier = entry.getDynamicObject("tqq9_e_supplier");//生产商
|
||||||
|
if (StringUtils.isNotBlank(supno)) {
|
||||||
|
stringBuilder_supno.append("#").append(supno);
|
||||||
|
}
|
||||||
|
if (tqq9_e_supplier != null) {
|
||||||
|
stringBuilder_supplier.append("#").append(tqq9_e_supplier.getString("name"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration",
|
||||||
|
new QFilter[]{new QFilter("id", QCP.equals, newValue.getLong("id"))});
|
||||||
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
||||||
for (DynamicObject entry : tqq9_entry) {
|
for (DynamicObject entry : tqq9_entry) {
|
||||||
String supno = entry.getString("tqq9_e_supno");//许可证
|
String supno = entry.getString("tqq9_e_supno");//许可证
|
||||||
|
|
@ -148,32 +166,19 @@ public class BaseDataPlugin extends AbstractFormPlugin implements Plugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
if (StringUtils.isNotBlank(stringBuilder_supno.toString())) {
|
||||||
DynamicObject tqq9_registration = BusinessDataServiceHelper.loadSingle("tqq9_registration",
|
String substring = stringBuilder_supno.substring(1);
|
||||||
new QFilter[]{new QFilter("id", QCP.equals, newValue.getLong("id"))});
|
this.getModel().setValue("tqq9_licenseno", substring, rowIndex);
|
||||||
DynamicObjectCollection tqq9_entry = tqq9_registration.getDynamicObjectCollection("tqq9_entry");
|
}
|
||||||
for (DynamicObject entry : tqq9_entry) {
|
if (StringUtils.isNotBlank(stringBuilder_supplier.toString())) {
|
||||||
String supno = entry.getString("tqq9_e_supno");//许可证
|
String substring = stringBuilder_supplier.substring(1);
|
||||||
DynamicObject tqq9_e_supplier = entry.getDynamicObject("tqq9_e_supplier");//生产商
|
this.getModel().setValue("tqq9_cs", substring, rowIndex);
|
||||||
if (StringUtils.isNotBlank(supno)) {
|
|
||||||
stringBuilder_supno.append("#").append(supno);
|
|
||||||
}
|
|
||||||
if (tqq9_e_supplier != null) {
|
|
||||||
stringBuilder_supplier.append("#").append(tqq9_e_supplier.getString("name"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(stringBuilder_supno.toString())) {
|
|
||||||
String substring = stringBuilder_supno.substring(1);
|
|
||||||
this.getModel().setValue("tqq9_licenseno", substring, rowIndex);
|
|
||||||
}
|
|
||||||
if (StringUtils.isNotBlank(stringBuilder_supplier.toString())) {
|
|
||||||
String substring = stringBuilder_supplier.substring(1);
|
|
||||||
this.getModel().setValue("tqq9_cs", substring, rowIndex);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleFyfxd(int rowIndex, boolean isFyfxd, String tqq9_scxkzh, String tqq9_sccsname) {
|
private void handleFyfxd(int rowIndex, boolean isFyfxd, String tqq9_scxkzh, String tqq9_sccsname) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue