Commit 22b314aa authored by shiyu's avatar shiyu

查询订单的账目明细api

parent 33d4b957
...@@ -126,6 +126,7 @@ public class ShiroConfig { ...@@ -126,6 +126,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/admin/identifyOrder/**", "anon"); filterChainDefinitionMap.put("/admin/identifyOrder/**", "anon");
filterChainDefinitionMap.put("/admin/dashboard/**", "anon"); filterChainDefinitionMap.put("/admin/dashboard/**", "anon");
filterChainDefinitionMap.put("/admin/specialPerformance/**", "anon"); filterChainDefinitionMap.put("/admin/specialPerformance/**", "anon");
filterChainDefinitionMap.put("/admin/sysFinance/**", "anon");
filterChainDefinitionMap.put("/admin/invitationCode/**", "anon"); filterChainDefinitionMap.put("/admin/invitationCode/**", "anon");
......
package com.wwdz.ch.admin.controller;
import com.alibaba.fastjson.JSON;
import com.wwdz.ch.admin.service.SysFinanceService;
import com.wwdz.ch.core.consts.ResultCode;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.domain.distribution.DistributionOrder;
import com.wwdz.ch.db.domain.distribution.UserAccountDetail;
import com.wwdz.ch.db.dto.request.distribution.*;
import com.xxdxxs.service.FormHandler;
import com.xxdxxs.validation.Validator;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* 后台财务管理
*/
@RestController
@RequestMapping("/admin/sysFinance")
public class SysFinanceController {
private static final Logger logger = LoggerFactory.getLogger(SysDistributionOrderController.class);
@Autowired
SysFinanceService sysFinanceService;
@ApiOperation(value = "查询订单的账目明细")
@PostMapping("/findOrderBillDetail")
public Result findOrderBillDetail(@RequestBody DistributionOrderRequestDto dto) {
logger.info("查询订单的账目明细,请求参数:{}", JSON.toJSONString(dto));
return sysFinanceService.findOrderBillDetail(dto);
}
@ApiOperation(value = "查询用户账单")
@PostMapping("/findUserBill")
public Result findUserBill(@RequestBody UserBillRequestDto dto) {
logger.info("查询用户账单,请求参数:{}", JSON.toJSONString(dto));
return sysFinanceService.findUserBill(dto);
}
@ApiOperation(value = "查询用户账单明细")
@PostMapping("/findUserBillDetail")
public Result findUserBillDetail(@RequestBody UserAccountDetailRequestDto dto) {
logger.info("查询用户账单明细,请求参数:{}", JSON.toJSONString(dto));
if (dto.getUserId() == null) {
return Result.failed(ResultCode.PARAM_ERROR);
}
return sysFinanceService.findUserBillDetail(dto);
}
@ApiOperation(value = "查询平台账户明细")
@PostMapping("/findSystemBillDetail")
public Result findSystemBillDetail(@RequestBody UserAccountDetailRequestDto dto) {
logger.info("查询平台账户明细,请求参数:{}", JSON.toJSONString(dto));
return sysFinanceService.findSystemBillDetail(dto);
}
}
package com.wwdz.ch.admin.entity.vo;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
import java.util.Map;
@Data
public class OrderBillVo implements Entity {
/**
* 分销订单号
*/
private String distributionOrderId;
/**
* 用于列表展示的图片对象
*/
private Map<String, Object> homePageImage;
/**
* 商品名称
*/
private String itemName;
/**
* 卖方id
*/
private Long sellerId;
/**
* 卖家名称
*/
private String sellerName;
/**
* 订单金额,要除以100
*/
private String amount;
/**
* 平台实际到账金额
* 要减去微信手续费1%
*/
private String realAmount;
/**
* 创建时间
*/
private Date createTime;
/**
* 分销订单状态
*/
private Integer state;
/**
* 订单状态
*/
private String stateName;
/**
* 商品类型1一口价2竞拍
*/
private Integer type;
private String typeName;
/**
* 藏家入账金额
*/
private String sellerEntryAmount;
/**
* 藏家待入账金额
*/
private String sellerWaitEntryAmount;
/**
* 系统入账金额
*/
private String systemEntryAmount;
/**
* 系统待入账金额
*/
private String systemWaitEntryAmount;
/**
* 介绍佣金入账金额
*/
private String introduceEntryAmount;
/**
* 介绍佣金待入账金额
*/
private String introduceWaitEntryAmount;
/**
* 介绍费归属人
*/
private String introducerId;
/**
* 介绍费归属人
*/
private String introducerName;
}
package com.wwdz.ch.admin.impl;
import com.github.pagehelper.PageInfo;
import com.wwdz.ch.admin.entity.vo.OrderBillVo;
import com.wwdz.ch.admin.service.SysFinanceService;
import com.wwdz.ch.core.consts.CommConsts;
import com.wwdz.ch.core.consts.DistributionEnum;
import com.wwdz.ch.core.consts.LogisticsEnum;
import com.wwdz.ch.core.type.PageSearchResult;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.core.util.CacheUtil;
import com.wwdz.ch.core.util.MediaUtil;
import com.wwdz.ch.core.util.PriceUtil;
import com.wwdz.ch.db.dao.distribution.*;
import com.wwdz.ch.db.domain.distribution.DistributionOrder;
import com.wwdz.ch.db.domain.distribution.DistributorProfit;
import com.wwdz.ch.db.domain.distribution.SupplierItem;
import com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto;
import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
import com.wwdz.ch.db.dto.request.distribution.UserAccountDetailRequestDto;
import com.wwdz.ch.db.dto.request.distribution.UserBillRequestDto;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
@Service
public class SysFinanceServiceImpl implements SysFinanceService {
private static final Logger logger = LoggerFactory.getLogger(SysFinanceServiceImpl.class);
@Autowired
DistributionOrderDao distributionOrderDao;
@Autowired
UserAccountDetailDao userAccountDetailDao;
@Autowired
UserBillDao userBillDao;
@Autowired
DistributorProfitDao distributorProfitDao;
@Autowired
SupplierItemDao supplierItemDao;
@Autowired
CacheUtil cacheUtil;
@Override
public Result findOrderBillDetail(DistributionOrderRequestDto dto) {
try {
List<DistributionOrder> distributionOrderList = distributionOrderDao.findByPage(dto);
PageInfo<DistributionOrder> pageInfo = new PageInfo<>(distributionOrderList);
List<OrderBillVo> orderBillVoList = new ArrayList<>();
for (DistributionOrder distributionOrder : distributionOrderList) {
String distributionOrderId = distributionOrder.getDistributionOrderId();
DistributorProfit distributorProfit = distributorProfitDao.findById(distributionOrderId);
OrderBillVo orderBillVo = new OrderBillVo();
SupplierItem supplierItem = supplierItemDao.findById(distributionOrder.getItemId());
orderBillVo.setDistributionOrderId(distributionOrderId);
orderBillVo.setItemName(supplierItem.getName());
orderBillVo.setHomePageImage(MediaUtil.getHomePageImage(supplierItem.getImages(), supplierItem.getVideos()));
orderBillVo.setSellerId(distributionOrder.getSellerId());
orderBillVo.setSellerName(cacheUtil.appletUserInfoCache.get(distributionOrder.getSellerId()).get().getNickname());
orderBillVo.setAmount(PriceUtil.convertPriceFenToYuan(distributionOrder.getAmount()));
orderBillVo.setRealAmount(PriceUtil.convertPriceFenToYuan(distributorProfit.getRealAmount()));
orderBillVo.setType(distributionOrder.getType());
orderBillVo.setTypeName( DistributionEnum.DistributionTypeEnum.getNameByCode(distributionOrder.getType()));
orderBillVo.setCreateTime(distributionOrder.getCreateTime());
orderBillVo.setState(distributionOrder.getState());
orderBillVo.setStateName(DistributionEnum.DistributionOrderStateEnum.getNameByCode(distributionOrder.getState()));
if (distributionOrder.getState() != DistributionEnum.DistributionOrderStateEnum.FINISH.getCode()) {
orderBillVo.setSellerWaitEntryAmount(PriceUtil.convertPriceFenToYuan(distributorProfit.getProfit()));
orderBillVo.setSystemWaitEntryAmount(PriceUtil.convertPriceFenToYuan(distributorProfit.getChannelCost()));
orderBillVo.setIntroduceWaitEntryAmount(PriceUtil.convertPriceFenToYuan(distributorProfit.getIntroduceCost()));
} else {
orderBillVo.setSellerEntryAmount(PriceUtil.convertPriceFenToYuan(distributorProfit.getProfit()));
orderBillVo.setSystemEntryAmount(PriceUtil.convertPriceFenToYuan(distributorProfit.getChannelCost()));
orderBillVo.setIntroduceEntryAmount(PriceUtil.convertPriceFenToYuan(distributorProfit.getIntroduceCost()));
}
orderBillVo.setIntroducerId(distributionOrder.getShareRecordId());
if (!CommConsts.DEFAULT_SHARE_ID.equals(distributionOrder.getShareRecordId()) && !CommConsts.SYSTEM_ACCOUNT.equals(distributionOrder.getShareRecordId())
&& distributionOrder.getShareRecordId().length() < 10) {
//表示介绍费不是平台的
orderBillVo.setIntroducerName(cacheUtil.appletUserInfoCache.get(Long.valueOf(distributionOrder.getShareRecordId())).get().getNickname());
} else {
orderBillVo.setIntroducerName("平台");
}
orderBillVoList.add(orderBillVo);
}
return Result.success(PageSearchResult.of(pageInfo, orderBillVoList));
} catch (Exception e) {
logger.error("查询订单账目明细error:{}", e);
}
return Result.failed();
}
@Override
public Result findUserBill(UserBillRequestDto dto) {
try {
return Result.success();
} catch (Exception e) {
logger.error("查询用户账单error:{}", e);
}
return Result.failed();
}
@Override
public Result findUserBillDetail(UserAccountDetailRequestDto dto) {
try {
return Result.success();
} catch (Exception e) {
logger.error("查询用户账单明细error:{}", e);
}
return Result.failed();
}
@Override
public Result findSystemBillDetail(UserAccountDetailRequestDto dto) {
try {
return Result.success();
} catch (Exception e) {
logger.error("查询平台账户明细error:{}", e);
}
return Result.failed();
}
}
package com.wwdz.ch.admin.service;
import com.wwdz.ch.core.type.Result;
import com.wwdz.ch.db.domain.distribution.DistributionOrder;
import com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto;
import com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto;
import com.wwdz.ch.db.dto.request.distribution.UserAccountDetailRequestDto;
import com.wwdz.ch.db.dto.request.distribution.UserBillRequestDto;
public interface SysFinanceService {
/**
* 查询订单的账目明细
* @param dto
* @return
*/
Result findOrderBillDetail(DistributionOrderRequestDto dto);
/**
* 查询用户账单
* @param dto
* @return
*/
Result findUserBill(UserBillRequestDto dto);
/**
* 查询用户账单明细
* @param dto
* @return
*/
Result findUserBillDetail(UserAccountDetailRequestDto dto);
/**
* 查询平台账户明细
* @param dto
* @return
*/
Result findSystemBillDetail(UserAccountDetailRequestDto dto);
}
...@@ -114,4 +114,40 @@ public class BillEnum { ...@@ -114,4 +114,40 @@ public class BillEnum {
return des; return des;
} }
} }
/**
* 用户账户明细收支类型
*/
public enum BillStateEnum {
NOT_PAID(0, "未结款"),
PAID(1, "已结款"),
;
private int code;
private String des;
BillStateEnum(int code, String des) {
this.code = code;
this.des = des;
}
public static String getNameByCode(int code) {
for (BillEnum.BillStateEnum billStateEnum : BillEnum.BillStateEnum.values()) {
if (code == billStateEnum.getCode()) {
return billStateEnum.getDes();
}
}
return null;
}
public int getCode() {
return code;
}
public String getDes() {
return des;
}
}
} }
package com.wwdz.ch.core.util; package com.wwdz.ch.core.util;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.LocalDate; import java.time.*;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
...@@ -73,6 +70,24 @@ public class DateTimeUtil { ...@@ -73,6 +70,24 @@ public class DateTimeUtil {
return null; return null;
} }
/**
* 获取yyyy-MM格式月份的首末时间
* @param yearMonth
* @return
*/
public static Date[] getMonthDateTimeRange(String yearMonth) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM");
YearMonth ym = YearMonth.parse(yearMonth, formatter);
LocalDateTime startDateTime = ym.atDay(1).atStartOfDay();
LocalDateTime endDateTime = ym.atEndOfMonth().atTime(23, 59, 59);
return new Date[] {
Date.from(startDateTime.atZone(ZoneId.systemDefault()).toInstant()),
Date.from(endDateTime.atZone(ZoneId.systemDefault()).toInstant())
};
}
/** /**
* 判断是否是当前的日期 * 判断是否是当前的日期
......
package com.wwdz.ch.db.dao.distribution;
import com.wwdz.ch.db.domain.distribution.SettlementRecord;
import com.wwdz.ch.db.domain.distribution.UserBill;
public interface SettlementRecordDao {
boolean insert(SettlementRecord settlementRecord);
boolean update(SettlementRecord settlementRecord);
}
package com.wwdz.ch.db.dao.distribution;
import com.wwdz.ch.db.domain.distribution.UserBill;
public interface UserBillDao {
boolean insert(UserBill userBill);
boolean update(UserBill userBill);
boolean update(String billId, int state);
}
...@@ -3,13 +3,14 @@ package com.wwdz.ch.db.domain.distribution; ...@@ -3,13 +3,14 @@ package com.wwdz.ch.db.domain.distribution;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import com.xxdxxs.entity.Entity; import com.xxdxxs.entity.Entity;
import lombok.Data; import lombok.Data;
/** /**
* @author shiyu * @author shiyu
* @date 2024/07/10 * @date 2024/07/11
*/ */
@Data @Data
public class UserBill implements Entity { public class UserBill implements Entity {
...@@ -61,7 +62,17 @@ public class UserBill implements Entity { ...@@ -61,7 +62,17 @@ public class UserBill implements Entity {
private Long introduceWaitEntryAmount; private Long introduceWaitEntryAmount;
/** /**
* 状态 * 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 状态0未结款;1结款
*/ */
private Integer state; private Integer state;
...@@ -83,6 +94,8 @@ public class UserBill implements Entity { ...@@ -83,6 +94,8 @@ public class UserBill implements Entity {
sb.append(", orderWaitEntryAmount=").append(orderWaitEntryAmount); sb.append(", orderWaitEntryAmount=").append(orderWaitEntryAmount);
sb.append(", introduceEntryAmount=").append(introduceEntryAmount); sb.append(", introduceEntryAmount=").append(introduceEntryAmount);
sb.append(", introduceWaitEntryAmount=").append(introduceWaitEntryAmount); sb.append(", introduceWaitEntryAmount=").append(introduceWaitEntryAmount);
sb.append(", createTime=").append(createTime);
sb.append(", updateTime=").append(updateTime);
sb.append(", state=").append(state); sb.append(", state=").append(state);
sb.append(", serialVersionUID=").append(serialVersionUID); sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]"); sb.append("]");
...@@ -111,6 +124,8 @@ public class UserBill implements Entity { ...@@ -111,6 +124,8 @@ public class UserBill implements Entity {
&& (this.getOrderWaitEntryAmount() == null ? other.getOrderWaitEntryAmount() == null : this.getOrderWaitEntryAmount().equals(other.getOrderWaitEntryAmount())) && (this.getOrderWaitEntryAmount() == null ? other.getOrderWaitEntryAmount() == null : this.getOrderWaitEntryAmount().equals(other.getOrderWaitEntryAmount()))
&& (this.getIntroduceEntryAmount() == null ? other.getIntroduceEntryAmount() == null : this.getIntroduceEntryAmount().equals(other.getIntroduceEntryAmount())) && (this.getIntroduceEntryAmount() == null ? other.getIntroduceEntryAmount() == null : this.getIntroduceEntryAmount().equals(other.getIntroduceEntryAmount()))
&& (this.getIntroduceWaitEntryAmount() == null ? other.getIntroduceWaitEntryAmount() == null : this.getIntroduceWaitEntryAmount().equals(other.getIntroduceWaitEntryAmount())) && (this.getIntroduceWaitEntryAmount() == null ? other.getIntroduceWaitEntryAmount() == null : this.getIntroduceWaitEntryAmount().equals(other.getIntroduceWaitEntryAmount()))
&& (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
&& (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
&& (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState())); && (this.getState() == null ? other.getState() == null : this.getState().equals(other.getState()));
} }
...@@ -128,6 +143,8 @@ public class UserBill implements Entity { ...@@ -128,6 +143,8 @@ public class UserBill implements Entity {
result = prime * result + ((getOrderWaitEntryAmount() == null) ? 0 : getOrderWaitEntryAmount().hashCode()); result = prime * result + ((getOrderWaitEntryAmount() == null) ? 0 : getOrderWaitEntryAmount().hashCode());
result = prime * result + ((getIntroduceEntryAmount() == null) ? 0 : getIntroduceEntryAmount().hashCode()); result = prime * result + ((getIntroduceEntryAmount() == null) ? 0 : getIntroduceEntryAmount().hashCode());
result = prime * result + ((getIntroduceWaitEntryAmount() == null) ? 0 : getIntroduceWaitEntryAmount().hashCode()); result = prime * result + ((getIntroduceWaitEntryAmount() == null) ? 0 : getIntroduceWaitEntryAmount().hashCode());
result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
result = prime * result + ((getState() == null) ? 0 : getState().hashCode()); result = prime * result + ((getState() == null) ? 0 : getState().hashCode());
return result; return result;
} }
...@@ -150,6 +167,8 @@ public class UserBill implements Entity { ...@@ -150,6 +167,8 @@ public class UserBill implements Entity {
orderWaitEntryAmount("order_wait_entry_amount", "orderWaitEntryAmount", "BIGINT", false), orderWaitEntryAmount("order_wait_entry_amount", "orderWaitEntryAmount", "BIGINT", false),
introduceEntryAmount("introduce_entry_amount", "introduceEntryAmount", "BIGINT", false), introduceEntryAmount("introduce_entry_amount", "introduceEntryAmount", "BIGINT", false),
introduceWaitEntryAmount("introduce_wait_entry_amount", "introduceWaitEntryAmount", "BIGINT", false), introduceWaitEntryAmount("introduce_wait_entry_amount", "introduceWaitEntryAmount", "BIGINT", false),
createTime("create_time", "createTime", "TIMESTAMP", false),
updateTime("update_time", "updateTime", "TIMESTAMP", false),
state("state", "state", "INTEGER", true); state("state", "state", "INTEGER", true);
/** /**
......
package com.wwdz.ch.db.domain.distribution; package com.wwdz.ch.db.domain.distribution;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
public class UserBillExample { public class UserBillExample {
...@@ -1487,6 +1488,270 @@ public class UserBillExample { ...@@ -1487,6 +1488,270 @@ public class UserBillExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("create_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeNotEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("create_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("create_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeGreaterThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("create_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("create_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andCreateTimeLessThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("create_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNull() {
addCriterion("update_time is null");
return (Criteria) this;
}
public Criteria andUpdateTimeIsNotNull() {
addCriterion("update_time is not null");
return (Criteria) this;
}
public Criteria andUpdateTimeEqualTo(Date value) {
addCriterion("update_time =", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("update_time = ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeNotEqualTo(Date value) {
addCriterion("update_time <>", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeNotEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("update_time <> ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThan(Date value) {
addCriterion("update_time >", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("update_time > ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("update_time >=", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeGreaterThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("update_time >= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeLessThan(Date value) {
addCriterion("update_time <", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanColumn(UserBill.Column column) {
addCriterion(new StringBuilder("update_time < ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
addCriterion("update_time <=", value, "updateTime");
return (Criteria) this;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user_bill
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public Criteria andUpdateTimeLessThanOrEqualToColumn(UserBill.Column column) {
addCriterion(new StringBuilder("update_time <= ").append(column.getEscapedColumnName()).toString());
return (Criteria) this;
}
public Criteria andUpdateTimeIn(List<Date> values) {
addCriterion("update_time in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotIn(List<Date> values) {
addCriterion("update_time not in", values, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeBetween(Date value1, Date value2) {
addCriterion("update_time between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andStateIsNull() { public Criteria andStateIsNull() {
addCriterion("`state` is null"); addCriterion("`state` is null");
return (Criteria) this; return (Criteria) this;
......
package com.wwdz.ch.db.dto.request.distribution;
import com.xxdxxs.entity.Entity;
import lombok.Data;
import java.util.Date;
@Data
public class SettlementRecordRequestDto implements Entity {
/**
* id
*/
private Long id;
/**
* 结算id
*/
private String settlementId;
/**
* 用户id
*/
private Long userId;
/**
* 银行卡号
*/
private String bankCardId;
/**
* 真实姓名
*/
private String realUserName;
/**
* 结算金额
*/
private Long settleAmount;
/**
* 结算时间
*/
private Date settleTime;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
/**
* 关联账单id
*/
private String billId;
/**
* 类型
*/
private Integer type;
/**
* 状态
*/
private Integer state;
/**
* 结算凭证
*/
private String voucher;
}
...@@ -39,6 +39,7 @@ public class UserAccountDetailRequestDto extends BaseRequestDto implements Entit ...@@ -39,6 +39,7 @@ public class UserAccountDetailRequestDto extends BaseRequestDto implements Entit
/** /**
* 收入或支出的类型 * 收入或支出的类型
* 1收入; -1支出
*/ */
private Integer type; private Integer type;
...@@ -57,6 +58,10 @@ public class UserAccountDetailRequestDto extends BaseRequestDto implements Entit ...@@ -57,6 +58,10 @@ public class UserAccountDetailRequestDto extends BaseRequestDto implements Entit
*/ */
private Date createTime; private Date createTime;
private Date startCreateTime;
private Date startEndTime;
/** /**
* 更新时间 * 更新时间
*/ */
......
...@@ -4,6 +4,8 @@ import com.wwdz.ch.db.dto.request.BaseRequestDto; ...@@ -4,6 +4,8 @@ import com.wwdz.ch.db.dto.request.BaseRequestDto;
import com.xxdxxs.entity.Entity; import com.xxdxxs.entity.Entity;
import lombok.Data; import lombok.Data;
import java.util.Date;
@Data @Data
public class UserBillRequestDto extends BaseRequestDto implements Entity { public class UserBillRequestDto extends BaseRequestDto implements Entity {
...@@ -56,6 +58,17 @@ public class UserBillRequestDto extends BaseRequestDto implements Entity { ...@@ -56,6 +58,17 @@ public class UserBillRequestDto extends BaseRequestDto implements Entity {
/** /**
* 状态 * 状态
* 0未结款;1已结款
*/ */
private Integer state; private Integer state;
/**
* 创建时间
*/
private Date createTime;
/**
* 更新时间
*/
private Date updateTime;
} }
...@@ -119,6 +119,8 @@ public class DistributionOrderDaoImpl implements DistributionOrderDao { ...@@ -119,6 +119,8 @@ public class DistributionOrderDaoImpl implements DistributionOrderDao {
JdbcHelper.ifPresent(dto.getNotFilterLogisticsState(), criteria::andLogisticsStateNotEqualTo); JdbcHelper.ifPresent(dto.getNotFilterLogisticsState(), criteria::andLogisticsStateNotEqualTo);
JdbcHelper.ifPresent(dto.getType(), criteria::andTypeEqualTo); JdbcHelper.ifPresent(dto.getType(), criteria::andTypeEqualTo);
JdbcHelper.ifPresent(dto.getTypeList(), criteria::andTypeIn); JdbcHelper.ifPresent(dto.getTypeList(), criteria::andTypeIn);
JdbcHelper.ifPresent(dto.getStartCreateTime(), criteria::andCreateTimeGreaterThanOrEqualTo);
JdbcHelper.ifPresent(dto.getEndCreateTime(), criteria::andCreateTimeLessThanOrEqualTo);
JdbcHelper.ifPresent(dto.getStartDeliveryTime(), criteria::andDeliveryTimeGreaterThanOrEqualTo); JdbcHelper.ifPresent(dto.getStartDeliveryTime(), criteria::andDeliveryTimeGreaterThanOrEqualTo);
JdbcHelper.ifPresent(dto.getEndDeliveryTime(), criteria::andDeliveryTimeLessThanOrEqualTo); JdbcHelper.ifPresent(dto.getEndDeliveryTime(), criteria::andDeliveryTimeLessThanOrEqualTo);
JdbcHelper.ifPresent(dto.getEndSignedTime(), criteria::andSignedTimeLessThanOrEqualTo); JdbcHelper.ifPresent(dto.getEndSignedTime(), criteria::andSignedTimeLessThanOrEqualTo);
......
package com.wwdz.ch.db.impl.distribution;
import com.wwdz.ch.db.dao.distribution.SettlementRecordDao;
import com.wwdz.ch.db.domain.distribution.SettlementRecord;
import com.wwdz.ch.db.mapper.distribution.SettlementRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class SettlementRecordDaoImpl implements SettlementRecordDao {
@Autowired
SettlementRecordMapper settlementRecordMapper;
@Override
public boolean insert(SettlementRecord settlementRecord) {
return settlementRecordMapper.insert(settlementRecord) > 0;
}
@Override
public boolean update(SettlementRecord settlementRecord) {
return false;
}
}
package com.wwdz.ch.db.impl.distribution;
import com.wwdz.ch.db.dao.distribution.UserBillDao;
import com.wwdz.ch.db.domain.distribution.UserBill;
import com.wwdz.ch.db.mapper.distribution.UserBillMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
@Repository
public class UserBillDaoImpl implements UserBillDao {
@Autowired
UserBillMapper userBillMapper;
@Override
public boolean insert(UserBill userBill) {
return userBillMapper.insert(userBill) > 0;
}
@Override
public boolean update(UserBill userBill) {
return false;
}
@Override
public boolean update(String billId, int state) {
return false;
}
}
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
<result column="order_wait_entry_amount" jdbcType="BIGINT" property="orderWaitEntryAmount" /> <result column="order_wait_entry_amount" jdbcType="BIGINT" property="orderWaitEntryAmount" />
<result column="introduce_entry_amount" jdbcType="BIGINT" property="introduceEntryAmount" /> <result column="introduce_entry_amount" jdbcType="BIGINT" property="introduceEntryAmount" />
<result column="introduce_wait_entry_amount" jdbcType="BIGINT" property="introduceWaitEntryAmount" /> <result column="introduce_wait_entry_amount" jdbcType="BIGINT" property="introduceWaitEntryAmount" />
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="state" jdbcType="INTEGER" property="state" /> <result column="state" jdbcType="INTEGER" property="state" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
...@@ -75,7 +77,7 @@ ...@@ -75,7 +77,7 @@
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, bill_id, account_period, user_id, total_entry_amount, total_wait_entry_amount, id, bill_id, account_period, user_id, total_entry_amount, total_wait_entry_amount,
order_entry_amount, order_wait_entry_amount, introduce_entry_amount, introduce_wait_entry_amount, order_entry_amount, order_wait_entry_amount, introduce_entry_amount, introduce_wait_entry_amount,
`state` create_time, update_time, `state`
</sql> </sql>
<select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.UserBillExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.wwdz.ch.db.domain.distribution.UserBillExample" resultMap="BaseResultMap">
select select
...@@ -104,7 +106,7 @@ ...@@ -104,7 +106,7 @@
distinct distinct
</if> </if>
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
...@@ -112,7 +114,7 @@ ...@@ -112,7 +114,7 @@
<otherwise> <otherwise>
id, bill_id, account_period, user_id, total_entry_amount, total_wait_entry_amount, id, bill_id, account_period, user_id, total_entry_amount, total_wait_entry_amount,
order_entry_amount, order_wait_entry_amount, introduce_entry_amount, introduce_wait_entry_amount, order_entry_amount, order_wait_entry_amount, introduce_entry_amount, introduce_wait_entry_amount,
`state` create_time, update_time, `state`
</otherwise> </otherwise>
</choose> </choose>
from user_bill from user_bill
...@@ -137,7 +139,7 @@ ...@@ -137,7 +139,7 @@
--> -->
select select
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
...@@ -145,7 +147,7 @@ ...@@ -145,7 +147,7 @@
<otherwise> <otherwise>
id, bill_id, account_period, user_id, total_entry_amount, total_wait_entry_amount, id, bill_id, account_period, user_id, total_entry_amount, total_wait_entry_amount,
order_entry_amount, order_wait_entry_amount, introduce_entry_amount, introduce_wait_entry_amount, order_entry_amount, order_wait_entry_amount, introduce_entry_amount, introduce_wait_entry_amount,
`state` create_time, update_time, `state`
</otherwise> </otherwise>
</choose> </choose>
from user_bill from user_bill
...@@ -168,11 +170,13 @@ ...@@ -168,11 +170,13 @@
insert into user_bill (bill_id, account_period, user_id, insert into user_bill (bill_id, account_period, user_id,
total_entry_amount, total_wait_entry_amount, order_entry_amount, total_entry_amount, total_wait_entry_amount, order_entry_amount,
order_wait_entry_amount, introduce_entry_amount, order_wait_entry_amount, introduce_entry_amount,
introduce_wait_entry_amount, `state`) introduce_wait_entry_amount, create_time,
update_time, `state`)
values (#{billId,jdbcType=VARCHAR}, #{accountPeriod,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT}, values (#{billId,jdbcType=VARCHAR}, #{accountPeriod,jdbcType=VARCHAR}, #{userId,jdbcType=BIGINT},
#{totalEntryAmount,jdbcType=BIGINT}, #{totalWaitEntryAmount,jdbcType=BIGINT}, #{orderEntryAmount,jdbcType=BIGINT}, #{totalEntryAmount,jdbcType=BIGINT}, #{totalWaitEntryAmount,jdbcType=BIGINT}, #{orderEntryAmount,jdbcType=BIGINT},
#{orderWaitEntryAmount,jdbcType=BIGINT}, #{introduceEntryAmount,jdbcType=BIGINT}, #{orderWaitEntryAmount,jdbcType=BIGINT}, #{introduceEntryAmount,jdbcType=BIGINT},
#{introduceWaitEntryAmount,jdbcType=BIGINT}, #{state,jdbcType=INTEGER}) #{introduceWaitEntryAmount,jdbcType=BIGINT}, #{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP}, #{state,jdbcType=INTEGER})
</insert> </insert>
<insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.UserBill"> <insert id="insertSelective" parameterType="com.wwdz.ch.db.domain.distribution.UserBill">
<selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer"> <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
...@@ -207,6 +211,12 @@ ...@@ -207,6 +211,12 @@
<if test="introduceWaitEntryAmount != null"> <if test="introduceWaitEntryAmount != null">
introduce_wait_entry_amount, introduce_wait_entry_amount,
</if> </if>
<if test="createTime != null">
create_time,
</if>
<if test="updateTime != null">
update_time,
</if>
<if test="state != null"> <if test="state != null">
`state`, `state`,
</if> </if>
...@@ -239,6 +249,12 @@ ...@@ -239,6 +249,12 @@
<if test="introduceWaitEntryAmount != null"> <if test="introduceWaitEntryAmount != null">
#{introduceWaitEntryAmount,jdbcType=BIGINT}, #{introduceWaitEntryAmount,jdbcType=BIGINT},
</if> </if>
<if test="createTime != null">
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="state != null"> <if test="state != null">
#{state,jdbcType=INTEGER}, #{state,jdbcType=INTEGER},
</if> </if>
...@@ -283,6 +299,12 @@ ...@@ -283,6 +299,12 @@
<if test="record.introduceWaitEntryAmount != null"> <if test="record.introduceWaitEntryAmount != null">
introduce_wait_entry_amount = #{record.introduceWaitEntryAmount,jdbcType=BIGINT}, introduce_wait_entry_amount = #{record.introduceWaitEntryAmount,jdbcType=BIGINT},
</if> </if>
<if test="record.createTime != null">
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.state != null"> <if test="record.state != null">
`state` = #{record.state,jdbcType=INTEGER}, `state` = #{record.state,jdbcType=INTEGER},
</if> </if>
...@@ -303,6 +325,8 @@ ...@@ -303,6 +325,8 @@
order_wait_entry_amount = #{record.orderWaitEntryAmount,jdbcType=BIGINT}, order_wait_entry_amount = #{record.orderWaitEntryAmount,jdbcType=BIGINT},
introduce_entry_amount = #{record.introduceEntryAmount,jdbcType=BIGINT}, introduce_entry_amount = #{record.introduceEntryAmount,jdbcType=BIGINT},
introduce_wait_entry_amount = #{record.introduceWaitEntryAmount,jdbcType=BIGINT}, introduce_wait_entry_amount = #{record.introduceWaitEntryAmount,jdbcType=BIGINT},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
`state` = #{record.state,jdbcType=INTEGER} `state` = #{record.state,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
...@@ -338,6 +362,12 @@ ...@@ -338,6 +362,12 @@
<if test="introduceWaitEntryAmount != null"> <if test="introduceWaitEntryAmount != null">
introduce_wait_entry_amount = #{introduceWaitEntryAmount,jdbcType=BIGINT}, introduce_wait_entry_amount = #{introduceWaitEntryAmount,jdbcType=BIGINT},
</if> </if>
<if test="createTime != null">
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="state != null"> <if test="state != null">
`state` = #{state,jdbcType=INTEGER}, `state` = #{state,jdbcType=INTEGER},
</if> </if>
...@@ -355,6 +385,8 @@ ...@@ -355,6 +385,8 @@
order_wait_entry_amount = #{orderWaitEntryAmount,jdbcType=BIGINT}, order_wait_entry_amount = #{orderWaitEntryAmount,jdbcType=BIGINT},
introduce_entry_amount = #{introduceEntryAmount,jdbcType=BIGINT}, introduce_entry_amount = #{introduceEntryAmount,jdbcType=BIGINT},
introduce_wait_entry_amount = #{introduceWaitEntryAmount,jdbcType=BIGINT}, introduce_wait_entry_amount = #{introduceWaitEntryAmount,jdbcType=BIGINT},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP},
`state` = #{state,jdbcType=INTEGER} `state` = #{state,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>
...@@ -385,7 +417,7 @@ ...@@ -385,7 +417,7 @@
select select
'true' as QUERYID, 'true' as QUERYID,
<choose> <choose>
<when test="selective != null and selective.length > 0"> <when test="selective != null and selective.length &gt; 0">
<foreach collection="selective" item="column" separator=","> <foreach collection="selective" item="column" separator=",">
${column.escapedColumnName} ${column.escapedColumnName}
</foreach> </foreach>
...@@ -393,7 +425,7 @@ ...@@ -393,7 +425,7 @@
<otherwise> <otherwise>
id, bill_id, account_period, user_id, total_entry_amount, total_wait_entry_amount, id, bill_id, account_period, user_id, total_entry_amount, total_wait_entry_amount,
order_entry_amount, order_wait_entry_amount, introduce_entry_amount, introduce_wait_entry_amount, order_entry_amount, order_wait_entry_amount, introduce_entry_amount, introduce_wait_entry_amount,
`state` create_time, update_time, `state`
</otherwise> </otherwise>
</choose> </choose>
from user_bill from user_bill
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
<javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution" <javaClientGenerator type="XMLMAPPER" targetPackage="com.wwdz.ch.db.mapper.distribution"
targetProject="ch-dao/src/main/java"/> targetProject="ch-dao/src/main/java"/>
<table tableName="settlement_record" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true"> <table tableName="user_bill" enableCountByExample="true" enableUpdateByExample="true" enableDeleteByExample="true" enableSelectByExample="true" selectByExampleQueryId="true">
<generatedKey column="id" sqlStatement="Mysql" identity="true" /> <generatedKey column="id" sqlStatement="Mysql" identity="true" />
</table> </table>
......
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