Commit a91ad091 by 陶光胜

Merge branch 'developer' of…

Merge branch 'developer' of http://115.159.76.241/base_platform_enterprise/gic-platform-enterprise into developer
parents acd70c5d 871c5105
package com.gic.enterprise.constant;
/**
* 未开票收据生成类型
* @ClassName: BuyTypeEnum

* @Description: 

* @author guojuxing

* @date 2019/8/15 3:28 PM

*/
public enum BuyTypeEnum {
BUY_SHORT_MESSAGE_PACKAGE(2, "短信套餐包购买"),
BALANCE_RECHARGE(1, "商户余额充值");
private int code;
private String message;
private BuyTypeEnum(int code, String message) {
this.code = code;
this.message = message;
}
public static String getMessageByCode(Integer code) {
if (code == null) {
return "未知";
}
for (BuyTypeEnum typeEnum : values()) {
if (code.intValue() == typeEnum.getCode()) {
return typeEnum.getMessage();
}
}
return "未知";
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.gic.enterprise.constant;
/**
* 支付方式类型
* @ClassName: PayTypeEnum

* @Description: 

* @author guojuxing

* @date 2019/8/15 3:24 PM

*/
public enum PayTypeEnum {
WE_CHAT_PAY(1, "微信支付"),
ALI_PAY(2, "支付宝支付"),
OFFLINE_PAY(3, "银行对公转账"),
BALANCE_PAY(4, "余额支付");
private int code;
private String message;
private PayTypeEnum(int code, String message) {
this.code = code;
this.message = message;
}
public static String getMessageByCode(Integer code) {
if (code == null) {
return "未知";
}
for (PayTypeEnum typeEnum : values()) {
if (code.intValue() == typeEnum.getCode()) {
return typeEnum.getMessage();
}
}
return "未知";
}
public int getCode() {
return code;
}
public void setCode(int code) {
this.code = code;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
}
package com.gic.enterprise.dto;
import java.io.Serializable;
import java.util.Date;
/**
* 支付信息
* @ClassName: BillingPayInfoDTO

* @Description: 

* @author guojuxing

* @date 2019/8/15 11:37 AM

*/
public class BillingPayInfoDTO implements Serializable{
private static final long serialVersionUID = -6345149211985605905L;
/**
*
*/
private Integer payInfoId;
/**
*
*/
private Integer enterpriseId;
/**
* 支付流水号
*/
private String serialNumber;
/**
* 支付方式 1微信 2支付宝 3.线下支付 4余额支付
*/
private Integer payType;
/**
* 实付金额
*/
private Double totalFeePaid;
/**
* 支付创建时间
*/
private String timeStart;
/**
* 支付完成时间 (到账时间)
*/
private String timeEnd;
/**
* 业务结果 1成功 2失败
*/
private Integer resultCode;
/**
* 交易返回错误编码
*/
private String errCode;
/**
* 交易返回错误信息
*/
private String errCodeDes;
/**
* 二维码链接
*/
private String codeUrl;
/**
* 预支付交易会话标识
*/
private String prepayId;
/**
* 发票状态 1:已开具 0:未开具
*/
private Integer invoiceStatus;
/**
*
*/
private Integer status;
/**
*
*/
private Date createTime;
/**
*
*/
private Date updateTime;
/**
* 购买类型 1:商户余额充值 2:短信套餐包购买
*/
private Integer buyType;
public Integer getPayInfoId() {
return payInfoId;
}
public void setPayInfoId(Integer payInfoId) {
this.payInfoId = payInfoId;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
}
public String getSerialNumber() {
return serialNumber;
}
public void setSerialNumber(String serialNumber) {
this.serialNumber = serialNumber;
}
public Integer getPayType() {
return payType;
}
public void setPayType(Integer payType) {
this.payType = payType;
}
public Double getTotalFeePaid() {
return totalFeePaid;
}
public void setTotalFeePaid(Double totalFeePaid) {
this.totalFeePaid = totalFeePaid;
}
public String getTimeStart() {
return timeStart;
}
public void setTimeStart(String timeStart) {
this.timeStart = timeStart;
}
public String getTimeEnd() {
return timeEnd;
}
public void setTimeEnd(String timeEnd) {
this.timeEnd = timeEnd;
}
public Integer getResultCode() {
return resultCode;
}
public void setResultCode(Integer resultCode) {
this.resultCode = resultCode;
}
public String getErrCode() {
return errCode;
}
public void setErrCode(String errCode) {
this.errCode = errCode;
}
public String getErrCodeDes() {
return errCodeDes;
}
public void setErrCodeDes(String errCodeDes) {
this.errCodeDes = errCodeDes;
}
public String getCodeUrl() {
return codeUrl;
}
public void setCodeUrl(String codeUrl) {
this.codeUrl = codeUrl;
}
public String getPrepayId() {
return prepayId;
}
public void setPrepayId(String prepayId) {
this.prepayId = prepayId;
}
public Integer getInvoiceStatus() {
return invoiceStatus;
}
public void setInvoiceStatus(Integer invoiceStatus) {
this.invoiceStatus = invoiceStatus;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public Integer getBuyType() {
return buyType;
}
public void setBuyType(Integer buyType) {
this.buyType = buyType;
}
}
package com.gic.enterprise.exception;
/**
* @author guojx
* @date 2019/6/26 2:03 PM
*/
public class EnterpriseException extends RuntimeException{
private String errorCode;
public EnterpriseException(String errorCode, String message) {
super(message);
this.errorCode = errorCode;
}
public String getErrorCode() {
return errorCode;
}
}
package com.gic.enterprise.qo;
/**
* 为开票单据查询参数
* @ClassName: BillListQueryQO

* @Description: 

* @author guojuxing

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

*/
public class BillListQueryQO extends PageQO{
private static final long serialVersionUID = 916995795168464728L;
private String startTime;
private String endTime;
/**
* 支付方式
*/
private Integer payType;
/**
* 单据生成类型
*/
private Integer buyType;
private Integer enterpriseId;
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public Integer getPayType() {
return payType;
}
public void setPayType(Integer payType) {
this.payType = payType;
}
public Integer getBuyType() {
return buyType;
}
public void setBuyType(Integer buyType) {
this.buyType = buyType;
}
public Integer getEnterpriseId() {
return enterpriseId;
}
public void setEnterpriseId(Integer enterpriseId) {
this.enterpriseId = enterpriseId;
}
}
package com.gic.enterprise.service;
import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse;
import com.gic.enterprise.dto.BillingPayInfoDTO;
import com.gic.enterprise.qo.BillListQueryQO;
/**
* 支付信息
* @ClassName: BillingPayInfoApiService

* @Description: 

* @author guojuxing

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

*/
public interface BillingPayInfoApiService {
/**
* 分页查询为开票单据列表数据
* @Title: listBill

* @Description:

 * @author guojuxing
* @param params

* @return com.gic.api.base.commons.ServiceResponse<com.gic.api.base.commons.Page<com.gic.enterprise.dto.BillingPayInfoDTO>>


 */
ServiceResponse<Page<BillingPayInfoDTO>> listBill(BillListQueryQO params);
}
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,29 @@
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}
and time_end is not null
<if test="buyType != null">
and buy_type = #{buyType}
</if>
<if test="payType != null">
and pay_type = #{payType}
</if>
<if test="startTime != null">
and DATE_FORMAT(time_end,'%Y-%m-%d') >= #{startTime}
</if>
<if test="endTime != null">
and DATE_FORMAT(time_end,'%Y-%m-%d') &lt;= #{endTime}
</if>
</select>
</mapper>
\ No newline at end of file
......@@ -28,7 +28,7 @@ public class EnterpriseApiServiceImplTest extends AbstractJUnit4SpringContextTes
// if (!response.isSuccess()) {
// System.out.println(response.getMessage());
// }
enterpriseInitService.initEnterpriseConfigInfo(25);
enterpriseApiService.listEnterprise(null, null, null, " order by a.create_time ", 1, 20);
System.out.println("success");
}
......
......@@ -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.controller;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.qo.BillListQueryQO;
import com.gic.enterprise.service.BillingPayInfoApiService;
import com.gic.enterprise.utils.ResultControllerUtils;
import com.gic.enterprise.web.vo.BillListVO;
@RestController
@RequestMapping("/billing-pay-info")
public class BillingPayInfoController {
private static final Logger LOGGER = LoggerFactory.getLogger(BillingPayInfoController.class);
@Autowired
private BillingPayInfoApiService billingPayInfoApiService;
@RequestMapping("/list-bill")
public RestResponse listBill(BillListQueryQO params) {
return ResultControllerUtils.commonPageResult(billingPayInfoApiService.listBill(params), BillListVO.class);
}
}
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());
}
......
package com.gic.enterprise.web.qo;
import java.io.Serializable;
/**
* 分页查询
*
* @author zhurz
*/
public class PageQO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 页码
*/
private Integer currentPage=1;
/**
* 分页大小
*/
private Integer pageSize=20;
public Integer getCurrentPage() {
return currentPage;
}
public void setCurrentPage(Integer currentPage) {
this.currentPage = currentPage;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
}
package com.gic.enterprise.web.vo;
import com.gic.enterprise.constant.BuyTypeEnum;
import com.gic.enterprise.constant.PayTypeEnum;
import java.io.Serializable;
/**
* 未开票列表
* @ClassName: BillListVO

* @Description: 

* @author guojuxing

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

*/
public class BillListVO implements Serializable{
private static final long serialVersionUID = -3737832047382825129L;
/**
* 支付流水号
*/
private String serialNumber;
/**
* 支付方式 1微信 2支付宝 3.线下支付 4余额支付
*/
private Integer payType;
/**
* 支付方式名称
*/
private String payTypeStr;
/**
* 支付完成时间 (到账时间)
*/
private String timeEnd;
/**
* 实付金额
*/
private Double totalFeePaid;
/**
* 购买类型 1:商户余额充值 2:短信套餐包购买
*/
private Integer buyType;
/**
* 为开票单据生成方式名称
*/
private String buyTypeStr;
public String getSerialNumber() {
return serialNumber;
}
public void setSerialNumber(String serialNumber) {
this.serialNumber = serialNumber;
}
public void setPayType(Integer payType) {
this.payType = payType;
}
public String getPayTypeStr() {
return PayTypeEnum.getMessageByCode(payType);
}
public String getTimeEnd() {
return timeEnd;
}
public void setTimeEnd(String timeEnd) {
this.timeEnd = timeEnd;
}
public Double getTotalFeePaid() {
return totalFeePaid;
}
public void setTotalFeePaid(Double totalFeePaid) {
this.totalFeePaid = totalFeePaid;
}
public void setBuyType(Integer buyType) {
this.buyType = buyType;
}
public String getBuyTypeStr() {
return BuyTypeEnum.getMessageByCode(buyType);
}
}
......@@ -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