Commit 5362bf1c by yangyang

资金流相关提交

parent 70b7008c
package com.founder.commonutils.model.newPublicEntity.ztypEntity;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.util.HashSet;
import java.util.Set;
/**
* 团伙类
* create by lystar
......
......@@ -2,8 +2,6 @@ package com.founder.commonutils.model.newPublicEntity.ztypEntity;
import lombok.Data;
import java.util.Objects;
/**
* 嫌疑人证件号码及是否被使用
* create by lystar
......
package com.founder.commonutils.model.newPublicEntity.ztypEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author zzj
* @description 银行卡研判可视化分析
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BankCardKshfxPojo {
/**
* 标识id
*/
private String id;
/**
* 节点名称
*/
private String name;
/**
* 类型 task表示任务,bankCard表示银行卡号
*/
private String type;
/**
* 子节点集合
*/
private List<BankCardKshfxPojo> children;
/**
* 是否高亮
*/
private boolean red;
/**
* 父级类型
*/
private String parentType;
/**
* 父级id
*/
private String parentId;
/**
* 父级name
*/
private String parentName;
/**
* 转入、转出
*/
private String jcbz;
}
package com.founder.commonutils.model.newPublicEntity.ztypEntity;
import com.founder.commonutils.model.newPublicEntity.SysUser;
import lombok.Data;
/**
* @author szLi
* @date 2021/8/25 15:39
*/
@Data
public class BaseModel {
protected String xxscPdbz;
protected String xxdjdwGajgjgdm;
protected String xxdjdwGajgmc;
protected String xxdjryXm;
protected String xxdjryGmsfhm;
protected String xxdjryLxdh;
protected String djsj;
protected String gxsj;
protected String xxczdwGajgjgdm;
protected String xxczdwGajgmc;
protected String xxczryXm;
protected String xxczryGmsfhm;
protected String xxczryLxdh;
protected String xxlyms = "刑侦信息专业应用系统";
protected String xxrsksj;
protected String xxrbksj;
protected String xxrskPdbz;
protected String xxrbkPdbz;
protected String gabxf;
protected int begin;
protected int end;
protected int page;//当前第几页
protected int limit;//每页多少行
//登录人员
public void setDjUser(SysUser user){
this.xxdjryXm=user.getTrueName();
this.xxdjdwGajgjgdm=user.getUnitcode();
this.xxdjdwGajgmc=user.getUnitname();
this.xxdjryGmsfhm=user.getIdentitycard();
this.xxdjryLxdh=user.getTelephone();
this.xxczryXm=user.getTrueName();
this.xxczdwGajgjgdm=user.getUnitcode();
this.xxczdwGajgmc=user.getUnitname();
this.xxczryGmsfhm=user.getIdentitycard();
}
}
package com.founder.commonutils.model.newPublicEntity.ztypEntity;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;
/**
* @auther: Lilei
* @date: 2022/4/27 16:45
*/
@Data
public class FileParam {
private MultipartFile[] files;
private String xxzjbh;
private String username;
private String taskId;
}
package com.founder.commonutils.model.newPublicEntity.ztypEntity;
import lombok.Data;
@Data
public class JypdTj {
/**
* 本方卡号
*/
private String bfCardsNum;
/**
* 对方卡号
*/
private String dfCardsNum;
/**
* 总交易次数
*/
private String jycsTotal;
/**
* 总交易额
*/
private String jyzeTotal;
/**
* 转入总交易额
*/
private String zrjyzeTotal;
/**
* 转出总交易额
*/
private String zcjyzeTotal;
}
package com.founder.commonutils.model.newPublicEntity.ztypEntity;
import lombok.Data;
@Data
public class JyxxJsPojo {
private String asjbh;
private String yhkh;
private String zjhm;
private int page;
private int limit;
}
package com.founder.commonutils.model.newPublicEntity.ztypEntity;
import com.founder.commonutils.model.newPublicEntity.result.ResultCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
@Data
@ApiModel(value = "全局统一返回结果")
public class Result {
@ApiModelProperty(value = "是否成功")
private boolean success;
@ApiModelProperty(value = "返回码")
private Integer code;
@ApiModelProperty(value = "返回消息")
private String message;
@ApiModelProperty(value = "返回数据")
private Map<String, Object> data = new HashMap<String, Object>();
private Result(){}
public static Result ok(){
Result r = new Result();
r.setSuccess(true);
r.setCode(ResultCode.OK);
r.setMessage(ResultCode.OK_MSG);
return r;
}
public static Result error(){
Result r = new Result();
r.setSuccess(false);
r.setCode(ResultCode.ERROR);
r.setMessage(ResultCode.ERROR_MSG);
return r;
}
public static Result loginFail() {
Result r = new Result();
r.setSuccess(false);
r.setCode(ResultCode.LOGIN_OUT_TIME);
r.setMessage(ResultCode.LOGIN_OUT_TIME_MSG);
return r;
}
public Result message(String message){
this.setMessage(message);
return this;
}
public Result code(Integer code){
this.setCode(code);
return this;
}
public Result data(String key, Object value){
this.data.put(key, value);
return this;
}
public Result data(Map<String, Object> map){
this.setData(map);
return this;
}
public Result rows(Object object){
this.data("rows",object);
return this;
}
public Result total(Object object){
this.data("total",object);
return this;
}
}
......@@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.util.Date;
import java.util.List;
@Getter
......
package com.founder.commonutils.model.newPublicEntity.ztypEntity;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
/**
* 资金流导出实体类
* @auther: Lilei
* @date: 2022/4/29 10:17
*/
@Data
public class TbZjlxxExcel {
@ExcelProperty("本方卡号")
private String bfkh;
@ExcelProperty("账号名称")
private String bfzhmc;
@ExcelProperty("对手卡号")
private String dfkh;
@ExcelProperty("对手名称")
private String dfmc;
@ExcelProperty("交易时间")
private String jysj;
@ExcelProperty("转账金额")
private String zzje;
@ExcelProperty("余额")
private String zhye;
@ExcelProperty("进出标志")
private String jcbz;
@ExcelProperty("交易方式")
private String jyfs;
@ExcelProperty("交易流水号")
private String jylsh;
@ExcelProperty("交易摘要")
private String jyzy;
@ExcelProperty("交易银行")
private String jyyh;
}
......@@ -11,7 +11,7 @@ import lombok.Data;
@Data
@ApiModel(value = "TbZjlxxzx最新资金表", description = "最新资金表")
public class TbZjlxxzx {
public class TbZjlxxzx extends BaseModel {
@ApiModelProperty(value = "本方卡号")
private String bfkh;
......
......@@ -11,7 +11,7 @@ import lombok.Data;
@Data
@ApiModel(value = "TbZxrwb任务表", description = "任务表")
public class TbZxrwb{
public class TbZxrwb extends BaseModel {
@ApiModelProperty(value = "任务编号")
private String xxzjbh;
......
package com.founder.publicapi.controller.ZtypService;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.founder.commonutils.model.newPublicEntity.ApprovalEntity.EasyUIPage;
import com.founder.commonutils.model.newPublicEntity.SysUser;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.*;
import com.founder.publicapi.service.TbZjlxxServcie;
import com.founder.servicebase.logs.OperLog;
import com.founder.servicebase.logs.OperationType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.poi.hssf.usermodel.HSSFCellStyle;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.net.URLEncoder;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author yangyang
* @date 2023/09/21
* 主题研判资金流相关接口
*/
@Controller
@RequestMapping(value = "/ztypxx")
@Api(value = "主题研判资金流相关接口", tags = "主题研判资金流相关接口")
public class TbZjlxxController {
@Autowired
private TbZjlxxServcie tbZjlxxServcie;
@OperLog(message = "获取任务的交易详情", operation = OperationType.QUERY)
@PostMapping("/getTransactionDetailByTaskId")
@ResponseBody
@ApiOperation(value = "获取任务的交易详情", notes = "获取任务的交易详情")
public R getTransactionDetailByTaskId(BankCardParamPojo requestParam) {
Map<String, Object> result = tbZjlxxServcie.getTransactionDetailByTaskId(requestParam);
return R.ok().data(result);
}
@OperLog(message = "获取交易时间规律统计", operation = OperationType.QUERY)
@PostMapping("/getTradingTimeStatistics")
@ResponseBody
@ApiOperation(value = "获取交易时间规律统计", notes = "获取交易时间规律统计")
public R getTradingTimeStatistics(BankCardParamPojo requestParam) throws ParseException {
Map<String, Object> result = tbZjlxxServcie.getTradingTimeStatistics(requestParam);
return R.ok().data(result);
}
@OperLog(message = "获取交易地域规律统计", operation = OperationType.QUERY)
@PostMapping("/getTradingLocationStatistics")
@ResponseBody
@ApiOperation(value = "获取交易地域规律统计", notes = "获取交易地域规律统计")
public R getTradingLocationStatistics(BankCardParamPojo requestParam) {
Map<String, Object> result = tbZjlxxServcie.getTradingLocationStatistics(requestParam);
return R.ok().data(result);
}
@OperLog(message = "获取交易习惯分析统计", operation = OperationType.QUERY)
@PostMapping("/getTradingHabitStatistics")
@ResponseBody
@ApiOperation(value = "获取交易习惯分析统计", notes = "获取交易习惯分析统计")
public R getTradingHabitStatistics(BankCardParamPojo requestParam) {
Map<String, Object> result = tbZjlxxServcie.getTradingHabitStatistics(requestParam);
return R.ok().data(result);
}
@OperLog(message = "获取交易频度分析统计", operation = OperationType.QUERY)
@PostMapping("/getTradingFrequencyStatistics")
@ResponseBody
@ApiOperation(value = "获取交易频度分析统计", notes = "获取交易频度分析统计")
public R getTradingFrequencyStatistics(BankCardParamPojo requestParam) {
Map<String, Object> result = tbZjlxxServcie.getTradingFrequencyStatistics(requestParam);
return R.ok().data(result);
}
@OperLog(message = "获取交易频度分析统计", operation = OperationType.QUERY)
@PostMapping("/getJwdAnly")
@ResponseBody
@ApiOperation(value = "获取经纬度", notes = "获取经纬度")
public R getJwdAnly(BankCardParamPojo requestParam) {
Map<String, Object> result = tbZjlxxServcie.getJwdAnly(requestParam);
return R.ok().data(result);
}
// 根据任务编号,查询最新资金表的数据
@OperLog(message = "查询最新资金表的list集合", operation = OperationType.QUERY)
@PostMapping("/selectZxzjbList")
@ResponseBody
@ApiOperation(value = "查询最新资金表的list集合", notes = "查询最新资金表的list集合")
public R selectZxzjbList(TbZjlxxzx tbZjlxxzx) {
try {
Map<String, Object> map = new HashMap<>();
List<TbZjlxxzx> list = tbZjlxxServcie.getZxzjbList(tbZjlxxzx);
// int count = tbZjlxxServcie.getZxzjbCount(tbZjlxxzx);
map.put("rows", list);
map.put("total", list.size());
return R.ok().data(map);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
// 根据银行卡号查询资金流
@OperLog(message = "查询交易信息检索的list集合", operation = OperationType.QUERY)
@PostMapping("/selectJyxxjsList")
@ResponseBody
@ApiOperation(value = "查询交易信息检索的list集合", notes = "查询交易信息检索的list集合")
public R selectJyxxjsList(TbZjlxxzx tbZjlxxzx) {
try {
Map<String, Object> map = new HashMap<>();
if (tbZjlxxzx.getBfkh() == null || "".equals(tbZjlxxzx.getBfkh())) {
map.put("rows", new ArrayList<>());
map.put("total", 0);
return R.ok().data(map);
}
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(tbZjlxxzx.getPage());
easyUIPage.setPagePara(tbZjlxxzx.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
tbZjlxxzx.setPage(begin);
tbZjlxxzx.setLimit(end);
List<TbZjlxxzx> list = tbZjlxxServcie.selectJyxxjsList(tbZjlxxzx);
int total = tbZjlxxServcie.selectJyxxjsListCount(tbZjlxxzx);
map.put("rows", list);
map.put("total", total);
return R.ok().data(map);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
@OperLog(message = "查询业务关联的list集合", operation = OperationType.QUERY)
@PostMapping("/selectJyywglList")
@ResponseBody
@ApiOperation(value = "查询业务关联的list集合", notes = "查询业务关联的list集合")
public R selectJyywglList(JyxxJsPojo jyxxJsPojo) {
try {
Map<String, Object> map = new HashMap<>();
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(jyxxJsPojo.getPage());
easyUIPage.setPagePara(jyxxJsPojo.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
jyxxJsPojo.setPage(begin);
jyxxJsPojo.setLimit(end);
List<String> yhkhlist = tbZjlxxServcie.getKyfwbshListByAsjbh(jyxxJsPojo);
List<TbZjlxxzx> list = tbZjlxxServcie.selectJyywglList(yhkhlist, jyxxJsPojo.getPage(), jyxxJsPojo.getLimit());
int total = tbZjlxxServcie.selectJyywglCount(yhkhlist, jyxxJsPojo.getPage(), jyxxJsPojo.getLimit());
map.put("rows", list);
map.put("total", total);
return R.ok().data(map);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
//多个文件的资金流可视化
@OperLog(message = "资金流可视化", operation = OperationType.QUERY)
@PostMapping("/getZjlkshBySsrwbh")
@ResponseBody
@ApiOperation(value = "资金流可视化", notes = "资金流可视化")
public R getZjlkshBySsrwbh(String ssrwbh) {
try {
Map<String, Object> zjlkshBySsrwbh = tbZjlxxServcie.getZjlkshBySsrwbh(ssrwbh);
return R.ok().data(zjlkshBySsrwbh);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
@OperLog(message = "获取交易关系可视化分析", operation = OperationType.QUERY)
@PostMapping("/getTradingRelationship")
@ResponseBody
@ApiOperation(value = "获取交易关系可视化分析", notes = "获取交易关系可视化分析")
public R getTradingRelationship(BankCardParamPojo requestParam) {
Map<String, Object> result = tbZjlxxServcie.getTradingRelationship(requestParam);
return R.ok().data(result);
}
@OperLog(message = "查询交易信息分析数据", operation = OperationType.QUERY)
@PostMapping("/getTransactionStatistics")
@ResponseBody
@ApiOperation(value = "查询交易信息分析数据", notes = "查询交易信息分析数据")
public R getTransactionStatistics(BankCardNumPojo bankCard) {
Map<String, Object> result = tbZjlxxServcie.getTransactionStatistics(bankCard);
return R.ok().data(result);
}
// 查询任务列表
@OperLog(message = "查询具体任务的list集合", operation = OperationType.QUERY)
@PostMapping("/selectJtrwList")
@ResponseBody
@ApiOperation(value = "查询具体任务的list集合", notes = "查询具体任务的list集合")
public R selectJtrwList(TbZxrwb tbZxrwb) {
try {
EasyUIPage easyUIPage = new EasyUIPage();
easyUIPage.setPage(tbZxrwb.getPage());
easyUIPage.setPagePara(tbZxrwb.getLimit());
int begin = easyUIPage.getBegin();
int end = easyUIPage.getEnd();
tbZxrwb.setBegin(begin);
tbZxrwb.setEnd(end);
Map<String, Object> map = new HashMap<>();
List<TbZxrwb> list = tbZjlxxServcie.getJtrwList(tbZxrwb);
int count = tbZjlxxServcie.getJtrwCount(tbZxrwb);
map.put("rows", list);
map.put("total", count);
return R.ok().data(map);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
/**
* 导入Excel表中数据到数据库中
* <p>
* files 文件
* xxzjbh 用户名
*
* @return
* @throws IOException
*/
@OperLog(message = "导入Excel表中数据到数据库中", operation = OperationType.QUERY)
@PostMapping("uploadFile")
@ResponseBody
@ApiOperation(value = "导入Excel表中数据到数据库中", notes = "导入Excel表中数据到数据库中")
public Result uploadFile(FileParam fileParam, HttpServletRequest request) throws Exception {
// 查询是否有这个任务编号
SysUser user = (SysUser)request.getAttribute("user");
String xxzjbh = fileParam.getXxzjbh();
TbZxrwb jtxxByxxzjbh = tbZjlxxServcie.getJtxxByxxzjbh(xxzjbh);
if (jtxxByxxzjbh == null) {
return Result.error().message("不存在该任务编号");
}
for (MultipartFile file : fileParam.getFiles()) {
List data = tbZjlxxServcie.readAndSaveExcel(file, xxzjbh);
// 将数据进行保存
tbZjlxxServcie.insertSave(data, xxzjbh,user);
}
return Result.ok();
}
/**
* 导出数据到Excel中
* @return
* @throws
*/
@OperLog(message = "导出数据到Excel中", operation = OperationType.QUERY)
@PostMapping("/downloadExcel")
@ResponseBody
@ApiOperation(value = "导出数据到Excel中", notes = "导出数据到Excel中")
public Result downloadExcel(TbZjlxxzx tbZjlxxzx, HttpServletResponse response) throws Exception {
List<TbZjlxxExcel> excelList = tbZjlxxServcie.dcZjlList(tbZjlxxzx);
try {
response.setCharacterEncoding("utf-8");
// 这里URLEncoder.encode可以防止中文乱码 当然和easyexcel没有关系
String fileName = URLEncoder.encode("银行卡转账信息", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
// 这里需要设置不关闭流
EasyExcel.write(response.getOutputStream(), TbZjlxxExcel.class).autoCloseStream(Boolean.FALSE).sheet("银行卡转账信息")
.doWrite(excelList);
} catch (Exception e) {
// 重置response
response.reset();
response.setContentType("application/json");
response.setCharacterEncoding("utf-8");
Map<String, String> map = new HashMap<String, String>();
map.put("status", "failure");
map.put("message", "下载文件失败" + e.getMessage());
response.getWriter().println(JSON.toJSONString(map));
}
return Result.ok();
}
@OperLog(message = "删除资金流数据", operation = OperationType.QUERY)
@PostMapping("/deleteZjlByBfkh")
@ResponseBody
@ApiOperation(value = "删除资金流数据", notes = "删除资金流数据")
public R deleteZjlByBfkh(HttpServletRequest request, TbZjlxxzx tbZjlxxzx) {
try {
SysUser user = (SysUser)request.getAttribute("user");
int count = tbZjlxxServcie.deleteZjlByBfkh(tbZjlxxzx,user);
return R.ok().data("count",count);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
@OperLog(message = "导出数据为excel", operation = OperationType.QUERY)
@ApiOperation(value = "导出数据为excel")
@PostMapping("/dataToExcel")
@ResponseBody
public void dataToExcel(BankCardParamPojo bankCardParamPojo, HttpServletResponse response) throws Exception {
List<?> excelList = tbZjlxxServcie.getExcelList(bankCardParamPojo);
List<String> headNameList = tbZjlxxServcie.getHeadNameList(bankCardParamPojo);
List<String> headIdList = tbZjlxxServcie.getHeadIdList(bankCardParamPojo);
if ("02".equals(bankCardParamPojo.getDataType()) && "01".equals(bankCardParamPojo.getAnalysisFrequency())) {
bankCardParamPojo.setDataType("06");
}
traidDataExport("交易数据", bankCardParamPojo, excelList, headNameList, headIdList, response);
}
private void traidDataExport(String titleName, BankCardParamPojo bankCardParamPojo, List<?> excelList, List<String> headNameList,
List<String> headIdList, HttpServletResponse response) throws Exception {
OutputStream os = response.getOutputStream();
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet(titleName);
HSSFRow row0 = sheet.createRow(0);
HSSFCellStyle style = wb.createCellStyle();
style.setAlignment(HorizontalAlignment.CENTER);
int headIndex = 1;
row0.createCell(0).setCellValue("序号");
for (String headName : headNameList) {
row0.createCell(headIndex).setCellValue(headName);
headIndex++;
}
int rowNum = 1;
if ("01".equals(bankCardParamPojo.getDataType()) || "02".equals(bankCardParamPojo.getDataType()) || "03".equals(bankCardParamPojo.getDataType())) {
List<BankCardNumPojo> excelListNew = (List<BankCardNumPojo>) excelList;
if("02".equals(bankCardParamPojo.getDataType())&&"02".equals(bankCardParamPojo.getAnalysisFrequency())){
excelListNew = (List<BankCardNumPojo>) excelList.get(0);
}else {
excelListNew = (List<BankCardNumPojo>) excelList;
}
for (BankCardNumPojo excelItem : excelListNew) {
HSSFRow row = sheet.createRow(rowNum);
row.createCell(0).setCellValue(rowNum);
int colNum = 1;
for (String headId : headIdList) {
row.createCell(colNum).setCellValue(String.valueOf(getFieldValueByName(excelItem, headId)));
colNum++;
}
rowNum++;
}
} else if ("04".equals(bankCardParamPojo.getDataType())) {
List<JypdTj> excelListNew = (List<JypdTj>) excelList;
for (JypdTj excelItem : excelListNew) {
HSSFRow row = sheet.createRow(rowNum);
row.createCell(0).setCellValue(rowNum);
int colNum = 1;
for (String headId : headIdList) {
row.createCell(colNum).setCellValue(String.valueOf(getFieldValueByName(excelItem, headId)));
colNum++;
}
rowNum++;
}
} else if ("05".equals(bankCardParamPojo.getDataType())) {
List<Map<String, Object>> excelListNew = (List<Map<String, Object>>) excelList;
for (Map<String, Object> excelItem : excelListNew) {
HSSFRow row = sheet.createRow(rowNum);
row.createCell(0).setCellValue(rowNum);
int colNum = 1;
for (String headId : headIdList) {
row.createCell(colNum).setCellValue(String.valueOf(excelItem.get(headId)));
colNum++;
}
rowNum++;
}
}else if ("06".equals(bankCardParamPojo.getDataType())) {
List<List<Object>> excelListNew = (List<List<Object>>) excelList;
for (List<Object> excelItem : excelListNew) {
HSSFRow row = sheet.createRow(rowNum);
row.createCell(0).setCellValue(rowNum);
int colNum = 1;
for (String headId : headIdList) {
row.createCell(colNum).setCellValue(String.valueOf(excelItem.get(colNum-1)));
colNum++;
}
rowNum++;
}
}
sheet.setDefaultRowHeight((short) (16.5 * 20));
for (int i = 1; i < headIdList.size(); i++) {
sheet.autoSizeColumn(i);
}
response.setContentType("application/vnd.ms-excel;charset=utf-8");
response.setHeader("Content-disposition", "attachment;" + URLEncoder.encode(titleName + ".xls", "UTF-8"));//默认Excel名称
wb.write(os);
os.flush();
}
private static Object getFieldValueByName(Object o, String name) throws Exception {
Field[] declaredFields = o.getClass().getDeclaredFields();
for (Field field : declaredFields) {
field.setAccessible(true);
if (field.getName().equals(name)) {
return field.get(o);
}
}
return null;
}
// 新增任务
@OperLog(message = "录入任务信息", operation = OperationType.QUERY)
@PostMapping("/insertJtrw")
@ResponseBody
@ApiOperation(value = "录入任务信息", notes = "录入任务信息")
public R insertJtrw(TbZxrwb tbZxrwb, HttpServletRequest request) {
try {
SysUser user = (SysUser)request.getAttribute("user");
String xxzjbh = tbZjlxxServcie.insertJtrw(tbZxrwb,user);
return R.ok().data("xxzjbh", xxzjbh);
} catch (Exception e) {
e.printStackTrace();
return R.error(e.getMessage());
}
}
}
package com.founder.publicapi.mapper.mysqlMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
@Mapper
@Component
public interface SysXxzjbhMapper {
public String getXxzjbh(@Param("unitCode") String unitCode, @Param("time") String time);
public String getZcxwYwzj(@Param("unitCode") String unitCode, @Param("time") String time, @Param("tableName") String tableName, @Param("prefix") String prefix);
}
package com.founder.publicapi.mapper.mysqlMapper;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
* @author yangyang
* @date 2023/09/21 -- 15:01
*/
@Mapper
public interface TbZjlxxMapper {
// 获取任务信息 列表
List<TbZxrwb> getJtrwList(TbZxrwb tbZxrwb) throws Exception;
// 获取电信流信息 个数
int getJtrwCount(TbZxrwb tbZxrwb) throws Exception;
int batchInsertZjl(List<TbZjlxxzx> list);
int batchInsertZjlByExcel(TbZjlxxzx tbZjlxxzx);
//删除资金流
int deleteZjlByBfkh(TbZjlxxzx tbZjlxxzx);
// 获取最新资金表信息 列表
List<TbZjlxxzx> getZxzjbList(TbZjlxxzx tbZjlxxzx) throws Exception;
int selectJyxxjsListCount(TbZjlxxzx tbZjlxxzx);
//@DS("xzxt")
int getZpajxxTotal(ZpajxxModel model);
List<String> getKyfwbshListByAsjbh(String asjbh);
List<String> getKyfwbshListByZjhm(JyxxJsPojo jyxxJsPojo);
int selectJyywglCount(@Param(value = "list") List<String> list, @Param(value = "page") int page, @Param(value = "limit") int limit);
int getTransactionStatisticsCount(BankCardNumPojo bankCard);
int getTransactionCountByTaskId(BankCardParamPojo requestParam);
List<BankCardNumPojo> getTransactionDetailByTaskId(BankCardParamPojo requestParam);
int getTradingTimeStatisticsCount(BankCardParamPojo requestParam);
List<String> getEarlyTimelist(@Param("taskIdList") List<String> taskIdList, @Param("bfkh") String bfkh, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<String> getLastTimelist(@Param("taskIdList") List<String> taskIdList, @Param("bfkh") String bfkh, @Param("startTime") String startTime, @Param("endTime") String endTime);
String getZcjyyh(@Param("taskIdList") List<String> taskIdList, @Param("bfkh") String bfkh, @Param("startTime") String startTime, @Param("endTime") String endTime);
List<String> getBankByTaskid(BankCardParamPojo requestParam);
int getBankByTaskidCount(BankCardParamPojo requestParam);
List<JypdTj> getTradingFrequencyStatistics(BankCardParamPojo requestParam);
int getTradingFrequencyCount(BankCardParamPojo requestParam);
int getJyTotalBybfkhAndDfkh(BankCardParamPojo requestParam);
List<Map<String, Object>> getTransactionCardAndTime(BankCardParamPojo requestParam);
List<BankCardNumPojo> getTradingTimeStatisticsList(BankCardParamPojo requestParam);
List<Map<String, Object>> getAllTradList(BankCardParamPojo requestParam);
List<BankCardNumPojo> getTradingBankList(BankCardParamPojo requestParam);
List<TbZjlxxzx> selectJyyeglList(@Param(value = "list") List<String> list, @Param(value = "page") int page, @Param(value = "limit") int limit);
List<TbZjlxxzx> selectJyxxjsList(TbZjlxxzx tbZjlxxzx);
//根据所属任务编号获取资金流信息
List<AjThKshfxPojo> getZjlAllBySsrwbh(String ssrwbh);
TbZxrwb getJtxxByxxzjbh(String xxzjbh) throws Exception;
List<BankCardNumPojo> getTransactionStatisticsList(BankCardNumPojo bankCard);
//导出资金表信息列表
List<TbZjlxxExcel> dcZjlList(TbZjlxxzx tbZjlxxzx) throws Exception;
// 录入任务
int insertJtrw(TbZxrwb tbZxrwb) throws Exception;
}
<?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="com.founder.publicapi.mapper.mysqlMapper.SysXxzjbhMapper">
<select id="getXxzjbh" resultType="string">
select FN_XXCJ_XXZJBH(#{unitCode},#{time}) from dual
</select>
<select id="getZcxwYwzj" resultType="string">
select FN_XXCJ_NGZBHZH(#{unitCode},#{tableName},#{time},#{prefix}) from dual;
</select>
</mapper>
<?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="com.founder.publicapi.mapper.mysqlMapper.TbZjlxxMapper">
<sql id="zjl-where">
WHERE xxsc_pdbz = '0'
<if test="fsrzzzh != null and fsrzzzh != ''">
and fsrzzzh = #{ fsrzzzh , jdbcType=VARCHAR }
</if>
<if test="fsrsfzh != null and fsrsfzh != ''">
and fsrsfzh = #{ fsrsfzh , jdbcType=VARCHAR }
</if>
<if test="jsrzzzh != null and jsrzzzh != ''">
and jsrzzzh = #{ jsrzzzh , jdbcType=VARCHAR }
</if>
<if test="jsrsfz != null and jsrsfz != ''">
and jsrsfz = #{ jsrsfz , jdbcType=VARCHAR }
</if>
</sql>
<sql id="dxl-where">
WHERE xxsc_pdbz = '0'
<if test="jsfxm != null and jsfxm != ''">
and jsfxm = #{ jsfxm , jdbcType=VARCHAR }
</if>
<if test="jsfsjh != null and jsfsjh != ''">
and jsfsjh = #{ jsfsjh , jdbcType=VARCHAR }
</if>
<if test="fsfxm != null and fsfxm != ''">
and fsfxm = #{ fsfxm , jdbcType=VARCHAR }
</if>
<if test="fsfsjh != null and fsfsjh != ''">
and fsfsjh = #{ fsfsjh , jdbcType=VARCHAR }
</if>
</sql>
<!-- 获取-->
<select id="getJtrwList" parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZxrwb"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZxrwb">
SELECT a.xxzjbh AS xxzjbh,
DATE_FORMAT(a.djsj, '%Y-%m-%d %H:%i:%s') AS djsj,
a.zwmc AS zwmc,
count(DISTINCT b.bfkh) bfCardsCount,
count(DISTINCT b.dfkh) dfCardsCount
FROM tb_zxrwb a
LEFT JOIN tb_zjlxxzx b ON a.xxzjbh = b.ssrwbh AND b.xxsc_pdbz = '0'
<where>
a.xxsc_pdbz = '0'
<if test="zwmc != null and zwmc != ''">
and a.zwmc like '%${zwmc}%'
</if>
<if test="rwkssj != null and rwkssj != ''">
and a.djsj <![CDATA[>=]]> DATE_FORMAT(#{rwkssj,jdbcType=VARCHAR},'%Y%m%d')
</if>
<if test="rwjssj != null and rwjssj != ''">
and a.djsj <![CDATA[<=]]> (DATE_FORMAT(#{rwjssj,jdbcType=VARCHAR},'%Y%m%d'))
</if>
</where>
GROUP BY a.xxzjbh, a.djsj, a.zwmc order by a.djsj desc,a.xxzjbh
limit #{begin}, #{end}
</select>
<select id="getJtrwCount" resultType="java.lang.Integer"
parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZxrwb">
SELECT count(a.xxzjbh)
FROM tb_zxrwb a
<where>
a.xxsc_pdbz = '0'
<if test="zwmc != null and zwmc != ''">
and a.zwmc like '%${zwmc}%'
</if>
<if test="rwkssj != null and rwkssj != ''">
and a.djsj <![CDATA[>=]]> DATE_FORMAT(#{rwkssj,jdbcType=VARCHAR},'%Y%m%d')
</if>
<if test="rwjssj != null and rwjssj != ''">
and a.djsj <![CDATA[<=]]> (DATE_FORMAT(#{rwjssj,jdbcType=VARCHAR},'%Y%m%d'))
</if>
</where>
</select>
<sql id="jtrw-where">
WHERE xxsc_pdbz = '0'
<if test="zwmc != null and zwmc != ''">
and zwmc = #{ zwmc , jdbcType=VARCHAR }
</if>
<if test="rwkssj != null and rwkssj != ''">
and djsj <![CDATA[>=]]> DATE_FORMAT(#{rwkssj,jdbcType=VARCHAR},'%Y%m%d')
</if>
<if test="rwjssj != null and rwjssj != ''">
and djsj <![CDATA[<]]> (DATE_FORMAT(#{rwjssj,jdbcType=VARCHAR},'%Y%m%d'))+1
</if>
</sql>
<!-- 录入最新资金流的数据-->
<insert id="batchInsertZjl" parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZjlxxzx">
INSERT INTO tb_zjlxxzx (
djsj
,gxsj
,xxsc_pdbz
,xxdjdw_gajgjgdm
,xxdjdw_gajgmc
,xxdjry_gmsfhm
,xxdjry_lxdh
,xxdjry_xm
,xxczdw_gajgjgdm
,xxczdw_gajgmc
,xxczry_gmsfhm
,xxczry_lxdh
,xxczry_xm
,xxzjbh
,bfkh
,bfzhmc
,dfkh
,dfmc
,jysj
,zzje
,zhye
,jcbz
,jyyh
,jyzy
,ssrwbh
,jyfs
,jylsh
)
VALUES
<foreach collection="list" item="item" separator=",">
(
now()
,#{ item.gxsj , jdbcType=VARCHAR }
,'0'
,#{ item.xxdjdwGajgjgdm , jdbcType=VARCHAR }
,#{ item.xxdjdwGajgmc , jdbcType=VARCHAR }
,#{ item.xxdjryGmsfhm , jdbcType=VARCHAR }
,#{ item.xxdjryLxdh , jdbcType=VARCHAR }
,#{ item.xxdjryXm , jdbcType=VARCHAR }
,#{ item.xxczdwGajgjgdm , jdbcType=VARCHAR }
,#{ item.xxczdwGajgmc , jdbcType=VARCHAR }
,#{ item.xxczryGmsfhm , jdbcType=VARCHAR }
,#{ item.xxczryLxdh , jdbcType=VARCHAR }
,#{ item.xxczryXm , jdbcType=VARCHAR }
,#{ item.xxzjbh , jdbcType=VARCHAR }
,#{ item.bfkh , jdbcType=VARCHAR }
,#{ item.bfzhmc , jdbcType=VARCHAR }
,#{ item.dfkh , jdbcType=VARCHAR }
,#{ item.dfmc , jdbcType=VARCHAR }
,#{ item.jysj , jdbcType=VARCHAR }
,#{ item.zzje , jdbcType=VARCHAR }
,#{ item.zhye , jdbcType=VARCHAR }
,#{ item.jcbz , jdbcType=VARCHAR }
,#{ item.jyyh , jdbcType=VARCHAR }
,#{ item.jyzy , jdbcType=VARCHAR }
,#{ item.ssrwbh , jdbcType=VARCHAR }
,#{ item.jyfs , jdbcType=VARCHAR }
,#{ item.jylsh , jdbcType=VARCHAR }
)
</foreach>
</insert>
<!-- 录入最新资金流的数据-->
<insert id="batchInsertZjlByExcel" parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZjlxxzx">
INSERT INTO tb_zjlxxzx (
djsj
,gxsj
,xxsc_pdbz
,xxdjdw_gajgjgdm
,xxdjdw_gajgmc
,xxdjry_gmsfhm
,xxdjry_lxdh
,xxdjry_xm
,xxczdw_gajgjgdm
,xxczdw_gajgmc
,xxczry_gmsfhm
,xxczry_lxdh
,xxczry_xm
,xxzjbh
,bfkh
,bfzhmc
,dfkh
,dfmc
<if test="jysj != null and jysj != ''">
,jysj
</if>
,zzje
,zhye
,jcbz
,jyyh
,ssrwbh
)
VALUES
(
now()
,#{ gxsj , jdbcType=VARCHAR }
,'0'
,#{ xxdjdwGajgjgdm , jdbcType=VARCHAR }
,#{ xxdjdwGajgmc , jdbcType=VARCHAR }
,#{ xxdjryGmsfhm , jdbcType=VARCHAR }
,#{ xxdjryLxdh , jdbcType=VARCHAR }
,#{ xxdjryXm , jdbcType=VARCHAR }
,#{ xxczdwGajgjgdm , jdbcType=VARCHAR }
,#{ xxczdwGajgmc , jdbcType=VARCHAR }
,#{ xxczryGmsfhm , jdbcType=VARCHAR }
,#{ xxczryLxdh , jdbcType=VARCHAR }
,#{ xxczryXm , jdbcType=VARCHAR }
,#{ xxzjbh , jdbcType=VARCHAR }
,#{ bfkh , jdbcType=VARCHAR }
,#{ bfzhmc , jdbcType=VARCHAR }
,#{ dfkh , jdbcType=VARCHAR }
,#{ dfmc , jdbcType=VARCHAR }
<if test="jysj != null and jysj != ''">
,#{ jysj , jdbcType=VARCHAR }
</if>
,#{ zzje , jdbcType=VARCHAR }
,#{ zhye , jdbcType=VARCHAR }
,#{ jcbz , jdbcType=VARCHAR }
,#{ jyyh , jdbcType=VARCHAR }
,#{ ssrwbh , jdbcType=VARCHAR }
)
</insert>
<delete id="deleteZjlByBfkh" parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZjlxxzx">
update tb_zjlxxzx set xxsc_pdbz = '1',
<if test="xxczdwGajgjgdm != null and xxczdwGajgjgdm !=''">xxczdw_gajgjgdm = #{xxczdwGajgjgdm},</if>
<if test="xxczdwGajgmc != null and xxczdwGajgmc !=''">xxczdw_gajgmc = #{xxczdwGajgmc},</if>
<if test="xxczryXm != null and xxczryXm !=''">xxczry_xm = #{xxczryXm},</if>
<if test="xxczryGmsfhm != null and xxczryGmsfhm !=''">xxczry_gmsfhm = #{xxczryGmsfhm},</if>
gxsj = now()
where bfkh = #{ bfkh , jdbcType=VARCHAR }
and ssrwbh = #{ ssrwbh , jdbcType=VARCHAR }
</delete>
<!-- 获取-->
<select id="getZxzjbList" parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZjlxxzx"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZjlxxzx">
SELECT djsj as djsj,
gxsj as gxsj,
xxsc_pdbz as xxscPdbz,
xxdjdw_gajgjgdm as xxdjdwGajgjgdm,
xxdjdw_gajgmc as xxdjdwGajgmc,
xxdjry_gmsfhm as xxdjryGmsfhm,
xxdjry_lxdh as xxdjryLxdh,
xxdjry_xm as xxdjryXm,
xxczdw_gajgjgdm as xxczdwGajgjgdm,
xxczdw_gajgmc as xxczdwGajgmc,
xxczry_gmsfhm as xxczryGmsfhm,
xxczry_lxdh as xxczryLxdh,
xxczry_xm as xxczryXm,
xxzjbh as xxzjbh,
bfkh as bfkh,
bfzhmc as bfzhmc,
dfkh as dfkh,
dfmc as dfmc,
jysj as jysj,
zzje as zzje,
zhye as zhye,
jcbz as jcbz,
jyyh as jyyh,
ssrwbh as ssrwbh
FROM tb_zjlxxzx
where xxsc_pdbz = '0'
and ssrwbh = #{ ssrwbh , jdbcType=VARCHAR }
</select>
<select id="selectJyxxjsListCount" parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZjlxxzx"
resultType="java.lang.Integer">
SELECT count(*)
FROM tb_zjlxxzx
where xxsc_pdbz = '0'
AND ssrwbh IN (SELECT XXZJBH FROM tb_zxrwb WHERE tb_zxrwb.xxsc_pdbz = '0')
and (bfkh = #{ bfkh , jdbcType=VARCHAR } or dfkh = #{ bfkh , jdbcType=VARCHAR })
</select>
<select id="selectJyywglCount" resultType="java.lang.Integer">
SELECT count(*)
FROM tb_zjlxxzx
where xxsc_pdbz='0' AND ssrwbh IN (SELECT XXZJBH FROM tb_zxrwb WHERE tb_zxrwb.xxsc_pdbz = '0')
<if test="list != null ">
and (bfkh in
<foreach collection="list" item="item" index="index" open="(" separator=","
close=")">
#{item}
</foreach>
or dfkh in
<foreach collection="list" item="item" index="index" open="(" separator=","
close=")">
#{item}
</foreach>
)
</if>
</select>
<select id="getZpajxxTotal" parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.ZpajxxModel"
resultType="java.lang.Integer">
select count(*) from (
select a.asjbh asjbh,
a.ajmc ajmc,
(select name from sys_dictitem where groupid = 'CODE_AJXZ' and code = a.ZATZ_JYQK) zatzJyqk,
(select name from sys_dictitem where groupid = 'CODE_AJXLB' and code = b.AJXLB) ajxlb,
wm_concat(case ASJXGFWBZH_FWBZH_FWBZHLBDM when '01' then h.ASJXGFWBZH_FWBZH end) mobile,
wm_concat(case ASJXGFWBZH_FWBZH_FWBZHLBDM when '04' then h.ASJXGFWBZH_FWBZH end) yhkh,
wm_concat(case ASJXGFWBZH_FWBZH_FWBZHLBDM when '13' then h.ASJXGFWBZH_FWBZH end) wx,
wm_concat(case ASJXGFWBZH_FWBZH_FWBZHLBDM when '16' then h.ASJXGFWBZH_FWBZH end) personid
from tb_st_asj a left join tb_st_asj_asjbz b on a.ASJBH = b.ASJBH left join TB_XW_ASJXGFWBZH h on b.ASJBH =
h.ASJBH
where a.AJLBDM = '05000300' and a.ZATZ_JYQK != '0500030002%'
<if test="asjbh != null and asjbh != '' ">
and a.asjbh like '%' || #{asjbh} || '%'
</if>
<if test="ajmc != null and ajmc != '' ">
and a.ajmc like '%' || #{ajmc} || '%'
</if>
<if test="ajzlb != null and ajzlb != '' ">
and b.AJZLB = #{ajzlb}
</if>
<if test="ajxzlb != null and ajxzlb != '' ">
and b.AJXZLB = #{ajxzlb}
</if>
<if test="xalbdmbcms != null and xalbdmbcms != '' ">
and b.XALBDMBCMS = #{xalbdmbcms}
</if>
group by a.asjbh, a.ajmc, a.ZATZ_JYQK, b.AJXLB
) t
</select>
<select id="getKyfwbshListByAsjbh" parameterType="String"
resultType="java.lang.String">
select distinct GJC
from tb_tzxxjq_tzxxlxdy
where SCBZ = '0'
and BSHLX = 'yhkh'
and ZJBH = #{asjbh}
</select>
<select id="getKyfwbshListByZjhm"
resultType="java.lang.String">
select distinct GJC from tb_tzxxjq_tzxxlxdy
where SCBZ='0' and BSHLX='yhkh' and ZJBH in (
select xyr.ASJBH
from tb_xw_zbfzxyr xyr
where xyr.XXSC_PDBZ = '0'
<if test="asjbh != null and asjbh != '' ">
and xyr.ASJBH =#{asjbh}
</if>
<if test="zjhm != null and zjhm != '' ">
and xyr.ZHFZXYR_CYZJ_ZJHM =#{zjhm}
</if>
)
</select>
<select id="getTransactionStatisticsCount" resultType="java.lang.Integer"
parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardNumPojo">
SELECT count(distinct a.xxzjbh)
FROM tb_zxrwb a left join tb_zjlxxzx b on a.xxzjbh = b.ssrwbh and b.xxsc_pdbz = '0'
<where>
a.xxsc_pdbz = '0'
<if test="taskName != null and taskName != ''">
and a.zwmc like '%${taskName}%'
</if>
<if test="bfCardsNum != null and bfCardsNum != ''">
and b.bfkh = #{bfCardsNum}
</if>
<if test="bfCardsName != null and bfCardsName != ''">
and b.bfzhmc like '%${bfCardsName}%'
</if>
<if test="dfCardsNum != null and dfCardsNum != ''">
and b.dfkh = #{dfCardsNum}
</if>
<if test="dfCardsName != null and dfCardsName != ''">
and b.dfmc like '%${dfCardsName}%'
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and b.jysj <![CDATA[>=]]> DATE_FORMAT(#{tradingTimeStart,jdbcType=VARCHAR},'%Y-%m-%d')
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and b.jysj <![CDATA[<=]]> (DATE_FORMAT(#{tradingTimeEnd,jdbcType=VARCHAR},'%Y-%m-%d'))
</if>
</where>
</select>
<select id="getTransactionCountByTaskId" resultType="java.lang.Integer"
parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardParamPojo">
select count(a.xxzjbh)
from tb_zjlxxzx a
where a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
<if test="bfCardsNum != null and bfCardsNum != ''">
and a.bfkh = #{bfCardsNum}
</if>
<if test="dfCardsNum != null and dfCardsNum != ''">
and a.dfkh = #{dfCardsNum}
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and a.jysj <![CDATA[>=]]> #{tradingTimeStart}
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and a.jysj <![CDATA[<=]]> #{tradingTimeEnd}
</if>
</select>
<select id="getTransactionDetailByTaskId"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardNumPojo"
parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardParamPojo">
select b.xxzjbh as taskId,
b.zwmc as taskName,
a.xxzjbh as xxzjbh,
a.bfkh as bfCardsNum,
a.bfzhmc as bfCardsName,
a.dfkh as dfCardsNum,
a.dfmc as dfCardsName,
a.jysj as tradingTimeStart,
a.zzje as transactionAmount,
a.zhye as accountBalance,
a.jcbz as transferInOrOut,
a.jyyh as tradingBankName,
a.jyfs as transactionMode,
a.jylsh as transactionNumber
from tb_zjlxxzx a join tb_zxrwb b on a.ssrwbh = b.xxzjbh
where a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
<if test="bfCardsNum != null and bfCardsNum != ''">
and a.bfkh = #{bfCardsNum}
</if>
<if test="dfCardsNum != null and dfCardsNum != ''">
and a.dfkh = #{dfCardsNum}
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and a.jysj <![CDATA[>=]]> #{tradingTimeStart}
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and a.jysj <![CDATA[<=]]> #{tradingTimeEnd}
</if>
order by a.xxzjbh,a.jysj desc
<if test="limit != null and limit > 0">
limit #{start},#{limit}
</if>
</select>
<select id="getTradingTimeStatisticsCount" resultType="java.lang.Integer"
parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardParamPojo">
select count(b.bfCardsNum) from (
select a.bfkh as bfCardsNum, date_format(a.jysj, '%Y-%m-%d') as tradingTimeStart
from tb_zjlxxzx a
<where>
a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
<if test="bfCardsNum != null and bfCardsNum != ''">
and a.bfkh = #{bfCardsNum}
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[>=]]> #{tradingTimeStart}
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[<=]]> #{tradingTimeEnd}
</if>
</where>
group by a.bfkh, tradingTimeStart) b
</select>
<select id="getTradingFrequencyStatistics"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.JypdTj"
parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardParamPojo">
select * from ( select distinct a.bfkh as bfCardsNum,a.dfkh as dfCardsNum,count(1) jycsTotal,
sum(zzje) jyzeTotal, sum(case jcbz when '转入' then zzje else 0 end) zrjyzeTotal,
sum(case jcbz when '转出' then zzje else 0 end) zcjyzeTotal
from tb_zjlxxzx a
where a.xxsc_pdbz='0'
<if test="taskIdList != null ">
and a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
</if>
<if test="bfCardsNum != null and bfCardsNum != ''">
and a.bfkh = #{bfCardsNum}
</if>
<if test="dfCardsNum != null and dfCardsNum != ''">
and a.dfkh = #{dfCardsNum}
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[>=]]> #{tradingTimeStart}
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[<=]]> #{tradingTimeEnd}
</if>
group by a.bfkh,a.dfkh
<if test="orderField != null and orderField != ''">
order by ${orderField}
</if>
<if test="orderField == null or orderField == ''">
order by a.bfkh,a.dfkh
</if>
) cc
<if test="limit != null and limit > 0">
limit #{page},#{limit}
</if>
</select>
<select id="getTradingFrequencyCount" resultType="java.lang.Integer">
select count(*) from ( select a.bfkh as bfCardsNum,a.dfkh as dfCardsNum
from tb_zjlxxzx a
where a.xxsc_pdbz='0'
<if test="taskIdList != null ">
and a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
</if>
<if test="bfCardsNum != null and bfCardsNum != ''">
and a.bfkh = #{bfCardsNum}
</if>
<if test="dfCardsNum != null and dfCardsNum != ''">
and a.dfkh = #{dfCardsNum}
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[>=]]> #{tradingTimeStart}
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[<=]]> #{tradingTimeEnd}
</if>
group by a.bfkh,a.dfkh order by a.bfkh,a.dfkh ) cc
</select>
<select id="getJyTotalBybfkhAndDfkh" resultType="java.lang.Integer">
select distinct a.bfkh as bfCardsNum,a.dfkh as dfCardsNum
from tb_zjlxxzx a
where a.xxsc_pdbz='0'
<if test="taskIdList != null ">
and a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
</if>
<if test="bfCardsNum != null and bfCardsNum != ''">
and a.bfkh = #{bfCardsNum}
</if>
<if test="dfCardsNum != null and dfCardsNum != ''">
and a.dfkh = #{dfCardsNum}
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[>=]]> #{tradingTimeStart}
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[<=]]> #{tradingTimeStart}
</if>
</select>
<select id="getZcjyyh" resultType="java.lang.String">
select a.jyyh
from tb_zjlxxzx a where a.xxsc_pdbz='0'
and a.bfkh = #{bfkh}
<if test="taskIdList != null ">
and a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
</if>
<if test="startTime != null and startTime != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') > #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[<]]> #{endTime}
</if>
group by a.jyyh order by count(a.jyyh) desc limit 0,1
</select>
<select id="getEarlyTimelist" resultType="java.lang.String">
select min(date_format(a.jysj, '%H:%i:%S'))
from tb_zjlxxzx a where a.xxsc_pdbz='0'
<if test="taskIdList != null ">
and a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
</if>
<if test="bfkh != null and bfkh != ''">
and a.bfkh = #{bfkh}
</if>
<if test="startTime != null and startTime != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') > #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[<]]> #{endTime}
</if>
group by a.bfkh, date_format(a.jysj, '%Y-%m-%d')
</select>
<select id="getLastTimelist" resultType="java.lang.String">
select Max(date_format(a.jysj, '%H:%i:%S'))
from tb_zjlxxzx a where a.xxsc_pdbz='0'
<if test="taskIdList != null ">
and a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
</if>
<if test="bfkh != null and bfkh != ''">
and a.bfkh = #{bfkh}
</if>
<if test="startTime != null and startTime != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') > #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[<]]> #{endTime}
</if>
group by a.bfkh, date_format(a.jysj, '%Y-%m-%d')
</select>
<select id="getBankByTaskid" resultType="java.lang.String">
select * from (select distinct a.bfkh yhkh
from tb_zjlxxzx a where a.xxsc_pdbz='0'
<if test="taskIdList != null ">
and a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
</if>
<if test="bfCardsNum != null and bfCardsNum != ''">
and a.bfkh = #{bfCardsNum}
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') > #{tradingTimeStart}
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[<]]> #{tradingTimeEnd}
</if>
) bb order by bb.yhkh desc
<if test="limit != null and limit >0">
limit #{page},#{limit}
</if>
</select>
<select id="getBankByTaskidCount" resultType="java.lang.Integer">
select COUNT(*) from (select distinct a.bfkh yhkh
from tb_zjlxxzx a where a.xxsc_pdbz='0'
<if test="taskIdList != null ">
and a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
</if>
<if test="bfCardsNum != null and bfCardsNum != ''">
and a.bfkh = #{bfCardsNum}
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') > #{tradingTimeStart}
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[<]]> #{tradingTimeEnd}
</if>
) bb
</select>
<select id="getTransactionCardAndTime" resultType="java.util.Map"
parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardParamPojo">
select a.bfkh as "bfCardsNum",
date_format(a.jysj, '%H') as "tradingTimeHour"
from tb_zjlxxzx a
where a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
<if test="bfCardsNum != null and bfCardsNum != ''">
and a.bfkh = #{bfCardsNum}
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and a.jysj <![CDATA[>=]]> #{tradingTimeStart}
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and a.jysj <![CDATA[<=]]> #{tradingTimeEnd}
</if>
</select>
<select id="getTradingTimeStatisticsList"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardNumPojo"
parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardParamPojo">
select a.bfkh as bfCardsNum, date_format(a.jysj, '%Y-%m-%d') as tradingTimeStart, count(a.bfkh) as transCount
from tb_zjlxxzx a
<where>
a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
<if test="bfCardsNum != null and bfCardsNum != ''">
and a.bfkh = #{bfCardsNum}
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and a.jysj <![CDATA[>=]]> #{tradingTimeStart}
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and a.jysj <![CDATA[<=]]> #{tradingTimeEnd}
</if>
</where>
group by a.bfkh, tradingTimeStart order by a.bfkh,transCount desc
<if test="limit != null and limit > 0">
limit #{start},#{limit}
</if>
</select>
<select id="getAllTradList" resultType="java.util.Map"
parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardParamPojo">
SELECT a.bfkh AS "bfCardsNum", date_format(a.jysj, '%Y-%m-%d') AS "tradingTime"
FROM tb_zjlxxzx a
WHERE a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
<if test="bfCardsNum != null and bfCardsNum != ''">
and a.bfkh = #{bfCardsNum}
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and a.jysj <![CDATA[>=]]> #{tradingTimeStart}
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and a.jysj <![CDATA[<=]]> #{tradingTimeEnd}
</if>
order by a.bfkh, a.jysj
</select>
<select id="getTradingBankList" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardNumPojo"
parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardParamPojo">
select a.bfkh as bfCardsNum,a.dfkh as dfCardsNum, a.jyyh as tradingBankName
from tb_zjlxxzx a
<where>
a.ssrwbh in
<foreach collection="taskIdList" separator="," item="item" open="(" close=")" index="index">
#{item}
</foreach>
<if test="bfCardsNum != null and bfCardsNum != ''">
and a.bfkh = #{bfCardsNum}
</if>
<if test="dfCardsNum != null and dfCardsNum != ''">
and a.dfkh = #{dfCardsNum}
</if>
<if test="tradingBankName != null and tradingBankName != ''">
and a.jyyh like '%${tradingBankName}%'
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') > #{tradingTimeStart}
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and date_format(a.jysj,'%Y-%m-%d %H:%i:%S') <![CDATA[<]]> #{tradingTimeEnd}
</if>
</where>
</select>
<select id="selectJyyeglList"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZjlxxzx">
SELECT djsj as djsj,
gxsj as gxsj,
xxsc_pdbz as xxscPdbz,
xxdjdw_gajgjgdm as xxdjdwGajgjgdm,
xxdjdw_gajgmc as xxdjdwGajgmc,
xxdjry_gmsfhm as xxdjryGmsfhm,
xxdjry_lxdh as xxdjryLxdh,
xxdjry_xm as xxdjryXm,
xxczdw_gajgjgdm as xxczdwGajgjgdm,
xxczdw_gajgmc as xxczdwGajgmc,
xxczry_gmsfhm as xxczryGmsfhm,
xxczry_lxdh as xxczryLxdh,
xxczry_xm as xxczryXm,
xxzjbh as xxzjbh,
bfkh as bfkh,
bfzhmc as bfzhmc,
dfkh as dfkh,
dfmc as dfmc,
jysj as jysj,
zzje as zzje,
zhye as zhye,
jcbz as jcbz,
jyyh as jyyh,
jyfs as jyfs,
jylsh as jylsh,
ssrwbh as ssrwbh
FROM tb_zjlxxzx
where xxsc_pdbz='0' AND ssrwbh IN (SELECT XXZJBH FROM tb_zxrwb WHERE tb_zxrwb.xxsc_pdbz = '0')
<if test="list != null ">
and (bfkh in
<foreach collection="list" item="item" index="index" open="(" separator=","
close=")">
#{item}
</foreach>
or dfkh in
<foreach collection="list" item="item" index="index" open="(" separator=","
close=")">
#{item}
</foreach>
)
</if>
<!-- and ( bfkh = #{ bfkh , jdbcType=VARCHAR } or dfkh = #{ bfkh , jdbcType=VARCHAR } )-->
order by djsj desc
limit #{page} ,#{limit}
</select>
<select id="selectJyxxjsList" parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZjlxxzx"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZjlxxzx">
SELECT djsj as djsj,
gxsj as gxsj,
xxsc_pdbz as xxscPdbz,
xxdjdw_gajgjgdm as xxdjdwGajgjgdm,
xxdjdw_gajgmc as xxdjdwGajgmc,
xxdjry_gmsfhm as xxdjryGmsfhm,
xxdjry_lxdh as xxdjryLxdh,
xxdjry_xm as xxdjryXm,
xxczdw_gajgjgdm as xxczdwGajgjgdm,
xxczdw_gajgmc as xxczdwGajgmc,
xxczry_gmsfhm as xxczryGmsfhm,
xxczry_lxdh as xxczryLxdh,
xxczry_xm as xxczryXm,
xxzjbh as xxzjbh,
bfkh as bfkh,
bfzhmc as bfzhmc,
dfkh as dfkh,
dfmc as dfmc,
jysj as jysj,
zzje as zzje,
zhye as zhye,
jcbz as jcbz,
jyyh as jyyh,
ssrwbh as ssrwbh,
jyfs as jyfs,
jylsh as jylsh
FROM tb_zjlxxzx
where xxsc_pdbz = '0'
AND ssrwbh IN (SELECT XXZJBH FROM tb_zxrwb WHERE tb_zxrwb.xxsc_pdbz = '0')
and (bfkh = #{ bfkh , jdbcType=VARCHAR } or dfkh = #{ bfkh , jdbcType=VARCHAR })
order by djsj desc
limit #{page}, #{limit}
</select>
<select id="getZjlAllBySsrwbh" resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.AjThKshfxPojo">
SELECT #{ ssrwbh , jdbcType=VARCHAR } as id,
#{ ssrwbh , jdbcType=VARCHAR } as name,
'转出' as jcbz,
bfkh as parentId,
'' as parentName,
'' as value,
'zjl' as type,
'group' as parentType
FROM tb_zjlxxzx
where xxsc_pdbz = '0' and ssrwbh = #{ ssrwbh , jdbcType=VARCHAR }
group by bfkh
union
SELECT bfkh as id,
any_value(concat(bfzhmc, ':', bfkh)) as name,
jcbz as jcbz,
dfkh as parentId,
any_value(concat(dfmc, ':', dfkh)) as parentName,
concat('次数:', count(*), ',金额:', abs(sum(zzje))) as value,
'zjl' as type,
'group' as parentType
FROM tb_zjlxxzx
where xxsc_pdbz = '0' and ssrwbh = #{ ssrwbh , jdbcType=VARCHAR }
group by bfkh, dfkh, jcbz
</select>
<select id="getTransactionStatisticsList"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardNumPojo"
parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.BankCardNumPojo">
SELECT a.xxzjbh AS taskId,
a.djsj as taskCreatedTime,
a.zwmc AS taskName,
count(DISTINCT b.bfkh) as bfCardsCount,
count(DISTINCT b.dfkh) as dfCardsCount,
count(DISTINCT b.jyyh) as bankCount,
CONCAT(min(b.jysj), '~', max(b.jysj)) as transactionRange,
count(b.xxzjbh) as allDataCount
FROM tb_zxrwb a left join tb_zjlxxzx b on a.xxzjbh = b.ssrwbh and b.xxsc_pdbz = '0'
<where>
a.xxsc_pdbz = '0'
<if test="taskName != null and taskName != ''">
and a.zwmc like '%${taskName}%'
</if>
<if test="bfCardsNum != null and bfCardsNum != ''">
and b.bfkh = #{bfCardsNum}
</if>
<if test="bfCardsName != null and bfCardsName != ''">
and b.bfzhmc like '%${bfCardsName}%'
</if>
<if test="dfCardsNum != null and dfCardsNum != ''">
and b.dfkh = #{dfCardsNum}
</if>
<if test="dfCardsName != null and dfCardsName != ''">
and b.dfmc like '%${dfCardsName}%'
</if>
<if test="tradingTimeStart != null and tradingTimeStart != ''">
and b.jysj <![CDATA[>=]]> DATE_FORMAT(#{tradingTimeStart,jdbcType=VARCHAR},'%Y-%m-%d')
</if>
<if test="tradingTimeEnd != null and tradingTimeEnd != ''">
and b.jysj <![CDATA[<=]]> (DATE_FORMAT(#{tradingTimeEnd,jdbcType=VARCHAR},'%Y-%m-%d'))
</if>
</where>
GROUP BY a.xxzjbh, a.djsj, a.zwmc order by a.djsj desc, a.xxzjbh
<if test="limit != null and limit > 0">
limit #{page},#{limit}
</if>
</select>
<!-- 获取-->
<select id="getJtxxByxxzjbh" parameterType="java.lang.String"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZxrwb">
SELECT zwmc as zwmc
FROM tb_zxrwb
where xxzjbh = #{xxzjbh,jdbcType=VARCHAR}
and xxsc_pdbz = '0'
</select>
<!--导出资金流列表-->
<select id="dcZjlList" parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZjlxxzx"
resultType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZjlxxExcel">
SELECT bfkh as bfkh,
bfzhmc as bfzhmc,
dfkh as dfkh,
dfmc as dfmc,
jysj as jysj,
zzje as zzje,
zhye as zhye,
jcbz as jcbz,
jyfs as jyfs,
jylsh as jylsh,
jyzy as jyzy,
jyyh as jyyh
FROM tb_zjlxxzx
where xxsc_pdbz = '0'
and bfkh = #{ bfkh , jdbcType=VARCHAR }
and ssrwbh = #{ ssrwbh , jdbcType=VARCHAR }
</select>
<!-- 录入 任务的数据-->
<insert id="insertJtrw" parameterType="com.founder.commonutils.model.newPublicEntity.ztypEntity.TbZxrwb">
INSERT INTO tb_zxrwb ( djsj
, gxsj
, xxsc_pdbz
, xxdjdw_gajgjgdm
, xxdjdw_gajgmc
, xxdjry_gmsfhm
, xxdjry_lxdh
, xxdjry_xm
, xxczdw_gajgjgdm
, xxczdw_gajgmc
, xxczry_gmsfhm
, xxczry_lxdh
, xxczry_xm
, xxzjbh
, zwmc
, zwms)
VALUES ( now()
, #{ gxsj , jdbcType=VARCHAR }
, '0'
, #{ xxdjdwGajgjgdm , jdbcType=VARCHAR }
, #{ xxdjdwGajgmc , jdbcType=VARCHAR }
, #{ xxdjryGmsfhm , jdbcType=VARCHAR }
, #{ xxdjryLxdh , jdbcType=VARCHAR }
, #{ xxdjryXm , jdbcType=VARCHAR }
, #{ xxczdwGajgjgdm , jdbcType=VARCHAR }
, #{ xxczdwGajgmc , jdbcType=VARCHAR }
, #{ xxczryGmsfhm , jdbcType=VARCHAR }
, #{ xxczryLxdh , jdbcType=VARCHAR }
, #{ xxczryXm , jdbcType=VARCHAR }
, #{ xxzjbh , jdbcType=VARCHAR }
, #{ zwmc , jdbcType=VARCHAR }
, #{ zwms , jdbcType=VARCHAR })
</insert>
</mapper>
package com.founder.publicapi.service;
import com.founder.commonutils.model.newPublicEntity.SysUser;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.*;
import org.springframework.web.multipart.MultipartFile;
import java.text.ParseException;
import java.util.List;
import java.util.Map;
/**
* @author yangyang
* @date 2023/09/21
*/
public interface TbZjlxxServcie {
// 获取最新资金表信息 列表
List<TbZjlxxzx> getZxzjbList(TbZjlxxzx tbZjlxxzx) throws Exception;
List<TbZjlxxzx> selectJyxxjsList(TbZjlxxzx tbZjlxxzx);
int selectJyxxjsListCount(TbZjlxxzx tbZjlxxzx);
List<TbZjlxxzx> selectJyywglList(List<String> list, int page, int limit);
int selectJyywglCount(List<String> list, int page, int limit);
List<String> getKyfwbshListByAsjbh(JyxxJsPojo jyxxJsPojo);
Map<String, Object> getTransactionDetailByTaskId(BankCardParamPojo requestParam);
Map<String, Object> getTradingTimeStatistics(BankCardParamPojo requestParam) throws ParseException;
Map<String, Object> getTradingHabitStatistics(BankCardParamPojo requestParam);
Map<String, Object> getTradingFrequencyStatistics(BankCardParamPojo requestParam);
Map<String, Object> getTradingLocationStatistics(BankCardParamPojo requestParam);
Map<String, Object> getJwdAnly(BankCardParamPojo requestParam);
Map<String, Object> getZjlkshBySsrwbh(String ssrwbh);
Map<String, Object> getTradingRelationship(BankCardParamPojo requestParam);
Map<String, Object> getTransactionStatistics(BankCardNumPojo bankCard);
// 获取任务信息 列表
List<TbZxrwb> getJtrwList(TbZxrwb tbZxrwb) throws Exception;
// 获取任务信息 个数
int getJtrwCount(TbZxrwb tbZxrwb) throws Exception;
List<?> getExcelList(BankCardParamPojo bankCardParamPojo) throws ParseException;
List<String> getHeadNameList(BankCardParamPojo bankCardParamPojo);
List<String> getHeadIdList(BankCardParamPojo bankCardParamPojo);
TbZxrwb getJtxxByxxzjbh(String xxzjbh) throws Exception;
List readAndSaveExcel(MultipartFile file, String xxzjbh);
void insertSave(List<TbZjlxxzx> data, String xxzjbh, SysUser sysUser);
//导出资金表信息列表
List<TbZjlxxExcel> dcZjlList(TbZjlxxzx tbZjlxxzx) throws Exception;
//删除资金流
int deleteZjlByBfkh(TbZjlxxzx tbZjlxxzx, SysUser sysUser);
// 录入任务信息
String insertJtrw(TbZxrwb tbZxrwb, SysUser user) throws Exception;
}
package com.founder.publicapi.service.serviceimpl;
import com.founder.publicapi.mapper.mysqlMapper.SysXxzjbhMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
@Service
public class SysXxzjbhService {
@Autowired
private SysXxzjbhMapper sysXxzjbhMapper;
/**
* 根据传入的单位代码和日期,生成对应的信息主键编号,返回编号长度为30位。
*
* @param unitCode
* @param time 格式(yyyyMMdd '20210309')
* @return 30位长度主键
*/
public String getXxzjbh(String unitCode, String time) {
String xxzjbh = "";
try {
SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
if (!StringUtils.hasText(unitCode)) {
throw new RuntimeException("单位代码为空,不能生成信息主键编号");
} else if (!StringUtils.hasText(time)) {
time = format.format(new Date());
}
xxzjbh = sysXxzjbhMapper.getXxzjbh(unitCode, time);
} catch (Exception e) {
e.printStackTrace();
}
return xxzjbh;
}
public String getXxzjbh(String unitCode) {
return getXxzjbh(unitCode, "");
}
/**
* 根据传入的单位代码和日期,生成对应的信息主键编号,返回编号长度为23位。也可以用来生成人员编号等主键,需要传入对应的表名和编号前缀(人员:P,案件:A,)
*
* @param unitCode
* @param time 格式(yyyyMMdd '202103')
* @param tableName 行为表名
* @param prefix 前缀
* @return 23位长度主键
*/
public String getZcxwYwbh(String unitCode, String time, String tableName, String prefix) {
String xxzjbh = "";
SimpleDateFormat format = new SimpleDateFormat("yyyyMM");
if (StringUtils.isEmpty(unitCode)) {
throw new RuntimeException("单位代码为空,不能生成信息主键编号");
} else if (StringUtils.isEmpty(time)) {
time = format.format(new Date());
} else {
try {
format.parse(time);
} catch (ParseException e) {
time = format.format(new Date());
e.printStackTrace();
}
}
xxzjbh = sysXxzjbhMapper.getZcxwYwzj(unitCode, time, tableName, prefix);
return xxzjbh;
}
}
package com.founder.publicapi.service.serviceimpl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.founder.commonutils.model.newPublicEntity.SysUser;
import com.founder.commonutils.model.newPublicEntity.ztypEntity.*;
import com.founder.commonutils.util.AddressPoiUtil;
import com.founder.commonutils.util.ExcelUtil;
import com.founder.publicapi.mapper.mysqlMapper.TbZjlxxMapper;
import com.founder.publicapi.service.TbZjlxxServcie;
import io.micrometer.core.instrument.util.StringUtils;
import lombok.SneakyThrows;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Service
public class TbZjlxxServcieImpl implements TbZjlxxServcie {
@Autowired
private TbZjlxxMapper tbZjlxxMapper;
@Autowired
private SysXxzjbhService xxzjbhService;
@Autowired
AddressPoiUtil addressPoiUtil;
// 根据任务编号,分页查询最新资金表的数据
@Override
public List<TbZjlxxzx> getZxzjbList(TbZjlxxzx tbZjlxxzx) throws Exception {
List<TbZjlxxzx> zxzjbList = tbZjlxxMapper.getZxzjbList(tbZjlxxzx);
ArrayList<TbZjlxxzx> tbZjlxxzxes = removeDuplicateUser(zxzjbList);
return tbZjlxxzxes;
}
@Override
public Map<String, Object> getTransactionDetailByTaskId(BankCardParamPojo requestParam) {
Map<String, Object> result = new HashMap<>(16);
int start = (requestParam.getPage() - 1) * requestParam.getLimit();
requestParam.setStart(start);
int totalCount = tbZjlxxMapper.getTransactionCountByTaskId(requestParam);
result.put("total", totalCount);
if (totalCount > 0) {
List<BankCardNumPojo> records = tbZjlxxMapper.getTransactionDetailByTaskId(requestParam);
result.put("rows", records);
}
return result;
}
@Override
public Map<String, Object> getTradingTimeStatistics(BankCardParamPojo requestParam) throws ParseException {
Map<String, Object> result = new HashMap<>(16);
int page = requestParam.getPage();
if (page > 0) {
requestParam.setPage((page - 1) * requestParam.getLimit());
requestParam.setStart((page - 1) * requestParam.getLimit());
}
int totalCount = 0;
List<?> records = new ArrayList<>();
if ("01".equals(requestParam.getAnalysisFrequency())) {
/* totalCount = tbZjlxxMapper.getTransactionCountByTaskId(requestParam);
if (totalCount > 0) {
records = tbZjlxxMapper.getTransactionDetailByTaskId(requestParam);
}*/
List<Map<String, Object>> allTransaction = tbZjlxxMapper.getTransactionCardAndTime(requestParam);
Set<String> bfCardsSet = new TreeSet<>();
for (Map<String, Object> allTrad : allTransaction) {
bfCardsSet.add(allTrad.get("bfCardsNum").toString());
}
List<Map<String, Object>> newRecords = new ArrayList<>();
for (String bfCardNum : bfCardsSet) {
Map<String, Object> resultMap = new HashMap<>(32);
resultMap.put("bfCardsNum", bfCardNum);
Map<String, Integer> sortMap = initMapKeyAndValue("hour");
for (Map<String, Object> allTrad : allTransaction) {
if (bfCardNum.equals(allTrad.get("bfCardsNum").toString())) {
String tradingTime = String.valueOf(allTrad.get("tradingTimeHour"));
if (sortMap.get(tradingTime) == null || sortMap.get(tradingTime) == 0) {
sortMap.put(tradingTime, 1);
} else {
sortMap.put(tradingTime, sortMap.get(tradingTime) + 1);
}
}
}
for (Map.Entry<String, Integer> entry : sortMap.entrySet()) {
resultMap.put(entry.getKey(), entry.getValue());
}
newRecords.add(resultMap);
}
totalCount = newRecords.size();
int start = requestParam.getStart();
int end = start + requestParam.getLimit();
if (start == 0 && end == 0) {
StringBuilder sb = new StringBuilder();
List<List<Object>> viewArray = new ArrayList<>();
for (Map<String, Object> resultMap : newRecords) {
List<Object> resultArray = new ArrayList<>();
resultArray.add(resultMap.get("bfCardsNum"));
for (int i = 0; i < 24; i++) {
String key;
if (i < 10) {
key = sb.append("0").append(i).toString();
sb.delete(0, sb.length());
} else {
key = String.valueOf(i);
}
resultArray.add(resultMap.get(key));
}
viewArray.add(resultArray);
}
records = viewArray;
} else if (start < totalCount) {
if (end < totalCount) {
records = newRecords.subList(start, end);
} else {
records = newRecords.subList(start, totalCount);
}
}
} else if ("02".equals(requestParam.getAnalysisFrequency())) {
totalCount = tbZjlxxMapper.getTradingTimeStatisticsCount(requestParam);
if (totalCount > 0) {
List<BankCardNumPojo> resultList = tbZjlxxMapper.getTradingTimeStatisticsList(requestParam);
if (page == 0 && requestParam.getLimit() == 0) {
List<List<BankCardNumPojo>> newRecords = sortRecordsByTime(resultList);
records = newRecords;
} else {
records = resultList;
}
}
} else if ("03".equals(requestParam.getAnalysisFrequency())) {
List<BankCardNumPojo> allRecords = new ArrayList<>();
List<Map<String, Object>> allTradList = tbZjlxxMapper.getAllTradList(requestParam);
Set<String> bfCardsSet = new TreeSet<>();
for (Map<String, Object> allTrad : allTradList) {
bfCardsSet.add(allTrad.get("bfCardsNum").toString());
}
SimpleDateFormat weekSdf = new SimpleDateFormat("EEEE");
SimpleDateFormat timeSdf = new SimpleDateFormat("yyyy-MM-dd");
for (String bfCardNum : bfCardsSet) {
BankCardNumPojo bankCardNumPojo = new BankCardNumPojo();
bankCardNumPojo.setBfCardsNum(bfCardNum);
Map<String, Integer> tradingByWeekDay = initMapKeyAndValue("week");
for (Map<String, Object> allTrad : allTradList) {
if (bfCardNum.equals(allTrad.get("bfCardsNum"))) {
String tradingTime = String.valueOf(allTrad.get("tradingTime"));
String weekStr = weekSdf.format(timeSdf.parse(tradingTime));
if (tradingByWeekDay.get(weekStr) == null || tradingByWeekDay.get(weekStr) == 0) {
tradingByWeekDay.put(weekStr, 1);
} else {
tradingByWeekDay.put(weekStr, tradingByWeekDay.get(weekStr) + 1);
}
}
}
bankCardNumPojo.setTransCountMon(tradingByWeekDay.get("Monday").toString());
bankCardNumPojo.setTransCountTues(tradingByWeekDay.get("Tuesday").toString());
bankCardNumPojo.setTransCountWednes(tradingByWeekDay.get("Wednesday").toString());
bankCardNumPojo.setTransCountThurs(tradingByWeekDay.get("Thursday").toString());
bankCardNumPojo.setTransCountFri(tradingByWeekDay.get("Friday").toString());
bankCardNumPojo.setTransCountSatur(tradingByWeekDay.get("Saturday").toString());
bankCardNumPojo.setTransCountSun(tradingByWeekDay.get("Sunday").toString());
allRecords.add(bankCardNumPojo);
}
totalCount = allRecords.size();
int start = requestParam.getStart();
int end = start + requestParam.getLimit();
if (start == 0 && end == 0) {
records = allRecords;
} else if (start < totalCount) {
if (end < totalCount) {
records = allRecords.subList(start, end);
} else {
records = allRecords.subList(start, totalCount);
}
}
}
result.put("rows", records);
result.put("total", totalCount);
return result;
}
private List<List<BankCardNumPojo>> sortRecordsByTime(List<BankCardNumPojo> records) {
Set<String> bankCardList = new HashSet<>();
Set<String> dateSet = new HashSet<>();
List<List<BankCardNumPojo>> newRecords = new ArrayList<>();
for (BankCardNumPojo bankCard : records) {
bankCardList.add(bankCard.getBfCardsNum());
dateSet.add(bankCard.getTradingTimeStart());
}
for (String bankCardStr : bankCardList) {
List<BankCardNumPojo> bankCardByCardNum = new ArrayList<>();
List<String> timeList = new ArrayList<>();
for (BankCardNumPojo bankCard : records) {
if (bankCardStr.equals(bankCard.getBfCardsNum())) {
bankCardByCardNum.add(bankCard);
timeList.add(bankCard.getTradingTimeStart());
}
}
for (String timeSetItem : dateSet) {
if (!timeList.contains(timeSetItem)) {
BankCardNumPojo newBankCard = new BankCardNumPojo();
newBankCard.setBfCardsNum(bankCardStr);
newBankCard.setTradingTimeStart(timeSetItem);
newBankCard.setTransCount("0");
bankCardByCardNum.add(newBankCard);
}
}
newRecords.add(bankCardByCardNum);
}
for (List<BankCardNumPojo> bankArray : newRecords) {
Collections.sort(bankArray, new Comparator<BankCardNumPojo>() {
@SneakyThrows
@Override
public int compare(BankCardNumPojo o1, BankCardNumPojo o2) {
String o1Time = o1.getTradingTimeStart();
String o2Time = o2.getTradingTimeStart();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Long timeDiff = sdf.parse(o1Time).getTime() - sdf.parse(o2Time).getTime();
if (timeDiff > 0) {
return 1;
} else if (timeDiff == 0) {
return 0;
}
return -1;
}
});
}
return newRecords;
}
@Override
public Map<String, Object> getTradingHabitStatistics(BankCardParamPojo requestParam) {
Map<String, Object> resultMap = new HashMap<>();
int page = requestParam.getPage();
requestParam.setPage((page - 1) * requestParam.getLimit());
requestParam.setStart((page - 1) * requestParam.getLimit());
List<Map<String, Object>> records = new ArrayList<>();
List<String> banks = tbZjlxxMapper.getBankByTaskid(requestParam);
int total = tbZjlxxMapper.getBankByTaskidCount(requestParam);
// String[] banks=requestParam.getBfCardsNum().split(",");
for (String bank : banks) {
Map<String, Object> result = new HashMap<>(16);
List<String> earliestTimelist = tbZjlxxMapper.getEarlyTimelist(requestParam.getTaskIdList(), bank, requestParam.getTradingTimeStart(), requestParam.getTradingTimeEnd());
String avgEarliestTime = getAvgTime(earliestTimelist);
List<String> lastTimelist = tbZjlxxMapper.getLastTimelist(requestParam.getTaskIdList(), bank, requestParam.getTradingTimeStart(), requestParam.getTradingTimeEnd());
String avgLastTime = getAvgTime(lastTimelist);
String jcjyyh = tbZjlxxMapper.getZcjyyh(requestParam.getTaskIdList(), bank, requestParam.getTradingTimeStart(), requestParam.getTradingTimeEnd());
result.put("bfkh", bank);
result.put("avgEarliestTime", avgEarliestTime);
result.put("avgLastestTime", avgLastTime);
result.put("jcszd", "");
result.put("jcccd", "");
result.put("jcjyyh", jcjyyh);
records.add(result);
}
resultMap.put("rows", records);
resultMap.put("total", total);
return resultMap;
}
private String getAvgTime(List<String> earliestTimelist) {
if (earliestTimelist != null && earliestTimelist.size() > 0) {
int totalSeconds = 0;
for (String timeStr : earliestTimelist) {
if (timeStr.contains(":")) {
int totalSecond = 0;
String[] timeSplit = timeStr.split(":");
String hourStr = "00";
String minuteStr = "00";
String secondStr = "00";
if (timeSplit.length > 0) {
hourStr = timeSplit[0];
}
if (timeSplit.length > 1) {
minuteStr = timeSplit[1];
}
if (timeSplit.length > 2) {
secondStr = timeSplit[2];
}
totalSecond = Integer.valueOf(hourStr) * 60 * 60 + Integer.valueOf(minuteStr) * 60 +Integer.valueOf(secondStr);
totalSeconds += totalSecond;
}
}
int avgSecond = totalSeconds / earliestTimelist.size();
int hour = avgSecond / 3600;
int minute = avgSecond % 3600 / 60;
int second = avgSecond % 3600 % 60;
return (hour >= 10 ? ("" + hour) : ("0" + hour)) + ":" + (minute >= 10 ? ("" + minute) : ("0" + minute)) + ":" + (second >= 10 ? ("" + second) : ("0" + second));
}
return "";
}
@Override
public Map<String, Object> getTradingFrequencyStatistics(BankCardParamPojo requestParam) {
Map<String, Object> resultMap = new HashMap<>();
int page = requestParam.getPage();
requestParam.setPage((page - 1) * requestParam.getLimit());
requestParam.setStart((page - 1) * requestParam.getLimit());
int total = tbZjlxxMapper.getTradingFrequencyCount(requestParam);
resultMap.put("total", total);
List<JypdTj> banks = new ArrayList<>();
if (total > 0) {
banks = tbZjlxxMapper.getTradingFrequencyStatistics(requestParam);
}
resultMap.put("rows", banks);
return resultMap;
}
@Override
public Map<String, Object> getTradingLocationStatistics(BankCardParamPojo requestParam) {
Map<String, Object> resultMap = new HashMap<>();
int page = requestParam.getPage();
requestParam.setStart((page - 1) * requestParam.getLimit());
List<BankCardNumPojo> allTraidList = tbZjlxxMapper.getTradingBankList(requestParam);
Set<String> cardSet = new HashSet<>();
List<BankCardNumPojo> records = new ArrayList<>();
for (BankCardNumPojo item : allTraidList) {
if ("01".equals(requestParam.getTraidParty())) {
cardSet.add(item.getBfCardsNum());
} else {
cardSet.add(item.getDfCardsNum());
}
}
for (String cardNum : cardSet) {
Map<String, Integer> sortMap = new HashMap<>(16);
for (BankCardNumPojo item : allTraidList) {
if ("01".equals(requestParam.getTraidParty())) {
if (cardNum.equals(item.getBfCardsNum())) {
if (sortMap.get(item.getTradingBankName()) == null || sortMap.get(item.getTradingBankName()) == 0) {
sortMap.put(item.getTradingBankName(), 1);
} else {
sortMap.put(item.getTradingBankName(), sortMap.get(item.getTradingBankName()) + 1);
}
}
} else {
if (cardNum.equals(item.getDfCardsNum())) {
if (sortMap.get(item.getTradingBankName()) == null || sortMap.get(item.getTradingBankName()) == 0) {
sortMap.put(item.getTradingBankName(), 1);
} else {
sortMap.put(item.getTradingBankName(), sortMap.get(item.getTradingBankName()) + 1);
}
}
}
}
for (Map.Entry<String, Integer> entry : sortMap.entrySet()) {
BankCardNumPojo cardItem = new BankCardNumPojo();
if ("01".equals(requestParam.getTraidParty())) {
cardItem.setBfCardsNum(cardNum);
} else {
cardItem.setDfCardsNum(cardNum);
}
cardItem.setTradingBankName(entry.getKey());
cardItem.setTransCount(entry.getValue().toString());
records.add(cardItem);
}
}
int totalCount = records.size();
int start = requestParam.getStart();
int end = start + requestParam.getLimit();
if (start < totalCount && requestParam.getLimit() != 0) {
if (end < totalCount) {
records = records.subList(start, end);
} else {
records = records.subList(start, totalCount);
}
}
resultMap.put("total", totalCount);
resultMap.put("rows", records);
return resultMap;
}
@Override
public Map<String, Object> getJwdAnly(BankCardParamPojo requestParam) {
List<BankCardNumPojo> allTranList = tbZjlxxMapper.getTransactionDetailByTaskId(requestParam);
List<String[]> result=new ArrayList<>();
ExecutorService executor = Executors.newFixedThreadPool(50);
List<CompletableFuture<String[]>> futures = new ArrayList<>();
if(allTranList.size()>0) {
for (BankCardNumPojo cardItem : allTranList) {
futures.add(CompletableFuture.supplyAsync(() ->
{
String[] sj = new String[4];
sj[0]=cardItem.getDfCardsNum();
Map<String, String> jdwd=getJdwdxy(cardItem.getTradingBankName());
sj[1]=jdwd.get("x");
sj[2]=jdwd.get("y");
sj[3]=cardItem.getTradingTimeStart();
return sj;
},executor
));
}
}
//等待全部完成
CompletableFuture.allOf(futures.toArray(new CompletableFuture[0])).join();
//获取内容
for (CompletableFuture<String[]> future : futures) {
try {
result.add(future.get());
} catch (Exception e) {
e.printStackTrace();
}
}
Map<String, Object> resultMap = new HashMap<>(16);
resultMap.put("rows", result);
return resultMap;
}
@Override
public Map<String, Object> getZjlkshBySsrwbh(String ssrwbh) {
//定义每一个节点的索引map
HashMap<String, List<AjThKshfxPojo>> hashMap = new HashMap<>();
List<AjThKshfxPojo> zjlList = tbZjlxxMapper.getZjlAllBySsrwbh(ssrwbh);
//过滤进出标志,统一改为转出的类型
for (AjThKshfxPojo pojo : zjlList) {
if ("转入".equals(pojo.getJcbz())) {
//统一改为转出,并互换id和parentId、name和ParentName的值
String parentId = pojo.getId();
pojo.setId(pojo.getParentId());
pojo.setParentId(parentId);
pojo.setJcbz("转出");
String parentName = pojo.getName();
pojo.setName(pojo.getParentName());
pojo.setParentName(parentName);
}
}
//定义根节点
AjThKshfxPojo root = null;
for (AjThKshfxPojo kshfxPojo : zjlList) {
String id = kshfxPojo.getId();
//当root节点为空且当前节点id不为空,设置root为当前节点
if (root == null && StringUtils.isNotEmpty(id)) {
root = kshfxPojo.cloneAjth();
}
//判断索引map中是否存在,存在添加入list中,不存在新建list加入
if (hashMap.containsKey(id)) {
List<AjThKshfxPojo> list = hashMap.get(id);
list.add(kshfxPojo);
} else {
List<AjThKshfxPojo> list = new ArrayList<>();
list.add(kshfxPojo);
hashMap.put(id, list);
}
}
for (AjThKshfxPojo kshfxPojo : zjlList) {
String parentId = kshfxPojo.getParentId();
//把只收到转账信息的银行卡号加入集合
if (!hashMap.containsKey(parentId)) {
List<AjThKshfxPojo> list = new ArrayList<>();
AjThKshfxPojo pojo = new AjThKshfxPojo();
pojo.setId(kshfxPojo.getParentId());
pojo.setParentId(null);
pojo.setName(kshfxPojo.getParentName());
pojo.setParentName(null);
pojo.setValue(kshfxPojo.getValue());
pojo.setType("zjl");
pojo.setParentType("zjl");
list.add(pojo);
hashMap.put(parentId, list);
}
}
//获取团伙返回
return getAccompliceByThMap(ssrwbh, zjlList, root, hashMap);
}
@Override
public Map<String, Object> getTradingRelationship(BankCardParamPojo requestParam) {
Integer commonRelationshipNum = Integer.valueOf(requestParam.getCommonRelationshipNum());
List<BankCardNumPojo> allTranList = tbZjlxxMapper.getTransactionDetailByTaskId(requestParam);
if (commonRelationshipNum > 1) {
StringBuilder sb = new StringBuilder();
Set<String> screenSet = new HashSet<>();
List<String> dfCards = new ArrayList<>();
for (BankCardNumPojo cardNum : allTranList) {
if (org.springframework.util.StringUtils.hasText(cardNum.getBfCardsNum()) && org.springframework.util.StringUtils.hasText(cardNum.getDfCardsNum())) {
String screenKey = sb.append(cardNum.getBfCardsNum()).append("-").append(cardNum.getDfCardsNum()).toString();
sb.delete(0, sb.length());
screenSet.add(screenKey);
}
}
for (String entry : screenSet) {
if (org.springframework.util.StringUtils.hasText(entry) && entry.contains("-")) {
String dfCard = entry.split("-")[1];
dfCards.add(dfCard);
}
}
Map<String, Integer> screenMap = new HashMap<>(screenSet.size());
for (String dfCard : dfCards) {
if (screenMap.get(dfCard) == null || screenMap.get(dfCard) == 0) {
screenMap.put(dfCard, 1);
} else {
screenMap.put(dfCard, screenMap.get(dfCard) + 1);
}
}
dfCards.clear();
for (Map.Entry<String, Integer> entry : screenMap.entrySet()) {
if (entry.getValue() >= commonRelationshipNum) {
dfCards.add(entry.getKey());
}
}
List<BankCardNumPojo> tranList = new ArrayList<>();
for (String dfCard : dfCards) {
for (BankCardNumPojo cardNumItem : allTranList) {
if (dfCard.equals(cardNumItem.getDfCardsNum())) {
tranList.add(cardNumItem);
}
}
}
allTranList = tranList;
}
HashSet<BankCardKshfxPojo> taskList = new HashSet<>();
for (BankCardNumPojo cardItem : allTranList) {
BankCardKshfxPojo taskPojo = new BankCardKshfxPojo();
taskPojo.setId(cardItem.getTaskId());
taskPojo.setRed(true);
taskPojo.setType("task");
taskList.add(taskPojo);
}
for (BankCardKshfxPojo taskItem : taskList) {
Set<BankCardKshfxPojo> bfCards = new HashSet<>();
for (BankCardNumPojo bfCardChild : allTranList) {
if (bfCardChild.getTaskId().equals(taskItem.getId())) {
taskItem.setName(bfCardChild.getTaskName());
BankCardKshfxPojo bfCardPojo = new BankCardKshfxPojo();
bfCardPojo.setId(bfCardChild.getBfCardsNum());
bfCardPojo.setName(bfCardChild.getBfCardsNum());
bfCardPojo.setType("bankCard");
bfCardPojo.setParentType("task");
bfCardPojo.setParentId(bfCardChild.getTaskId());
bfCardPojo.setParentName(bfCardChild.getTaskName());
bfCards.add(bfCardPojo);
}
}
taskItem.setChildren(new ArrayList<>(bfCards));
}
List<BankCardKshfxPojo> dfOutTypeList = new ArrayList<>();
for (BankCardKshfxPojo taskItem : taskList) {
List<BankCardKshfxPojo> bfCards = taskItem.getChildren();
for (BankCardKshfxPojo bfCard : bfCards) {
Set<BankCardKshfxPojo> dfCards = new HashSet<>();
for (BankCardNumPojo dfCard : allTranList) {
if (bfCard.getId().equals(dfCard.getBfCardsNum()) && bfCard.getParentId().equals(dfCard.getTaskId())) {
BankCardKshfxPojo dfCardChild = new BankCardKshfxPojo();
dfCardChild.setId(dfCard.getDfCardsNum());
dfCardChild.setName(dfCard.getDfCardsNum());
dfCardChild.setParentId(bfCard.getId());
dfCardChild.setParentName(bfCard.getName());
dfCardChild.setType("bankCard");
dfCardChild.setParentType("bankCard");
if ("转出".equals(dfCard.getTransferInOrOut())) {
dfCards.add(dfCardChild);
} else {
dfCardChild.setParentId(null);
dfCardChild.setParentName(null);
dfCardChild.setParentType(null);
dfOutTypeList.add(dfCardChild);
}
}
}
bfCard.setChildren(new ArrayList<>(dfCards));
}
}
for (BankCardKshfxPojo dfCardParent : dfOutTypeList) {
Set<BankCardKshfxPojo> bfCards = new HashSet<>();
for (BankCardNumPojo bfCard : allTranList) {
if (dfCardParent.getId().equals(bfCard.getDfCardsNum()) && "转入".equals(bfCard.getTransferInOrOut())) {
BankCardKshfxPojo bfCardChild = new BankCardKshfxPojo();
bfCardChild.setId(bfCard.getBfCardsNum());
bfCardChild.setName(bfCard.getBfCardsNum());
bfCardChild.setParentId(dfCardParent.getId());
bfCardChild.setParentName(dfCardParent.getId());
bfCardChild.setType("bankCard");
bfCardChild.setParentType("bankCard");
bfCards.add(bfCardChild);
}
}
dfCardParent.setChildren(new ArrayList<>(bfCards));
}
taskList.addAll(dfOutTypeList);
Map<String, Object> resultMap = new HashMap<>(16);
resultMap.put("rows", taskList);
return resultMap;
}
/**
* getAccompliceByThMap 获取团伙树返回数据,map中为团伙的root节点
*
* @param ssrwbh: 所属任务编号
* @param zjlList: 资金流的集合
* @param root: root节点
* @param hashMap: 索引map
* @return java.util.Map<java.lang.String, java.lang.Object>
* @author lystar
* 2022/4/22 15:25
*/
private Map<String, Object> getAccompliceByThMap(String ssrwbh, List<AjThKshfxPojo> zjlList, AjThKshfxPojo root, HashMap<String, List<AjThKshfxPojo>> hashMap) {
HashMap<String, Object> resultMap = new HashMap<>();
//id临时表
HashSet<String> idTemp = new HashSet<>();
//安全性校验
if (hashMap.isEmpty() || root == null) {
resultMap.put("rows", new AjThKshfxPojo());
return resultMap;
}
//在索引map中获取根对应的子节点id
List<AjThKshfxPojo> rootChildrenList = hashMap.get(root.getId());
if (rootChildrenList == null || rootChildrenList.isEmpty()) {
resultMap.put("rows", new AjThKshfxPojo());
return resultMap;
}
ArrayList<AjThKshfxPojo> rootChildren = new ArrayList<>();
//通过子节点id拿到子节点的具体数据,添加到root的子节点
for (AjThKshfxPojo rootChild : rootChildrenList) {
List<AjThKshfxPojo> list = hashMap.get(rootChild.getParentId());
if (list != null && !list.isEmpty()) {
rootChildren.addAll(list);
}
}
root.setChildrenList(rootChildren);
//将根节点加入id临时表
idTemp.add(root.getId());
//存入根节点的子节点的子节点id
HashSet<String> rootChildrenPid = new HashSet<>();
for (AjThKshfxPojo pojo : rootChildren) {
rootChildrenPid.add(pojo.getParentId());
}
//处理只给根的子节点转账过的节点,首先获取hashMap的所有id
Set<String> keySet = hashMap.keySet();
for (String key : keySet) {
//该id在hashMap中,若该id不是原来根节点的子节点的子节点,则该节点为只给根的子节点转账过的节点
//排除所属任务编号,即根节点id
if (!rootChildrenPid.contains(key) && !ssrwbh.equals(key)) {
//只给根的子节点转账过的节点
List<AjThKshfxPojo> rootChildrenQt = hashMap.get(key);
//根节点的子节点
List<AjThKshfxPojo> children = root.getChildren();
//把只给根的子节点转账过的节点加入到根节点的子节点
children.addAll(rootChildrenQt);
root.setChildrenList(children);
}
}
//把所有根节点的子节点的子节点存入set集合记录id
HashSet<String> childrenId = new HashSet<>();
List<AjThKshfxPojo> childrenNew = root.getChildren();
for (AjThKshfxPojo child:childrenNew) {
String id = child.getId();
List<AjThKshfxPojo> pojos = hashMap.get(id);
for (AjThKshfxPojo pojo:pojos) {
childrenId.add(pojo.getParentId());
}
}
//若根节点的子节点是其他根节点的子节点,则把该节点从根节点的子节点删除
//做此处理是为了让可视化界面层级相对清晰,不处理也可以
Iterator<AjThKshfxPojo> iterator = childrenNew.iterator();
while (iterator.hasNext()){
String id = iterator.next().getId();
if (childrenId.contains(id)){
iterator.remove();
}
}
//定义一个队列(基于双向链表手动达成队列效果),并将根的子节点加入队列中
LinkedList<AjThKshfxPojo> queue = new LinkedList<>(root.getChildren());
//循环队列
while (!queue.isEmpty()) {
AjThKshfxPojo child = queue.removeFirst();
idTemp.add(child.getId());
//拿到child节点在索引map中的子节点id
List<AjThKshfxPojo> children = hashMap.get(child.getId());
if (children != null && !children.isEmpty()) {
List<AjThKshfxPojo> list = new ArrayList<>();
//通过子节点id拿到对应的子节点
for (AjThKshfxPojo pojo : children) {
List<AjThKshfxPojo> pojoList = hashMap.get(pojo.getParentId());
if (pojoList != null) {
list.addAll(pojoList);
}
}
//若子节点列表不为空,设置child节点的子节点
if (!list.isEmpty()) {
child.setChildrenList(list);
}
//拿到child节点的子节点
List<AjThKshfxPojo> childChildren = child.getChildren();
//若子节点不为空,遍历子节点,若子节点未被使用,加入队列中,准备循环
if (childChildren != null) {
for (AjThKshfxPojo childChild : childChildren) {
//设置每个节点的value值
for (AjThKshfxPojo zjlPojo : zjlList) {
String id = zjlPojo.getId();
String parentId = zjlPojo.getParentId();
if (id.equals(childChild.getParentId()) && parentId.equals(childChild.getId())) {
childChild.setValue(zjlPojo.getValue());
}
}
if (!idTemp.contains(childChild.getId())) {
queue.addLast(childChild);
}
}
}
}
}
//清理多个相同的A节点指向相同的B节点的数据
checkDistinct(queue, root);
//设置根节点的子节点value为空
List<AjThKshfxPojo> children = root.getChildren();
for (AjThKshfxPojo child : children) {
child.setValue("");
}
resultMap.put("rows", root.getChildren());
resultMap.put("total", hashMap.size());
return resultMap;
}
/**
* checkDistinct 清理多个相同的A节点指向相同的B节点的数据 如 A->B、C B->D->E C->D->E 的树将变成A->B、C B->D->E C->D
*
* @param queue: 队列,因getAccompliceByThMap中定义了一个队列,此处直接使用
* @param root: 要清理的树的根节点
* @author lystar
* 2022/4/22 15:34
*/
private void checkDistinct(LinkedList<AjThKshfxPojo> queue, AjThKshfxPojo root) {
//将根加入队列
queue.addLast(root);
//定义临时表做记录
HashSet<String> temp = new HashSet<>();
while (!queue.isEmpty()) {
AjThKshfxPojo pojo = queue.removeFirst();
temp.add(pojo.getId());
//获取pojo节点的子节点
List<AjThKshfxPojo> children = pojo.getChildren();
if (children != null && !children.isEmpty()) {
for (AjThKshfxPojo child : children) {
//遍历子节点,若该子节点的id在其他上级节点中已经被使用(临时表中存在),设置下级节点为空,否则加入队列和临时表
if (temp.contains(child.getId())) {
//设置该子节点的下级节点为空
child.setChildrenList(new ArrayList<>(0));
} else {
//将子节点加入队列和临时表
queue.addLast(child);
temp.add(child.getId());
}
}
}
}
}
private Map<String, String> getJdwdxy(String name){
Map<String, String> res = new HashMap<>();
res.put("x","");
res.put("y","");
String resultToken = "";
try {
resultToken = addressPoiUtil.getData(name, 1, 10);
if (StringUtils.isNotEmpty(resultToken)) {
//解析数据
JSONObject jsonObject = JSON.parseObject(resultToken);
JSONArray arrayResult = jsonObject.getJSONArray("list");// 解析处理
if(arrayResult.size()>0){
JSONObject jsonObject1 = arrayResult.getJSONObject(0);
res.put("x",jsonObject1.getString("x"));
res.put("y",jsonObject1.getString("y"));
}
}
}catch (Exception e){
e.printStackTrace();
}
return res;
}
@Override
public List<String> getKyfwbshListByAsjbh(JyxxJsPojo jyxxJsPojo) {
// if(jyxxJsPojo.getAsjbh()!=null&&!"".equals(jyxxJsPojo.getAsjbh())){
// List<String> asjkhList = tbZjlxxMapper.getKyfwbshListByAsjbh(jyxxJsPojo.getAsjbh());
// }
List<String> list = new ArrayList<>();
if (jyxxJsPojo.getAsjbh() != null && !"".equals(jyxxJsPojo.getAsjbh()) && jyxxJsPojo.getZjhm() != null && !"".equals(jyxxJsPojo.getZjhm())) {
//证件号码与案件编号都不为空
List<String> zjhmkhList = tbZjlxxMapper.getKyfwbshListByZjhm(jyxxJsPojo);
return zjhmkhList;
} else if (jyxxJsPojo.getAsjbh() != null && !"".equals(jyxxJsPojo.getAsjbh()) && (jyxxJsPojo.getZjhm() == null || "".equals(jyxxJsPojo.getZjhm()))) {
//证件号码为空与案件编号不为空
List<String> asjkhList = tbZjlxxMapper.getKyfwbshListByAsjbh(jyxxJsPojo.getAsjbh());
return asjkhList;
} else if ((jyxxJsPojo.getAsjbh() == null || "".equals(jyxxJsPojo.getAsjbh())) && jyxxJsPojo.getZjhm() != null && !"".equals(jyxxJsPojo.getZjhm())) {
//证件号码不为空与案件编号为空
List<String> zjhmkhList = tbZjlxxMapper.getKyfwbshListByZjhm(jyxxJsPojo);
return zjhmkhList;
} else {
//都为空
return list;
}
}
@Override
public Map<String, Object> getTransactionStatistics(BankCardNumPojo bankCard) {
int page = bankCard.getPage();
int limit = bankCard.getLimit();
int start = (page - 1) * limit;
bankCard.setPage(start);
Map<String, Object> result = new HashMap<>();
int totalCount = tbZjlxxMapper.getTransactionStatisticsCount(bankCard);
result.put("total", totalCount);
result.put("rows", new ArrayList<>());
if (totalCount > 0) {
List<BankCardNumPojo> records = tbZjlxxMapper.getTransactionStatisticsList(bankCard);
result.put("rows", records);
}
return result;
}
@Override
public List<TbZjlxxzx> selectJyywglList(List<String> list, int page, int limit) {
List<TbZjlxxzx> result = new ArrayList<>();
if (list != null && list.size() > 0) {
result = tbZjlxxMapper.selectJyyeglList(list, page, limit);
}
return result;
}
@Override
public int selectJyywglCount(List<String> list, int page, int limit) {
if (list != null && list.size() > 0) {
return tbZjlxxMapper.selectJyywglCount(list, page, limit);
} else {
return 0;
}
}
// 任务的列表展示
@Override
public List<TbZxrwb> getJtrwList(TbZxrwb tbZxrwb) throws Exception {
return tbZjlxxMapper.getJtrwList(tbZxrwb);
}
// 任务的个数
@Override
public int getJtrwCount(TbZxrwb tbZxrwb) throws Exception {
return tbZjlxxMapper.getJtrwCount(tbZxrwb);
}
@Override
public List<TbZjlxxzx> selectJyxxjsList(TbZjlxxzx tbZjlxxzx) {
List<TbZjlxxzx> zxzjbList = tbZjlxxMapper.selectJyxxjsList(tbZjlxxzx);
return zxzjbList;
}
@Override
public int selectJyxxjsListCount(TbZjlxxzx tbZjlxxzx) {
return tbZjlxxMapper.selectJyxxjsListCount(tbZjlxxzx);
}
@Override
public List<?> getExcelList(BankCardParamPojo bankCardParamPojo) throws ParseException {
String dataType = bankCardParamPojo.getDataType();
List<?> records = new ArrayList<>();
if ("01".equals(dataType)) {
records = tbZjlxxMapper.getTransactionDetailByTaskId(bankCardParamPojo);
} else if ("02".equals(dataType)) {
records = (List<?>) getTradingTimeStatistics(bankCardParamPojo).get("rows");
} else if ("03".equals(dataType)) {
records = (List<?>) getTradingLocationStatistics(bankCardParamPojo).get("rows");
} else if ("04".equals(dataType)) {
records = tbZjlxxMapper.getTradingFrequencyStatistics(bankCardParamPojo);
} else if ("05".equals(dataType)) {
records = (List<?>) getTradingHabitStatistics(bankCardParamPojo).get("rows");
}
return records;
}
@Override
public List<String> getHeadNameList(BankCardParamPojo bankCardParamPojo) {
String dataType = bankCardParamPojo.getDataType();
List<String> records = new ArrayList<>();
if ("01".equals(dataType)) {
records.add("任务名称");
records.add("本方卡号");
records.add("本方持卡人姓名");
records.add("对方卡号");
records.add("对方持卡人姓名");
records.add("交易时间");
records.add("转账金额");
records.add("账户余额");
records.add("转账类型");
records.add("交易银行");
records.add("交易方式");
records.add("交易流水号");
} else if ("02".equals(dataType)) {
String analysisFrequency = bankCardParamPojo.getAnalysisFrequency();
if ("01".equals(analysisFrequency)) {
records.add("本方卡号");
records.add("0~1");
records.add("1~2");
records.add("2~3");
records.add("3~4");
records.add("4~5");
records.add("5~6");
records.add("6~7");
records.add("7~8");
records.add("8~9");
records.add("9~10");
records.add("10~11");
records.add("11~12");
records.add("12~13");
records.add("13~14");
records.add("14~15");
records.add("15~16");
records.add("16~17");
records.add("17~18");
records.add("18~19");
records.add("19~20");
records.add("20~21");
records.add("21~22");
records.add("22~23");
records.add("23~24");
} else if ("02".equals(analysisFrequency)) {
records.add("本方卡号");
records.add("交易日期");
records.add("交易数");
} else if ("03".equals(analysisFrequency)) {
records.add("本方卡号");
records.add("周一交易次数");
records.add("周二交易次数");
records.add("周三交易次数");
records.add("周四交易次数");
records.add("周五交易次数");
records.add("周六交易次数");
records.add("周日交易次数");
}
} else if ("03".equals(dataType)) {
String traidParty = bankCardParamPojo.getTraidParty();
if ("01".equals(traidParty)) {
records.add("本方卡号");
} else {
records.add("对方卡号");
}
records.add("交易地点");
records.add("交易次数");
} else if ("04".equals(dataType)) {
records.add("本方卡号");
records.add("对方卡号");
records.add("总交易次数");
records.add("转入总额");
records.add("转出总额");
} else if ("05".equals(dataType)) {
records.add("本方卡号");
records.add("平均每日最早交易时间");
records.add("平均每日最晚交易时间");
records.add("经常交易银行");
records.add("经常所在地");
records.add("经常出差地");
}
return records;
}
@Override
public List<String> getHeadIdList(BankCardParamPojo bankCardParamPojo) {
String dataType = bankCardParamPojo.getDataType();
List<String> records = new ArrayList<>();
if ("01".equals(dataType)) {
records.add("taskName");
records.add("bfCardsNum");
records.add("bfCardsName");
records.add("dfCardsNum");
records.add("dfCardsName");
records.add("tradingTimeStart");
records.add("transactionAmount");
records.add("accountBalance");
records.add("transferInOrOut");
records.add("tradingBankName");
records.add("transactionMode");
records.add("transactionNumber");
} else if ("02".equals(dataType)) {
String analysisFrequency = bankCardParamPojo.getAnalysisFrequency();
if ("01".equals(analysisFrequency)) {
records.add("bfCardsNum");
records.add("00");
records.add("01");
records.add("02");
records.add("03");
records.add("04");
records.add("05");
records.add("06");
records.add("07");
records.add("08");
records.add("09");
records.add("10");
records.add("11");
records.add("12");
records.add("13");
records.add("14");
records.add("15");
records.add("16");
records.add("17");
records.add("18");
records.add("19");
records.add("20");
records.add("21");
records.add("22");
records.add("23");
} else if ("02".equals(analysisFrequency)) {
records.add("bfCardsNum");
records.add("tradingTimeStart");
records.add("transCount");
} else if ("03".equals(analysisFrequency)) {
records.add("bfCardsNum");
records.add("transCountMon");
records.add("transCountTues");
records.add("transCountWednes");
records.add("transCountThurs");
records.add("transCountFri");
records.add("transCountSatur");
records.add("transCountSun");
}
} else if ("03".equals(dataType)) {
String traidParty = bankCardParamPojo.getTraidParty();
if ("01".equals(traidParty)) {
records.add("bfCardsNum");
} else {
records.add("dfCardsNum");
}
records.add("tradingBankName");
records.add("transCount");
} else if ("04".equals(dataType)) {
records.add("bfCardsNum");
records.add("dfCardsNum");
records.add("jycsTotal");
records.add("zrjyzeTotal");
records.add("zcjyzeTotal");
} else if ("05".equals(dataType)) {
records.add("bfkh");
records.add("avgEarliestTime");
records.add("avgLastestTime");
records.add("jcjyyh");
records.add("jcszd");
records.add("jcccd");
}
return records;
}
// 任务的list集合
@Override
public TbZxrwb getJtxxByxxzjbh(String xxzjbh) throws Exception {
return tbZjlxxMapper.getJtxxByxxzjbh(xxzjbh);
}
// 读取数据
@Override
public List readAndSaveExcel(MultipartFile file, String xxzjbh) {
List resultList = null;
int totalRowNums = 0;
int abandonFields = 1;
try {
String filename = file.getOriginalFilename();
String postfix = filename.substring(filename.lastIndexOf(".") + 1);
//根据Excel文件后缀读取数据
if (postfix.equals("xls")) {
Map xlsExcelMap = ExcelUtil.readXLSExcel(file.getInputStream(), TbZjlxxzx.class, abandonFields);
resultList = (List) xlsExcelMap.get("dataList");
totalRowNums = (int) xlsExcelMap.get("totalRowNums");
} else {
Map xlsxExcelMap = ExcelUtil.readXLSXExcel(file.getInputStream(), TbZjlxxzx.class, abandonFields);
resultList = (List) xlsxExcelMap.get("dataList");
totalRowNums = (int) xlsxExcelMap.get("totalRowNums");
}
//保存Excel信息数据
// saveExcelInfoInDB(filename, taskId, excelId, username, totalRowNums, postfix);
} catch (Exception e) {
e.printStackTrace();
}
return resultList;
}
@Override
public void insertSave(List<TbZjlxxzx> data, String xxzjbh, SysUser sysUser) {
if (data != null && data.size() > 0) {
for (TbZjlxxzx item : data) {
item.setSsrwbh(xxzjbh);
String zjxxzjbh = xxzjbhService.getXxzjbh(sysUser.getUnitcode(), null);//xxzjbh
item.setXxzjbh(zjxxzjbh);
item.setDjUser(sysUser);
if(judgeTbZjlxxzx(item)){
tbZjlxxMapper.batchInsertZjlByExcel(item);
}
}
// tbZjlxxMapper.batchInsertZjl(data);
}
}
@Override
public List<TbZjlxxExcel> dcZjlList(TbZjlxxzx tbZjlxxzx) throws Exception {
return tbZjlxxMapper.dcZjlList(tbZjlxxzx);
}
@Override
public int deleteZjlByBfkh(TbZjlxxzx tbZjlxxzx, SysUser sysUser) {
if(sysUser!=null && tbZjlxxzx!=null){
tbZjlxxzx.setXxczryXm(sysUser.getTrueName());
tbZjlxxzx.setXxczryGmsfhm(sysUser.getIdentitycard());
tbZjlxxzx.setXxczdwGajgjgdm(sysUser.getUnitcode());
tbZjlxxzx.setXxczdwGajgmc(sysUser.getUnitname());
}
return tbZjlxxMapper.deleteZjlByBfkh(tbZjlxxzx);
}
@Override
public String insertJtrw(TbZxrwb tbZxrwb, SysUser user) throws Exception {
String xxzjbh = xxzjbhService.getXxzjbh(user.getUnitcode(), null);//xxzjbh
tbZxrwb.setXxzjbh(xxzjbh);
tbZxrwb.setDjUser(user);
tbZjlxxMapper.insertJtrw(tbZxrwb);
return xxzjbh;
}
public boolean judgeTbZjlxxzx(TbZjlxxzx tbZjlxxzx){
if(tbZjlxxzx.getBfkh() != null && !"".equals(tbZjlxxzx.getBfkh())){ //本方卡号
return true;
}
if(tbZjlxxzx.getBfzhmc() != null && !"".equals(tbZjlxxzx.getBfzhmc())){ //账户名称
return true;
}
if(tbZjlxxzx.getDfkh() != null && !"".equals(tbZjlxxzx.getDfkh())){ //对手卡号
return true;
}
if(tbZjlxxzx.getDfmc() != null && !"".equals(tbZjlxxzx.getDfmc())){ //对手名称
return true;
}
if(tbZjlxxzx.getJysj() != null && !"".equals(tbZjlxxzx.getJysj())){ //交易时间
return true;
}
if(tbZjlxxzx.getZzje() != null && !"".equals(tbZjlxxzx.getZzje())){ //金额
return true;
}
if(tbZjlxxzx.getZhye() != null && !"".equals(tbZjlxxzx.getZhye())){ //余额
return true;
}
if(tbZjlxxzx.getJcbz() != null && !"".equals(tbZjlxxzx.getJcbz())){ //进出标志
return true;
}
if(tbZjlxxzx.getJyyh() != null && !"".equals(tbZjlxxzx.getJyyh())){ //交易银行
return true;
}
return false;
}
private static ArrayList<TbZjlxxzx> removeDuplicateUser(List<TbZjlxxzx> users) {
Set<TbZjlxxzx> set = new TreeSet<TbZjlxxzx>(new Comparator<TbZjlxxzx>() {
@Override
public int compare(TbZjlxxzx o1, TbZjlxxzx o2) {
//字符串,则按照asicc码升序排列
return o1.getBfkh().compareTo(o2.getBfkh());
}
});
set.addAll(users);
return new ArrayList<TbZjlxxzx>(set);
}
private Map<String, Integer> initMapKeyAndValue(String type) {
Map<String, Integer> sortMap = new HashMap<>();
if ("hour".equals(type)) {
sortMap.put("00", 0);
sortMap.put("01", 0);
sortMap.put("02", 0);
sortMap.put("03", 0);
sortMap.put("04", 0);
sortMap.put("05", 0);
sortMap.put("06", 0);
sortMap.put("07", 0);
sortMap.put("08", 0);
sortMap.put("09", 0);
sortMap.put("10", 0);
sortMap.put("11", 0);
sortMap.put("12", 0);
sortMap.put("13", 0);
sortMap.put("14", 0);
sortMap.put("15", 0);
sortMap.put("16", 0);
sortMap.put("17", 0);
sortMap.put("18", 0);
sortMap.put("19", 0);
sortMap.put("20", 0);
sortMap.put("21", 0);
sortMap.put("22", 0);
sortMap.put("23", 0);
} else if ("week".equals(type)) {
sortMap.put("Monday", 0);
sortMap.put("Tuesday", 0);
sortMap.put("Wednesday", 0);
sortMap.put("Thursday", 0);
sortMap.put("Friday", 0);
sortMap.put("Saturday", 0);
sortMap.put("Sunday", 0);
}
return sortMap;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment