盘点功能优化

test
anthonywj 1 year ago
parent 94e09d6d8d
commit b1a99cced7

@ -1,6 +1,7 @@
package com.glxp.api.dao.inv;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inv.InvCountCodesEntity;
import com.glxp.api.entity.inv.InvCountSettingEntity;
import com.glxp.api.req.inv.FilterInvCountCodesRequest;
@ -10,7 +11,7 @@ import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface InvCountCodesMapper extends BaseMapper<InvCountCodesEntity> {
public interface InvCountCodesMapper extends BaseMapperPlus<InvCountCodesMapper, InvCountCodesEntity, InvCountCodesEntity> {
/**

@ -1,6 +1,7 @@
package com.glxp.api.req.inv;
import com.glxp.api.entity.inv.InvCountCodesEntity;
import com.glxp.api.entity.inv.InvCountOrderDetailEntity;
import lombok.Data;
import javax.validation.constraints.NotBlank;
@ -25,4 +26,7 @@ public class FilterInvCountOrderSaveRequest {
@NotEmpty(message = "盘点产品不能为空")
private List<InvCountCodesEntity> countCodeList;
@NotEmpty(message = "盘点产品不能为空")
private List<InvCountOrderDetailEntity> orderDetailEntities;
}

@ -1,5 +1,6 @@
package com.glxp.api.service.inout.impl;
import cn.hutool.core.bean.BeanUtil;
import com.glxp.api.service.inv.impl.InvProductDetailService;
import com.glxp.api.service.inv.impl.InvProductService;
import org.springframework.beans.BeanUtils;
@ -662,7 +663,7 @@ public class IoOrderServiceImpl implements IoOrderService {
try {
IoOrderResponse response = new IoOrderResponse();
BeanUtils.copyProperties(orderEntity, response);
BeanUtil.copyProperties(orderEntity, response);
if (orderEntity.getStatus().equals(ConstantStatus.ORDER_STATUS_AUDITED) && checkBusTypeSupplementOrder(orderEntity)
&& StrUtil.isEmpty(orderEntity.getSupplementNo())) {
response.setEnableSupplementOrder(true);

@ -45,9 +45,11 @@ import com.glxp.api.util.OrderNoTypeBean;
import com.glxp.api.util.udi.FilterUdiUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.apache.regexp.RE;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
@ -173,8 +175,8 @@ public class InvCountOrderService extends ServiceImpl<InvCountOrderMapper, InvCo
}
public BaseResponse submitAudit(String id) {
InvCountOrderEntity invCountOrder = invCountOrderDao.selectByOrderId(id);
public BaseResponse submitAudit(String orderId) {
InvCountOrderEntity invCountOrder = invCountOrderDao.selectByOrderId(orderId);
if (null == invCountOrder) {
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "单据不存在");
}
@ -186,11 +188,6 @@ public class InvCountOrderService extends ServiceImpl<InvCountOrderMapper, InvCo
if (detailCount == 0) {
return ResultVOUtils.error(ResultEnum.DATA_ERROR, "请先选择盘点产品");
}
// Long codesCount = invCountCodesDao.countByOrderIdFk(invCountOrder.getOrderId());
// if (codesCount == 0) {
// return ResultVOUtils.error(ResultEnum.DATA_ERROR, "请扫描需要盘点的产品");
// }
//更新状态
invCountOrder.setStatus(1);
invCountOrder.setUpdateTime(new Date());
@ -239,7 +236,7 @@ public class InvCountOrderService extends ServiceImpl<InvCountOrderMapper, InvCo
return ResultVOUtils.success();
}
@Transactional(rollbackFor = Exception.class)
public BaseResponse saveCountOrderForPDA(FilterInvCountOrderSaveRequest filterInvCountOrderSaveRequest) {
InvCountOrderEntity invCountOrder = invCountOrderDao.selectByOrderId(filterInvCountOrderSaveRequest.getOrderId());
if (null == invCountOrder) {
@ -251,12 +248,18 @@ public class InvCountOrderService extends ServiceImpl<InvCountOrderMapper, InvCo
//解析条码,修改单据详情,修改单据状态为待审核
invCountOrder.setStatus(1);
invCountOrder.setUpdateTime(new Date());
invCountCodesDao.deleteByOrderId(invCountOrder.getOrderId());
List<InvCountCodesEntity> countCodeList = filterInvCountOrderSaveRequest.getCountCodeList();
for (InvCountCodesEntity invCountCodes : countCodeList) {
invCountCodesService.addCode(invCountCodes);
if (CollUtil.isNotEmpty(countCodeList)) {
invCountCodesDao.insertBatch(countCodeList);
}
submitAudit(invCountOrder.getId().toString());
return ResultVOUtils.success();
invCountOrderDetailDao.deleteByOrderId(invCountOrder.getOrderId());
List<InvCountOrderDetailEntity> orderDetailEntities = filterInvCountOrderSaveRequest.getOrderDetailEntities();
if (CollUtil.isNotEmpty(orderDetailEntities)) {
invCountOrderDetailDao.insertBatch(orderDetailEntities);
}
return submitAudit(invCountOrder.getOrderId());
}
/**

Loading…
Cancel
Save