/selectSpecificInvoice接口已完成
/invoiceToUser接口已完成成功部分,失败部分明天弄
This commit is contained in:
parent
e9242aaa11
commit
f0d93937f6
@ -22,6 +22,13 @@
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!--发送邮件依赖-->
|
||||
<dependency>
|
||||
<groupId>com.sun.mail</groupId>
|
||||
<artifactId>javax.mail</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
|
||||
<!--单元测试依赖-->
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
|
||||
@ -3,6 +3,8 @@ package com.xhpc.invoice.controller;
|
||||
import com.xhpc.common.core.web.controller.BaseController;
|
||||
import com.xhpc.common.core.web.domain.AjaxResult;
|
||||
import com.xhpc.invoice.domain.AllInvoiceOrdersRequest;
|
||||
import com.xhpc.invoice.domain.AllInvoiceOrdersResponse;
|
||||
import com.xhpc.invoice.domain.InvoiceToUserRequest;
|
||||
import com.xhpc.invoice.domain.SpecificInvoiceWrap;
|
||||
import com.xhpc.invoice.service.XhpcInvoiceService;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
@ -27,6 +29,53 @@ public class XhpcInvoiceController extends BaseController {
|
||||
@Resource
|
||||
XhpcInvoiceService xhpcInvoiceService;
|
||||
|
||||
/**
|
||||
* 给指定用户开发票,开票完成之后将开出的电子发票发送至用户的接收邮箱
|
||||
*
|
||||
* @author WH
|
||||
* @date 2021/12/22 12:03
|
||||
* @since version-1.0
|
||||
*/
|
||||
@PostMapping("/invoiceToUser")
|
||||
public AjaxResult invoiceToUser(@RequestBody InvoiceToUserRequest requestData) {
|
||||
//前置条件
|
||||
if (requestData.getInvoiceId() == null) {
|
||||
AjaxResult.error("必须传递未开发票id");
|
||||
}
|
||||
if (requestData.getStatus() == null) {
|
||||
AjaxResult.error("必须传递发票状态");
|
||||
}
|
||||
//捕获参数异常
|
||||
try {
|
||||
Boolean flagOfjudge = xhpcInvoiceService.invoiceToUser(requestData);
|
||||
if (!flagOfjudge) {
|
||||
AjaxResult.error("客户邮箱有误,邮件未发送成功,请通知用户修改邮箱");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
return AjaxResult.error(e.getMessage());
|
||||
}
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于在后台显示所有发票信息,包括待开发票和已开发票的信息
|
||||
*
|
||||
* @param requestData 前端传递过来的要查询的参数
|
||||
* @return AllInvoiceOrdersResponse 装着回显数据的包装类
|
||||
* @author WH
|
||||
* @date 2021/12/21 11:33
|
||||
* @since version-1.0
|
||||
*/
|
||||
@PostMapping("/selectAllInvoiceOrders")
|
||||
public AjaxResult selectAllInvoiceOrders(@RequestBody AllInvoiceOrdersRequest requestData) {
|
||||
|
||||
if (requestData.getCurrentPage() == null || requestData.getItems() == null) {
|
||||
AjaxResult.error("当前页数、每页要显示的条数为必传递项");
|
||||
}
|
||||
AllInvoiceOrdersResponse allInvoiceOrdersResponse = xhpcInvoiceService.selectAllInvoiceOrders(requestData);
|
||||
return AjaxResult.success(allInvoiceOrdersResponse);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于在财务点击开票时,回显开票数据
|
||||
*
|
||||
@ -46,20 +95,4 @@ public class XhpcInvoiceController extends BaseController {
|
||||
}
|
||||
return AjaxResult.success(specificInvoiceWrap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 用于在后台显示,所有发票信息,包括待开发票和已开发票的信息
|
||||
*
|
||||
* @param requestData 前端传递过来的要查询的参数
|
||||
* @return AllInvoiceOrdersResponse 装着回显数据的包装类
|
||||
* @author WH
|
||||
* @date 2021/12/21 11:33
|
||||
* @since version-1.0
|
||||
*/
|
||||
@PostMapping("/selectAllInvoiceOrders")
|
||||
public AjaxResult selectAllInvoiceOrders(@RequestBody AllInvoiceOrdersRequest requestData) {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
package com.xhpc.invoice.domain;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* InvoiceToUser接口接收数据的包装类
|
||||
*
|
||||
* @author WH
|
||||
* @date 2021/12/22 14:48
|
||||
* @since version-1.0
|
||||
*/
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
public class InvoiceToUserRequest {
|
||||
|
||||
@JsonProperty("invoiceId")
|
||||
private Long invoiceId;
|
||||
@JsonProperty("financeNotes")
|
||||
private String financeNotes;
|
||||
@JsonProperty("invoicingTime")
|
||||
private String invoicingTime;
|
||||
@JsonProperty("eletricInvoiceUrl")
|
||||
private String eletricInvoiceUrl;
|
||||
@JsonProperty("status")
|
||||
private Integer status;
|
||||
@JsonProperty("drawer")
|
||||
private String drawer;
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package com.xhpc.invoice.mapper;
|
||||
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
|
||||
/**
|
||||
* 操作后台系统用户表(SysUserMapper)的Mapper
|
||||
*
|
||||
* @author WH
|
||||
* @date 2021/12/22 15:18
|
||||
* @since version-1.0
|
||||
*/
|
||||
public interface SysUserMapper {
|
||||
|
||||
/**
|
||||
* 通过用户ID查询用户
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
SysUser selectUserById(Long userId);
|
||||
|
||||
}
|
||||
@ -1,7 +1,12 @@
|
||||
package com.xhpc.invoice.mapper;
|
||||
|
||||
import com.xhpc.invoice.domain.AllInvoiceOrdersRequest;
|
||||
import com.xhpc.invoice.domain.InvoiceToUserRequest;
|
||||
import com.xhpc.invoice.pojo.XhpcInvoice;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
public interface XhpcInvoiceMapper {
|
||||
|
||||
int deleteByPrimaryKey(Long invoiceId);
|
||||
@ -25,4 +30,57 @@ public interface XhpcInvoiceMapper {
|
||||
|
||||
int updateByPrimaryKey(XhpcInvoice record);
|
||||
|
||||
/**
|
||||
* 通过条件来查询每个发票的信息,然后返回
|
||||
*
|
||||
* @param requestData 查询条件
|
||||
* @return List<XhpcInvoice> 装着指定记录的信息
|
||||
* @author WH
|
||||
* @date 2021/12/21 16:13
|
||||
* @since version-1.0
|
||||
*/
|
||||
List<XhpcInvoice> selectAllInvoiceOrdersByCondition(AllInvoiceOrdersRequest requestData);
|
||||
|
||||
/**
|
||||
* 通过条件查询当前发票的总个数,然后返回
|
||||
*
|
||||
* @param requestData 查询条件
|
||||
* @return Long 发票总个数
|
||||
* @author WH
|
||||
* @date 2021/12/22 10:01
|
||||
* @since version-1.0
|
||||
*/
|
||||
Long sumItemsInvoice(AllInvoiceOrdersRequest requestData);
|
||||
|
||||
/**
|
||||
* 查询所有已开发票的总金额
|
||||
*
|
||||
* @return BigDecimal 所有已开发票的总金额
|
||||
* @author WH
|
||||
* @date 2021/12/22 11:45
|
||||
* @since version-1.0
|
||||
*/
|
||||
BigDecimal allInvoicedMoney();
|
||||
|
||||
/**
|
||||
* 查询所有未开发票的总金额
|
||||
*
|
||||
* @return BigDecimal 所有未开发票的总金额
|
||||
* @author WH
|
||||
* @date 2021/12/22 11:53
|
||||
* @since version-1.0
|
||||
*/
|
||||
BigDecimal allNotInvoicedMoney();
|
||||
|
||||
/**
|
||||
* 更新指定发票状态,让其成为已开发票状态
|
||||
*
|
||||
* @param requestData 更新数据的来源
|
||||
* @return Long 返回更新受影响的条数
|
||||
* @author WH
|
||||
* @date 2021/12/22 15:07
|
||||
* @since version-1.0
|
||||
*/
|
||||
Long invoiceToUser(InvoiceToUserRequest requestData);
|
||||
|
||||
}
|
||||
@ -1,5 +1,8 @@
|
||||
package com.xhpc.invoice.service;
|
||||
|
||||
import com.xhpc.invoice.domain.AllInvoiceOrdersRequest;
|
||||
import com.xhpc.invoice.domain.AllInvoiceOrdersResponse;
|
||||
import com.xhpc.invoice.domain.InvoiceToUserRequest;
|
||||
import com.xhpc.invoice.domain.SpecificInvoiceWrap;
|
||||
|
||||
/**
|
||||
@ -22,4 +25,26 @@ public interface XhpcInvoiceService {
|
||||
*/
|
||||
SpecificInvoiceWrap selectSpecificInvoice(Long invoiceId);
|
||||
|
||||
/**
|
||||
* 通过requestData中的申请人、申请人类型、发票状态、发票起始时间、发票申请终止时间、开票起始时间、开票终点时间、当前所在页数、当前页所要显示几行,来查询发票列表信息
|
||||
*
|
||||
* @param requestData 传递过来的查询参数
|
||||
* @return AllInvoiceOrdersResponse 发票列表对象
|
||||
* @author WH
|
||||
* @date 2021/12/21 16:02
|
||||
* @since version-1.0
|
||||
*/
|
||||
AllInvoiceOrdersResponse selectAllInvoiceOrders(AllInvoiceOrdersRequest requestData);
|
||||
|
||||
/**
|
||||
* 存储开发票的状态,将开票信息入库,并向指定用户的邮箱发送短信
|
||||
*
|
||||
* @param requestData 要入库的信息
|
||||
* @return Boolean 成功还是失败
|
||||
* @author WH
|
||||
* @date 2021/12/22 14:59
|
||||
* @since version-1.0
|
||||
*/
|
||||
Boolean invoiceToUser(InvoiceToUserRequest requestData);
|
||||
|
||||
}
|
||||
|
||||
@ -1,19 +1,24 @@
|
||||
package com.xhpc.invoice.service.impl;
|
||||
|
||||
import cn.hutool.extra.mail.MailUtil;
|
||||
import com.xhpc.common.core.utils.DateUtils;
|
||||
import com.xhpc.common.core.utils.bean.BeanUtils;
|
||||
import com.xhpc.common.domain.XhpcChargingStation;
|
||||
import com.xhpc.invoice.domain.AllInvoiceOrdersRequest;
|
||||
import com.xhpc.invoice.domain.AllInvoiceOrdersResponse;
|
||||
import com.xhpc.invoice.domain.InvoiceToUserRequest;
|
||||
import com.xhpc.invoice.domain.SpecificInvoiceWrap;
|
||||
import com.xhpc.invoice.mapper.XhpcChargingStationMapper;
|
||||
import com.xhpc.invoice.mapper.XhpcInvoiceMapHistoryOrderMapper;
|
||||
import com.xhpc.invoice.mapper.XhpcInvoiceMapper;
|
||||
import com.xhpc.invoice.mapper.XhpcOperatorMapper;
|
||||
import com.xhpc.invoice.mapper.*;
|
||||
import com.xhpc.invoice.pojo.XhpcInvoice;
|
||||
import com.xhpc.invoice.pojo.XhpcInvoiceMapHistoryOrder;
|
||||
import com.xhpc.invoice.service.XhpcInvoiceService;
|
||||
import com.xhpc.system.api.domain.SysUser;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.File;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@ -36,6 +41,86 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
||||
XhpcOperatorMapper xhpcOperatorMapper;
|
||||
@Resource
|
||||
XhpcChargingStationMapper xhpcChargingStationMapper;
|
||||
@Resource
|
||||
SysUserMapper sysUserMapper;
|
||||
|
||||
/**
|
||||
* 通过requestData中的申请人、申请人类型、发票状态、发票起始时间、发票申请终止时间、开票起始时间、开票终点时间、当前所在页数、当前页所要显示几行,来查询发票列表信息
|
||||
*
|
||||
* @param requestData 传递过来的查询参数
|
||||
* @return AllInvoiceOrdersResponse 发票列表对象
|
||||
* @author WH
|
||||
* @date 2021/12/21 16:02
|
||||
* @since version-1.0
|
||||
*/
|
||||
@Override
|
||||
public AllInvoiceOrdersResponse selectAllInvoiceOrders(AllInvoiceOrdersRequest requestData) {
|
||||
//计算分页索引
|
||||
requestData.setCurrentPage(requestData.getCurrentPage() - 1);
|
||||
//获取每个历史订单信息
|
||||
List<XhpcInvoice> xhpcInvoiceList = xhpcInvoiceMapper.selectAllInvoiceOrdersByCondition(requestData);
|
||||
//对拷,放置到itemsDTO中,然后将itemsDTO存放到itemsDTOList中
|
||||
ArrayList<AllInvoiceOrdersResponse.ItemsDTO> itemsDTOList = new ArrayList<>();
|
||||
for (XhpcInvoice xhpcInvoice : xhpcInvoiceList) {
|
||||
AllInvoiceOrdersResponse.ItemsDTO itemsDTO = new AllInvoiceOrdersResponse.ItemsDTO();
|
||||
itemsDTO.setInvoiceId(xhpcInvoice.getInvoiceId());
|
||||
itemsDTO.setCreator(xhpcInvoice.getCreator());
|
||||
itemsDTO.setCreatorType(xhpcInvoice.getCreatorType());
|
||||
itemsDTO.setInvoiceMoney(xhpcInvoice.getInvoiceMoney());
|
||||
itemsDTO.setStatus(xhpcInvoice.getStatus());
|
||||
itemsDTO.setCreateTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getCreateTime()));
|
||||
itemsDTO.setInvoicingTime(DateUtils.parseDateToStr(DateUtils.YYYY_MM_DD_HH_MM_SS, xhpcInvoice.getInvoicingTime()));
|
||||
itemsDTO.setDrawer(xhpcInvoice.getDrawer());
|
||||
itemsDTOList.add(itemsDTO);
|
||||
}
|
||||
AllInvoiceOrdersResponse allInvoiceOrdersResponse = new AllInvoiceOrdersResponse();
|
||||
allInvoiceOrdersResponse.setItems(itemsDTOList);
|
||||
//获取根据条件查询出来的发票总条数
|
||||
Long sumItemsInvoice = xhpcInvoiceMapper.sumItemsInvoice(requestData);
|
||||
allInvoiceOrdersResponse.setTotalItems(sumItemsInvoice);
|
||||
//查询所有已开发票总金额
|
||||
BigDecimal allInvoicedMoney = xhpcInvoiceMapper.allInvoicedMoney();
|
||||
if (allInvoicedMoney == null) {
|
||||
//如果没有开任何发票,那么总金额就设置成0.00
|
||||
allInvoicedMoney = new BigDecimal("0.00");
|
||||
}
|
||||
allInvoiceOrdersResponse.setInvoicedSumMoney(allInvoicedMoney);
|
||||
//查询所有未开发票总金额
|
||||
BigDecimal allNotInvoicedMoney = xhpcInvoiceMapper.allNotInvoicedMoney();
|
||||
allInvoiceOrdersResponse.setNotInvoiceSumMoney(allNotInvoicedMoney);
|
||||
return allInvoiceOrdersResponse;
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储成功开发票的状态,将开票信息入库,并向指定用户的邮箱发送短信
|
||||
*
|
||||
* @param requestData 要入库的信息
|
||||
* @return Boolean 成功还是失败
|
||||
* @author WH
|
||||
* @date 2021/12/22 14:59
|
||||
* @since version-1.0
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean invoiceToUser(InvoiceToUserRequest requestData) {
|
||||
//根据操作人的id,查询操作人的名字
|
||||
SysUser sysUser = sysUserMapper.selectUserById(Long.valueOf(requestData.getDrawer()));
|
||||
requestData.setDrawer(sysUser.getNickName());
|
||||
//发送电子pdf到接收者邮箱
|
||||
XhpcInvoice xhpcInvoice = xhpcInvoiceMapper.selectByPrimaryKey(requestData.getInvoiceId());
|
||||
String receiveEmail = xhpcInvoice.getReceiveEmail();
|
||||
File eletricInvoiceFile = new File("D:\\Enterprise_Resources\\ElectricInvoice\\ElectricInvoice.pdf");
|
||||
String sendEmailInfo = MailUtil.send(receiveEmail, "测试", "邮件来自Hutool测试", false, eletricInvoiceFile);
|
||||
if (sendEmailInfo == null) {
|
||||
return Boolean.FALSE;
|
||||
}
|
||||
//更新发票数据
|
||||
Long successFlag = xhpcInvoiceMapper.invoiceToUser(requestData);
|
||||
if (successFlag == 0) {
|
||||
throw new RuntimeException("无法更新指定发票,传入的数据有问题");
|
||||
}
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过发票id查找对应的发票数据
|
||||
@ -86,5 +171,4 @@ public class XhpcInvoiceServiceImpl implements XhpcInvoiceService {
|
||||
specificInvoiceWrap.setHistoryOrderScope(minTime + "," + maxTime);
|
||||
return specificInvoiceWrap;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
# 发件人(必须正确,否则发送失败)
|
||||
from = coml_aaron@163.com
|
||||
# 密码(注意,某些邮箱需要为SMTP服务单独设置密码,详情查看相关帮助)
|
||||
pass = DRTYHUCGNKPOFRVE
|
||||
@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.xhpc.invoice.mapper.SysUserMapper">
|
||||
|
||||
<resultMap id="SysUserResult" type="com.xhpc.system.api.domain.SysUser">
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="dept_id" property="deptId"/>
|
||||
<result column="user_name" property="userName"/>
|
||||
<result column="user_type" property="userType"/>
|
||||
<result column="nick_name" property="nickName"/>
|
||||
<result column="email" property="email"/>
|
||||
<result column="phonenumber" property="phonenumber"/>
|
||||
<result column="operator_id" property="operatorId"/>
|
||||
<result column="internet_user_id" property="internetUserId"/>
|
||||
<result column="sex" property="sex"/>
|
||||
<result column="avatar" property="avatar"/>
|
||||
<result column="password" property="password"/>
|
||||
<result column="data_power_type" property="dataPowerType"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="del_flag" property="delFlag"/>
|
||||
<result column="login_ip" property="loginIp"/>
|
||||
<result column="login_date" property="loginDate"/>
|
||||
<result column="create_by" property="createBy"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
<result column="update_by" property="updateBy"/>
|
||||
<result column="update_time" property="updateTime"/>
|
||||
<result column="remark" property="remark"/>
|
||||
<result column="operator_id" property="operatorId"/>
|
||||
<association column="dept_id" property="dept" javaType="com.xhpc.system.api.domain.SysDept"
|
||||
resultMap="deptResult"/>
|
||||
<collection property="roles" javaType="java.util.List" resultMap="RoleResult"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="deptResult" type="com.xhpc.system.api.domain.SysDept">
|
||||
<id property="deptId" column="dept_id"/>
|
||||
<result property="parentId" column="parent_id"/>
|
||||
<result property="deptName" column="dept_name"/>
|
||||
<result property="orderNum" column="order_num"/>
|
||||
<result property="leader" column="leader"/>
|
||||
<result property="status" column="dept_status"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="RoleResult" type="com.xhpc.system.api.domain.SysRole">
|
||||
<id property="roleId" column="role_id"/>
|
||||
<result property="roleName" column="role_name"/>
|
||||
<result property="roleKey" column="role_key"/>
|
||||
<result property="roleSort" column="role_sort"/>
|
||||
<result property="dataScope" column="data_scope"/>
|
||||
<result property="status" column="role_status"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id,
|
||||
u.dept_id,
|
||||
u.user_name,
|
||||
u.nick_name,
|
||||
u.email,
|
||||
u.avatar,
|
||||
u.phonenumber,
|
||||
u.password,
|
||||
u.sex,
|
||||
u.status,
|
||||
u.del_flag,
|
||||
u.login_ip,
|
||||
u.login_date,
|
||||
u.create_by,
|
||||
u.create_time,
|
||||
u.remark,
|
||||
d.dept_id,
|
||||
d.parent_id,
|
||||
d.dept_name,
|
||||
d.order_num,
|
||||
d.leader,
|
||||
d.status as dept_status,
|
||||
u.data_power_type,
|
||||
r.role_id,
|
||||
r.role_name,
|
||||
r.role_key,
|
||||
r.role_sort,
|
||||
r.data_scope,
|
||||
r.status as role_status,
|
||||
u.user_type,
|
||||
u.operator_id
|
||||
from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
left join sys_user_role ur on u.user_id = ur.user_id
|
||||
left join sys_role r on r.role_id = ur.role_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
|
||||
<include refid="selectUserVo"/>
|
||||
where u.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -44,6 +44,86 @@
|
||||
from xhpc_invoice
|
||||
where invoice_id = #{invoiceId,jdbcType=BIGINT} and del_flag is null;
|
||||
</select>
|
||||
<select id="selectAllInvoiceOrdersByCondition" resultMap="BaseResultMap">
|
||||
SELECT
|
||||
invoice_id,
|
||||
creator,
|
||||
creator_type,
|
||||
invoice_money,
|
||||
status,
|
||||
create_time,
|
||||
invoicing_time,
|
||||
drawer
|
||||
FROM
|
||||
xhpc_invoice
|
||||
<where>
|
||||
del_flag IS NULL
|
||||
<if test="creator!=null">
|
||||
and creator = #{creator}
|
||||
</if>
|
||||
<if test="creatorType!=null">
|
||||
and creatorType = #{creatorType}
|
||||
</if>
|
||||
<if test="status!=null">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="startCreatorTime!=null">
|
||||
and create_time >= #{startCreatorTime}
|
||||
</if>
|
||||
<if test="endCreatorTime!=null">
|
||||
and create_time <= #{endCreatorTime}
|
||||
</if>
|
||||
<if test="startInvoicingTime!=null">
|
||||
and invoicing_time >= #{startInvoicingTime}
|
||||
</if>
|
||||
<if test="endInvoicingTime!=null">
|
||||
and invoicing_time <= #{endInvoicingTime}
|
||||
</if>
|
||||
</where>
|
||||
LIMIT #{currentPage},#{items}
|
||||
</select>
|
||||
<select id="sumItemsInvoice" resultType="java.lang.Long">
|
||||
SELECT
|
||||
count(invoice_id)
|
||||
FROM
|
||||
xhpc_invoice
|
||||
<where>
|
||||
del_flag IS NULL
|
||||
<if test="creator!=null">
|
||||
and creator = #{creator}
|
||||
</if>
|
||||
<if test="creatorType!=null">
|
||||
and creatorType = #{creatorType}
|
||||
</if>
|
||||
<if test="status!=null">
|
||||
and status = #{status}
|
||||
</if>
|
||||
<if test="startCreatorTime!=null">
|
||||
and create_time >= #{startCreatorTime}
|
||||
</if>
|
||||
<if test="endCreatorTime!=null">
|
||||
and create_time <= #{endCreatorTime}
|
||||
</if>
|
||||
<if test="startInvoicingTime!=null">
|
||||
and invoicing_time >= #{startInvoicingTime}
|
||||
</if>
|
||||
<if test="endInvoicingTime!=null">
|
||||
and invoicing_time <= #{endInvoicingTime}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<select id="allInvoicedMoney" resultType="java.math.BigDecimal">
|
||||
SELECT sum(invoice_money)
|
||||
FROM xhpc_invoice
|
||||
WHERE del_flag IS NULL
|
||||
AND `status` = 1
|
||||
</select>
|
||||
<select id="allNotInvoicedMoney" resultType="java.math.BigDecimal">
|
||||
SELECT sum(invoice_money)
|
||||
FROM xhpc_invoice
|
||||
WHERE del_flag IS NULL
|
||||
AND `status` = 0
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from xhpc_invoice
|
||||
@ -348,4 +428,15 @@
|
||||
del_flag = #{delFlag,jdbcType=INTEGER}
|
||||
where invoice_id = #{invoiceId,jdbcType=BIGINT}
|
||||
</update>
|
||||
|
||||
<update id="invoiceToUser">
|
||||
UPDATE xhpc_invoice
|
||||
SET finance_notes = #{financeNotes},
|
||||
invoicing_time = #{invoicingTime},
|
||||
electric_invoice_url = #{eletricInvoiceUrl},
|
||||
`status` = #{status},
|
||||
drawer = #{drawer}
|
||||
WHERE invoice_id = #{invoiceId};
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Loading…
x
Reference in New Issue
Block a user