| | |
| | | import com.mzl.flower.entity.supplier.Supplier; |
| | | import com.mzl.flower.entity.system.UserWechat; |
| | | import com.mzl.flower.entity.wallet.WalletBillRecordDO; |
| | | import com.mzl.flower.entity.wallet.WalletBillRecordDetail; |
| | | import com.mzl.flower.entity.wallet.WalletDO; |
| | | import com.mzl.flower.mapper.flower.FlowerSupplierSaleNumMapper; |
| | | import com.mzl.flower.mapper.payment.*; |
| | |
| | | import com.mzl.flower.mapper.wallet.WalletMapper; |
| | | import com.mzl.flower.service.BaseService; |
| | | import com.mzl.flower.service.wallet.WalletService; |
| | | import com.mzl.flower.utils.ExcelExportUtil; |
| | | import com.mzl.flower.utils.UUIDGenerator; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.redisson.api.RLock; |
| | |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.util.ObjectUtils; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDateTime; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | |
| | | orderMapper.updateById(o); |
| | | } |
| | | } |
| | | |
| | | public void exportSettlementList(HttpServletResponse response, OrderSettlementQueryDTO dto) { |
| | | dto.setStartDate(parseLocalDateTime(dto.getStartDateStr(), true)); |
| | | dto.setEndDate(parseLocalDateTime(dto.getEndDateStr(), false)); |
| | | List<OrderSettlementListDTO> ls = settlementMapper.selectSettlementListInfo(null, dto); |
| | | |
| | | String[] rowsName = new String[]{"序号","结算人", "结算金额(元)", "订单数量", "买家数量", "商品数量", "结算合计(元)", "结算均价(元)", "降级扣款(元)", |
| | | "缺货扣款(元)", "补货扣款(元)", "售后理赔(元)", "服务费(元)", "集货站运费(元)", "结算类型", "结算状态", "结算时间"}; |
| | | List<Object[]> dataList = new ArrayList<>(); |
| | | int sn = 1; |
| | | for (OrderSettlementListDTO o : ls) { |
| | | Object[] objs = new Object[rowsName.length]; |
| | | int a = 0; |
| | | objs[a++] = sn; |
| | | objs[a++] = o.getUserName(); |
| | | objs[a++] = o.getSettlementAmount(); |
| | | objs[a++] = o.getOrderNum(); |
| | | objs[a++] = o.getCustomerNum(); |
| | | objs[a++] = o.getFlowerNum(); |
| | | objs[a++] = o.getTotalAmount(); |
| | | objs[a++] = o.getPrice(); |
| | | objs[a++] = o.getCheckFee(); |
| | | objs[a++] = o.getLackFee(); |
| | | objs[a++] = o.getReplaceFee(); |
| | | objs[a++] = o.getSalesFee(); |
| | | objs[a++] = o.getServiceFee(); |
| | | objs[a++] = o.getStationFee(); |
| | | objs[a++] = o.getTypeStr(); |
| | | objs[a++] = o.getStatusStr(); |
| | | objs[a++] = o.getTransferTime(); |
| | | dataList.add(objs); |
| | | |
| | | sn++; |
| | | } |
| | | ExcelExportUtil excelExportUtil = new ExcelExportUtil("结算列表", rowsName, dataList, response); |
| | | try { |
| | | response.addHeader("filename", URLEncoder.encode("结算列表.xls", "UTF-8")); |
| | | response.addHeader("Access-Control-Expose-Headers", "filename"); |
| | | excelExportUtil.export(); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage(), e); |
| | | } |
| | | |
| | | } |
| | | } |