|
|
|
@ -11,6 +11,7 @@ import com.glxp.mipsdl.admin.dao.basic.*;
|
|
|
|
|
import com.glxp.mipsdl.admin.dao.business.StockOrderDao;
|
|
|
|
|
import com.glxp.mipsdl.admin.dao.business.StockOrderDetailDao;
|
|
|
|
|
import com.glxp.mipsdl.admin.dao.business.StockOrderUploadLogDao;
|
|
|
|
|
import com.glxp.mipsdl.admin.dao.inout.CodesDao;
|
|
|
|
|
import com.glxp.mipsdl.admin.dao.inout.OrderDao;
|
|
|
|
|
import com.glxp.mipsdl.admin.dao.inventory.InvWarehouseDao;
|
|
|
|
|
import com.glxp.mipsdl.admin.dao.phxyy.BasicThirdSysDetailDao;
|
|
|
|
@ -92,6 +93,10 @@ public class PhxyyClient {
|
|
|
|
|
private BussinessOriginTypeService bussinessOriginTypeService;
|
|
|
|
|
@Resource
|
|
|
|
|
SubmitOrderUtils submitOrderUtils;
|
|
|
|
|
@Resource
|
|
|
|
|
CodesDao codesDao;
|
|
|
|
|
@Resource
|
|
|
|
|
UnitMaintainDao unitMaintainDao;
|
|
|
|
|
|
|
|
|
|
public HttpHeaders getHeaders() {
|
|
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
|
@ -230,9 +235,14 @@ public class PhxyyClient {
|
|
|
|
|
|
|
|
|
|
InvWarehouseEntity invWarehouseEntity = invWarehouseDao.selectOneByCode(orderEntity.getInvStorageCode());
|
|
|
|
|
try {
|
|
|
|
|
ThrInvWarehouseEntity thrInvWarehouseEntity = thrInvWarehouseDao.selectByCode(invWarehouseEntity.getThirdId(), thirdId);
|
|
|
|
|
udiwmsOrderRequest.setLocStorageCode(thrInvWarehouseEntity.getCode());
|
|
|
|
|
udiwmsOrderRequest.setLocStorageName(thrInvWarehouseEntity.getName());
|
|
|
|
|
if (StrUtil.isNotEmpty(invWarehouseEntity.getThirdId())) {
|
|
|
|
|
ThrInvWarehouseEntity thrInvWarehouseEntity = thrInvWarehouseDao.selectByCode(invWarehouseEntity.getThirdId(), thirdId);
|
|
|
|
|
udiwmsOrderRequest.setLocStorageCode(thrInvWarehouseEntity.getCode());
|
|
|
|
|
udiwmsOrderRequest.setLocStorageName(thrInvWarehouseEntity.getName());
|
|
|
|
|
} else {
|
|
|
|
|
return ResultVOUtils.error(500, "未绑定第三方仓库!");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
log.error("查询第三方系统仓库异常", e);
|
|
|
|
|
}
|
|
|
|
@ -254,6 +264,34 @@ public class PhxyyClient {
|
|
|
|
|
} else if (ConstantType.TYPE_OUT.equals(mainAction)) {
|
|
|
|
|
udiwmsOrderRequest.setInoutType(2); //出入库类型:出库
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// //出库单转入库单
|
|
|
|
|
// if (StrUtil.nullToEmpty(thirdSysBusApiEntity.getUrl()).equals("useOut")) {
|
|
|
|
|
// //使用部门
|
|
|
|
|
// udiwmsOrderRequest.setUseDeptCode(udiwmsOrderRequest.getLocStorageCode());
|
|
|
|
|
// udiwmsOrderRequest.setUseDeptName(udiwmsOrderRequest.getLocStorageName());
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// ThrInvWarehouseEntity deviceInv = thrInvWarehouseDao.selectByCode("29", thirdId);
|
|
|
|
|
// udiwmsOrderRequest.setLocStorageCode("29");
|
|
|
|
|
// udiwmsOrderRequest.setLocStorageName(deviceInv.getName());
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// udiwmsOrderRequest.setInoutType(1); //出入库类型:入库
|
|
|
|
|
//
|
|
|
|
|
// List<WarehouseEntity> warehouseEntities = codesDao.findByReceiptId(stockOrderEntity.getOrderIdFk());
|
|
|
|
|
// if (CollUtil.isNotEmpty(warehouseEntities)) {
|
|
|
|
|
// UnitMaintainEntity unitMaintainEntity = unitMaintainDao.selectThirdInfoByErpId(warehouseEntities.get(0).getSupId());
|
|
|
|
|
// udiwmsOrderRequest.setCorpId(unitMaintainEntity.getThirdId());
|
|
|
|
|
// udiwmsOrderRequest.setCorpName(unitMaintainEntity.getThirdName());
|
|
|
|
|
// }
|
|
|
|
|
//// udiwmsOrderRequest.setCorpId(udiwmsOrderRequest.getLocStorageCode());
|
|
|
|
|
//// udiwmsOrderRequest.setCorpName(udiwmsOrderRequest.getLocStorageName());
|
|
|
|
|
//
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
udiwmsOrderRequest.setRemark("udi管理系统提交单据"); //备注
|
|
|
|
|
|
|
|
|
|
//组装明细数据
|
|
|
|
@ -263,10 +301,10 @@ public class PhxyyClient {
|
|
|
|
|
UdiwmsOrderDetail item = new UdiwmsOrderDetail();
|
|
|
|
|
BeanUtil.copyProperties(stockOrderDetailEntity, item);
|
|
|
|
|
if (StrUtil.isNotEmpty(stockOrderDetailEntity.getProductDate())) {
|
|
|
|
|
item.setProductDate(com.glxp.mipsdl.admin.util.DateUtil.formatExpireTime("20" + stockOrderDetailEntity.getProductDate()));
|
|
|
|
|
// item.setProductDate(com.glxp.mipsdl.admin.util.DateUtil.formatExpireTime("20" + stockOrderDetailEntity.getProductDate()));
|
|
|
|
|
}
|
|
|
|
|
if (StrUtil.isNotEmpty(stockOrderDetailEntity.getExpireDate())) {
|
|
|
|
|
item.setExpireDate(com.glxp.mipsdl.admin.util.DateUtil.formatExpireTime("20" + stockOrderDetailEntity.getExpireDate()));
|
|
|
|
|
// item.setExpireDate(com.glxp.mipsdl.admin.util.DateUtil.formatExpireTime("20" + stockOrderDetailEntity.getExpireDate()));
|
|
|
|
|
}
|
|
|
|
|
item.setMeasname(udiRelevanceEntity.getMeasname());
|
|
|
|
|
item.setStandard(stockOrderDetailEntity.getSpec());
|
|
|
|
@ -309,6 +347,7 @@ public class PhxyyClient {
|
|
|
|
|
uploadLog.setThrBillNo(null);
|
|
|
|
|
uploadLog.setResult("提交成功");
|
|
|
|
|
stockOrderUploadLogDao.insert(uploadLog);
|
|
|
|
|
orderDao.updateOrder(orderEntity);
|
|
|
|
|
return ResultVOUtils.success("提交成功");
|
|
|
|
|
}
|
|
|
|
|
uploadLog.setStatus(3);
|
|
|
|
|