未打卡用户列表

This commit is contained in:
xiezhijun 2021-08-02 18:15:26 +08:00
parent 3000bbbbbe
commit 238042409d
8 changed files with 300 additions and 7 deletions

View File

@ -10,6 +10,7 @@ import com.stdiet.common.utils.DateUtils;
import com.stdiet.common.utils.StringUtils;
import com.stdiet.common.utils.oss.AliyunOSSUtils;
import com.stdiet.common.utils.poi.ExcelUtil;
import com.stdiet.custom.domain.SysCustomer;
import com.stdiet.custom.domain.SysWxUserInfo;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.page.WxLogInfo;
@ -223,4 +224,16 @@ public class SysWxUserLogController extends BaseController {
}
return toAjax(row);
}
/**
* 查询指定日期未打卡用户
*/
@PreAuthorize("@ss.hasPermi('custom:wxUserLog:list')")
@GetMapping("/selectNotPunchCustomerByDate")
public TableDataInfo selectNotPunchCustomerByDate(SysCustomer sysCustomer) {
startPage();
List<SysCustomer> list = sysWxUserLogService.selectNotPunchCustomerByDate(sysCustomer);
return getDataTable(list);
}
}

View File

@ -2,9 +2,11 @@ package com.stdiet.custom.mapper;
import java.util.List;
import com.stdiet.custom.domain.SysCustomer;
import com.stdiet.custom.domain.SysWxUserInfo;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.dto.response.CommunityPunchReponse;
import com.stdiet.custom.dto.response.CustomerListResponse;
import com.stdiet.custom.page.WxLogInfo;
/**
@ -113,4 +115,10 @@ public interface SysWxUserLogMapper
*/
int getPunchCustomerTotalNum();
/**
* 根据日期营养师助理售后查询指定日期未打卡的客户信息
* @return
*/
List<SysCustomer> selectNotPunchCustomerByDate(SysCustomer sysCustomer);
}

View File

@ -2,6 +2,7 @@ package com.stdiet.custom.service;
import java.util.List;
import com.stdiet.custom.domain.SysCustomer;
import com.stdiet.custom.domain.SysWxUserInfo;
import com.stdiet.custom.domain.SysWxUserLog;
import com.stdiet.custom.dto.response.CommunityPunchReponse;
@ -115,4 +116,10 @@ public interface ISysWxUserLogService
*/
int getPunchCustomerTotalNum();
/**
* 根据日期营养师助理售后查询指定日期未打卡的客户信息
* @return
*/
List<SysCustomer> selectNotPunchCustomerByDate(SysCustomer sysCustomer);
}

View File

@ -8,6 +8,7 @@ import com.stdiet.common.utils.DateUtils;
import com.stdiet.common.utils.file.FileUploadUtils;
import com.stdiet.common.utils.file.MimeTypeUtils;
import com.stdiet.common.utils.oss.AliyunOSSUtils;
import com.stdiet.custom.domain.SysCustomer;
import com.stdiet.custom.domain.SysMessageNotice;
import com.stdiet.custom.domain.SysWxUserInfo;
import com.stdiet.custom.domain.entityEnum.MessageNoticeEnum;
@ -170,4 +171,13 @@ public class SysWxUserLogServiceImpl implements ISysWxUserLogService {
return sysWxUserLogMapper.getPunchCustomerTotalNum();
}
/**
* 根据日期营养师助理售后查询指定日期未打卡的客户信息
* @return
*/
@Override
public List<SysCustomer> selectNotPunchCustomerByDate(SysCustomer sysCustomer){
return sysWxUserLogMapper.selectNotPunchCustomerByDate(sysCustomer);
}
}

View File

@ -414,5 +414,35 @@
select count(wxlog.openid) from sys_wx_user_log wxlog where wxlog.del_flag = 0 and to_days(log_time) = to_days(now())
</select>
<!-- 根据日期查询该日期中未打卡客户(根据食谱计划判断今日是否需要打卡) -->
<select id="selectNotPunchCustomerByDate" parameterType="SysCustomer" resultType="SysCustomer">
select plan.cus_id as id, cus.name, cus.main_dietitian as mainDietitian, cus.assistant_dietitian as assistantDietitian,cus.after_dietitian as afterDietitian from
(
select DISTINCT cus_id from sys_recipes_plan where end_date >= DATE_FORMAT(#{startDate},'%Y-%m-%d') and DATE_FORMAT(#{startDate},'%Y-%m-%d') >= start_date and del_flag = 0 and instr(pause_date, DATE_FORMAT(#{startDate},'%Y%m%d')) = 0
) as plan
left join sys_customer cus on cus.id = plan.cus_id and cus.del_flag = 0
where plan.cus_id not in
(
select info.cus_id from sys_wx_user_log log left join sys_wx_user_info info on info.openid = log.openid
where log.del_flag = 0 and DATE_FORMAT(log.log_time,'%Y-%m-%d') = DATE_FORMAT(#{startDate},'%Y-%m-%d')
)
<if test="mainDietitian != null">
and cus.main_dietitian = #{mainDietitian}
</if>
<if test="assistantDietitian != null">
and cus.assistant_dietitian = #{assistantDietitian}
</if>
<if test="afterDietitian != null">
and cus.after_dietitian = #{afterDietitian}
</if>
order by plan.cus_id desc
</select>
</mapper>

View File

@ -79,6 +79,17 @@ export function commentPunchContent(data) {
})
}
// 查询未打卡用户列表
export function getNotPunchCustomer(query) {
return request({
url: '/custom/wxUserLog/selectNotPunchCustomerByDate',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,208 @@
<template>
<!-- -->
<!-- 查询未打卡客户信息 -->
<el-dialog :title="title" :visible.sync="open" width="1050px" :close-on-click-modal="false" append-to-body @closed="cancel">
<!--<div style="margin-bottom: 20px;color:red"></div>-->
<el-form :model="queryParams" ref="queryForm" :inline="true" >
<el-form-item label="打卡日期" prop="startDate" >
<el-date-picker
v-model="queryParams.startDate"
align="right"
type="date"
placeholder="选择打卡日期"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions">
</el-date-picker>
</el-form-item>
<el-form-item label="营养师" prop="mainDietitian" >
<el-select
v-model="queryParams.mainDietitian"
placeholder="请选择销售"
clearable
filterable
size="small"
>
<el-option
v-for="dict in nutritionistIdOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
/>
</el-select>
</el-form-item>
<!--<el-form-item label="营养师助理" prop="assistantDietitian" label-width="50px">
<el-select
v-model="queryParams.assistantDietitian"
placeholder="请选择销售"
clearable
filterable
size="small"
>
<el-option
v-for="dict in nutriAssisIdOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
/>
</el-select>
</el-form-item>-->
<el-form-item label="售后" prop="afterDietitian" >
<el-select
v-model="queryParams.afterDietitian"
placeholder="请选择销售"
clearable
filterable
size="small"
>
<el-option
v-for="dict in afterSaleIdOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="parseInt(dict.dictValue)"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<div style="height: 550px; overflow: auto">
<el-table v-loading="loading" :data="notPunchCustomerList">
<el-table-column label="客户姓名" align="center" prop="name" />
<el-table-column label="营养师" align="center" prop="mainDietitian" :formatter="nutritionistFormat"/>
<el-table-column label="售后营养师" align="center" prop="afterDietitian" :formatter="afterDietitianFormat"/>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getNotLunchCustomer"
/>
</div>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取消</el-button>
</div>
</el-dialog>
</template>
<script>
import { getNotPunchCustomer } from "@/api/custom/wxUserLog";
import { mapGetters } from "vuex";
import dayjs from "dayjs";
const nowTime = dayjs().format("YYYY-MM-DD");
export default {
name: "NotPunchCustomer",
components: {
},
data() {
return {
//
loading: true,
//
title: "",
//
open: false,
total: 0,
//
rules: {
},
queryParams:{
startDate: nowTime,
mainDietitian: null,
assistantDietitian: null,
afterDietitian: null,
pageNum: 1,
pageSize: 10
},
pickerOptions: {
disabledDate(time) {
return time.getTime() > Date.now();
},
},
notPunchCustomerList: [],
nutritionistIdOptions: [],
afterSaleIdOptions: []
};
},
created(){
},
computed: {
...mapGetters([
//
//"preSaleIdOptions"
]),
},
methods: {
showDialog(queryParams, nutritionistIdOptions, afterSaleIdOptions) {
this.nutritionistIdOptions = nutritionistIdOptions != null ? nutritionistIdOptions.slice(1) : [];
this.afterSaleIdOptions = afterSaleIdOptions != null ? afterSaleIdOptions.slice(1) : [];
this.queryParams.startDate = queryParams.startDate != null ? queryParams.startDate : nowTime;
this.queryParams.mainDietitian = queryParams.nutritionistId != null ? queryParams.nutritionistId : null;
this.queryParams.afterDietitian = queryParams.afterNutritionistId != null ? queryParams.afterNutritionistId : null;
this.title = "未打卡用户列表";
this.reset();
this.getNotLunchCustomer();
this.open = true;
},
reset(){
},
/** 提交按钮 */
submitForm() {
},
onClosed() {
this.reset();
},
cancel(){
this.open = false;
this.reset();
},
//
getNotLunchCustomer() {
getNotPunchCustomer(this.queryParams).then((response) => {
/*response.data.forEach((item,index) => {
item.liveRoomName = item.liveNutritionistName + " " + item.liveRoomName;
});*/
this.notPunchCustomerList = response.rows;
this.total = response.total;
this.loading = false;
});
},
handleQuery(){
this.getNotLunchCustomer();
},
resetQuery(){
this.queryParams = {
startDate: nowTime,
mainDietitian: null,
assistantDietitian: null,
afterDietitian: null
};
},
//
nutritionistFormat(row, column) {
return this.selectDictLabel(this.nutritionistIdOptions, row.mainDietitian);
},
//
nutriAssisFormat(row, column) {
return this.selectDictLabel(this.nutriAssisIdOptions, row.assistantDietitian);
},
//
afterDietitianFormat(row, column) {
return this.selectDictLabel(this.afterSaleIdOptions, row.afterDietitian);
},
}
};
</script>
<style lang="scss" scoped>
</style>

View File

@ -81,16 +81,15 @@
</el-form>
<el-row :gutter="10" class="mb8">
<!--<el-col :span="1.5">
<el-col :span="1.5">
<el-button
type="primary"
icon="el-icon-plus"
icon="el-icon-s-flag"
size="mini"
@click="handleAdd"
v-hasPermi="['custom:wxUserLog:add']"
>新增
@click="showNotLunch()"
>未打卡客户列表
</el-button>
</el-col>-->
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
@ -298,6 +297,8 @@
<PunchLogEdit ref="punchLogEditRef"></PunchLogEdit>
<!-- 详情 -->
<PunchLogDetail ref="punchLogDetailRef"></PunchLogDetail>
<!-- 未打卡用户 -->
<NotPunchCustomer ref="notPunchCustomerRef"></NotPunchCustomer>
</div>
</template>
@ -314,6 +315,7 @@ import { mapGetters } from "vuex";
import PunchLogDetail from "@/components/PunchLog/PunchLogDetail";
import PunchLogEdit from "@/components/PunchLog/PunchLogEdit";
import AutoHideMessage from "@/components/AutoHideMessage";
import NotPunchCustomer from "@/components/PunchLog/NotPunchCustomer"
import dayjs from "dayjs";
export default {
name: "WxUserLog",
@ -369,7 +371,7 @@ export default {
};
},
components:{
PunchLogDetail,AutoHideMessage,PunchLogEdit
PunchLogDetail,AutoHideMessage,PunchLogEdit,NotPunchCustomer
},
created() {
this.getList();
@ -563,6 +565,10 @@ export default {
})
.catch(function () {});
},
showNotLunch(){
this.queryParams.startDate = this.logTimeScope && this.logTimeScope.length > 0 ? this.logTimeScope[0] : null;
this.$refs.notPunchCustomerRef.showDialog(this.queryParams, this.nutritionistIdOptions,this.afterSaleIdOptions);
}
},
};
</script>