release
WangQi 2 years ago
parent 2771b60ca8
commit b5fca06951
  1. 3
      order-management-consumer/src/main/java/com/dxhy/order/consumer/dao/OrderProcessInfoMapper.java
  2. 6
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/controller/OrderInfoController.java
  3. 29
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/model/vo/OrderInfoTotalAmountVO.java
  4. 11
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/OrderInfoService.java
  5. 6
      order-management-consumer/src/main/java/com/dxhy/order/consumer/modules/order/service/impl/OrderInfoServiceImpl.java
  6. 289
      order-management-consumer/src/main/resources/mybatis/mapper/OrderProcessInfoMapper.xml

@ -1,5 +1,6 @@
package com.dxhy.order.consumer.dao;
import com.dxhy.order.consumer.modules.order.model.vo.OrderInfoTotalAmountVO;
import com.dxhy.order.model.OrderProcessInfo;
import com.dxhy.order.consumer.modules.order.model.bo.YwlxCountBO;
import com.dxhy.order.consumer.modules.order.model.bo.YwlxCountTotalBO;
@ -78,6 +79,8 @@ public interface OrderProcessInfoMapper {
*/
List<OrderProcessInfo> queryOrderInfo(@Param("map") Map map, @Param("shList") List<String> shList, @Param("entList") List<String> entList);
OrderInfoTotalAmountVO queryOrderInfoTotalAmount(@Param("map") Map map, @Param("shList") List<String> shList, @Param("entList") List<String> entList);
/**
* 通过orderId查询处理表
*

@ -10,6 +10,7 @@ import com.dxhy.order.constant.OrderInfoContentEnum;
import com.dxhy.order.constant.OrderInfoEnum;
import com.dxhy.order.constant.OrderManagementConstant;
import com.dxhy.order.consumer.modules.order.model.dto.RewriteBzdhDTO;
import com.dxhy.order.consumer.modules.order.model.vo.OrderInfoTotalAmountVO;
import com.dxhy.order.consumer.modules.order.service.OrderBzdhService;
import com.dxhy.order.exception.OrderReceiveException;
import com.dxhy.order.model.*;
@ -152,7 +153,10 @@ public class OrderInfoController {
//查询数据库
PageUtils page = orderInfoService.selectOrderInfo(paramMap, null, entList);
return R.ok().put(OrderManagementConstant.DATA, page);
// 统计金额税额
OrderInfoTotalAmountVO totalAmountVO = orderInfoService.selectOrderSum(paramMap, null, entList);
return R.ok().put(OrderManagementConstant.DATA, page).put("total", totalAmountVO);
} catch (Exception e) {
log.error("{}列表查询异常:{}", LOGGER_MSG, e);
return R.error(OrderInfoContentEnum.INTERNAL_SERVER_ERROR);

@ -0,0 +1,29 @@
package com.dxhy.order.consumer.modules.order.model.vo;
import lombok.Data;
import java.math.BigDecimal;
/**
* 发票申请单管理 发票处理中心金额税额价税合计统计VO
*/
@Data
public class OrderInfoTotalAmountVO {
/**
* 开票合计金额
*/
private BigDecimal kphjje;
/**
* 合计不含税金额
*/
private BigDecimal hjbhsje;
/**
* 开票税额
*/
private BigDecimal kpse;
}

@ -3,6 +3,7 @@ package com.dxhy.order.consumer.modules.order.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.dxhy.order.consumer.model.page.PageRequestVO;
import com.dxhy.order.consumer.modules.order.model.vo.OrderInfoTotalAmountVO;
import com.dxhy.order.exception.OrderReceiveException;
import com.dxhy.order.model.*;
import com.dxhy.base.constant.OrderSeparationException;
@ -14,6 +15,7 @@ import com.dxhy.order.consumer.modules.order.model.bo.YwlxCountTotalBO;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;
@ -35,6 +37,15 @@ public interface OrderInfoService {
*/
PageUtils selectOrderInfo(Map<String, Object> map, List<String> shList, List<String> entList);
/**
* 查询订单列表金额统计
* @param map
* @param shList
* @param entList
* @return
*/
OrderInfoTotalAmountVO selectOrderSum(Map<String, Object> map, List<String> shList, List<String> entList);
/**
* 根据发票请求流水号 查询订单信息和订单明细
*

@ -33,6 +33,7 @@ import com.dxhy.order.consumer.modules.order.model.PageInvoiceItem;
import com.dxhy.order.consumer.modules.order.model.PageKySlReq;
import com.dxhy.order.consumer.modules.order.model.PageKySlRsp;
import com.dxhy.order.consumer.modules.order.model.bo.YwlxCountTotalBO;
import com.dxhy.order.consumer.modules.order.model.vo.OrderInfoTotalAmountVO;
import com.dxhy.order.consumer.modules.order.service.*;
import com.dxhy.order.consumer.modules.validate.service.ValidateOrderInfoService;
import com.dxhy.order.consumer.openapi.service.CommonInterfaceService;
@ -178,6 +179,11 @@ public class OrderInfoServiceImpl implements OrderInfoService {
return orderProcessService.selectOrderInfo(map, shList, entList);
}
@Override
public OrderInfoTotalAmountVO selectOrderSum(Map<String, Object> map, List<String> shList, List<String> entList) {
return orderProcessInfoMapper.queryOrderInfoTotalAmount(map, shList, entList);
}
@Override
public OderDetailInfo selectOrderDetailByFpqqlsh(String fpqqlsh, List<String> shList) {
/**

@ -1317,6 +1317,295 @@
</if>
</where>
</select>
<select id="queryOrderInfoTotalAmount"
resultType="com.dxhy.order.consumer.modules.order.model.vo.OrderInfoTotalAmountVO">
select
sum(ifnull(cast(op.kphjje as decimal(18,6)),0)) as kphjje,
sum(ifnull(cast(op.hjbhsje as decimal(18,6)),0)) as hjbhsje,
sum(ifnull(cast(op.kpse as decimal(18,6)),0)) as kpse
from order_process_info op
left join order_invoice_info oii on op.id = oii.order_process_info_id
<where>
<!-- mysql数据库 -->
<if test="dataType == 0">
<choose>
<when
test="map.minhjje !=null and map.minhjje != '' and map.maxhjje !=null and map.maxhjje != ''">
and cast(op.kphjje as DECIMAL) BETWEEN
#{map.minhjje,jdbcType=DOUBLE}
and
#{map.maxhjje,jdbcType=DOUBLE}
</when>
<otherwise>
<if test="map.minhjje !=null and map.minhjje != ''">
and cast(op.kphjje as DECIMAL) >=
#{map.minhjje,jdbcType=DOUBLE}
</if>
<if test="map.maxhjje !=null and map.maxhjje != ''">
and #{map.maxhjje,jdbcType=DOUBLE}
>= cast(op.kphjje as DECIMAL)
</if>
</otherwise>
</choose>
<if test="map.startTime !=null and map.startTime != ''">
and op.ddcjsj >= #{map.startTime}
</if>
<if test="map.endTime !=null and map.endTime != ''">
and #{map.endTime} >= op.ddcjsj
</if>
<if test="map.ddh != null and map.ddh != ''">
and op.ddh like "%"#{map.ddh,jdbcType=VARCHAR}"%"
</if>
<if test="map.gmfmc != null and map.gmfmc != ''">
and op.ghf_mc like
concat('%',#{map.gmfmc,jdbcType=VARCHAR},'%')
</if>
<if test="map.xhfmc != null and map.xhfmc != ''">
and op.xhf_mc like
concat('%',#{map.xhfmc,jdbcType=VARCHAR},'%')
</if>
<if test="map.sbyy != null and map.sbyy != ''">
and op.sbyy like
concat('%',#{map.sbyy,jdbcType=VARCHAR},'%')
</if>
</if>
<!-- oracle数据库 -->
<if test="dataType == 1">
<choose>
<when
test="map.minhjje !=null and map.minhjje != '' and map.maxhjje !=null and map.maxhjje != ''">
and to_number(op.kphjje) BETWEEN
#{map.minhjje,jdbcType=DOUBLE}
and
#{map.maxhjje,jdbcType=DOUBLE}
</when>
<otherwise>
<if test="map.minhjje !=null and map.minhjje != ''">
and to_number(op.kphjje) >=
#{map.minhjje,jdbcType=DOUBLE}
</if>
<if test="map.maxhjje !=null and map.maxhjje != ''">
and #{map.maxhjje,jdbcType=DOUBLE}
>= to_number(op.kphjje)
</if>
</otherwise>
</choose>
<if test="map.startTime !=null and map.startTime != ''">
and trunc(op.ddcjsj)
>=to_date(#{map.startTime,jdbcType=VARCHAR},'yyyy-mm-dd hh24:mi:ss')
</if>
<if test="map.endTime !=null and map.endTime != ''">
and to_date(#{map.endTime,jdbcType=VARCHAR},'yyyy-mm-dd
hh24:mi:ss')>=trunc(op.ddcjsj)
</if>
<if test="map.ddh != null and map.ddh != ''">
and op.ddh like '%' || #{map.ddh,jdbcType=VARCHAR} || '%'
</if>
<if test="map.gmfmc != null and map.gmfmc != ''">
and op.ghf_mc like '%' || #{map.gmfmc,jdbcType=VARCHAR} ||
'%'
</if>
<if test="map.xhfmc != null and map.xhfmc != ''">
and op.xhf_mc like % || #{map.xhfmc,jdbcType=VARCHAR} ||
'%'
</if>
<if test="map.sbyy != null and map.sbyy != ''">
and op.sbyy like % || #{map.sbyy,jdbcType=VARCHAR} ||
'%'
</if>
</if>
<if test="map.ddzt != null and map.ddzt.size != 0">
and op.ddzt in
<foreach collection="map.ddzt" index="index" item="ddzti"
open="(" separator="," close=")">
#{ddzti,jdbcType=VARCHAR}
</foreach>
</if>
<if test="map.ddly != null and map.ddly.size() != 0">
and op.ddly in
<foreach collection="map.ddly" index="index" item="ddlyit"
open="(" separator="," close=")">
#{ddlyit,jdbcType=VARCHAR}
</foreach>
</if>
<if test="map.fpzldm != null and map.fpzldm.size() != 0">
and op.fpzl_dm in
<foreach collection="map.fpzldm" index="index" item="fpzldmit"
open="(" separator="," close=")">
#{fpzldmit,jdbcType=VARCHAR}
</foreach>
</if>
<if test="map.fpqqlshList != null and map.fpqqlshList.size() == 1">
and op.fpqqlsh =
<foreach collection="map.fpqqlshList" index="index" item="item">
#{item}
</foreach>
</if>
<if test="map.fpqqlshList != null and map.fpqqlshList.size() > 1">
and op.fpqqlsh in
<foreach collection="map.fpqqlshList" index="index" item="item"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="map.kplshList != null and map.kplshList.size() == 1">
and oii.kplsh =
<foreach collection="map.kplshList" index="index" item="item">
#{item}
</foreach>
</if>
<if test="map.kplshList != null and map.kplshList.size() > 1">
and oii.kplsh in
<foreach collection="map.kplshList" index="index" item="item"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="map.sksbCode != null and map.sksbCode != ''">
and oii.sksbdm = #{map.sksbCode,jdbcType=VARCHAR}
</if>
<if test="map.tsJosList != null and map.tsJosList.size == 1">
and oii.push_jos_status =
<foreach collection="map.tsJosList" index="index" item="item">
#{item}
</foreach>
</if>
<if test="map.tsJosList != null and map.tsJosList.size > 1">
and oii.push_jos_status in
<foreach collection="map.tsJosList" index="index" item="tsJosListi"
open="(" separator="," close=")">
#{tsJosListi,jdbcType=VARCHAR}
</foreach>
</if>
<if test="map.ywlx != null and map.ywlx != ''">
and op.ywlx = #{map.ywlx,jdbcType=VARCHAR}
</if>
<if test="map.fplx != null and map.fplx != '' ">
and op.fpzl_dm = #{map.fplx,jdbcType=VARCHAR}
</if>
<if test="map.ghfNsrsbh != null and map.ghfNsrsbh != ''">
and op.ghf_nsrsbh = #{map.ghfNsrsbh,jdbcType=VARCHAR}
</if>
<if test="map.orderStatus !=null and map.orderStatus !='' ">
and op.order_status = #{map.orderStatus,jdbcType=VARCHAR}
</if>
<if test="map.checkStatus !=null and map.checkStatus !='' ">
and op.check_status = #{map.checkStatus,jdbcType=VARCHAR}
</if>
<if test="shList != null and shList.size() == 0">
and op.xhf_nsrsbh = ''
</if>
<if test="shList != null and shList.size() == 1">
and op.xhf_nsrsbh =
<foreach collection="shList" index="index" item="item">
#{item}
</foreach>
</if>
<if test="shList != null and shList.size() > 1">
and op.xhf_nsrsbh in
<foreach collection="shList" index="index" item="item"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="entList != null and entList.size() == 0">
and op.ent_id = ''
</if>
<if test="entList != null and entList.size() == 1">
and op.ent_id =
<foreach collection="entList" index="index" item="item">
#{item}
</foreach>
</if>
<if test="entList != null and entList.size() > 1">
and op.ent_id in
<foreach collection="entList" index="index" item="item"
open="(" separator="," close=")">
#{item}
</foreach>
</if>
<if test="map.bzdh != null and map.bzdh != ''">
and op.bzdh = #{map.bzdh,jdbcType=VARCHAR}
</if>
<if test="map.xtly != null and map.xtly != ''">
and op.xtly = #{map.xtly,jdbcType=VARCHAR}
</if>
<if test="map.gsdm != null and map.gsdm != ''">
and op.gsdm = #{map.gsdm,jdbcType=VARCHAR}
</if>
<if test="map.bhzt != null and map.bhzt != ''">
and op.bhzt = #{map.bhzt,jdbcType=VARCHAR}
</if>
<if test="map.ygxm != null and map.ygxm != ''">
and op.ygxm = #{map.ygxm,jdbcType=VARCHAR}
</if>
<if test="map.kppzh != null and map.kppzh != ''">
and op.kppzh = #{map.kppzh,jdbcType=VARCHAR}
</if>
<if test="map.pzgzrq != null">
and op.pzgzrq = #{map.pzgzrq,jdbcType=TIMESTAMP}
</if>
<if test="map.yzfp != null and map.yzfp != ''">
and op.yzfp = #{map.yzfp,jdbcType=VARCHAR}
</if>
<if test="map.originDdh != null and map.originDdh != ''">
and op.origin_ddh = #{map.originDdh,jdbcType=VARCHAR}
</if>
<if test="map.originOrderId != null and map.originOrderId != ''">
and op.origin_order_id = #{map.originOrderId,jdbcType=VARCHAR}
</if>
<if test="map.kb != null and map.kb != ''">
and op.kb = #{map.kb,jdbcType=VARCHAR}
</if>
<if test="map.pzgzrqBegin !=null and map.pzgzrqBegin != ''">
and op.pzgzrq >= #{map.pzgzrqBegin}
</if>
<if test="map.pzgzrqEnd !=null and map.pzgzrqEnd != ''">
and #{map.pzgzrqEnd} >= op.pzgzrq
</if>
<if test="map.dyzt != null and map.dyzt != ''">
and oii.dyzt = #{map.dyzt,jdbcType=VARCHAR}
</if>
<if test="map.qdbz != null ">
and oii.qd_bz in
<foreach collection="map.qdbz" index="index" item="item"
open="(" separator="," close=")">
#{item,jdbcType=VARCHAR}
</foreach>
</if>
<if test="map.kplx != null and map.kplx != ''">
and oii.kplx = #{map.kplx,jdbcType=VARCHAR}
</if>
<!-- 异常订单列表根据订单更新时间排序 -->
<choose>
<when test="map.orderBy !=null and map.orderBy == 'updateTime' ">
order by op.update_time desc
</when>
<when test="map.orderBy !=null and map.orderBy == 'createTimeAsc' ">
order by op.ddcjsj asc
</when>
<otherwise>
order by op.ddcjsj desc,op.num desc,op.create_time desc,op.id desc
</otherwise>
</choose>
</where>
</select>
</mapper>

Loading…
Cancel
Save