diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxAppinfo.java b/mallinkService/src/main/java/com/simple/domain/po/WxAppinfo.java index 6aadb354e..3133e2c47 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxAppinfo.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxAppinfo.java @@ -63,12 +63,6 @@ public class WxAppinfo implements Serializable { /*消息类型**/ @io.swagger.annotations.ApiModelProperty(value="消息类型",name="msgDataFormat") private String msgDataFormat; - /*微信商户ID**/ - @io.swagger.annotations.ApiModelProperty(value="微信商户ID",name="mchId") - private String mchId; - /*微信支付回调**/ - @io.swagger.annotations.ApiModelProperty(value="微信支付回调",name="notifyUrl") - private String notifyUrl; /*微信访问token**/ @io.swagger.annotations.ApiModelProperty(value="微信访问token",name="accessToken") private String accessToken; @@ -120,18 +114,6 @@ public class WxAppinfo implements Serializable { public void setMsgDataFormat(String _msgDataFormat) { msgDataFormat = _msgDataFormat; } - public String getMchId() { - return mchId; - } - public void setMchId(String _mchId) { - mchId = _mchId; - } - public String getNotifyUrl() { - return notifyUrl; - } - public void setNotifyUrl(String _notifyUrl) { - notifyUrl = _notifyUrl; - } public String getAccessToken() { return accessToken; } @@ -163,8 +145,6 @@ public class WxAppinfo implements Serializable { ,Token_ASC("`token` ASC"),Token_DESC("`token` DESC") ,AesKey_ASC("`aesKey` ASC"),AesKey_DESC("`aesKey` DESC") ,MsgDataFormat_ASC("`msgDataFormat` ASC"),MsgDataFormat_DESC("`msgDataFormat` DESC") - ,MchId_ASC("`mchId` ASC"),MchId_DESC("`mchId` DESC") - ,NotifyUrl_ASC("`notifyUrl` ASC"),NotifyUrl_DESC("`notifyUrl` DESC") ,AccessToken_ASC("`accessToken` ASC"),AccessToken_DESC("`accessToken` DESC") ,LastTokenTime_ASC("`lastTokenTime` ASC"),LastTokenTime_DESC("`lastTokenTime` DESC") ,ExpiresIn_ASC("`expiresIn` ASC"),ExpiresIn_DESC("`expiresIn` DESC") diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxMall.java b/mallinkService/src/main/java/com/simple/domain/po/WxMall.java index 7035068de..4d2a701b6 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxMall.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxMall.java @@ -1,40 +1,42 @@ package com.simple.domain.po; -import javax.persistence.Id; -import javax.persistence.Table; +import javax.persistence.*; +import java.util.*; +import java.math.*; import javax.persistence.Transient; -import java.io.Serializable; -import java.math.BigDecimal; import java.util.List; +import javax.persistence.Id; +import java.io.Serializable; @Table(name = "wx_mall") public class WxMall implements Serializable { private static final long serialVersionUID = 1L; @Id - protected Long mallId; + protected Long id; @Transient - protected List ids; + protected List ids; @Transient protected String sortColumns; - public Long getMallId() { - return mallId; + public Long getId() { + return id; } - public void setMallId(Long mallId) { - this.mallId = mallId; + public void setId(Long id) { + this.id = id; } public String getSortColumns() { return sortColumns; } - public List getIds() { + public List getIds() { return ids; } - public void setIds(List ids) { + + public void setIds(List ids) { this.ids = ids; } @@ -76,6 +78,9 @@ public class WxMall implements Serializable { /*车位数**/ @io.swagger.annotations.ApiModelProperty(value="车位数",name="parkPlaceNumber") private Integer parkPlaceNumber; + /*支付ID,参看wx_pay_account**/ + @io.swagger.annotations.ApiModelProperty(value="支付ID,参看wx_pay_account",name="payId") + private Long payId; public String getTenantId() { return tenantId; } @@ -148,12 +153,18 @@ public class WxMall implements Serializable { public void setParkPlaceNumber(Integer _parkPlaceNumber) { parkPlaceNumber = _parkPlaceNumber; } + public Long getPayId() { + return payId; + } + public void setPayId(Long _payId) { + payId = _payId; + } public static enum Field { - Id_ASC("`mallId` ASC"),Id_DESC("`mallId` DESC") + Id_ASC("`id` ASC"),Id_DESC("`id` DESC") ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") ,Name_ASC("`name` ASC"),Name_DESC("`name` DESC") ,Group_ASC("`group` ASC"),Group_DESC("`group` DESC") @@ -166,6 +177,7 @@ public class WxMall implements Serializable { ,OperatingArea_ASC("`operatingArea` ASC"),OperatingArea_DESC("`operatingArea` DESC") ,ParkArea_ASC("`parkArea` ASC"),ParkArea_DESC("`parkArea` DESC") ,ParkPlaceNumber_ASC("`parkPlaceNumber` ASC"),ParkPlaceNumber_DESC("`parkPlaceNumber` DESC") + ,PayId_ASC("`payId` ASC"),PayId_DESC("`payId` DESC") ; private String value; Field(String value){ diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxMerchant.java b/mallinkService/src/main/java/com/simple/domain/po/WxMerchant.java index 4fdec229c..bc01d2a9e 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxMerchant.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxMerchant.java @@ -16,7 +16,7 @@ public class WxMerchant implements Serializable { protected Long id; @Transient - protected List ids; + protected List ids; @Transient protected String sortColumns; @@ -32,10 +32,10 @@ public class WxMerchant implements Serializable { return sortColumns; } - public List getIds() { + public List getIds() { return ids; } - public void setIds(List ids) { + public void setIds(List ids) { this.ids = ids; } @@ -59,9 +59,9 @@ public class WxMerchant implements Serializable { /*银行开户行**/ @io.swagger.annotations.ApiModelProperty(value="银行开户行",name="bankName") private String bankName; - /*微信收款账号**/ - @io.swagger.annotations.ApiModelProperty(value="微信收款账号",name="wxchatAccount") - private String wxchatAccount; + /*支付ID,参看wx_pay_account**/ + @io.swagger.annotations.ApiModelProperty(value="支付ID,参看wx_pay_account",name="payId") + private Long payId; /*创建时间**/ @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") private Date createDate; @@ -110,11 +110,11 @@ public class WxMerchant implements Serializable { public void setBankName(String _bankName) { bankName = _bankName; } - public String getWxchatAccount() { - return wxchatAccount; + public Long getPayId() { + return payId; } - public void setWxchatAccount(String _wxchatAccount) { - wxchatAccount = _wxchatAccount; + public void setPayId(Long _payId) { + payId = _payId; } public Date getCreateDate() { return createDate; @@ -152,7 +152,7 @@ public class WxMerchant implements Serializable { ,LinkPhone_ASC("`linkPhone` ASC"),LinkPhone_DESC("`linkPhone` DESC") ,BankCard_ASC("`bankCard` ASC"),BankCard_DESC("`bankCard` DESC") ,BankName_ASC("`bankName` ASC"),BankName_DESC("`bankName` DESC") - ,WxchatAccount_ASC("`wxchatAccount` ASC"),WxchatAccount_DESC("`wxchatAccount` DESC") + ,PayId_ASC("`payId` ASC"),PayId_DESC("`payId` DESC") ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") ,CarVendorType_ASC("`carVendorType` ASC"),CarVendorType_DESC("`carVendorType` DESC") diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxPayAccount.java b/mallinkService/src/main/java/com/simple/domain/po/WxPayAccount.java new file mode 100644 index 000000000..6d71144cb --- /dev/null +++ b/mallinkService/src/main/java/com/simple/domain/po/WxPayAccount.java @@ -0,0 +1,132 @@ +package com.simple.domain.po; + +import javax.persistence.*; +import java.util.*; +import java.math.*; +import javax.persistence.Transient; +import java.util.List; +import javax.persistence.Id; +import java.io.Serializable; + +@Table(name = "wx_pay_account") +public class WxPayAccount implements Serializable { + private static final long serialVersionUID = 1L; + + @Id + protected Long id; + + @Transient + protected List ids; + @Transient + protected String sortColumns; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getSortColumns() { + return sortColumns; + } + + public List getIds() { + return ids; + } + + public void setIds(List ids) { + this.ids = ids; + } + + + + /***/ + @io.swagger.annotations.ApiModelProperty(value="",name="mchId") + private String mchId; + /***/ + @io.swagger.annotations.ApiModelProperty(value="",name="apiKey") + private String apiKey; + /*证书本地存放位置**/ + @io.swagger.annotations.ApiModelProperty(value="证书本地存放位置",name="certPath") + private String certPath; + public String getMchId() { + return mchId; + } + public void setMchId(String _mchId) { + mchId = _mchId; + } + public String getApiKey() { + return apiKey; + } + public void setApiKey(String _apiKey) { + apiKey = _apiKey; + } + public String getCertPath() { + return certPath; + } + public void setCertPath(String _certPath) { + certPath = _certPath; + } + + + + public static enum Field + { + Id_ASC("`id` ASC"),Id_DESC("`id` DESC") + ,MchId_ASC("`mchId` ASC"),MchId_DESC("`mchId` DESC") + ,ApiKey_ASC("`apiKey` ASC"),ApiKey_DESC("`apiKey` DESC") + ,CertPath_ASC("`certPath` ASC"),CertPath_DESC("`certPath` DESC") + ; + private String value; + Field(String value){ + this.value = value; + } + public String getValue() { + return value; + } + public void setCol(String value) { + this.value = value; + } + @Override + public String toString() { + return this.getValue(); + } + } + + public void setSortColumns(WxPayAccount.Field... fields) + { + if (fields == null || fields.length == 0) { + return; + } + for (int k = 0; k < fields.length; k++) { + if (fields[k] == null) { + return; + } + } + StringBuilder sb = new StringBuilder(fields[0].toString()); + for (int k = 1; k < fields.length; k++) { + sb.append(","); + sb.append(fields[k].toString()); + } + + } + + public void setSortColumns(String sortColumns) + { + if (sortColumns == null || "".equals(sortColumns.trim())) { + return; + } + if (sortColumns.contains(",")) { + String[] cols = sortColumns.split(","); + java.util.List fList = new java.util.ArrayList(); + for (int k = 0; k < cols.length; k++) { + fList.add(Field.valueOf(cols[k])); + } + this.setSortColumns(fList.toArray(new Field[fList.size()])); + } else { + this.setSortColumns(Field.valueOf(sortColumns)); + } + } +} diff --git a/mallinkService/src/main/java/com/simple/mapper/WxAppinfoMapper.java b/mallinkService/src/main/java/com/simple/mapper/WxAppinfoMapper.java index 23cca95e7..e3bbdb8c3 100644 --- a/mallinkService/src/main/java/com/simple/mapper/WxAppinfoMapper.java +++ b/mallinkService/src/main/java/com/simple/mapper/WxAppinfoMapper.java @@ -5,7 +5,7 @@ import com.simple.common.CommonMapper; import org.apache.ibatis.annotations.Param; import com.simple.domain.po.WxAppinfo; -public interface WxAppinfoMapper extends CommonMapper { +public interface WxAppinfoMapper extends CommonMapper { List findList(WxAppinfo wxAppinfo); diff --git a/mallinkService/src/main/java/com/simple/mapper/WxMallMapper.java b/mallinkService/src/main/java/com/simple/mapper/WxMallMapper.java index 75f0d214c..9fdc8cc82 100644 --- a/mallinkService/src/main/java/com/simple/mapper/WxMallMapper.java +++ b/mallinkService/src/main/java/com/simple/mapper/WxMallMapper.java @@ -5,7 +5,7 @@ import com.simple.common.CommonMapper; import org.apache.ibatis.annotations.Param; import com.simple.domain.po.WxMall; -public interface WxMallMapper extends CommonMapper { +public interface WxMallMapper extends CommonMapper { List findList(WxMall wxMall); diff --git a/mallinkService/src/main/java/com/simple/mapper/WxMerchantMapper.java b/mallinkService/src/main/java/com/simple/mapper/WxMerchantMapper.java index 9ba17d017..24f0d23ef 100644 --- a/mallinkService/src/main/java/com/simple/mapper/WxMerchantMapper.java +++ b/mallinkService/src/main/java/com/simple/mapper/WxMerchantMapper.java @@ -5,7 +5,7 @@ import com.simple.common.CommonMapper; import org.apache.ibatis.annotations.Param; import com.simple.domain.po.WxMerchant; -public interface WxMerchantMapper extends CommonMapper { +public interface WxMerchantMapper extends CommonMapper { List findList(WxMerchant wxMerchant); diff --git a/mallinkService/src/main/java/com/simple/mapper/WxOrderMapper.java b/mallinkService/src/main/java/com/simple/mapper/WxOrderMapper.java index 063ac1807..b6f7ed209 100644 --- a/mallinkService/src/main/java/com/simple/mapper/WxOrderMapper.java +++ b/mallinkService/src/main/java/com/simple/mapper/WxOrderMapper.java @@ -6,7 +6,7 @@ import com.simple.domain.vo.OrderVo; import org.apache.ibatis.annotations.Param; import com.simple.domain.po.WxOrder; -public interface WxOrderMapper extends CommonMapper { +public interface WxOrderMapper extends CommonMapper { List findList(WxOrder wxOrder); diff --git a/mallinkService/src/main/java/com/simple/mapper/WxPayAccountMapper.java b/mallinkService/src/main/java/com/simple/mapper/WxPayAccountMapper.java new file mode 100644 index 000000000..90cb060d5 --- /dev/null +++ b/mallinkService/src/main/java/com/simple/mapper/WxPayAccountMapper.java @@ -0,0 +1,17 @@ +package com.simple.mapper; + +import java.util.*; +import com.simple.common.CommonMapper; +import org.apache.ibatis.annotations.Param; +import com.simple.domain.po.WxPayAccount; + +public interface WxPayAccountMapper extends CommonMapper { + + List findList(WxPayAccount wxPayAccount); + + + + + + +} diff --git a/mallinkService/src/main/java/com/simple/service/WxPayAccountService.java b/mallinkService/src/main/java/com/simple/service/WxPayAccountService.java new file mode 100644 index 000000000..67eacb27f --- /dev/null +++ b/mallinkService/src/main/java/com/simple/service/WxPayAccountService.java @@ -0,0 +1,48 @@ +package com.simple.service; + +import java.util.*; +import com.github.pagehelper.PageInfo; +import com.simple.domain.po.WxPayAccount; + +public interface WxPayAccountService { + + /** + * 根据实体查询分页列表 + * + * @param record + * @param offset + * @param limit + * @return + */ + PageInfo listAsPage(WxPayAccount record, Integer pageIndex, Integer pageSize); + + /** + * 根据Id获得实体 + * + * @param id + * @return + */ + WxPayAccount getById(Long id); + + /** + * 保存或更新实体 + * + * @param record + */ + void saveOrUpdate(WxPayAccount record); + + /** + * 根据Id删除实体 + * + * @param id + */ + void deleteById(Long id); + + + + + + + + +} diff --git a/mallinkService/src/main/java/com/simple/service/impl/WxMallServiceImpl.java b/mallinkService/src/main/java/com/simple/service/impl/WxMallServiceImpl.java index 5047aa5ae..36dbf1f9d 100644 --- a/mallinkService/src/main/java/com/simple/service/impl/WxMallServiceImpl.java +++ b/mallinkService/src/main/java/com/simple/service/impl/WxMallServiceImpl.java @@ -29,10 +29,10 @@ public class WxMallServiceImpl implements WxMallService { @Override public void saveOrUpdate(WxMall record) { - if (record.getMallId() == null) { + if (record.getId() == null) { //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); final IdWorker idWorker = IdWorker.get(); - record.setMallId(idWorker.nextId()); + record.setId(idWorker.nextId()); record.setTenantId(String.valueOf(idWorker.nextId())); wxMallMapper.insertSelective(record); } else { diff --git a/mallinkService/src/main/java/com/simple/service/impl/WxPayAccountServiceImpl.java b/mallinkService/src/main/java/com/simple/service/impl/WxPayAccountServiceImpl.java new file mode 100644 index 000000000..d2db9536f --- /dev/null +++ b/mallinkService/src/main/java/com/simple/service/impl/WxPayAccountServiceImpl.java @@ -0,0 +1,54 @@ +package com.simple.service.impl; + +import java.util.*; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.simple.domain.po.WxPayAccount; +import com.simple.mapper.WxPayAccountMapper; +import com.simple.service.WxPayAccountService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.simple.common.IdWorker; + +@Service +public class WxPayAccountServiceImpl implements WxPayAccountService { + + @Autowired + WxPayAccountMapper wxPayAccountMapper; + + + @Override + public PageInfo listAsPage(WxPayAccount record, Integer pageIndex, Integer pageSize) { + return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxPayAccountMapper.findList(record)); + } + + @Override + public WxPayAccount getById(Long id) { + return wxPayAccountMapper.selectByPrimaryKey(id); + } + + @Override + public void saveOrUpdate(WxPayAccount record) { + if (record.getId() == null) { + //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); + final IdWorker idWorker = IdWorker.get(); + record.setId(idWorker.nextId()); + wxPayAccountMapper.insertSelective(record); + } else { + wxPayAccountMapper.updateByPrimaryKeySelective(record); + } + } + + @Override + public void deleteById(Long id) { + wxPayAccountMapper.deleteByPrimaryKey(id); + } + + + + + + + + +} diff --git a/mallinkService/src/main/java/com/simple/service/impl/WxPayOrderServiceImpl.java b/mallinkService/src/main/java/com/simple/service/impl/WxPayOrderServiceImpl.java index d7276364e..2f10f26c0 100644 --- a/mallinkService/src/main/java/com/simple/service/impl/WxPayOrderServiceImpl.java +++ b/mallinkService/src/main/java/com/simple/service/impl/WxPayOrderServiceImpl.java @@ -112,13 +112,13 @@ public class WxPayOrderServiceImpl implements WxPayOrderService { String noncestr = Utility.generate32UUID(); WxPayOrderP wxPayOrderP = new WxPayOrderP(); wxPayOrderP.setAppid(appInfo.getAppId()); - wxPayOrderP.setMch_id(appInfo.getMchId()); + //wxPayOrderP.setMch_id(appInfo.getMchId()); wxPayOrderP.setNonce_str(noncestr); wxPayOrderP.setBody(body); wxPayOrderP.setOut_trade_no(record.getPayOrderNo()); wxPayOrderP.setTotal_fee(order.getPayment()); wxPayOrderP.setSpbill_create_ip(record.getIp()); // 终端IP - wxPayOrderP.setNotify_url(appInfo.getNotifyUrl()); + //wxPayOrderP.setNotify_url(appInfo.getNotifyUrl()); wxPayOrderP.setTrade_type(WxPay.TradeType.APP.name()); // 终端类型 wxPayOrderP.setProduct_id(String.valueOf(order.getId())); // 订单ID wxPayOrderP.setTime_start(Utility.getDataFormatStringYYYYMMDDHHmmss(currentTime)); diff --git a/mallinkService/src/main/resources/mapper/WxAppinfoMapper.xml b/mallinkService/src/main/resources/mapper/WxAppinfoMapper.xml index b757b20ca..5f3170dcd 100644 --- a/mallinkService/src/main/resources/mapper/WxAppinfoMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxAppinfoMapper.xml @@ -10,15 +10,13 @@ - - - `id`,`tenant_id`,`app_id`,`name`,`secret`,`token`,`aes_key`,`msg_data_format`,`mch_id`,`notify_url`,`access_token`,`last_token_time`,`expires_in` + `id`,`tenant_id`,`app_id`,`name`,`secret`,`token`,`aes_key`,`msg_data_format`,`access_token`,`last_token_time`,`expires_in` @@ -61,15 +59,6 @@ and `msg_data_format` like concat('%', #{msgDataFormat},'%') - - - - and `mch_id` like concat('%', #{mchId},'%') - - - - - and `notify_url` like concat('%', #{notifyUrl},'%') diff --git a/mallinkService/src/main/resources/mapper/WxMallMapper.xml b/mallinkService/src/main/resources/mapper/WxMallMapper.xml index 277b92e7d..4e0c99e43 100644 --- a/mallinkService/src/main/resources/mapper/WxMallMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMallMapper.xml @@ -2,7 +2,7 @@ - + @@ -15,17 +15,18 @@ + - `mall_id`,`tenant_id`,`name`,`group`,`country`,`province`,`city`,`addr`,`wiwide_id`,`total_area`,`operating_area`,`park_area`,`park_place_number` + `id`,`tenant_id`,`name`,`group`,`country`,`province`,`city`,`addr`,`wiwide_id`,`total_area`,`operating_area`,`park_area`,`park_place_number`,`pay_id` where 1 = 1 - - and `mall_id` = #{mallId} + + and `id` = #{id} @@ -87,9 +88,14 @@ and `park_place_number` = #{parkPlaceNumber} + + + + and `pay_id` = #{payId} + - and mall_id in + and id in #{idItem} diff --git a/mallinkService/src/main/resources/mapper/WxMerchantMapper.xml b/mallinkService/src/main/resources/mapper/WxMerchantMapper.xml index 5b0e30a3e..4a75e1787 100644 --- a/mallinkService/src/main/resources/mapper/WxMerchantMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxMerchantMapper.xml @@ -9,7 +9,7 @@ - + @@ -17,7 +17,7 @@ - `id`,`tenant_id`,`img_url`,`name`,`link_phone`,`bank_card`,`bank_name`,`wxchat_account`,`create_date`,`update_date`,`car_vendor_type`,`car_params` + `id`,`tenant_id`,`img_url`,`name`,`link_phone`,`bank_card`,`bank_name`,`pay_id`,`create_date`,`update_date`,`car_vendor_type`,`car_params` @@ -58,8 +58,8 @@ - - and `wxchat_account` like concat('%', #{wxchatAccount},'%') + + and `pay_id` = #{payId} diff --git a/mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml b/mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml new file mode 100644 index 000000000..d7d2ec2b8 --- /dev/null +++ b/mallinkService/src/main/resources/mapper/WxPayAccountMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + `id`,`mch_id`,`api_key`,`cert_path` + + + + where 1 = 1 + + + and `id` = #{id} + + + + + and `mch_id` like concat('%', #{mchId},'%') + + + + + and `api_key` like concat('%', #{apiKey},'%') + + + + + and `cert_path` like concat('%', #{certPath},'%') + + + + and id in + + #{idItem} + + + order by ${sortColumns} + + + + + + + + + +