提交 e0f7d792 编写于 作者: ibizdev's avatar ibizdev

zhouweidong@lab.ibiz5.com 发布系统代码

上级 2e64595e
...@@ -41,29 +41,97 @@ public class PayTrade extends EntityMP implements Serializable { ...@@ -41,29 +41,97 @@ public class PayTrade extends EntityMP implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 属性 * 交易标识
*/ */
@DEField(isKeyField=true) @DEField(isKeyField=true)
@TableId(value= "tradeid",type=IdType.ASSIGN_UUID) @TableId(value= "tradeid",type=IdType.ASSIGN_UUID)
@JSONField(name = "tradeid") @JSONField(name = "trade_id")
@JsonProperty("tradeid") @JsonProperty("trade_id")
private String tradeid; private String tradeId;
/** /**
* 属性2 * 交易名称
*/ */
@TableField(value = "tradename") @TableField(value = "tradename")
@JSONField(name = "tradename") @JSONField(name = "trade_name")
@JsonProperty("tradename") @JsonProperty("trade_name")
private String tradename; private String tradeName;
/**
* 订单标题
*/
@TableField(value = "subject")
@JSONField(name = "subject")
@JsonProperty("subject")
private String subject;
/**
* 订单号
*/
@TableField(value = "outtradeno")
@JSONField(name = "out_trade_no")
@JsonProperty("out_trade_no")
private String outTradeNo;
/**
* 订单金额
*/
@TableField(value = "totalamount")
@JSONField(name = "total_amount")
@JsonProperty("total_amount")
private String totalAmount;
/**
* 支付平台接入标识
*/
@TableField(value = "accessid")
@JSONField(name = "access_id")
@JsonProperty("access_id")
private String accessId;
/**
* 接入平台
*/
@JsonIgnore
@JSONField(serialize = false)
@TableField(exist = false)
private cn.ibizlab.core.pay.domain.PayOpenAccess openaccess;
/** /**
* 设置 [属性2] * 设置 [交易名称]
*/
public void setTradeName(String tradeName){
this.tradeName = tradeName ;
this.modify("tradename",tradeName);
}
/**
* 设置 [订单标题]
*/
public void setSubject(String subject){
this.subject = subject ;
this.modify("subject",subject);
}
/**
* 设置 [订单号]
*/
public void setOutTradeNo(String outTradeNo){
this.outTradeNo = outTradeNo ;
this.modify("outtradeno",outTradeNo);
}
/**
* 设置 [订单金额]
*/
public void setTotalAmount(String totalAmount){
this.totalAmount = totalAmount ;
this.modify("totalamount",totalAmount);
}
/**
* 设置 [支付平台接入标识]
*/ */
public void setTradename(String tradename){ public void setAccessId(String accessId){
this.tradename = tradename ; this.accessId = accessId ;
this.modify("tradename",tradename); this.modify("accessid",accessId);
} }
......
...@@ -27,13 +27,20 @@ import cn.ibizlab.core.pay.domain.PayTrade; ...@@ -27,13 +27,20 @@ import cn.ibizlab.core.pay.domain.PayTrade;
@Data @Data
public class PayTradeSearchContext extends QueryWrapperContext<PayTrade> { public class PayTradeSearchContext extends QueryWrapperContext<PayTrade> {
private String n_tradename_like;//[属性2] private String n_tradename_like;//[交易名称]
public void setN_tradename_like(String n_tradename_like) { public void setN_tradename_like(String n_tradename_like) {
this.n_tradename_like = n_tradename_like; this.n_tradename_like = n_tradename_like;
if(!ObjectUtils.isEmpty(this.n_tradename_like)){ if(!ObjectUtils.isEmpty(this.n_tradename_like)){
this.getSearchCond().like("tradename", n_tradename_like); this.getSearchCond().like("tradename", n_tradename_like);
} }
} }
private String n_accessid_eq;//[支付平台接入标识]
public void setN_accessid_eq(String n_accessid_eq) {
this.n_accessid_eq = n_accessid_eq;
if(!ObjectUtils.isEmpty(this.n_accessid_eq)){
this.getSearchCond().eq("accessid", n_accessid_eq);
}
}
/** /**
* 启用快速搜索 * 启用快速搜索
......
...@@ -62,4 +62,6 @@ public interface PayTradeMapper extends BaseMapper<PayTrade>{ ...@@ -62,4 +62,6 @@ public interface PayTradeMapper extends BaseMapper<PayTrade>{
@Delete("${sql}") @Delete("${sql}")
boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param); boolean deleteBySQL(@Param("sql") String sql, @Param("et")Map param);
List<PayTrade> selectByAccessId(@Param("id") Serializable id) ;
} }
...@@ -37,6 +37,8 @@ public interface IPayTradeService extends IService<PayTrade>{ ...@@ -37,6 +37,8 @@ public interface IPayTradeService extends IService<PayTrade>{
boolean save(PayTrade et) ; boolean save(PayTrade et) ;
void saveBatch(List<PayTrade> list) ; void saveBatch(List<PayTrade> list) ;
Page<PayTrade> searchDefault(PayTradeSearchContext context) ; Page<PayTrade> searchDefault(PayTradeSearchContext context) ;
List<PayTrade> selectByAccessId(String id) ;
void removeByAccessId(String id) ;
/** /**
*自定义查询SQL *自定义查询SQL
* @param sql select * from table where id =#{et.param} * @param sql select * from table where id =#{et.param}
......
...@@ -45,6 +45,9 @@ import org.springframework.util.StringUtils; ...@@ -45,6 +45,9 @@ import org.springframework.util.StringUtils;
@Service("PayOpenAccessServiceImpl") @Service("PayOpenAccessServiceImpl")
public class PayOpenAccessServiceImpl extends ServiceImpl<PayOpenAccessMapper, PayOpenAccess> implements IPayOpenAccessService { public class PayOpenAccessServiceImpl extends ServiceImpl<PayOpenAccessMapper, PayOpenAccess> implements IPayOpenAccessService {
@Autowired
@Lazy
protected cn.ibizlab.core.pay.service.IPayTradeService paytradeService;
protected int batchSize = 500; protected int batchSize = 500;
......
...@@ -45,6 +45,9 @@ import org.springframework.util.StringUtils; ...@@ -45,6 +45,9 @@ import org.springframework.util.StringUtils;
@Service("PayTradeServiceImpl") @Service("PayTradeServiceImpl")
public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> implements IPayTradeService { public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> implements IPayTradeService {
@Autowired
@Lazy
protected cn.ibizlab.core.pay.service.IPayOpenAccessService payopenaccessService;
protected int batchSize = 500; protected int batchSize = 500;
...@@ -53,7 +56,7 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i ...@@ -53,7 +56,7 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i
public boolean create(PayTrade et) { public boolean create(PayTrade et) {
if(!this.retBool(this.baseMapper.insert(et))) if(!this.retBool(this.baseMapper.insert(et)))
return false; return false;
CachedBeanCopier.copy(get(et.getTradeid()),et); CachedBeanCopier.copy(get(et.getTradeId()),et);
return true; return true;
} }
...@@ -65,9 +68,9 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i ...@@ -65,9 +68,9 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i
@Override @Override
@Transactional @Transactional
public boolean update(PayTrade et) { public boolean update(PayTrade et) {
if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("tradeid",et.getTradeid()))) if(!update(et,(Wrapper) et.getUpdateWrapper(true).eq("tradeid",et.getTradeId())))
return false; return false;
CachedBeanCopier.copy(get(et.getTradeid()),et); CachedBeanCopier.copy(get(et.getTradeId()),et);
return true; return true;
} }
...@@ -94,7 +97,7 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i ...@@ -94,7 +97,7 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i
PayTrade et = getById(key); PayTrade et = getById(key);
if(et==null){ if(et==null){
et=new PayTrade(); et=new PayTrade();
et.setTradeid(key); et.setTradeId(key);
} }
else{ else{
} }
...@@ -108,7 +111,7 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i ...@@ -108,7 +111,7 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i
@Override @Override
public boolean checkKey(PayTrade et) { public boolean checkKey(PayTrade et) {
return (!ObjectUtils.isEmpty(et.getTradeid()))&&(!Objects.isNull(this.getById(et.getTradeid()))); return (!ObjectUtils.isEmpty(et.getTradeId()))&&(!Objects.isNull(this.getById(et.getTradeId())));
} }
@Override @Override
@Transactional @Transactional
...@@ -140,6 +143,16 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i ...@@ -140,6 +143,16 @@ public class PayTradeServiceImpl extends ServiceImpl<PayTradeMapper, PayTrade> i
} }
@Override
public List<PayTrade> selectByAccessId(String id) {
return baseMapper.selectByAccessId(id);
}
@Override
public void removeByAccessId(String id) {
this.remove(new QueryWrapper<PayTrade>().eq("accessid",id));
}
/** /**
* 查询集合 数据集 * 查询集合 数据集
......
<?xml version="1.1" encoding="UTF-8" standalone="no"?> !!!!模版产生代码错误:----
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd"> Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
<!--输出实体[PAY_OPEN_ACCESS]数据结构 --> FTL stack trace ("~" means nesting-related):
<changeSet author="a_A_5d9d78509" id="tab-pay_open_access-15-1"> - Failed at: ${dbinst.getUserName()} [in template "CODETEMPL_zh_CN" at line 28, column 24]
<createTable tableName="IBZOPENACCESS"> ----
<column name="ACCESSID" remarks="" type="VARCHAR(100)"> \ No newline at end of file
<constraints primaryKey="true" primaryKeyName="PK_PAY_OPEN_ACCESS_ACCESSID"/>
</column>
<column name="ACCESSNAME" remarks="" type="VARCHAR(100)">
</column>
<column name="OPEN_TYPE" remarks="" type="VARCHAR(100)">
</column>
<column name="ACCESS_KEY" remarks="" type="VARCHAR(100)">
</column>
<column name="SECRET_KEY" remarks="" type="VARCHAR(100)">
</column>
<column name="REGION_ID" remarks="" type="VARCHAR(100)">
</column>
<column name="ACCESS_TOKEN" remarks="" type="VARCHAR(1000)">
</column>
<column name="EXPIRES_TIME" remarks="" type="DATETIME">
</column>
<column name="DISABLED" remarks="" type="INT">
</column>
<column name="REDIRECT_URI" remarks="" type="VARCHAR(500)">
</column>
</createTable>
</changeSet>
<!--输出实体[PAY_TRADE]数据结构 -->
<changeSet author="a_A_5d9d78509" id="tab-pay_trade-8-2">
<createTable tableName="IBZPAYTRADE">
<column name="TRADEID" remarks="" type="VARCHAR(100)">
<constraints primaryKey="true" primaryKeyName="PK_PAY_TRADE_TRADEID"/>
</column>
<column name="TRADENAME" remarks="" type="VARCHAR(100)">
</column>
</createTable>
</changeSet>
<!--输出实体[PAY_OPEN_ACCESS]外键关系 -->
<!--输出实体[PAY_TRADE]外键关系 -->
</databaseChangeLog>
...@@ -8,16 +8,26 @@ ...@@ -8,16 +8,26 @@
<![CDATA[select t1.* from (SELECT t1.`TRADEID`, t1.`TRADENAME` FROM `IBZPAYTRADE` t1 ) t1 where tradeid=#{id}]]> <![CDATA[select t1.* from (SELECT t1.`TRADEID`, t1.`TRADENAME` FROM `IBZPAYTRADE` t1 ) t1 where tradeid=#{id}]]>
</select> </select>
<select id="selectById" resultMap="PayTradeResultMap" databaseId="oracle"> <select id="selectById" resultMap="PayTradeResultMap" databaseId="oracle">
<![CDATA[select t1.* from (SELECT t1.TRADEID, t1.TRADENAME FROM IBZPAYTRADE t1 ) t1 where tradeid=#{id}]]> <![CDATA[select t1.* from (SELECT t1.ACCESSID, t1.OUTTRADENO, t1.SUBJECT, t1.TOTALAMOUNT, t1.TRADEID, t1.TRADENAME FROM IBZPAYTRADE t1 ) t1 where tradeid=#{id}]]>
</select> </select>
<!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 --> <!--通过mybatis将查询结果注入到entity中,通过配置autoMapping="true"由mybatis自动处理映射关系 -->
<resultMap id="PayTradeResultMap" type="cn.ibizlab.core.pay.domain.PayTrade" autoMapping="true"> <resultMap id="PayTradeResultMap" type="cn.ibizlab.core.pay.domain.PayTrade" autoMapping="true">
<id property="tradeid" column="tradeid" /><!--主键字段映射--> <id property="tradeId" column="tradeid" /><!--主键字段映射-->
<result property="accessId" column="accessid" />
<!--通过mybatis自动注入关系属性[主实体],fetchType="lazy"为懒加载配置 -->
<association property="openaccess" javaType="cn.ibizlab.core.pay.domain.PayOpenAccess" column="accessid" select="cn.ibizlab.core.pay.mapper.PayOpenAccessMapper.selectById" fetchType="lazy"></association>
</resultMap> </resultMap>
<!--关系实体暴露select方法供主实体通过外键查询关系实体数据[实体关系名称:DER1N_PAY_TRADE_PAY_OPEN_ACCESS_ACCESSID] -->
<select id="selectByAccessId" resultMap="PayTradeResultMap">
select t1.* from (
<include refid="Default" />
) t1
where accessid=#{id}
</select>
<!--数据集合[Default]--> <!--数据集合[Default]-->
<select id="searchDefault" parameterType="cn.ibizlab.core.pay.filter.PayTradeSearchContext" resultMap="PayTradeResultMap"> <select id="searchDefault" parameterType="cn.ibizlab.core.pay.filter.PayTradeSearchContext" resultMap="PayTradeResultMap">
...@@ -35,7 +45,7 @@ ...@@ -35,7 +45,7 @@
</sql> </sql>
<!--数据查询[Default]--> <!--数据查询[Default]-->
<sql id="Default" databaseId="oracle"> <sql id="Default" databaseId="oracle">
<![CDATA[ SELECT t1.TRADEID, t1.TRADENAME FROM IBZPAYTRADE t1 <![CDATA[ SELECT t1.ACCESSID, t1.OUTTRADENO, t1.SUBJECT, t1.TOTALAMOUNT, t1.TRADEID, t1.TRADENAME FROM IBZPAYTRADE t1
]]> ]]>
</sql> </sql>
<!--数据查询[View]--> <!--数据查询[View]-->
...@@ -45,7 +55,7 @@ ...@@ -45,7 +55,7 @@
</sql> </sql>
<!--数据查询[View]--> <!--数据查询[View]-->
<sql id="View" databaseId="oracle"> <sql id="View" databaseId="oracle">
<![CDATA[ SELECT t1.TRADEID, t1.TRADENAME FROM IBZPAYTRADE t1 <![CDATA[ SELECT t1.ACCESSID, t1.OUTTRADENO, t1.SUBJECT, t1.TOTALAMOUNT, t1.TRADEID, t1.TRADENAME FROM IBZPAYTRADE t1
]]> ]]>
</sql> </sql>
</mapper> </mapper>
......
...@@ -28,25 +28,89 @@ public class PayTradeDTO extends DTOBase implements Serializable { ...@@ -28,25 +28,89 @@ public class PayTradeDTO extends DTOBase implements Serializable {
* 属性 [TRADEID] * 属性 [TRADEID]
* *
*/ */
@JSONField(name = "tradeid") @JSONField(name = "trade_id")
@JsonProperty("tradeid") @JsonProperty("trade_id")
private String tradeid; private String tradeId;
/** /**
* 属性 [TRADENAME] * 属性 [TRADENAME]
* *
*/ */
@JSONField(name = "tradename") @JSONField(name = "trade_name")
@JsonProperty("tradename") @JsonProperty("trade_name")
private String tradename; private String tradeName;
/**
* 属性 [SUBJECT]
*
*/
@JSONField(name = "subject")
@JsonProperty("subject")
private String subject;
/**
* 属性 [OUTTRADENO]
*
*/
@JSONField(name = "out_trade_no")
@JsonProperty("out_trade_no")
private String outTradeNo;
/**
* 属性 [TOTALAMOUNT]
*
*/
@JSONField(name = "total_amount")
@JsonProperty("total_amount")
private String totalAmount;
/**
* 属性 [ACCESSID]
*
*/
@JSONField(name = "access_id")
@JsonProperty("access_id")
private String accessId;
/** /**
* 设置 [TRADENAME] * 设置 [TRADENAME]
*/ */
public void setTradename(String tradename){ public void setTradeName(String tradeName){
this.tradename = tradename ; this.tradeName = tradeName ;
this.modify("tradename",tradename); this.modify("tradename",tradeName);
}
/**
* 设置 [SUBJECT]
*/
public void setSubject(String subject){
this.subject = subject ;
this.modify("subject",subject);
}
/**
* 设置 [OUTTRADENO]
*/
public void setOutTradeNo(String outTradeNo){
this.outTradeNo = outTradeNo ;
this.modify("outtradeno",outTradeNo);
}
/**
* 设置 [TOTALAMOUNT]
*/
public void setTotalAmount(String totalAmount){
this.totalAmount = totalAmount ;
this.modify("totalamount",totalAmount);
}
/**
* 设置 [ACCESSID]
*/
public void setAccessId(String accessId){
this.accessId = accessId ;
this.modify("accessid",accessId);
} }
......
...@@ -69,7 +69,7 @@ public class PayTradeResource { ...@@ -69,7 +69,7 @@ public class PayTradeResource {
@RequestMapping(method = RequestMethod.PUT, value = "/paytrades/{paytrade_id}") @RequestMapping(method = RequestMethod.PUT, value = "/paytrades/{paytrade_id}")
public ResponseEntity<PayTradeDTO> update(@PathVariable("paytrade_id") String paytrade_id, @RequestBody PayTradeDTO paytradedto) { public ResponseEntity<PayTradeDTO> update(@PathVariable("paytrade_id") String paytrade_id, @RequestBody PayTradeDTO paytradedto) {
PayTrade domain = paytradeMapping.toDomain(paytradedto); PayTrade domain = paytradeMapping.toDomain(paytradedto);
domain .setTradeid(paytrade_id); domain .setTradeId(paytrade_id);
paytradeService.update(domain ); paytradeService.update(domain );
PayTradeDTO dto = paytradeMapping.toDto(domain ); PayTradeDTO dto = paytradeMapping.toDto(domain );
return ResponseEntity.status(HttpStatus.OK).body(dto); return ResponseEntity.status(HttpStatus.OK).body(dto);
......
...@@ -22,9 +22,9 @@ spring: ...@@ -22,9 +22,9 @@ spring:
max-file-size: 100MB max-file-size: 100MB
max-request-size: 100MB max-request-size: 100MB
datasource: datasource:
username: a_A_5d9d78509 username: root
password: '@6dEfb3@' password: 'root'
url: jdbc:mysql://172.16.180.232:3306/a_A_5d9d78509?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true url: jdbc:mysql://127.0.0.1:3306/ibzpay?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&allowMultiQueries=true
driver-class-name: com.mysql.jdbc.Driver driver-class-name: com.mysql.jdbc.Driver
filters: stat,wall,log4j2 filters: stat,wall,log4j2
#配置初始化大小/最小/最大 #配置初始化大小/最小/最大
...@@ -45,7 +45,7 @@ spring: ...@@ -45,7 +45,7 @@ spring:
pool-prepared-statements: false pool-prepared-statements: false
max-pool-prepared-statement-per-connection-size: 20 max-pool-prepared-statement-per-connection-size: 20
isSyncDBSchema: false isSyncDBSchema: false
defaultSchema: a_A_5d9d78509 defaultSchema: root
conf: classpath:liquibase/master.xml conf: classpath:liquibase/master.xml
#Mybatis-plus配置 #Mybatis-plus配置
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册