| New file |
| | |
| | | package com.java110.dto.transactionLog; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 交互日志数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class TransactionLogDto extends PageDto implements Serializable { |
| | | |
| | | private String srcIp; |
| | | private String serviceCode; |
| | | private String costTime; |
| | | private String ip; |
| | | private String appId; |
| | | private String logId; |
| | | private String state; |
| | | private String userId; |
| | | private String transactionId; |
| | | private String timestamp; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getSrcIp() { |
| | | return srcIp; |
| | | } |
| | | public void setSrcIp(String srcIp) { |
| | | this.srcIp = srcIp; |
| | | } |
| | | public String getServiceCode() { |
| | | return serviceCode; |
| | | } |
| | | public void setServiceCode(String serviceCode) { |
| | | this.serviceCode = serviceCode; |
| | | } |
| | | public String getCostTime() { |
| | | return costTime; |
| | | } |
| | | public void setCostTime(String costTime) { |
| | | this.costTime = costTime; |
| | | } |
| | | public String getIp() { |
| | | return ip; |
| | | } |
| | | public void setIp(String ip) { |
| | | this.ip = ip; |
| | | } |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | public String getLogId() { |
| | | return logId; |
| | | } |
| | | public void setLogId(String logId) { |
| | | this.logId = logId; |
| | | } |
| | | public String getState() { |
| | | return state; |
| | | } |
| | | public void setState(String state) { |
| | | this.state = state; |
| | | } |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | public String getTransactionId() { |
| | | return transactionId; |
| | | } |
| | | public void setTransactionId(String transactionId) { |
| | | this.transactionId = transactionId; |
| | | } |
| | | public String getTimestamp() { |
| | | return timestamp; |
| | | } |
| | | public void setTimestamp(String timestamp) { |
| | | this.timestamp = timestamp; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.dto.transactionLogMessage; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 交互日志数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class TransactionLogMessageDto extends PageDto implements Serializable { |
| | | |
| | | private String requestMessage; |
| | | private String responseHeader; |
| | | private String logId; |
| | | private String requestHeader; |
| | | private String responseMessage; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getRequestMessage() { |
| | | return requestMessage; |
| | | } |
| | | public void setRequestMessage(String requestMessage) { |
| | | this.requestMessage = requestMessage; |
| | | } |
| | | public String getResponseHeader() { |
| | | return responseHeader; |
| | | } |
| | | public void setResponseHeader(String responseHeader) { |
| | | this.responseHeader = responseHeader; |
| | | } |
| | | public String getLogId() { |
| | | return logId; |
| | | } |
| | | public void setLogId(String logId) { |
| | | this.logId = logId; |
| | | } |
| | | public String getRequestHeader() { |
| | | return requestHeader; |
| | | } |
| | | public void setRequestHeader(String requestHeader) { |
| | | this.requestHeader = requestHeader; |
| | | } |
| | | public String getResponseMessage() { |
| | | return responseMessage; |
| | | } |
| | | public void setResponseMessage(String responseMessage) { |
| | | this.responseMessage = responseMessage; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.po.transactionLog; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class TransactionLogMessagePo implements Serializable { |
| | | |
| | | private String requestMessage; |
| | | private String responseHeader; |
| | | private String logId; |
| | | private String requestHeader; |
| | | private String responseMessage; |
| | | |
| | | public String getRequestMessage() { |
| | | return requestMessage; |
| | | } |
| | | |
| | | public void setRequestMessage(String requestMessage) { |
| | | this.requestMessage = requestMessage; |
| | | } |
| | | |
| | | public String getResponseHeader() { |
| | | return responseHeader; |
| | | } |
| | | |
| | | public void setResponseHeader(String responseHeader) { |
| | | this.responseHeader = responseHeader; |
| | | } |
| | | |
| | | public String getLogId() { |
| | | return logId; |
| | | } |
| | | |
| | | public void setLogId(String logId) { |
| | | this.logId = logId; |
| | | } |
| | | |
| | | public String getRequestHeader() { |
| | | return requestHeader; |
| | | } |
| | | |
| | | public void setRequestHeader(String requestHeader) { |
| | | this.requestHeader = requestHeader; |
| | | } |
| | | |
| | | public String getResponseMessage() { |
| | | return responseMessage; |
| | | } |
| | | |
| | | public void setResponseMessage(String responseMessage) { |
| | | this.responseMessage = responseMessage; |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.po.transactionLog; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class TransactionLogPo implements Serializable { |
| | | |
| | | private String srcIp; |
| | | private String serviceCode; |
| | | private String costTime; |
| | | private String ip; |
| | | private String appId; |
| | | private String logId; |
| | | private String state; |
| | | private String userId; |
| | | private String transactionId; |
| | | private String timestamp; |
| | | |
| | | private String requestMessage; |
| | | private String responseHeader; |
| | | private String requestHeader; |
| | | private String responseMessage; |
| | | |
| | | public String getSrcIp() { |
| | | return srcIp; |
| | | } |
| | | |
| | | public void setSrcIp(String srcIp) { |
| | | this.srcIp = srcIp; |
| | | } |
| | | |
| | | public String getServiceCode() { |
| | | return serviceCode; |
| | | } |
| | | |
| | | public void setServiceCode(String serviceCode) { |
| | | this.serviceCode = serviceCode; |
| | | } |
| | | |
| | | public String getCostTime() { |
| | | return costTime; |
| | | } |
| | | |
| | | public void setCostTime(String costTime) { |
| | | this.costTime = costTime; |
| | | } |
| | | |
| | | public String getIp() { |
| | | return ip; |
| | | } |
| | | |
| | | public void setIp(String ip) { |
| | | this.ip = ip; |
| | | } |
| | | |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | |
| | | public String getLogId() { |
| | | return logId; |
| | | } |
| | | |
| | | public void setLogId(String logId) { |
| | | this.logId = logId; |
| | | } |
| | | |
| | | public String getState() { |
| | | return state; |
| | | } |
| | | |
| | | public void setState(String state) { |
| | | this.state = state; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public String getTransactionId() { |
| | | return transactionId; |
| | | } |
| | | |
| | | public void setTransactionId(String transactionId) { |
| | | this.transactionId = transactionId; |
| | | } |
| | | |
| | | public String getTimestamp() { |
| | | return timestamp; |
| | | } |
| | | |
| | | public void setTimestamp(String timestamp) { |
| | | this.timestamp = timestamp; |
| | | } |
| | | |
| | | public String getRequestMessage() { |
| | | return requestMessage; |
| | | } |
| | | |
| | | public void setRequestMessage(String requestMessage) { |
| | | this.requestMessage = requestMessage; |
| | | } |
| | | |
| | | public String getResponseHeader() { |
| | | return responseHeader; |
| | | } |
| | | |
| | | public void setResponseHeader(String responseHeader) { |
| | | this.responseHeader = responseHeader; |
| | | } |
| | | |
| | | public String getRequestHeader() { |
| | | return requestHeader; |
| | | } |
| | | |
| | | public void setRequestHeader(String requestHeader) { |
| | | this.requestHeader = requestHeader; |
| | | } |
| | | |
| | | public String getResponseMessage() { |
| | | return responseMessage; |
| | | } |
| | | |
| | | public void setResponseMessage(String responseMessage) { |
| | | this.responseMessage = responseMessage; |
| | | } |
| | | } |
| | |
| | | public static final String CODE_PREFIX_cartId = "95"; |
| | | public static final String CODE_PREFIX_orderId = "96"; |
| | | public static final String CODE_PREFIX_oaId = "97"; |
| | | public static final String CODE_PREFIX_logId = "10"; |
| | | |
| | | |
| | | |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="transactionLogMessageServiceDaoImpl"> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 保存交互日志信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveTransactionLogMessageInfo" parameterType="Map"> |
| | | insert into transaction_log_message( |
| | | request_message,response_header,log_id,request_header,response_message |
| | | ) values ( |
| | | #{requestMessage},#{responseHeader},#{logId},#{requestHeader},#{responseMessage} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询交互日志信息 add by wuxw 2018-07-03 --> |
| | | <select id="getTransactionLogMessageInfo" parameterType="Map" resultType="Map"> |
| | | select t.request_message,t.request_message requestMessage,t.response_header,t.response_header responseHeader,t.log_id,t.log_id logId,t.request_header,t.request_header requestHeader,t.response_message,t.response_message responseMessage |
| | | from transaction_log_message t |
| | | where 1 =1 |
| | | <if test="requestMessage !=null and requestMessage != ''"> |
| | | and t.request_message= #{requestMessage} |
| | | </if> |
| | | <if test="responseHeader !=null and responseHeader != ''"> |
| | | and t.response_header= #{responseHeader} |
| | | </if> |
| | | <if test="logId !=null and logId != ''"> |
| | | and t.log_id= #{logId} |
| | | </if> |
| | | <if test="requestHeader !=null and requestHeader != ''"> |
| | | and t.request_header= #{requestHeader} |
| | | </if> |
| | | <if test="responseMessage !=null and responseMessage != ''"> |
| | | and t.response_message= #{responseMessage} |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 修改交互日志信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateTransactionLogMessageInfo" parameterType="Map"> |
| | | update transaction_log_message t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="requestMessage !=null and requestMessage != ''"> |
| | | , t.request_message= #{requestMessage} |
| | | </if> |
| | | <if test="responseHeader !=null and responseHeader != ''"> |
| | | , t.response_header= #{responseHeader} |
| | | </if> |
| | | <if test="requestHeader !=null and requestHeader != ''"> |
| | | , t.request_header= #{requestHeader} |
| | | </if> |
| | | <if test="responseMessage !=null and responseMessage != ''"> |
| | | , t.response_message= #{responseMessage} |
| | | </if> |
| | | where 1=1 <if test="logId !=null and logId != ''"> |
| | | and t.log_id= #{logId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询交互日志数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryTransactionLogMessagesCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from transaction_log_message t |
| | | where 1 =1 |
| | | <if test="requestMessage !=null and requestMessage != ''"> |
| | | and t.request_message= #{requestMessage} |
| | | </if> |
| | | <if test="responseHeader !=null and responseHeader != ''"> |
| | | and t.response_header= #{responseHeader} |
| | | </if> |
| | | <if test="logId !=null and logId != ''"> |
| | | and t.log_id= #{logId} |
| | | </if> |
| | | <if test="requestHeader !=null and requestHeader != ''"> |
| | | and t.request_header= #{requestHeader} |
| | | </if> |
| | | <if test="responseMessage !=null and responseMessage != ''"> |
| | | and t.response_message= #{responseMessage} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="transactionLogServiceDaoImpl"> |
| | | |
| | | |
| | | <!-- 保存交互日志信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveTransactionLogInfo" parameterType="Map"> |
| | | insert into transaction_log( |
| | | src_ip,service_code,cost_time,ip,app_id,log_id,state,user_id,transaction_id,timestamp |
| | | ) values ( |
| | | #{srcIp},#{serviceCode},#{costTime},#{ip},#{appId},#{logId},#{state},#{userId},#{transactionId},#{timestamp} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询交互日志信息 add by wuxw 2018-07-03 --> |
| | | <select id="getTransactionLogInfo" parameterType="Map" resultType="Map"> |
| | | select t.src_ip,t.src_ip srcIp,t.service_code,t.service_code serviceCode,t.cost_time,t.cost_time |
| | | costTime,t.ip,t.app_id,t.app_id appId,t.log_id,t.log_id logId,t.state,t.user_id,t.user_id |
| | | userId,t.transaction_id,t.transaction_id transactionId,t.timestamp |
| | | from transaction_log t |
| | | where 1 =1 |
| | | <if test="srcIp !=null and srcIp != ''"> |
| | | and t.src_ip= #{srcIp} |
| | | </if> |
| | | <if test="serviceCode !=null and serviceCode != ''"> |
| | | and t.service_code= #{serviceCode} |
| | | </if> |
| | | <if test="costTime !=null and costTime != ''"> |
| | | and t.cost_time= #{costTime} |
| | | </if> |
| | | <if test="ip !=null and ip != ''"> |
| | | and t.ip= #{ip} |
| | | </if> |
| | | <if test="appId !=null and appId != ''"> |
| | | and t.app_id= #{appId} |
| | | </if> |
| | | <if test="logId !=null and logId != ''"> |
| | | and t.log_id= #{logId} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | and t.user_id= #{userId} |
| | | </if> |
| | | <if test="transactionId !=null and transactionId != ''"> |
| | | and t.transaction_id= #{transactionId} |
| | | </if> |
| | | <if test="timestamp !=null and timestamp != ''"> |
| | | and t.timestamp= #{timestamp} |
| | | </if> |
| | | order by t.create_time desc |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | <!-- 修改交互日志信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateTransactionLogInfo" parameterType="Map"> |
| | | update transaction_log t |
| | | <set> |
| | | <if test="newBId != null and newBId != ''"> |
| | | t.b_id = #{newBId}, |
| | | </if> |
| | | <if test="srcIp !=null and srcIp != ''"> |
| | | t.src_ip= #{srcIp}, |
| | | </if> |
| | | <if test="serviceCode !=null and serviceCode != ''"> |
| | | t.service_code= #{serviceCode}, |
| | | </if> |
| | | <if test="costTime !=null and costTime != ''"> |
| | | t.cost_time= #{costTime}, |
| | | </if> |
| | | <if test="ip !=null and ip != ''"> |
| | | t.ip= #{ip}, |
| | | </if> |
| | | <if test="appId !=null and appId != ''"> |
| | | t.app_id= #{appId}, |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | t.state= #{state}, |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | t.user_id= #{userId}, |
| | | </if> |
| | | <if test="transactionId !=null and transactionId != ''"> |
| | | t.transaction_id= #{transactionId}, |
| | | </if> |
| | | <if test="timestamp !=null and timestamp != ''"> |
| | | t.timestamp= #{timestamp}, |
| | | </if> |
| | | </set> |
| | | where 1=1 |
| | | <if test="logId !=null and logId != ''"> |
| | | and t.log_id= #{logId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询交互日志数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryTransactionLogsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from transaction_log t |
| | | where 1 =1 |
| | | <if test="srcIp !=null and srcIp != ''"> |
| | | and t.src_ip= #{srcIp} |
| | | </if> |
| | | <if test="serviceCode !=null and serviceCode != ''"> |
| | | and t.service_code= #{serviceCode} |
| | | </if> |
| | | <if test="costTime !=null and costTime != ''"> |
| | | and t.cost_time= #{costTime} |
| | | </if> |
| | | <if test="ip !=null and ip != ''"> |
| | | and t.ip= #{ip} |
| | | </if> |
| | | <if test="appId !=null and appId != ''"> |
| | | and t.app_id= #{appId} |
| | | </if> |
| | | <if test="logId !=null and logId != ''"> |
| | | and t.log_id= #{logId} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="userId !=null and userId != ''"> |
| | | and t.user_id= #{userId} |
| | | </if> |
| | | <if test="transactionId !=null and transactionId != ''"> |
| | | and t.transaction_id= #{transactionId} |
| | | </if> |
| | | <if test="timestamp !=null and timestamp != ''"> |
| | | and t.timestamp= #{timestamp} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | { |
| | | "autoMove": true, |
| | | "id": "oaId", |
| | | "name": "storeOrderAddress", |
| | | "desc": "发货地址", |
| | | "shareParam": "orderId", |
| | | "shareColumn": "order_id", |
| | | "shareName": "goods", |
| | | "tableName": "store_order_address", |
| | | "id": "logId", |
| | | "name": "transactionLogMessage", |
| | | "desc": "交互日志", |
| | | "shareParam": "logId", |
| | | "shareColumn": "log_id", |
| | | "shareName": "common", |
| | | "tableName": "transaction_log_message", |
| | | "param": { |
| | | "oaId": "oa_id", |
| | | "addressId": "address_id", |
| | | "orderId": "order_id", |
| | | "tel": "tel", |
| | | "areaCode": "area_code", |
| | | "address": "address", |
| | | "username": "username", |
| | | "statusCd": "status_cd" |
| | | "logId": "log_id", |
| | | "requestHeader": "request_header", |
| | | "responseHeader": "response_header", |
| | | "requestMessage": "request_message", |
| | | "responseMessage": "response_message" |
| | | }, |
| | | "required": [ |
| | | { |
| | | "code": "orderId", |
| | | "msg": "订单不能为空" |
| | | }, |
| | | { |
| | | "code": "areaCode", |
| | | "msg": "地区编码不能为空" |
| | | }, |
| | | { |
| | | "code": "tel", |
| | | "msg": "手机号不能为空" |
| | | }, |
| | | { |
| | | "code": "address", |
| | | "msg": "详细地址不能为空" |
| | | }, |
| | | { |
| | | "code": "username", |
| | | "msg": "收货人不能为空" |
| | | "code": "logId", |
| | | "msg": "日志ID不能为空" |
| | | } |
| | | ] |
| | | } |
| New file |
| | |
| | | package com.java110.intf.common; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.transactionLog.TransactionLogDto; |
| | | import com.java110.po.transactionLog.TransactionLogPo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName ITransactionLogInnerServiceSMO |
| | | * @Description 交互日志接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "common-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/transactionLogApi") |
| | | public interface ITransactionLogInnerServiceSMO { |
| | | |
| | | |
| | | @RequestMapping(value = "/saveTransactionLog", method = RequestMethod.POST) |
| | | public int saveTransactionLog(@RequestBody TransactionLogPo transactionLogPo); |
| | | |
| | | @RequestMapping(value = "/updateTransactionLog", method = RequestMethod.POST) |
| | | public int updateTransactionLog(@RequestBody TransactionLogPo transactionLogPo); |
| | | |
| | | @RequestMapping(value = "/deleteTransactionLog", method = RequestMethod.POST) |
| | | public int deleteTransactionLog(@RequestBody TransactionLogPo transactionLogPo); |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param transactionLogDto 数据对象分享 |
| | | * @return TransactionLogDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryTransactionLogs", method = RequestMethod.POST) |
| | | List<TransactionLogDto> queryTransactionLogs(@RequestBody TransactionLogDto transactionLogDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param transactionLogDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryTransactionLogsCount", method = RequestMethod.POST) |
| | | int queryTransactionLogsCount(@RequestBody TransactionLogDto transactionLogDto); |
| | | } |
| New file |
| | |
| | | package com.java110.intf.common; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.transactionLogMessage.TransactionLogMessageDto; |
| | | import com.java110.po.transactionLog.TransactionLogMessagePo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName ITransactionLogMessageInnerServiceSMO |
| | | * @Description 交互日志接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "common-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/transactionLogMessageApi") |
| | | public interface ITransactionLogMessageInnerServiceSMO { |
| | | |
| | | |
| | | @RequestMapping(value = "/saveTransactionLogMessage", method = RequestMethod.POST) |
| | | public int saveTransactionLogMessage(@RequestBody TransactionLogMessagePo transactionLogMessagePo); |
| | | |
| | | @RequestMapping(value = "/updateTransactionLogMessage", method = RequestMethod.POST) |
| | | public int updateTransactionLogMessage(@RequestBody TransactionLogMessagePo transactionLogMessagePo); |
| | | |
| | | @RequestMapping(value = "/deleteTransactionLogMessage", method = RequestMethod.POST) |
| | | public int deleteTransactionLogMessage(@RequestBody TransactionLogMessagePo transactionLogMessagePo); |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param transactionLogMessageDto 数据对象分享 |
| | | * @return TransactionLogMessageDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryTransactionLogMessages", method = RequestMethod.POST) |
| | | List<TransactionLogMessageDto> queryTransactionLogMessages(@RequestBody TransactionLogMessageDto transactionLogMessageDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param transactionLogMessageDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryTransactionLogMessagesCount", method = RequestMethod.POST) |
| | | int queryTransactionLogMessagesCount(@RequestBody TransactionLogMessageDto transactionLogMessageDto); |
| | | } |
| | |
| | | //支付默认回话 |
| | | public final static int PAY_DEFAULT_EXPIRE_TIME = 2 * 60 * 60; |
| | | |
| | | //日志 |
| | | public final static String LOG_SERVICE_CODE = "LOG_SERVICE_CODE"; |
| | | |
| | | /** |
| | | * 获取值(用户ID) |
| | | * |
| | |
| | | public final static String HTTP_METHOD = "METHOD"; |
| | | public final static String HTTP_APP_ID = "app_id"; |
| | | public final static String HTTP_TRANSACTION_ID = "transaction_id"; |
| | | public final static String HTTP_SRC_IP = "IP"; |
| | | |
| | | public final static String HTTP_REQ_TIME = "req_time"; |
| | | public final static String HTTP_RES_TIME = "res_time"; |
| | |
| | | import org.springframework.context.ApplicationContext; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.http.converter.StringHttpMessageConverter; |
| | | |
| | | import org.springframework.scheduling.annotation.EnableAsync; |
| | | import springfox.documentation.builders.ApiInfoBuilder; |
| | | import springfox.documentation.builders.PathSelectors; |
| | | import springfox.documentation.builders.RequestHandlerSelectors; |
| | |
| | | "com.java110.api", |
| | | "com.java110.core", |
| | | "com.java110.config.properties.code", |
| | | }) |
| | | }) |
| | | @EnableDiscoveryClient |
| | | @Java110ListenerDiscovery(listenerPublishClass = ServiceDataFlowEventPublishing.class, |
| | | basePackages = {"com.java110.api.listener"}) |
| | |
| | | //@EnableConfigurationProperties(EventProperties.class) |
| | | @EnableFeignClients(basePackages = {"com.java110.intf"}) |
| | | @EnableAutoConfiguration(exclude = {DataSourceAutoConfiguration.class}) |
| | | @EnableAsync |
| | | public class ApiApplicationStart { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ApiApplicationStart.class); |
| | |
| | | |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | try{ |
| | | try { |
| | | ApplicationContext context = SpringApplication.run(ApiApplicationStart.class, args); |
| | | |
| | | //服务启动加载 |
| | | ServiceStartInit.initSystemConfig(context); |
| | | }catch (Throwable e){ |
| | | logger.error("系统启动失败",e); |
| | | } catch (Throwable e) { |
| | | logger.error("系统启动失败", e); |
| | | } |
| | | } |
| | | |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.HashMap; |
| | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | |
| | | /** |
| | | * 健康检查 服务 |
| | | * |
| | |
| | | import com.java110.entity.center.AppRoute; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.entity.center.DataFlowLinksCost; |
| | | import com.java110.intf.common.ITransactionLogInnerServiceSMO; |
| | | import com.java110.po.transactionLog.TransactionLogPo; |
| | | import com.java110.utils.cache.AppRouteCache; |
| | | import com.java110.utils.cache.CommonCache; |
| | | import com.java110.utils.cache.MappingCache; |
| | | import com.java110.utils.constant.*; |
| | | import com.java110.utils.exception.*; |
| | | import com.java110.utils.constant.CommonConstant; |
| | | import com.java110.utils.constant.KafkaConstant; |
| | | import com.java110.utils.constant.MappingConstant; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.constant.ServiceCodeConstant; |
| | | import com.java110.utils.exception.BusinessException; |
| | | import com.java110.utils.exception.DecryptException; |
| | | import com.java110.utils.exception.InitConfigDataException; |
| | | import com.java110.utils.exception.ListenerExecuteException; |
| | | import com.java110.utils.exception.NoAuthorityException; |
| | | import com.java110.utils.exception.SMOException; |
| | | import com.java110.utils.kafka.KafkaFactory; |
| | | import com.java110.utils.log.LoggerEngine; |
| | | import com.java110.utils.util.DateUtil; |
| | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | |
| | | @Autowired |
| | | private RestTemplate outRestTemplate; |
| | | |
| | | @Autowired |
| | | private ITransactionLogInnerServiceSMO transactionLogInnerServiceSMOImpl; |
| | | |
| | | |
| | | /** |
| | | * 服务调度 |
| | |
| | | |
| | | ApiDataFlow dataFlow = null; |
| | | |
| | | //JSONObject responseJson = null; |
| | | Date startDate = DateUtil.getCurrentDate(); |
| | | |
| | | ResponseEntity<String> responseEntity = null; |
| | | |
| | |
| | | responseEntity = new ResponseEntity<String>("内部异常:" + e.getMessage() + e.getLocalizedMessage(), HttpStatus.INTERNAL_SERVER_ERROR); |
| | | |
| | | } finally { |
| | | Date endDate = DateUtil.getCurrentDate(); |
| | | if (dataFlow != null) { |
| | | //这里记录日志 |
| | | Date endDate = DateUtil.getCurrentDate(); |
| | | |
| | | dataFlow.setEndDate(endDate); |
| | | //添加耗时 |
| | | //DataFlowFactory.addCostTime(dataFlow, "service", "业务处理总耗时", dataFlow.getStartDate(), dataFlow.getEndDate()); |
| | | //保存耗时 |
| | | //saveCostTimeLogMessage(dataFlow); |
| | | //处理返回报文鉴权 |
| | | //AuthenticationFactory.putSign(dataFlow); |
| | | } |
| | |
| | | //resJson = encrypt(responseJson.toJSONString(),headers); |
| | | responseEntity = new ResponseEntity<String>(resJson, HttpStatus.OK); |
| | | } |
| | | |
| | | //添加耗时 |
| | | saveLog(dataFlow, startDate, endDate, reqJson, responseEntity); |
| | | //这里保存耗时,以及日志 |
| | | return responseEntity; |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 日志记录 |
| | | * |
| | | * @param dataFlow |
| | | * @param startDate |
| | | * @param endDate |
| | | */ |
| | | private void saveLog(ApiDataFlow dataFlow, Date startDate, Date endDate, String reqJson, ResponseEntity<String> responseEntity) { |
| | | |
| | | if (dataFlow == null) { |
| | | return; |
| | | } |
| | | |
| | | String serviceCode = dataFlow.getRequestHeaders().get(CommonConstant.HTTP_SERVICE); |
| | | |
| | | String logServiceCode = CommonCache.getValue(CommonCache.LOG_SERVICE_CODE); |
| | | |
| | | if (StringUtil.isEmpty(logServiceCode)) { |
| | | return; |
| | | } |
| | | if (logServiceCode.contains("|")) { |
| | | String[] logServiceCodes = logServiceCode.split("|"); |
| | | |
| | | for (String lServiceCode : logServiceCodes) { |
| | | if (serviceCode.equals(lServiceCode.trim())) { |
| | | doSaveLog(dataFlow, startDate, endDate, serviceCode, reqJson, responseEntity); |
| | | return; |
| | | } |
| | | } |
| | | } |
| | | |
| | | if ("all".equals(logServiceCode.trim().toLowerCase())) { |
| | | doSaveLog(dataFlow, startDate, endDate, serviceCode, reqJson, responseEntity); |
| | | return; |
| | | } |
| | | |
| | | if (serviceCode.equals(logServiceCode.trim())) { |
| | | doSaveLog(dataFlow, startDate, endDate, serviceCode, reqJson, responseEntity); |
| | | } |
| | | } |
| | | |
| | | @Async |
| | | private void doSaveLog(ApiDataFlow dataFlow, Date startDate, Date endDate, String serviceCode, String reqJson, ResponseEntity<String> responseEntity) { |
| | | |
| | | TransactionLogPo transactionLogPo = new TransactionLogPo(); |
| | | transactionLogPo.setAppId(dataFlow.getAppId()); |
| | | transactionLogPo.setCostTime((endDate.getTime() - startDate.getTime()) + ""); |
| | | transactionLogPo.setIp(""); |
| | | transactionLogPo.setServiceCode(serviceCode); |
| | | transactionLogPo.setSrcIp(dataFlow.getRequestHeaders().get(CommonConstant.HTTP_SRC_IP)); |
| | | transactionLogPo.setState(responseEntity.getStatusCode() != HttpStatus.OK ? "S" : "F"); |
| | | transactionLogPo.setTimestamp(dataFlow.getRequestTime()); |
| | | transactionLogPo.setUserId(dataFlow.getUserId()); |
| | | transactionLogPo.setTransactionId(dataFlow.getTransactionId()); |
| | | transactionLogPo.setRequestHeader(dataFlow.getRequestHeaders() != null ? dataFlow.getRequestHeaders().toString() : ""); |
| | | transactionLogPo.setResponseHeader(responseEntity.getHeaders().toSingleValueMap().toString()); |
| | | transactionLogPo.setRequestMessage(reqJson); |
| | | transactionLogPo.setResponseMessage(responseEntity.getBody()); |
| | | transactionLogInnerServiceSMOImpl.saveTransactionLog(transactionLogPo); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 抒写返回头信息 |
| New file |
| | |
| | | package com.java110.common.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.bmo.transactionLog.IDeleteTransactionLogBMO; |
| | | import com.java110.common.bmo.transactionLog.IGetTransactionLogBMO; |
| | | import com.java110.common.bmo.transactionLog.ISaveTransactionLogBMO; |
| | | import com.java110.common.bmo.transactionLog.IUpdateTransactionLogBMO; |
| | | import com.java110.dto.transactionLog.TransactionLogDto; |
| | | import com.java110.po.transactionLog.TransactionLogPo; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/transactionLog") |
| | | public class TransactionLogApi { |
| | | |
| | | @Autowired |
| | | private ISaveTransactionLogBMO saveTransactionLogBMOImpl; |
| | | @Autowired |
| | | private IUpdateTransactionLogBMO updateTransactionLogBMOImpl; |
| | | @Autowired |
| | | private IDeleteTransactionLogBMO deleteTransactionLogBMOImpl; |
| | | |
| | | @Autowired |
| | | private IGetTransactionLogBMO getTransactionLogBMOImpl; |
| | | |
| | | /** |
| | | * 微信保存消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /transactionLog/saveTransactionLog |
| | | * @path /app/transactionLog/saveTransactionLog |
| | | */ |
| | | @RequestMapping(value = "/saveTransactionLog", method = RequestMethod.POST) |
| | | public ResponseEntity<String> saveTransactionLog(@RequestBody JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "serviceCode", "请求报文中未包含serviceCode"); |
| | | |
| | | |
| | | TransactionLogPo transactionLogPo = BeanConvertUtil.covertBean(reqJson, TransactionLogPo.class); |
| | | return saveTransactionLogBMOImpl.save(transactionLogPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信修改消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /transactionLog/updateTransactionLog |
| | | * @path /app/transactionLog/updateTransactionLog |
| | | */ |
| | | @RequestMapping(value = "/updateTransactionLog", method = RequestMethod.POST) |
| | | public ResponseEntity<String> updateTransactionLog(@RequestBody JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "serviceCode", "请求报文中未包含serviceCode"); |
| | | Assert.hasKeyAndValue(reqJson, "logId", "logId不能为空"); |
| | | |
| | | |
| | | TransactionLogPo transactionLogPo = BeanConvertUtil.covertBean(reqJson, TransactionLogPo.class); |
| | | return updateTransactionLogBMOImpl.update(transactionLogPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /transactionLog/deleteTransactionLog |
| | | * @path /app/transactionLog/deleteTransactionLog |
| | | */ |
| | | @RequestMapping(value = "/deleteTransactionLog", method = RequestMethod.POST) |
| | | public ResponseEntity<String> deleteTransactionLog(@RequestBody JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "logId", "logId不能为空"); |
| | | |
| | | |
| | | TransactionLogPo transactionLogPo = BeanConvertUtil.covertBean(reqJson, TransactionLogPo.class); |
| | | return deleteTransactionLogBMOImpl.delete(transactionLogPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param serviceCode 服务编码 |
| | | * @return |
| | | * @serviceCode /transactionLog/queryTransactionLog |
| | | * @path /app/transactionLog/queryTransactionLog |
| | | */ |
| | | @RequestMapping(value = "/queryTransactionLog", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryTransactionLog(@RequestParam(value = "serviceCode", required = false) String serviceCode, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | TransactionLogDto transactionLogDto = new TransactionLogDto(); |
| | | transactionLogDto.setPage(page); |
| | | transactionLogDto.setRow(row); |
| | | transactionLogDto.setServiceCode(serviceCode); |
| | | return getTransactionLogBMOImpl.get(transactionLogDto); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLog; |
| | | import com.java110.po.transactionLog.TransactionLogPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IDeleteTransactionLogBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改交互日志 |
| | | * add by wuxw |
| | | * @param transactionLogPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> delete(TransactionLogPo transactionLogPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLog; |
| | | |
| | | import com.java110.dto.transactionLog.TransactionLogDto; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IGetTransactionLogBMO { |
| | | |
| | | |
| | | /** |
| | | * 查询交互日志 |
| | | * add by wuxw |
| | | * |
| | | * @param transactionLogDto |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> get(TransactionLogDto transactionLogDto); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLog; |
| | | |
| | | import com.java110.po.transactionLog.TransactionLogPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface ISaveTransactionLogBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加交互日志 |
| | | * add by wuxw |
| | | * |
| | | * @param transactionLogPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> save(TransactionLogPo transactionLogPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLog; |
| | | import com.java110.po.transactionLog.TransactionLogPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IUpdateTransactionLogBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改交互日志 |
| | | * add by wuxw |
| | | * @param transactionLogPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> update(TransactionLogPo transactionLogPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLog.impl; |
| | | |
| | | import com.java110.common.bmo.transactionLog.IDeleteTransactionLogBMO; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.common.ITransactionLogInnerServiceSMO; |
| | | import com.java110.po.transactionLog.TransactionLogPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("deleteTransactionLogBMOImpl") |
| | | public class DeleteTransactionLogBMOImpl implements IDeleteTransactionLogBMO { |
| | | |
| | | @Autowired |
| | | private ITransactionLogInnerServiceSMO transactionLogInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param transactionLogPo 数据 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> delete(TransactionLogPo transactionLogPo) { |
| | | |
| | | int flag = transactionLogInnerServiceSMOImpl.deleteTransactionLog(transactionLogPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLog.impl; |
| | | |
| | | import com.java110.common.bmo.transactionLog.IGetTransactionLogBMO; |
| | | import com.java110.dto.transactionLog.TransactionLogDto; |
| | | import com.java110.intf.common.ITransactionLogInnerServiceSMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service("getTransactionLogBMOImpl") |
| | | public class GetTransactionLogBMOImpl implements IGetTransactionLogBMO { |
| | | |
| | | @Autowired |
| | | private ITransactionLogInnerServiceSMO transactionLogInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param transactionLogDto |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public ResponseEntity<String> get(TransactionLogDto transactionLogDto) { |
| | | |
| | | |
| | | int count = transactionLogInnerServiceSMOImpl.queryTransactionLogsCount(transactionLogDto); |
| | | |
| | | List<TransactionLogDto> transactionLogDtos = null; |
| | | if (count > 0) { |
| | | transactionLogDtos = transactionLogInnerServiceSMOImpl.queryTransactionLogs(transactionLogDto); |
| | | } else { |
| | | transactionLogDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) transactionLogDto.getRow()), count, transactionLogDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLog.impl; |
| | | |
| | | import com.java110.common.bmo.transactionLog.ISaveTransactionLogBMO; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.common.ITransactionLogInnerServiceSMO; |
| | | import com.java110.po.transactionLog.TransactionLogPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("saveTransactionLogBMOImpl") |
| | | public class SaveTransactionLogBMOImpl implements ISaveTransactionLogBMO { |
| | | |
| | | @Autowired |
| | | private ITransactionLogInnerServiceSMO transactionLogInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param transactionLogPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | //@Java110Transactional |
| | | public ResponseEntity<String> save(TransactionLogPo transactionLogPo) { |
| | | |
| | | transactionLogPo.setLogId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_logId)); |
| | | int flag = transactionLogInnerServiceSMOImpl.saveTransactionLog(transactionLogPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLog.impl; |
| | | |
| | | import com.java110.common.bmo.transactionLog.IUpdateTransactionLogBMO; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.common.ITransactionLogInnerServiceSMO; |
| | | import com.java110.po.transactionLog.TransactionLogPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("updateTransactionLogBMOImpl") |
| | | public class UpdateTransactionLogBMOImpl implements IUpdateTransactionLogBMO { |
| | | |
| | | @Autowired |
| | | private ITransactionLogInnerServiceSMO transactionLogInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param transactionLogPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> update(TransactionLogPo transactionLogPo) { |
| | | |
| | | int flag = transactionLogInnerServiceSMOImpl.updateTransactionLog(transactionLogPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLogMessage; |
| | | |
| | | import com.java110.po.transactionLog.TransactionLogMessagePo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IDeleteTransactionLogMessageBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改交互日志 |
| | | * add by wuxw |
| | | * |
| | | * @param transactionLogMessagePo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> delete(TransactionLogMessagePo transactionLogMessagePo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLogMessage; |
| | | |
| | | import com.java110.dto.transactionLogMessage.TransactionLogMessageDto; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IGetTransactionLogMessageBMO { |
| | | |
| | | |
| | | /** |
| | | * 查询交互日志 |
| | | * add by wuxw |
| | | * |
| | | * @param transactionLogMessageDto |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> get(TransactionLogMessageDto transactionLogMessageDto); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLogMessage; |
| | | |
| | | import com.java110.po.transactionLog.TransactionLogMessagePo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface ISaveTransactionLogMessageBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加交互日志 |
| | | * add by wuxw |
| | | * |
| | | * @param transactionLogMessagePo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> save(TransactionLogMessagePo transactionLogMessagePo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLogMessage; |
| | | |
| | | import com.java110.po.transactionLog.TransactionLogMessagePo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IUpdateTransactionLogMessageBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改交互日志 |
| | | * add by wuxw |
| | | * |
| | | * @param transactionLogMessagePo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> update(TransactionLogMessagePo transactionLogMessagePo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLogMessage.impl; |
| | | |
| | | import com.java110.common.bmo.transactionLogMessage.IDeleteTransactionLogMessageBMO; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.common.ITransactionLogMessageInnerServiceSMO; |
| | | import com.java110.po.transactionLog.TransactionLogMessagePo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("deleteTransactionLogMessageBMOImpl") |
| | | public class DeleteTransactionLogMessageBMOImpl implements IDeleteTransactionLogMessageBMO { |
| | | |
| | | @Autowired |
| | | private ITransactionLogMessageInnerServiceSMO transactionLogMessageInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param transactionLogMessagePo 数据 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> delete(TransactionLogMessagePo transactionLogMessagePo) { |
| | | |
| | | int flag = transactionLogMessageInnerServiceSMOImpl.deleteTransactionLogMessage(transactionLogMessagePo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLogMessage.impl; |
| | | |
| | | import com.java110.common.bmo.transactionLogMessage.IGetTransactionLogMessageBMO; |
| | | import com.java110.dto.transactionLogMessage.TransactionLogMessageDto; |
| | | import com.java110.intf.common.ITransactionLogMessageInnerServiceSMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service("getTransactionLogMessageBMOImpl") |
| | | public class GetTransactionLogMessageBMOImpl implements IGetTransactionLogMessageBMO { |
| | | |
| | | @Autowired |
| | | private ITransactionLogMessageInnerServiceSMO transactionLogMessageInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param transactionLogMessageDto |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public ResponseEntity<String> get(TransactionLogMessageDto transactionLogMessageDto) { |
| | | |
| | | |
| | | int count = transactionLogMessageInnerServiceSMOImpl.queryTransactionLogMessagesCount(transactionLogMessageDto); |
| | | |
| | | List<TransactionLogMessageDto> transactionLogMessageDtos = null; |
| | | if (count > 0) { |
| | | transactionLogMessageDtos = transactionLogMessageInnerServiceSMOImpl.queryTransactionLogMessages(transactionLogMessageDto); |
| | | } else { |
| | | transactionLogMessageDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) transactionLogMessageDto.getRow()), count, transactionLogMessageDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLogMessage.impl; |
| | | |
| | | import com.java110.common.bmo.transactionLogMessage.ISaveTransactionLogMessageBMO; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.common.ITransactionLogMessageInnerServiceSMO; |
| | | import com.java110.po.transactionLog.TransactionLogMessagePo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("saveTransactionLogMessageBMOImpl") |
| | | public class SaveTransactionLogMessageBMOImpl implements ISaveTransactionLogMessageBMO { |
| | | |
| | | @Autowired |
| | | private ITransactionLogMessageInnerServiceSMO transactionLogMessageInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param transactionLogMessagePo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> save(TransactionLogMessagePo transactionLogMessagePo) { |
| | | |
| | | transactionLogMessagePo.setLogId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_logId)); |
| | | int flag = transactionLogMessageInnerServiceSMOImpl.saveTransactionLogMessage(transactionLogMessagePo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.bmo.transactionLogMessage.impl; |
| | | |
| | | import com.java110.common.bmo.transactionLogMessage.IUpdateTransactionLogMessageBMO; |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.common.ITransactionLogMessageInnerServiceSMO; |
| | | import com.java110.po.transactionLog.TransactionLogMessagePo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("updateTransactionLogMessageBMOImpl") |
| | | public class UpdateTransactionLogMessageBMOImpl implements IUpdateTransactionLogMessageBMO { |
| | | |
| | | @Autowired |
| | | private ITransactionLogMessageInnerServiceSMO transactionLogMessageInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param transactionLogMessagePo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> update(TransactionLogMessagePo transactionLogMessagePo) { |
| | | |
| | | int flag = transactionLogMessageInnerServiceSMOImpl.updateTransactionLogMessage(transactionLogMessagePo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 交互日志组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 交互日志服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface ITransactionLogMessageServiceDao { |
| | | |
| | | |
| | | /** |
| | | * 保存 交互日志信息 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveTransactionLogMessageInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询交互日志信息(instance过程) |
| | | * 根据bId 查询交互日志信息 |
| | | * @param info bId 信息 |
| | | * @return 交互日志信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getTransactionLogMessageInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改交互日志信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateTransactionLogMessageInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询交互日志总数 |
| | | * |
| | | * @param info 交互日志信息 |
| | | * @return 交互日志数量 |
| | | */ |
| | | int queryTransactionLogMessagesCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.dao; |
| | | |
| | | |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 交互日志组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 交互日志服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface ITransactionLogServiceDao { |
| | | |
| | | |
| | | /** |
| | | * 保存 交互日志信息 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveTransactionLogInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询交互日志信息(instance过程) |
| | | * 根据bId 查询交互日志信息 |
| | | * @param info bId 信息 |
| | | * @return 交互日志信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getTransactionLogInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改交互日志信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateTransactionLogInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询交互日志总数 |
| | | * |
| | | * @param info 交互日志信息 |
| | | * @return 交互日志数量 |
| | | */ |
| | | int queryTransactionLogsCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.common.dao.ITransactionLogMessageServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 交互日志服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("transactionLogMessageServiceDaoImpl") |
| | | //@Transactional |
| | | public class TransactionLogMessageServiceDaoImpl extends BaseServiceDao implements ITransactionLogMessageServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(TransactionLogMessageServiceDaoImpl.class); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存交互日志信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveTransactionLogMessageInfo(Map info) throws DAOException { |
| | | logger.debug("保存交互日志信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("transactionLogMessageServiceDaoImpl.saveTransactionLogMessageInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存交互日志信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询交互日志信息(instance) |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getTransactionLogMessageInfo(Map info) throws DAOException { |
| | | logger.debug("查询交互日志信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessTransactionLogMessageInfos = sqlSessionTemplate.selectList("transactionLogMessageServiceDaoImpl.getTransactionLogMessageInfo",info); |
| | | |
| | | return businessTransactionLogMessageInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改交互日志信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateTransactionLogMessageInfo(Map info) throws DAOException { |
| | | logger.debug("修改交互日志信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("transactionLogMessageServiceDaoImpl.updateTransactionLogMessageInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改交互日志信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询交互日志数量 |
| | | * @param info 交互日志信息 |
| | | * @return 交互日志数量 |
| | | */ |
| | | @Override |
| | | public int queryTransactionLogMessagesCount(Map info) { |
| | | logger.debug("查询交互日志数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessTransactionLogMessageInfos = sqlSessionTemplate.selectList("transactionLogMessageServiceDaoImpl.queryTransactionLogMessagesCount", info); |
| | | if (businessTransactionLogMessageInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessTransactionLogMessageInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.utils.constant.ResponseConstant; |
| | | import com.java110.utils.exception.DAOException; |
| | | import com.java110.utils.util.DateUtil; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import com.java110.common.dao.ITransactionLogServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 交互日志服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("transactionLogServiceDaoImpl") |
| | | //@Transactional |
| | | public class TransactionLogServiceDaoImpl extends BaseServiceDao implements ITransactionLogServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(TransactionLogServiceDaoImpl.class); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存交互日志信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveTransactionLogInfo(Map info) throws DAOException { |
| | | logger.debug("保存交互日志信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("transactionLogServiceDaoImpl.saveTransactionLogInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存交互日志信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询交互日志信息(instance) |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getTransactionLogInfo(Map info) throws DAOException { |
| | | logger.debug("查询交互日志信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessTransactionLogInfos = sqlSessionTemplate.selectList("transactionLogServiceDaoImpl.getTransactionLogInfo",info); |
| | | |
| | | return businessTransactionLogInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改交互日志信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateTransactionLogInfo(Map info) throws DAOException { |
| | | logger.debug("修改交互日志信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("transactionLogServiceDaoImpl.updateTransactionLogInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改交互日志信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询交互日志数量 |
| | | * @param info 交互日志信息 |
| | | * @return 交互日志数量 |
| | | */ |
| | | @Override |
| | | public int queryTransactionLogsCount(Map info) { |
| | | logger.debug("查询交互日志数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessTransactionLogInfos = sqlSessionTemplate.selectList("transactionLogServiceDaoImpl.queryTransactionLogsCount", info); |
| | | if (businessTransactionLogInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessTransactionLogInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.smo.impl; |
| | | |
| | | |
| | | import com.java110.common.dao.ITransactionLogServiceDao; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.transactionLog.TransactionLogDto; |
| | | import com.java110.intf.common.ITransactionLogInnerServiceSMO; |
| | | import com.java110.intf.common.ITransactionLogMessageInnerServiceSMO; |
| | | import com.java110.po.transactionLog.TransactionLogMessagePo; |
| | | import com.java110.po.transactionLog.TransactionLogPo; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import com.java110.utils.util.StringUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 交互日志内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class TransactionLogInnerServiceSMOImpl extends BaseServiceSMO implements ITransactionLogInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private ITransactionLogServiceDao transactionLogServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private ITransactionLogMessageInnerServiceSMO transactionLogMessageInnerServiceSMOImpl; |
| | | |
| | | |
| | | @Override |
| | | public int saveTransactionLog(@RequestBody TransactionLogPo transactionLogPo) { |
| | | int saveFlag = 1; |
| | | |
| | | if (StringUtil.isEmpty(transactionLogPo.getLogId()) || transactionLogPo.getLogId().startsWith("-")) { |
| | | transactionLogPo.setLogId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_logId)); |
| | | } |
| | | transactionLogServiceDaoImpl.saveTransactionLogInfo(BeanConvertUtil.beanCovertMap(transactionLogPo)); |
| | | TransactionLogMessagePo transactionLogMessagePo = BeanConvertUtil.covertBean(transactionLogPo, TransactionLogMessagePo.class); |
| | | transactionLogMessageInnerServiceSMOImpl.saveTransactionLogMessage(transactionLogMessagePo); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int updateTransactionLog(@RequestBody TransactionLogPo transactionLogPo) { |
| | | int saveFlag = 1; |
| | | transactionLogServiceDaoImpl.updateTransactionLogInfo(BeanConvertUtil.beanCovertMap(transactionLogPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteTransactionLog(@RequestBody TransactionLogPo transactionLogPo) { |
| | | int saveFlag = 1; |
| | | transactionLogServiceDaoImpl.updateTransactionLogInfo(BeanConvertUtil.beanCovertMap(transactionLogPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public List<TransactionLogDto> queryTransactionLogs(@RequestBody TransactionLogDto transactionLogDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = transactionLogDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | transactionLogDto.setPage((page - 1) * transactionLogDto.getRow()); |
| | | } |
| | | |
| | | List<TransactionLogDto> transactionLogs = BeanConvertUtil.covertBeanList(transactionLogServiceDaoImpl.getTransactionLogInfo(BeanConvertUtil.beanCovertMap(transactionLogDto)), TransactionLogDto.class); |
| | | |
| | | return transactionLogs; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryTransactionLogsCount(@RequestBody TransactionLogDto transactionLogDto) { |
| | | return transactionLogServiceDaoImpl.queryTransactionLogsCount(BeanConvertUtil.beanCovertMap(transactionLogDto)); |
| | | } |
| | | |
| | | public ITransactionLogServiceDao getTransactionLogServiceDaoImpl() { |
| | | return transactionLogServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTransactionLogServiceDaoImpl(ITransactionLogServiceDao transactionLogServiceDaoImpl) { |
| | | this.transactionLogServiceDaoImpl = transactionLogServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.common.smo.impl; |
| | | |
| | | |
| | | import com.java110.common.dao.ITransactionLogMessageServiceDao; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.transactionLogMessage.TransactionLogMessageDto; |
| | | import com.java110.intf.common.ITransactionLogMessageInnerServiceSMO; |
| | | import com.java110.po.transactionLog.TransactionLogMessagePo; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 交互日志内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class TransactionLogMessageInnerServiceSMOImpl extends BaseServiceSMO implements ITransactionLogMessageInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private ITransactionLogMessageServiceDao transactionLogMessageServiceDaoImpl; |
| | | |
| | | |
| | | @Override |
| | | public int saveTransactionLogMessage(@RequestBody TransactionLogMessagePo transactionLogMessagePo) { |
| | | int saveFlag = 1; |
| | | transactionLogMessageServiceDaoImpl.saveTransactionLogMessageInfo(BeanConvertUtil.beanCovertMap(transactionLogMessagePo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int updateTransactionLogMessage(@RequestBody TransactionLogMessagePo transactionLogMessagePo) { |
| | | int saveFlag = 1; |
| | | transactionLogMessageServiceDaoImpl.updateTransactionLogMessageInfo(BeanConvertUtil.beanCovertMap(transactionLogMessagePo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteTransactionLogMessage(@RequestBody TransactionLogMessagePo transactionLogMessagePo) { |
| | | int saveFlag = 1; |
| | | transactionLogMessageServiceDaoImpl.updateTransactionLogMessageInfo(BeanConvertUtil.beanCovertMap(transactionLogMessagePo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public List<TransactionLogMessageDto> queryTransactionLogMessages(@RequestBody TransactionLogMessageDto transactionLogMessageDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = transactionLogMessageDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | transactionLogMessageDto.setPage((page - 1) * transactionLogMessageDto.getRow()); |
| | | } |
| | | |
| | | List<TransactionLogMessageDto> transactionLogMessages = BeanConvertUtil.covertBeanList(transactionLogMessageServiceDaoImpl.getTransactionLogMessageInfo(BeanConvertUtil.beanCovertMap(transactionLogMessageDto)), TransactionLogMessageDto.class); |
| | | |
| | | return transactionLogMessages; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryTransactionLogMessagesCount(@RequestBody TransactionLogMessageDto transactionLogMessageDto) { |
| | | return transactionLogMessageServiceDaoImpl.queryTransactionLogMessagesCount(BeanConvertUtil.beanCovertMap(transactionLogMessageDto)); |
| | | } |
| | | |
| | | public ITransactionLogMessageServiceDao getTransactionLogMessageServiceDaoImpl() { |
| | | return transactionLogMessageServiceDaoImpl; |
| | | } |
| | | |
| | | public void setTransactionLogMessageServiceDaoImpl(ITransactionLogMessageServiceDao transactionLogMessageServiceDaoImpl) { |
| | | this.transactionLogMessageServiceDaoImpl = transactionLogMessageServiceDaoImpl; |
| | | } |
| | | } |