forked from rongchao/epmet-cloud-rizhao
220 changed files with 8885 additions and 173 deletions
@ -0,0 +1,8 @@ |
|||
INSERT INTO `epmet_admin`.`sys_dict_type` (`id`, `dict_type`, `dict_name`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458000894500866', 'icpartyact_auto_publish_time', '党组织活动自动发布时间', '党组织活动自动发布时间', 35, 0, 0, '1', '2022-08-19 10:45:54', '1', '2022-08-19 10:46:11'); |
|||
|
|||
|
|||
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458233091170305', 1560458000894500866, '活动开始前1天', '1', '0', '活动开始前1天', 1, 0, 0, '1', '2022-08-19 10:46:49', '1', '2022-08-19 10:46:49'); |
|||
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458276439302146', 1560458000894500866, '活动开始前3天', '3', '0', '活动开始前3天', 2, 0, 0, '1', '2022-08-19 10:47:00', '1', '2022-08-19 10:47:00'); |
|||
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458332076744705', 1560458000894500866, '活动开始前5天', '5', '0', '活动开始前5天', 3, 0, 0, '1', '2022-08-19 10:47:13', '1', '2022-08-19 10:47:13'); |
|||
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1560458388007788545', 1560458000894500866, '活动开始前7天', '7', '0', '活动开始前7天', 4, 0, 0, '1', '2022-08-19 10:47:26', '1', '2022-08-19 10:47:26'); |
|||
INSERT INTO `epmet_admin`.`sys_dict_data` (`id`, `dict_type_id`, `dict_label`, `dict_value`, `dict_p_value`, `remark`, `sort`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1561627442626142210', 1560458000894500866, '现在发布', '0', '0', '', 5, 0, 0, '1', '2022-08-22 16:12:51', '1', '2022-08-22 16:12:51'); |
@ -0,0 +1,23 @@ |
|||
package com.epmet.commons.rocketmq.messages; |
|||
|
|||
import com.epmet.commons.tools.dto.form.mq.MqBaseFormDTO; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 党建小助手发布活动、活动到期提醒、活动发布提醒推送MQ |
|||
* @author sun |
|||
*/ |
|||
@Data |
|||
public class PartyMeetingMessageMQMsg extends MqBaseFormDTO implements Serializable { |
|||
|
|||
//客户Id
|
|||
private String customerId; |
|||
//活动/日程Id
|
|||
private String icPartyActId; |
|||
//动作类型 发布活动:publish 提前提醒:remind 日程通知:notify
|
|||
private String type; |
|||
|
|||
} |
@ -0,0 +1,59 @@ |
|||
package com.epmet.excel.converter; |
|||
|
|||
import com.alibaba.excel.converters.Converter; |
|||
import com.alibaba.excel.enums.CellDataTypeEnum; |
|||
import com.alibaba.excel.metadata.GlobalConfiguration; |
|||
import com.alibaba.excel.metadata.data.ReadCellData; |
|||
import com.alibaba.excel.metadata.data.WriteCellData; |
|||
import com.alibaba.excel.metadata.property.ExcelContentProperty; |
|||
|
|||
import java.text.SimpleDateFormat; |
|||
import java.time.LocalDateTime; |
|||
import java.time.ZoneId; |
|||
import java.time.temporal.ChronoUnit; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 框架:easyexcel |
|||
* 目的:工作日志(服务),对服务时间日期类型的转换 |
|||
*/ |
|||
public class WorkDiaryServiceEasyExcelDateConverter implements Converter<Date> { |
|||
|
|||
private static final String PATTERN_YYYY_MM_DD = "yyyy-MM-dd"; |
|||
|
|||
/** |
|||
* excel内容转化为java时间 |
|||
* @param cellData |
|||
* @param contentProperty |
|||
* @param globalConfiguration |
|||
* @return |
|||
* @throws Exception |
|||
*/ |
|||
public Date convertToJavaData(ReadCellData<?> cellData, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
|||
if (cellData.getType() == CellDataTypeEnum.NUMBER) { |
|||
// 数字类型,是1900-01-03到excel中数据日期的天数差值
|
|||
LocalDateTime localDate = LocalDateTime.of(1900, 1, 1, 0, 0, 0) |
|||
// 不知为何,这个日期差值,多了2天,需要减去
|
|||
.minus(2L, ChronoUnit.DAYS) |
|||
.plus(cellData.getNumberValue().longValue(), ChronoUnit.DAYS); |
|||
return Date.from(localDate.atZone(ZoneId.systemDefault()).toInstant()); |
|||
} else { |
|||
// 字符串,正常格式化
|
|||
Date dateData = new SimpleDateFormat(PATTERN_YYYY_MM_DD).parse(cellData.getStringValue()); |
|||
return dateData; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* java日期转为excel内容 |
|||
* @param value |
|||
* @param contentProperty |
|||
* @param globalConfiguration |
|||
* @return |
|||
* @throws Exception |
|||
*/ |
|||
public WriteCellData<?> convertToExcelData(Date value, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) throws Exception { |
|||
String dataStr = new SimpleDateFormat(PATTERN_YYYY_MM_DD).format(value); |
|||
return new WriteCellData(dataStr); |
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.epmet.task; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author yzm |
|||
* @Date 2022/8/22 15:13 |
|||
*/ |
|||
@Slf4j |
|||
@Component("autoPublishIcPartyActTask") |
|||
public class AutoPublishIcPartyActTask implements ITask { |
|||
@Autowired |
|||
private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient; |
|||
/** |
|||
* 活动时间2022-08-15 10:30 选择的是提前3天自动发布 |
|||
* 本任务是自动发布活动 |
|||
* //2022-8-9号 8:00 收到一个:您有一个活动3天后即将自动发布
|
|||
* |
|||
* @param params 参数,多参数使用JSON数据 |
|||
*/ |
|||
@Override |
|||
public void run(String params) { |
|||
Result result=resiPartyMemberOpenFeignClient.autoPublishIcPartyAct(); |
|||
if(result.success()){ |
|||
log.info("autoPublishIcPartyActTask执行成功"); |
|||
}else{ |
|||
log.info("autoPublishIcPartyActTask执行失败"); |
|||
} |
|||
} |
|||
} |
|||
|
@ -0,0 +1,31 @@ |
|||
package com.epmet.task; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.feign.GovOrgOpenFeignClient; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import javax.annotation.Resource; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/9/6 17:35 |
|||
*/ |
|||
@Component("enterprisePatrolRemindTask") |
|||
@Slf4j |
|||
public class EnterprisePatrolRemindTask implements ITask { |
|||
@Resource |
|||
private GovOrgOpenFeignClient govOrgOpenFeignClient; |
|||
|
|||
@Override |
|||
public void run(String params) { |
|||
log.info("EnterprisePatrolRemindTask定时任务正在执行,参数为:{}", params); |
|||
Result result = govOrgOpenFeignClient.sendEnterprisePatrolRemindMessage(); |
|||
if (result.success()) { |
|||
log.info("EnterprisePatrolRemindTask定时任务执行成功"); |
|||
} else { |
|||
log.error("EnterprisePatrolRemindTask定时任务执行失败:" + result.getMsg()); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.epmet.task; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author yzm |
|||
* @Date 2022/8/22 15:07 |
|||
*/ |
|||
@Slf4j |
|||
@Component("noticePartyActAutoPublishTask") |
|||
public class NoticePartyActAutoPublishTask implements ITask { |
|||
@Autowired |
|||
private ResiPartyMemberOpenFeignClient resiPartyMemberOpenFeignClient; |
|||
|
|||
/** |
|||
* 活动时间2022-08-15 10:30 选择的是提前3天自动发布 |
|||
* //2022-8-12 10:30自动发布,收到消息:您有一个活动已经发布
|
|||
* 本任务是通知:2022-8-9号 8:00 收到一个:您有一个活动3天后即将自动发布 |
|||
* |
|||
* @param params 参数,多参数使用JSON数据 |
|||
*/ |
|||
@Override |
|||
public void run(String params) { |
|||
Result result=resiPartyMemberOpenFeignClient.noticePartyActAutoPublishTask(); |
|||
if(result.success()){ |
|||
log.info("noticePartyActAutoPublishTask执行成功"); |
|||
}else{ |
|||
log.info("noticePartyActAutoPublishTask执行失败"); |
|||
} |
|||
} |
|||
} |
|||
|
@ -0,0 +1,35 @@ |
|||
package com.epmet.task.ic; |
|||
|
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.feign.EpmetUserOpenFeignClient; |
|||
import com.epmet.task.ITask; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
import javax.annotation.Resource; |
|||
|
|||
/** |
|||
* desc:定时弥补数据 保证数据的一致性 |
|||
*/ |
|||
@Slf4j |
|||
@Component("icUpdateYlfnTask") |
|||
public class IcUpdateYlfnTask implements ITask { |
|||
|
|||
@Resource |
|||
private EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
|||
|
|||
/** |
|||
* 执行定时任务接口 |
|||
* |
|||
* @param params 参数,多参数使用JSON数据 |
|||
*/ |
|||
@Override |
|||
public void run(String params) { |
|||
Result result = epmetUserOpenFeignClient.updateYlfn(); |
|||
if (result.success()) { |
|||
log.info("icUpdateYlfnTask定时任务正在执行定时任务执行成功"); |
|||
} else { |
|||
log.warn("icUpdateYlfnTask定时任务正在执行定时任务执行失败:" + result.getMsg()); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,104 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 用户消息表(党建小助手) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-08-19 |
|||
*/ |
|||
@Data |
|||
public class IcMessageDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* app=resi时,此列为gridId,其他情况暂定 * |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 被通知的用户id |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 消息通知对象:居民端用户resi、政府端工作人员gov、运营端工作人员oper |
|||
*/ |
|||
private String app; |
|||
|
|||
/** |
|||
* 消息分类 党建活动:party_act 党建日程:party_schedule |
|||
*/ |
|||
private String messageType; |
|||
|
|||
/** |
|||
* 消息类型对应的业务Id |
|||
*/ |
|||
private String targetId; |
|||
|
|||
/** |
|||
* 消息标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 消息通知内容 |
|||
*/ |
|||
private String messageContent; |
|||
|
|||
/** |
|||
* read已读、unread未读 |
|||
*/ |
|||
private String readFlag; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人(发布消息的人) |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
/** |
|||
* 调用者 |
|||
*/ |
|||
private String referer; |
|||
|
|||
} |
@ -0,0 +1,66 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class IcMessageFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 2697079163476964749L; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
@NotBlank(message = "客户id不能为空") |
|||
private String customerId; |
|||
|
|||
/** |
|||
* app=resi时,此列为gridId,其他情况暂定 * |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 对应用户id |
|||
*/ |
|||
@NotBlank(message = "通知用户id为空") |
|||
private String userId; |
|||
|
|||
/** |
|||
* 消息通知对象:居民端用户resi、政府端工作人员gov、运营端工作人员oper |
|||
*/ |
|||
@NotBlank(message = "消息通知对象不能为空") |
|||
private String app; |
|||
|
|||
/** |
|||
* 消息标题 |
|||
*/ |
|||
@NotBlank(message = "消息标题不能为空") |
|||
private String title; |
|||
|
|||
/** |
|||
* 消息通知内容 |
|||
*/ |
|||
@NotBlank(message = "通知内容不能为空") |
|||
private String messageContent; |
|||
|
|||
/** |
|||
* read已读、unread未读 |
|||
*/ |
|||
@NotBlank(message = "readFlag不能为空") |
|||
private String readFlag; |
|||
|
|||
/** |
|||
* 调用者 【分内部调用和外部调用,内部调用值为空,外部默认为:外挂-站内信】 |
|||
*/ |
|||
private String referer; |
|||
|
|||
/** |
|||
* 消息分类:info-上传下达消息 详见UserMessageTypeConstant |
|||
*/ |
|||
private String messageType; |
|||
/** |
|||
* 消息对应的业务id,比如message_type=info时,此列存储的是消息id,可跳转到消息详情 |
|||
*/ |
|||
private String targetId; |
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class IcMessageListFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 2697079163476964749L; |
|||
|
|||
private Integer pageNo = 1; |
|||
private Integer pageSize = 20; |
|||
private Boolean isPage = true; |
|||
//token中信息
|
|||
private String customerId; |
|||
private String userId; |
|||
|
|||
} |
@ -0,0 +1,18 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
@Data |
|||
public class ReadIcMessageFormDTO implements Serializable { |
|||
private static final long serialVersionUID = 2697079163476964749L; |
|||
|
|||
/** |
|||
* 消息Id |
|||
*/ |
|||
private String id; |
|||
//token中信息
|
|||
private String customerId; |
|||
private String userId; |
|||
} |
@ -0,0 +1,105 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.aop.NoRepeatSubmit; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.commons.tools.validator.AssertUtils; |
|||
import com.epmet.commons.tools.validator.ValidatorUtils; |
|||
import com.epmet.commons.tools.validator.group.AddGroup; |
|||
import com.epmet.commons.tools.validator.group.DefaultGroup; |
|||
import com.epmet.commons.tools.validator.group.UpdateGroup; |
|||
import com.epmet.dto.IcMessageDTO; |
|||
import com.epmet.dto.form.IcMessageFormDTO; |
|||
import com.epmet.dto.form.IcMessageListFormDTO; |
|||
import com.epmet.dto.form.ReadIcMessageFormDTO; |
|||
import com.epmet.service.IcMessageService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
|
|||
/** |
|||
* 用户消息表(党建小助手) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-08-19 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("icMessage") |
|||
public class IcMessageController { |
|||
|
|||
@Autowired |
|||
private IcMessageService icMessageService; |
|||
|
|||
@RequestMapping("list") |
|||
public Result<PageData<IcMessageDTO>> list(@LoginUser TokenDto tokenDto, @RequestBody IcMessageListFormDTO formDTO){ |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
formDTO.setUserId(tokenDto.getUserId()); |
|||
return new Result<PageData<IcMessageDTO>>().ok(icMessageService.list(formDTO)); |
|||
} |
|||
|
|||
@RequestMapping(value = "{id}",method = {RequestMethod.POST,RequestMethod.GET}) |
|||
public Result<IcMessageDTO> get(@PathVariable("id") String id){ |
|||
IcMessageDTO data = icMessageService.get(id); |
|||
return new Result<IcMessageDTO>().ok(data); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("save") |
|||
public Result save(@RequestBody IcMessageDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|||
icMessageService.save(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@NoRepeatSubmit |
|||
@PostMapping("update") |
|||
public Result update(@RequestBody IcMessageDTO dto){ |
|||
//效验数据
|
|||
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|||
icMessageService.update(dto); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("delete") |
|||
public Result delete(@RequestBody String[] ids){ |
|||
//效验数据
|
|||
AssertUtils.isArrayEmpty(ids, "id"); |
|||
icMessageService.delete(ids); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 批量插入未读消息 |
|||
**/ |
|||
@PostMapping("saveicmessagelist") |
|||
public Result saveIcMessageList(@RequestBody List<IcMessageFormDTO> msgList) { |
|||
icMessageService.saveIcMessageList(msgList); |
|||
return new Result(); |
|||
} |
|||
|
|||
/** |
|||
* @Author sun |
|||
* @Description 单条或批量修改已读 |
|||
**/ |
|||
@PostMapping("read") |
|||
public Result read(@LoginUser TokenDto tokenDto, @RequestBody ReadIcMessageFormDTO formDTO) { |
|||
formDTO.setCustomerId(tokenDto.getCustomerId()); |
|||
formDTO.setUserId(tokenDto.getUserId()); |
|||
icMessageService.read(formDTO); |
|||
return new Result(); |
|||
} |
|||
|
|||
@PostMapping("unreadcount/{userId}") |
|||
public Result<Integer> unReadCount(@PathVariable ("userId") String userId) { |
|||
return new Result<Integer>().ok(icMessageService.unReadCount(userId)); |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.IcMessageDTO; |
|||
import com.epmet.dto.form.IcMessageListFormDTO; |
|||
import com.epmet.dto.form.ReadIcMessageFormDTO; |
|||
import com.epmet.entity.IcMessageEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 用户消息表(党建小助手) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-08-19 |
|||
*/ |
|||
@Mapper |
|||
public interface IcMessageDao extends BaseDao<IcMessageEntity> { |
|||
|
|||
List<IcMessageDTO> selectMessageList(IcMessageListFormDTO formDTO); |
|||
|
|||
void upByUserId(ReadIcMessageFormDTO formDTO); |
|||
|
|||
Integer selectUnReadCount(@Param("userId") String userId); |
|||
} |
@ -0,0 +1,74 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 用户消息表(党建小助手) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-08-19 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("ic_message") |
|||
public class IcMessageEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* app=resi时,此列为gridId,其他情况暂定 * |
|||
*/ |
|||
private String gridId; |
|||
|
|||
/** |
|||
* 被通知的用户id |
|||
*/ |
|||
private String userId; |
|||
|
|||
/** |
|||
* 消息通知对象:居民端用户resi、政府端工作人员gov、运营端工作人员oper |
|||
*/ |
|||
private String app; |
|||
|
|||
/** |
|||
* 消息分类 党建活动:party_act 党建日程:party_schedule |
|||
*/ |
|||
private String messageType; |
|||
|
|||
/** |
|||
* 消息类型对应的业务Id |
|||
*/ |
|||
private String targetId; |
|||
|
|||
/** |
|||
* 消息标题 |
|||
*/ |
|||
private String title; |
|||
|
|||
/** |
|||
* 消息通知内容 |
|||
*/ |
|||
private String messageContent; |
|||
|
|||
/** |
|||
* read已读、unread未读 |
|||
*/ |
|||
private String readFlag; |
|||
|
|||
/** |
|||
* 调用者 |
|||
*/ |
|||
private String referer; |
|||
|
|||
} |
@ -0,0 +1,78 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dto.IcMessageDTO; |
|||
import com.epmet.dto.form.IcMessageFormDTO; |
|||
import com.epmet.dto.form.IcMessageListFormDTO; |
|||
import com.epmet.dto.form.ReadIcMessageFormDTO; |
|||
import com.epmet.entity.IcMessageEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* 用户消息表(党建小助手) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-08-19 |
|||
*/ |
|||
public interface IcMessageService extends BaseService<IcMessageEntity> { |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param formDTO |
|||
* @return java.util.List<IcMessageDTO> |
|||
* @author generator |
|||
* @date 2022-08-19 |
|||
*/ |
|||
PageData<IcMessageDTO> list(IcMessageListFormDTO formDTO); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return IcMessageDTO |
|||
* @author generator |
|||
* @date 2022-08-19 |
|||
*/ |
|||
IcMessageDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-08-19 |
|||
*/ |
|||
void save(IcMessageDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-08-19 |
|||
*/ |
|||
void update(IcMessageDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-08-19 |
|||
*/ |
|||
void delete(String[] ids); |
|||
|
|||
void saveIcMessageList(List<IcMessageFormDTO> msgList); |
|||
|
|||
void read(ReadIcMessageFormDTO formDTO); |
|||
|
|||
Integer unReadCount(String userId); |
|||
} |
@ -0,0 +1,116 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
|||
import com.epmet.commons.tools.constant.FieldConstant; |
|||
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; |
|||
import com.epmet.commons.tools.enums.DictTypeEnum; |
|||
import com.epmet.commons.tools.exception.EpmetException; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.commons.tools.redis.common.CustomerStaffRedis; |
|||
import com.epmet.commons.tools.utils.ConvertUtils; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.dao.IcMessageDao; |
|||
import com.epmet.dto.IcMessageDTO; |
|||
import com.epmet.dto.form.IcMessageFormDTO; |
|||
import com.epmet.dto.form.IcMessageListFormDTO; |
|||
import com.epmet.dto.form.IcMoveInListFormDTO; |
|||
import com.epmet.dto.form.ReadIcMessageFormDTO; |
|||
import com.epmet.dto.result.AllGridsByUserIdResultDTO; |
|||
import com.epmet.dto.result.HouseInfoDTO; |
|||
import com.epmet.dto.result.IcMoveInListResultDTO; |
|||
import com.epmet.entity.IcMessageEntity; |
|||
import com.epmet.service.IcMessageService; |
|||
import com.github.pagehelper.PageHelper; |
|||
import com.github.pagehelper.PageInfo; |
|||
import org.apache.commons.collections4.MapUtils; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.util.CollectionUtils; |
|||
|
|||
import java.util.*; |
|||
import java.util.function.Function; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 用户消息表(党建小助手) |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-08-19 |
|||
*/ |
|||
@Service |
|||
public class IcMessageServiceImpl extends BaseServiceImpl<IcMessageDao, IcMessageEntity> implements IcMessageService { |
|||
|
|||
|
|||
@Override |
|||
public PageData<IcMessageDTO> list(IcMessageListFormDTO formDTO) { |
|||
PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize(), formDTO.getIsPage()); |
|||
List<IcMessageDTO> list = baseDao.selectMessageList(formDTO); |
|||
PageInfo<IcMessageDTO> pageInfo = new PageInfo<>(list); |
|||
return new PageData<>(list, pageInfo.getTotal()); |
|||
} |
|||
|
|||
private QueryWrapper<IcMessageEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<IcMessageEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public IcMessageDTO get(String id) { |
|||
IcMessageEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, IcMessageDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(IcMessageDTO dto) { |
|||
IcMessageEntity entity = ConvertUtils.sourceToTarget(dto, IcMessageEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(IcMessageDTO dto) { |
|||
IcMessageEntity entity = ConvertUtils.sourceToTarget(dto, IcMessageEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
@Override |
|||
public void saveIcMessageList(List<IcMessageFormDTO> msgList) { |
|||
List<IcMessageEntity> entityList = ConvertUtils.sourceToTarget(msgList, IcMessageEntity.class); |
|||
insertBatch(entityList); |
|||
} |
|||
|
|||
@Override |
|||
public void read(ReadIcMessageFormDTO formDTO) { |
|||
//id入参有值就按id修改,没值就按用户修改
|
|||
if(StringUtils.isNotBlank(formDTO.getId())){ |
|||
IcMessageEntity entity = new IcMessageEntity(); |
|||
entity.setId(formDTO.getId()); |
|||
entity.setReadFlag("read"); |
|||
updateById(entity); |
|||
return; |
|||
} |
|||
//批量修改某个人消息列表
|
|||
baseDao.upByUserId(formDTO); |
|||
} |
|||
|
|||
@Override |
|||
public Integer unReadCount(String userId) { |
|||
return baseDao.selectUnReadCount(userId); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
CREATE TABLE `ic_message` ( |
|||
`ID` varchar(64) NOT NULL COMMENT '主键', |
|||
`customer_id` varchar(64) NOT NULL COMMENT '客户id', |
|||
`grid_id` varchar(64) NOT NULL DEFAULT '*' COMMENT '暂定 *', |
|||
`user_id` varchar(64) NOT NULL COMMENT '被通知的用户id', |
|||
`app` varchar(32) NOT NULL COMMENT '消息通知对象:居民端用户resi、政府端工作人员gov、运营端工作人员oper', |
|||
`message_type` varchar(32) DEFAULT NULL COMMENT '消息分类 党建小助手:party', |
|||
`target_id` varchar(64) DEFAULT NULL COMMENT '消息类型对应的业务Id', |
|||
`title` varchar(255) NOT NULL COMMENT '消息标题', |
|||
`message_content` varchar(3096) NOT NULL COMMENT '消息通知内容', |
|||
`read_flag` varchar(32) NOT NULL DEFAULT 'unread' COMMENT 'read已读、unread未读', |
|||
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', |
|||
`REVISION` int(11) DEFAULT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人(发布消息的人)', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
`REFERER` varchar(20) DEFAULT NULL COMMENT '调用者', |
|||
PRIMARY KEY (`ID`) USING BTREE |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='用户消息表(党建小助手)'; |
@ -0,0 +1,2 @@ |
|||
ALTER TABLE epmet_message.`ic_message` |
|||
MODIFY COLUMN `message_type` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '消息分类 \r\n党建活动:party_act \r\n党建日程:party_schedule \r\n' AFTER `app`; |
@ -0,0 +1,40 @@ |
|||
<?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="com.epmet.dao.IcMessageDao"> |
|||
|
|||
<select id="selectMessageList" resultType="com.epmet.dto.IcMessageDTO"> |
|||
SELECT |
|||
* |
|||
FROM |
|||
ic_message |
|||
WHERE |
|||
del_flag = '0' |
|||
AND customer_id = #{customerId} |
|||
AND user_id = #{userId} |
|||
ORDER BY CREATED_TIME desc |
|||
</select> |
|||
|
|||
<update id="upByUserId" parameterType="com.epmet.dto.form.ReadIcMessageFormDTO"> |
|||
UPDATE ic_message |
|||
SET read_flag = 'read', |
|||
updated_by = #{userId}, |
|||
updated_time = NOW() |
|||
WHERE |
|||
del_flag = '0' |
|||
AND customer_id = #{customerId} |
|||
AND user_id = #{userId} |
|||
</update> |
|||
|
|||
<select id="selectUnReadCount" resultType="java.lang.Integer"> |
|||
SELECT |
|||
COUNT(id) |
|||
FROM |
|||
ic_message |
|||
WHERE |
|||
del_flag = '0' |
|||
AND read_flag = 'unread' |
|||
AND user_id = #{userId} |
|||
</select> |
|||
|
|||
</mapper> |
@ -0,0 +1,25 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import com.epmet.commons.tools.dto.form.PageFormDTO; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/8/22 15:57 |
|||
*/ |
|||
@Data |
|||
public class PartyPointFormDTO extends PageFormDTO implements Serializable { |
|||
private static final long serialVersionUID = -4811220825653023328L; |
|||
private String customerId; |
|||
private String userId; |
|||
private String year; |
|||
private String quarter; |
|||
private String month; |
|||
private String type; |
|||
private String dateType; |
|||
private String startDate; |
|||
private String endDate; |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/8/25 9:20 |
|||
*/ |
|||
@Data |
|||
public class PartyPointRecordResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -1480768520576719171L; |
|||
/** |
|||
* 日期 yyyy-MM-dd 字符串 |
|||
* */ |
|||
private String date; |
|||
private List<PartyPointResultDTO> dailyList; |
|||
} |
@ -0,0 +1,33 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/8/22 15:59 |
|||
*/ |
|||
@Data |
|||
public class PartyPointResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -3208641116926725011L; |
|||
private String title; |
|||
/** |
|||
* 日期yyyy-MM-dd |
|||
*/ |
|||
private String date; |
|||
/** |
|||
* 时间hh:mm |
|||
*/ |
|||
private String time; |
|||
private String point; |
|||
private String actId; |
|||
private String actTopic; |
|||
private String actType; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
private Date actDate; |
|||
private String actAddress; |
|||
} |
@ -0,0 +1,21 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author yzm |
|||
* @Date 2022/9/8 10:44 |
|||
*/ |
|||
@Data |
|||
public class CustomerParaResDTO implements Serializable { |
|||
/** |
|||
* 开启:open |
|||
* 关闭:closed |
|||
* 没有数据默认开启 |
|||
*/ |
|||
private String govPartyHelper; |
|||
} |
|||
|
@ -0,0 +1,3 @@ |
|||
INSERT INTO `epmet_oper_crm`.`customer_parameter` ( `ID`, `CUSTOMER_ID`, `PARAMETER_KEY`, `PARAMETER_NAME`, `PARAMETER_SWITCH`, `PARAMETER_VALUE`, `DESCRIPTION`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME` ) |
|||
VALUES |
|||
( '5ce6f22c-2f22-11ed-bb6b-0050568f8cf7', 'default', 'gov_party_helper', '工作端党建小助手是否开启?', 'on', 'open', '开启:open;关闭:closed;不配置,默认是开启', 0, 0, 'APP_USER', '2022-09-08 11:03:35', 'APP_USER', '2022-09-08 11:03:45' ); |
@ -0,0 +1,18 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Description |
|||
* @Author zhaoqifeng |
|||
* @Date 2022/9/8 15:43 |
|||
*/ |
|||
@Data |
|||
public class YlfnValueResultDTO implements Serializable { |
|||
private static final long serialVersionUID = -1416102274320519092L; |
|||
private String customerId; |
|||
private Integer min; |
|||
private Integer max; |
|||
} |
@ -0,0 +1,4 @@ |
|||
alter table ic_resi_category_stats_config |
|||
add COLUMN `AUTO_MATCHING` varchar(1) NOT NULL DEFAULT '0' COMMENT '自动匹配:开启1;不匹配:0' after SORT; |
|||
|
|||
alter table ic_resi_category_stats_config add COLUMN `YLFN_VALUE` varchar(32) DEFAULT NULL COMMENT '育龄妇女年龄范围,英文逗号隔开的数字例如:18,49' after AUTO_MATCHING; |
@ -0,0 +1,8 @@ |
|||
ALTER TABLE `epmet_resi_group`.`resi_group` |
|||
ADD COLUMN `PARTY_ORG_ID` varchar(64) NULL COMMENT '党支部ID' AFTER `CUSTOMER_ID`, |
|||
ADD COLUMN `PARTY_ORG_PIDS` varchar(255) NULL COMMENT '党支部的所有上级ID' AFTER `PARTY_ORG_ID`; |
|||
|
|||
|
|||
ALTER TABLE `epmet_resi_group`.`group_edit_submit_record` |
|||
ADD COLUMN `PARTY_ORG_ID` varchar(64) NULL COMMENT '党支部ID' AFTER `GRID_ID`, |
|||
ADD COLUMN `PARTY_ORG_PIDS` varchar(255) NULL COMMENT '党支部的所有上级ID' AFTER `PARTY_ORG_ID`; |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue