parent
1ff1495d29
commit
1e9f224640
|
|
@ -196,24 +196,6 @@ public class OtherOutApplyBillPlugin extends AbstractBillPlugIn implements Befor
|
|||
dynamicObject.set("tqq9_expirydate",entry.getDate("tqq9_deadline"));//到期日期
|
||||
dynamicObject.set("tqq9_dcck",entry.getDynamicObject("tqq9_thck"));//退货仓库
|
||||
dynamicObject.set("tqq9_lot",entry.getDynamicObject("tqq9_ph"));//批号
|
||||
if(bd_materialinventoryinfo!=null){
|
||||
QFilter purinbillF=new QFilter("billentry.material.id", QCP.equals,bd_materialinventoryinfo.getLong("id"));
|
||||
purinbillF=purinbillF.and("billstatus", QCP.equals,"C");
|
||||
//采购入库单
|
||||
DynamicObject[] purinbills = BusinessDataServiceHelper.load("im_purinbill", "id,billno,billentry.material,billentry.priceandtax", purinbillF.toArray(),"auditdate desc");
|
||||
DynamicObject purinbill = purinbills[0];
|
||||
if(purinbill!=null) {
|
||||
DynamicObjectCollection entries = purinbill.getDynamicObjectCollection("billentry");
|
||||
for (DynamicObject entry1 : entries) {
|
||||
String number = entry1.getString("material.masterid.number");
|
||||
if (StringUtils.equals(number, masterid.getString("number"))) {
|
||||
BigDecimal priceandtax = entry1.getBigDecimal("priceandtax");
|
||||
this.getModel().setValue("tqq9_price", priceandtax);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,10 +3,15 @@ package tqq9.lc123.cloud.app.plugin.form.pm;
|
|||
import kd.bos.bill.AbstractBillPlugIn;
|
||||
import kd.bos.bill.BillShowParameter;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.form.CloseCallBack;
|
||||
import kd.bos.form.ShowType;
|
||||
import kd.bos.form.control.events.ItemClickEvent;
|
||||
import kd.bos.form.field.BasedataEdit;
|
||||
import kd.bos.form.field.events.BeforeF7SelectEvent;
|
||||
import kd.bos.form.field.events.BeforeF7SelectListener;
|
||||
import kd.bos.list.ListShowParameter;
|
||||
import kd.bos.logging.Log;
|
||||
import kd.bos.logging.LogFactory;
|
||||
import kd.bos.orm.query.QCP;
|
||||
|
|
@ -20,12 +25,15 @@ import java.util.EventObject;
|
|||
/**
|
||||
* 采购退货界面插件
|
||||
*/
|
||||
public class PurRefundApplyBillPlugin extends AbstractBillPlugIn implements Plugin {
|
||||
public class PurRefundApplyBillPlugin extends AbstractBillPlugIn implements BeforeF7SelectListener {
|
||||
private final static Log logger = LogFactory.getLog(PurorderEntryIntroPaybillPlugin.class);
|
||||
@Override
|
||||
public void registerListener(EventObject e) {
|
||||
super.registerListener(e);
|
||||
this.addItemClickListeners("tbmain");
|
||||
BasedataEdit control = this.getControl("tqq9_ph");
|
||||
control.addBeforeF7SelectListener(this);
|
||||
// this.addClickListeners("tqq9_xsddh");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -44,4 +52,34 @@ public class PurRefundApplyBillPlugin extends AbstractBillPlugIn implements Plug
|
|||
this.getView().showForm(param);
|
||||
}
|
||||
}
|
||||
|
||||
/**出库批号根据了做筛选
|
||||
*
|
||||
*/
|
||||
|
||||
@Override
|
||||
public void beforeF7Select(BeforeF7SelectEvent beforeF7SelectEvent) {
|
||||
int index = this.getModel().getEntryCurrentRowIndex("billentry");
|
||||
DynamicObjectCollection entryentity = this.getModel().getDataEntity(true).getDynamicObjectCollection("billentry");
|
||||
DynamicObject dynamicObject = entryentity.get(index);
|
||||
DynamicObject material = dynamicObject.getDynamicObject("material");//物料采购信息
|
||||
if (material == null) {
|
||||
beforeF7SelectEvent.setCancel(true);
|
||||
this.getView().showMessage("请先填物料信息");
|
||||
} else {
|
||||
DynamicObject masterid = material.getDynamicObject("masterid");//物料
|
||||
DynamicObject bd_materialinventoryinfo = BusinessDataServiceHelper.loadSingle("bd_materialinventoryinfo", new QFilter[]{new QFilter("masterid", QCP.equals, masterid.getLong("id"))});
|
||||
|
||||
Boolean enablelot = bd_materialinventoryinfo.getBoolean("enablelot");//是否启用批号管理
|
||||
if (enablelot) {
|
||||
ListShowParameter param = (ListShowParameter) beforeF7SelectEvent.getFormShowParameter();
|
||||
QFilter qF1 = new QFilter("material.number", QCP.equals, masterid.getString("number"));
|
||||
param.getListFilterParameter().getQFilters().add(qF1);
|
||||
} else {
|
||||
beforeF7SelectEvent.setCancel(true);
|
||||
this.getView().showMessage("该物料未启用批号管理");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +1,47 @@
|
|||
package tqq9.lc123.cloud.app.plugin.form.sys;
|
||||
|
||||
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.datamodel.ListSelectedRowCollection;
|
||||
import kd.bos.entity.operate.result.IOperateInfo;
|
||||
import kd.bos.entity.operate.result.OperationResult;
|
||||
import kd.bos.form.control.events.ItemClickEvent;
|
||||
import kd.bos.list.IListView;
|
||||
import kd.bos.list.plugin.AbstractListPlugin;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
import kd.bos.servicehelper.BusinessDataServiceHelper;
|
||||
import kd.bos.servicehelper.operation.OperationServiceHelper;
|
||||
import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
import kd.sdk.plugin.Plugin;
|
||||
import tqq9.lc123.cloud.app.api.utils.Constants;
|
||||
|
||||
import javax.swing.text.html.Option;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 标准单据列表插件
|
||||
* 物料列表界面插件
|
||||
*/
|
||||
public class MaterialListPlugin extends AbstractListPlugin implements Plugin {
|
||||
|
||||
|
||||
private static String BD_MATERIALSALINFO = "bd_materialsalinfo";//物料销售信息
|
||||
private static String BD_MATERIALPURCHASEINFO = "bd_materialpurchaseinfo";//物料采购信息
|
||||
private static String SH = "SHLC";
|
||||
private static String BJ = "BJLC";
|
||||
private static String GZ = "GZLC";
|
||||
|
||||
@Override
|
||||
public void itemClick(ItemClickEvent evt) {
|
||||
super.itemClick(evt);
|
||||
String itemKey = evt.getItemKey();
|
||||
List<String> buttonList = Arrays.asList("SHZTXS", "BJZTXS", "GZZTXS", "SHZTCG", "BJZTCG", "GZZTCG", "SHQYXS", "BJQYXS", "GZQYXS", "SHQYCG", "BJQYCG", "GZQYCG");
|
||||
// String message="";
|
||||
StringBuilder errorMsg = new StringBuilder();
|
||||
|
||||
if (buttonList.contains(itemKey)) {
|
||||
IListView listview = (IListView) this.getView();
|
||||
|
|
@ -33,26 +50,107 @@ public class MaterialListPlugin extends AbstractListPlugin implements Plugin {
|
|||
QFilter materialF = new QFilter("id", QCP.in, primaryKeyValues);
|
||||
DynamicObject[] materials = BusinessDataServiceHelper.load("bd_material", "id,number,name,tqq9_stopsale,tqq9_stoppurchase", materialF.toArray());
|
||||
String city = itemKey.substring(0, 2);//取前两位代表地区
|
||||
for (DynamicObject material : materials) {
|
||||
DynamicObject[] bd_materialinfo = new DynamicObject[materials.length];
|
||||
Boolean flag=false;
|
||||
for (int i = 0; i < materials.length; i++) {
|
||||
|
||||
}
|
||||
for (int i = 0; i < materials.length; i++) {
|
||||
DynamicObject material = materials[i];
|
||||
String tqq9_stopsale = material.getString("tqq9_stopsale");
|
||||
String tqq9_stoppurchase = material.getString("tqq9_stoppurchase");
|
||||
QFilter qFilter = new QFilter("masterid", QCP.equals, material.getLong("id"));
|
||||
qFilter = qFilter.and("createorg.number", QCP.equals, city+"LC");
|
||||
if (itemKey.contains("ZTXS")) {
|
||||
tqq9_stopsale = addOrRemoveCity(tqq9_stopsale, city, true);
|
||||
material.set("tqq9_stopsale", tqq9_stopsale);
|
||||
DynamicObject bd_materialsalinfo = BusinessDataServiceHelper.loadSingle(BD_MATERIALSALINFO, qFilter.toArray());
|
||||
if (bd_materialsalinfo == null) {
|
||||
errorMsg.append("物料" + material.getString("name") + "暂停失败,原因为:").append("未查询到该物料的销售信息").append("\r\n");
|
||||
} else {
|
||||
material.set("tqq9_stopsale", tqq9_stopsale);
|
||||
flag=true;
|
||||
bd_materialinfo[i] = bd_materialsalinfo;
|
||||
}
|
||||
} else if (itemKey.contains("QYXS")) {
|
||||
tqq9_stopsale = addOrRemoveCity(tqq9_stopsale, city, false);
|
||||
material.set("tqq9_stopsale", tqq9_stopsale);
|
||||
}else if(itemKey.contains("ZTCG")){
|
||||
DynamicObject bd_materialsalinfo = BusinessDataServiceHelper.loadSingle(BD_MATERIALSALINFO, qFilter.toArray());
|
||||
if (bd_materialsalinfo == null) {
|
||||
errorMsg.append("物料" + material.getString("name") + "启用失败,原因为:").append("未查询到该物料的销售信息").append("\r\n");
|
||||
} else {
|
||||
material.set("tqq9_stopsale", tqq9_stopsale);
|
||||
flag=true;
|
||||
bd_materialinfo[i] = bd_materialsalinfo;
|
||||
}
|
||||
} else if (itemKey.contains("ZTCG")) {
|
||||
tqq9_stoppurchase = addOrRemoveCity(tqq9_stoppurchase, city, true);
|
||||
material.set("tqq9_stoppurchase", tqq9_stoppurchase);
|
||||
}else if(itemKey.contains("QYCG")){
|
||||
DynamicObject bd_materialpurchaseinfo = BusinessDataServiceHelper.loadSingle(BD_MATERIALPURCHASEINFO, qFilter.toArray());
|
||||
if (bd_materialpurchaseinfo == null) {
|
||||
errorMsg.append("物料" + material.getString("name") + "暂停失败,原因为:").append("未查询到该物料的销售信息").append("\r\n");
|
||||
} else {
|
||||
material.set("tqq9_stoppurchase", tqq9_stoppurchase);
|
||||
flag=true;
|
||||
bd_materialinfo[i] = bd_materialpurchaseinfo;
|
||||
}
|
||||
} else if (itemKey.contains("QYCG")) {
|
||||
tqq9_stoppurchase = addOrRemoveCity(tqq9_stoppurchase, city, false);
|
||||
material.set("tqq9_stoppurchase", tqq9_stoppurchase);
|
||||
DynamicObject bd_materialpurchaseinfo = BusinessDataServiceHelper.loadSingle(BD_MATERIALPURCHASEINFO, qFilter.toArray());
|
||||
if (bd_materialpurchaseinfo == null) {
|
||||
errorMsg.append("物料" + material.getString("name") + "启用失败,原因为:").append("未查询到该物料的销售信息").append("\r\n");
|
||||
} else {
|
||||
material.set("tqq9_stoppurchase", tqq9_stoppurchase);
|
||||
flag=true;
|
||||
bd_materialinfo[i] = bd_materialpurchaseinfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
SaveServiceHelper.save(materials);
|
||||
if (flag) {
|
||||
SaveServiceHelper.save(materials);
|
||||
OperateOption operateOption = OperateOption.create();
|
||||
if (itemKey.contains("ZTXS")) {
|
||||
OperationResult auditResult = OperationServiceHelper.executeOperate(Constants.TYPE_DISABLE, BD_MATERIALSALINFO, bd_materialinfo, operateOption);
|
||||
List<IOperateInfo> allErrorOrValidateInfo1 = auditResult.getAllErrorOrValidateInfo();
|
||||
for (IOperateInfo iOperateInfo : allErrorOrValidateInfo1) {
|
||||
String message = iOperateInfo.getMessage();
|
||||
DynamicObject material = BusinessDataServiceHelper.loadSingle(iOperateInfo.getPkValue(), BD_MATERIALSALINFO);
|
||||
DynamicObject masterid = material.getDynamicObject("masterid");
|
||||
errorMsg.append("物料" + masterid.getString("name") + "暂停失败,原因为:").append(message).append("\r\n");
|
||||
}
|
||||
} else if (itemKey.contains("QYXS")) {
|
||||
OperationResult auditResult = OperationServiceHelper.executeOperate(Constants.TYPE_ENABLE, BD_MATERIALSALINFO, bd_materialinfo, operateOption);
|
||||
List<IOperateInfo> allErrorOrValidateInfo1 = auditResult.getAllErrorOrValidateInfo();
|
||||
for (IOperateInfo iOperateInfo : allErrorOrValidateInfo1) {
|
||||
String message = iOperateInfo.getMessage();
|
||||
DynamicObject material = BusinessDataServiceHelper.loadSingle(iOperateInfo.getPkValue(), BD_MATERIALSALINFO);
|
||||
errorMsg.append("物料" + material.getString("name") + "启用失败,原因为:").append(message).append("\r\n");
|
||||
}
|
||||
} else if (itemKey.contains("ZTCG")) {
|
||||
OperationResult auditResult = OperationServiceHelper.executeOperate(Constants.TYPE_DISABLE, BD_MATERIALPURCHASEINFO, bd_materialinfo, operateOption);
|
||||
List<IOperateInfo> allErrorOrValidateInfo1 = auditResult.getAllErrorOrValidateInfo();
|
||||
for (IOperateInfo iOperateInfo : allErrorOrValidateInfo1) {
|
||||
String message = iOperateInfo.getMessage();
|
||||
DynamicObject material = BusinessDataServiceHelper.loadSingle(iOperateInfo.getPkValue(), BD_MATERIALPURCHASEINFO);
|
||||
errorMsg.append("物料" + material.getString("name") + "暂停失败,原因为:").append(message).append("\r\n");
|
||||
}
|
||||
} else if (itemKey.contains("QYCG")) {
|
||||
OperationResult auditResult = OperationServiceHelper.executeOperate(Constants.TYPE_ENABLE, BD_MATERIALPURCHASEINFO, bd_materialinfo, operateOption);
|
||||
List<IOperateInfo> allErrorOrValidateInfo1 = auditResult.getAllErrorOrValidateInfo();
|
||||
for (IOperateInfo iOperateInfo : allErrorOrValidateInfo1) {
|
||||
String message = iOperateInfo.getMessage();
|
||||
DynamicObject material = BusinessDataServiceHelper.loadSingle(iOperateInfo.getPkValue(), BD_MATERIALPURCHASEINFO);
|
||||
errorMsg.append("物料" + material.getString("name") + "启用失败,原因为:").append(message).append("\r\n");
|
||||
}
|
||||
}
|
||||
this.getView().updateView();
|
||||
if (StringUtils.isNotBlank(errorMsg)) {
|
||||
this.getView().showMessage(errorMsg.toString());
|
||||
} else {
|
||||
this.getView().showMessage("修改成功");
|
||||
}
|
||||
}
|
||||
this.getView().showMessage(errorMsg.toString());
|
||||
|
||||
}
|
||||
this.getView().updateView();
|
||||
|
||||
}
|
||||
|
||||
public static String addOrRemoveCity(String input, String city, boolean add) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package tqq9.lc123.cloud.app.plugin.operate.im;
|
||||
|
||||
import com.alibaba.nacos.common.utils.StringUtils;
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||
|
|
@ -66,7 +67,7 @@ public class OtherInIotManagePlugin extends AbstractOperationServicePlugIn imple
|
|||
QFilter goodlotmanageF = new QFilter("number", QCP.equals,number);
|
||||
goodlotmanageF=goodlotmanageF.and(new QFilter("tqq9_lot", QCP.equals,lotnumber));
|
||||
DynamicObject tqq9_goodlotmanage1 = BusinessDataServiceHelper.loadSingle("tqq9_goodlotmanage",goodlotmanageF.toArray());
|
||||
if(tqq9_goodlotmanage1==null){
|
||||
if(tqq9_goodlotmanage1==null&& StringUtils.isNotBlank(lotnumber)){
|
||||
falg=true;
|
||||
tqq9_goodlotmanages[i]=tqq9_goodlotmanage;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package tqq9.lc123.cloud.app.plugin.operate.im;
|
|||
|
||||
import kd.bos.dataentity.entity.DynamicObject;
|
||||
import kd.bos.dataentity.entity.DynamicObjectCollection;
|
||||
import kd.bos.dataentity.utils.StringUtils;
|
||||
import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||
import kd.bos.entity.plugin.args.AfterOperationArgs;
|
||||
import kd.bos.logging.Log;
|
||||
|
|
@ -57,7 +58,6 @@ public class PurInIotManagePlugin extends AbstractOperationServicePlugIn impleme
|
|||
}
|
||||
tqq9_goodlotmanage.set("number",number);//商品编码
|
||||
tqq9_goodlotmanage.set("tqq9_lot",lotnumber);//批号
|
||||
|
||||
tqq9_goodlotmanage.set("name",name);//商品注册证名称
|
||||
tqq9_goodlotmanage.set("tqq9_brand",tqq9_brand);//商品品牌
|
||||
tqq9_goodlotmanage.set("tqq9_crreatdate",producedate);//生产日期
|
||||
|
|
@ -67,7 +67,7 @@ public class PurInIotManagePlugin extends AbstractOperationServicePlugIn impleme
|
|||
QFilter goodlotmanageF = new QFilter("number", QCP.equals,number);
|
||||
goodlotmanageF=goodlotmanageF.and(new QFilter("tqq9_lot", QCP.equals,lotnumber));
|
||||
DynamicObject tqq9_goodlotmanage1 = BusinessDataServiceHelper.loadSingle("tqq9_goodlotmanage",goodlotmanageF.toArray());
|
||||
if(tqq9_goodlotmanage1==null){
|
||||
if(tqq9_goodlotmanage1==null&& StringUtils.isNotBlank(lotnumber)){
|
||||
falg=true;
|
||||
tqq9_goodlotmanages[i]=tqq9_goodlotmanage;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue