最新代码提交

pro
wj 2 years ago
parent c6a74080d0
commit b3eca1daaa

@ -19,6 +19,7 @@ import com.glxp.api.req.auth.FilterInvBusUserRequest;
import com.glxp.api.req.basic.BasicEntrustRecRequest;
import com.glxp.api.req.inout.*;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.req.udims.PostUdimsOrderRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.inout.IoOrderDetailBizResponse;
import com.glxp.api.res.inout.IoOrderDetailCodeResponse;
@ -28,6 +29,7 @@ import com.glxp.api.service.auth.InvBusUserService;
import com.glxp.api.service.basic.EntrustReceService;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.inout.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -46,6 +48,7 @@ import java.util.List;
@Slf4j
@RestController
@Api("单据相关")
public class IoOrderController extends BaseController {
@Resource
@ -638,5 +641,15 @@ public class IoOrderController extends BaseController {
return ResultVOUtils.success();
}
// --------------------------------------------------------UDI_MS平台--------------------------------------------------------------------------------------
@ApiOperation("udims上传单据")
@PostMapping("/warehouse/inout/postOrdersUdims")
public BaseResponse postOrdersUdims(@RequestBody PostUdimsOrderRequest orderRequest) {
ioAddInoutService.creatOrderByUdims(orderRequest);
return ResultVOUtils.success();
}
}

@ -0,0 +1,36 @@
package com.glxp.api.req.udims;
import lombok.Data;
import java.math.BigDecimal;
import java.time.LocalDate;
/**
* udims
*/
@Data
public class PostUdimsOrderDetailRequest {
//uuid
private String uuidFk;
//批次号
private String batchNo;
//价格
private BigDecimal price;
//销售发票号(第一票)
private String firstSalesInvNo;
//销售发票号(第二票)
private String secSalesInvNo;
//销售清单号(第二票)
private String secSalesListNo;
//开票日期
private LocalDate invoiceDate;
}

@ -0,0 +1,61 @@
package com.glxp.api.req.udims;
import lombok.Data;
import java.util.List;
@Data
public class PostUdimsOrderRequest {
List<OrderBean> orderBeans;
private String customerId;
@Data
public static class OrderBean {
private String orderId;
private String corpOrderId;
private String action;
private String actDate;
private String actor;
private String mainAction;
private String fromCorpId;
private String fromCorp;
private String remark;
private String invStorageCode;
private String deptCode;
private List<PostUdimsOrderDetailRequest> orderDetails;
private List<CodeBean> codes;
@Data
public static class CodeBean {
private String action;
private String mainAction;
private String code;
private String corpOrderId;
private String actor;
private String actDate;
private String fromCorpId;
private String fromCorp;
private String orderId;
private String batchNo;
private String produceDate;
private String expireDate;
private String serialNo;
private Integer count;
private String packageLevel;
private String warehouseCode;
private String customerId;
private String nameCode;
private String supId;//供应商ID
private String invStorageCode;
private String invWarehouseCode;
private String relId;
private Integer status;
private String locStorageCode;
}
}
}

@ -22,6 +22,7 @@ import com.glxp.api.entity.system.SystemParamConfigEntity;
import com.glxp.api.req.basic.FilterCompanyProductRelevanceRequest;
import com.glxp.api.entity.inout.PdaCodeEntity;
import com.glxp.api.req.inout.PostOrderRequest;
import com.glxp.api.req.udims.PostUdimsOrderRequest;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.service.basic.BasicCorpService;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
@ -38,6 +39,7 @@ import com.glxp.api.util.udi.UdiCalCountUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
@ -696,4 +698,101 @@ public class IoAddInoutService {
}
//duims上传单据
@Transactional
public void creatOrderByUdims(PostUdimsOrderRequest postOrderRequest) {
List<PostUdimsOrderRequest.OrderBean> postOrders = postOrderRequest.getOrderBeans();
if (postOrders != null && postOrders.size() > 0) {
for (int i = 0; i < postOrders.size(); i++) {
PostUdimsOrderRequest.OrderBean postOrder = postOrders.get(i);
//创建单据
IoOrderEntity orderEntity = orderService.findByBillNo(postOrder.getOrderId());
if (orderEntity != null) {
//已包含业务单据校验
// orderEntity.setUpdateUser(postOrderRequest.getUserId() + "");
orderEntity.setUpdateTime(new Date());
orderService.update(orderEntity);
List<PostUdimsOrderRequest.OrderBean.CodeBean> pdaCodeEntities = postOrder.getCodes();
if (pdaCodeEntities != null && pdaCodeEntities.size() > 0) {
PostUdimsOrderRequest.OrderBean.CodeBean pdaCodeEntity = pdaCodeEntities.get(0);
//写入条码
List<IoCodeTempEntity> ioCodeEnttities = new ArrayList<>();
for (int index = 0; index < pdaCodeEntities.size(); index++) {
IoCodeTempEntity codeEnttity = new IoCodeTempEntity();
BeanUtils.copyProperties(pdaCodeEntities.get(index), codeEnttity);
codeEnttity.setAction(orderEntity.getAction());
codeEnttity.setMainAction(orderEntity.getMainAction());
codeEnttity.setDeptCode(orderEntity.getDeptCode());
codeEnttity.setOrderId(orderEntity.getBillNo());
codeEnttity.setInvCode(orderEntity.getInvCode());
codeEnttity.setReCount(codeEnttity.getCount() * udiCalCountUtil.getActCount(codeEnttity.getNameCode()));
codeEnttity.setUpdateTime(new Date());
codeEnttity.setCreateTime(DateUtil.parseDate(pdaCodeEntity.getActDate()));
ioCodeEnttities.add(codeEnttity);
}
codeTempService.insertBatch(ioCodeEnttities);
dealProcess(orderEntity);
if (!ioCheckInoutService.checkManual(orderEntity.getBillNo())) {
ioCheckInoutService.check(orderEntity.getBillNo());
}
}
} else {
//创建新单据
BasicBussinessTypeEntity bussinessTypeEntity = basicBussinessTypeService.findByAction(postOrder.getAction());
String orderNo = gennerOrderUtils.createScOrderNo(new OrderNoTypeBean(Constant.SCAN_ORDER + StrUtil.trimToEmpty(bussinessTypeEntity.getPrefix()), "yyyyMMdd"));
IoOrderEntity orderSaveRequest = new IoOrderEntity();
orderSaveRequest.setBillNo(orderNo);
orderSaveRequest.setMainAction(postOrder.getMainAction());
orderSaveRequest.setAction(postOrder.getAction());
orderSaveRequest.setCorpOrderId(postOrder.getCorpOrderId());
orderSaveRequest.setFromCorp(postOrder.getFromCorp());
orderSaveRequest.setCustomerId(postOrderRequest.getCustomerId());
orderSaveRequest.setDeptCode(postOrder.getDeptCode());
orderSaveRequest.setInvCode(postOrder.getInvStorageCode());
orderSaveRequest.setStatus(ConstantStatus.ORDER_STATUS_PROCESS);
orderSaveRequest.setDealStatus(ConstantStatus.ORDER_DEAL_POST);
// orderSaveRequest.setCreateUser(postOrderRequest.getUserId() + "");
// orderSaveRequest.setUpdateUser(postOrderRequest.getUserId() + "");
orderSaveRequest.setUpdateTime(new Date());
orderSaveRequest.setBusType(bussinessTypeEntity.getBusType());
orderSaveRequest.setOrderType(ConstantStatus.ORDER_TYPE_SCAN);
orderSaveRequest.setFromType(ConstantStatus.FROM_UDIMS);
List<PostUdimsOrderRequest.OrderBean.CodeBean> pdaCodeEntities = postOrder.getCodes();
if (pdaCodeEntities != null && pdaCodeEntities.size() > 0) {
PostUdimsOrderRequest.OrderBean.CodeBean pdaCodeEntity = pdaCodeEntities.get(0);
if (pdaCodeEntity.getActDate() != null) {
orderSaveRequest.setCreateTime(DateUtil.parseDate(pdaCodeEntity.getActDate()));
}
//写入条码
List<IoCodeTempEntity> ioCodeEnttities = new ArrayList<>();
for (int index = 0; index < pdaCodeEntities.size(); index++) {
IoCodeTempEntity codeEnttity = new IoCodeTempEntity();
BeanUtils.copyProperties(pdaCodeEntities.get(index), codeEnttity);
codeEnttity.setAction(orderSaveRequest.getAction());
codeEnttity.setMainAction(orderSaveRequest.getMainAction());
codeEnttity.setDeptCode(orderSaveRequest.getDeptCode());
codeEnttity.setOrderId(orderSaveRequest.getBillNo());
codeEnttity.setInvCode(orderSaveRequest.getInvCode());
codeEnttity.setReCount(codeEnttity.getCount() * udiCalCountUtil.getActCount(codeEnttity.getNameCode()));
codeEnttity.setUpdateTime(new Date());
codeEnttity.setCreateTime(DateUtil.parseDate(pdaCodeEntity.getActDate()));
ioCodeEnttities.add(codeEnttity);
}
codeTempService.insertBatch(ioCodeEnttities);
}
orderService.insertOrder(orderSaveRequest);
dealProcess(orderSaveRequest);
if (!ioCheckInoutService.checkManual(orderEntity.getBillNo())) {
ioCheckInoutService.check(orderEntity.getBillNo());
}
}
}
}
}
}

@ -9,6 +9,9 @@ import java.util.List;
@Data
public class InvWarehouseTreeVo extends InvWarehouseEntity {
private String deptCode;
private String deptName;
List<WarehouseBussinessTypeEntity> bussinessTypeList = new ArrayList<>();

@ -401,10 +401,11 @@
<select id="selectInvListTreeByUser" resultMap="selectInvListTreeByUser">
select auth_warehouse.`code`,
auth_warehouse.name,
auth_warehouse.name warehouseName,
auth_warehouse.parentId,
auth_warehouse.parentCode,
auth_dept.name warehouseName,
auth_dept.code deptCode,
auth_dept.name deptName,
auth_warehouse.advanceType
from auth_warehouse
inner join auth_dept on auth_warehouse.parentId = auth_dept.code

Loading…
Cancel
Save