|
|
@ -14,6 +14,10 @@ import com.glxp.api.req.inv.FilterInvCountOrderDetailRequest;
|
|
|
|
import com.glxp.api.res.inv.InvCountOrderDetailResponse;
|
|
|
|
import com.glxp.api.res.inv.InvCountOrderDetailResponse;
|
|
|
|
import com.glxp.api.service.inv.InvCountOrderDetailService;
|
|
|
|
import com.glxp.api.service.inv.InvCountOrderDetailService;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
|
|
import org.apache.ibatis.session.ExecutorType;
|
|
|
|
|
|
|
|
import org.apache.ibatis.session.SqlSession;
|
|
|
|
|
|
|
|
import org.apache.ibatis.session.SqlSessionFactory;
|
|
|
|
|
|
|
|
import org.apache.ibatis.session.TransactionIsolationLevel;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
|
@ -32,6 +36,8 @@ public class InvCountOrderDetailServiceImpl implements InvCountOrderDetailServic
|
|
|
|
private InvCountOrderDao invCountOrderDao;
|
|
|
|
private InvCountOrderDao invCountOrderDao;
|
|
|
|
@Resource
|
|
|
|
@Resource
|
|
|
|
private InvProductDao invProductDao;
|
|
|
|
private InvProductDao invProductDao;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
private SqlSessionFactory sqlSessionFactory;
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public List<InvCountOrderDetailEntity> filterList(FilterInvCountOrderDetailRequest detailRequest) {
|
|
|
|
public List<InvCountOrderDetailEntity> filterList(FilterInvCountOrderDetailRequest detailRequest) {
|
|
|
@ -78,4 +84,20 @@ public class InvCountOrderDetailServiceImpl implements InvCountOrderDetailServic
|
|
|
|
invCountOrderDetailDao.insert(invCountOrderDetail);
|
|
|
|
invCountOrderDetailDao.insert(invCountOrderDetail);
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
|
|
|
public BaseResponse batchAddDetail(String orderId, List<InvCountOrderDetailEntity> countOrderDetailList) {
|
|
|
|
|
|
|
|
InvCountOrderEntity invCountOrder = invCountOrderDao.selectByOrderId(orderId);
|
|
|
|
|
|
|
|
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH, TransactionIsolationLevel.READ_COMMITTED);
|
|
|
|
|
|
|
|
InvCountOrderDetailDao mapper = sqlSession.getMapper(InvCountOrderDetailDao.class);
|
|
|
|
|
|
|
|
for (InvCountOrderDetailEntity orderDetailEntity : countOrderDetailList) {
|
|
|
|
|
|
|
|
InvProductEntity invProductEntity = invProductDao.selectProductInfo(orderDetailEntity.getRelId(), orderDetailEntity.getBatchNo(), invCountOrder.getDeptCode(), invCountOrder.getInvCode(), invCountOrder.getInvSpaceCode());
|
|
|
|
|
|
|
|
orderDetailEntity.setInvNum(invProductEntity.getReCount());
|
|
|
|
|
|
|
|
orderDetailEntity.setCountNum(0);
|
|
|
|
|
|
|
|
mapper.insert(orderDetailEntity);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sqlSession.commit();
|
|
|
|
|
|
|
|
sqlSession.close();
|
|
|
|
|
|
|
|
return ResultVOUtils.success();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|