8 files modified
9 files renamed
2 files copied
7 files added
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @GetMapping("/batchSendNotice") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "批量发送通知") |
| | | public R<SmsTemplateVO> batchSendNotice(@RequestParam("templateId") Long smsTaskId) { |
| | | Boolean aBoolean = iSmsSendService.batchSendNotice( smsTaskId); |
| | | return R.status(aBoolean); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | package org.springblade.modules.sms.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | |
| | | import org.springblade.modules.sms.wrapper.SmsTemplateWrapper; |
| | | import org.springblade.modules.sms.service.ISmsTemplateService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 短信模版表 控制器 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 短信模版表 分页 |
| | | */ |
| | | @GetMapping("/customList") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "不分页", notes = "传入smsTemplate") |
| | | public R<List<SmsTemplateEntity>> customList() { |
| | | List<SmsTemplateEntity> list = smsTemplateService.list(Wrappers.<SmsTemplateEntity>lambdaQuery().eq(SmsTemplateEntity::getIsDeleted, 0)); |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 短信模版表 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | |
| | | Boolean loginSendVerificationCode(String phone); |
| | | |
| | | String checkCode(String phone, String code); |
| | | |
| | | Boolean batchSendNotice(Long smsTaskId); |
| | | } |
| | |
| | | import org.springblade.modules.sms.service.ISmsTemplateService; |
| | | import org.springblade.modules.sms.entity.SmsRecordEntity; |
| | | import org.springblade.modules.sms.service.ISmsRecordService; |
| | | import org.springblade.modules.smsTask.entity.SmsTaskEntity; |
| | | import org.springblade.modules.smsTask.service.ISmsTaskService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.system.vo.UserVO; |
| | | import org.springblade.modules.task.entity.TaskPlaceSelfCheckEntity; |
| | |
| | | return ""; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean batchSendNotice(Long smsTaskId) { |
| | | ISmsTaskService taskService = SpringUtils.getBean(ISmsTaskService.class); |
| | | SmsTaskEntity smsTaskEntity = taskService.getById(smsTaskId); |
| | | |
| | | Sms serviceOne = iSmsService.getOne(Wrappers.<Sms>lambdaQuery().eq(Sms::getStatus, 2)); |
| | | if (serviceOne == null) { |
| | | logger.error("未找到状态为2的Sms服务"); |
| | | return false; |
| | | } |
| | | SmsTemplateEntity smsTemplateEntity = iSmsTemplateService.getOne(Wrappers.<SmsTemplateEntity>lambdaQuery() |
| | | .eq(SmsTemplateEntity::getId, smsTaskEntity.getSmsTemplate())); |
| | | if (smsTemplateEntity == null) { |
| | | logger.error("未找到对应的短信模板"); |
| | | return false; |
| | | } |
| | | |
| | | //发送的手机号 |
| | | List<Map> phonesList = new ArrayList<>(); |
| | | Map phoneMap = new HashMap(); |
| | | // phoneMap.put("phone", phone); |
| | | List<String> varList = new ArrayList<>(); |
| | | // 设置参数 |
| | | phoneMap.put("varList", varList); |
| | | phonesList.add(phoneMap); |
| | | //短信内容 |
| | | String content = smsTemplateEntity.getContent(); |
| | | //发送时间 |
| | | LocalDateTime nowDateTime = LocalDateTime.now(); |
| | | String send_time = nowDateTime.format(SECOND_FORMATTER); |
| | | Map params = new HashMap(); |
| | | params.put("phones", phonesList); |
| | | //短信主题 |
| | | params.put("subject", "对外接口不同内容发送-动态模板"); |
| | | params.put("content", content); |
| | | //短信模板 |
| | | params.put("template_id", null); |
| | | // 发送时间 |
| | | params.put("send_time", send_time); |
| | | //优先级,高级=5,中级=3,低级=1 |
| | | params.put("priority", "1"); |
| | | //不同内容发送类型,1=动态模板发送,2=文件内容发送 |
| | | params.put("type", "1"); |
| | | //创建人主键 |
| | | params.put("sop_create_by", serviceOne.getSmsCode()); |
| | | //短信发送记录 |
| | | // saveSmsRecord(phone, serviceOne, placeSelfCheckEntity.getPlaceName(), content); |
| | | Boolean aBoolean = sendSmsGet(serviceOne, params); |
| | | return aBoolean; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 发送短信并获取发送结果。 |
| | | * |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.smsTask.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.smsTask.entity.SmsTaskEntity; |
| | | import org.springblade.modules.smsTask.vo.SmsTaskVO; |
| | | import org.springblade.modules.smsTask.wrapper.SmsTaskWrapper; |
| | | import org.springblade.modules.smsTask.service.ISmsTaskService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | /** |
| | | * 短信发送任务 控制器 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-08-08 |
| | | */ |
| | | @RestController |
| | | @AllArgsConstructor |
| | | @RequestMapping("blade-smsTask/smsTask") |
| | | @Api(value = "短信发送任务", tags = "短信发送任务接口") |
| | | public class SmsTaskController extends BladeController { |
| | | |
| | | private final ISmsTaskService smsTaskService; |
| | | |
| | | /** |
| | | * 短信发送任务 详情 |
| | | */ |
| | | @GetMapping("/detail") |
| | | @ApiOperationSupport(order = 1) |
| | | @ApiOperation(value = "详情", notes = "传入smsTask") |
| | | public R<SmsTaskVO> detail(SmsTaskEntity smsTask) { |
| | | SmsTaskEntity detail = smsTaskService.getOne(Condition.getQueryWrapper(smsTask)); |
| | | return R.data(SmsTaskWrapper.build().entityVO(detail)); |
| | | } |
| | | /** |
| | | * 短信发送任务 分页 |
| | | */ |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入smsTask") |
| | | public R<IPage<SmsTaskVO>> list(SmsTaskEntity smsTask, Query query) { |
| | | IPage<SmsTaskEntity> pages = smsTaskService.page(Condition.getPage(query), Condition.getQueryWrapper(smsTask)); |
| | | return R.data(SmsTaskWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 短信发送任务 自定义分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入smsTask") |
| | | public R<IPage<SmsTaskVO>> page(SmsTaskVO smsTask, Query query) { |
| | | IPage<SmsTaskVO> pages = smsTaskService.selectSmsTaskPage(Condition.getPage(query), smsTask); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 短信发送任务 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入smsTask") |
| | | public R save(@Valid @RequestBody SmsTaskEntity smsTask) { |
| | | return R.status(smsTaskService.save(smsTask)); |
| | | } |
| | | |
| | | /** |
| | | * 短信发送任务 修改 |
| | | */ |
| | | @PostMapping("/update") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入smsTask") |
| | | public R update(@Valid @RequestBody SmsTaskEntity smsTask) { |
| | | return R.status(smsTaskService.updateById(smsTask)); |
| | | } |
| | | |
| | | /** |
| | | * 短信发送任务 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | | @ApiOperationSupport(order = 6) |
| | | @ApiOperation(value = "新增或修改", notes = "传入smsTask") |
| | | public R submit(@Valid @RequestBody SmsTaskEntity smsTask) { |
| | | return R.status(smsTaskService.saveOrUpdate(smsTask)); |
| | | } |
| | | |
| | | /** |
| | | * 短信发送任务 删除 |
| | | */ |
| | | @PostMapping("/remove") |
| | | @ApiOperationSupport(order = 7) |
| | | @ApiOperation(value = "逻辑删除", notes = "传入ids") |
| | | public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { |
| | | return R.status(smsTaskService.removeBatchByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | } |
copy from src/main/java/org/springblade/modules/customTask/dto/CustomTaskDTO.java
copy to src/main/java/org/springblade/modules/smsTask/dto/SmsTaskDTO.java
| File was copied from src/main/java/org/springblade/modules/customTask/dto/CustomTaskDTO.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.customTask.dto; |
| | | package org.springblade.modules.smsTask.dto; |
| | | |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.smsTask.entity.SmsTaskEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 自定义任务表 数据传输对象实体类 |
| | | * 短信发送任务 数据传输对象实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-07-30 |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CustomTaskDTO extends CustomTaskEntity { |
| | | public class SmsTaskDTO extends SmsTaskEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.smsTask.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 短信发送任务 实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Data |
| | | @TableName("jczz_sms_task") |
| | | @ApiModel(value = "SmsTask对象", description = "短信发送任务") |
| | | public class SmsTaskEntity { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | |
| | | /** id */ |
| | | @ApiModelProperty(value = "主键ID", example = "") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** 任务名称 */ |
| | | @ApiModelProperty(value = "任务名称", example = "") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | /** 社区 */ |
| | | @ApiModelProperty(value = "社区", example = "") |
| | | @TableField("community") |
| | | private String community; |
| | | |
| | | /** 创建时间 */ |
| | | @ApiModelProperty(value = "创建时间", example = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField(value = "create_time",fill = FieldFill.INSERT) |
| | | private Date createTime; |
| | | |
| | | /** 更新时间 */ |
| | | @ApiModelProperty(value = "更新时间", example = "") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | @TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE) |
| | | private Date updateTime; |
| | | |
| | | /** 短信模板id */ |
| | | @ApiModelProperty(value = "短信模板id", example = "") |
| | | @TableField("sms_template") |
| | | private Long smsTemplate; |
| | | |
| | | /** 0 :否 1 :是 */ |
| | | @ApiModelProperty(value = "0 :否 1 :是", example = "") |
| | | @TableField("delete_flag") |
| | | private String deleteFlag; |
| | | |
| | | /** 小区编码 */ |
| | | @ApiModelProperty(value = "小区ID", example = "") |
| | | @TableField("district_id") |
| | | private String districtId; |
| | | |
| | | /** 楼栋 */ |
| | | @ApiModelProperty(value = "楼栋", example = "") |
| | | @TableField("building_code") |
| | | private String buildingCode; |
| | | |
| | | @ApiModelProperty(value = "小区名称", example = "") |
| | | @TableField("district_name") |
| | | private String districtName; |
| | | |
| | | @ApiModelProperty(value = "楼栋名称", example = "") |
| | | @TableField("building_name") |
| | | private String buildingName; |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.smsTask.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.smsTask.dto.SmsTaskDTO; |
| | | import org.springblade.modules.smsTask.entity.SmsTaskEntity; |
| | | import org.springblade.modules.smsTask.vo.SmsTaskVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 短信发送任务 Mapper 接口 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface SmsTaskMapper extends BaseMapper<SmsTaskEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param smsTask |
| | | * @return |
| | | */ |
| | | List<SmsTaskVO> selectSmsTaskPage(IPage page, @Param("smsTask") SmsTaskVO smsTask); |
| | | /** |
| | | * 查询短信发送任务 |
| | | * |
| | | * @param id 短信发送任务ID |
| | | * @return 短信发送任务 |
| | | */ |
| | | public SmsTaskDTO selectSmsTaskById(Long id); |
| | | |
| | | /** |
| | | * 查询短信发送任务列表 |
| | | * |
| | | * @param smsTaskDTO 短信发送任务 |
| | | * @return 短信发送任务集合 |
| | | */ |
| | | public List<SmsTaskDTO> selectSmsTaskList(SmsTaskDTO smsTaskDTO); |
| | | |
| | | } |
| New file |
| | |
| | | <?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="org.springblade.modules.smsTask.mapper.SmsTaskMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="smsTaskResultMap" type="org.springblade.modules.smsTask.entity.SmsTaskEntity"> |
| | | </resultMap> |
| | | |
| | | |
| | | <select id="selectSmsTaskPage" resultMap="smsTaskResultMap"> |
| | | <include refid="selectSmsTask"/> |
| | | <where> |
| | | <if test="smsTask.id != null "> and id = #{smsTask.id}</if> |
| | | <if test="smsTask.name != null and smsTask.name != ''"> and name = #{smsTask.name}</if> |
| | | <if test="smsTask.community != null and smsTask.community != ''"> and community = #{smsTask.community}</if> |
| | | <if test="smsTask.createTime != null "> and create_time = #{smsTask.createTime}</if> |
| | | <if test="smsTask.updateTime != null "> and update_time = #{smsTask.updateTime}</if> |
| | | <if test="smsTask.smsTemplate != null "> and sms_template = #{smsTask.smsTemplate}</if> |
| | | <if test="smsTask.deleteFlag != null and smsTask.deleteFlag != ''"> and delete_flag = #{smsTask.deleteFlag}</if> |
| | | <if test="smsTask.aoiCode != null and smsTask.aoiCode != ''"> and district_id = #{smsTask.aoiCode}</if> |
| | | <if test="smsTask.buildingCode != null smsTask.and buildingCode != ''"> and building_code = #{smsTask.buildingCode}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | <resultMap type="org.springblade.modules.smsTask.dto.SmsTaskDTO" id="SmsTaskDTOResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="name" column="name" /> |
| | | <result property="community" column="community" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="smsTemplate" column="sms_template" /> |
| | | <result property="deleteFlag" column="delete_flag" /> |
| | | <result property="districtId" column="district_id" /> |
| | | <result property="buildingCode" column="building_code" /> |
| | | </resultMap> |
| | | |
| | | <sql id="selectSmsTask"> |
| | | select |
| | | id, |
| | | name, |
| | | community, |
| | | create_time, |
| | | update_time, |
| | | sms_template, |
| | | delete_flag, |
| | | district_id, |
| | | building_code, |
| | | building_name, |
| | | district_name |
| | | from |
| | | jczz_sms_task |
| | | </sql> |
| | | |
| | | <select id="selectSmsTaskById" parameterType="long" resultMap="SmsTaskDTOResult"> |
| | | <include refid="selectSmsTask"/> |
| | | where |
| | | id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectSmsTaskList" parameterType="org.springblade.modules.smsTask.dto.SmsTaskDTO" resultMap="SmsTaskDTOResult"> |
| | | <include refid="selectSmsTask"/> |
| | | <where> |
| | | <if test="id != null "> and id = #{id}</if> |
| | | <if test="name != null and name != ''"> and name = #{name}</if> |
| | | <if test="community != null and community != ''"> and community = #{community}</if> |
| | | <if test="createTime != null "> and create_time = #{createTime}</if> |
| | | <if test="updateTime != null "> and update_time = #{updateTime}</if> |
| | | <if test="smsTemplate != null "> and sms_template = #{smsTemplate}</if> |
| | | <if test="deleteFlag != null and deleteFlag != ''"> and delete_flag = #{deleteFlag}</if> |
| | | <if test="districtId != null and districtId != ''"> and district_id = #{districtId}</if> |
| | | <if test="buildingCode != null and buildingCode != ''"> and building_code = #{buildingCode}</if> |
| | | </where> |
| | | </select> |
| | | |
| | | |
| | | </mapper> |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.smsTask.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.smsTask.dto.SmsTaskDTO; |
| | | import org.springblade.modules.smsTask.entity.SmsTaskEntity; |
| | | import org.springblade.modules.smsTask.vo.SmsTaskVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 短信发送任务 服务类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-08-08 |
| | | */ |
| | | public interface ISmsTaskService extends IService<SmsTaskEntity> { |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param page |
| | | * @param smsTask |
| | | * @return |
| | | */ |
| | | IPage<SmsTaskVO> selectSmsTaskPage(IPage<SmsTaskVO> page, SmsTaskVO smsTask); |
| | | |
| | | |
| | | /** |
| | | * 查询短信发送任务 |
| | | * |
| | | * @param id 短信发送任务ID |
| | | * @return 短信发送任务 |
| | | */ |
| | | public SmsTaskDTO selectSmsTaskById(Long id); |
| | | |
| | | /** |
| | | * 查询短信发送任务列表 |
| | | * |
| | | * @param smsTaskDTO 短信发送任务 |
| | | * @return 短信发送任务集合 |
| | | */ |
| | | public List<SmsTaskDTO> selectSmsTaskList(SmsTaskDTO smsTaskDTO); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.smsTask.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.modules.smsTask.dto.SmsTaskDTO; |
| | | import org.springblade.modules.smsTask.entity.SmsTaskEntity; |
| | | import org.springblade.modules.smsTask.vo.SmsTaskVO; |
| | | import org.springblade.modules.smsTask.mapper.SmsTaskMapper; |
| | | import org.springblade.modules.smsTask.service.ISmsTaskService; |
| | | import org.springblade.core.mp.base.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 短信发送任务 服务实现类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Service |
| | | public class SmsTaskServiceImpl extends ServiceImpl<SmsTaskMapper, SmsTaskEntity> implements ISmsTaskService { |
| | | |
| | | @Override |
| | | public IPage<SmsTaskVO> selectSmsTaskPage(IPage<SmsTaskVO> page, SmsTaskVO smsTask) { |
| | | return page.setRecords(baseMapper.selectSmsTaskPage(page, smsTask)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询短信发送任务 |
| | | * |
| | | * @param id 短信发送任务ID |
| | | * @return 短信发送任务 |
| | | */ |
| | | @Override |
| | | public SmsTaskDTO selectSmsTaskById(Long id) |
| | | { |
| | | return this.baseMapper.selectSmsTaskById(id); |
| | | } |
| | | |
| | | /** |
| | | * 查询短信发送任务列表 |
| | | * |
| | | * @param smsTaskDTO 短信发送任务 |
| | | * @return 短信发送任务集合 |
| | | */ |
| | | @Override |
| | | public List<SmsTaskDTO> selectSmsTaskList(SmsTaskDTO smsTaskDTO) |
| | | { |
| | | return this.baseMapper.selectSmsTaskList(smsTaskDTO); |
| | | } |
| | | |
| | | |
| | | } |
copy from src/main/java/org/springblade/modules/customTask/vo/CustomTaskVO.java
copy to src/main/java/org/springblade/modules/smsTask/vo/SmsTaskVO.java
| File was copied from src/main/java/org/springblade/modules/customTask/vo/CustomTaskVO.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.customTask.vo; |
| | | package org.springblade.modules.smsTask.vo; |
| | | |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.smsTask.entity.SmsTaskEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * 自定义任务表 视图实体类 |
| | | * 短信发送任务 视图实体类 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-07-30 |
| | | * @since 2024-08-08 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | public class CustomTaskVO extends CustomTaskEntity { |
| | | public class SmsTaskVO extends SmsTaskEntity { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. |
| | | * |
| | | * Redistribution and use in source and binary forms, with or without |
| | | * modification, are permitted provided that the following conditions are met: |
| | | * |
| | | * Redistributions of source code must retain the above copyright notice, |
| | | * this list of conditions and the following disclaimer. |
| | | * Redistributions in binary form must reproduce the above copyright |
| | | * notice, this list of conditions and the following disclaimer in the |
| | | * documentation and/or other materials provided with the distribution. |
| | | * Neither the name of the dreamlu.net developer nor the names of its |
| | | * contributors may be used to endorse or promote products derived from |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.smsTask.wrapper; |
| | | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.smsTask.entity.SmsTaskEntity; |
| | | import org.springblade.modules.smsTask.vo.SmsTaskVO; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * 短信发送任务 包装类,返回视图层所需的字段 |
| | | * |
| | | * @author BladeX |
| | | * @since 2024-08-08 |
| | | */ |
| | | public class SmsTaskWrapper extends BaseEntityWrapper<SmsTaskEntity, SmsTaskVO> { |
| | | |
| | | public static SmsTaskWrapper build() { |
| | | return new SmsTaskWrapper(); |
| | | } |
| | | |
| | | @Override |
| | | public SmsTaskVO entityVO(SmsTaskEntity smsTask) { |
| | | SmsTaskVO smsTaskVO = Objects.requireNonNull(BeanUtil.copy(smsTask, SmsTaskVO.class)); |
| | | |
| | | //User createUser = UserCache.getUser(smsTask.getCreateUser()); |
| | | //User updateUser = UserCache.getUser(smsTask.getUpdateUser()); |
| | | //smsTaskVO.setCreateUserName(createUser.getName()); |
| | | //smsTaskVO.setUpdateUserName(updateUser.getName()); |
| | | |
| | | return smsTaskVO; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | package org.springblade.modules.task.service; |
| | | |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.threeColorTask.entity.CustomTaskEntity; |
| | | |
| | | public interface TaskHandle { |
| | | void taskHandle(CustomTaskEntity customTask); |
| | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springblade.binlog.listener.BinlogListenerMixed; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.threeColorTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.place.service.IPlaceService; |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.task.entity.TaskEntity; |
| | |
| | | package org.springblade.modules.task.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | |
| | | import org.springblade.common.constant.DictConstant; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.modules.category.entity.CategoryEntity; |
| | | import org.springblade.modules.category.service.ICategoryService; |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.threeColorTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.grid.entity.GridEntity; |
| | | import org.springblade.modules.grid.entity.GridWorkLogEntity; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | |
| | | package org.springblade.modules.task.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.threeColorTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.grid.entity.GridWorkLogEntity; |
| | | import org.springblade.modules.grid.service.IGridWorkLogService; |
| | | import org.springblade.modules.house.entity.UserHouseLabelEntity; |
| File was renamed from src/main/java/org/springblade/modules/customTask/controller/CustomTaskController.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.customTask.controller; |
| | | package org.springblade.modules.threeColorTask.controller; |
| | | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import lombok.AllArgsConstructor; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.secure.BladeUser; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.customTask.vo.CustomTaskVO; |
| | | import org.springblade.modules.customTask.wrapper.CustomTaskWrapper; |
| | | import org.springblade.modules.customTask.service.ICustomTaskService; |
| | | import org.springblade.modules.threeColorTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.threeColorTask.vo.CustomTaskVO; |
| | | import org.springblade.modules.threeColorTask.wrapper.CustomTaskWrapper; |
| | | import org.springblade.modules.threeColorTask.service.ICustomTaskService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | /** |
| File was renamed from src/main/java/org/springblade/modules/customTask/dto/CustomTaskDTO.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.customTask.dto; |
| | | package org.springblade.modules.threeColorTask.dto; |
| | | |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.threeColorTask.entity.CustomTaskEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| File was renamed from src/main/java/org/springblade/modules/customTask/entity/CustomTaskEntity.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.customTask.entity; |
| | | package org.springblade.modules.threeColorTask.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | |
| | | import lombok.Data; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.EqualsAndHashCode; |
| | | import org.springblade.core.tenant.mp.TenantEntity; |
| | | |
| | | import java.util.Date; |
| | | |
| | |
| | | */ |
| | | @ApiModel(value = "CustomTask对象" , description = "自定义任务表") |
| | | @Data |
| | | @TableName("jczz_custom_task") |
| | | @TableName("jczz_three_color_task") |
| | | public class CustomTaskEntity { |
| | | |
| | | |
| File was renamed from src/main/java/org/springblade/modules/customTask/mapper/CustomTaskMapper.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.customTask.mapper; |
| | | package org.springblade.modules.threeColorTask.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.customTask.dto.CustomTaskDTO; |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.customTask.vo.CustomTaskVO; |
| | | import org.springblade.modules.threeColorTask.dto.CustomTaskDTO; |
| | | import org.springblade.modules.threeColorTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.threeColorTask.vo.CustomTaskVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| File was renamed from src/main/java/org/springblade/modules/customTask/mapper/CustomTaskMapper.xml |
| | |
| | | <?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="org.springblade.modules.customTask.mapper.CustomTaskMapper"> |
| | | <mapper namespace="org.springblade.modules.threeColorTask.mapper.CustomTaskMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="customTaskResultMap" type="org.springblade.modules.customTask.entity.CustomTaskEntity"> |
| | | <resultMap id="customTaskResultMap" type="org.springblade.modules.threeColorTask.entity.CustomTaskEntity"> |
| | | </resultMap> |
| | | |
| | | |
| | |
| | | </select> |
| | | |
| | | |
| | | <resultMap type="org.springblade.modules.customTask.dto.CustomTaskDTO" id="CustomTaskDTOResult"> |
| | | <resultMap type="org.springblade.modules.threeColorTask.dto.CustomTaskDTO" id="CustomTaskDTOResult"> |
| | | <result property="id" column="id" /> |
| | | <result property="name" column="name" /> |
| | | <result property="taskType" column="task_type" /> |
| | |
| | | task_status, |
| | | job_id |
| | | from |
| | | jczz_custom_task |
| | | jczz_three_color_task |
| | | </sql> |
| | | |
| | | <select id="selectCustomTaskById" parameterType="int" resultMap="CustomTaskDTOResult"> |
| | |
| | | id = #{id} |
| | | </select> |
| | | |
| | | <select id="selectCustomTaskList" parameterType="org.springblade.modules.customTask.dto.CustomTaskDTO" resultMap="CustomTaskDTOResult"> |
| | | <select id="selectCustomTaskList" parameterType="org.springblade.modules.threeColorTask.dto.CustomTaskDTO" resultMap="CustomTaskDTOResult"> |
| | | <include refid="selectCustomTask"/> |
| | | <where> |
| | | <if test="id != null "> and id = #{id}</if> |
| File was renamed from src/main/java/org/springblade/modules/customTask/service/ICustomTaskService.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.customTask.service; |
| | | package org.springblade.modules.threeColorTask.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.customTask.dto.CustomTaskDTO; |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.customTask.vo.CustomTaskVO; |
| | | import org.springblade.core.mp.base.BaseService; |
| | | import org.springblade.modules.threeColorTask.dto.CustomTaskDTO; |
| | | import org.springblade.modules.threeColorTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.threeColorTask.vo.CustomTaskVO; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| File was renamed from src/main/java/org/springblade/modules/customTask/service/impl/CustomTaskServiceImpl.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.customTask.service.impl; |
| | | package org.springblade.modules.threeColorTask.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springblade.core.tool.utils.DateUtil; |
| | | import org.springblade.modules.customTask.dto.CustomTaskDTO; |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.customTask.mapper.CustomTaskMapper; |
| | | import org.springblade.modules.customTask.service.ICustomTaskService; |
| | | import org.springblade.modules.customTask.vo.CustomTaskVO; |
| | | import org.springblade.modules.threeColorTask.dto.CustomTaskDTO; |
| | | import org.springblade.modules.threeColorTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.threeColorTask.mapper.CustomTaskMapper; |
| | | import org.springblade.modules.threeColorTask.service.ICustomTaskService; |
| | | import org.springblade.modules.threeColorTask.vo.CustomTaskVO; |
| | | import org.springblade.xxljob.entity.JobInfoEntity; |
| | | import org.springblade.xxljob.service.IJobInfoService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| File was renamed from src/main/java/org/springblade/modules/customTask/vo/CustomTaskVO.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.customTask.vo; |
| | | package org.springblade.modules.threeColorTask.vo; |
| | | |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.core.tool.node.INode; |
| | | import org.springblade.modules.threeColorTask.entity.CustomTaskEntity; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| File was renamed from src/main/java/org/springblade/modules/customTask/wrapper/CustomTaskWrapper.java |
| | |
| | | * this software without specific prior written permission. |
| | | * Author: Chill 庄骞 (smallchill@163.com) |
| | | */ |
| | | package org.springblade.modules.customTask.wrapper; |
| | | package org.springblade.modules.threeColorTask.wrapper; |
| | | |
| | | import org.springblade.core.mp.support.BaseEntityWrapper; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.customTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.customTask.vo.CustomTaskVO; |
| | | import org.springblade.modules.threeColorTask.entity.CustomTaskEntity; |
| | | import org.springblade.modules.threeColorTask.vo.CustomTaskVO; |
| | | import java.util.Objects; |
| | | |
| | | /** |