15 changed files with 354 additions and 4 deletions
Unified View
Diff Options
-
56dating-agency-mall-entity/src/main/java/com/qniao/dam/domain/aggregate/userdeliveryincome/entity/UserDeliveryIncome.java
-
8dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/dailyincome/user/DailyIncomeUserCommandController.java
-
32dating-agency-mall-server/src/main/java/com/qniao/dam/api/command/dailyincome/user/request/SubmitUserDeliveryCostDto.java
-
59dating-agency-mall-server/src/main/java/com/qniao/dam/application/service/dailyincome/DailyIncomeApplicationService.java
-
28dating-agency-mall-server/src/main/java/com/qniao/dam/application/task/DailyIncomeTask.java
-
26dating-agency-mall-server/src/main/java/com/qniao/dam/domain/aggregate/userdeliveryincome/UserDeliveryIncomeAggregate.java
-
11dating-agency-mall-server/src/main/java/com/qniao/dam/domain/aggregate/userdeliveryincome/repository/UserDeliveryIncomeRepository.java
-
6dating-agency-mall-server/src/main/java/com/qniao/dam/infrastructure/persistent/dao/domain/MarriageInformationDao.java
-
11dating-agency-mall-server/src/main/java/com/qniao/dam/infrastructure/persistent/dao/userdeliveryincome/UserDeliveryIncomeDao.java
-
40dating-agency-mall-server/src/main/java/com/qniao/dam/infrastructure/persistent/repository/impl/UserDeliveryIncomeRepositoryImpl.java
-
4dating-agency-mall-server/src/main/java/com/qniao/dam/query/marriageinformation/MarriageInformationQueryService.java
-
6dating-agency-mall-server/src/main/java/com/qniao/dam/query/marriageinformation/impl/MarriageInformationQueryServiceImpl.java
-
16dating-agency-mall-server/src/main/java/com/qniao/dam/query/userdeliveryincome/UserDeliveryIncomeQueryService.java
-
35dating-agency-mall-server/src/main/java/com/qniao/dam/query/userdeliveryincome/impl/UserDeliveryIncomeQueryServiceImpl.java
-
20dating-agency-mall-server/src/main/resources/mapper/marriageinformation/MarriageInformationDao.xml
@ -0,0 +1,56 @@ |
|||||
|
package com.qniao.dam.domain.aggregate.userdeliveryincome.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.qniao.domain.Entity; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDate; |
||||
|
|
||||
|
/** |
||||
|
* @author Zpj |
||||
|
* @date 2026/5/10 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper = true) |
||||
|
@TableName("da_user_delivery_income") |
||||
|
public class UserDeliveryIncome extends Entity<UserDeliveryIncome> { |
||||
|
|
||||
|
@ApiModelProperty("统计日期") |
||||
|
private LocalDate statDate; |
||||
|
|
||||
|
@ApiModelProperty("注册数量") |
||||
|
private Integer registerCount; |
||||
|
|
||||
|
@ApiModelProperty("投放成本") |
||||
|
private BigDecimal deliveryCost; |
||||
|
|
||||
|
@ApiModelProperty("2日收入") |
||||
|
private BigDecimal income2d; |
||||
|
|
||||
|
@ApiModelProperty("3日收入") |
||||
|
private BigDecimal income3d; |
||||
|
|
||||
|
@ApiModelProperty("4日收入") |
||||
|
private BigDecimal income4d; |
||||
|
|
||||
|
@ApiModelProperty("5日收入") |
||||
|
private BigDecimal income5d; |
||||
|
|
||||
|
@ApiModelProperty("6日收入") |
||||
|
private BigDecimal income6d; |
||||
|
|
||||
|
@ApiModelProperty("7日收入") |
||||
|
private BigDecimal income7d; |
||||
|
|
||||
|
@ApiModelProperty("14日收入") |
||||
|
private BigDecimal income14d; |
||||
|
|
||||
|
@ApiModelProperty("30日收入") |
||||
|
private BigDecimal income30d; |
||||
|
|
||||
|
@ApiModelProperty("是否完成") |
||||
|
private Boolean isFinished; |
||||
|
} |
||||
@ -0,0 +1,32 @@ |
|||||
|
package com.qniao.dam.api.command.dailyincome.user.request; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.qniao.dam.domain.aggregate.userdeliveryincome.entity.UserDeliveryIncome; |
||||
|
import com.qniao.domain.Trans2DomainAssembler; |
||||
|
import com.qniao.framework.utils.TypeConvertUtils; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
import java.time.LocalDate; |
||||
|
|
||||
|
/** |
||||
|
* @author Zpj |
||||
|
* @date 2026/5/10 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SubmitUserDeliveryCostDto implements Trans2DomainAssembler<UserDeliveryIncome> { |
||||
|
|
||||
|
@ApiModelProperty("投放成本") |
||||
|
private BigDecimal deliveryCost; |
||||
|
|
||||
|
@ApiModelProperty("统计日期") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||
|
private LocalDate statDate; |
||||
|
|
||||
|
@Override |
||||
|
public UserDeliveryIncome trans2Domain() { |
||||
|
return TypeConvertUtils.convert(this, UserDeliveryIncome.class); |
||||
|
} |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,26 @@ |
|||||
|
package com.qniao.dam.domain.aggregate.userdeliveryincome; |
||||
|
|
||||
|
import com.qniao.dam.domain.aggregate.userdeliveryincome.entity.UserDeliveryIncome; |
||||
|
import com.qniao.dam.domain.aggregate.userdeliveryincome.repository.UserDeliveryIncomeRepository; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
|
||||
|
/** |
||||
|
* @author Zpj |
||||
|
* @date 2026/5/10 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class UserDeliveryIncomeAggregate { |
||||
|
|
||||
|
@Resource |
||||
|
private UserDeliveryIncomeRepository repository; |
||||
|
|
||||
|
public void create(UserDeliveryIncome entity) { |
||||
|
repository.save(entity); |
||||
|
} |
||||
|
|
||||
|
public void edit(UserDeliveryIncome entity) { |
||||
|
repository.save(entity); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
package com.qniao.dam.domain.aggregate.userdeliveryincome.repository; |
||||
|
|
||||
|
import com.qniao.dam.domain.aggregate.userdeliveryincome.entity.UserDeliveryIncome; |
||||
|
import com.qniao.domain.Repository; |
||||
|
|
||||
|
/** |
||||
|
* @author Zpj |
||||
|
* @date 2026/5/10 |
||||
|
*/ |
||||
|
public interface UserDeliveryIncomeRepository extends Repository<UserDeliveryIncome,Long> { |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
package com.qniao.dam.infrastructure.persistent.dao.userdeliveryincome; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.qniao.dam.domain.aggregate.userdeliveryincome.entity.UserDeliveryIncome; |
||||
|
|
||||
|
/** |
||||
|
* @author Zpj |
||||
|
* @date 2026/5/10 |
||||
|
*/ |
||||
|
public interface UserDeliveryIncomeDao extends BaseMapper<UserDeliveryIncome> { |
||||
|
} |
||||
@ -0,0 +1,40 @@ |
|||||
|
package com.qniao.dam.infrastructure.persistent.repository.impl; |
||||
|
|
||||
|
import com.qniao.dam.domain.aggregate.userdeliveryincome.entity.UserDeliveryIncome; |
||||
|
import com.qniao.dam.domain.aggregate.userdeliveryincome.repository.UserDeliveryIncomeRepository; |
||||
|
import com.qniao.dam.infrastructure.persistent.dao.userdeliveryincome.UserDeliveryIncomeDao; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.util.Objects; |
||||
|
|
||||
|
/** |
||||
|
* @author Zpj |
||||
|
* @date 2026/5/10 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class UserDeliveryIncomeRepositoryImpl implements UserDeliveryIncomeRepository { |
||||
|
|
||||
|
@Resource |
||||
|
private UserDeliveryIncomeDao dao; |
||||
|
|
||||
|
@Override |
||||
|
public UserDeliveryIncome load(Long id) { |
||||
|
return dao.selectById(id); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public Long save(UserDeliveryIncome entity) { |
||||
|
if (Objects.isNull(entity.getId()) || Objects.isNull(dao.selectById(entity.getId()))) { |
||||
|
dao.insert(entity); |
||||
|
} else { |
||||
|
dao.updateById(entity); |
||||
|
} |
||||
|
return entity.getId(); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public void delete(Long id) { |
||||
|
dao.deleteById(id); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
package com.qniao.dam.query.userdeliveryincome; |
||||
|
|
||||
|
import com.qniao.dam.domain.aggregate.userdeliveryincome.entity.UserDeliveryIncome; |
||||
|
|
||||
|
import java.time.LocalDate; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author Zpj |
||||
|
* @date 2026/5/10 |
||||
|
*/ |
||||
|
public interface UserDeliveryIncomeQueryService { |
||||
|
List<UserDeliveryIncome> listUnfinished(); |
||||
|
|
||||
|
UserDeliveryIncome queryBy(LocalDate statDate); |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
package com.qniao.dam.query.userdeliveryincome.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.qniao.dam.domain.aggregate.userdeliveryincome.entity.UserDeliveryIncome; |
||||
|
import com.qniao.dam.infrastructure.persistent.dao.userdeliveryincome.UserDeliveryIncomeDao; |
||||
|
import com.qniao.dam.query.userdeliveryincome.UserDeliveryIncomeQueryService; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import javax.annotation.Resource; |
||||
|
import java.time.LocalDate; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author Zpj |
||||
|
* @date 2026/5/10 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class UserDeliveryIncomeQueryServiceImpl implements UserDeliveryIncomeQueryService { |
||||
|
|
||||
|
@Resource |
||||
|
private UserDeliveryIncomeDao userDeliveryIncomeDao; |
||||
|
|
||||
|
@Override |
||||
|
public List<UserDeliveryIncome> listUnfinished() { |
||||
|
return userDeliveryIncomeDao.selectList(new LambdaQueryWrapper<UserDeliveryIncome>() |
||||
|
.eq(UserDeliveryIncome::getIsFinished, false)); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public UserDeliveryIncome queryBy(LocalDate statDate) { |
||||
|
return userDeliveryIncomeDao.selectOne(new LambdaQueryWrapper<UserDeliveryIncome>() |
||||
|
.eq(UserDeliveryIncome::getStatDate, statDate) |
||||
|
.last("limit 1")); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,20 @@ |
|||||
|
<?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.qniao.dam.infrastructure.persistent.dao.domain.MarriageInformationDao"> |
||||
|
|
||||
|
<select id="getRegisterCount" resultType="java.lang.Integer"> |
||||
|
SELECT |
||||
|
COUNT(1) |
||||
|
from da_marriage_information as dami |
||||
|
INNER JOIN da_user_marriage_information as daumi on daumi.is_delete=0 and daumi.mi_id=dami.id and daumi.type=1 |
||||
|
INNER JOIN da_user as dau on dau.is_delete=0 and dau.id=daumi.user_id |
||||
|
where dami.is_delete=0 |
||||
|
<if test="appId != null"> |
||||
|
and dau.app_from = #{appId} |
||||
|
</if> |
||||
|
<if test="statDateFrom != null and statDateTo != null"> |
||||
|
and dami.create_time BETWEEN #{statDateFrom} and #{statDateTo} |
||||
|
</if> |
||||
|
|
||||
|
</select> |
||||
|
</mapper> |
||||
Write
Preview
Loading…
Cancel
Save