发票问题代码备份

pro
anthonywj 2 years ago
parent 3ac25d320a
commit c57e232dfb

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

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

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

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

@ -1,10 +1,13 @@
package com.glxp.api.service.inout.impl; 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.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.glxp.api.dao.inout.IoCodeRelMapper; 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.dao.inout.IoOrderInvoiceMapper;
import com.glxp.api.entity.inout.IoCodeRelEntity; 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.entity.inout.IoOrderInvoiceEntity;
import com.glxp.api.req.inout.IoOrderInvoiceRequest; import com.glxp.api.req.inout.IoOrderInvoiceRequest;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
@ -14,6 +17,7 @@ import com.glxp.api.service.inout.IoOrderInvoiceService;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -22,6 +26,8 @@ import java.util.List;
public class IoOrderInvoiceServiceImpl extends ServiceImpl<IoOrderInvoiceMapper, IoOrderInvoiceEntity> implements IoOrderInvoiceService { public class IoOrderInvoiceServiceImpl extends ServiceImpl<IoOrderInvoiceMapper, IoOrderInvoiceEntity> implements IoOrderInvoiceService {
@Resource @Resource
IoOrderInvoiceMapper ioOrderInvoiceMapper; IoOrderInvoiceMapper ioOrderInvoiceMapper;
@Resource
IoOrderDetailCodeDao orderDetailCodeDao;
@Override @Override
public List<IoOrderInvoiceEntity> findByBillNo(String orderIdFk) { public List<IoOrderInvoiceEntity> findByBillNo(String orderIdFk) {
@ -51,4 +57,28 @@ public class IoOrderInvoiceServiceImpl extends ServiceImpl<IoOrderInvoiceMapper,
public List<IoOrderInvoiceEntity> selectOrderInvoice(IoOrderInvoiceRequest ioOrderInvoiceRequest) { public List<IoOrderInvoiceEntity> selectOrderInvoice(IoOrderInvoiceRequest ioOrderInvoiceRequest) {
return ioOrderInvoiceMapper.selectOrderInvoice(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 id="filterListInv" resultType="com.glxp.api.res.inout.IoOrderInvoiceResponse">
SELECT ic.*,cpmctymc,ggxh SELECT ic.*, cpmctymc, ggxh
FROM io_order_invoice ic FROM io_order_invoice ic
LEFT JOIN basic_udirel bu ON bu.id = ic.bindRlFk LEFT JOIN basic_udirel bu ON bu.id = ic.bindRlFk
LEFT JOIN basic_products bp ON bu.uuid = bp.uuid LEFT JOIN basic_products bp ON bu.uuid = bp.uuid
<where> <where>
<if test="orderIdFk != null and orderIdFk != ''"> <if test="orderIdFk != null and orderIdFk != ''">
AND ic.orderIdFk = #{orderIdFk} AND ic.orderIdFk = #{orderIdFk}
@ -70,13 +70,15 @@
<if test="batchNo == null || batchNo == ''"> <if test="batchNo == null || batchNo == ''">
AND (ic.batchNo is null or ic.batchNo = '') AND (ic.batchNo is null or ic.batchNo = '')
</if> </if>
</where> </where>
GROUP BY ic.id GROUP BY ic.id
</select> </select>
<select id="selectByinvoiceId" parameterType="java.lang.Long" resultType="com.glxp.api.res.inout.IoOrderInvoiceResponse"> <select id="selectByinvoiceId" parameterType="java.lang.Long"
select * from io_order_invoice where id= #{id} resultType="com.glxp.api.res.inout.IoOrderInvoiceResponse">
select *
from io_order_invoice
where id = #{id}
</select> </select>
<select id="selectOrderDetailBiz" resultType="com.glxp.api.entity.inout.IoOrderDetailBizEntity"> <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 id="getfilterOrderList" resultType="com.glxp.api.res.inout.IoOrderDetailCodeResponse">
select io_order_detail_code.*, select io_order_detail_code.*,
(select count(*) (select count(*)
FROM io_order_invoice FROM io_order_invoice
where io_order_invoice.orderIdFk = io_order_detail_code.orderIdFk) as sucCount where io_order_invoice.orderIdFk = io_order_detail_code.orderIdFk) as sucCount
from io_order_detail_code from io_order_detail_code
<where> <where>
<if test="orderIdFk != null and orderIdFk != ''"> <if test="orderIdFk != null and orderIdFk != ''">
@ -126,11 +128,7 @@
<if test="batchNo != null and batchNo != ''"> <if test="batchNo != null and batchNo != ''">
AND batchNo = #{batchNo} AND batchNo = #{batchNo}
</if> </if>
<if test="productName != null and productName != ''">
AND bp.cpmctymc like concat('%', #{productName}, '%')
</if>
</where> </where>
group by io_order_detail_code.id group by io_order_detail_code.id
</select> </select>
</mapper> </mapper>

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

Loading…
Cancel
Save