rev:修改合格证入库组盘实体
This commit is contained in:
@@ -2,13 +2,16 @@ package org.nl.wms.external_system.erp;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.github.javaparser.utils.Log;
|
||||
import com.kingdee.bos.webapi.entity.*;
|
||||
import com.kingdee.bos.webapi.sdk.K3CloudApi;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.wms.base_manage.bsrealstorattr.service.impl.StIvtBsrealstorattrServiceImpl;
|
||||
import org.nl.wms.base_manage.customer.service.impl.BmCustomerServiceImpl;
|
||||
import org.nl.wms.base_manage.material.service.dao.MdMeMaterialbase;
|
||||
@@ -177,6 +180,35 @@ public class SyncErpService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 回传测试
|
||||
*/
|
||||
public JSONObject process(JSONObject from) {
|
||||
String result ="";
|
||||
//执行回传
|
||||
String formType = from.getString("formid");
|
||||
try {
|
||||
//要回传的json数据
|
||||
JSONObject formData = from.getJSONObject("data");
|
||||
//todo 需要封装
|
||||
IdentifyInfo identifyInfo = new IdentifyInfo();
|
||||
BeanUtils.copyProperties(erpSec, identifyInfo);
|
||||
K3CloudApi cloudApi = new K3CloudApi(identifyInfo);
|
||||
result = cloudApi.save(formType, formData.toJSONString());
|
||||
Integer sd =0;
|
||||
} catch (Exception ex) {
|
||||
Log.error(ex.getMessage());
|
||||
String sd =result;
|
||||
}
|
||||
return from;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -192,9 +224,9 @@ public class SyncErpService {
|
||||
ErpQuery query = new ErpQuery();
|
||||
// query.setFilterString(filterString);
|
||||
//query.setFormId(syncFormMapping.getForm_type());
|
||||
query.setFormId("PRD_MO");
|
||||
query.setFormId("STK_InStock");
|
||||
query.setFieldKeys("FID");
|
||||
query.setLimit(2);
|
||||
query.setLimit(1);
|
||||
String jsonString = JSON.toJSONString(query);
|
||||
List<List<Object>> lists = cloudApi.executeBillQuery(jsonString);
|
||||
log.info("同步ERP结果" + lists.size());
|
||||
@@ -212,7 +244,7 @@ public class SyncErpService {
|
||||
Map<String, String> error = new HashMap<>();
|
||||
for (String id : ids) {
|
||||
param.setId(id);
|
||||
OperatorResult view = cloudApi.view("PRD_MO", param);
|
||||
OperatorResult view = cloudApi.view("STK_InStock", param);
|
||||
RepoStatus status = view.getResult().getResponseStatus();
|
||||
if (status.isIsSuccess()) {
|
||||
result.add(view.getResult().getResult());
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
package org.nl.wms.flow_manage.flow.service.classprocessimpl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.javaparser.utils.Log;
|
||||
import com.kingdee.bos.webapi.entity.IdentifyInfo;
|
||||
import com.kingdee.bos.webapi.sdk.K3CloudApi;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.wms.external_system.erp.dto.ErpSec;
|
||||
import org.nl.wms.flow_manage.flow.framework.process.nodeType.excess.impl.process.classprocess.ClassProcess;
|
||||
import org.nl.wms.pm_manage.form_data.service.IPmFormDataService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -18,22 +23,35 @@ public class SyncReceiptProcessHandler implements ClassProcess {
|
||||
|
||||
@Autowired
|
||||
IPmFormDataService iPmFormDataService;
|
||||
@Autowired
|
||||
ErpSec erpSec;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public JSONObject process(JSONObject from, JSONObject param) {
|
||||
//执行回传
|
||||
String formType = from.getString("form_type");
|
||||
String code = from.getString("code");
|
||||
if (!formType.contains("RECEIPT")){
|
||||
throw new BadRequestException("回传失败:单据类型不是回传类型单据");
|
||||
try {
|
||||
String code = from.getString("code");
|
||||
if (!formType.contains("RECEIPT")) {
|
||||
throw new BadRequestException("回传失败:单据类型不是回传类型单据");
|
||||
}
|
||||
//要回传的json数据
|
||||
JSONObject formData = from.getJSONObject("form_data");
|
||||
String formid = formData.getString("formid");
|
||||
if (StringUtils.isEmpty(formid)) {
|
||||
throw new BadRequestException("回传失败:回传数据form_data中数据格式不是formid,data类型");
|
||||
}
|
||||
//todo 需要封装
|
||||
IdentifyInfo identifyInfo = new IdentifyInfo();
|
||||
BeanUtils.copyProperties(erpSec, identifyInfo);
|
||||
K3CloudApi cloudApi = new K3CloudApi(identifyInfo);
|
||||
String result = cloudApi.save(formid, formData.toJSONString());
|
||||
} catch (Exception ex) {
|
||||
Log.error(ex.getMessage());
|
||||
}
|
||||
//要回传的json数据
|
||||
JSONObject formData = from.getJSONObject("form_data");
|
||||
String formid = formData.getString("formid");
|
||||
if (StringUtils.isEmpty(formid)){
|
||||
throw new BadRequestException("回传失败:回传数据form_data中数据格式不是formid,data类型");
|
||||
}
|
||||
|
||||
return from;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.pda_manage.iostorage.server.dto;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -122,7 +123,7 @@ public class PdaFormInMst implements Serializable {
|
||||
/**
|
||||
* 单据类型
|
||||
*/
|
||||
private String BillType;
|
||||
private String billType;
|
||||
/**
|
||||
* 供应商Id
|
||||
*/
|
||||
@@ -134,6 +135,18 @@ public class PdaFormInMst implements Serializable {
|
||||
private String ownerId_Id;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 货主表头
|
||||
*/
|
||||
private String ownerIdHead_Id;
|
||||
|
||||
|
||||
/**
|
||||
* 货主类型表头
|
||||
*/
|
||||
private String ownerTypeIdHead;
|
||||
|
||||
/**
|
||||
* 货主类型id
|
||||
*/
|
||||
@@ -156,6 +169,6 @@ public class PdaFormInMst implements Serializable {
|
||||
/**
|
||||
* 入库时间
|
||||
*/
|
||||
private String Date;
|
||||
private String date;
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
package org.nl.wms.pda_manage.iostorage.server.dto;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 收料通知单信息表
|
||||
* </p>
|
||||
*
|
||||
* @author generator
|
||||
* @since 2024-03-25
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class ReceiveBillData implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 单据编码
|
||||
*/
|
||||
private String pCode;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 数量
|
||||
*/
|
||||
private BigDecimal ActReceiveQty;
|
||||
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit_id;
|
||||
|
||||
/**
|
||||
* 批次号
|
||||
*/
|
||||
private String pcsn;
|
||||
|
||||
|
||||
/**
|
||||
* 自定义表单字段
|
||||
*/
|
||||
private String form_data;
|
||||
|
||||
/**
|
||||
* 自定义表单字段父级
|
||||
*/
|
||||
private String pForm_data;
|
||||
|
||||
|
||||
// /**
|
||||
// * 自定义表单字段
|
||||
// */
|
||||
// @TableField(typeHandler = FastjsonTypeHandler.class)
|
||||
// private JSONObject form_data = new JSONObject();
|
||||
//
|
||||
// /**
|
||||
// * 自定义表单字段父级
|
||||
// */
|
||||
// @TableField(typeHandler = FastjsonTypeHandler.class)
|
||||
// private JSONObject pForm_data = new JSONObject();
|
||||
|
||||
|
||||
/**
|
||||
* 条码
|
||||
*/
|
||||
private String bar_code;
|
||||
|
||||
|
||||
/**
|
||||
* 生产组织
|
||||
*/
|
||||
|
||||
private String PurOrgId_Id;
|
||||
|
||||
|
||||
/**
|
||||
* 入库组织
|
||||
*/
|
||||
|
||||
private String DemandOrgId_Id;
|
||||
|
||||
/**
|
||||
* 货主1
|
||||
*/
|
||||
|
||||
private String OwnerIdHead_Id;
|
||||
|
||||
/**
|
||||
* 货主类型1
|
||||
*/
|
||||
|
||||
private String OwnerTypeIdHead;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
|
||||
private String SupplierId_Id;
|
||||
|
||||
/**
|
||||
* 单重
|
||||
*/
|
||||
|
||||
private String single_weight;
|
||||
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
|
||||
private String material_name;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 物料规格
|
||||
*/
|
||||
|
||||
private String material_spec;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
|
||||
private String material_code;
|
||||
|
||||
|
||||
/**
|
||||
* 货主
|
||||
*/
|
||||
|
||||
private String OwnerId_Id;
|
||||
|
||||
/**
|
||||
* 货主类型
|
||||
*/
|
||||
|
||||
private String OwnerTypeId;
|
||||
|
||||
|
||||
/**
|
||||
* 计价单位
|
||||
*/
|
||||
|
||||
private String PriceUnitId_Id;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package org.nl.wms.pda_manage.iostorage.sevice;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.kingdee.bos.webapi.entity.IdentifyInfo;
|
||||
import com.kingdee.bos.webapi.sdk.K3CloudApi;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
@@ -10,13 +11,19 @@ import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.*;
|
||||
import org.nl.wms.base_manage.material.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.base_manage.material.service.impl.MdMeMaterialbaseServiceImpl;
|
||||
import org.nl.wms.base_manage.measure.service.dao.BmMeasureUnit;
|
||||
import org.nl.wms.base_manage.measure.service.impl.BmMeasureUnitServiceImpl;
|
||||
import org.nl.wms.config_manage.form_struc.service.IBmFormStrucService;
|
||||
import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc;
|
||||
import org.nl.wms.external_system.erp.dto.ErpQuery;
|
||||
import org.nl.wms.external_system.erp.dto.ErpSec;
|
||||
import org.nl.wms.pda_manage.iostorage.server.dto.PdaFormOutDtl;
|
||||
import org.nl.wms.pda_manage.iostorage.server.dto.PdaFormOutMst;
|
||||
import org.nl.wms.pda_manage.iostorage.server.dto.ReceiveBillData;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.mapper.PmFormDataMapper;
|
||||
import org.nl.wms.stor_manage.io.service.iostor.IStIvtIostorinvService;
|
||||
import org.nl.wms.stor_manage.io.service.iostor.dao.StIvtIostorinv;
|
||||
import org.nl.wms.stor_manage.io.service.iostor_dtl.IStIvtIostorinvdtlService;
|
||||
@@ -44,6 +51,15 @@ public class PdaIOService {
|
||||
@Autowired
|
||||
IStIvtIostorinvdtlService iStIvtIostorinvdtlService;
|
||||
|
||||
@Autowired
|
||||
BmMeasureUnitServiceImpl bmMeasureUnitServiceImpl;
|
||||
|
||||
@Autowired
|
||||
MdMeMaterialbaseServiceImpl mdMeMaterialbaseServiceImpl;
|
||||
|
||||
@Autowired
|
||||
PmFormDataMapper pmFormDataMapper;
|
||||
|
||||
|
||||
public void PpdaOrderOutStorage(PdaFormOutMst pdaFormOutMst) {
|
||||
PdaIOService ioService = SpringContextHolder.getBean(PdaIOService.class);
|
||||
@@ -125,13 +141,53 @@ public class PdaIOService {
|
||||
public PmFormData getCertificateInfo(String id) {
|
||||
PmFormData result = new PmFormData();
|
||||
try {
|
||||
if (id.contains("OP")||id.contains("op")) {
|
||||
if (id.contains("OP") || id.contains("op")) {
|
||||
getOpBills(id, result);
|
||||
} else {
|
||||
|
||||
ReceiveBillData receiveBillData = pmFormDataMapper.queryReceiveBill(id);
|
||||
if (receiveBillData != null) {
|
||||
String form_data = receiveBillData.getForm_data();
|
||||
String pForm_data = receiveBillData.getPForm_data();
|
||||
JSONObject formJson = JSONObject.parseObject(form_data);
|
||||
JSONObject pFormJson = JSONObject.parseObject(pForm_data);
|
||||
if (ObjectUtils.isNotEmpty(formJson) && ObjectUtils.isNotEmpty(pFormJson)) {
|
||||
result.setPrdOrgId(pFormJson.getString("PurOrgId_Id"));
|
||||
result.setStockOrgId(pFormJson.getString("DemandOrgId_Id"));
|
||||
result.setOwnerIdHead_Id(pFormJson.getString("OwnerIdHead_Id"));
|
||||
result.setOwnerTypeIdHead(pFormJson.getString("OwnerTypeIdHead"));
|
||||
result.setSupplierId(pFormJson.getString("SupplierId_Id"));
|
||||
result.setMoNumber(formJson.getString("OrderBillNo"));
|
||||
result.setQty(new BigDecimal(formJson.getString("ActReceiveQty")));
|
||||
result.setOwnerId_Id(StringUtils.isBlank(formJson.getString("OwnerId_Id"))?"750572":formJson.getString("OwnerId_Id"));
|
||||
result.setOwnerTypeId(formJson.getString("OwnerTypeId"));
|
||||
result.setRemainInStockUnitId(formJson.getString("PriceUnitId_Id"));
|
||||
result.setBillNo(receiveBillData.getPCode());
|
||||
result.setMaterial_id(receiveBillData.getMaterial_id());
|
||||
result.setUnit_id(receiveBillData.getUnit_id());
|
||||
result.setPcsn(receiveBillData.getPcsn());
|
||||
} else {
|
||||
throw new BadRequestException("合格证信息有误!");
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestException("未查询到该合格证信息!");
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
throw new BadRequestException("未查询到对应合格证信息!");
|
||||
throw new BadRequestException("未查询到该合格证信息!");
|
||||
}
|
||||
if (StringUtils.isNotBlank(result.getUnit_id())) {
|
||||
List<BmMeasureUnit> bmMeasureUnitList = bmMeasureUnitServiceImpl.list(new LambdaQueryWrapper<BmMeasureUnit>().eq(BmMeasureUnit::getUnit_id, result.getUnit_id()));
|
||||
if (ObjectUtils.isNotEmpty(bmMeasureUnitList)) {
|
||||
result.setUnit_name(bmMeasureUnitList.get(0).getUnit_name());
|
||||
}
|
||||
}
|
||||
if (StringUtils.isNotBlank(result.getMaterial_id())) {
|
||||
List<MdMeMaterialbase> materialbaseList = mdMeMaterialbaseServiceImpl.list(new LambdaQueryWrapper<MdMeMaterialbase>().eq(MdMeMaterialbase::getMaterial_id, result.getMaterial_id()));
|
||||
if (ObjectUtils.isNotEmpty(materialbaseList)) {
|
||||
result.setMaterial_code(materialbaseList.get(0).getMaterial_code());
|
||||
result.setMaterial_spec(materialbaseList.get(0).getMaterial_spec());
|
||||
result.setMaterial_name(materialbaseList.get(0).getMaterial_name());
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -147,25 +203,33 @@ public class PdaIOService {
|
||||
ErpQuery query = new ErpQuery();
|
||||
query.setFilterString(filterString);
|
||||
query.setFormId("SFC_OperationPlanning");
|
||||
query.setFieldKeys("FBillNo,FProOrgId,FProductId,FProductName,FProSpecification,FMOQty,FMOUnitId,FOwnerId,FLot,FProDepartmentId,FStockInOrgId");
|
||||
query.setFieldKeys("FBillNo,FProOrgId,FStockInOrgId,FProductId,FProductName,FProSpecification,FMOQty,FMOUnitId,FOwnerId,FLot,FProDepartmentId,FMONumber,FMOEntrySeq,FOwnerTypeId");
|
||||
query.setLimit(1);
|
||||
String jsonString = JSON.toJSONString(query);
|
||||
List<List<Object>> lists = cloudApi.executeBillQuery(jsonString);
|
||||
if (ObjectUtils.isNotEmpty(lists)) {
|
||||
List<Object> dataList = lists.get(0);
|
||||
if (dataList != null && !dataList.isEmpty()) {
|
||||
result.setCode(dataList.get(0).toString());
|
||||
result.setBillNo(dataList.get(0).toString());
|
||||
result.setPrdOrgId(dataList.get(1).toString());
|
||||
result.setMaterial_id(dataList.get(2).toString());
|
||||
result.setMaterial_name(dataList.get(3).toString());
|
||||
result.setMaterial_spec(dataList.get(4).toString());
|
||||
result.setQty(new BigDecimal(dataList.get(5).toString()));
|
||||
result.setUnit_id(dataList.get(6).toString());
|
||||
result.setOwnerId(dataList.get(7).toString());
|
||||
result.setPcsn(dataList.get(8).toString());
|
||||
result.setProduct_area(dataList.get(9).toString());
|
||||
//result.setStockId(dataList.get(10).toString());
|
||||
result.setStockOrgId(dataList.get(2).toString());
|
||||
result.setMaterial_id(dataList.get(3).toString());
|
||||
result.setMaterial_name(dataList.get(4).toString());
|
||||
result.setMaterial_spec(dataList.get(5).toString());
|
||||
result.setQty(new BigDecimal(dataList.get(6).toString()));
|
||||
result.setUnit_id(dataList.get(7).toString());
|
||||
result.setOwnerId_Id(dataList.get(8).toString());
|
||||
result.setPcsn(dataList.get(9).toString());
|
||||
result.setProduct_area(dataList.get(10).toString());
|
||||
result.setMoNumber(dataList.get(11).toString());
|
||||
result.setMoEntrySeq(dataList.get(12).toString());
|
||||
result.setOwnerTypeId(dataList.get(13).toString());
|
||||
//查询仓库信息
|
||||
String stockId = pmFormDataMapper.queryOrderStockId(result.getMoNumber(), result.getMoEntrySeq());
|
||||
result.setStockId(stockId);
|
||||
}
|
||||
} else {
|
||||
throw new BadRequestException("未查询到该合格证信息!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,52 +1,25 @@
|
||||
package org.nl.wms.pda_manage.iostorage.sevice;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.kingdee.bos.webapi.entity.IdentifyInfo;
|
||||
import com.kingdee.bos.webapi.sdk.K3CloudApi;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.domain.exception.BadRequestException;
|
||||
import org.nl.common.enums.StatusEnum;
|
||||
import org.nl.common.utils.*;
|
||||
import org.nl.common.utils.ListOf;
|
||||
import org.nl.wms.base_manage.material.service.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.base_manage.material.service.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.base_manage.measure.service.IBmMeasureUnitService;
|
||||
import org.nl.wms.base_manage.measure.service.dao.BmMeasureUnit;
|
||||
import org.nl.wms.base_manage.vehicle.service.IBmVehicleInfoService;
|
||||
import org.nl.wms.base_manage.vehicle.service.dao.BmVehicleInfo;
|
||||
import org.nl.wms.config_manage.form_struc.service.IBmFormStrucService;
|
||||
import org.nl.wms.config_manage.form_struc.service.dao.BmFormStruc;
|
||||
import org.nl.wms.external_system.erp.dto.ErpQuery;
|
||||
import org.nl.wms.external_system.erp.dto.ErpSec;
|
||||
import org.nl.wms.md_manage.group_dick.service.IMdGruopDickService;
|
||||
import org.nl.wms.pda_manage.group.dto.GroupItemData;
|
||||
import org.nl.wms.pda_manage.group.dto.MaterGroupDto;
|
||||
import org.nl.wms.pda_manage.group.dto.MaterItem;
|
||||
import org.nl.wms.pda_manage.iostorage.server.dto.PdaFormInMst;
|
||||
import org.nl.wms.pda_manage.iostorage.server.dto.PdaFormOutDtl;
|
||||
import org.nl.wms.pda_manage.iostorage.server.dto.PdaFormOutMst;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import org.nl.wms.stor_manage.io.service.iostor.IStIvtIostorinvService;
|
||||
import org.nl.wms.stor_manage.io.service.iostor.dao.StIvtIostorinv;
|
||||
import org.nl.wms.stor_manage.io.service.iostor_dtl.IStIvtIostorinvdtlService;
|
||||
import org.nl.wms.stor_manage.io.service.iostor_dtl.dao.StIvtIostorinvdtl;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class PdaInIOService {
|
||||
|
||||
@Autowired
|
||||
IMdGruopDickService iMdGruopDickService;
|
||||
|
||||
@@ -111,4 +84,6 @@ public class PdaInIOService {
|
||||
groupDto.setItem(ListOf.of(materItem));
|
||||
iMdGruopDickService.groupDick((JSONObject) JSONObject.toJSON(groupDto));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -143,17 +143,45 @@ public class PmFormData implements Serializable {
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 条码
|
||||
*/
|
||||
private String bar_code;
|
||||
|
||||
|
||||
/**
|
||||
* 生产组织
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String prdOrgId;
|
||||
|
||||
|
||||
/**
|
||||
* 入库组织
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String stockOrgId;
|
||||
|
||||
/**
|
||||
* 货主
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ownerId_Id;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 货主1
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ownerId;
|
||||
private String ownerIdHead_Id;
|
||||
|
||||
|
||||
/**
|
||||
* 货主类型1
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ownerTypeIdHead;
|
||||
|
||||
|
||||
|
||||
@@ -164,6 +192,12 @@ public class PmFormData implements Serializable {
|
||||
private String material_name;
|
||||
|
||||
|
||||
/**
|
||||
* 单重
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String single_weight;
|
||||
|
||||
|
||||
/**
|
||||
* 物料规格
|
||||
@@ -171,6 +205,12 @@ public class PmFormData implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private String material_spec;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String material_code;
|
||||
|
||||
/**
|
||||
* 生产车间
|
||||
*/
|
||||
@@ -183,11 +223,49 @@ public class PmFormData implements Serializable {
|
||||
@TableField(exist = false)
|
||||
private String stockId;
|
||||
|
||||
|
||||
/**
|
||||
* 条码
|
||||
* 生产订单编号
|
||||
*/
|
||||
private String bar_code;
|
||||
@TableField(exist = false)
|
||||
private String moNumber;
|
||||
|
||||
/**
|
||||
* 生产订单行号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String moEntrySeq;
|
||||
|
||||
/**
|
||||
* 单据编号
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String billNo;
|
||||
|
||||
|
||||
/**
|
||||
* 单位名称
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String unit_name;
|
||||
|
||||
/**
|
||||
* 货主类型
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String ownerTypeId;
|
||||
|
||||
|
||||
/**
|
||||
* 供应商
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String supplierId;
|
||||
|
||||
/**
|
||||
* 计价单位
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String remainInStockUnitId;
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.pm_manage.form_data.service.dao.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import org.nl.wms.pda_manage.iostorage.server.dto.ReceiveBillData;
|
||||
import org.nl.wms.pm_manage.form_data.service.dao.PmFormData;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.nl.wms.pm_manage.form_data.service.dto.FormDataQuery;
|
||||
@@ -28,4 +29,10 @@ public interface PmFormDataMapper extends BaseMapper<PmFormData> {
|
||||
List<PmFormDataDto> selectChilds(List<String> parents);
|
||||
@Update("${sql}")
|
||||
void dynamicSql(@Param("sql")String sql);
|
||||
|
||||
|
||||
String queryOrderStockId(@Param("code")String code,@Param("seq")String seq);
|
||||
|
||||
ReceiveBillData queryReceiveBill(@Param("bar_code")String bar_code);
|
||||
|
||||
}
|
||||
|
||||
@@ -159,4 +159,23 @@
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="queryOrderStockId" resultType="java.lang.String">
|
||||
SELECT d.bar_code
|
||||
FROM pm_form_data d
|
||||
JOIN pm_form_data p ON d.parent_id = p.id
|
||||
WHERE p.CODE = #{code}
|
||||
AND d.pcsn = #{seq}
|
||||
</select>
|
||||
<select id="queryReceiveBill" resultType="org.nl.wms.pda_manage.iostorage.server.dto.ReceiveBillData">
|
||||
SELECT d.unit_id,
|
||||
d.pcsn,
|
||||
d.form_data,
|
||||
d.material_id,
|
||||
d.bar_code,
|
||||
p.code AS pCode,
|
||||
p.form_data AS pForm_data
|
||||
FROM pm_form_data d
|
||||
JOIN pm_form_data p ON d.parent_id = p.id
|
||||
WHERE d.bar_code= #{bar_code}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -116,12 +116,22 @@ public class SyncFormMappingController {
|
||||
//参数判读,参数解析,调用参数入库
|
||||
SyncFormMapping syncFormMapping = form.toJavaObject(SyncFormMapping.class);
|
||||
List<Object> objects = syncErpService.syncData(syncFormMapping);
|
||||
List<PmFormData> pmFormDatas = formDataService.syncAnalyse(syncFormMapping, JSON.toJSONString(objects));
|
||||
formDataService.saveBatch(pmFormDatas);
|
||||
// List<PmFormData> pmFormDatas = formDataService.syncAnalyse(syncFormMapping, JSON.toJSONString(objects));
|
||||
// formDataService.saveBatch(pmFormDatas);
|
||||
return new ResponseEntity<>(TableDataInfo.build(objects),HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/process")
|
||||
@Log("回传测试")
|
||||
public ResponseEntity<Object> process(@RequestBody JSONObject form){
|
||||
//参数判读,参数解析,调用参数入库
|
||||
JSONObject result = syncErpService.process(form);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user