parent
1dd21a1d9a
commit
70f1c1307b
@ -0,0 +1,102 @@ |
|||||||
|
package com.cweb.controller; |
||||||
|
|
||||||
|
import com.github.pagehelper.PageHelper; |
||||||
|
import com.github.pagehelper.PageInfo; |
||||||
|
import com.hai.common.exception.ErrorCode; |
||||||
|
import com.hai.common.exception.ErrorHelp; |
||||||
|
import com.hai.common.exception.SysCode; |
||||||
|
import com.hai.common.security.UserCenter; |
||||||
|
import com.hai.common.utils.ResponseMsgUtil; |
||||||
|
import com.hai.entity.HighOilCard; |
||||||
|
import com.hai.enum_type.OilCardStatusEnum; |
||||||
|
import com.hai.model.ResponseData; |
||||||
|
import com.hai.model.UserInfoModel; |
||||||
|
import com.hai.service.HighCompanyTwoPwdService; |
||||||
|
import com.hai.service.HighOilCardRecordService; |
||||||
|
import com.hai.service.HighOilCardService; |
||||||
|
import io.swagger.annotations.Api; |
||||||
|
import io.swagger.annotations.ApiOperation; |
||||||
|
import org.apache.commons.lang3.StringUtils; |
||||||
|
import org.slf4j.Logger; |
||||||
|
import org.slf4j.LoggerFactory; |
||||||
|
import org.springframework.stereotype.Controller; |
||||||
|
import org.springframework.web.bind.annotation.*; |
||||||
|
|
||||||
|
import javax.annotation.Resource; |
||||||
|
import java.util.HashMap; |
||||||
|
import java.util.Map; |
||||||
|
|
||||||
|
@Controller |
||||||
|
@RequestMapping(value = "/oilCard") |
||||||
|
@Api(value = "油卡") |
||||||
|
public class HighOilCardController { |
||||||
|
|
||||||
|
private static Logger log = LoggerFactory.getLogger(HighOilCardController.class); |
||||||
|
|
||||||
|
@Resource |
||||||
|
private UserCenter userCenter; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private HighOilCardService oilCardService; |
||||||
|
|
||||||
|
@Resource |
||||||
|
private HighOilCardRecordService oilCardRecordService; |
||||||
|
|
||||||
|
@RequestMapping(value = "/getDetailByCardNo", method = RequestMethod.GET) |
||||||
|
@ResponseBody |
||||||
|
@ApiOperation(value = "根据卡号查询详情") |
||||||
|
public ResponseData getDetailByCardNo(@RequestParam(name = "cardNo", required = true) String cardNo) { |
||||||
|
try { |
||||||
|
// 查询油卡
|
||||||
|
HighOilCard card = oilCardService.getOilCardByCardNo(cardNo); |
||||||
|
if (card == null) { |
||||||
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "卡号不正确"); |
||||||
|
} |
||||||
|
if (StringUtils.isBlank(card.getContactPhone())) { |
||||||
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "油卡未配置完成"); |
||||||
|
} |
||||||
|
|
||||||
|
Map<String, Object> map = new HashMap<>(); |
||||||
|
map.put("cardNo", card.getCardNo()); |
||||||
|
map.put("amount", card.getAmount()); |
||||||
|
map.put("status", card.getStatus()); |
||||||
|
map.put("contactName", card.getContactName()); |
||||||
|
map.put("contactPhone", card.getContactPhone()); |
||||||
|
return ResponseMsgUtil.success(map); |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.error("HighOilCardController --> getDetailByCardNo() error!", e); |
||||||
|
return ResponseMsgUtil.exception(e); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
@RequestMapping(value = "/getOilCardRecordList", method = RequestMethod.GET) |
||||||
|
@ResponseBody |
||||||
|
@ApiOperation(value = "查询油卡记录列表") |
||||||
|
public ResponseData getOilCardRecordList(@RequestParam(name = "cardNo", required = true) String cardNo, |
||||||
|
@RequestParam(name = "sourceOrderNo", required = false) String sourceOrderNo, |
||||||
|
@RequestParam(name = "type", required = false) Integer type, |
||||||
|
@RequestParam(name = "sourceType", required = false) String sourceType, |
||||||
|
@RequestParam(name = "createTimeS", required = false) Long createTimeS, |
||||||
|
@RequestParam(name = "createTimeE", required = false) Long createTimeE, |
||||||
|
@RequestParam(name = "pageNum", required = true) Integer pageNum, |
||||||
|
@RequestParam(name = "pageSize", required = true) Integer pageSize) { |
||||||
|
try { |
||||||
|
|
||||||
|
Map<String, Object> param = new HashMap<>(); |
||||||
|
param.put("cardNo", cardNo); |
||||||
|
param.put("sourceOrderNo", sourceOrderNo); |
||||||
|
param.put("type", type); |
||||||
|
param.put("sourceType", sourceType); |
||||||
|
param.put("createTimeS", createTimeS); |
||||||
|
param.put("createTimeE", createTimeE); |
||||||
|
|
||||||
|
PageHelper.startPage(pageNum, pageSize); |
||||||
|
return ResponseMsgUtil.success(new PageInfo<>(oilCardRecordService.getRecordList(param))); |
||||||
|
|
||||||
|
} catch (Exception e) { |
||||||
|
log.error("HighOilCardRecordController --> getOilCardRecordList() error!", e); |
||||||
|
return ResponseMsgUtil.exception(e); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
package com.hai.enum_type; |
||||||
|
|
||||||
|
/** |
||||||
|
* 支付模式 |
||||||
|
* @author hurui |
||||||
|
*/ |
||||||
|
public enum OrderPayModelEnum { |
||||||
|
type1(1 , "金币"), |
||||||
|
type2(2 , "第三方平台"), |
||||||
|
type3(3 , "混合"), |
||||||
|
type4(4 , "油卡"), |
||||||
|
; |
||||||
|
|
||||||
|
private Integer type; |
||||||
|
private String name; |
||||||
|
|
||||||
|
OrderPayModelEnum(int type , String name) { |
||||||
|
this.type = type; |
||||||
|
this.name = name; |
||||||
|
} |
||||||
|
|
||||||
|
public Integer getType() { |
||||||
|
return type; |
||||||
|
} |
||||||
|
|
||||||
|
public void setType(Integer type) { |
||||||
|
this.type = type; |
||||||
|
} |
||||||
|
|
||||||
|
public String getName() { |
||||||
|
return name; |
||||||
|
} |
||||||
|
|
||||||
|
public void setName(String name) { |
||||||
|
this.name = name; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,40 @@ |
|||||||
|
package com.hai.enum_type; |
||||||
|
|
||||||
|
/** |
||||||
|
* 支付方式 |
||||||
|
* @author hurui |
||||||
|
*/ |
||||||
|
public enum OrderPayTypeEnum { |
||||||
|
type1(1 , "支付宝"), |
||||||
|
type2(2 , "微信"), |
||||||
|
type3(3 , "金币"), |
||||||
|
type4(4 , "汇联通工会卡"), |
||||||
|
type5(5 , "银联"), |
||||||
|
type6(6 , "银联分期"), |
||||||
|
type7(7 , "嗨森逛油卡"), |
||||||
|
; |
||||||
|
|
||||||
|
private Integer type; |
||||||
|
private String name; |
||||||
|
|
||||||
|
OrderPayTypeEnum(int type , String name) { |
||||||
|
this.type = type; |
||||||
|
this.name = name; |
||||||
|
} |
||||||
|
|
||||||
|
public Integer getType() { |
||||||
|
return type; |
||||||
|
} |
||||||
|
|
||||||
|
public void setType(Integer type) { |
||||||
|
this.type = type; |
||||||
|
} |
||||||
|
|
||||||
|
public String getName() { |
||||||
|
return name; |
||||||
|
} |
||||||
|
|
||||||
|
public void setName(String name) { |
||||||
|
this.name = name; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,192 @@ |
|||||||
|
package com.hai.model; |
||||||
|
|
||||||
|
import java.math.BigDecimal; |
||||||
|
import java.util.Date; |
||||||
|
|
||||||
|
/** |
||||||
|
* 油卡订单 |
||||||
|
* @author hurui |
||||||
|
*/ |
||||||
|
public class OilCardOrderModel { |
||||||
|
|
||||||
|
private String orgName; |
||||||
|
private String merPhone; |
||||||
|
private String orderNo; |
||||||
|
private String gasOrderNo; |
||||||
|
private Integer payType; |
||||||
|
private String payTypeName; |
||||||
|
private String memCardNo; |
||||||
|
private BigDecimal totalPrice; |
||||||
|
private BigDecimal deductionPrice; |
||||||
|
private BigDecimal payRealPrice; |
||||||
|
private Integer status; |
||||||
|
private String statusName; |
||||||
|
private String goodsName; |
||||||
|
private String gasOilNo; |
||||||
|
private String gasGunNo; |
||||||
|
private String gasPriceGun; |
||||||
|
private String platformPriceGun; |
||||||
|
private Date createTime; |
||||||
|
private Date payTime; |
||||||
|
private Date refundTime; |
||||||
|
|
||||||
|
public String getOrgName() { |
||||||
|
return orgName; |
||||||
|
} |
||||||
|
|
||||||
|
public void setOrgName(String orgName) { |
||||||
|
this.orgName = orgName; |
||||||
|
} |
||||||
|
|
||||||
|
public String getMerPhone() { |
||||||
|
return merPhone; |
||||||
|
} |
||||||
|
|
||||||
|
public void setMerPhone(String merPhone) { |
||||||
|
this.merPhone = merPhone; |
||||||
|
} |
||||||
|
|
||||||
|
public String getOrderNo() { |
||||||
|
return orderNo; |
||||||
|
} |
||||||
|
|
||||||
|
public void setOrderNo(String orderNo) { |
||||||
|
this.orderNo = orderNo; |
||||||
|
} |
||||||
|
|
||||||
|
public String getGasOrderNo() { |
||||||
|
return gasOrderNo; |
||||||
|
} |
||||||
|
|
||||||
|
public void setGasOrderNo(String gasOrderNo) { |
||||||
|
this.gasOrderNo = gasOrderNo; |
||||||
|
} |
||||||
|
|
||||||
|
public Integer getPayType() { |
||||||
|
return payType; |
||||||
|
} |
||||||
|
|
||||||
|
public void setPayType(Integer payType) { |
||||||
|
this.payType = payType; |
||||||
|
} |
||||||
|
|
||||||
|
public String getPayTypeName() { |
||||||
|
return payTypeName; |
||||||
|
} |
||||||
|
|
||||||
|
public void setPayTypeName(String payTypeName) { |
||||||
|
this.payTypeName = payTypeName; |
||||||
|
} |
||||||
|
|
||||||
|
public String getMemCardNo() { |
||||||
|
return memCardNo; |
||||||
|
} |
||||||
|
|
||||||
|
public void setMemCardNo(String memCardNo) { |
||||||
|
this.memCardNo = memCardNo; |
||||||
|
} |
||||||
|
|
||||||
|
public BigDecimal getTotalPrice() { |
||||||
|
return totalPrice; |
||||||
|
} |
||||||
|
|
||||||
|
public void setTotalPrice(BigDecimal totalPrice) { |
||||||
|
this.totalPrice = totalPrice; |
||||||
|
} |
||||||
|
|
||||||
|
public BigDecimal getDeductionPrice() { |
||||||
|
return deductionPrice; |
||||||
|
} |
||||||
|
|
||||||
|
public void setDeductionPrice(BigDecimal deductionPrice) { |
||||||
|
this.deductionPrice = deductionPrice; |
||||||
|
} |
||||||
|
|
||||||
|
public BigDecimal getPayRealPrice() { |
||||||
|
return payRealPrice; |
||||||
|
} |
||||||
|
|
||||||
|
public void setPayRealPrice(BigDecimal payRealPrice) { |
||||||
|
this.payRealPrice = payRealPrice; |
||||||
|
} |
||||||
|
|
||||||
|
public Integer getStatus() { |
||||||
|
return status; |
||||||
|
} |
||||||
|
|
||||||
|
public void setStatus(Integer status) { |
||||||
|
this.status = status; |
||||||
|
} |
||||||
|
|
||||||
|
public String getStatusName() { |
||||||
|
return statusName; |
||||||
|
} |
||||||
|
|
||||||
|
public void setStatusName(String statusName) { |
||||||
|
this.statusName = statusName; |
||||||
|
} |
||||||
|
|
||||||
|
public String getGoodsName() { |
||||||
|
return goodsName; |
||||||
|
} |
||||||
|
|
||||||
|
public void setGoodsName(String goodsName) { |
||||||
|
this.goodsName = goodsName; |
||||||
|
} |
||||||
|
|
||||||
|
public String getGasOilNo() { |
||||||
|
return gasOilNo; |
||||||
|
} |
||||||
|
|
||||||
|
public void setGasOilNo(String gasOilNo) { |
||||||
|
this.gasOilNo = gasOilNo; |
||||||
|
} |
||||||
|
|
||||||
|
public String getGasGunNo() { |
||||||
|
return gasGunNo; |
||||||
|
} |
||||||
|
|
||||||
|
public void setGasGunNo(String gasGunNo) { |
||||||
|
this.gasGunNo = gasGunNo; |
||||||
|
} |
||||||
|
|
||||||
|
public String getGasPriceGun() { |
||||||
|
return gasPriceGun; |
||||||
|
} |
||||||
|
|
||||||
|
public void setGasPriceGun(String gasPriceGun) { |
||||||
|
this.gasPriceGun = gasPriceGun; |
||||||
|
} |
||||||
|
|
||||||
|
public String getPlatformPriceGun() { |
||||||
|
return platformPriceGun; |
||||||
|
} |
||||||
|
|
||||||
|
public void setPlatformPriceGun(String platformPriceGun) { |
||||||
|
this.platformPriceGun = platformPriceGun; |
||||||
|
} |
||||||
|
|
||||||
|
public Date getCreateTime() { |
||||||
|
return createTime; |
||||||
|
} |
||||||
|
|
||||||
|
public void setCreateTime(Date createTime) { |
||||||
|
this.createTime = createTime; |
||||||
|
} |
||||||
|
|
||||||
|
public Date getPayTime() { |
||||||
|
return payTime; |
||||||
|
} |
||||||
|
|
||||||
|
public void setPayTime(Date payTime) { |
||||||
|
this.payTime = payTime; |
||||||
|
} |
||||||
|
|
||||||
|
public Date getRefundTime() { |
||||||
|
return refundTime; |
||||||
|
} |
||||||
|
|
||||||
|
public void setRefundTime(Date refundTime) { |
||||||
|
this.refundTime = refundTime; |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue