Merge branch 'wcd-2411-update' into dengjh-2507-update
10 files added
9 files modified
| | |
| | | <!-- <version>4.7.2.B</version>-->
|
| | | <version>4.7.7-20250915.094526</version>
|
| | | </dependency>
|
| | | <dependency>
|
| | | <groupId>redis.clients</groupId>
|
| | | <artifactId>jedis</artifactId>
|
| | | <version>3.3.0</version>
|
| | | </dependency>
|
| | |
|
| | | <!-- 模拟前端渲染 -->
|
| | | <dependency>
|
| | |
| | | package me.zhengjie.config; |
| | | |
| | | import com.binarywang.spring.starter.wxjava.cp.properties.WxCpProperties; |
| | | import com.binarywang.spring.starter.wxjava.cp.properties.WxCpRedisProperties; |
| | | import me.chanjar.weixin.cp.api.WxCpService; |
| | | import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl; |
| | | import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl; |
| | | import me.chanjar.weixin.cp.config.impl.WxCpJedisConfigImpl; |
| | | import me.chanjar.weixin.cp.config.impl.WxCpRedisTemplateConfigImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import redis.clients.jedis.JedisPool; |
| | | import redis.clients.jedis.JedisPoolConfig; |
| | | |
| | | /** |
| | | * @author baoLh |
| | |
| | | |
| | | @Bean |
| | | public WxCpService wxCpService() { |
| | | // // 默认缓存配置 |
| | | // WxCpDefaultConfigImpl configStorage = new WxCpDefaultConfigImpl(); |
| | | |
| | | WxCpDefaultConfigImpl configStorage; |
| | | if (wxCpProperties.getConfigStorage().getType().equals(WxCpProperties.StorageType.redistemplate)) { |
| | | // redis缓存配置 |
| | | StringRedisTemplate redisTemplate = applicationContext.getBean(StringRedisTemplate.class); |
| | | WxCpDefaultConfigImpl configStorage = new WxCpRedisTemplateConfigImpl(redisTemplate, wxCpProperties.getConfigStorage().getKeyPrefix()); |
| | | configStorage = new WxCpRedisTemplateConfigImpl(redisTemplate, wxCpProperties.getConfigStorage().getKeyPrefix()); |
| | | } else if (wxCpProperties.getConfigStorage().getType().equals(WxCpProperties.StorageType.jedis)) { |
| | | // jedis配置 |
| | | WxCpRedisProperties wxCpRedisProperties = wxCpProperties.getConfigStorage().getRedis(); |
| | | JedisPool jedisPool; |
| | | if (wxCpRedisProperties != null && StringUtils.isNotEmpty(wxCpRedisProperties.getHost())) { |
| | | jedisPool = getJedisPool(); |
| | | } else { |
| | | jedisPool = applicationContext.getBean(JedisPool.class); |
| | | } |
| | | configStorage = new WxCpJedisConfigImpl(jedisPool, wxCpProperties.getConfigStorage().getKeyPrefix()); |
| | | } else { |
| | | // 默认缓存配置 |
| | | configStorage = new WxCpDefaultConfigImpl(); |
| | | } |
| | | |
| | | // 基本配置 |
| | | configStorage.setCorpId(wxCpProperties.getCorpId()); |
| | | configStorage.setAgentId(wxCpProperties.getAgentId()); |
| | | configStorage.setCorpSecret(wxCpProperties.getCorpSecret()); |
| | |
| | | |
| | | return wxCpService; |
| | | } |
| | | |
| | | private JedisPool getJedisPool() { |
| | | WxCpProperties.ConfigStorage storage = wxCpProperties.getConfigStorage(); |
| | | WxCpRedisProperties redis = storage.getRedis(); |
| | | |
| | | JedisPoolConfig config = new JedisPoolConfig(); |
| | | if (redis.getMaxActive() != null) { |
| | | config.setMaxTotal(redis.getMaxActive()); |
| | | } |
| | | if (redis.getMaxIdle() != null) { |
| | | config.setMaxIdle(redis.getMaxIdle()); |
| | | } |
| | | if (redis.getMaxWaitMillis() != null) { |
| | | config.setMaxWaitMillis(redis.getMaxWaitMillis()); |
| | | } |
| | | if (redis.getMinIdle() != null) { |
| | | config.setMinIdle(redis.getMinIdle()); |
| | | } |
| | | config.setTestOnBorrow(true); |
| | | config.setTestWhileIdle(true); |
| | | |
| | | return new JedisPool(config, redis.getHost(), redis.getPort(), |
| | | redis.getTimeout(), redis.getPassword(), redis.getDatabase()); |
| | | } |
| | | } |
| | |
| | | Map<String, String> robotParamMap = dictDetailRepository.findByDictName(Constant.WECOM_ROBOT_PARAM).stream().collect(Collectors.toMap(DictDetail::getLabel, DictDetail::getValue)); |
| | | if (robotParamMap.containsKey(Constant.REMIND_REPORT_WEBHOOK_KEY) && robotParamMap.containsKey(Constant.REMIND_REPORT_MSG)) { |
| | | // 发送消息 |
| | | WxCpDefaultConfigImpl wxCpDefaultConfig = new WxCpDefaultConfigImpl(); |
| | | wxCpDefaultConfig.setWebhookKey(robotParamMap.get(Constant.REMIND_REPORT_WEBHOOK_KEY)); |
| | | wxCpService.setWxCpConfigStorage(wxCpDefaultConfig); |
| | | wxCpService.getGroupRobotService().sendText(robotParamMap.get(Constant.REMIND_REPORT_MSG), Arrays.asList("@all"), Arrays.asList()); |
| | | String webhookUrl = wxCpService.getWxCpConfigStorage().getApiUrl("/cgi-bin/webhook/send?key=") + robotParamMap.get(Constant.REMIND_REPORT_WEBHOOK_KEY); |
| | | wxCpService.getGroupRobotService().sendText(webhookUrl, robotParamMap.get(Constant.REMIND_REPORT_MSG), Arrays.asList("@all"), Arrays.asList()); |
| | | } |
| | | } catch (WxErrorException wxErrorException) { |
| | | wxErrorException.printStackTrace(); |
| | |
| | | Map<String, String> robotParamMap = dictDetailRepository.findByDictName(Constant.WECOM_ROBOT_PARAM).stream().collect(Collectors.toMap(DictDetail::getLabel, DictDetail::getValue)); |
| | | if (robotParamMap.containsKey(Constant.REMIND_REPORT_WEBHOOK_KEY) && robotParamMap.containsKey(Constant.REMIND_REPORT_SUCCESS_MSG)) { |
| | | // 发送周报生成成功消息 |
| | | WxCpDefaultConfigImpl wxCpDefaultConfig = new WxCpDefaultConfigImpl(); |
| | | wxCpDefaultConfig.setWebhookKey(robotParamMap.get(Constant.REMIND_REPORT_WEBHOOK_KEY)); |
| | | wxCpService.setWxCpConfigStorage(wxCpDefaultConfig); |
| | | wxCpService.getGroupRobotService().sendText(robotParamMap.get(Constant.REMIND_REPORT_SUCCESS_MSG), Arrays.asList("@all"), Arrays.asList()); |
| | | String webhookUrl = wxCpService.getWxCpConfigStorage().getApiUrl("/cgi-bin/webhook/send?key=") + robotParamMap.get(Constant.REMIND_REPORT_WEBHOOK_KEY); |
| | | wxCpService.getGroupRobotService().sendText(webhookUrl, robotParamMap.get(Constant.REMIND_REPORT_SUCCESS_MSG), Arrays.asList("@all"), Arrays.asList()); |
| | | } |
| | | } catch (WxErrorException wxErrorException) { |
| | | wxErrorException.printStackTrace(); |
| | |
| | | port: ${REDIS_PORT:6379}
|
| | | password: ${REDIS_PWD:}
|
| | | timeout: 5000
|
| | |
|
| | | # max-active: 50
|
| | | # max-idle: 20
|
| | | # max-wait-millis: 1000
|
| | | # min-idle: 10
|
| New file |
| | |
| | | <template> |
| | | <el-dialog |
| | | title="删除提示" |
| | | :visible.sync="dialogVisible" |
| | | width="800px" |
| | | :before-close="handleClose" |
| | | > |
| | | <div style="max-height: calc(80vh - 160px); overflow-y: scroll;"> |
| | | <div style="font-size: 16px; font-weight: 600; margin-bottom: 20px;">当前删除的申请使用了【企微审核】,无法在系统内删除,请根据不同操作设备参照以下步骤在【企业微信】操作撤回申请:</div> |
| | | <el-collapse v-model="activeNames" @change="handleChange"> |
| | | <el-collapse-item name="WEB"> |
| | | <template slot="title"> |
| | | <span style="font-size: 16px; font-weight: 600;">1.电脑端操作</span> |
| | | <span v-if="!activeNames.includes('WEB')" style="font-size: 12px; color: #999999; margin-left: 20px;">点击展开查看</span> |
| | | </template> |
| | | <div class="steps-image-box"> |
| | | <el-image v-for="(webImage, webIndex) in webImageList" :key="'web_image_' + webIndex" class="steps-image" :src="webImage" fit="contain" :preview-src-list="webImageList" /> |
| | | </div> |
| | | </el-collapse-item> |
| | | <el-collapse-item name="APP"> |
| | | <template slot="title"> |
| | | <span style="font-size: 16px; font-weight: 600;">2.手机端操作</span> |
| | | <span v-if="!activeNames.includes('APP')" style="font-size: 12px; color: #999999; margin-left: 20px;">点击展开查看</span> |
| | | </template> |
| | | <div class="steps-image-box"> |
| | | <el-image v-for="(appImage, appIndex) in appImageList" :key="'web_image_' + appIndex" class="steps-image" :src="appImage" fit="contain" :preview-src-list="appImageList" /> |
| | | </div> |
| | | </el-collapse-item> |
| | | </el-collapse> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="dialogVisible = false">我已知晓</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import Web1 from '@/assets/images/cp_approval_del/web/1.png' |
| | | import Web2 from '@/assets/images/cp_approval_del/web/2.png' |
| | | import Web3 from '@/assets/images/cp_approval_del/web/3.png' |
| | | import Web4 from '@/assets/images/cp_approval_del/web/4.png' |
| | | import App1 from '@/assets/images/cp_approval_del/app/1.jpg' |
| | | import App2 from '@/assets/images/cp_approval_del/app/2.jpg' |
| | | import App3 from '@/assets/images/cp_approval_del/app/3.jpg' |
| | | import App4 from '@/assets/images/cp_approval_del/app/4.jpg' |
| | | import App5 from '@/assets/images/cp_approval_del/app/5.jpg' |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | dialogVisible: false, |
| | | activeNames: [], |
| | | webImageList: [Web1, Web2, Web3, Web4], |
| | | appImageList: [App1, App2, App3, App4, App5] |
| | | } |
| | | }, |
| | | methods: { |
| | | handleOpen() { |
| | | const that = this |
| | | that.dialogVisible = true |
| | | }, |
| | | handleClose() { |
| | | const that = this |
| | | that.dialogVisible = false |
| | | }, |
| | | handleChange(val) { |
| | | const that = this |
| | | that.activeNames = val |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .steps-image-box { |
| | | display: flex; |
| | | flex-wrap: wrap; |
| | | gap: 12px; |
| | | padding: 12px; |
| | | } |
| | | .steps-image { |
| | | width: 200px; |
| | | border-radius: 5px; |
| | | border: 1px solid #999999; |
| | | } |
| | | </style> |
| | |
| | | </el-table> |
| | | <!--分页组件--> |
| | | <pagination /> |
| | | |
| | | <cp-approval-del-dialog ref="cpApprovalDelDialog" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import approvalLine from '@/components/ApprovalLine' |
| | | import cpApprovalDelDialog from '@/components/CpApprovalDelDialog' |
| | | import constant from '../../../utils/constant' |
| | | |
| | | const defaultForm = { |
| | |
| | | } |
| | | export default { |
| | | name: 'AttendanceBusinessTravel', |
| | | components: { pagination, crudOperation, rrOperation, udOperation, approvalLine }, |
| | | components: { pagination, crudOperation, rrOperation, udOperation, approvalLine, cpApprovalDelDialog }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | cruds() { |
| | | return CRUD({ |
| | |
| | | this.form.userId = this.user.id |
| | | } |
| | | }, |
| | | // 钩子:删除 - 之前 |
| | | [CRUD.HOOK.beforeDelete]() { |
| | | const that = this |
| | | if (that.crud.selections.some(selection => selection.wecomSpNo !== null && selection.wecomSpNo !== undefined && selection.wecomSpNo !== '')) { |
| | | that.$refs.cpApprovalDelDialog.handleOpen() |
| | | that.crud.delAllLoading = false |
| | | return false |
| | | } |
| | | return true |
| | | }, |
| | | // 禁用 |
| | | disabledUser(data) { |
| | | if (this.userRolesLevelMin > this.roleLevelGenerl) { |
| | |
| | | </el-table> |
| | | <!--分页组件--> |
| | | <pagination /> |
| | | |
| | | <cp-approval-del-dialog ref="cpApprovalDelDialog" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import approvalLine from '@/components/ApprovalLine' |
| | | import cpApprovalDelDialog from '@/components/CpApprovalDelDialog' |
| | | import constant from '../../../utils/constant' |
| | | |
| | | const defaultForm = { id: null, userId: null, userName: null, approvalUserId: null, cardReplacementTime: null, cardReplacementReason: null, approvalStatus: null, approvalDescription: null, cardReplacementDistinguish: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null, wecomSpNo: null, event: null } |
| | | export default { |
| | | name: 'AttendanceCardreplacement', |
| | | components: { pagination, crudOperation, rrOperation, udOperation, approvalLine }, |
| | | components: { pagination, crudOperation, rrOperation, udOperation, approvalLine, cpApprovalDelDialog }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | // 数据字典 |
| | | dicts: [constant.CARD_REPLACEMENT_DIFFERENTIATION, constant.CARD_APPROVE_STATUS, constant.APPROVAL_SITE_TYPE], |
| | |
| | | this.form.approvalUserId = 0 |
| | | } |
| | | }, |
| | | // 钩子:删除 - 之前 |
| | | [CRUD.HOOK.beforeDelete]() { |
| | | const that = this |
| | | if (that.crud.selections.some(selection => selection.wecomSpNo !== null && selection.wecomSpNo !== undefined && selection.wecomSpNo !== '')) { |
| | | that.$refs.cpApprovalDelDialog.handleOpen() |
| | | that.crud.delAllLoading = false |
| | | return false |
| | | } |
| | | return true |
| | | }, |
| | | // 禁用 |
| | | disabledUser(data) { |
| | | if (this.userRolesLevelMin > this.roleLevelGenerl) { |
| | |
| | | </el-table> |
| | | <!--分页组件--> |
| | | <pagination /> |
| | | |
| | | <cp-approval-del-dialog ref="cpApprovalDelDialog" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import approvalLine from '@/components/ApprovalLine' |
| | | import cpApprovalDelDialog from '@/components/CpApprovalDelDialog' |
| | | import constant from '@/utils/constant' |
| | | |
| | | const defaultForm = { |
| | |
| | | } |
| | | export default { |
| | | name: 'AttendanceGoOut', |
| | | components: { pagination, crudOperation, rrOperation, udOperation, approvalLine }, |
| | | components: { pagination, crudOperation, rrOperation, udOperation, approvalLine, cpApprovalDelDialog }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | cruds() { |
| | | return CRUD({ |
| | |
| | | this.form.userId = this.user.id |
| | | } |
| | | }, |
| | | // 钩子:删除 - 之前 |
| | | [CRUD.HOOK.beforeDelete]() { |
| | | const that = this |
| | | if (that.crud.selections.some(selection => selection.wecomSpNo !== null && selection.wecomSpNo !== undefined && selection.wecomSpNo !== '')) { |
| | | that.$refs.cpApprovalDelDialog.handleOpen() |
| | | that.crud.delAllLoading = false |
| | | return false |
| | | } |
| | | return true |
| | | }, |
| | | // 禁用 |
| | | disabledUser(data) { |
| | | if (this.userRolesLevelMin > this.roleLevelGenerl) { |
| | |
| | | </el-table> |
| | | <!--分页组件--> |
| | | <pagination /> |
| | | |
| | | <cp-approval-del-dialog ref="cpApprovalDelDialog" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import approvalLine from '@/components/ApprovalLine' |
| | | import cpApprovalDelDialog from '@/components/CpApprovalDelDialog' |
| | | import constant from '@/utils/constant' |
| | | |
| | | const defaultForm = { id: null, userId: null, approvalUserId: null, leaveType: null, leaveStartTime: null, leaveEndTime: null, leaveDuration: null, leaveDurationUnit: null, leaveReason: null, approvalStatus: null, approvalDescription: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null, wecomSpNo: null, event: null } |
| | | export default { |
| | | name: 'AttendanceLeave', |
| | | components: { pagination, crudOperation, rrOperation, udOperation, approvalLine }, |
| | | components: { pagination, crudOperation, rrOperation, udOperation, approvalLine, cpApprovalDelDialog }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | cruds() { |
| | | return CRUD({ title: '请假记录', url: 'api/attendanceLeave', idField: 'id', sort: 'leaveStartTime,desc', crudMethod: { ...crudAttendanceLeave }}) |
| | |
| | | this.form.userId = this.user.id |
| | | } |
| | | }, |
| | | // 钩子:删除 - 之前 |
| | | [CRUD.HOOK.beforeDelete]() { |
| | | const that = this |
| | | if (that.crud.selections.some(selection => selection.wecomSpNo !== null && selection.wecomSpNo !== undefined && selection.wecomSpNo !== '')) { |
| | | that.$refs.cpApprovalDelDialog.handleOpen() |
| | | that.crud.delAllLoading = false |
| | | return false |
| | | } |
| | | return true |
| | | }, |
| | | // 钩子:在编辑之前执行 |
| | | // [CRUD.HOOK.beforeToEdit]() { |
| | | // this.getUserTimes() |
| | |
| | | </el-table> |
| | | <!--分页组件--> |
| | | <pagination /> |
| | | |
| | | <cp-approval-del-dialog ref="cpApprovalDelDialog" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import approvalLine from '@/components/ApprovalLine' |
| | | import cpApprovalDelDialog from '@/components/CpApprovalDelDialog' |
| | | import constant from '@/utils/constant' |
| | | import { mapGetters } from 'vuex' |
| | | |
| | | const defaultForm = { id: null, userId: null, approvalUserId: null, overtimeStartTime: null, overtimeEndTime: null, overtimeDuration: null, overtimeDurationUnit: null, approvalStatus: null, approvalDescription: null, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null, wecomSpNo: null, event: null } |
| | | export default { |
| | | name: 'AttendanceOvertime', |
| | | components: { pagination, crudOperation, rrOperation, udOperation, approvalLine }, |
| | | components: { pagination, crudOperation, rrOperation, udOperation, approvalLine, cpApprovalDelDialog }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | cruds() { |
| | | return CRUD({ title: '考勤加班', url: 'api/attendanceOvertime', idField: 'id', sort: 'id,desc', crudMethod: { ...crudAttendanceOvertime }}) |
| | |
| | | this.form.userId = this.user.id |
| | | } |
| | | }, |
| | | // 钩子:删除 - 之前 |
| | | [CRUD.HOOK.beforeDelete]() { |
| | | const that = this |
| | | if (that.crud.selections.some(selection => selection.wecomSpNo !== null && selection.wecomSpNo !== undefined && selection.wecomSpNo !== '')) { |
| | | that.$refs.cpApprovalDelDialog.handleOpen() |
| | | that.crud.delAllLoading = false |
| | | return false |
| | | } |
| | | return true |
| | | }, |
| | | // 查询员工 |
| | | getUsers() { |
| | | crudUser.getAll().then(res => { |