作者 shenhailong

钉钉小程序逻辑修改 单独抽出小程序接口 添加 小程序用户姓名 电话

... ... @@ -51,7 +51,16 @@ public class UserPayController {
return waterMeterService.payWater(payFees, wmId);
}
/**
* 水电系统发起
* @param payFees
* @param wmId
* @param userId
* @param realName
* @param eeId
* @return
* @throws UnsupportedEncodingException
*/
@ApiOperation(value = "请求返回二维码")
@PostMapping("/qrCode")
public ResultJson qrCode(@RequestParam(value = "payFees", required = false) String payFees,
... ... @@ -60,7 +69,29 @@ public class UserPayController {
@RequestParam(value = "realName", required = false) String realName,
@RequestParam(value = "deviceId", required = false) String eeId) throws UnsupportedEncodingException {
ResultJson resultJson = waterMeterService.qrCode(payFees, wmId, userId, realName, eeId);
ResultJson resultJson = waterMeterService.qrCode(payFees, wmId, userId, realName, eeId, "0");
return resultJson;
}
/**
* 钉钉小程序发起
* @param payFees
* @param wmId
* @param userId
* @param realName
* @param eeId
* @return
* @throws UnsupportedEncodingException
*/
@ApiOperation(value = "请求返回二维码")
@PostMapping("/ddQrCode")
public ResultJson ddQrCode(@RequestParam(value = "payFees", required = false) String payFees,
@RequestParam(value = "wmId", required = false) String wmId,
@RequestParam(value = "userId", required = false) String userId,
@RequestParam(value = "realName", required = false) String realName,
@RequestParam(value = "deviceId", required = false) String eeId) throws UnsupportedEncodingException {
ResultJson resultJson = waterMeterService.qrCode(payFees, wmId, userId, realName, eeId, "1");
return resultJson;
}
... ...
... ... @@ -17,7 +17,7 @@ public class PayRecords {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date paytime;
private Integer paylocationid;
private String paylocationid;
private Boolean paystatus;
... ... @@ -82,11 +82,11 @@ public class PayRecords {
this.paytime = paytime;
}
public Integer getPaylocationid() {
public String getPaylocationid() {
return paylocationid;
}
public void setPaylocationid(Integer paylocationid) {
public void setPaylocationid(String paylocationid) {
this.paylocationid = paylocationid;
}
... ...
... ... @@ -19,7 +19,7 @@ public interface WaterMeterService {
/**
* 请求返回二维码
*/
ResultJson qrCode(String payFees, String wmId, String userId, String realName, String eeId) throws UnsupportedEncodingException;
ResultJson qrCode(String payFees, String wmId, String userId, String realName, String eeId, String payType) throws UnsupportedEncodingException;
}
... ...
... ... @@ -200,12 +200,13 @@ public class WaterMeterServiceImp implements WaterMeterService {
// 请求返回二维码
@Override
public ResultJson qrCode(String payFees, String wmId, String userId, String realName, String eeId) throws UnsupportedEncodingException {
public ResultJson qrCode(String payFees, String wmId, String userId,
String realName, String eeId, String payType) throws UnsupportedEncodingException {
ResultJson<Object> resultJson = new ResultJson<>();
QrDemo qrDemo = new QrDemo(MERCHANTIDS,POSIDS,BRANCHIDS,TXCODES,PUB32TR2S);
// 成功生成水费订单
if (!"".equals(wmId)) {
PayRecords payRecords = payRecords(payFees, wmId, userId, realName, "");
PayRecords payRecords = payRecords(payFees, wmId, userId, realName, "", payType);
// 请求返回二维码lujing
String url = qrDemo.orUrl(payRecords.getOrdernumber(), payFees);
... ... @@ -222,8 +223,7 @@ public class WaterMeterServiceImp implements WaterMeterService {
resultJson.setCode("200");
}
} else {
PayRecords payRecords = payRecords(payFees, "", userId, realName, eeId);
PayRecords payRecords = payRecords(payFees, "", userId, realName, eeId, payType);
// 请求返回二维码lujing
String url = qrDemo.orUrl(payRecords.getOrdernumber(), payFees);
... ... @@ -280,7 +280,7 @@ public class WaterMeterServiceImp implements WaterMeterService {
* @param realName
* @return
*/
public PayRecords payRecords(String payFees, String wmId, String userId, String realName, String eeId) {
public PayRecords payRecords(String payFees, String wmId, String userId, String realName, String eeId, String payType) {
PayRecords payRecords = new PayRecords();
payRecords.setOrdernumber(AllUtils.getOrderIdByUUId());
... ... @@ -298,9 +298,17 @@ public class WaterMeterServiceImp implements WaterMeterService {
payRecords.setPaylocationname(roomNumber);
}
payRecords.setReamke1("0");
payRecords.setPayuserid(Integer.valueOf(userId));
if (userId.contains(",")){
String[] split = userId.split(",");
payRecords.setPayusername(split[0]);
payRecords.setPayuserid(0);
payRecords.setPaylocationid(split[2]);
}else {
payRecords.setPayuserid(Integer.valueOf(userId));
payRecords.setPayusername(realName);
}
payRecords.setPaytime(new Date());
payRecords.setPayusername(realName);
payRecords.setReamke4(payType);
return payRecords;
... ...
... ... @@ -22,4 +22,4 @@ ${AnsiColor.YELLOW}
==================================================
Application Info:${application.title}
ver:${application.version}
Powered by:Spring Boot ${spring-boot.version}
\ No newline at end of file
Powered by:Spring Boot ${spring-boot.version}
... ...
... ... @@ -6,7 +6,7 @@
<result column="payFees" property="payfees" jdbcType="DECIMAL"/>
<result column="payUserId" property="payuserid" jdbcType="INTEGER"/>
<result column="payTime" property="paytime" jdbcType="TIMESTAMP"/>
<result column="payLocationId" property="paylocationid" jdbcType="INTEGER"/>
<result column="payLocationId" property="paylocationid" jdbcType="VARCHAR"/>
<result column="payStatus" property="paystatus" jdbcType="BIT"/>
<result column="payType" property="paytype" jdbcType="BIT"/>
<result column="payFessType" property="payfesstype" jdbcType="BIT"/>
... ... @@ -84,7 +84,7 @@
reamke4, payUserName, payLocationName,
payTypeAddress)
values (#{id,jdbcType=INTEGER}, #{payfees,jdbcType=DECIMAL}, #{payuserid,jdbcType=INTEGER},
#{paytime,jdbcType=TIMESTAMP}, #{paylocationid,jdbcType=INTEGER}, #{paystatus,jdbcType=BIT},
#{paytime,jdbcType=TIMESTAMP}, #{paylocationid,jdbcType=VARCHAR}, #{paystatus,jdbcType=BIT},
#{paytype,jdbcType=BIT}, #{payfesstype,jdbcType=BIT}, #{ordernumber,jdbcType=VARCHAR},
#{reamke1,jdbcType=VARCHAR}, #{reamke2,jdbcType=VARCHAR}, #{reamke3,jdbcType=VARCHAR},
#{reamke4,jdbcType=VARCHAR}, #{payusername,jdbcType=VARCHAR}, #{paylocationname,jdbcType=VARCHAR},
... ... @@ -156,7 +156,7 @@
#{paytime,jdbcType=TIMESTAMP},
</if>
<if test="paylocationid != null">
#{paylocationid,jdbcType=INTEGER},
#{paylocationid,jdbcType=VARCHAR},
</if>
<if test="paystatus != null">
#{paystatus,jdbcType=BIT},
... ... @@ -206,7 +206,7 @@
payTime = #{paytime,jdbcType=TIMESTAMP},
</if>
<if test="paylocationid != null">
payLocationId = #{paylocationid,jdbcType=INTEGER},
payLocationId = #{paylocationid,jdbcType=VARCHAR},
</if>
<if test="paystatus != null">
payStatus = #{paystatus,jdbcType=BIT},
... ...