导粉记录
This commit is contained in:
@ -1,9 +1,12 @@
|
||||
package com.stdiet.custom.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import com.stdiet.common.annotation.Excel;
|
||||
import com.stdiet.common.core.domain.BaseEntity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 导粉记录中对应微信记录对象 sys_import_fan_wx_account
|
||||
*
|
||||
@ -32,4 +35,8 @@ public class SysImportFanWxAccount extends BaseEntity
|
||||
|
||||
/** 删除标识 0未删除 1已删除 */
|
||||
private Long delFlag;
|
||||
|
||||
//导粉日期
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
private Date importFanDate;
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
package com.stdiet.custom.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.stdiet.custom.domain.SysImportFanWxAccount;
|
||||
|
||||
/**
|
||||
@ -65,4 +67,11 @@ public interface SysImportFanWxAccountMapper
|
||||
* @return
|
||||
*/
|
||||
public SysImportFanWxAccount getWxAccountByFanRecordId(SysImportFanWxAccount sysImportFanWxAccount);
|
||||
|
||||
/**
|
||||
* 根据微信号查询
|
||||
* @param sysImportFanWxAccount
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> getTotalImportFanNum(SysImportFanWxAccount sysImportFanWxAccount);
|
||||
}
|
@ -74,8 +74,7 @@ public interface SysWxSaleAccountMapper
|
||||
|
||||
/**
|
||||
* 获取可接粉的微信号以及分配的销售昵称
|
||||
* @param sysWxSaleAccount
|
||||
* @return
|
||||
*/
|
||||
List<SysWxSaleAccount> getWxAccountAndSale(SysWxSaleAccount sysWxSaleAccount);
|
||||
List<SysWxSaleAccount> getWxAccountAndSale();
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
package com.stdiet.custom.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.stdiet.custom.domain.SysImportFanWxAccount;
|
||||
import com.stdiet.custom.domain.SysWxSaleAccount;
|
||||
|
||||
/**
|
||||
* 导粉记录中对应微信记录Service接口
|
||||
@ -65,4 +68,10 @@ public interface ISysImportFanWxAccountService
|
||||
* @return
|
||||
*/
|
||||
public SysImportFanWxAccount getWxAccountByFanRecordId(SysImportFanWxAccount sysImportFanWxAccount);
|
||||
|
||||
/**
|
||||
* 根据日期统计微信号导粉数量
|
||||
* @return
|
||||
*/
|
||||
List<Map<String,Object>> getTotalImportFanNum(SysImportFanWxAccount sysImportFanWxAccount);
|
||||
}
|
@ -75,8 +75,7 @@ public interface ISysWxSaleAccountService
|
||||
|
||||
/**
|
||||
* 获取可接粉的微信号以及分配的销售昵称
|
||||
* @param sysWxSaleAccount
|
||||
* @return
|
||||
*/
|
||||
List<SysWxSaleAccount> getWxAccountAndSale(SysWxSaleAccount sysWxSaleAccount);
|
||||
List<SysWxSaleAccount> getWxAccountAndSale();
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
package com.stdiet.custom.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.stdiet.common.utils.DateUtils;
|
||||
import com.stdiet.custom.domain.SysWxSaleAccount;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.stdiet.custom.mapper.SysImportFanWxAccountMapper;
|
||||
@ -102,4 +105,13 @@ public class SysImportFanWxAccountServiceImpl implements ISysImportFanWxAccountS
|
||||
public SysImportFanWxAccount getWxAccountByFanRecordId(SysImportFanWxAccount sysImportFanWxAccount){
|
||||
return sysImportFanWxAccountMapper.getWxAccountByFanRecordId(sysImportFanWxAccount);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据日期统计微信号导粉数量
|
||||
* @return
|
||||
*/
|
||||
public List<Map<String,Object>> getTotalImportFanNum(SysImportFanWxAccount sysImportFanWxAccount){
|
||||
return sysImportFanWxAccountMapper.getTotalImportFanNum(sysImportFanWxAccount);
|
||||
}
|
||||
}
|
@ -9,7 +9,9 @@ import com.stdiet.custom.service.ISysWxSaleAccountService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 微信账号Service业务层处理
|
||||
@ -134,7 +136,7 @@ public class SysWxSaleAccountServiceImpl implements ISysWxSaleAccountService {
|
||||
* @param sysWxSaleAccount
|
||||
* @return
|
||||
*/
|
||||
public List<SysWxSaleAccount> getWxAccountAndSale(SysWxSaleAccount sysWxSaleAccount){
|
||||
return sysWxSaleAccountMapper.getWxAccountAndSale(sysWxSaleAccount);
|
||||
public List<SysWxSaleAccount> getWxAccountAndSale(){
|
||||
return sysWxSaleAccountMapper.getWxAccountAndSale();
|
||||
}
|
||||
}
|
@ -124,8 +124,8 @@
|
||||
from sys_import_fan_wx_account fwc
|
||||
left join sys_wx_sale_account wa on wa.id = fwc.import_wx_account_id and wa.del_flag = 0
|
||||
left join sys_wx_distribution swd on swd.wechat_account = wa.id and swd.del_flag = 0
|
||||
left join sys_user su on swd.user_id = su.id and su.del_flag = 0
|
||||
where fwc.del_flag = 0
|
||||
left join sys_user su on swd.user_id = su.user_id and su.del_flag = 0
|
||||
where fwc.del_flag = 0 and fwc.import_fan_record_id = #{id}
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -87,4 +87,22 @@
|
||||
and import_wx_account_id = #{importWxAccountId} order by id desc limit 1
|
||||
</select>
|
||||
|
||||
<!-- 根据微信号ID查询导粉多少 -->
|
||||
<select id="getTotalImportFanNum" parameterType="SysImportFanWxAccount" resultType="Map">
|
||||
select w.import_wx_account_id as wxAccountId,sum(w.import_fan_num) as fanNum
|
||||
from
|
||||
(
|
||||
select fwa.import_wx_account_id,fwa.import_fan_num from sys_import_fan_wx_account fwa
|
||||
left join sys_import_fan_record ifr on fwa.import_fan_record_id = ifr.id and ifr.del_flag = 0
|
||||
where fwa.del_flag = 0
|
||||
<if test="importFanDate != null">
|
||||
and ifr.import_fan_date = #{importFanDate}
|
||||
</if>
|
||||
<if test="importWxAccountId != null">
|
||||
and fwa.import_wx_account_id = #{importWxAccountId}
|
||||
</if>
|
||||
) w
|
||||
group by w.import_wx_account_id order by w.import_wx_account_id desc
|
||||
</select>
|
||||
|
||||
</mapper>
|
@ -139,14 +139,13 @@
|
||||
</insert>
|
||||
|
||||
<!-- 查询可以接粉的微信号以及对应销售,用于导粉记录管理 -->
|
||||
<select id="getWxAccountAndSale" parameterType="SysWxSaleAccount" resultMap="SysWxSaleAccountResult">
|
||||
<select id="getWxAccountAndSale" resultMap="SysWxSaleAccountResult">
|
||||
select wa.id, wa.wx_account, su.nick_name as sale_name
|
||||
from sys_wx_sale_account wa
|
||||
left join sys_wx_distribution swd on wa.id = swd.wechat_account and swd.del_flag = 0
|
||||
LEFT JOIN sys_user su ON su.user_id = swd.user_id AND su.del_flag = 0
|
||||
where wa.del_flag = 0 and wa.status = 0
|
||||
<if test="wxAccount != null and wxAccount != ''">and wa.wx_account like concat('%', #{wxAccount}, '%')</if>
|
||||
order by wa.id desc
|
||||
order by su.user_id asc
|
||||
</select>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user