导粉记录页面以及接口修改

This commit is contained in:
xiezhijun
2021-05-21 18:59:26 +08:00
parent 17df1db9e2
commit f913774025
12 changed files with 250 additions and 21 deletions

View File

@ -52,4 +52,17 @@ public class SysImportFanRecord extends BaseEntity
private String liveNutritionistName;
private List<Map<String,Object>> wxAccountList;
private String importFanChannels;
private String importFanLives;
private String wxAccountIds;
private String fanNums;
//总进粉数量
private Integer totalFanNum;
}

View File

@ -65,4 +65,7 @@ public interface SysImportFanRecordMapper
* @return
*/
public SysImportFanRecord getFanRecordByChannelLive(SysImportFanRecord sysImportFanRecord);
//查询总导粉数量
int selectTotalSysImportFanNum(SysImportFanRecord sysImportFanRecord);
}

View File

@ -74,4 +74,11 @@ public interface SysImportFanWxAccountMapper
* @return
*/
List<Map<String,Object>> getTotalImportFanNum(SysImportFanWxAccount sysImportFanWxAccount);
/**
* 根据记录ID删除对应所有微信
* @param ids
* @return
*/
int deleteSysImportFanWxAccountByFanRecordIds(Long[] ids);
}

View File

@ -58,4 +58,7 @@ public interface ISysImportFanRecordService
* @return 结果
*/
public int deleteSysImportFanRecordById(Long id);
//查询总导粉数量
int selectTotalSysImportFanNum(SysImportFanRecord sysImportFanRecord);
}

View File

@ -74,4 +74,11 @@ public interface ISysImportFanWxAccountService
* @return
*/
List<Map<String,Object>> getTotalImportFanNum(SysImportFanWxAccount sysImportFanWxAccount);
/**
* 根据记录ID删除对应所有微信
* @param ids
* @return
*/
int deleteSysImportFanWxAccountByFanRecordIds(Long[] ids);
}

View File

@ -107,7 +107,11 @@ public class SysImportFanRecordServiceImpl implements ISysImportFanRecordService
@Override
public int deleteSysImportFanRecordByIds(Long[] ids)
{
return sysImportFanRecordMapper.deleteSysImportFanRecordByIds(ids);
int row = sysImportFanRecordMapper.deleteSysImportFanRecordByIds(ids);
if(row > 0){
sysImportFanWxAccountService.deleteSysImportFanWxAccountByFanRecordIds(ids);
}
return row;
}
/**
@ -119,6 +123,16 @@ public class SysImportFanRecordServiceImpl implements ISysImportFanRecordService
@Override
public int deleteSysImportFanRecordById(Long id)
{
return sysImportFanRecordMapper.deleteSysImportFanRecordById(id);
int row = sysImportFanRecordMapper.deleteSysImportFanRecordById(id);
if(row > 0){
Long[] ids = {id};
sysImportFanWxAccountService.deleteSysImportFanWxAccountByFanRecordIds(ids);
}
return row;
}
//查询总导粉数量
public int selectTotalSysImportFanNum(SysImportFanRecord sysImportFanRecord){
return sysImportFanRecordMapper.selectTotalSysImportFanNum(sysImportFanRecord);
}
}

View File

@ -114,4 +114,13 @@ public class SysImportFanWxAccountServiceImpl implements ISysImportFanWxAccountS
public List<Map<String,Object>> getTotalImportFanNum(SysImportFanWxAccount sysImportFanWxAccount){
return sysImportFanWxAccountMapper.getTotalImportFanNum(sysImportFanWxAccount);
}
/**
* 根据记录ID删除对应所有微信
* @param ids
* @return
*/
public int deleteSysImportFanWxAccountByFanRecordIds(Long[] ids){
return sysImportFanWxAccountMapper.deleteSysImportFanWxAccountByFanRecordIds(ids);
}
}

View File

@ -54,7 +54,16 @@
where fc.del_flag = 0
<if test="importFanDate != null "> and fc.import_fan_date = #{importFanDate}</if>
<if test="importFanChannel != null "> and fc.import_fan_channel = #{importFanChannel}</if>
<if test="importFanLive != null "> and fc.import_fan_live = #{importFanLive}</if>
order by fc.import_fan_date desc,fc.import_fan_channel asc
</select>
<select id="selectTotalSysImportFanNum" parameterType="SysImportFanRecord" resultType="int">
select sum(fwa.import_fan_num)
from sys_import_fan_record as fc
left join sys_import_fan_wx_account fwa on fwa.import_fan_record_id = fc.id and fwa.del_flag = 0
where fc.del_flag = 0
<if test="importFanDate != null "> and fc.import_fan_date = #{importFanDate}</if>
<if test="importFanChannel != null "> and fc.import_fan_channel = #{importFanChannel}</if>
</select>
<select id="selectSysImportFanRecordById" parameterType="Long" resultMap="SysImportFanRecordResult">

View File

@ -105,4 +105,12 @@
group by w.import_wx_account_id order by w.import_wx_account_id desc
</select>
<!-- 根据导粉ID删除对应所有微信记录 -->
<update id="deleteSysImportFanWxAccountByFanRecordIds" parameterType="String">
update sys_import_fan_wx_account set del_flag = 1 where import_fan_record_id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</update>
</mapper>