|
|
|
@ -1,10 +1,13 @@
|
|
|
|
|
package com.glxp.api.service.inout.impl;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
import com.glxp.api.dao.inout.IoCodeRelMapper;
|
|
|
|
|
import com.glxp.api.dao.inout.IoOrderDetailCodeDao;
|
|
|
|
|
import com.glxp.api.dao.inout.IoOrderInvoiceMapper;
|
|
|
|
|
import com.glxp.api.entity.inout.IoCodeRelEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderDetailCodeEntity;
|
|
|
|
|
import com.glxp.api.entity.inout.IoOrderInvoiceEntity;
|
|
|
|
|
import com.glxp.api.req.inout.IoOrderInvoiceRequest;
|
|
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
@ -14,6 +17,7 @@ import com.glxp.api.service.inout.IoOrderInvoiceService;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
@ -22,6 +26,8 @@ import java.util.List;
|
|
|
|
|
public class IoOrderInvoiceServiceImpl extends ServiceImpl<IoOrderInvoiceMapper, IoOrderInvoiceEntity> implements IoOrderInvoiceService {
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderInvoiceMapper ioOrderInvoiceMapper;
|
|
|
|
|
@Resource
|
|
|
|
|
IoOrderDetailCodeDao orderDetailCodeDao;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public List<IoOrderInvoiceEntity> findByBillNo(String orderIdFk) {
|
|
|
|
@ -51,4 +57,28 @@ public class IoOrderInvoiceServiceImpl extends ServiceImpl<IoOrderInvoiceMapper,
|
|
|
|
|
public List<IoOrderInvoiceEntity> selectOrderInvoice(IoOrderInvoiceRequest ioOrderInvoiceRequest) {
|
|
|
|
|
return ioOrderInvoiceMapper.selectOrderInvoice(ioOrderInvoiceRequest);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean updateRegStatus(IoOrderDetailCodeEntity orderDetailCodeEntity) {
|
|
|
|
|
IoOrderInvoiceRequest orderInvoiceRequest = new IoOrderInvoiceRequest();
|
|
|
|
|
orderInvoiceRequest.setBatchNo(orderDetailCodeEntity.getBatchNo());
|
|
|
|
|
orderInvoiceRequest.setBindRlFk(orderDetailCodeEntity.getBindRlFk() + "");
|
|
|
|
|
List<IoOrderInvoiceEntity> orderInvoiceEntities = selectOrderInvoice(orderInvoiceRequest);
|
|
|
|
|
if (CollUtil.isNotEmpty(orderInvoiceEntities)) {
|
|
|
|
|
// BigDecimal amount = new BigDecimal(0.00);
|
|
|
|
|
// for (IoOrderInvoiceEntity orderInvoiceEntity : orderInvoiceEntities) {
|
|
|
|
|
// amount = amount.add(new BigDecimal(orderInvoiceEntity.getPrice()));
|
|
|
|
|
// }
|
|
|
|
|
// if (amount.compareTo(orderDetailCodeEntity.getPrice()) == 0) {
|
|
|
|
|
// orderDetailCodeEntity.setRegStatus(true);
|
|
|
|
|
// } else {
|
|
|
|
|
// orderDetailCodeEntity.setRegStatus(false);
|
|
|
|
|
// }
|
|
|
|
|
orderDetailCodeEntity.setRegStatus(true);
|
|
|
|
|
} else {
|
|
|
|
|
orderDetailCodeEntity.setRegStatus(false);
|
|
|
|
|
}
|
|
|
|
|
orderDetailCodeDao.updateById(orderDetailCodeEntity);
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|