发票问题代码备份

pro
anthonywj 2 years ago
parent 3ac25d320a
commit c57e232dfb

@ -590,7 +590,7 @@ public class IoOrderDetailBizController extends BaseController {
List<IoOrderInvoiceResponse> ioOrderInvoiceResponses = orderDetailBizService.filterListInv(filterOrderDetailBizRequest1);
if (list.size() == 0) {
ioOrderDetailBizEntity.setRegStatus(false);
}else{
} else {
ioOrderDetailBizEntity.setRegStatus(true);
}
orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity);
@ -683,12 +683,7 @@ public class IoOrderDetailBizController extends BaseController {
public BaseResponse updateorderBiz(@RequestBody InvoiceRequest invoiceRequest) {
String billNo = null;
for (IoOrderDetailCodeEntity ioOrderDetailBizEntity : invoiceRequest.getList()) {
if("key".equals(invoiceRequest.getKey())){
ioOrderDetailBizEntity.setRegStatus(false);
}else{
ioOrderDetailBizEntity.setRegStatus(true);
}
orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity);
ioOrderInvoiceService.updateRegStatus(ioOrderDetailBizEntity);
billNo = ioOrderDetailBizEntity.getOrderIdFk();
}
IoOrderEntity orderEntity = orderService.findByBillNo(billNo);
@ -707,7 +702,7 @@ public class IoOrderDetailBizController extends BaseController {
*/
@GetMapping("/udiwms/inout/bizDetail/filterBizOrderList")
public BaseResponse filterBizOrderList(FilterOrderDetailCodeRequest orderDetailBizRequest) {
List<IoOrderDetailCodeResponse> ioOrderDetailCodeResponses = orderDetailBizService.getfilterList(orderDetailBizRequest);
List<IoOrderDetailCodeResponse> ioOrderDetailCodeResponses = orderDetailBizService.getfilterOrderList(orderDetailBizRequest);
for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) {
if (ioOrderDetailCodeRespons.getReCount() != 0 && ioOrderDetailCodeRespons.getPrice() != null) {
ioOrderDetailCodeRespons.setAmount(new BigDecimal(ioOrderDetailCodeRespons.getReCount()).multiply(ioOrderDetailCodeRespons.getPrice()));

@ -281,7 +281,6 @@ public class IoChangeInoutService {
}
}
}
//根据单据设置状态 1:草稿
if (bussinessChangeTypeEntity.getAuditStatus() == 1) {
orderEntity.setStatus(ConstantStatus.ORDER_STATUS_TEMP_SAVE);

@ -350,6 +350,9 @@ public class IoCheckInoutService {
checkThird(orderEntity);
}
@Resource
IoOrderInvoiceService orderInvoiceService;
//一次校验完成
public void checkFirstFinish(IoOrderEntity orderEntity) {
@ -420,6 +423,7 @@ public class IoCheckInoutService {
bizEntity.setCheckSuccess(true);
codeEntity.setCheckSuccess(true);
codeEntity.setPrice(bizEntity.getPrice());
orderInvoiceService.updateRegStatus(codeEntity);
}
break;
}
@ -448,7 +452,7 @@ public class IoCheckInoutService {
orderDetailResultService.insert(orderDetailResultEntity);
}
orderDetailCodeDao.updateBatchById(orderDetailCodeEntities);
// orderDetailCodeDao.updateBatchById(orderDetailCodeEntities);
//临时表转正式表
List<IoCodeTempEntity> codeTempEntities = codeTempService.findByOrderId(orderEntity.getBillNo());
@ -1029,4 +1033,6 @@ public class IoCheckInoutService {
}
return bizEntity.getCoName() + "数量不匹配!";
}
}

@ -2,6 +2,7 @@ package com.glxp.api.service.inout;
import com.baomidou.mybatisplus.extension.service.IService;
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;
@ -20,5 +21,8 @@ public interface IoOrderInvoiceService extends IService<IoOrderInvoiceEntity> {
List<IoOrderInvoiceEntity> selectOrderInvoice(IoOrderInvoiceRequest ioOrderInvoiceRequest);
// 更新发票状态
boolean updateRegStatus(IoOrderDetailCodeEntity orderDetailCodeEntity);
}

@ -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;
}
}

@ -50,10 +50,10 @@
<select id="filterListInv" resultType="com.glxp.api.res.inout.IoOrderInvoiceResponse">
SELECT ic.*,cpmctymc,ggxh
SELECT ic.*, cpmctymc, ggxh
FROM io_order_invoice ic
LEFT JOIN basic_udirel bu ON bu.id = ic.bindRlFk
LEFT JOIN basic_products bp ON bu.uuid = bp.uuid
LEFT JOIN basic_udirel bu ON bu.id = ic.bindRlFk
LEFT JOIN basic_products bp ON bu.uuid = bp.uuid
<where>
<if test="orderIdFk != null and orderIdFk != ''">
AND ic.orderIdFk = #{orderIdFk}
@ -70,13 +70,15 @@
<if test="batchNo == null || batchNo == ''">
AND (ic.batchNo is null or ic.batchNo = '')
</if>
</where>
GROUP BY ic.id
</select>
<select id="selectByinvoiceId" parameterType="java.lang.Long" resultType="com.glxp.api.res.inout.IoOrderInvoiceResponse">
select * from io_order_invoice where id= #{id}
<select id="selectByinvoiceId" parameterType="java.lang.Long"
resultType="com.glxp.api.res.inout.IoOrderInvoiceResponse">
select *
from io_order_invoice
where id = #{id}
</select>
<select id="selectOrderDetailBiz" resultType="com.glxp.api.entity.inout.IoOrderDetailBizEntity">
@ -112,9 +114,9 @@
<select id="getfilterOrderList" resultType="com.glxp.api.res.inout.IoOrderDetailCodeResponse">
select io_order_detail_code.*,
(select count(*)
FROM io_order_invoice
where io_order_invoice.orderIdFk = io_order_detail_code.orderIdFk) as sucCount
(select count(*)
FROM io_order_invoice
where io_order_invoice.orderIdFk = io_order_detail_code.orderIdFk) as sucCount
from io_order_detail_code
<where>
<if test="orderIdFk != null and orderIdFk != ''">
@ -126,11 +128,7 @@
<if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo}
</if>
<if test="productName != null and productName != ''">
AND bp.cpmctymc like concat('%', #{productName}, '%')
</if>
</where>
group by io_order_detail_code.id
</select>
</mapper>

@ -12,15 +12,11 @@
<select id="selectOrderInvoice" parameterType="com.glxp.api.req.inout.IoOrderInvoiceRequest"
resultType="com.glxp.api.entity.inout.IoOrderInvoiceEntity">
SELECT ic.*,
(select cpmctymc
from basic_products
where basic_products.uuid = bu.uuid
GROUP BY basic_products.uuid) cpmctymc,
(select ggxh from basic_products where basic_products.uuid = bu.uuid GROUP BY basic_products.uuid) ggxh
SELECT ic.*,bp.cpmctymc,bp.ggxh
FROM io_order_invoice ic
LEFT JOIN basic_udirel bu ON bu.id = ic.bindRlFk
LEFT JOIN basic_products bp ON bu.uuid = bp.uuid
LEFT JOIN basic_udirel bu ON bu.id = ic.bindRlFk
LEFT JOIN basic_products bp ON bu.uuid = bp.uuid
and bp.id >1
<where>
<if test="orderIdFk != null and orderIdFk != ''">
AND ic.orderIdFk = #{orderIdFk}

Loading…
Cancel
Save