| @@ -79,8 +79,8 @@ public class WxBillSettle extends BaseEntity { | |||||
| @Transient | @Transient | ||||
| @io.swagger.annotations.ApiModelProperty(value="开始时间",name="starttime") | @io.swagger.annotations.ApiModelProperty(value="开始时间",name="starttime") | ||||
| private Date starttime; | |||||
| private Date startTime; | |||||
| @Transient | @Transient | ||||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | ||||
| private Date endtime; | |||||
| private Date endTime; | |||||
| } | } | ||||
| @@ -0,0 +1,44 @@ | |||||
| package com.iformall.domain.vo; | |||||
| import cn.afterturn.easypoi.excel.annotation.Excel; | |||||
| import lombok.Data; | |||||
| import lombok.EqualsAndHashCode; | |||||
| import lombok.ToString; | |||||
| /** | |||||
| * @author luozukai | |||||
| */ | |||||
| @Data | |||||
| @ToString(callSuper = true) | |||||
| public class WxBillSettleVo { | |||||
| @Excel(name="结算单号",width = 20,orderNum = "1") | |||||
| private String settleNumber; | |||||
| @Excel(name="结算商户",width = 20,orderNum = "2") | |||||
| private String merchantName; | |||||
| @Excel(name="创建时间",width = 20,orderNum = "3") | |||||
| private String createtime; | |||||
| @Excel(name="收款(元)",width = 20,orderNum = "4") | |||||
| private String receiveMoney; | |||||
| @Excel(name="承付(元)",width = 20,orderNum = "5") | |||||
| private String payMoney; | |||||
| @Excel(name="结算金额(元)",width = 20,orderNum = "6") | |||||
| private String balance; | |||||
| @Excel(name="结算时间",width = 20,orderNum = "7") | |||||
| private String settletime; | |||||
| @Excel(name="结算状态",width = 20,orderNum = "8") | |||||
| private String status; | |||||
| @Excel(name="审批状态",width = 20,orderNum = "9") | |||||
| private String applyStatus; | |||||
| } | |||||
| @@ -0,0 +1,37 @@ | |||||
| package com.iformall.enums; | |||||
| /** | |||||
| * luozukai | |||||
| */ | |||||
| public enum EnumSettleStatus { | |||||
| //0待确认1未清算结余金额2结算完成 | |||||
| DEF(0, "待确认"), | |||||
| NOT_FINISH(1, "未清算结余金额"), | |||||
| FINISH(2, "结算完成"), | |||||
| ; | |||||
| public static EnumSettleStatus getEnum(Integer code) { | |||||
| for (EnumSettleStatus value : values()) { | |||||
| if (value.getCode().equals(code)) { | |||||
| return value; | |||||
| } | |||||
| } | |||||
| return null; | |||||
| } | |||||
| private Integer code; | |||||
| private String message; | |||||
| EnumSettleStatus(Integer code, String message) { | |||||
| this.code = code; | |||||
| this.message = message; | |||||
| } | |||||
| public Integer getCode() { | |||||
| return code; | |||||
| } | |||||
| public String getMessage() { | |||||
| return message; | |||||
| } | |||||
| } | |||||
| @@ -5,20 +5,21 @@ import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.IdWorker; | import com.iformall.common.IdWorker; | ||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.*; | import com.iformall.domain.po.*; | ||||
| import com.iformall.enums.EnumBillRentStatus; | |||||
| import com.iformall.enums.EnumBillType; | |||||
| import com.iformall.enums.EnumFreezeType; | |||||
| import com.iformall.enums.EnumSettleBillType; | |||||
| import com.iformall.domain.vo.WxBillSettleVo; | |||||
| import com.iformall.enums.*; | |||||
| import com.iformall.mapper.*; | import com.iformall.mapper.*; | ||||
| import com.iformall.service.ExcelService; | import com.iformall.service.ExcelService; | ||||
| import com.iformall.service.WxBillSettleService; | import com.iformall.service.WxBillSettleService; | ||||
| import com.iformall.service.WxFlowService; | import com.iformall.service.WxFlowService; | ||||
| import com.iformall.utils.DateUtils; | |||||
| import org.checkerframework.checker.units.qual.A; | import org.checkerframework.checker.units.qual.A; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import org.springframework.transaction.annotation.Transactional; | import org.springframework.transaction.annotation.Transactional; | ||||
| import javax.servlet.http.HttpServletRequest; | import javax.servlet.http.HttpServletRequest; | ||||
| import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
| import java.math.BigDecimal; | |||||
| import java.util.ArrayList; | |||||
| import java.util.List; | import java.util.List; | ||||
| /** | /** | ||||
| @@ -187,7 +188,22 @@ public class WxBillSettleServiceImpl implements WxBillSettleService { | |||||
| @Override | @Override | ||||
| public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillSettle wxBillSettle) { | public void exportBill(HttpServletRequest request, HttpServletResponse response, WxBillSettle wxBillSettle) { | ||||
| List<WxBillSettle> list = wxBillSettleMapper.findList(wxBillSettle); | List<WxBillSettle> list = wxBillSettleMapper.findList(wxBillSettle); | ||||
| excelService.exportExcel(list, null, "补贴记录", WxBillSettle.class, "补贴记录.xlsx", response, false); | |||||
| List<WxBillSettleVo> voList = new ArrayList<>(); | |||||
| for (WxBillSettle s:list) { | |||||
| WxBillSettleVo vo = new WxBillSettleVo(); | |||||
| vo.setSettleNumber(s.getSettleNumber()); | |||||
| vo.setMerchantName(s.getMerchantName()); | |||||
| vo.setCreatetime(DateUtils.formatDateTime(s.getCreatetime())); | |||||
| vo.setReceiveMoney(new BigDecimal(s.getReceiveMoney()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP).toString()); | |||||
| vo.setPayMoney(new BigDecimal(s.getPayMoney()).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP).toString()); | |||||
| vo.setBalance(new BigDecimal(s.getReceiveMoney()).subtract(new BigDecimal(s.getPayMoney())).divide(new BigDecimal(100), 2, BigDecimal.ROUND_HALF_UP).toString()); | |||||
| vo.setSettletime(DateUtils.formatDateTime(s.getSettletime())); | |||||
| vo.setStatus(EnumSettleStatus.getEnum(s.getStatus()).getMessage()); | |||||
| vo.setApplyStatus(EnumRentContractAppStatus.getEnum(s.getApplyStatus()).getMessage()); | |||||
| voList.add(vo); | |||||
| } | |||||
| excelService.exportExcel(voList, null, "结算单", WxBillSettleVo.class, "结算单.xlsx", response, false); | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -28,6 +28,11 @@ public class DateUtils { | |||||
| return format(date, DATE_PATTERN); | return format(date, DATE_PATTERN); | ||||
| } | } | ||||
| public static String formatDateTime(Date date) { | |||||
| return format(date, DATE_TIME_PATTERN); | |||||
| } | |||||
| public static String format(Date date, String pattern) { | public static String format(Date date, String pattern) { | ||||
| if(date != null){ | if(date != null){ | ||||
| SimpleDateFormat df = new SimpleDateFormat(pattern); | SimpleDateFormat df = new SimpleDateFormat(pattern); | ||||
| @@ -28,14 +28,14 @@ | |||||
| <if test=" null != tenantId ">and s.`tenant_id` = #{tenantId}</if> | <if test=" null != tenantId ">and s.`tenant_id` = #{tenantId}</if> | ||||
| <if test=" null != merchantName ">and m.name like concat('%', #{merchantName},'%')</if> | <if test=" null != merchantName ">and m.name like concat('%', #{merchantName},'%')</if> | ||||
| <if test="startTime != null"> | <if test="startTime != null"> | ||||
| and day_date >= #{startTime} | |||||
| and createtime >= #{startTime} | |||||
| </if> | </if> | ||||
| <if test="endTime != null"> | <if test="endTime != null"> | ||||
| and day_date <= #{endTime} | |||||
| and createtime <= #{endTime} | |||||
| </if> | </if> | ||||
| <if test=" null != settleNumber ">and s.`settle_number` = #{settleNumber}</if> | <if test=" null != settleNumber ">and s.`settle_number` = #{settleNumber}</if> | ||||
| <if test=" null != status ">and s.`status` = #{status}</if> | <if test=" null != status ">and s.`status` = #{status}</if> | ||||
| <if test=" null != apply_status ">and s.`apply_status` = #{applyStatus}</if> | |||||
| <if test=" null != applyStatus ">and s.`apply_status` = #{applyStatus}</if> | |||||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | <if test=" null != sortColumns">order by ${sortColumns}</if> | ||||
| </sql> | </sql> | ||||