Commit a878f9cb by guojuxing

查询为开票单据列表

parent 277b8385
package com.gic.enterprise.dao.mapper;
import com.gic.enterprise.entity.TabBillingPayInfo;
import com.gic.enterprise.qo.BillListQueryQO;
import java.util.List;
public interface TabBillingPayInfoMapper {
/**
......@@ -50,4 +53,14 @@ public interface TabBillingPayInfoMapper {
* @return 更新条目数
*/
int updateByPrimaryKey(TabBillingPayInfo record);
/**
* 查询为开票单据列表数据
* @Title: listBill

* @Description:

 * @author guojuxing
* @param params

* @return java.util.List<com.gic.enterprise.entity.TabBillingPayInfo>


 */
List<TabBillingPayInfo> listBill(BillListQueryQO params);
}
\ No newline at end of file
......@@ -85,6 +85,10 @@ public class TabBillingPayInfo {
*
*/
private Date updateTime;
/**
* 购买类型 1:商户余额充值 2:短信套餐包购买
*/
private Integer buyType;
public Integer getPayInfoId() {
return payInfoId;
......@@ -213,4 +217,12 @@ public class TabBillingPayInfo {
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getBuyType() {
return buyType;
}
public void setBuyType(Integer buyType) {
this.buyType = buyType;
}
}
\ No newline at end of file
package com.gic.enterprise.service;
import com.gic.enterprise.entity.TabBillingPayInfo;
import com.gic.enterprise.qo.BillListQueryQO;
import com.github.pagehelper.Page;
/**
* 支付信息
* @ClassName: BillingPayInfoService

* @Description: 

* @author guojuxing

* @date 2019/8/15 1:59 PM

*/
public interface BillingPayInfoService {
/**
* 根据主键查询单条
* @Title: getById

* @Description:

 * @author guojuxing
* @param billingPayInfoId

* @return com.gic.enterprise.entity.TabBillingPayInfo


 */
TabBillingPayInfo getById(Integer billingPayInfoId);
/**
* 分页查询为开票单据列表数据
* @Title: listBilling

* @Description:

 * @author guojuxing
* @param params

* @return com.github.pagehelper.Page<com.gic.enterprise.entity.TabBillingPayInfo>


 */
Page<TabBillingPayInfo> listBilling(BillListQueryQO params);
}
package com.gic.enterprise.service.impl;
import com.gic.enterprise.dao.mapper.TabBillingPayInfoMapper;
import com.gic.enterprise.entity.TabBillingPayInfo;
import com.gic.enterprise.qo.BillListQueryQO;
import com.gic.enterprise.service.BillingPayInfoService;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
@Service("billingPayInfoService")
public class BillingPayInfoServiceImpl implements BillingPayInfoService{
@Autowired
private TabBillingPayInfoMapper tabBillingPayInfoMapper;
@Override
public TabBillingPayInfo getById(Integer billingPayInfoId) {
return tabBillingPayInfoMapper.selectByPrimaryKey(billingPayInfoId);
}
@Override
public Page<TabBillingPayInfo> listBilling(BillListQueryQO params) {
PageHelper.startPage(params.getCurrentPage(), params.getPageSize());
List<TabBillingPayInfo> list = tabBillingPayInfoMapper.listBill(params);
return (Page<TabBillingPayInfo>) list;
}
}
package com.gic.enterprise.service.outer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.commons.util.PageHelperUtils;
import com.gic.enterprise.dto.BillingPayInfoDTO;
import com.gic.enterprise.qo.BillListQueryQO;
import com.gic.enterprise.service.BillingPayInfoApiService;
import com.gic.enterprise.service.BillingPayInfoService;
@Service("billingPayInfoApiService")
public class BillingPayInfoApiServiceImpl implements BillingPayInfoApiService{
@Autowired
private BillingPayInfoService billingPayInfoService;
@Override
public ServiceResponse<Page<BillingPayInfoDTO>> listBill(BillListQueryQO params) {
com.github.pagehelper.Page page = billingPayInfoService.listBilling(params);
Page<BillingPayInfoDTO> resultPage = PageHelperUtils.changePageHelperToCurrentPage(page, BillingPayInfoDTO.class);
return ServiceResponse.success(resultPage);
}
}
......@@ -17,7 +17,7 @@ import com.gic.enterprise.dto.EnterpriseDTO;
import com.gic.enterprise.dto.EnterpriseListDTO;
import com.gic.enterprise.entity.TabEnterprise;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.EnterpriseException;
import com.gic.enterprise.exception.CommonException;
import com.gic.enterprise.service.EnterpriseApiService;
import com.gic.enterprise.service.EnterpriseInitService;
import com.gic.enterprise.service.EnterpriseService;
......@@ -67,7 +67,7 @@ public class EnterpriseApiServiceImpl implements EnterpriseApiService {
if (userResult.isSuccess()) {
return ServiceResponse.success(enterpriseId);
} else {
throw new EnterpriseException(userResult.getCode(), userResult.getMessage());
throw new CommonException(userResult.getCode(), userResult.getMessage());
}
}
......
......@@ -27,4 +27,7 @@
<!-- 字典 -->
<dubbo:reference interface="com.gic.bizdict.api.service.BizdictService" id="bizdictService" timeout="60000" />
<dubbo:service interface="com.gic.enterprise.service.DictApiService" ref="dictApiService" timeout="60000" />
<!--支付信息-->
<dubbo:service interface="com.gic.enterprise.service.BillingPayInfoApiService" ref="billingPayInfoApiService" timeout="60000" />
</beans>
......@@ -18,11 +18,12 @@
<result column="status" jdbcType="INTEGER" property="status" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="buy_type" jdbcType="INTEGER" property="buyType" />
</resultMap>
<sql id="Base_Column_List">
pay_info_id, enterprise_id, serial_number, pay_type, total_fee_paid, time_start,
time_end, result_code, err_code, err_code_des, code_url, prepay_id, invoice_status,
status, create_time, update_time
status, create_time, update_time, buy_type
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
......@@ -40,13 +41,13 @@
time_end, result_code, err_code,
err_code_des, code_url, prepay_id,
invoice_status, status, create_time,
update_time)
update_time, buy_type)
values (#{payInfoId,jdbcType=INTEGER}, #{enterpriseId,jdbcType=INTEGER}, #{serialNumber,jdbcType=VARCHAR},
#{payType,jdbcType=INTEGER}, #{totalFeePaid,jdbcType=DOUBLE}, #{timeStart,jdbcType=VARCHAR},
#{timeEnd,jdbcType=VARCHAR}, #{resultCode,jdbcType=INTEGER}, #{errCode,jdbcType=VARCHAR},
#{errCodeDes,jdbcType=VARCHAR}, #{codeUrl,jdbcType=VARCHAR}, #{prepayId,jdbcType=VARCHAR},
#{invoiceStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
#{updateTime,jdbcType=TIMESTAMP}, #{buyType,jdbcType=INTEGER})
</insert>
<insert id="insertSelective" parameterType="com.gic.enterprise.entity.TabBillingPayInfo">
insert into tab_billing_pay_info
......@@ -99,6 +100,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="buyType != null">
buy_type,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="payInfoId != null">
......@@ -149,6 +153,9 @@
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="buyType != null">
#{buyType,jdbcType=INTEGER},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.gic.enterprise.entity.TabBillingPayInfo">
......@@ -199,6 +206,9 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="buyType != null">
buy_type = #{buyType,jdbcType=INTEGER},
</if>
</set>
where pay_info_id = #{payInfoId,jdbcType=INTEGER}
</update>
......@@ -218,7 +228,28 @@
invoice_status = #{invoiceStatus,jdbcType=INTEGER},
status = #{status,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
update_time = #{updateTime,jdbcType=TIMESTAMP},
buy_type = #{buyType,jdbcType=INTEGER}
where pay_info_id = #{payInfoId,jdbcType=INTEGER}
</update>
<select id="listBill" parameterType="com.gic.enterprise.qo.BillListQueryQO" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from tab_billing_pay_info
where enterprise_id = #{enterpriseId}
<if test="buyType != null">
buy_type = #{buyType}
</if>
<if test="payType != null">
pay_type = #{payType}
</if>
<if test="startTime != null">
DATE_FORMAT(create_time,'%Y-%m-%d') >= #{startTime}
</if>
<if test="endTime != null">
DATE_FORMAT(create_time,'%Y-%m-%d') &lt;= #{endTime}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -80,6 +80,11 @@
<version>${gic-enterprise-base-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>gic-platform-enterprise-api</artifactId>
<version>${gic-platform-enterprise-api}</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<version>2.1.5.RELEASE</version>
......
package com.gic.enterprise.web.exception;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.store.constant.StoreGroupErrorEnum;
import com.gic.store.exception.StoreException;
import com.gic.store.exception.StoreGroupException;
import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Set;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.BindException;
......@@ -13,13 +17,10 @@ import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletResponse;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import java.io.ByteArrayOutputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.Set;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.CommonException;
import com.gic.store.constant.StoreGroupErrorEnum;
/**
* 全局异常处理类
......@@ -79,19 +80,9 @@ public class GlobalExceptionHandler {
return getRestResponse(ErrorCode.PARAMETER_ERROR.getCode(), getFailFastMsg(paramName, paramError));
}
/**
* 自定义异常统一处理
* @param e
* @return
*/
@ResponseBody
@ExceptionHandler(StoreGroupException.class)
public RestResponse customException(StoreGroupException e) {
return getRestResponse(e.getErrorCode(), e.getMessage());
}
@ResponseBody
@ExceptionHandler(StoreException.class)
public RestResponse customException(StoreException e) {
@ExceptionHandler(CommonException.class)
public RestResponse customException(CommonException e) {
return getRestResponse(e.getErrorCode(), e.getMessage());
}
......
......@@ -36,5 +36,6 @@
<dubbo:reference interface="com.gic.store.service.StoreStatusSettingApiService" id="storeStatusSettingApiService" timeout="60000" />
<dubbo:reference interface="com.gic.log.api.service.LogApiService" id="logApiService" timeout="60000" />
<dubbo:reference interface="com.gic.enterprise.service.BillingPayInfoApiService" id="billingPayInfoApiService" timeout="60000" />
</beans>
\ No newline at end of file
......@@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.EnterpriseException;
import com.gic.enterprise.exception.CommonException;
import com.gic.store.exception.StoreException;
/**
......@@ -91,8 +91,8 @@ public class GlobalExceptionHandler {
return getRestResponse(e.getErrorCode(), e.getMessage());
}
@ResponseBody
@ExceptionHandler(EnterpriseException.class)
public RestResponse customException(EnterpriseException e) {
@ExceptionHandler(CommonException.class)
public RestResponse customException(CommonException e) {
return getRestResponse(e.getErrorCode(), e.getMessage());
}
......
package com.gic.operation.web.utils;
import com.gic.enterprise.utils.CreateRandomUtils;
import org.apache.commons.lang3.StringUtils;
import com.gic.auth.constant.UserConstants;
import com.gic.commons.util.Md5Util;
import com.gic.enterprise.error.ErrorCode;
import com.gic.enterprise.exception.EnterpriseException;
import com.gic.enterprise.exception.CommonException;
import com.gic.enterprise.utils.CreateRandomUtils;
/**
* @author guojx
......@@ -45,7 +45,7 @@ public class UserPasswordUtil {
//如果一致
return password;
} else {
throw new EnterpriseException(ErrorCode.PARAMETER_ERROR.getCode(), "密码不一致");
throw new CommonException(ErrorCode.PARAMETER_ERROR.getCode(), "密码不一致");
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment