1.添加条码校验批次号,使用产品设置参数做一次校验

2.修复库存统计报错问题
purchase
x_z 3 years ago
parent 954addf7f7
commit d8d3ae7393

@ -2,6 +2,7 @@ package com.glxp.api.admin.controller.business;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
@ -228,7 +229,7 @@ public class StockOrderController {
stockOrderEntity.setUnitIdFk(stockOrderPostRequest.getUnitIdFk());
stockOrderEntity.setCustomerId(stockOrderPostRequest.getCustomerId());
stockOrderEntity.setBilldate(DateUtil.formatDate(new Date()));
stockOrderEntity.setBilldate(cn.hutool.core.date.DateUtil.parse(stockOrderPostRequest.getBilldate(), DatePattern.UTC_MS_WITH_XXX_OFFSET_PATTERN).toString());
b = stockOrderService.insertStockOrder(stockOrderEntity);
} else {
stockOrderService.updateById(stockOrderEntity);
@ -307,7 +308,6 @@ public class StockOrderController {
filterInvUserRequest.setCode(invWarehouseEntity.getCode());
filterInvUserRequest.setUserid(userId.longValue());
filterInvUserRequest.setIsDirector(true);
List<WarehouseUserEntity> warehouseUserEntities = warehouseUserService.filterWarehouseUsers(filterInvUserRequest);
} else {
return ResultVOUtils.error(500, "请先选择当前仓库");
}

@ -94,14 +94,12 @@ public class StockOrderDetailController {
StockOrderEntity stockOrderEntity = stockOrderService.findById(stockOrderDetailFilterRequest.getOrderIdFk());
List<StockOrderDetailEntity> stockOrderDetailEntityList
= stockOrderDetailService.filterStockOrderDetail(stockOrderDetailFilterRequest);
PageInfo<StockOrderDetailEntity> pageInfo = new PageInfo<>(stockOrderDetailEntityList);
BussinessLocalTypeEntity bussinessLocalTypeEntity = bussinessLocalTypeService.findBTByAction(stockOrderEntity.getBillType());
if (bussinessLocalTypeEntity.getOrderVisibleType() == 1 && (stockOrderEntity.getStatus().equals("4") || stockOrderEntity.getStatus().equals("5"))) {
stockOrderDetailEntityList = transferSerList(stockOrderDetailEntityList, stockOrderEntity.getOrderIdFk());
}
PageInfo<StockOrderDetailEntity> pageInfo;
pageInfo = new PageInfo<>(stockOrderDetailEntityList);
PageSimpleResponse<StockOrderDetailEntity> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(stockOrderDetailEntityList);

@ -66,11 +66,11 @@ import java.util.stream.Collectors;
@RestController
public class WareHouseController {
@Resource
private CodesService codesService;
@Resource
private OrderService orderService;
@Resource
private IoTransInoutService ioTransInoutService;
@Resource
@ -78,9 +78,9 @@ public class WareHouseController {
@Resource
private BussinessTypeService bussinessTypeService;
@Resource
AuthAdminService authAdminService;
private AuthAdminService authAdminService;
@Resource
BasicUnitMaintainService basicUnitMaintainService;
private BasicUnitMaintainService basicUnitMaintainService;
@Resource
private AuthLicenseDao authLicenseDao;
@Resource
@ -88,30 +88,29 @@ public class WareHouseController {
@Resource
private WarehouseBussinessTypeService warehouseBussinessTypeService;
@Resource
CustomerService customerService;
private CustomerService customerService;
@Resource
UdiRelevanceService udiRelevanceService;
private UdiRelevanceService udiRelevanceService;
@Resource
CompanyProductRelevanceService companyProductRelevanceService;
private CompanyProductRelevanceService companyProductRelevanceService;
@Resource
SystemParamConfigService systemParamConfigService;
private SystemParamConfigService systemParamConfigService;
@Resource
StockOrderService stockOrderService;
private StockOrderService stockOrderService;
@Resource
GennerOrderUtils gennerOrderUtils;
private GennerOrderUtils gennerOrderUtils;
@Resource
InvPreInProductDetailService invPreInProductDetailService;
private InvPreInProductDetailService invPreInProductDetailService;
@Resource
SpsDirectClient spsDirectClient;
private SpsDirectClient spsDirectClient;
@Resource
InvWarehouseDao invWarehouseService;
private InvWarehouseDao invWarehouseService;
@Resource
InvSubWarehouseService invSubWarehouseService;
private InvSubWarehouseService invSubWarehouseService;
@Resource
private UdiInfoService udiInfoService;
@Resource
InvBusUserService invBusUserService;
private InvBusUserService invBusUserService;
@AuthRuleAnnotation("")
@GetMapping("admin/warehouse/inout/list")
@ -641,9 +640,14 @@ public class WareHouseController {
//批次号校验
if (StrUtil.isEmpty(udiEntity.getSerialNo()) && StrUtil.isEmpty(udiEntity.getBatchNo())) {
return ResultVOUtils.error(500, "批次号不能为空!");
//判断此产品是否开启允许无批次号
UdiInfoEntity udiInfoEntity = udiInfoService.findByNameCode(udiEntity.getUdi());
if (!udiInfoEntity.isAllowNoBatch()) {
if (StrUtil.isEmpty(udiEntity.getSerialNo()) && StrUtil.isEmpty(udiEntity.getBatchNo())) {
return ResultVOUtils.error(500, "批次号不能为空!");
}
}
String orderId = addOrderRequest.getOrderId();
// String isCheck = systemParamConfigService.selectValueByParamKey("code_fill_check");

@ -1,6 +1,8 @@
package com.glxp.api.admin.controller.thrsys;
//领用单
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
import com.glxp.api.admin.constant.Constant;
import com.glxp.api.admin.entity.business.StockOrderDetailEntity;
@ -10,7 +12,6 @@ import com.glxp.api.admin.req.business.StockOrderPostRequest;
import com.glxp.api.admin.service.auth.CustomerService;
import com.glxp.api.admin.service.thrsys.ThrOrderDetailService;
import com.glxp.api.admin.service.thrsys.ThrOrderService;
import com.glxp.api.admin.util.DateUtil;
import com.glxp.api.admin.util.GennerOrderUtils;
import com.glxp.api.admin.util.OrderNoTypeBean;
import com.glxp.api.common.enums.ResultEnum;
@ -52,7 +53,7 @@ public class ThrOrderReceiveController {
stockOrderEntity.setCreateUser(userId + "");
stockOrderEntity.setType(1);//领用单据
stockOrderEntity.setUpdateTime(new Date());
stockOrderEntity.setBilldate(DateUtil.formatDate(new Date()));
stockOrderEntity.setBilldate(DateUtil.parse(stockOrderEntity.getBilldate(), DatePattern.NORM_DATETIME_PATTERN).toString());
ThrOrderEntity temp = thrOrderService.findByUnique(stockOrderEntity.getBillNo(), stockOrderEntity.getThirdSysFk());
if (temp != null) {
stockOrderEntity.setId(temp.getId());

@ -10,7 +10,7 @@ import java.util.Date;
public class StockOrderEntity {
private String id;
private String billNo;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private String billdate;
private String corpId;
private String corpName;

@ -104,13 +104,16 @@ public class InvProductServiceImpl implements InvProductService {
for (String relIdFk : relIdFkSet) {
if (CollUtil.isNotEmpty(batchNoSet)) {
for (String batchNo : batchNoSet) {
InvProductResponse invProductResponse = data.stream().filter(product -> product.getRelIdFk().equals(relIdFk)).filter(product -> product.getBatchNo().equals(batchNo)).collect(Collectors.toList()).get(0);
int inCount = data.stream().filter(product -> product.getRelIdFk().equals(relIdFk)).filter(product -> product.getBatchNo().equals(batchNo)).mapToInt(InvProductResponse::getInCount).sum();
int outCount = data.stream().filter(product -> product.getRelIdFk().equals(relIdFk)).filter(product -> product.getBatchNo().equals(batchNo)).mapToInt(InvProductResponse::getOutCount).sum();
invProductResponse.setInCount(inCount);
invProductResponse.setOutCount(outCount);
invProductResponse.setReCount(inCount - outCount);
result.add(invProductResponse);
List<InvProductResponse> list = data.stream().filter(product -> product.getRelIdFk().equals(relIdFk)).filter(product -> product.getBatchNo().equals(batchNo)).collect(Collectors.toList());
if (CollUtil.isNotEmpty(list)) {
InvProductResponse invProductResponse = list.get(0);
int inCount = data.stream().filter(product -> product.getRelIdFk().equals(relIdFk)).filter(product -> product.getBatchNo().equals(batchNo)).mapToInt(InvProductResponse::getInCount).sum();
int outCount = data.stream().filter(product -> product.getRelIdFk().equals(relIdFk)).filter(product -> product.getBatchNo().equals(batchNo)).mapToInt(InvProductResponse::getOutCount).sum();
invProductResponse.setInCount(inCount);
invProductResponse.setOutCount(outCount);
invProductResponse.setReCount(inCount - outCount);
result.add(invProductResponse);
}
}
} else {
InvProductResponse invProductResponse = data.stream().filter(product -> product.getRelIdFk().equals(relIdFk)).collect(Collectors.toList()).get(0);

@ -398,8 +398,9 @@
<select id="selectUploadList" resultType="com.glxp.api.admin.entity.business.StockOrderEntity">
select t1.* from stock_order t1 left join io_order t2 on t1.billNo = t2.erpFk
<where>
t2.erpFk is not null
<if test="request.billNo != null and request.billNo != ''">
AND (t2.erpFk like concat('%', #{request.billNo}, '%') or t2.thirdBillNo like concat('%',#{request.billNo},'%'))
AND ((t1.billNo like concat('%', #{request.billNo}, '%') and t2.erpFk like concat('%', #{request.billNo}, '%')) or t2.thirdBillNo like concat('%',#{request.billNo},'%'))
</if>
<if test="request.submitStatus != null">
AND t2.exportStatus = #{request.submitStatus}

Loading…
Cancel
Save