Commit adbef38a by lihui.wang

添加PayPlatformAccount表

parent 8a8bb712
......@@ -14,6 +14,8 @@ public interface PayDMMapper extends IBaseDao<PayDM> {
PayDM selectByPrimaryKey(Long id);
PayDM selectByZhuiOrderId(String zhuihuorderid);
@Override
int updateByPrimaryKeySelective(PayDM record);
......
package com.freemud.pay.job.dao.repository;
import com.freemud.pay.job.dao.dbModel.PartnerDM;
import com.freemud.pay.job.dao.dbModel.PayDM;
/**
* Created by jacksu on 2017/3/16.
*/
public interface IPartnerRepository extends IBaseRepository{
PartnerDM selectByPrimaryKey(Integer id);
}
package com.freemud.pay.job.dao.repository;
import com.freemud.pay.job.dao.dbModel.PayDM;
import org.springframework.beans.factory.annotation.Autowired;
/**
* All rights Reserved, Designed By www.freemud.cn
*
......@@ -12,4 +15,5 @@ package com.freemud.pay.job.dao.repository;
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
public interface IPayRepository extends IBaseRepository {
PayDM selectByZhuiOrderId(String zhuihuorderid);
}
......@@ -2,6 +2,7 @@ package com.freemud.pay.job.dao.repository.Impl;
import com.freemud.pay.job.dao.IBaseDao;
import com.freemud.pay.job.dao.dbModel.PartnerDM;
import com.freemud.pay.job.dao.mapper.PartnerDMMapper;
import com.freemud.pay.job.dao.repository.IPartnerRepository;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -19,4 +20,9 @@ public class PartnerRepositoryImpl extends BaseRepositoryImpl implements IPartne
protected IBaseDao getDao() {
return partnerDMMapper;
}
@Override
public PartnerDM selectByPrimaryKey(Integer id) {
return partnerDMMapper.selectByPrimaryKey(id);
}
}
......@@ -2,6 +2,8 @@ package com.freemud.pay.job.dao.repository.Impl;
import com.freemud.pay.job.dao.IBaseDao;
import com.freemud.pay.job.dao.dbModel.PayDM;
import com.freemud.pay.job.dao.mapper.PayDMMapper;
import com.freemud.pay.job.dao.repository.IPayMessageRepository;
import com.freemud.pay.job.dao.repository.IPayRepository;
import com.freemud.pay.job.entity.BaseParam;
......@@ -25,18 +27,18 @@ import java.util.List;
@Primary
@Repository
public class PayRepositoryImpl extends BaseRepositoryImpl implements IPayRepository {
@Autowired
PayDMMapper payDMMapper;
@Override
protected IBaseDao getDao() {
return null;
return payDMMapper;
}
@Override
public PayDM selectByZhuiOrderId(String zhuihuorderid) {
return payDMMapper.selectByZhuiOrderId(zhuihuorderid);
}
// @Autowired
// PayDMMapper payDMMapper;
//
// @Override
// protected IBaseDao getDao() {
// return payDMMapper;
// }
}
\ No newline at end of file
......@@ -20,6 +20,24 @@ public class PayMessage {
private BaseParam baseParam;
private PayMessageDM payMessage;
private PayMessageActiveDM payMessageActive;
private boolean NoRetry;
private boolean isSuccess;
public boolean isNoRetry() {
return NoRetry;
}
public void setNoRetry(boolean noRetry) {
NoRetry = noRetry;
}
public boolean isSuccess() {
return isSuccess;
}
public void setSuccess(boolean success) {
isSuccess = success;
}
public BaseParam getBaseParam() {
return baseParam;
......
package com.freemud.pay.job.entity.dto;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title:
* @Package com.freemud.pay
* @Description:
* @author: lihui.wang
* @date:
* @Copyright: 2017 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
public class AliFuWuChuangSingleMessageRequest extends CommonRequest{
private String bizContent;
public String getBizContent() {
return bizContent;
}
public void setBizContent(String bizContent) {
this.bizContent = bizContent;
}
}
\ No newline at end of file
package com.freemud.pay.job.entity.dto;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title:
* @Package com.freemud.pay
* @Description:
* @author: lihui.wang
* @date:
* @Copyright: 2017 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
public class AliFuWuChuangSingleMessageResponse {
private String code;
private String msg;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}
\ No newline at end of file
package com.freemud.pay.job.entity.dto;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title:
* @Package com.freemud.pay
* @Description:
* @author: lihui.wang
* @date:
* @Copyright: 2017 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
public class CommonRequest {
private String appId;
private String method;
private String format;
private String charset;
private String signType;
private String sign;
private String timestamp;
/**
* 调用的接口版本,固定为1.0
*/
private String version;
private String appAuthToken;
public String getAppId() {
return appId;
}
public void setAppId(String appId) {
this.appId = appId;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getFormat() {
return format;
}
public void setFormat(String format) {
this.format = format;
}
public String getCharset() {
return charset;
}
public void setCharset(String charset) {
this.charset = charset;
}
public String getSignType() {
return signType;
}
public void setSignType(String signType) {
this.signType = signType;
}
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign;
}
public String getTimestamp() {
return timestamp;
}
public void setTimestamp(String timestamp) {
this.timestamp = timestamp;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public String getAppAuthToken() {
return appAuthToken;
}
public void setAppAuthToken(String appAuthToken) {
this.appAuthToken = appAuthToken;
}
}
\ No newline at end of file
package com.freemud.pay.job.entity.dto;
/**
* All rights Reserved, Designed By www.freemud.cn
*
* @Title:
* @Package com.freemud.pay
* @Description:
* @author: lihui.wang
* @date:
* @Copyright: 2017 www.freemud.cn Inc. All rights reserved.
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
public class CommonResponse {
private String code;
private String msg;
private String subCode;
private String subMsg;
private String sign;
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public String getSubCode() {
return subCode;
}
public void setSubCode(String subCode) {
this.subCode = subCode;
}
public String getSubMsg() {
return subMsg;
}
public void setSubMsg(String subMsg) {
this.subMsg = subMsg;
}
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign;
}
}
\ No newline at end of file
......@@ -17,4 +17,5 @@ import java.util.List;
*/
public interface IPartnerService {
public List<PartnerDM> selectAll();
PartnerDM selectByPrimaryKey(Integer id);
}
package com.freemud.pay.job.service;
import com.freemud.pay.job.dao.dbModel.PayMessageDM;
import com.freemud.pay.job.entity.BaseParam;
import org.springframework.stereotype.Service;
......@@ -19,4 +20,5 @@ import java.util.List;
public interface IPayMessageService {
void pushMessage(BaseParam baseRequest);
int updateMessageStatus(Integer status,Long id);
List<PayMessageDM> getPayMessages(BaseParam baseParam);
}
package com.freemud.pay.job.service;
import com.freemud.pay.job.dao.dbModel.PayDM;
import org.springframework.stereotype.Service;
/**
......@@ -14,4 +15,5 @@ import org.springframework.stereotype.Service;
* 注意:本内容仅限于上海非码科技内部传阅,禁止外泄以及用于其他的商业目
*/
public interface IPayService {
PayDM getPay(String zhuihuorderid);
}
package com.freemud.pay.job.service.impl;
import com.freemud.pay.job.dao.dbModel.PayPlatformAccountDM;
import com.freemud.pay.job.entity.PayMessage;
import com.freemud.pay.job.service.IMessageProcessor;
import com.freemud.pay.job.service.PayPlatformAccountService;
import org.springframework.beans.factory.annotation.Autowired;
/**
* All rights Reserved, Designed By www.freemud.cn
......@@ -16,17 +19,29 @@ import com.freemud.pay.job.service.IMessageProcessor;
*/
public class AliFuWuChuangSingleMessageSender implements IMessageProcessor {
@Autowired
PayPlatformAccountService payPlatformAccountService;
@Override
public Boolean Process(PayMessage payMessage) {
// var account = new PayPlatformAccountRepository().GetPayPlatformAccount(context.Message.PartnerId,
// PayPlatformAccountRepository.PLATFORM_ALI_FWC, context.BussinessType, context.DBPartition);
// if (account == null)
// {
// context.NoRetry = true;
// return false;
// }
PayPlatformAccountDM payPlatformAccountDM = payPlatformAccountService.getPayPlatformAccount(payMessage.getPayMessage().getPartnerid());
if (payPlatformAccountDM == null){
payMessage.setNoRetry(true);
return false;
}
try {
}catch (Exception e){
return false;
}
// try
// {
//
......@@ -68,4 +83,26 @@ public class AliFuWuChuangSingleMessageSender implements IMessageProcessor {
}
// public MeddyIdResponse getMeddyId(String json, String url){
// RestTemplate restTemplate = new RestTemplate();
// HttpHeaders headers = new HttpHeaders();
// //一定要设置好ContentType为utf8否则会乱码
// MediaType type = MediaType.parseMediaType("application/json; charset=UTF-8");
// headers.setContentType(type);
// headers.add("Accept", MediaType.APPLICATION_JSON.toString());
//
// HttpEntity<String> formEntity = new HttpEntity<String>(json, headers);
// String meddyIdResponseString = restTemplate.postForObject(url, formEntity, String.class);
// MeddyIdResponse meddyIdResponse = JSONObject.parseObject(meddyIdResponseString,MeddyIdResponse.class);
// return meddyIdResponse;
// }
}
\ No newline at end of file
......@@ -30,4 +30,9 @@ public class PartnerServiceImpl implements IPartnerService {
return iPartnerRepository.selectAll();
}
@Override
public PartnerDM selectByPrimaryKey(Integer id) {
return iPartnerRepository.selectByPrimaryKey(id);
}
}
\ No newline at end of file
......@@ -121,7 +121,8 @@ public class PayMessageServiceImpl implements IPayMessageService {
}
private List<PayMessageDM> getPayMessages(BaseParam baseParam){
@Override
public List<PayMessageDM> getPayMessages(BaseParam baseParam){
//db linkserver
Map<String, Object> paramsMap = new HashMap<String, Object>();
paramsMap.put("linkServer",baseParam.getLinkServer());
......
package com.freemud.pay.job.service.impl;
import com.freemud.pay.job.dao.dbModel.PayDM;
import com.freemud.pay.job.dao.repository.IPayRepository;
import com.freemud.pay.job.service.IPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
......@@ -17,4 +20,13 @@ import org.springframework.stereotype.Service;
*/
@Service("payService")
public class PayServiceImpl implements IPayService {
@Autowired
IPayRepository iPayRepository;
@Override
public PayDM getPay(String zhuihuorderid) {
return iPayRepository.selectByZhuiOrderId(zhuihuorderid);
}
}
\ No newline at end of file
......@@ -70,10 +70,11 @@
<property name="enableSubPackages" value="true"/>
</javaClientGenerator>
<table tableName="pay" domainObjectName="PayDM" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table>
<!--<table tableName="pay" domainObjectName="PayDM" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table>-->
<!--<table tableName="Pay_Message" domainObjectName="PayMessageDM" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table>-->
<!--<table tableName="Pay_Message_Active" domainObjectName="PayMessageActiveDM" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table>-->
<table tableName="Partner" domainObjectName="PartnerDM" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table>
<!--<table tableName="Partner" domainObjectName="PartnerDM" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table>-->
<table tableName="Pay_PlatformAccount" domainObjectName="PayPlatformAccountDM" enableCountByExample="false" enableUpdateByExample="false" enableDeleteByExample="false" enableSelectByExample="false" selectByExampleQueryId="false" ></table>
<!--<table tableName="partner" domainObjectName="Partner" ></table>
......
......@@ -24,6 +24,12 @@
from Partner
where ID = #{id,jdbcType=INTEGER}
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from Partner
where ID = #{id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
delete from Partner
where ID = #{id,jdbcType=INTEGER}
......
......@@ -53,6 +53,12 @@
from Pay
where ID = #{id,jdbcType=BIGINT}
</select>
<select id="selectByZhuiOrderId" parameterType="jdbcType=VARCHAR" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from Pay
where ZhuiOrderId = #{zhuiOrderId,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
delete from Pay
where ID = #{id,jdbcType=BIGINT}
......
......@@ -194,6 +194,6 @@
AND a.LastEditDate &lt; GETDATE()
</select>
<update id="updateMessageStatus">
update top(1) [Freemud_ThirdParty].[dbo].[Pay_Message] set status=-1 ,TryTimes=TryTimes+1 where id=#{id}
update top(1) [Freemud_ThirdParty].[dbo].[Pay_Message] set status=#{status} ,TryTimes=TryTimes+1 where id=#{id}
</update>
</mapper>
\ No newline at end of file
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