修改发票bug 添加金额 总金额

pro
wangwei 2 years ago
parent 7e6f38b274
commit 83697b44bd

@ -21,6 +21,7 @@ import com.glxp.api.req.inout.*;
import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.inout.IoOrderDetailBizResponse;
import com.glxp.api.res.inout.IoOrderDetailCodeResponse;
import com.glxp.api.res.inout.IoOrderResponse;
import com.glxp.api.res.inout.PdaBusOrderResponse;
import com.glxp.api.service.auth.InvBusUserService;
@ -36,6 +37,7 @@ import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -134,6 +136,22 @@ public class IoOrderController extends BaseController {
}
List<IoOrderResponse> list = orderService.getfilterList(filterOrderRequest);
for (IoOrderResponse ioOrderResponse : list) {
FilterOrderDetailCodeRequest filterOrderDetailCodeRequest = new FilterOrderDetailCodeRequest();
filterOrderDetailCodeRequest.setOrderIdFk(ioOrderResponse.getBillNo());
List<IoOrderDetailCodeResponse> ioOrderDetailCodeResponses = orderDetailBizService.getfilterList(filterOrderDetailCodeRequest);
BigDecimal amount=new BigDecimal(0.00);
for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) {
if(ioOrderDetailCodeRespons.getCount() != 0) {
amount = amount.add(new BigDecimal(ioOrderDetailCodeRespons.getCount()).multiply(ioOrderDetailCodeRespons.getPrice()));
}
}
ioOrderResponse.setAllAmount(amount);
}
PageInfo<IoOrderResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo);
}

@ -32,6 +32,7 @@ import com.glxp.api.req.thrsys.FilterThrOrderDetailRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.res.inout.IoOrderDetailBizResponse;
import com.glxp.api.res.inout.IoOrderDetailCodeResponse;
import com.glxp.api.res.inout.IoOrderInvoiceResponse;
import com.glxp.api.service.auth.InvWarehouseService;
import com.glxp.api.service.basic.*;
@ -513,14 +514,14 @@ public class IoOrderDetailBizController extends BaseController {
return ResultVOUtils.page(pageInfo);
}
@GetMapping("/udiwms/inout/bizDetail/filterListInv")
public BaseResponse filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest) {
List<IoOrderDetailBizResponse> list = orderDetailBizService.getfilterList(orderDetailBizRequest);
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderDetailBizRequest.getOrderIdFk());
ioCheckInoutService.bizOrderCheck2(list, orderDetailCodeEntities);
PageInfo<IoOrderDetailBizResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo);
}
// @GetMapping("/udiwms/inout/bizDetail/filterListInv")
// public BaseResponse filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest) {
// List<IoOrderDetailBizResponse> list = orderDetailBizService.getfilterList(orderDetailBizRequest);
// List<IoOrderDetailCodeEntity> orderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderDetailBizRequest.getOrderIdFk());
// ioCheckInoutService.bizOrderCheck2(list, orderDetailCodeEntities);
// PageInfo<IoOrderDetailBizResponse> pageInfo = new PageInfo<>(list);
// return ResultVOUtils.page(pageInfo);
// }
@GetMapping("/udiwms/inout/bizDetail/filterListInvoice")
public BaseResponse filterListInvoice(FilterOrderDetailBizRequest orderDetailBizRequest) {
@ -561,7 +562,7 @@ public class IoOrderDetailBizController extends BaseController {
ioOrderInvoiceService.deleteByInvId(ioOrderInvoiceEntity.getId()+"");
//更改 登记状态
IoOrderDetailBizEntity ioOrderDetailBizEntity = new IoOrderDetailBizEntity();
IoOrderDetailCodeEntity ioOrderDetailBizEntity = new IoOrderDetailCodeEntity();
FilterOrderDetailBizRequest filterOrderDetailBizRequest = new FilterOrderDetailBizRequest();
@ -575,7 +576,7 @@ public class IoOrderDetailBizController extends BaseController {
if(list == null && list.size()==0){
ioOrderDetailBizEntity.setRegStatus(false);
}
orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity);
orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity);
return ResultVOUtils.success();
@ -627,10 +628,10 @@ public class IoOrderDetailBizController extends BaseController {
}
@PostMapping("/udiwms/inout/biz/updateorderBiz")
public BaseResponse updateorderBiz(@RequestBody List<IoOrderDetailBizEntity> list) {
for (IoOrderDetailBizEntity ioOrderDetailBizEntity : list) {
public BaseResponse updateorderBiz(@RequestBody List<IoOrderDetailCodeEntity> list) {
for (IoOrderDetailCodeEntity ioOrderDetailBizEntity : list) {
ioOrderDetailBizEntity.setRegStatus(true);
orderDetailBizService.updateOrderDetailBiz(ioOrderDetailBizEntity);
orderDetailCodeService.updateOrderDetailBiz(ioOrderDetailBizEntity);
}
return ResultVOUtils.success("成功");
@ -645,13 +646,14 @@ public class IoOrderDetailBizController extends BaseController {
* @return
*/
@GetMapping("/udiwms/inout/bizDetail/filterBizOrderList")
public BaseResponse filterBizOrderList(FilterOrderDetailBizRequest orderDetailBizRequest) {
List<IoOrderDetailBizResponse> list = orderDetailBizService.getfilterList(orderDetailBizRequest);
for (IoOrderDetailBizResponse ioOrderDetailBizResponse : list) {
public BaseResponse filterBizOrderList(FilterOrderDetailCodeRequest orderDetailBizRequest) {
List<IoOrderDetailCodeResponse> ioOrderDetailCodeResponses = orderDetailBizService.getfilterList(orderDetailBizRequest);
for (IoOrderDetailCodeResponse ioOrderDetailCodeRespons : ioOrderDetailCodeResponses) {
ioOrderDetailCodeRespons.setAmount(new BigDecimal(ioOrderDetailCodeRespons.getCount()).multiply(ioOrderDetailCodeRespons.getPrice()));
String msg = "";
IoOrderInvoiceRequest ioOrderInvoiceEntity = new IoOrderInvoiceRequest();
ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailBizResponse.getOrderIdFk());
ioOrderInvoiceEntity.setBizIdFk(ioOrderDetailBizResponse.getId());
ioOrderInvoiceEntity.setOrderIdFk(ioOrderDetailCodeRespons.getOrderIdFk());
ioOrderInvoiceEntity.setBizIdFk(ioOrderDetailCodeRespons.getId());
List<IoOrderInvoiceEntity> ioOrderInvoiceEntityList = ioOrderInvoiceService.selectOrderInvoice(ioOrderInvoiceEntity);
for (IoOrderInvoiceEntity obj : ioOrderInvoiceEntityList) {
if (StrUtil.isNotEmpty(obj.getInvoiceEncode())) {
@ -661,9 +663,9 @@ public class IoOrderDetailBizController extends BaseController {
if (msg.length() > 1) {
msg = msg.substring(1);
}
ioOrderDetailBizResponse.setInvoiceCodes(msg);
ioOrderDetailCodeRespons.setInvoiceCodes(msg);
}
PageInfo<IoOrderDetailBizResponse> pageInfo = new PageInfo<>(list);
PageInfo<IoOrderDetailCodeResponse> pageInfo = new PageInfo<>(ioOrderDetailCodeResponses);
return ResultVOUtils.page(pageInfo);
}

@ -3,7 +3,9 @@ package com.glxp.api.dao.inout;
import com.glxp.api.dao.BaseMapperPlus;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.req.inout.FilterOrderDetailBizRequest;
import com.glxp.api.req.inout.FilterOrderDetailCodeRequest;
import com.glxp.api.res.inout.IoOrderDetailBizResponse;
import com.glxp.api.res.inout.IoOrderDetailCodeResponse;
import com.glxp.api.res.inout.IoOrderInvoiceResponse;
import org.apache.ibatis.annotations.Param;
@ -19,7 +21,7 @@ public interface IoOrderDetailBizDao extends BaseMapperPlus<IoOrderDetailBizDao,
*/
List<IoOrderDetailBizResponse> filterList(FilterOrderDetailBizRequest orderDetailBizRequest);
List<IoOrderDetailBizResponse> getfilterList(FilterOrderDetailBizRequest orderDetailBizRequest);
List<IoOrderDetailCodeResponse> getfilterList(FilterOrderDetailCodeRequest orderDetailBizRequest);
List<IoOrderInvoiceResponse> filterListInv(FilterOrderDetailBizRequest orderDetailBizRequest);

@ -191,5 +191,9 @@ public class IoOrderDetailCodeEntity {
@TableField(exist = false)
private String errMsg;
@TableField(value = "regStatus")
private boolean regStatus;
}

@ -8,6 +8,7 @@ import lombok.Data;
*/
@Data
public class FilterOrderDetailCodeRequest extends ListPageRequest {
private Long relId;
/**
*
@ -39,4 +40,6 @@ public class FilterOrderDetailCodeRequest extends ListPageRequest {
*/
private String productName;
private Long bizIdFk;
}

@ -162,4 +162,13 @@ public class IoOrderDetailCodeResponse {
private int orderCount;
private String invoiceCodes;
private Integer sucCount;
private boolean regStatus;
//金额
private BigDecimal amount;
}

@ -6,6 +6,7 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
@Data
@ -236,6 +237,9 @@ public class IoOrderResponse {
private Integer partCount;
//总金额
private BigDecimal allAmount;
/**

@ -2,7 +2,9 @@ package com.glxp.api.service.inout;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.req.inout.FilterOrderDetailBizRequest;
import com.glxp.api.req.inout.FilterOrderDetailCodeRequest;
import com.glxp.api.res.inout.IoOrderDetailBizResponse;
import com.glxp.api.res.inout.IoOrderDetailCodeResponse;
import com.glxp.api.res.inout.IoOrderInvoiceResponse;
import java.util.List;
@ -34,7 +36,7 @@ public interface IoOrderDetailBizService {
List<IoOrderDetailBizResponse> filterList(FilterOrderDetailBizRequest orderDetailBizRequest);
List<IoOrderDetailBizResponse> getfilterList(FilterOrderDetailBizRequest orderDetailBizRequest);
List<IoOrderDetailCodeResponse> getfilterList(FilterOrderDetailCodeRequest orderDetailBizRequest);
IoOrderDetailBizEntity selectByBatchNoAndBindRlFk(String batchNo, String bindRlFk);

@ -1,5 +1,6 @@
package com.glxp.api.service.inout;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderDetailCodeEntity;
import com.glxp.api.req.inout.FilterOrderDetailCodeRequest;
import com.glxp.api.res.inout.IoOrderDetailCodeResponse;
@ -47,4 +48,7 @@ public interface IoOrderDetailCodeService {
* @return
*/
List<IoOrderDetailCodeResponse> getDetailCodeResponse(List<IoOrderDetailCodeEntity> orderEntityList);
Boolean updateOrderDetailBiz(IoOrderDetailCodeEntity orderDetailCodeEntity);
}

@ -10,7 +10,9 @@ import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderDetailCodeEntity;
import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.req.inout.FilterOrderDetailBizRequest;
import com.glxp.api.req.inout.FilterOrderDetailCodeRequest;
import com.glxp.api.res.inout.IoOrderDetailBizResponse;
import com.glxp.api.res.inout.IoOrderDetailCodeResponse;
import com.glxp.api.res.inout.IoOrderInvoiceResponse;
import com.glxp.api.service.inout.IoCheckInoutService;
import com.glxp.api.service.inout.IoOrderDetailBizService;
@ -118,14 +120,14 @@ public class IoOrderDetailBizServiceImpl implements IoOrderDetailBizService {
}
@Override
public List<IoOrderDetailBizResponse> getfilterList(FilterOrderDetailBizRequest orderDetailBizRequest) {
if (null == orderDetailBizRequest) {
public List<IoOrderDetailCodeResponse> getfilterList(FilterOrderDetailCodeRequest OrderDetailCodeRequest) {
if (null == OrderDetailCodeRequest) {
return Collections.emptyList();
}
if (null != orderDetailBizRequest.getPage() && null != orderDetailBizRequest.getLimit()) {
PageHelper.offsetPage((orderDetailBizRequest.getPage() - 1) * orderDetailBizRequest.getLimit(), orderDetailBizRequest.getLimit());
if (null != OrderDetailCodeRequest.getPage() && null != OrderDetailCodeRequest.getLimit()) {
PageHelper.offsetPage((OrderDetailCodeRequest.getPage() - 1) * OrderDetailCodeRequest.getLimit(), OrderDetailCodeRequest.getLimit());
}
return ioOrderDetailBizDao.getfilterList(orderDetailBizRequest);
return ioOrderDetailBizDao.getfilterList(OrderDetailCodeRequest);
}
@Override

@ -115,4 +115,10 @@ public class IoOrderDetailCodeServiceImpl implements IoOrderDetailCodeService {
}
return list;
}
@Override
public Boolean updateOrderDetailBiz(IoOrderDetailCodeEntity orderDetailCodeEntity) {
return ioOrderDetailCodeDao.updateById(orderDetailCodeEntity)>0;
}
}

@ -149,11 +149,11 @@
(select name from auth_warehouse aw2 where aw2.code = io.fromInvCode) fromInvName,
(select name from basic_corp bc where bc.erpId = io.fromCorp) fromCorpName,
(select name from basic_corp bc where bc.erpId = io.customerId) customerName,
(SELECT count(*) FROM io_order_detail_biz WHERE io_order_detail_biz.orderIdFk = io.billNo
and io_order_detail_biz.regStatus = 1
(SELECT count(*) FROM io_order_detail_code WHERE io_order_detail_code.orderIdFk = io.billNo
and io_order_detail_code.regStatus = 1
) AS allCout,
(SELECT count(*) FROM io_order_detail_biz WHERE io_order_detail_biz.orderIdFk = io.billNo
and io_order_detail_biz.regStatus = 0
(SELECT count(*) FROM io_order_detail_code WHERE io_order_detail_code.orderIdFk = io.billNo
and io_order_detail_code.regStatus = 0
) As partCount
from io_order as io
<where>

@ -23,13 +23,13 @@
group by io_order_detail_biz.id
</select>
<select id="getfilterList" resultType="com.glxp.api.res.inout.IoOrderDetailBizResponse">
select io_order_detail_biz.*,
<select id="getfilterList" 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_biz.orderIdFk) as sucCount
from io_order_detail_biz
left join basic_udirel bu on bu.id = io_order_detail_biz.bindRlFk
where io_order_invoice.orderIdFk = io_order_detail_code.orderIdFk) as sucCount
from io_order_detail_code
left join basic_udirel bu on bu.id = io_order_detail_code.bindRlFk
left join basic_products bp on bu.uuid = bp.uuid
<where>
<if test="orderIdFk != null and orderIdFk != ''">
@ -45,7 +45,7 @@
AND bp.cpmctymc like concat('%', #{productName}, '%')
</if>
</where>
group by io_order_detail_biz.id
group by io_order_detail_code.id
</select>

@ -35,7 +35,6 @@ CALL Pro_Temp_ColumnWork('io_order', 'checkTime', 'datetime ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'checkUser', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_order', 'regStatus', 'varchar(255) ', 1);
CALL Pro_Temp_ColumnWork('io_order_detail_biz', 'regStatus', 'varchar(255) ', 1);
@ -351,9 +350,6 @@ CALL Pro_Temp_ColumnWork('thr_inv_warehouse', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('thr_products', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('thr_corp', 'id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_dept_user', 'userId', 'bigint', 2);
CALL Pro_Temp_ColumnWork('auth_dept_user', 'deptId', 'bigint', 2);
CALL Pro_Temp_ColumnWork('basic_bustype_pre', 'Id', 'bigint', 2);
CALL Pro_Temp_ColumnWork('basic_export_status', 'remark', 'varchar(2048)', 2);
CALL Pro_Temp_ColumnWork('auth_role', 'isCustomer', 'int', 1);
@ -367,4 +363,9 @@ CALL Pro_Temp_ColumnWork('sync_data_set', 'orderInvoice', 'tinyint', 1);
CALL Pro_Temp_ColumnWork('io_order_invoice', 'id', 'bigint ', 2);
CALL Pro_Temp_ColumnWork('io_order_detail_code', 'regStatus', 'varchar(255) ', 1);

Loading…
Cancel
Save