parent
473aa0adf9
commit
8cd3940c7c
@ -0,0 +1,24 @@
|
||||
package au.com.royalpay.payment.manage.mappers.riskbusiness;
|
||||
|
||||
import cn.yixblog.support.mybatis.autosql.annotations.AutoMapper;
|
||||
import cn.yixblog.support.mybatis.autosql.annotations.AutoSql;
|
||||
import cn.yixblog.support.mybatis.autosql.annotations.SqlType;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: lujian
|
||||
* @Date: 2018/11/22 15:32
|
||||
*/
|
||||
@AutoMapper(tablename = "risk_process_log", pkName = "risk_process_id")
|
||||
public interface RiskProcessLogMapper {
|
||||
|
||||
@AutoSql(type = SqlType.SELECT)
|
||||
PageList<JSONObject> getRiskProcessLogs(@Param("risk_id") String riskId, PageBounds pagination);
|
||||
|
||||
@AutoSql(type = SqlType.INSERT)
|
||||
void addRiskProcessLog(JSONObject log);
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package au.com.royalpay.payment.manage.riskbusiness.core;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: lujian
|
||||
* @Date: 2018/11/22 15:40
|
||||
*/
|
||||
public interface RiskProcessLogService {
|
||||
|
||||
/**
|
||||
* 获取事件处理流程
|
||||
* @param riskId
|
||||
* @return
|
||||
*/
|
||||
PageList<JSONObject> getRiskProcessLogs(String riskId);
|
||||
|
||||
/**
|
||||
* 新增处理流程
|
||||
* @param log
|
||||
*/
|
||||
void addRiskProcessLog(JSONObject log);
|
||||
|
||||
void addRiskProcessLog(String riskId, String operatorId, String operator, String remark, int resultTypeFrom, int resultTypeTo);
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package au.com.royalpay.payment.manage.riskbusiness.core.impl;
|
||||
|
||||
import au.com.royalpay.payment.manage.mappers.riskbusiness.RiskProcessLogMapper;
|
||||
import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.Order;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
|
||||
import com.github.miemiedev.mybatis.paginator.domain.PageList;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: lujian
|
||||
* @Date: 2018/11/22 15:46
|
||||
*/
|
||||
@Service
|
||||
public class RiskProcessLogServiceImpl implements RiskProcessLogService {
|
||||
|
||||
@Resource
|
||||
private RiskProcessLogMapper riskProcessLogMapper;
|
||||
|
||||
@Override
|
||||
public PageList<JSONObject> getRiskProcessLogs(String riskId) {
|
||||
return riskProcessLogMapper.getRiskProcessLogs(riskId, new PageBounds(Order.formString("create_time")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRiskProcessLog(JSONObject log) {
|
||||
riskProcessLogMapper.addRiskProcessLog(log);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addRiskProcessLog(String riskId, String operatorId, String operator, String remark, int resultTypeFrom, int resultTypeTo) {
|
||||
JSONObject log = new JSONObject();
|
||||
log.put("risk_id", riskId);
|
||||
log.put("operator_id", operatorId);
|
||||
log.put("operator", operator);
|
||||
log.put("remark", remark);
|
||||
log.put("result_type_from", resultTypeFrom);
|
||||
log.put("result_type_to", resultTypeTo);
|
||||
riskProcessLogMapper.addRiskProcessLog(log);
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package au.com.royalpay.payment.manage.riskbusiness.web;
|
||||
|
||||
import au.com.royalpay.payment.manage.riskbusiness.core.RiskProcessLogService;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.gson.JsonObject;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.xml.bind.util.JAXBSource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description:
|
||||
* @Author: lujian
|
||||
* @Date: 2018/11/22 15:52
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping(value = "/risk/business/process/logs")
|
||||
public class RiskProcessLogController {
|
||||
|
||||
@Resource
|
||||
private RiskProcessLogService riskProcessLogService;
|
||||
|
||||
@GetMapping(value = "/{risk_id}")
|
||||
public List<JSONObject> getRiskProcessLogs(@PathVariable("risk_id") String riskId) {
|
||||
return riskProcessLogService.getRiskProcessLogs(riskId);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
public void addRiskProcessLog(@RequestBody JSONObject log) {
|
||||
riskProcessLogService.addRiskProcessLog(log);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue