27 changed files with 484 additions and 58 deletions
@ -0,0 +1,35 @@ |
|||
package com.yxt.supervise.report.api.csmcashlog; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.yxt.common.core.domain.BaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/7/10 14:22 |
|||
*/ |
|||
@ApiModel(value = "每日回款审核日志", description = "每日回款审核日志:") |
|||
@TableName("csm_cash_log") |
|||
@Data |
|||
public class CsmCashLog { |
|||
private String id; |
|||
private String sid; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String status; |
|||
private String dataDate; |
|||
private String fileFullPath; |
|||
private String outFilePath; |
|||
private String fileUrl; |
|||
private Integer allNum; |
|||
private Integer validNum; |
|||
private Integer durations; |
|||
private Integer errRowNum; |
|||
private double salesAmountYesterday; |
|||
private double cashedAmountToday; |
|||
private double cashedAmountTodayReal; |
|||
private double cashedAmountDifferent; |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.yxt.supervise.report.api.csmcashlog; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/7/10 14:22 |
|||
*/ |
|||
@Data |
|||
public class CsmCashLogDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String status; |
|||
private String dataDate; |
|||
private String fileFullPath; |
|||
private String outFilePath; |
|||
private String fileUrl; |
|||
private Integer allNum; |
|||
private Integer validNum; |
|||
private Integer durations; |
|||
private Integer errRowNum; |
|||
private double salesAmountYesterday; |
|||
private double cashedAmountToday; |
|||
private double cashedAmountTodayReal; |
|||
private double cashedAmountDifferent; |
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.yxt.supervise.report.api.csmcashlog; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/7/10 14:23 |
|||
*/ |
|||
@Data |
|||
public class CsmCashLogQuery implements Query { |
|||
private String id; |
|||
private String sid; |
|||
private String dataDate; |
|||
private String fileFullPath; |
|||
private String outFilePath; |
|||
private String fileUrl; |
|||
private Integer allNum; |
|||
private Integer validNum; |
|||
private Integer durations; |
|||
private Integer errRowNum; |
|||
private double salesAmountYesterday; |
|||
private double cashedAmountToday; |
|||
private double cashedAmountTodayReal; |
|||
private double cashedAmountDifferent; |
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.yxt.supervise.report.api.csmcashlog; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/7/10 14:22 |
|||
*/ |
|||
@Data |
|||
public class CsmCashLogVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String status; |
|||
private String dataDate; |
|||
private String fileFullPath; |
|||
private String outFilePath; |
|||
private String fileUrl; |
|||
private Integer allNum; |
|||
private Integer validNum; |
|||
private Integer durations; |
|||
private Integer errRowNum; |
|||
private double salesAmountYesterday; |
|||
private double cashedAmountToday; |
|||
private double cashedAmountTodayReal; |
|||
private double cashedAmountDifferent; |
|||
} |
@ -0,0 +1,13 @@ |
|||
package com.yxt.supervise.report.biz.csmcashlog; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.yxt.supervise.report.api.csmcashlog.CsmCashLog; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/7/10 14:19 |
|||
*/ |
|||
@Mapper |
|||
public interface CsmCashLogMapper extends BaseMapper<CsmCashLog> { |
|||
} |
@ -0,0 +1,10 @@ |
|||
<?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.yxt.supervise.report.biz.csmcashlog.CsmCashLogMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
<select id="getCsmReport" resultType="map"> |
|||
select * from csm_cash_report_cashed_today where dataDate=#{dataDate} |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,13 @@ |
|||
package com.yxt.supervise.report.biz.csmcashlog; |
|||
|
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/7/10 14:19 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/csmcashlog") |
|||
public class CsmCashLogRest { |
|||
} |
@ -0,0 +1,13 @@ |
|||
package com.yxt.supervise.report.biz.csmcashlog; |
|||
|
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.supervise.report.api.csmcashlog.CsmCashLog; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/7/10 14:19 |
|||
*/ |
|||
@Service |
|||
public class CsmCashLogService extends MybatisBaseService<CsmCashLogMapper, CsmCashLog> { |
|||
} |
@ -0,0 +1,108 @@ |
|||
package com.yxt.supervise.report.biz.util; |
|||
|
|||
import cn.afterturn.easypoi.word.WordExportUtil; |
|||
import org.apache.poi.xwpf.usermodel.XWPFDocument; |
|||
|
|||
import java.io.ByteArrayOutputStream; |
|||
import java.io.File; |
|||
import java.io.FileOutputStream; |
|||
import java.util.ArrayList; |
|||
import java.util.HashMap; |
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/7/10 10:16 |
|||
*/ |
|||
public class WordUtil { |
|||
|
|||
|
|||
/** |
|||
* 导出word(2007版本docx) |
|||
* |
|||
* @param templateWordPath |
|||
* @param dataMap |
|||
* @return |
|||
* @throws Exception |
|||
*/ |
|||
public static byte[] exportWord(String templateWordPath, Map<String, Object> dataMap) throws Exception { |
|||
File tf = new File(templateWordPath); |
|||
if (!tf.exists() || !tf.isFile()) { |
|||
throw new RuntimeException("File [" + templateWordPath + "] Not Found Or Not File."); |
|||
} |
|||
XWPFDocument document = WordExportUtil.exportWord07(templateWordPath, dataMap); |
|||
ByteArrayOutputStream bos = new ByteArrayOutputStream(); |
|||
document.write(bos); |
|||
return bos.toByteArray(); |
|||
} |
|||
|
|||
public static void main(String[] args) { |
|||
try { |
|||
try (FileOutputStream fos = new FileOutputStream("C:\\Users\\www19\\Desktop\\666.docx")) { |
|||
Map<String, Object> dataMap = new HashMap<>(); |
|||
Map<String,Object> params =new HashMap<>(); |
|||
params.put("bankName","测试站点"); |
|||
params.put("CompanyName", "2022-4-1"); |
|||
params.put("salesAmountYesterday ", "5"); |
|||
params.put("cashedAmountToday ", "100"); |
|||
params.put("cashedAmountTodayReal ", "50"); |
|||
params.put("cashedAmountDifferent ", "22"); |
|||
params.put("tillTime ", "测试学校-55556555"); |
|||
params.put("accountBalance ", "测试学校-55556555"); |
|||
params.put("auditResult ", "测试学校-55556555"); |
|||
params.put("reportDate ", "测试学校-55556555"); |
|||
dataMap.put("params", params); |
|||
|
|||
List<Map> todayList =new ArrayList<>(); |
|||
Map<String,Object> resultListParams =new HashMap<>(); |
|||
Map<String,Object> resultListParams2 =new HashMap<>(); |
|||
resultListParams.put("salesDate","1"); |
|||
resultListParams2.put("salesDate","2"); |
|||
resultListParams.put("disbursementChannelName","测试1"); |
|||
resultListParams2.put("disbursementChannelName","测试2"); |
|||
resultListParams.put("amount","111"); |
|||
resultListParams2.put("amount","222"); |
|||
resultListParams.put("companyName","xx1"); |
|||
resultListParams2.put("companyName","xx2"); |
|||
resultListParams.put("cashedAmount","je1"); |
|||
resultListParams2.put("cashedAmount","je2"); |
|||
resultListParams.put("differentAmount","hh1"); |
|||
resultListParams2.put("differentAmount","hh2"); |
|||
resultListParams.put("remarks","hh1"); |
|||
resultListParams2.put("remarks","hh2"); |
|||
todayList.add(resultListParams); |
|||
todayList.add(resultListParams2); |
|||
List<Map> yesterdayList =new ArrayList<>(); |
|||
Map<String,Object> resultListParams3 =new HashMap<>(); |
|||
Map<String,Object> resultListParams4 =new HashMap<>(); |
|||
resultListParams3.put("disbursementChannelName","1"); |
|||
resultListParams4.put("disbursementChannelName","2"); |
|||
resultListParams3.put("amount","测试1666"); |
|||
resultListParams4.put("amount","测试2666"); |
|||
resultListParams3.put("companyName","xx16666"); |
|||
resultListParams4.put("companyName","xx26666"); |
|||
resultListParams3.put("accountCycle","je16666"); |
|||
resultListParams4.put("accountCycle","je26666"); |
|||
yesterdayList.add(resultListParams3); |
|||
yesterdayList.add(resultListParams4); |
|||
|
|||
dataMap.put("todayList", todayList); |
|||
dataMap.put("yesterday",yesterdayList); |
|||
|
|||
byte[] doc = exportWord("C:\\Users\\www19\\Desktop\\每日回款审核报告.docx", dataMap); |
|||
|
|||
fos.write(doc); |
|||
|
|||
fos.flush(); |
|||
|
|||
} |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
|
|||
} |
Loading…
Reference in new issue