采购入库单修改

jg-waiwang-pro
vayne 5 months ago
parent 8643d04873
commit 06438f77bd

@ -0,0 +1,32 @@
package baiduUtils;
import cn.hutool.core.util.ObjectUtil;
import com.github.pagehelper.util.StringUtil;
import java.beans.BeanInfo;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
public class BeanUtil {
/**
* BeanMerge(beanCopy)
* @Author zhengkai.blog.csdn.net
*/
public static <M> void merge(M target, M destination) throws Exception {
//获取目标bean
BeanInfo beanInfo = Introspector.getBeanInfo(target.getClass());
// 遍历所有属性
for (PropertyDescriptor descriptor : beanInfo.getPropertyDescriptors()) {
// 如果是可写属性
if (descriptor.getWriteMethod() != null) {
Object defaultValue = descriptor.getReadMethod().invoke(destination);
//可以使用StringUtil.isNotEmpty(defaultValue)来判断
if(ObjectUtil.isNotEmpty(defaultValue)){
//用非空的defaultValue值覆盖到target去
descriptor.getWriteMethod().invoke(target, defaultValue);
}
}
}
}
}

@ -1,6 +1,8 @@
package jnpf.controller;
import baiduUtils.BeanUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
@ -11,11 +13,13 @@ import jnpf.engine.service.FlowTaskNodeService;
import jnpf.engine.service.FlowTaskService;
import jnpf.exception.DataException;
import jnpf.model.yunguan.YunguanPurchaseInBoundModel;
import jnpf.model.yunguan.YunguanPurchaseOrderProductModel;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.warehousingstorage.*;
import jnpf.util.wxutil.HttpUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.jdbc.Null;
import org.springframework.beans.factory.annotation.Autowired;
@ -731,9 +735,16 @@ public class WarehousingStorageController {
}
if (entity.getWarehousingStorageType().equals("1")){
YunguanPurchaseInBoundModel yunguanPurchaseInBoundModel = warehousingStorageService.purchaseInBoundByYunGuan(id);
List<YunguanPurchaseInBoundModel> yunguanPurchaseProductInBoundModel = warehousingStorageService.purchaseInBoundProductByYunGuanInfo(id);
for (YunguanPurchaseInBoundModel model : yunguanPurchaseProductInBoundModel){
List<YunguanPurchaseInBoundModel> yunguanPurchaseProductInBoundModelList = warehousingStorageService.purchaseInBoundProductByYunGuanInfo(id);
for (YunguanPurchaseInBoundModel model : yunguanPurchaseProductInBoundModelList){
BeanUtil.merge(model,yunguanPurchaseInBoundModel);
}
if (yunguanPurchaseProductInBoundModelList != null && yunguanPurchaseProductInBoundModelList.size()>0) {
JSONObject purchaseCode = HttpUtil.httpRequest("http://172.16.1.50:8020/fggj/pur/stoIn", "POST", JsonUtil.getObjectToString(yunguanPurchaseProductInBoundModelList));
if (ObjectUtil.isNotEmpty(purchaseCode)){
if (purchaseCode.get("code").equals("200")) {
}
}
}
}
}

@ -823,9 +823,8 @@ export default {
inventoryUnitId: e.inventoryUnitId,
storageUnit: e.inventoryUnitId,
storageAreaId: e.storageAreaId,
storageNumber: e.storageNumber,
storageNumber: e.notificationStorageNumber,
receivedQuantity: e.receivedQuantity,
dateManufacture: new Date().getTime()
}
this.dataForm.warehousingStorageProductList.push(item)

Loading…
Cancel
Save