平潭单据上传修改

dev
anthonywj 2 years ago
parent 624e69e6f8
commit 35f13c824e

@ -179,8 +179,8 @@ public class PtxhyyClient extends CommonHttpClient {
List<IoOrderDetailBizEntity> detailBizEntities = orderDetailBizDao.selectList(new LambdaQueryWrapper<IoOrderDetailBizEntity>().eq(IoOrderDetailBizEntity::getOrderIdFk, orderEntity.getBillNo()));
//单据金额
BigDecimal djje = detailBizEntities.stream().map(IoOrderDetailBizEntity::getPrice).reduce(BigDecimal.ONE, BigDecimal::add);
List<IoOrderInvoiceEntity> ioOrderInvoiceEntities = IoOrderInvoiceEntity.builder().build().selectList(Wrappers.lambdaQuery(IoOrderInvoiceEntity.class).eq(IoOrderInvoiceEntity::getOrderIdFk, orderEntity.getId()));
BigDecimal djje = detailBizEntities.stream().map(IoOrderDetailBizEntity::getPrice).reduce(BigDecimal.ZERO, BigDecimal::add);
List<IoOrderInvoiceEntity> ioOrderInvoiceEntities = IoOrderInvoiceEntity.builder().build().selectList(Wrappers.lambdaQuery(IoOrderInvoiceEntity.class).eq(IoOrderInvoiceEntity::getOrderIdFk, orderEntity.getBillNo()));
int fbbz = 0;
if (CollectionUtil.isNotEmpty(ioOrderInvoiceEntities) && ioOrderInvoiceEntities.size() > 0) {
fbbz = 1;
@ -193,7 +193,7 @@ public class PtxhyyClient extends CommonHttpClient {
}
} catch (Exception e) {
log.info("查询操作人异常", ExceptionUtil.stacktraceToString(e));
return ResultVOUtils.error(500, "查询操作人异常!");
userName = getUserName(orderEntity);
}
PtxhyyOrderRequest ptxhyyOrderRequest = PtxhyyOrderRequest
.builder()
@ -211,7 +211,10 @@ public class PtxhyyClient extends CommonHttpClient {
.udixh(udiwmsOrderRequest.getBillNo())
.build();
ptxhyyOrderRequest.setDetailList(new ArrayList<>());
setOrderDetailList(ioCodeEntities, items, detailBizEntities);
String errMs = setOrderDetailList(ioCodeEntities, items, detailBizEntities);
if (errMs != null) {
return ResultVOUtils.error(500, errMs);
}
Collections.reverse(items);
for (UdiwmsOrderDetailRequest i : items) {
String udim = "";
@ -219,23 +222,28 @@ public class PtxhyyClient extends CommonHttpClient {
udim = i.getCodeList().stream().map(UdiwmsOrderDetailRequest.CodeDetailEntity::getCode).collect(Collectors.joining(","));
}
String fphm = "";
LocalDateTime fprq = null;
String fprq = null;
if (CollectionUtil.isNotEmpty(ioOrderInvoiceEntities)) {
List<IoOrderInvoiceEntity> invoiceList = ioOrderInvoiceEntities.stream().filter(s -> i.getBindRlFk().equals(s.getBindRlFk()) && i.getBatchNo().equals(s.getBatchNo()))
.sorted(Comparator.comparing(IoOrderInvoiceEntity::getInvoiceDate, Comparator.reverseOrder())).collect(Collectors.toList());
if (CollectionUtil.isNotEmpty(invoiceList)) {
fphm = invoiceList.stream().map(IoOrderInvoiceEntity::getInvoiceCode).collect(Collectors.joining(","));
fprq = LocalDateTime.parse(DateUtil.formatDateTime(invoiceList.get(0).getInvoiceDate()));
if (invoiceList.get(0).getInvoiceDate() != null)
fprq = DateUtil.formatDateTime(invoiceList.get(0).getInvoiceDate());
ioOrderInvoiceEntities.removeAll(invoiceList);
}
}
BigDecimal wzje = i.getPrice().multiply(BigDecimal.valueOf(i.getCount().intValue()));
PtxhyyOrderDetailRequest detailRequest = PtxhyyOrderDetailRequest.builder()
.wzxh(i.getProductId())
.cjxh(i.getManufactoryCode())
.bzdw(i.getMeasname())
.bzsl(i.getCount())
.wzjg(i.getPrice())
.lsje(i.getPrice())
.lsjg(i.getPrice() + "")
.lsje(wzje)
.wzje(wzje + "")
.udim(udim)
.hsfl(i.getCplb())
.wzph(i.getBatchNo())
@ -256,13 +264,17 @@ public class PtxhyyClient extends CommonHttpClient {
* @param orderDetailRequests
* @param detailBizEntities
*/
private void setOrderDetailList(List<IoCodeEntity> ioCodeEntities, List<UdiwmsOrderDetailRequest> orderDetailRequests, List<IoOrderDetailBizEntity> detailBizEntities) {
private String setOrderDetailList(List<IoCodeEntity> ioCodeEntities, List<UdiwmsOrderDetailRequest> orderDetailRequests, List<IoOrderDetailBizEntity> detailBizEntities) {
for (IoOrderDetailBizEntity detailBizEntity : detailBizEntities) {
UdiwmsOrderDetailRequest item = submitOrderUtil.buildProductInfo(detailBizEntity);
if (item == null) {
return detailBizEntity.getNameCode() + "第三方产品编码未关联";
}
//封装条码信息
submitOrderUtil.setCodeList(ioCodeEntities, detailBizEntity, item);
orderDetailRequests.add(item);
}
return null;
}
@Resource
@ -280,15 +292,18 @@ public class PtxhyyClient extends CommonHttpClient {
public String getUserName(IoOrderEntity orderEntity) {
//创建人非供应商
if (StrUtil.isNotEmpty(orderEntity.getCreateUser()) && orderEntity.getCreateUser().length() != 14) {
if (StrUtil.isNotEmpty(orderEntity.getCheckUser())) {
AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getReviewUser());
return authUserEntity.getUserName();
} else if (StrUtil.isNotEmpty(orderEntity.getReviewUser())) {
AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getReviewUser());
return authUserEntity.getUserName();
} else if (StrUtil.isNotEmpty(orderEntity.getCreateUser()) && orderEntity.getCreateUser().length() != 14) {
AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getCreateUser());
return authUserEntity.getUserName();
} else if (StrUtil.isNotEmpty(orderEntity.getUpdateUser()) && orderEntity.getUpdateUser().length() != 14) {
AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getUpdateUser());
return authUserEntity.getUserName();
} else if (StrUtil.isNotEmpty(orderEntity.getReviewUser())) {
AuthUserEntity authUserEntity = authUserDao.selectById(orderEntity.getReviewUser());
return authUserEntity.getUserName();
} else {
List<AuthWarehouseUser> authWarehouseUsers = authWarehouseUserMapper.selectList(new QueryWrapper<AuthWarehouseUser>().eq("code", orderEntity.getInvCode()));
if (CollUtil.isNotEmpty(authWarehouseUsers)) {
@ -299,6 +314,15 @@ public class PtxhyyClient extends CommonHttpClient {
}
public String getDefaultUserName(IoOrderEntity orderEntity) {
List<AuthWarehouseUser> authWarehouseUsers = authWarehouseUserMapper.selectList(new QueryWrapper<AuthWarehouseUser>().eq("code", orderEntity.getInvCode()));
if (CollUtil.isNotEmpty(authWarehouseUsers)) {
return authWarehouseUsers.get(0).getUserName();
}
return null;
}
public BaseResponse submitOrder(IoOrderEntity orderEntity, Object udiwmsOrderRequest) {
//记录日志
IoOrderUploadLogEntity uploadLog = new IoOrderUploadLogEntity();
@ -310,8 +334,6 @@ public class PtxhyyClient extends CommonHttpClient {
String response = httpClient.postJson(thrSystemDetailService.getUrl(Constants.URL_NAME_ORDER_SUBMIT_URL), udiwmsOrderRequest);
if (StrUtil.isNotBlank(response)) {
try {
// BaseResponse baseResponse = JSONObject.parseObject(response, BaseResponse.class);
BaseResponse<OrderUploadResponse> baseResponse =
JSONObject.parseObject(response, new TypeReference<BaseResponse<OrderUploadResponse>>() {
});

@ -8,9 +8,6 @@ import lombok.Data;
import java.util.Date;
/**
*
*/
@Data
@TableName(value = "io_order")
public class IoOrderEntity {
@ -43,7 +40,7 @@ public class IoOrderEntity {
private String action;
/**
*
*
*/
@TableField(value = "fromCorp")
private String fromCorp;
@ -114,6 +111,13 @@ public class IoOrderEntity {
@TableField(value = "auditTime")
private Date auditTime;
@TableField(value = "checkUser")
private String checkUser;
@TableField(value = "checkTime")
private Date checkTime;
/**
* ID
*/
@ -121,13 +125,13 @@ public class IoOrderEntity {
private String customerId;
/**
*
*
*/
@TableField(value = "deptCode")
private String deptCode;
/**
*
*
*/
@TableField(value = "invCode")
private String invCode;
@ -168,24 +172,6 @@ public class IoOrderEntity {
@TableField(value = "replicateNo")
private String replicateNo;
/**
* ,
*/
@TableField(value = "preOutBillNo")
private String preOutBillNo;
/**
*
*/
@TableField(value = "preInBillNo")
private String preInBillNo;
/**
*
*/
@TableField(value = "errMsg")
private String errMsg;
/**
*
*/
@ -198,17 +184,37 @@ public class IoOrderEntity {
@TableField(value = "remark")
private String remark;
@TableField(value = "errMsg")
private String errMsg;
@TableField(value = "preOutBillNo")
private String preOutBillNo;
@TableField(value = "preInBillNo")
private String preInBillNo;
@TableField(value = "entrustEnd")
private boolean entrustEnd;
@TableField(value = "reviewSp")
private boolean reviewSp; //是否验收外网单据时,需忽略流转更改为待审核
/**
* 1.2:3:
* 1.2:,3. 稿
*/
@TableField(value = "orderType")
private Integer orderType;
/**
*
*/
@TableField(value = "entrustEnd")
private Boolean entrustEnd;
//单据同步状态
@TableField(value = "syncStatus")
private Integer syncStatus;
@TableField(value = "fromReceiveBillNo")
private String fromReceiveBillNo;
@TableField(value = "fromThrBillNo")
private String fromThrBillNo;
/**
* /0.1.2.
@ -217,4 +223,47 @@ public class IoOrderEntity {
private Integer exportStatus;
}
@TableField(value = "busType")
private Integer busType; //1:正常2送货3.到货
@TableField(value = "deliveryStatus")
private Integer deliveryStatus; //单据送货验收状态
@TableField(value = "processStatus")
private Integer processStatus; //退货单据处理状态
@TableField(value = "inCodeStatus")
private Integer inCodeStatus; //内部码生成状态
@TableField(value = "relKey")
private String relKey; //关联单据唯一键
@TableField(value = "suppleCount")
private Integer suppleCount; //补单次数
@TableField(value = "checkStatus")
private Integer checkStatus; //确认状态
// 预验收按单出库,退货
@TableField(value = "checkPreInOrders")
private String checkPreInOrders;
// 预验收按货位出库,退货
@TableField(value = "checkPreInInvCode")
private String checkPreInInvCode;
// 预验收按货位出库,退货
@TableField(value = "checkPreInSpaceCode")
private String checkPreInSpaceCode;
// 当前货位
@TableField(value = "curSpaceCode")
private String curSpaceCode;
// 预验收、寄售当前货位
@TableField(value = "preCurSpaceCode")
private String preCurSpaceCode;
}

@ -84,7 +84,7 @@ public class PtxhyyOrderDetailRequest {
/**
*
*/
private LocalDateTime fprq;
private String fprq;
private String mjph;
}

@ -118,7 +118,10 @@ public class SubmitOrderUtil {
//查询第三方产品名称
ThrProductsEntity thrProductsEntity = thrProductsDao.selectOne(new LambdaQueryWrapper<ThrProductsEntity>()
.eq(ThrProductsEntity::getCode, thirdProductId));
if (thrProductsEntity == null) {
log.error("第三方产品编码未关联");
return null;
}
item.setProductName(thrProductsEntity.getName()); //产品名称
item.setBindRlFk(detailBizEntity.getBindRlFk());
item.setStandard(detailBizEntity.getSpec()); //规格型号
@ -130,6 +133,7 @@ public class SubmitOrderUtil {
item.setManufactoryCode(thrProductsEntity.getManufactoryCode());
item.setSupCode(thrProductsEntity.getSupCode());
item.setCplb(thrProductsEntity.getFlbm());
item.setCount(detailBizEntity.getCount());
return item;
}

Loading…
Cancel
Save