Commit 1d8d5ebc by 叶立庆

Merge branch 'V5.5.3' into 'master'

上线合并

See merge request !5
2 parents d5af456b 2888eef8
Showing 82 changed files with 2809 additions and 168 deletions
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</parent> </parent>
<groupId>cn.com.glsx</groupId> <groupId>cn.com.glsx</groupId>
<artifactId>rpc-dj-mindworkplate-api</artifactId> <artifactId>rpc-dj-mindworkplate-api</artifactId>
<version>5.5.1-SNAPSHOT</version> <version>5.5.3-SNAPSHOT</version>
<name>rpc-dj-mindworkplate-api</name> <name>rpc-dj-mindworkplate-api</name>
<properties> <properties>
<deploy.scanPackage>cn.com.glsx.remote</deploy.scanPackage> <deploy.scanPackage>cn.com.glsx.remote</deploy.scanPackage>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<dependency> <dependency>
<groupId>cn.com.glsx</groupId> <groupId>cn.com.glsx</groupId>
<artifactId>rpc-dj-mindworkplate-api</artifactId> <artifactId>rpc-dj-mindworkplate-api</artifactId>
<version>5.3.0-SNAPSHOT</version> <version>5.5.3-SNAPSHOT</version>
</dependency> </dependency>
</dependencies> </dependencies>
</plugin> </plugin>
......
package cn.com.glsx.dj.mindworkplate.consts;
/**
* 公共常量
* @author yangwei
* @version 1.0
* @since 2026/01/10 15:31
*/
public interface CommonConstants {
/** 已变更 */
String CHINESE_CHANGED = "已变更";
}
...@@ -19,4 +19,9 @@ public interface ConfigCenterConstants { ...@@ -19,4 +19,9 @@ public interface ConfigCenterConstants {
*/ */
String DATA_AI_SPARRING_STAFF_WORK_WECHAT_MERCHANT_ID = "data.aiSparring.staff.work.wechat.merchant.id"; String DATA_AI_SPARRING_STAFF_WORK_WECHAT_MERCHANT_ID = "data.aiSparring.staff.work.wechat.merchant.id";
/**
* 测试用-当前系统时间
*/
String CURRENT_SYSTEM_TIME_FOR_TEST = "current.system.time.for.test";
} }
package cn.com.glsx.dj.mindworkplate.consts;
/**
* 日期格式化
* @author yangwei
* @version 1.0
* @since 2026/01/10 16:02
*/
public interface DatePatternConstants {
/** yyyy/MM/dd */
String YYYY_MM_DD_SLASH = "yyyy/MM/dd";
}
package cn.com.glsx.dj.mindworkplate.consts;
import cn.com.glsx.dj.mindworkplate.enums.GoodNewsTemplateCodeEnum;
import com.google.common.collect.Lists;
import java.util.List;
/**
* @author yangwei
* @version 1.0
* @since 2026/01/12 19:41
*/
public interface ListConstants {
/**
* 日报模版代码
*/
List<String> DAILY_TEMPLATE_CODE_LIST = Lists.newArrayList(
GoodNewsTemplateCodeEnum.DELAY_TEMPLATE_CODE_2_3.getCode(),
GoodNewsTemplateCodeEnum.LIGHT_CHANGE_TEMPLATE_CODE_1_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_TEMPLATE_CODE_2_1.getCode()
);
/**
* 周报模版代码
*/
List<String> WEEKLY_TEMPLATE_CODE_LIST = Lists.newArrayList(
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_2_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_1_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_2_3.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_15_2_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_16_1_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_17_2_3.getCode()
);
/**
* 月报模版代码
*/
List<String> MONTHLY_TEMPLATE_CODE_LIST = Lists.newArrayList(
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_18_1_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_19_2_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_20_2_3.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY__21_2_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY__22_1_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_23_2_3.getCode()
);
}
package cn.com.glsx.dj.mindworkplate.consts;
/**
* 符号常量接口
* @author yangwei
* @since 2026/1/10 14:09
*/
public interface SymbolConstants {
String SLASH = "/";
String COLON = ":";
String COMMA = ",";
String SEMICOLON = ";";
/** \n */
String NEW_LINE = "\n";
/**【 */
String CHINESE_BRACKET_LEFT = "【";
/** 】 */
String CHINESE_BRACKET_RIGHT = "】";
/** : */
String CHINESE_COLON = ":";
/** 无 */
String NONE = "无";
/** - */
String BLANK_DASH = " - ";
/** "'" */
String SINGLE_QUOTE = "'";
/** "、" */
String CHINESE_COMMA = "、";
}
...@@ -209,4 +209,10 @@ public class EmployeeBadgeDTO extends EmployeeBadge implements Serializable { ...@@ -209,4 +209,10 @@ public class EmployeeBadgeDTO extends EmployeeBadge implements Serializable {
@ApiModelProperty(notes = "接待手机号") @ApiModelProperty(notes = "接待手机号")
private List<String> phoneList; private List<String> phoneList;
/**
* 客户手机号
*/
@ApiModelProperty(notes = "客户手机号")
private String customerPhone;
} }
\ No newline at end of file \ No newline at end of file
...@@ -61,6 +61,11 @@ public class DigitalManagementStaffRecordDTO extends DigitalManagementStaffRecor ...@@ -61,6 +61,11 @@ public class DigitalManagementStaffRecordDTO extends DigitalManagementStaffRecor
@JsonIgnore @JsonIgnore
private Map<String, String> templateExtendField; private Map<String, String> templateExtendField;
/**
* 是否保存
*/
private Boolean save;
public void appendTypes(DigitalManagementStaffRecordItemDTO item){ public void appendTypes(DigitalManagementStaffRecordItemDTO item){
if (CollectionUtils.isEmpty(types)) { if (CollectionUtils.isEmpty(types)) {
types = new ArrayList<>(); types = new ArrayList<>();
......
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement; package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplate; import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplate;
import cn.hutool.core.map.MapUtil;
import com.google.common.collect.Lists;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.util.CollectionUtils;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors;
@Data @Data
public class DigitalManagementTemplateSummaryDTO implements Serializable { public class DigitalManagementTemplateSummaryDTO implements Serializable {
...@@ -23,16 +21,24 @@ public class DigitalManagementTemplateSummaryDTO implements Serializable { ...@@ -23,16 +21,24 @@ public class DigitalManagementTemplateSummaryDTO implements Serializable {
private String code; private String code;
@ApiModelProperty(notes = "应填数") @ApiModelProperty(notes = "应填数")
private Long totalCount; private Long totalCount = 0L;
@ApiModelProperty(notes = "实填数") @ApiModelProperty(notes = "实填数")
private Long finishCount; private Long finishCount = 0L;
@ApiModelProperty(notes = "未提交数") @ApiModelProperty(notes = "未提交数")
private Long undoCount; private Long undoCount = 0L;
private String staffUuidListStr; private String staffUuidListStr;
@ApiModelProperty(notes = "未提交人员")
private String unSubmittedStaffNamesStr;
private List<String> unSubmittedStaffNames = Lists.newArrayList();
/** key uuid, value staffName */
private Map<String, String> unSubmittedStaffUuidMapName = MapUtil.<String, String>builder().build();
public Integer getIntOrDefault(Integer target){ public Integer getIntOrDefault(Integer target){
return Objects.isNull(target) ? 0 : target; return Objects.isNull(target) ? 0 : target;
} }
......
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import lombok.Data;
import java.util.List;
/**
* 人员喜报填写前端组件配置实体
* @author yangwei
* @version 1.0
* @since 2026/01/10 14:14
*/
@Data
public class FormComponentConfig {
/**
* 控件类型
*/
private String type;
/**
* 宽度设置
*/
private String width;
/**
* 添加HTML类型(textarea)
*/
private String addHtml;
/**
* 排序类型
*/
private String sortable;
/**
* 是否显示标签下划线
*/
private Boolean isLabelNoLine;
/**
* 是否不设置单元格高度
*/
private Boolean noCellHeight;
/**
* 验证规则集合
*/
private List<Rule> rule;
/**
* 输入限制配置
*/
private InputLimit inputLimit;
/**
* 验证规则实体类
* @author yangwei
* @since 2026/1/10 14:15
*/
@Data
public static class Rule {
private Boolean required;
private String message;
}
/**
* 输入限制实体类
* @author yangwei
* @since 2026/1/10 14:15
*/
@Data
public static class InputLimit {
private Integer maxlength;
}
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplate;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 模版配置内容
* @author yangwei
* @version 1.0
* @since 2026/01/09 17:55
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class ManagementTemplateContentDTO extends DigitalManagementTemplate {
private static final long serialVersionUID = 4431121600542401549L;
/**
* 模板内容
*/
private List<ManagementTemplateItemDTO> templateItemList;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplateItem;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
/**
* 模版配置内容,默认只有两级
* @author yangwei
* @version 1.0
* @since 2026/01/10 11:15
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class ManagementTemplateItemDTO extends DigitalManagementTemplateItem {
private static final long serialVersionUID = -1177892234642266947L;
/**
* 子项
*/
private List<DigitalManagementTemplateItem> childList;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.time.LocalDate;
/**
* 月份范围
* @author yangwei
* @version 1.0
* @since 2026/01/12 11:18
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class MonthRange implements Serializable {
private static final long serialVersionUID = -523293264450045632L;
/**
* 月份开始日期
*/
private LocalDate startDate;
/**
* 月份结束日期
*/
private LocalDate endDate;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDate;
/**
* 获取员工月报填写记录
* @author yangwei
* @version 1.0
* @since 2026/01/08 17:57
*/
@Data
public class MonthlyReportRecordReqDTO implements Serializable {
private static final long serialVersionUID = -1366491639688272784L;
/**
* 年
*/
private String year;
/**
* 月份
*/
private String month;
/**
* 开始日期
*/
private LocalDate startDate;
/**
* 结束日期
*/
@NotNull(message = "结束日期不能为空")
private LocalDate endDate;
}
...@@ -6,6 +6,8 @@ import lombok.Data; ...@@ -6,6 +6,8 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import lombok.ToString; import lombok.ToString;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable; import java.io.Serializable;
import java.util.Map; import java.util.Map;
...@@ -16,15 +18,18 @@ import java.util.Map; ...@@ -16,15 +18,18 @@ import java.util.Map;
public class SaveStaffRecordRequestDTO implements Serializable { public class SaveStaffRecordRequestDTO implements Serializable {
@ApiModelProperty(notes = "账号ID") @ApiModelProperty(notes = "账号ID")
@NotBlank(message = "账号ID不能为空")
private String uuid; private String uuid;
@ApiModelProperty(name="loginRole", notes = "登录角色 1-超管 2-商户管理员 3-区域督导 4-驻店人员 5-广联销售 6-飞行督导 7-技师") @ApiModelProperty(name="loginRole", notes = "登录角色 1-超管 2-商户管理员 3-区域督导 4-驻店人员 5-广联销售 6-飞行督导 7-技师")
private Integer loginRole; private Integer loginRole;
@ApiModelProperty(notes = "模板编号") @ApiModelProperty(notes = "模板编号")
@NotBlank(message = "模板编号不能为空")
private String templateCode; private String templateCode;
@ApiModelProperty(notes = "表单") @ApiModelProperty(notes = "表单")
@NotEmpty(message = "表单不能为空")
private Map<String, String> form; private Map<String, String> form;
public SaveStaffRecordRequestDTO(Integer loginRole, String uuid, Map<String, String> form) { public SaveStaffRecordRequestDTO(Integer loginRole, String uuid, Map<String, String> form) {
...@@ -32,4 +37,9 @@ public class SaveStaffRecordRequestDTO implements Serializable { ...@@ -32,4 +37,9 @@ public class SaveStaffRecordRequestDTO implements Serializable {
this.uuid = uuid; this.uuid = uuid;
this.loginRole = loginRole; this.loginRole = loginRole;
} }
/**
* 是否保存
*/
private Boolean save;
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementStaffRecord;
import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementStaffRecordItem;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.List;
/**
* 员工喜报记录
* @author yangwei
* @version 1.0
* @since 2026/01/09 18:16
*/
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
public class StaffGoodNewsRecordDTO extends DigitalManagementStaffRecord {
private static final long serialVersionUID = 8709022404031690840L;
/**
* 员工名称
*/
private String name;
/**
* 手机号
*/
private String phone;
/**
* 喜报记录项
*/
private List<DigitalManagementStaffRecordItem> recordItemList;
/**
* 模板内容
*/
private ManagementTemplateContentDTO template;
/**
* 是否保存
*/
private Boolean save;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import lombok.Data;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* 汇报统计
* @author yangwei
* @version 1.0
* @since 2026/01/12 18:08
*/
@Data
@Accessors(chain = true)
public class StaffGoodNewsStatisticsDTO implements Serializable {
private static final long serialVersionUID = 2070874714769621031L;
/**
* 开始时间
*/
@NotNull(message = "开始时间不能为空")
private Date startTime;
/**
* 结束时间
*/
@NotNull(message = "结束时间不能为空")
private Date endTime;
/**
* 员工uuid
*/
private List<String> staffUuidList;
/**
* 模版代码
*/
@NotNull(message = "模版代码不能为空")
private String code;
/**
* 模版名称
*/
private String name;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 获取员工喜报模版请求对象
* @author yangwei
* @version 1.0
* @since 2026/01/08 19:11
*/
@Data
public class StaffGoodNewsTemplateReqDTO implements Serializable {
private static final long serialVersionUID = 8296747587815169072L;
/**
* 场景类型:0-会员权益/升级,1-精品升级
*/
private Integer sceneType;
/**
* 报告类型:1-日报,2-周报,3-月报
*/
private Integer reportType;
/**
* 员工编号,如果不传入取当前登录用户
*/
@NotBlank(message = "员工编号不能为空")
private String uuid;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import lombok.Data;
import java.io.Serializable;
/**
* 喜报模版响应数据对象
* @author yangwei
* @version 1.0
* @since 2026/01/08 17:57
*/
@Data
public class StaffGoodNewsTemplateRespDTO implements Serializable {
private static final long serialVersionUID = -2081857723317276564L;
/**
* 报告类型:1-日报,2-周报,3-月报
*/
private Integer reportType;
/**
* 模板类型
*/
private String type;
/**
* 模板类型名称
*/
private String typeName;
/**
* 模版唯一编号
*/
private String code;
/**
* 模板名称
*/
private String name;
/**
* id
*/
private Integer id;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import lombok.Builder;
import lombok.Data;
import java.io.Serializable;
/**
* 获取员工月报填写记录
* @author yangwei
* @version 1.0
* @since 2026/01/08 17:57
*/
@Data
@Builder
public class StaffMonthlyReportRecordDTO implements Serializable {
private static final long serialVersionUID = 6519524672282618603L;
/**
* 年
*/
private String year;
/**
* 周唯一标识
*/
private String month;
/**
* 能够提交,true 即可以提交,false 即不可以提交
*/
private Boolean beAbleSubmit;
/**
* 是否提交
*/
private Boolean hasSubmit;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;
/**
* 获取员工周报填写记录
* @author yangwei
* @version 1.0
* @since 2026/01/08 20:16
*/
@Data
public class StaffMonthlyReportRecordWrapper implements Serializable {
private static final long serialVersionUID = 7496738397096982231L;
/**
* 用户uuid
*/
@NotBlank(message = "用户uuid不能为空")
private String uuid;
/**
* 模版唯一编号
*/
@NotBlank(message = "模版唯一编号不能为空")
private String code;
/**
* 当月周信息
*/
@NotEmpty(message = "月份信息不能为空")
private List<@Valid MonthlyReportRecordReqDTO> monthlyReportRecordReqList;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import lombok.Data;
/**
* @author yangwei
* @version 1.0
* @since 2026/01/08 20:43
*/
@Data
public class StaffRecordDTO {
/**
* 主键
*/
private Integer id;
/**
* 用户uuid
*/
private String staffUuid;
/**
* 模板编码
*/
private String templateCode;
/**
* 提交时间
*/
private String submitDate;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import java.io.Serializable;
/**
* 获取周信息响应对象
* @author yangwei
* @version 1.0
* @since 2026/01/08 17:57
*/
@Data
@ApiModel("获取员工周报填写记录")
public class StaffWeeklyReportRecordDTO implements Serializable {
private static final long serialVersionUID = 6519524672282618603L;
/**
* 周唯一标识
*/
private String weekCode;
/**
* 能够提交,true 即可以提交,false 即不可以提交
*/
private Boolean beAbleSubmit;
/**
* 是否提交
*/
private Boolean hasSubmit;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import lombok.Data;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.List;
/**
* 获取员工周报填写记录
* @author yangwei
* @version 1.0
* @since 2026/01/08 20:16
*/
@Data
public class StaffWeeklyReportRecordWrapper implements Serializable {
private static final long serialVersionUID = 7496738397096982231L;
/**
* 用户uuid
*/
@NotBlank(message = "用户uuid不能为空")
private String uuid;
/**
* 模版唯一编号
*/
@NotBlank(message = "模版唯一编号不能为空")
private String code;
/**
* 当月周信息
*/
@NotEmpty(message = "当月周信息不能为空")
private List<@Valid WeeklyReportRecordReqDTO> weeklyReportRecordReqList;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import lombok.Data;
import java.util.Date;
/**
* @author yangwei
* @version 1.0
* @since 2026/01/13 21:07
*/
@Data
public class SubmitCountDTO {
/**
* 用户id
*/
private String uuid;
/**
* 提交次数
*/
private Integer submitCount;
/**
* 最近一次提交时间
*/
private Date recentlySubmitDate;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplateStaffRef;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 模版员工关联信息
* @author yangwei
* @version 1.0
* @since 2026/01/12 20:03
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class TemplateStaffRefDTO extends DigitalManagementTemplateStaffRef {
private static final long serialVersionUID = -339891578518469012L;
/**
* 指定日期
*/
private String targetDate;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
/**
* 周开始结束日期
* @author yangwei
* @version 1.0
* @since 2026/01/10 15:49
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class WeekRange {
private LocalDate startDate;
private LocalDate endDate;
}
package cn.com.glsx.dj.mindworkplate.dto.digitalmanagement;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDate;
/**
* 获取员工周报填写记录
* @author yangwei
* @version 1.0
* @since 2026/01/08 17:57
*/
@Data
public class WeeklyReportRecordReqDTO implements Serializable {
private static final long serialVersionUID = -1366491639688272784L;
/**
* 年份
*/
private String year;
/**
* 月份
*/
private String month;
/**
* 周唯一标识
*/
@NotBlank(message = "周唯一标识不能为空")
private String weekCode;
/**
* 周序号(从1开始)
*/
private Integer weekNumber;
/**
* 周开始日期
*/
private LocalDate startDate;
private String startDateStr;
/**
* 周结束日期
*/
private LocalDate endDate;
@NotBlank(message = "周结束日期不能为空")
private String endDateStr;
/**
* 是否跨月
*/
@NotNull(message = "是否跨月不能为空")
private Boolean crossMonth;
}
package cn.com.glsx.dj.mindworkplate.dto.messagebox; package cn.com.glsx.dj.mindworkplate.dto.messagebox;
import cn.com.glsx.dj.mindworkplate.enums.messagebox.ModuleTypeEnums;
import io.swagger.annotations.ApiModelProperty;
import lombok.*; import lombok.*;
import java.io.Serializable; import java.io.Serializable;
......
package cn.com.glsx.dj.mindworkplate.dto.messagebox;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 活动消息弹窗查询请求模型
*
* @author yangwei
* @version 1.0
* @since 2026/01/04 9:52
*/
@Data
public class ActivityMessagePopUpWindowDTO implements Serializable {
private static final long serialVersionUID = 7981687277778332484L;
/**
* 业务场景:0-延保/权益,1-精品
*/
@NotNull(message = "业务场景不能为空")
private Integer businessType;
/**
* uuid
*/
@NotBlank(message = "uuid不能为空")
private String uuid;
}
package cn.com.glsx.dj.mindworkplate.dto.messagebox;
import lombok.Data;
import java.io.Serializable;
/**
* 活动消息弹窗响应模型
* @author yangwei
* @version 1.0
* @since 2026/1/04 10:55
*/
@Data
public class ActivityMessagePopUpWindowRespDTO implements Serializable {
private static final long serialVersionUID = 4022752306429970419L;
/**
* 消息id
*/
private Integer msgId;
/**
* 关联id
*/
private Long relId;
/**
* 活动id
*/
private Long activityId;
/**
* 消息类型 0-活动消息 1-获奖名单消息
*/
private String type;
/**
* 活动名称
*/
private String activityName;
}
package cn.com.glsx.dj.mindworkplate.enums;
/**
* 去重维度
* @author yangwei
* @version 1.0
* @since 2026/01/13 09:44
*/
public enum DistinctDimensionalityEnum {
PHONE,UUID
}
package cn.com.glsx.dj.mindworkplate.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 喜报模版代码
*
* @author yangwei
* @version 1.0
* @since 2026/01/09 15:46
*/
@Getter
@AllArgsConstructor
public enum GoodNewsTemplateCodeEnum {
/**
* 2.3延保区域日报模版
*/
DELAY_TEMPLATE_CODE_2_3("uuid-temp-001", "2.3延保区域日报模版"),
/**
* 1.1轻改区域日报模版
*/
LIGHT_CHANGE_TEMPLATE_CODE_1_1("qinggai-temp-001", "1.1轻改区域日报模版"),
/**
* 2.1权益区域日报模版
*/
REGIONAL_TEMPLATE_CODE_2_1("uuid-temp-011", "1.1权益区域日报模版"),
/**
* 2.1区域经理周报模版
*/
REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_2_1("uuid-temp-012", "2.1区域经理周报模版"),
/**
* 1.1区域经理周报模版
*/
REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_1_1("uuid-temp-013", "1.1区域经理周报模版"),
/**
* 2.3区域经理周报模版
*/
REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_2_3("uuid-temp-014", "2.3区域经理周报模版"),
/**
* 2.1运营主管周报模版
*/
REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_15_2_1("uuid-temp-015", "2.1运营主管周报模版"),
/**
* 1.1运营主管周报模版
*/
REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_16_1_1("uuid-temp-016", "1.1运营主管周报模版"),
/**
* 2.3运营主管周报模版
*/
REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_17_2_3("uuid-temp-017", "2.3区域经理周报模版"),
/**
* 1.1区域经理月报模版
*/
REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_18_1_1("uuid-temp-018", "1.1区域经理月报模版"),
/**
* 2.1区域经理月报模版
*/
REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_19_2_1("uuid-temp-019", "2.1区域经理月报模版"),
/**
* 2.3区域经理月报模版
*/
REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_20_2_3("uuid-temp-020", "2.3区域经理月报模版"),
/**
* 2.1运营主管月报模版
*/
REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY__21_2_1("uuid-temp-021", "2.1运营主管月报模版"),
/**
* 1.1运营主管月报模版
*/
REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY__22_1_1("uuid-temp-022", "1.1运营主管月报模版"),
/**
* 2.3运营主管月报模版
*/
REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_23_2_3("uuid-temp-023", "2.3运营主管月报模版");
private final String code;
private final String name;
}
package cn.com.glsx.dj.mindworkplate.enums;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 喜报模版类型枚举, 报告类型:1-日报,2-周报,3-月报
* @author yangwei
* @version 1.0
* @since 2026/01/09 16:05
*/
@Getter
@AllArgsConstructor
public enum GoodNewsTemplateReportTypeEnum {
DAY("1", "日报"),
WEEK("2", "周报"),
MONTH("3", "月报");
private final String code;
private final String name;
public static GoodNewsTemplateReportTypeEnum getReportType(String code) {
for (GoodNewsTemplateReportTypeEnum value : values()) {
if (value.code.equals(code)) {
return value;
}
}
throw new RpcServiceException(MindWorkplateServiceErrorEnum.COMMON_ERROR, "不支持的模板类型");
}
}
package cn.com.glsx.dj.mindworkplate.enums;
import cn.com.glsx.framework.core.enums.ErrorEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;
import java.util.HashMap;
import java.util.Map;
/**
* mindworkplate服务错误码枚举
* @author yangwei
* @version 1.0
* @since 2026/01/09 14:48
*/
@Getter
@AllArgsConstructor
public enum MindWorkplateServiceErrorEnum implements ErrorEnum {
COMMON_ERROR("10086", "{}"),
DATA_NOT_FULL_ERROR("10001000", "数据不完整!");
private final String value;
private final String displayName;
static final Map<String, CommonErrorEnum> ENUM_MAP = new HashMap<String, CommonErrorEnum>();
static{
for(CommonErrorEnum code:CommonErrorEnum.values()){
ENUM_MAP.put(code.getValue(), code);
}
}
public static CommonErrorEnum getEnum(String value){
return ENUM_MAP.get(value);
}
}
...@@ -4,9 +4,9 @@ import com.fasterxml.jackson.annotation.JsonFormat; ...@@ -4,9 +4,9 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.persistence.*;
import java.io.Serializable; import java.io.Serializable;
import java.util.Date; import java.util.Date;
import javax.persistence.*;
@Table(name = "digital_management_template") @Table(name = "digital_management_template")
@Data @Data
...@@ -82,4 +82,31 @@ public class DigitalManagementTemplate implements Serializable { ...@@ -82,4 +82,31 @@ public class DigitalManagementTemplate implements Serializable {
@Column(name = "extend_field") @Column(name = "extend_field")
@ApiModelProperty(notes = "额外字段") @ApiModelProperty(notes = "额外字段")
private String extendField; private String extendField;
/**
* 场景类型:0-会员权益/升级,1-精品升级
*/
@Column(name = "scene_type")
private String sceneType;
/**
* 业务类型:1-延保,2-权益
*/
@Column(name = "business_type")
private Integer businessType;
/**
* 报告类型:1-日报,2-周报,3-月报
*/
@Column(name = "report_type")
private Integer reportType;
/**
* 角色类型:1-区域经理(区域运营),2-运营主管(驻店人员)
*/
@Column(name = "role_type")
private String roleType;
} }
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.remote; package cn.com.glsx.dj.mindworkplate.remote;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.*; import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.*;
import cn.com.glsx.framework.core.annotation.ApiMethod;
import cn.com.glsx.framework.core.annotation.ApiParam;
import cn.com.glsx.framework.core.annotation.ApiResponse;
import cn.com.glsx.framework.core.annotation.ApiService;
import cn.com.glsx.dj.mindworkplate.request.digitalmanagement.SubmittedDateRequestDTO; import cn.com.glsx.dj.mindworkplate.request.digitalmanagement.SubmittedDateRequestDTO;
import cn.com.glsx.framework.core.annotation.*; import cn.com.glsx.framework.core.annotation.*;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
...@@ -13,7 +9,6 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse; ...@@ -13,7 +9,6 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import java.util.Collection; import java.util.Collection;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Description 数字化管理-员工日报服务 * @Description 数字化管理-员工日报服务
...@@ -90,4 +85,18 @@ public interface DigitalManagementRecordRemote { ...@@ -90,4 +85,18 @@ public interface DigitalManagementRecordRemote {
@ApiMethod("查询所有员工") @ApiMethod("查询所有员工")
RpcResponse<RpcPagination<DigitalManagementStaffResponseDTO>> pageStaffInfo(RpcPagination<DigitalManagementStaffRequestDTO> req); RpcResponse<RpcPagination<DigitalManagementStaffResponseDTO>> pageStaffInfo(RpcPagination<DigitalManagementStaffRequestDTO> req);
@ApiMethod("查询员工周报提交")
@ApiParam(name = "request", notes = "条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("查询员工周报提交")
RpcResponse<List<StaffWeeklyReportRecordDTO>> findStaffWeeklyReportSubmit(StaffWeeklyReportRecordWrapper request);
@ApiMethod("查询员工月报提交")
@ApiParam(name = "request", notes = "条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("查询员工月报提交")
RpcResponse<List<StaffMonthlyReportRecordDTO>> findStaffMonthlyReportSubmit(StaffMonthlyReportRecordWrapper request);
@ApiMethod("获取员工喜报模版")
@ApiParam(name = "request", notes = "条件", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("获取员工喜报模版")
RpcResponse<List<StaffGoodNewsTemplateRespDTO>> findStaffGoodNewsTemplate(StaffGoodNewsTemplateReqDTO request);
} }
package cn.com.glsx.dj.mindworkplate.remote; package cn.com.glsx.dj.mindworkplate.remote;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.ActivityMessageDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.ActivityMessageRespDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.PadMsgBoxBatchDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.StatusRequestDTO; import cn.com.glsx.dj.mindworkplate.dto.messagebox.StatusRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.*;
import cn.com.glsx.dj.mindworkplate.dto.script.*; import cn.com.glsx.dj.mindworkplate.dto.script.*;
import cn.com.glsx.dj.mindworkplate.model.PadMessageBox; import cn.com.glsx.dj.mindworkplate.model.PadMessageBox;
import cn.com.glsx.dj.mindworkplate.model.WarningNotification; import cn.com.glsx.dj.mindworkplate.model.WarningNotification;
...@@ -102,4 +100,14 @@ public interface PadMessageBoxRemote { ...@@ -102,4 +100,14 @@ public interface PadMessageBoxRemote {
@ApiParam(name = "msgId", notes = "消息id", dataType = ApiParam.DataTypeEnum.OBJECT, required = true) @ApiParam(name = "msgId", notes = "消息id", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("更新结果") @ApiResponse("更新结果")
RpcResponse<Boolean> updActivityMessageStatus(Integer msgId); RpcResponse<Boolean> updActivityMessageStatus(Integer msgId);
@ApiMethod("活动消息弹窗")
@ApiParam(name = "request", notes = "请求参数", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("活动消息弹窗")
RpcResponse<ActivityMessagePopUpWindowRespDTO> getActivityMsgPopUpWindow(ActivityMessagePopUpWindowDTO request);
@ApiMethod("更新活动弹窗状态")
@ApiParam(name = "msgId", notes = "消息id", dataType = ApiParam.DataTypeEnum.OBJECT, required = true)
@ApiResponse("更新结果")
RpcResponse<Boolean> updActivityPopUpWindowStatus(Integer msgId);
} }
...@@ -37,5 +37,8 @@ public class StaffConfigDTO implements Serializable { ...@@ -37,5 +37,8 @@ public class StaffConfigDTO implements Serializable {
@ApiModelProperty(notes = "长课程配置任务ID") @ApiModelProperty(notes = "长课程配置任务ID")
private Integer taskId; private Integer taskId;
@ApiModelProperty(notes = "长课程配置任务状态 0未开始 1进行中 2已结束")
private Byte taskStatus;
private Date createdDate; private Date createdDate;
} }
...@@ -115,4 +115,7 @@ public class ReceptionMissingReportResponse implements Serializable { ...@@ -115,4 +115,7 @@ public class ReceptionMissingReportResponse implements Serializable {
@ApiModelProperty(notes = "修改时间") @ApiModelProperty(notes = "修改时间")
private Date updatedDate; private Date updatedDate;
private Integer sceneType;
} }
\ No newline at end of file \ No newline at end of file
...@@ -14,6 +14,11 @@ ...@@ -14,6 +14,11 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-riskmanage-api</artifactId>
<version>5.5.3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>cn.com.glsx.scrm</groupId> <groupId>cn.com.glsx.scrm</groupId>
<artifactId>rpc-scrm-coupon-api</artifactId> <artifactId>rpc-scrm-coupon-api</artifactId>
<version>4.50.0-SNAPSHOT</version> <version>4.50.0-SNAPSHOT</version>
...@@ -41,12 +46,12 @@ ...@@ -41,12 +46,12 @@
<dependency> <dependency>
<groupId>cn.com.glsx</groupId> <groupId>cn.com.glsx</groupId>
<artifactId>rpc-dj-mindworkplate-api</artifactId> <artifactId>rpc-dj-mindworkplate-api</artifactId>
<version>5.5.1-SNAPSHOT</version> <version>5.5.3-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
<artifactId>rpc-dj-smartcarlife-api</artifactId> <artifactId>rpc-dj-smartcarlife-api</artifactId>
<version>5.5.1-SNAPSHOT</version> <version>5.5.3-SNAPSHOT</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>cn.com.glsx.dj</groupId> <groupId>cn.com.glsx.dj</groupId>
......
package cn.com.glsx.dj.mindworkplate.component;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* @author yangwei
* @version 1.0
* @since 2026/01/09 15:15
*/
@Component
public class SpringContextHolder implements ApplicationContextAware {
private static ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
SpringContextHolder.applicationContext = applicationContext;
}
public static <T> T getBean(Class<T> clazz) {
return applicationContext.getBean(clazz);
}
public static Object getBean(String name) {
return applicationContext.getBean(name);
}
}
package cn.com.glsx.dj.mindworkplate.config;
import cn.com.glsx.dj.riskmanage.remote.ActivityRemote;
import lombok.RequiredArgsConstructor;
import org.oreframework.boot.autoconfigure.dubbo.reference.ReferenceBuilderFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* riskManage rpc config
* @author yangwei
* @version 1.0
* @since 2026/01/04 11:06
*/
@Configuration
@RequiredArgsConstructor
public class RiskManageConfig {
private final ReferenceBuilderFactory factory;
@Bean("riskManageActivityRemote")
public ActivityRemote activityRemote(){
return factory
.builder(ActivityRemote.class)
.check(false)
.timeout(30000)
.build();
}
}
package cn.com.glsx.dj.mindworkplate.enums;
import cn.com.glsx.dj.smartcarlife.enums.ActionReportTypeEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 喜报模版映射群配置
* @author yangwei
* @version 1.0
* @since 2026/01/10 10:45
*/
@Getter
@AllArgsConstructor
public enum GoodNewsTempMapGroupConfigEnum {
/**
* 2.3延保区域日报模版
*/
DAILY_2_3(GoodNewsTemplateCodeEnum.DELAY_TEMPLATE_CODE_2_3, ActionReportTypeEnum.REGIONAL_OPERATIONS_DAILY),
/**
* 1.1轻改区域日报模版
*/
DAILY_1_1(GoodNewsTemplateCodeEnum.LIGHT_CHANGE_TEMPLATE_CODE_1_1, ActionReportTypeEnum.LIGHT_REGIONAL_OPERATIONS_DAILY),
/**
* 2.1权益区域日报模版
*/
DAILY_2_1(GoodNewsTemplateCodeEnum.REGIONAL_TEMPLATE_CODE_2_1, ActionReportTypeEnum.EQUITY_REGIONAL_OPERATIONS_DAILY_4_2_1),
/**
* 2.1区域经理周报模版
*/
WEEKLY_2_1(GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_2_1, ActionReportTypeEnum.EQUITY_REGIONAL_MANAGER_WEEKLY_REPORT_4_2_1),
/**
* 1.1区域经理周报模版
*/
WEEKLY_1_1(GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_1_1, ActionReportTypeEnum.REGIONAL_MANAGER_WEEKLY_REPORT_4_1_1),
/**
* 2.3区域经理周报模版
*/
WEEKLY_2_3(GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_2_3, ActionReportTypeEnum.EQUITY_REGIONAL_MANAGER_WEEKLY_REPORT_4_2_3),
/**
* 2.1运营主管周报模版
*/
WEEKLY_2_1_OPERATION_SUPERVISOR(GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_15_2_1, ActionReportTypeEnum.EQUITY_OPERATION_MANAGER_WEEKLY_REPORT_4_2_1),
/**
* 1.1运营主管周报模版
*/
WEEKLY_1_1_OPERATION_SUPERVISOR(GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_16_1_1, ActionReportTypeEnum.OPERATION_MANAGER_WEEKLY_REPORT_4_1_1),
/**
* 2.3运营主管周报模版
*/
WEEKLY_2_3_OPERATION_SUPERVISOR(GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_17_2_3, ActionReportTypeEnum.EQUITY_OPERATION_MANAGER_WEEKLY_REPORT_4_2_3),
/**
* 1.1区域经理月报模版
*/
MONTHLY_1_1(GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_18_1_1, ActionReportTypeEnum.REGIONAL_MANAGER_MONTHLY_REPORT_4_1_1),
/**
* 2.1区域经理月报模版
*/
MONTHLY_2_1(GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_19_2_1, ActionReportTypeEnum.EQUITY_REGIONAL_MANAGER_MONTHLY_REPORT_4_2_1),
/**
* 2.3区域经理月报模版
*/
MONTHLY_2_3(GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_20_2_3, ActionReportTypeEnum.EQUITY_REGIONAL_MANAGER_MONTHLY_REPORT_4_2_3),
/**
* 2.1运营主管月报模版
*/
MONTHLY_2_1_OPERATION_SUPERVISOR(GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY__21_2_1, ActionReportTypeEnum.EQUITY_OPERATION_MANAGER_MONTHLY_REPORT_4_2_1),
/**
* 1.1运营主管月报模版
*/
MONTHLY_1_1_OPERATION_SUPERVISOR(GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY__22_1_1, ActionReportTypeEnum.OPERATION_MANAGER_MONTHLY_REPORT_4_1_1),
/**
* 2.3运营主管月报模版
*/
MONTHLY_2_3_OPERATION_SUPERVISOR(GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_23_2_3, ActionReportTypeEnum.EQUITY_OPERATION_MANAGER_MONTHLY_REPORT_4_2_3),
;
private final GoodNewsTemplateCodeEnum templateCodeEnum;
private final ActionReportTypeEnum reportTypeEnum;
/**
* 根据模板编号获取对应的报告类型
* @author yangwei
* @since 2026/1/10 11:00
* @param templateCode 模板编号
* @return cn.com.glsx.dj.smartcarlife.enums.ActionReportTypeEnum
*/
public static ActionReportTypeEnum getReportTypeEnumByTemplateCode(String templateCode) {
for (GoodNewsTempMapGroupConfigEnum value : values()) {
if (value.getTemplateCodeEnum().getCode().equals(templateCode)) {
return value.getReportTypeEnum();
}
}
throw new RpcServiceException(MindWorkplateServiceErrorEnum.COMMON_ERROR, "不支持的模板类型: " + templateCode);
}
}
package cn.com.glsx.dj.mindworkplate.handler;
import cn.com.glsx.dj.mindworkplate.consts.SymbolConstants;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementTemplateSummaryDTO;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.StaffGoodNewsStatisticsDTO;
import cn.com.glsx.dj.mindworkplate.enums.DistinctDimensionalityEnum;
import cn.com.glsx.dj.mindworkplate.enums.GoodNewsTempMapGroupConfigEnum;
import cn.com.glsx.dj.mindworkplate.enums.GoodNewsTemplateReportTypeEnum;
import cn.com.glsx.dj.mindworkplate.mapper.digitalmanagement.DigitalManagementTemplateMapper;
import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplate;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.DigitalManagementStaffRecordService;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.StaffRecordSpecialHandler;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.goodnewssave.RegionalManagerMonthlyReportSaveStrategy;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.goodnewssave.RegionalManagerWeeklyReportSaveStrategy;
import cn.com.glsx.dj.mindworkplate.util.DateUtils;
import cn.com.glsx.dj.smartcarlife.dto.worktoolpush.RecordRequestDTO;
import cn.com.glsx.dj.smartcarlife.remote.ReportPushRecordRemote;
import cn.com.glsx.framework.core.beans.BaseModel;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.google.common.collect.Lists;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import tk.mybatis.mapper.entity.Example;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* 报告未提交统计
* @author yangwei
* @version 1.0
* @since 2026/01/13 14:24
*/
@Slf4j
@Component
@RequiredArgsConstructor
public class ReportUnSummitStatisticsHandler {
private final static String UN_SUMMIT_REPORT_TEMPLATE = "【{}】未填写{}统计\n人数:{}\n名单:{}\n";
private final ReportPushRecordRemote reportPushRecordRemote;
private final StaffRecordSpecialHandler staffRecordSpecialHandler;
private final DigitalManagementTemplateMapper digitalManagementTemplateMapper;
private final DigitalManagementStaffRecordService digitalManagementStaffRecordService;
/**
* 统计然后推送
* @author yangwei
* @since 2026/1/13 15:06
* @param reportType 报告类型
*/
public void statisticsThenPush(GoodNewsTemplateReportTypeEnum reportType) {
Example example = new Example(DigitalManagementTemplate.class);
example.createCriteria()
.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name())
.andEqualTo("reportType", reportType.getCode());
List<DigitalManagementTemplate> digitalManagementTemplates = digitalManagementTemplateMapper.selectByExample(example);
if (CollUtil.isEmpty(digitalManagementTemplates)) {
return;
}
Date now = staffRecordSpecialHandler.getCurrentSystemDate();
List<String> dayRangeList = Lists.newArrayList(DateUtil.format(now, DateUtils.PATTERN_YYYY_MM_DD));
digitalManagementTemplates.forEach(template -> {
StaffGoodNewsStatisticsDTO request = new StaffGoodNewsStatisticsDTO().setCode(template.getCode()).setName(template.getName());
DigitalManagementTemplateSummaryDTO digitalManagementTemplateSummaryDTO = digitalManagementStaffRecordService.statisticsAssignDateDistinct(
request,
dayRangeList,
DistinctDimensionalityEnum.PHONE,
reportType);
String content = StrUtil.format(
UN_SUMMIT_REPORT_TEMPLATE,
dateBuilder(now, reportType),
template.getName(),
digitalManagementTemplateSummaryDTO.getUndoCount(),
digitalManagementTemplateSummaryDTO.getUndoCount() == 0 ?
SymbolConstants.NONE : StrUtil.join(SymbolConstants.CHINESE_COMMA, digitalManagementTemplateSummaryDTO.getUnSubmittedStaffNames())
);
RecordRequestDTO pushRequest = pushRequestBuilder(content, template.getCode());
log.info("推送模版配置对应的群消息请求参数:{}", pushRequest);
reportPushRecordRemote.addPushRecordRemote(pushRequest);
});
}
/**
* 日期构建
* @author yangwei
* @since 2026/1/13 14:59
* @param now 当前时间
* @param reportType 模板类型
* @return java.lang.String
*/
public String dateBuilder(Date now, GoodNewsTemplateReportTypeEnum reportType) {
switch (reportType) {
case DAY:
return DateUtil.format(now, DateUtils.PATTERN_YYYY_MM_DD);
case WEEK:
return RegionalManagerWeeklyReportSaveStrategy.getWeeklyRange(now);
case MONTH:
return RegionalManagerMonthlyReportSaveStrategy.getMonthlyRange(now);
default:
return StrUtil.EMPTY;
}
}
/**
* 组装推送请求
* @author yangwei
* @since 2026/1/13 14:55
* @param content 提醒内容
* @param code 模版代码
* @return cn.com.glsx.dj.smartcarlife.dto.worktoolpush.RecordRequestDTO
*/
private RecordRequestDTO pushRequestBuilder(String content, String code) {
RecordRequestDTO pushRequest = new RecordRequestDTO();
pushRequest.setMsgId(UUID.randomUUID().toString());
pushRequest.setContent(content);
pushRequest.setAttType(1);
pushRequest.setPushType(GoodNewsTempMapGroupConfigEnum.getReportTypeEnumByTemplateCode(code));
return pushRequest;
}
}
package cn.com.glsx.dj.mindworkplate.job.digitalmanagement; package cn.com.glsx.dj.mindworkplate.job.digitalmanagement;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementStaffInfoDTO; import cn.com.glsx.dj.mindworkplate.enums.GoodNewsTemplateReportTypeEnum;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementStaffRecordDTO; import cn.com.glsx.dj.mindworkplate.handler.ReportUnSummitStatisticsHandler;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementTemplateDTO;
import cn.com.glsx.dj.mindworkplate.mapper.digitalmanagement.DigitalManagementTemplateMapper;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.DigitalManagementStaffRecordService;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.DigitalManagementTemplateService;
import cn.com.glsx.dj.smartcarlife.dto.worktoolpush.RecordRequestDTO;
import cn.com.glsx.dj.smartcarlife.enums.ActionReportTypeEnum;
import cn.com.glsx.dj.smartcarlife.enums.SceneTypeEnum;
import cn.com.glsx.dj.smartcarlife.remote.ReportPushRecordRemote;
import cn.com.glsx.dj.smartcarlife.util.DateUtils;
import com.dangdang.ddframe.job.api.ShardingContext; import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob; import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf; import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.UUID;
import java.util.stream.Collectors;
/** /**
* @Description 未填写日报人员统计及推送功能:需实现每日晚间23:00自动统计当日未提交轻改区域日报&延保区域日报的人员名单,并通过指定机器人推送至相关群 * 日报统计
* @Author lyj * @author yangwei
* @Date 2025/12/21 * @version 1.0
* @Version 1.0 * @since 2026/01/13 16:03
*/ */
@Slf4j @Slf4j
@RequiredArgsConstructor
@ElasticJobConf(name = "DailyReportUnsubmittedSummaryJob", cron = "0 0 23 * * ?", description = "工作日报未填写统计推送", overwrite = false) @ElasticJobConf(name = "DailyReportUnsubmittedSummaryJob", cron = "0 0 23 * * ?", description = "工作日报未填写统计推送", overwrite = false)
public class DailyReportUnsubmittedSummaryJob implements SimpleJob { public class DailyReportUnsubmittedSummaryJob implements SimpleJob {
@Autowired private final ReportUnSummitStatisticsHandler reportUnSummitStatisticsHandler;
private DigitalManagementTemplateService templateService;
@Autowired
private DigitalManagementStaffRecordService staffRecordService;
@Autowired
private DigitalManagementTemplateMapper templateMapper;
@Autowired
private ReportPushRecordRemote reportPushRecordRemote;
@Override @Override
public void execute(ShardingContext var1) { public void execute(ShardingContext shardingContext) {
log.info("DailyReportUnsubmittedSummaryJob______未填写日报人员统计_______start"); log.info("DailyReportUnsubmittedSummaryJob______工作日报未填写统计推送_______start");
try { try {
RecordRequestDTO requestDTO = new RecordRequestDTO(); reportUnSummitStatisticsHandler.statisticsThenPush(GoodNewsTemplateReportTypeEnum.DAY);
requestDTO.setAttType(1);
requestDTO.setScene(SceneTypeEnum.SCENE1_0);
// 延保日报
requestDTO.setMsgId(UUID.randomUUID().toString());
requestDTO.setContent(getTemplateContent(templateService.getRegionalTemplateCode()));
requestDTO.setPushType(ActionReportTypeEnum.REGIONAL_OPERATIONS_DAILY);
log.info("未填写延保日报人员统计推送:{}", requestDTO);
reportPushRecordRemote.addPushRecordRemote(requestDTO);
// 轻改日报
requestDTO.setMsgId(UUID.randomUUID().toString());
requestDTO.setContent(getTemplateContent(templateService.getLightChangeTemplateCode()));
requestDTO.setPushType(ActionReportTypeEnum.LIGHT_REGIONAL_OPERATIONS_DAILY);
log.info("未填写轻改日报人员统计推送:{}", requestDTO);
reportPushRecordRemote.addPushRecordRemote(requestDTO);
} catch (Exception e) { } catch (Exception e) {
log.error("未填写日报人员统计自动任务推送到外部群异常:{}", e.getMessage(), e); log.error("工作月报未填写统计推送异常:", e);
}
log.info("DailyReportUnsubmittedSummaryJob______未填写日报人员统计_______end");
}
private String getTemplateContent(String templateCode) {
StringBuilder content = new StringBuilder();
String dateF = DateUtils.formatDate(new Date());
DigitalManagementTemplateDTO template = templateMapper.findByCode(templateCode);
String titleF = String.format("【%s】未填写%s统计", dateF, template.getTypeName());
Integer count = 0;
String unsubmittedStaffName = "无";
DigitalManagementStaffRecordDTO staffRecordDTO = new DigitalManagementStaffRecordDTO();
staffRecordDTO.setTemplateCode(templateCode);
staffRecordDTO.setStartTime(DateUtils.getStartTimeOfDay(new Date()));
staffRecordDTO.setEndTime(new Date());
// 今日未提交员工
Collection<DigitalManagementStaffInfoDTO> staffInfos = staffRecordService.getUnsubmittedStaffInfo(staffRecordDTO);
if (CollectionUtils.isNotEmpty(staffInfos)) {
// 根据手机号去重,保留每个手机号的第一条记录
staffInfos = new ArrayList<>(staffInfos.stream()
.filter(p -> StringUtils.isNotBlank(p.getUserPhone()))
.collect(Collectors.toMap(p -> p.getUserPhone(), p -> p, (p1, p2) -> p1))
.values());
}
if (CollectionUtils.isNotEmpty(staffInfos)) {
count = staffInfos.size();
unsubmittedStaffName = staffInfos.stream().map(p -> p.getUserName()).collect(Collectors.joining(","));
} }
return content.append(titleF).append("\n") log.info("DailyReportUnsubmittedSummaryJob______工作日报未填写统计推送_______end");
.append("人数:").append(count).append("\n")
.append("名单:").append(unsubmittedStaffName).append("\n")
.toString();
} }
} }
package cn.com.glsx.dj.mindworkplate.job.digitalmanagement;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementStaffInfoDTO;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementStaffRecordDTO;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementTemplateDTO;
import cn.com.glsx.dj.mindworkplate.mapper.digitalmanagement.DigitalManagementTemplateMapper;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.DigitalManagementStaffRecordService;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.DigitalManagementTemplateService;
import cn.com.glsx.dj.smartcarlife.dto.worktoolpush.RecordRequestDTO;
import cn.com.glsx.dj.smartcarlife.enums.ActionReportTypeEnum;
import cn.com.glsx.dj.smartcarlife.enums.SceneTypeEnum;
import cn.com.glsx.dj.smartcarlife.remote.ReportPushRecordRemote;
import cn.com.glsx.dj.smartcarlife.util.DateUtils;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.UUID;
import java.util.stream.Collectors;
/**
* @Description 未填写日报人员统计及推送功能:需实现每日晚间23:00自动统计当日未提交轻改区域日报&延保区域日报的人员名单,并通过指定机器人推送至相关群
* @Author lyj
* @Date 2025/12/21
* @Version 1.0
*/
@Slf4j
@Deprecated
// @ElasticJobConf(name = "DailyReportUnsubmittedSummaryJob", cron = "0 0 23 * * ?", description = "工作日报未填写统计推送", overwrite = false)
public class DailyReportUnsubmittedSummaryJob1 implements SimpleJob {
@Autowired
private DigitalManagementTemplateService templateService;
@Autowired
private DigitalManagementStaffRecordService staffRecordService;
@Autowired
private DigitalManagementTemplateMapper templateMapper;
@Autowired
private ReportPushRecordRemote reportPushRecordRemote;
@Override
public void execute(ShardingContext var1) {
log.info("DailyReportUnsubmittedSummaryJob______未填写日报人员统计_______start");
try {
RecordRequestDTO requestDTO = new RecordRequestDTO();
requestDTO.setAttType(1);
requestDTO.setScene(SceneTypeEnum.SCENE1_0);
// 延保日报
requestDTO.setMsgId(UUID.randomUUID().toString());
requestDTO.setContent(getTemplateContent(templateService.getRegionalTemplateCode()));
requestDTO.setPushType(ActionReportTypeEnum.REGIONAL_OPERATIONS_DAILY);
log.info("未填写延保日报人员统计推送:{}", requestDTO);
reportPushRecordRemote.addPushRecordRemote(requestDTO);
// 轻改日报
requestDTO.setMsgId(UUID.randomUUID().toString());
requestDTO.setContent(getTemplateContent(templateService.getLightChangeTemplateCode()));
requestDTO.setPushType(ActionReportTypeEnum.LIGHT_REGIONAL_OPERATIONS_DAILY);
log.info("未填写轻改日报人员统计推送:{}", requestDTO);
reportPushRecordRemote.addPushRecordRemote(requestDTO);
} catch (Exception e) {
log.error("未填写日报人员统计自动任务推送到外部群异常:{}", e.getMessage(), e);
}
log.info("DailyReportUnsubmittedSummaryJob______未填写日报人员统计_______end");
}
private String getTemplateContent(String templateCode) {
StringBuilder content = new StringBuilder();
String dateF = DateUtils.formatDate(new Date());
DigitalManagementTemplateDTO template = templateMapper.findByCode(templateCode);
String titleF = String.format("【%s】未填写%s统计", dateF, template.getTypeName());
Integer count = 0;
String unsubmittedStaffName = "无";
DigitalManagementStaffRecordDTO staffRecordDTO = new DigitalManagementStaffRecordDTO();
staffRecordDTO.setTemplateCode(templateCode);
staffRecordDTO.setStartTime(DateUtils.getStartTimeOfDay(new Date()));
staffRecordDTO.setEndTime(new Date());
// 今日未提交员工
Collection<DigitalManagementStaffInfoDTO> staffInfos = staffRecordService.getUnsubmittedStaffInfo(staffRecordDTO);
if (CollectionUtils.isNotEmpty(staffInfos)) {
// 根据手机号去重,保留每个手机号的第一条记录
staffInfos = new ArrayList<>(staffInfos.stream()
.filter(p -> StringUtils.isNotBlank(p.getUserPhone()))
.collect(Collectors.toMap(p -> p.getUserPhone(), p -> p, (p1, p2) -> p1))
.values());
}
if (CollectionUtils.isNotEmpty(staffInfos)) {
count = staffInfos.size();
unsubmittedStaffName = staffInfos.stream().map(p -> p.getUserName()).collect(Collectors.joining(","));
}
return content.append(titleF).append("\n")
.append("人数:").append(count).append("\n")
.append("名单:").append(unsubmittedStaffName).append("\n")
.toString();
}
}
package cn.com.glsx.dj.mindworkplate.job.digitalmanagement;
import cn.com.glsx.dj.mindworkplate.enums.GoodNewsTemplateReportTypeEnum;
import cn.com.glsx.dj.mindworkplate.handler.ReportUnSummitStatisticsHandler;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.StaffRecordSpecialHandler;
import cn.com.glsx.dj.mindworkplate.util.DateUtils;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
import java.time.LocalDate;
/**
* 工作月报未填写统计推送
* @author yangwei
* @version 1.0
* @since 2026/01/13 14:15
*/
@Slf4j
@RequiredArgsConstructor
@ElasticJobConf(name = "MonthlyReportUnSubmittedSummaryJob", cron = "0 0 23 ? * *", description = "工作月报未填写统计推送", overwrite = false)
public class MonthlyReportUnSubmittedSummaryJob implements SimpleJob {
private final StaffRecordSpecialHandler staffRecordSpecialHandler;
private final ReportUnSummitStatisticsHandler reportUnSummitStatisticsHandler;
@Override
public void execute(ShardingContext shardingContext) {
log.info("MonthlyReportUnSubmittedSummaryJob______工作月报未填写统计推送_______start");
try {
LocalDate currentDate = staffRecordSpecialHandler.getCurrentSystemLocalDate();
boolean isLastDayOfMonth = DateUtils.isLastDayOfMonth(currentDate);
if (isLastDayOfMonth) {
reportUnSummitStatisticsHandler.statisticsThenPush(GoodNewsTemplateReportTypeEnum.MONTH);
}
} catch (Exception e) {
log.error("工作月报未填写统计推送异常:", e);
}
log.info("MonthlyReportUnSubmittedSummaryJob______工作月报未填写统计推送_______end");
}
}
package cn.com.glsx.dj.mindworkplate.job.digitalmanagement;
import cn.com.glsx.dj.mindworkplate.enums.GoodNewsTemplateReportTypeEnum;
import cn.com.glsx.dj.mindworkplate.handler.ReportUnSummitStatisticsHandler;
import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.simple.SimpleJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.oreframework.boot.autoconfigure.elasticjob.annotation.ElasticJobConf;
/**
* 工作周报未填写统计推送
* @author yangwei
* @version 1.0
* @since 2026/01/13 14:15
*/
@Slf4j
@RequiredArgsConstructor
@ElasticJobConf(name = "WeeklyReportUnSubmittedSummaryJob", cron = "0 0 23 ? * SUN", description = "工作周报未填写统计推送", overwrite = false)
public class WeeklyReportUnSubmittedSummaryJob implements SimpleJob {
private final ReportUnSummitStatisticsHandler reportUnSummitStatisticsHandler;
@Override
public void execute(ShardingContext shardingContext) {
log.info("WeeklyReportUnSubmittedSummaryJob______工作周报未填写统计推送_______start");
try {
reportUnSummitStatisticsHandler.statisticsThenPush(GoodNewsTemplateReportTypeEnum.WEEK);
} catch (Exception e) {
log.error("工作月报未填写统计推送异常:", e);
}
log.info("WeeklyReportUnSubmittedSummaryJob______工作周报未填写统计推送_______end");
}
}
package cn.com.glsx.dj.mindworkplate.mapper; package cn.com.glsx.dj.mindworkplate.mapper;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.ActivityMessageDTO; import cn.com.glsx.dj.mindworkplate.dto.messagebox.*;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.ActivityMessageRespDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.MsgStatusDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.StatusRequestDTO; import cn.com.glsx.dj.mindworkplate.dto.messagebox.StatusRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.script.*; import cn.com.glsx.dj.mindworkplate.dto.script.*;
import cn.com.glsx.dj.mindworkplate.model.PadMessageBox; import cn.com.glsx.dj.mindworkplate.model.PadMessageBox;
...@@ -60,4 +58,13 @@ public interface PadMessageBoxMapper extends OreMapper<PadMessageBox> { ...@@ -60,4 +58,13 @@ public interface PadMessageBoxMapper extends OreMapper<PadMessageBox> {
* @return java.util.List<cn.com.glsx.dj.mindworkplate.dto.messagebox.PadMessageSummaryDetail> * @return java.util.List<cn.com.glsx.dj.mindworkplate.dto.messagebox.PadMessageSummaryDetail>
*/ */
List<PadMessageSummaryDetail> countMessageBoxByUuid(MsgStatusDTO msgStatusDTO); List<PadMessageSummaryDetail> countMessageBoxByUuid(MsgStatusDTO msgStatusDTO);
/**
* 获取活动消息弹窗信息
* @author yangwei
* @since 2026/1/4 10:42
* @param request 查询参数
* @return cn.com.glsx.dj.mindworkplate.dto.messagebox.ActivityMessagePopUpWindowRespDTO
*/
ActivityMessagePopUpWindowRespDTO getActivityMsgPopUpWindow(ActivityMessagePopUpWindowDTO request);
} }
\ No newline at end of file \ No newline at end of file
...@@ -12,6 +12,7 @@ import org.oreframework.datasource.mybatis.mapper.OreMapper; ...@@ -12,6 +12,7 @@ import org.oreframework.datasource.mybatis.mapper.OreMapper;
import java.util.Collection; import java.util.Collection;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Set;
@Mapper @Mapper
public interface DigitalManagementStaffRecordMapper extends OreMapper<DigitalManagementStaffRecord> { public interface DigitalManagementStaffRecordMapper extends OreMapper<DigitalManagementStaffRecord> {
...@@ -64,4 +65,41 @@ public interface DigitalManagementStaffRecordMapper extends OreMapper<DigitalMan ...@@ -64,4 +65,41 @@ public interface DigitalManagementStaffRecordMapper extends OreMapper<DigitalMan
int getMonthlyIsTrainingOrganizedCount(String uuid); int getMonthlyIsTrainingOrganizedCount(String uuid);
List<DigitalManagementStaffResponseDTO> selectStaffInfo(DigitalManagementStaffRequestDTO condition); List<DigitalManagementStaffResponseDTO> selectStaffInfo(DigitalManagementStaffRequestDTO condition);
/**
* 查找指定用户 {@code uuid} 对应模版 {@code code} 所在天 {@code dates} 喜报记录
* @author yangwei
* @since 2026/1/9 11:10
* @param uuid 用户,不能为空
* @param code 模版代码
* @param dates 日期列表
* @return java.util.List<cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.StaffRecordDTO>
*/
List<StaffRecordDTO> findReportByUuidAndDate(@Param("uuid") String uuid,
@Param("code") String code,
@Param("dates") List<String> dates);
/**
* <pre>
* 获取员工喜报模版(最新的模版配置)
* - 最新定义,生效日期 effective_date 最新,生效日期一样,id最大即为最新
* </pre>
* @author yangwei
* @since 2026/1/9 11:09
* @param request 请求对象
* @return java.util.List<cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.StaffGoodNewsTemplateRespDTO>
*/
List<StaffGoodNewsTemplateRespDTO> findStaffGoodNewsTemplate(StaffGoodNewsTemplateReqDTO request);
List<SubmitCountDTO> selectSubmitCountAssignRange(
@Param("uuids") Set<String> uuids,
@Param("templateCode") String templateCode,
@Param("startDate") String startDate,
@Param("endDate") String endDate
);
List<SubmitCountDTO> selectRecentlySubmitDate(
@Param("uuids") Set<String> strings,
@Param("templateCode") String templateCode
);
} }
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.mindworkplate.mapper.digitalmanagement; ...@@ -2,6 +2,7 @@ package cn.com.glsx.dj.mindworkplate.mapper.digitalmanagement;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementTemplateDTO; import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementTemplateDTO;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementTemplateStaffRefDTO; import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementTemplateStaffRefDTO;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.TemplateStaffRefDTO;
import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplateStaffRef; import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplateStaffRef;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -24,4 +25,17 @@ public interface DigitalManagementTemplateStaffRefMapper extends OreMapper<Digit ...@@ -24,4 +25,17 @@ public interface DigitalManagementTemplateStaffRefMapper extends OreMapper<Digit
* @param staffUuids 要进行匹配的员工编号 * @param staffUuids 要进行匹配的员工编号
*/ */
Collection<String> getTemplateBindingStaff(@Param("filterTemplateTypeName")String filterTemplateTypeName, @Param("staffUuids")List<String> staffUuids); Collection<String> getTemplateBindingStaff(@Param("filterTemplateTypeName")String filterTemplateTypeName, @Param("staffUuids")List<String> staffUuids);
/**
* 指定日期最新的模版记录
* @author yangwei
* @since 2026/1/12 19:55
* @param templateCode 模板编号
* @param targetDates 指定日期,格式yyyy-MM-dd
* @return java.util.List<cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplateStaffRef>
*/
List<TemplateStaffRefDTO> findLatestRecordsByDates(
@Param("templateCode") String templateCode,
@Param("targetDates") List<String> targetDates);
} }
\ No newline at end of file \ No newline at end of file
...@@ -4,18 +4,21 @@ import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.*; ...@@ -4,18 +4,21 @@ import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.*;
import cn.com.glsx.dj.mindworkplate.request.digitalmanagement.SubmittedDateRequestDTO; import cn.com.glsx.dj.mindworkplate.request.digitalmanagement.SubmittedDateRequestDTO;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.DigitalManagementStaffRecordService; import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.DigitalManagementStaffRecordService;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.DigitalManagementTemplateService; import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.DigitalManagementTemplateService;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.goodnewssave.ReportSaveFactory;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.goodnewssave.ReportSaveStrategy;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.exception.RpcServiceException; import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.hutool.core.bean.BeanUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService; import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.task.TaskExecutor; import org.springframework.core.task.TaskExecutor;
import javax.annotation.Resource;
import java.util.Collection; import java.util.Collection;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Description 数字化管理-员工日报服务 * @Description 数字化管理-员工日报服务
...@@ -36,6 +39,9 @@ public class DigitalManagementRecordRemoteImpl implements DigitalManagementRecor ...@@ -36,6 +39,9 @@ public class DigitalManagementRecordRemoteImpl implements DigitalManagementRecor
@Autowired @Autowired
private TaskExecutor taskExecutor; private TaskExecutor taskExecutor;
@Resource
private ReportSaveFactory reportSaveFactory;
@Override @Override
public RpcResponse<List<DigitalManagementTemplateDTO>> typeList(DigitalManagementTemplateDTO dto){ public RpcResponse<List<DigitalManagementTemplateDTO>> typeList(DigitalManagementTemplateDTO dto){
try { try {
...@@ -49,7 +55,9 @@ public class DigitalManagementRecordRemoteImpl implements DigitalManagementRecor ...@@ -49,7 +55,9 @@ public class DigitalManagementRecordRemoteImpl implements DigitalManagementRecor
@Override @Override
public RpcResponse<DigitalManagementTemplateSummaryDTO> recordSummary(DigitalManagementTemplateDTO dto){ public RpcResponse<DigitalManagementTemplateSummaryDTO> recordSummary(DigitalManagementTemplateDTO dto){
try { try {
return RpcResponse.success(templateService.recordSummary(dto)); // return RpcResponse.success(templateService.recordSummary(dto));
StaffGoodNewsStatisticsDTO staffGoodNewsStatisticsDTO = BeanUtil.copyProperties(dto, StaffGoodNewsStatisticsDTO.class);
return RpcResponse.success(staffRecordService.statistics(staffGoodNewsStatisticsDTO));
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return RpcResponse.error(e); return RpcResponse.error(e);
...@@ -160,9 +168,19 @@ public class DigitalManagementRecordRemoteImpl implements DigitalManagementRecor ...@@ -160,9 +168,19 @@ public class DigitalManagementRecordRemoteImpl implements DigitalManagementRecor
@Override @Override
public RpcResponse<Integer> save(SaveStaffRecordRequestDTO dto) { public RpcResponse<Integer> save(SaveStaffRecordRequestDTO dto) {
try { try {
Integer recordId = staffRecordService.save(dto); // Map<String, String> form = dto.getForm();
taskExecutor.execute(() -> staffRecordService.sendQwRobotMessage(recordId)); // if (MapUtil.isNotEmpty(form)) {
return RpcResponse.success(recordId); // for (String key : form.keySet()) {
// String value = form.get(key);
// if (ObjectUtil.isNotNull(value)) {
// form.remove(key);
// form.put(key, ObjectUtil.toString(value));
// }
// }
// }
ReportSaveStrategy strategy = reportSaveFactory.getStrategy(dto.getTemplateCode());
return RpcResponse.success(strategy.save(dto));
} catch (RpcServiceException e) { } catch (RpcServiceException e) {
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return RpcResponse.error(e.getError(), e.getMessage()); return RpcResponse.error(e.getError(), e.getMessage());
...@@ -185,4 +203,57 @@ public class DigitalManagementRecordRemoteImpl implements DigitalManagementRecor ...@@ -185,4 +203,57 @@ public class DigitalManagementRecordRemoteImpl implements DigitalManagementRecor
} }
} }
/**
* 查询员工周报提交
* @author yangwei
* @since 2026/1/8 20:14
* @param request 请求对象
* @return cn.com.glsx.framework.core.beans.rpc.RpcResponse<java.util.List<cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.StaffWeeklyReportRecordDTO>>
*/
@Override
public RpcResponse<List<StaffWeeklyReportRecordDTO>> findStaffWeeklyReportSubmit(StaffWeeklyReportRecordWrapper request) {
try {
return RpcResponse.success(staffRecordService.findStaffWeeklyReportSubmit(request));
} catch (RpcServiceException e) {
log.error("查询员工周报提交接口调用异常!", e);
return RpcResponse.error(e);
} catch (Exception e) {
log.error("查询员工周报提交接口调用异常!", e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<List<StaffMonthlyReportRecordDTO>> findStaffMonthlyReportSubmit(StaffMonthlyReportRecordWrapper request) {
try {
return RpcResponse.success(staffRecordService.findStaffMonthlyReportSubmit(request));
} catch (RpcServiceException e) {
log.error("查询员工月报提交接口调用异常!", e);
return RpcResponse.error(e);
} catch (Exception e) {
log.error("查询员工月报提交接口调用异常!", e);
return RpcResponse.error(e);
}
}
/**
* 获取员工喜报模版
* @author yangwei
* @since 2026/1/9 10:24
* @param request 请求对象
* @return cn.com.glsx.framework.core.beans.rpc.RpcResponse<java.util.List<cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.StaffGoodNewsTemplateRespDTO>>
*/
@Override
public RpcResponse<List<StaffGoodNewsTemplateRespDTO>> findStaffGoodNewsTemplate(StaffGoodNewsTemplateReqDTO request) {
try {
return RpcResponse.success(staffRecordService.findStaffGoodNewsTemplate(request));
} catch (RpcServiceException e) {
log.error("获取员工喜报模版接口调用异常!", e);
return RpcResponse.error(e);
} catch (Exception e) {
log.error("获取员工喜报模版接口调用异常!", e);
return RpcResponse.error(e);
}
}
} }
package cn.com.glsx.dj.mindworkplate.remote; package cn.com.glsx.dj.mindworkplate.remote;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.ActivityMessageDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.ActivityMessageRespDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.PadMsgBoxBatchDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.StatusRequestDTO; import cn.com.glsx.dj.mindworkplate.dto.messagebox.StatusRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.*;
import cn.com.glsx.dj.mindworkplate.dto.script.*; import cn.com.glsx.dj.mindworkplate.dto.script.*;
import cn.com.glsx.dj.mindworkplate.model.PadMessageBox; import cn.com.glsx.dj.mindworkplate.model.PadMessageBox;
import cn.com.glsx.dj.mindworkplate.model.WarningNotification; import cn.com.glsx.dj.mindworkplate.model.WarningNotification;
...@@ -16,7 +14,6 @@ import cn.com.glsx.framework.core.exception.RpcServiceException; ...@@ -16,7 +14,6 @@ import cn.com.glsx.framework.core.exception.RpcServiceException;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService; import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.rpc.RpcException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import java.util.List; import java.util.List;
...@@ -269,5 +266,34 @@ public class PadMessageBoxRemoteImpl implements PadMessageBoxRemote { ...@@ -269,5 +266,34 @@ public class PadMessageBoxRemoteImpl implements PadMessageBoxRemote {
} catch (Exception e) { } catch (Exception e) {
log.error("更新活动状态异常", e); log.error("更新活动状态异常", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage()); return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
} } }
}
@Override
public RpcResponse<ActivityMessagePopUpWindowRespDTO> getActivityMsgPopUpWindow(ActivityMessagePopUpWindowDTO request) {
try {
ActivityMessagePopUpWindowRespDTO activityMessagePopUpWindowRespDTO = padMessageBoxService.getActivityMsgPopUpWindow(request);
return RpcResponse.success(activityMessagePopUpWindowRespDTO);
} catch (RpcServiceException e) {
log.error("活动消息弹窗调用异常!", e);
return RpcResponse.error(e);
} catch (Exception e) {
log.error("活动消息弹窗调用异常!", e);
return RpcResponse.error(e);
}
}
@Override
public RpcResponse<Boolean> updActivityPopUpWindowStatus(Integer msgId) {
try {
return RpcResponse.success(padMessageBoxService.updActivityPopUpWindowStatus(msgId));
} catch (RpcServiceException e) {
log.error("更新活动弹窗异常", e);
return RpcResponse.error(e);
} catch (Exception e) {
log.error("更新活动弹窗异常", e);
return RpcResponse.error(DefaultErrorEnum.SERVER_ERROR, e.getMessage());
}
}
} }
...@@ -101,12 +101,21 @@ public class ConversationBatchService { ...@@ -101,12 +101,21 @@ public class ConversationBatchService {
if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(merchantRopResponses)) { if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(merchantRopResponses)) {
merchantDTO.setMerchantName(merchantRopResponses.get(0).getMerchantName()); merchantDTO.setMerchantName(merchantRopResponses.get(0).getMerchantName());
} }
merchantDTO.setPhoneNumber(maskPhoneNumber(merchantDTO.getPhoneNumber()));
} }
} }
} }
return res; return res;
} }
public static String maskPhoneNumber(String phone) {
if (phone == null || phone.length() != 11) {
return phone; // 或抛出异常、返回空字符串等,根据业务需求处理
}
return phone.substring(0, 3) + "****" + phone.substring(7);
}
public String generateFileUrlShortLink(ReceptionDetailRequestDTO request){ public String generateFileUrlShortLink(ReceptionDetailRequestDTO request){
ConversationBatch conversationBatch = conversationBatchMapper.findHisFlagByBatchId( ConversationBatch conversationBatch = conversationBatchMapper.findHisFlagByBatchId(
request.getBatchId()); request.getBatchId());
......
...@@ -299,10 +299,20 @@ public class EmployeeBadgeService { ...@@ -299,10 +299,20 @@ public class EmployeeBadgeService {
long a = duration == null ? 0l : Long.parseLong(duration) / 1000; long a = duration == null ? 0l : Long.parseLong(duration) / 1000;
dto.setDuration(String.valueOf(a)); dto.setDuration(String.valueOf(a));
dto.setDefencePoint(formatDefenceScore(dto.getDefencePoint())); dto.setDefencePoint(formatDefenceScore(dto.getDefencePoint()));
// phoneNumber脱敏显示为 139****8888 格式
dto.setPhoneNumber(maskPhoneNumber(dto.getPhoneNumber()));
} }
return page; return page;
} }
public static String maskPhoneNumber(String phone) {
if (phone == null || phone.length() != 11) {
return phone; // 或抛出异常、返回空字符串等,根据业务需求处理
}
return phone.substring(0, 3) + "****" + phone.substring(7);
}
public String formatDefenceScore(String defenceScore) { public String formatDefenceScore(String defenceScore) {
if (defenceScore == null || defenceScore.trim().isEmpty()) { if (defenceScore == null || defenceScore.trim().isEmpty()) {
return null; return null;
......
...@@ -4,6 +4,7 @@ import cn.com.glsx.dj.businessschool.remote.TeachTaskRecordRemote; ...@@ -4,6 +4,7 @@ import cn.com.glsx.dj.businessschool.remote.TeachTaskRecordRemote;
import cn.com.glsx.dj.mindworkplate.constant.DigitalManagementConstants; import cn.com.glsx.dj.mindworkplate.constant.DigitalManagementConstants;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.*; import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.*;
import cn.com.glsx.dj.mindworkplate.enums.DigitalManagementErrorEnum; import cn.com.glsx.dj.mindworkplate.enums.DigitalManagementErrorEnum;
import cn.com.glsx.dj.mindworkplate.enums.GoodNewsTemplateReportTypeEnum;
import cn.com.glsx.dj.mindworkplate.mapper.digitalmanagement.DigitalManagementStaffRecordMapper; import cn.com.glsx.dj.mindworkplate.mapper.digitalmanagement.DigitalManagementStaffRecordMapper;
import cn.com.glsx.dj.mindworkplate.mapper.digitalmanagement.DigitalManagementTemplateItemMapper; import cn.com.glsx.dj.mindworkplate.mapper.digitalmanagement.DigitalManagementTemplateItemMapper;
import cn.com.glsx.dj.mindworkplate.mapper.digitalmanagement.DigitalManagementTemplateMapper; import cn.com.glsx.dj.mindworkplate.mapper.digitalmanagement.DigitalManagementTemplateMapper;
...@@ -11,10 +12,8 @@ import cn.com.glsx.dj.mindworkplate.mapper.digitalmanagement.DigitalManagementTe ...@@ -11,10 +12,8 @@ import cn.com.glsx.dj.mindworkplate.mapper.digitalmanagement.DigitalManagementTe
import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplate; import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplate;
import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplateItem; import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplateItem;
import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplateStaffRef; import cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplateStaffRef;
import cn.com.glsx.dj.smartcarlife.dto.ShopMerchantDirectorConfigDTO;
import cn.com.glsx.dj.smartcarlife.dto.merchantPerformanceConfig.MentorBaseInfoDTO; import cn.com.glsx.dj.smartcarlife.dto.merchantPerformanceConfig.MentorBaseInfoDTO;
import cn.com.glsx.dj.smartcarlife.dto.merchantPerformanceConfig.StaffBaseInfoDTO; import cn.com.glsx.dj.smartcarlife.dto.merchantPerformanceConfig.StaffBaseInfoDTO;
import cn.com.glsx.dj.smartcarlife.enums.DirectorTypeEnum;
import cn.com.glsx.dj.smartcarlife.remote.ShopMerchantDirectorConfigRemote; import cn.com.glsx.dj.smartcarlife.remote.ShopMerchantDirectorConfigRemote;
import cn.com.glsx.dj.smartcarlife.remote.StaffBaseInfoRemote; import cn.com.glsx.dj.smartcarlife.remote.StaffBaseInfoRemote;
import cn.com.glsx.dj.smartcarlife.util.DateUtils; import cn.com.glsx.dj.smartcarlife.util.DateUtils;
...@@ -24,7 +23,6 @@ import cn.com.glsx.framework.core.util.RpcAssert; ...@@ -24,7 +23,6 @@ import cn.com.glsx.framework.core.util.RpcAssert;
import cn.com.glsx.merchants.model.request.MerchantStaffRequest; import cn.com.glsx.merchants.model.request.MerchantStaffRequest;
import cn.com.glsx.merchants.model.response.MerchantStaffResponse; import cn.com.glsx.merchants.model.response.MerchantStaffResponse;
import cn.com.glsx.merchants.remote.MerchantStaffRemote; import cn.com.glsx.merchants.remote.MerchantStaffRemote;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -81,7 +79,21 @@ public class DigitalManagementTemplateService { ...@@ -81,7 +79,21 @@ public class DigitalManagementTemplateService {
private DigitalManagementStaffRecordService staffRecordService; private DigitalManagementStaffRecordService staffRecordService;
public List<DigitalManagementTemplateDTO> typeList(DigitalManagementTemplateDTO dto) { public List<DigitalManagementTemplateDTO> typeList(DigitalManagementTemplateDTO dto) {
return templateMapper.findAllType(); Example example = new Example(DigitalManagementTemplate.class);
example.orderBy("code").asc();
example.createCriteria()
.andEqualTo("deletedFlag", BaseModel.DeletedFlagEnum.N.name())
.andIn("reportType", Arrays.stream(GoodNewsTemplateReportTypeEnum.values()).map(GoodNewsTemplateReportTypeEnum::getCode).collect(Collectors.toList()));
List<DigitalManagementTemplate> digitalManagementTemplates = templateMapper.selectByExample(example);
return digitalManagementTemplates.stream()
.map(digitalManagementTemplate -> {
DigitalManagementTemplateDTO managementTemplateDTO = new DigitalManagementTemplateDTO();
managementTemplateDTO.setCode(digitalManagementTemplate.getCode());
managementTemplateDTO.setName(digitalManagementTemplate.getName());
managementTemplateDTO.setType(digitalManagementTemplate.getType());
managementTemplateDTO.setTypeName(digitalManagementTemplate.getTypeName());
return managementTemplateDTO;
}).collect(Collectors.toList());
} }
public DigitalManagementTemplateDTO templateDetail(DigitalManagementTemplateDTO dto) { public DigitalManagementTemplateDTO templateDetail(DigitalManagementTemplateDTO dto) {
......
package cn.com.glsx.dj.mindworkplate.service.digitalmanagement;
import cn.com.glsx.dj.mindworkplate.consts.ConfigCenterConstants;
import cn.com.glsx.dj.mindworkplate.util.DateUtils;
import cn.hutool.core.util.StrUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.core.env.Environment;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.Optional;
/**
* 员工喜报特殊逻辑处理器
* @author yangwei
* @version 1.0
* @since 2026/01/12 14:02
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class StaffRecordSpecialHandler {
private final Environment env;
/**
* 获取当前系统时间,为了测试当前系统时间支持配置化,如果未配置,取服务器时间
* @author yangwei
* @since 2026/1/12 14:04
* @return java.time.LocalDate
*/
public LocalDate getCurrentSystemLocalDate() {
return Optional.ofNullable(env.getProperty(ConfigCenterConstants.CURRENT_SYSTEM_TIME_FOR_TEST))
.filter(StrUtil::isNotBlank)
.map(sysTimeForTest -> cn.com.glsx.dj.mindworkplate.util.DateUtils.parseDate(sysTimeForTest, cn.com.glsx.dj.mindworkplate.util.DateUtils.PATTERN_YYYYMMDD))
.orElseGet(LocalDate::now);
}
/**
* 获取当前系统时间, 为了测试当前系统时间支持配置化,如果未配置,取服务器时间
* @author yangwei
* @since 2026/1/12 14:04
* @return java.util.Date
*/
public Date getCurrentSystemDate() {
return Optional.ofNullable(env.getProperty(ConfigCenterConstants.CURRENT_SYSTEM_TIME_FOR_TEST))
.filter(StrUtil::isNotBlank)
.map(sysTimeForTest -> cn.com.glsx.dj.mindworkplate.util.DateUtils.parseDate(sysTimeForTest, cn.com.glsx.dj.mindworkplate.util.DateUtils.PATTERN_YYYYMMDD))
.map(sysTimeForTest -> DateUtils.toDate(DateUtils.combineWithCurrentTime(sysTimeForTest), ZoneId.of("Asia/Shanghai")))
.orElseGet(Date::new);
}
/**
* 获取当前系统时间,为了测试当前系统时间支持配置化,如果未配置,取服务器时间
* @author yangwei
* @since 2026/1/12 14:04
* @return java.time.LocalDateTime
*/
public LocalDateTime getCurrentSystemLocalDateTime() {
return Optional.ofNullable(env.getProperty(ConfigCenterConstants.CURRENT_SYSTEM_TIME_FOR_TEST))
.filter(StrUtil::isNotBlank)
.map(sysTimeForTest -> cn.com.glsx.dj.mindworkplate.util.DateUtils.parseDate(sysTimeForTest, cn.com.glsx.dj.mindworkplate.util.DateUtils.PATTERN_YYYYMMDD))
.map(DateUtils::combineWithCurrentTime)
.orElseGet(LocalDateTime::now);
}
}
package cn.com.glsx.dj.mindworkplate.service.digitalmanagement.goodnewssave;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.*;
import cn.com.glsx.dj.mindworkplate.enums.GoodNewsTemplateCodeEnum;
import cn.com.glsx.dj.mindworkplate.enums.MindWorkplateServiceErrorEnum;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.DigitalManagementStaffRecordService;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
/**
* 日报保存
* @author yangwei
* @version 1.0
* @since 2026/01/09 16:42
*/
@Component
public class DailyReportSaveStrategy extends BaseReportSaveStrategy {
private static final List<String> DAILY_TEMPLATES = Arrays.asList(
GoodNewsTemplateCodeEnum.DELAY_TEMPLATE_CODE_2_3.getCode(),
GoodNewsTemplateCodeEnum.LIGHT_CHANGE_TEMPLATE_CODE_1_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_TEMPLATE_CODE_2_1.getCode()
);
@Resource
private DigitalManagementStaffRecordService staffRecordService;
@Override
public boolean supports(String templateCode) {
return DAILY_TEMPLATES.contains(templateCode);
}
/**
* 日报持久化使用历史代码
* @author yangwei
* @since 2026/1/9 16:48
* @param request 请求对象
* @return java.lang.Integer
*/
@Override
public Integer persistence(SaveStaffRecordRequestDTO request) {
return staffRecordService.save(request);
}
@Override
protected String contentHeadBuilder(StaffGoodNewsRecordDTO staffGoodNewsRecordDTO) {
// 日报沿用历史代码,头部直接沿用
return StrUtil.EMPTY;
}
@Override
public String contentBuilder(StaffGoodNewsRecordDTO staffGoodNewsRecordDTO) {
// 日报提醒群推消息构建逻辑
DigitalManagementStaffRecordDTO staffRecordDTO = staffRecordService.getDigitalManagementStaffRecordDTO(staffGoodNewsRecordDTO);
staffRecordDTO.setSave(staffGoodNewsRecordDTO.getSave());
StringBuilder recordContent = Optional.ofNullable(staffRecordService.getRecordContent(staffGoodNewsRecordDTO.getName(), staffRecordDTO))
.orElseThrow(() -> new RpcServiceException(MindWorkplateServiceErrorEnum.COMMON_ERROR, String.format("构建日报推送内容失败,recordId:%s", staffGoodNewsRecordDTO.getId())));
return recordContent.toString();
}
}
package cn.com.glsx.dj.mindworkplate.service.digitalmanagement.goodnewssave;
import cn.com.glsx.dj.mindworkplate.consts.CommonConstants;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.SaveStaffRecordRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.StaffGoodNewsRecordDTO;
import cn.com.glsx.dj.mindworkplate.enums.GoodNewsTemplateCodeEnum;
import cn.com.glsx.dj.mindworkplate.util.DateUtils;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 运营主管(驻店人员)月报保存策略
* @author yangwei
* @version 1.0
* @since 2026/01/12 11:28
*/
@Slf4j
@Component
public class OperationExecutiveMonthlyReportSaveStrategy extends BaseReportSaveStrategy {
private static final List<String> OPERATION_EXECUTIVE_WEEKLY_TEMPLATES = Arrays.asList(
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY__21_2_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY__22_1_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_23_2_3.getCode()
);
@Override
public boolean supports(String templateCode) {
return OPERATION_EXECUTIVE_WEEKLY_TEMPLATES.contains(templateCode);
}
@Override
public ValidationResult validate(SaveStaffRecordRequestDTO request) {
ValidationResult validate = super.validate(request);
if (!validate.isValid()) {
return validate;
}
// 月报只能每个月最后一天填写
LocalDate now = staffRecordSpecialHandler.getCurrentSystemLocalDate();
boolean isLastDayOfMonth = DateUtils.isLastDayOfMonth(now);
if (!isLastDayOfMonth) {
validate.setValid(false);
validate.setMessage("月报只能在本月的最后一天填写!");
}
return validate;
}
/**
* 企微消息推送头部构建,月报
*
* @author yangwei
* @since 2026/1/12 11:36
* @param staffGoodNewsRecordDTO 员工喜报业务数据对象
* @return java.lang.String
*/
@Override
protected String contentHeadBuilder(StaffGoodNewsRecordDTO staffGoodNewsRecordDTO) {
Date createdDate = staffGoodNewsRecordDTO.getCreatedDate();
return StrUtil.format(CONTENT_HEAD_TEMPLATE,
staffGoodNewsRecordDTO.getTemplate().getName(),
staffGoodNewsRecordDTO.getName(),
RegionalManagerMonthlyReportSaveStrategy.getMonthlyRange(createdDate),
BooleanUtil.isTrue(staffGoodNewsRecordDTO.getSave()) ? StrUtil.EMPTY : CommonConstants.CHINESE_CHANGED);
}
}
package cn.com.glsx.dj.mindworkplate.service.digitalmanagement.goodnewssave;
import cn.com.glsx.dj.mindworkplate.consts.CommonConstants;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.SaveStaffRecordRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.StaffGoodNewsRecordDTO;
import cn.com.glsx.dj.mindworkplate.enums.GoodNewsTemplateCodeEnum;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.DigitalManagementStaffRecordService;
import cn.com.glsx.dj.mindworkplate.util.DateUtils;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.StrUtil;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 运营主管(驻店人员)周报保存策略
* @author yangwei
* @version 1.0
* @since 2026/01/09 16:10
*/
@Component
public class OperationExecutiveWeeklyReportSaveStrategy extends BaseReportSaveStrategy {
@Resource
private DigitalManagementStaffRecordService staffRecordService;
private static final List<String> OPERATION_EXECUTIVE_WEEKLY_TEMPLATES = Arrays.asList(
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_15_2_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_16_1_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_17_2_3.getCode()
);
@Override
public boolean supports(String templateCode) {
return OPERATION_EXECUTIVE_WEEKLY_TEMPLATES.contains(templateCode);
}
@Override
public ValidationResult validate(SaveStaffRecordRequestDTO request) {
ValidationResult validate = super.validate(request);
if (!validate.isValid()) {
return validate;
}
// 周报只能周日填写
LocalDate now = staffRecordSpecialHandler.getCurrentSystemLocalDate();
validationDate(now, request.getUuid(), validate);
return validate;
}
/**
* 校验日期
* @author yangwei
* @since 2026/1/12 16:26
* @param assignDate 当前系统时间
* @param validate 校验对象
*/
public void validationDate(LocalDate assignDate, String uuid, ValidationResult validate) {
boolean isSunday = DateUtils.isSunday(assignDate);
if (!isSunday) {
validate.setValid(false);
validate.setMessage("周报只能周日填写!");
return;
}
// 如果周日刚好是每个月最后一天且配置了月报,则无需填写周报
if (staffRecordService.onlySubmitMonthReport(assignDate, uuid)) {
validate.setValid(false);
validate.setMessage("填写本月月报即可,周报无需填写!");
}
}
@Override
protected String contentHeadBuilder(StaffGoodNewsRecordDTO staffGoodNewsRecordDTO) {
Date createdDate = staffGoodNewsRecordDTO.getCreatedDate();
return StrUtil.format(CONTENT_HEAD_TEMPLATE,
staffGoodNewsRecordDTO.getTemplate().getName(),
staffGoodNewsRecordDTO.getName(),
RegionalManagerWeeklyReportSaveStrategy.getWeeklyRange(createdDate),
BooleanUtil.isTrue(staffGoodNewsRecordDTO.getSave()) ? StrUtil.EMPTY : CommonConstants.CHINESE_CHANGED);
}
}
package cn.com.glsx.dj.mindworkplate.service.digitalmanagement.goodnewssave;
import cn.com.glsx.dj.mindworkplate.consts.CommonConstants;
import cn.com.glsx.dj.mindworkplate.consts.DatePatternConstants;
import cn.com.glsx.dj.mindworkplate.consts.SymbolConstants;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.MonthRange;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.SaveStaffRecordRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.StaffGoodNewsRecordDTO;
import cn.com.glsx.dj.mindworkplate.enums.GoodNewsTemplateCodeEnum;
import cn.com.glsx.framework.core.util.DateUtils;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 区域经理(区域运营)月报保存策略
* @author yangwei
* @version 1.0
* @since 2026/01/12 11:11
*/
@Slf4j
@Component
public class RegionalManagerMonthlyReportSaveStrategy extends BaseReportSaveStrategy {
private static final List<String> REGIONAL_MANAGER_MONTHLY_TEMPLATES = Arrays.asList(
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_18_1_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_19_2_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_MONTHLY_20_2_3.getCode()
);
@Override
public boolean supports(String templateCode) {
return REGIONAL_MANAGER_MONTHLY_TEMPLATES.contains(templateCode);
}
@Override
public ValidationResult validate(SaveStaffRecordRequestDTO request) {
ValidationResult validate = super.validate(request);
if (!validate.isValid()) {
return validate;
}
// 月报只能每个月最后一天填写
LocalDate now = staffRecordSpecialHandler.getCurrentSystemLocalDate();
boolean isLastDayOfMonth = cn.com.glsx.dj.mindworkplate.util.DateUtils.isLastDayOfMonth(now);
if (!isLastDayOfMonth) {
validate.setValid(false);
validate.setMessage("月报只能在本月的最后一天填写!");
}
return validate;
}
@Override
protected String contentHeadBuilder(StaffGoodNewsRecordDTO staffGoodNewsRecordDTO) {
Date createdDate = staffGoodNewsRecordDTO.getCreatedDate();
return StrUtil.format(CONTENT_HEAD_TEMPLATE,
staffGoodNewsRecordDTO.getTemplate().getName(),
staffGoodNewsRecordDTO.getName(),
getMonthlyRange(createdDate),
BooleanUtil.isTrue(staffGoodNewsRecordDTO.getSave()) ? StrUtil.EMPTY : CommonConstants.CHINESE_CHANGED);
}
public static String getMonthlyRange(Date createdDate) {
String format = DateUtil.format(createdDate, DateUtils.DEFAULT_DATE_FORMAT5);
MonthRange monthRange = cn.com.glsx.dj.mindworkplate.util.DateUtils.getMonthRange(format, DateUtils.DEFAULT_DATE_FORMAT5);
return cn.com.glsx.dj.mindworkplate.util.DateUtils.formatLocalDate(monthRange.getStartDate(), DatePatternConstants.YYYY_MM_DD_SLASH)
+ SymbolConstants.BLANK_DASH + cn.com.glsx.dj.mindworkplate.util.DateUtils.formatLocalDate(monthRange.getEndDate(), DatePatternConstants.YYYY_MM_DD_SLASH);
}
}
package cn.com.glsx.dj.mindworkplate.service.digitalmanagement.goodnewssave;
import cn.com.glsx.dj.mindworkplate.consts.CommonConstants;
import cn.com.glsx.dj.mindworkplate.consts.DatePatternConstants;
import cn.com.glsx.dj.mindworkplate.consts.SymbolConstants;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.SaveStaffRecordRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.StaffGoodNewsRecordDTO;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.WeekRange;
import cn.com.glsx.dj.mindworkplate.enums.GoodNewsTemplateCodeEnum;
import cn.com.glsx.dj.mindworkplate.service.digitalmanagement.DigitalManagementStaffRecordService;
import cn.com.glsx.framework.core.util.DateUtils;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.BooleanUtil;
import cn.hutool.core.util.StrUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* 区域经理(区域运营)周报保存策略
* @author yangwei
* @version 1.0
* @since 2026/01/09 15:42
*/
@Slf4j
@Component
public class RegionalManagerWeeklyReportSaveStrategy extends BaseReportSaveStrategy {
@Autowired
private DigitalManagementStaffRecordService staffRecordService;
private static final List<String> REGIONAL_MANAGER_WEEKLY_TEMPLATES = Arrays.asList(
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_1_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_2_1.getCode(),
GoodNewsTemplateCodeEnum.REGIONAL_MANAGER_TEMPLATE_CODE_WEEKLY_2_3.getCode()
);
@Override
public boolean supports(String templateCode) {
return REGIONAL_MANAGER_WEEKLY_TEMPLATES.contains(templateCode);
}
@Override
public ValidationResult validate(SaveStaffRecordRequestDTO request) {
ValidationResult validate = super.validate(request);
if (!validate.isValid()) {
return validate;
}
// 周报只能周日填写
LocalDate now = staffRecordSpecialHandler.getCurrentSystemLocalDate();
validationDate(now, request.getUuid(), validate);
return validate;
}
public void validationDate(LocalDate assignDate, String uuid, ValidationResult validate) {
boolean isSunday = cn.com.glsx.dj.mindworkplate.util.DateUtils.isSunday(assignDate);
if (!isSunday) {
validate.setValid(false);
validate.setMessage("周报只能周日填写!");
return;
}
// 如果周日刚好是每个月最后一天且配置了月报,则无需填写周报
if (staffRecordService.onlySubmitMonthReport(assignDate, uuid)) {
validate.setValid(false);
validate.setMessage("填写本月月报即可,周报无需填写!");
}
}
/**
* 周报需要获取填写周报的区间
* @author yangwei
* @since 2026/1/10 15:42
* @param staffGoodNewsRecordDTO 请求参数
* @return java.lang.String
*/
@Override
protected String contentHeadBuilder(StaffGoodNewsRecordDTO staffGoodNewsRecordDTO) {
Date createdDate = staffGoodNewsRecordDTO.getCreatedDate();
return StrUtil.format(CONTENT_HEAD_TEMPLATE,
staffGoodNewsRecordDTO.getTemplate().getName(),
staffGoodNewsRecordDTO.getName(),
getWeeklyRange(createdDate),
BooleanUtil.isTrue(staffGoodNewsRecordDTO.getSave()) ? StrUtil.EMPTY : CommonConstants.CHINESE_CHANGED);
}
/**
* 获取周报填写的区间
* @author yangwei
* @since 2026/1/10 15:42
* @param createdDate 创建时间
* @return java.lang.String
*/
public static String getWeeklyRange(Date createdDate) {
String format = DateUtil.format(createdDate, DateUtils.DEFAULT_DATE_FORMAT5);
WeekRange weekRange = cn.com.glsx.dj.mindworkplate.util.DateUtils.getWeekRange(format, DateUtils.DEFAULT_DATE_FORMAT5);
return cn.com.glsx.dj.mindworkplate.util.DateUtils.formatLocalDate(weekRange.getStartDate(), DatePatternConstants.YYYY_MM_DD_SLASH)
+ SymbolConstants.BLANK_DASH + cn.com.glsx.dj.mindworkplate.util.DateUtils.formatLocalDate(weekRange.getEndDate(), DatePatternConstants.YYYY_MM_DD_SLASH);
}
}
package cn.com.glsx.dj.mindworkplate.service.digitalmanagement.goodnewssave;
import cn.com.glsx.dj.mindworkplate.enums.MindWorkplateServiceErrorEnum;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.List;
/**
* 喜报保存工厂
* @author yangwei
* @version 1.0
* @since 2026/01/09 15:57
*/
@Component
public class ReportSaveFactory {
/** 策略列表 */
private final List<ReportSaveStrategy> strategies;
@Autowired
public ReportSaveFactory(List<ReportSaveStrategy> strategies) {
this.strategies = strategies;
}
public ReportSaveStrategy getStrategy(String templateCode) {
return strategies.stream()
.filter(strategy -> strategy.supports(templateCode))
.findFirst()
.orElseThrow(() -> new RpcServiceException(MindWorkplateServiceErrorEnum.COMMON_ERROR, "不支持的模板类型: " + templateCode));
}
}
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.service.digitalmanagement.goodnewssave;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.ManagementTemplateContentDTO;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.SaveStaffRecordRequestDTO;
import cn.com.glsx.dj.smartcarlife.dto.worktoolpush.RecordRequestDTO;
import cn.com.glsx.dj.smartcarlife.dto.worktoolpush.StaffRecordRequestDTO;
/**
* 汇报保存策略
* 包含:验证、保存、推送、统计
* 支持多个模板,涵盖 日报,周报,月报
* @author yangwei
* @version 1.0
* @since 2026/01/09 14:32
*/
public interface ReportSaveStrategy {
/**
* 判断是否支持该模板
* @author yangwei
* @since 2026/1/9 15:38
* @param templateCode 模版代码
* @return boolean
*/
boolean supports(String templateCode);
/**
* 保存报告并推送消息
* @author yangwei
* @since 2026/1/9 15:37
* @param request 请求对象
* @return java.lang.Integer 保存之后的用户喜报id
*/
Integer save(SaveStaffRecordRequestDTO request);
/**
* 验证报告数据
* @author yangwei
* @since 2026/1/9 15:37
* @param request 请求对象
* @return cn.com.glsx.dj.mindworkplate.service.digitalmanagement.goodnewssave.ValidationResult
*/
ValidationResult validate(SaveStaffRecordRequestDTO request);
/**
* 获取模板配置
* @author yangwei
* @since 2026/1/9 15:37
* @param templateCode 模版代码
* @return cn.com.glsx.dj.mindworkplate.model.digitalmanagement.DigitalManagementTemplate
*/
ManagementTemplateContentDTO getTemplateItems(String templateCode);
/**
* 喜报后续处理
* @author yangwei
* @since 2026/1/9 17:18
* @param staffRecordId 喜报记录ID
* @param request 请求参数
*/
void postProcess(Integer staffRecordId, SaveStaffRecordRequestDTO request);
/**
* 企微群推送
* @author yangwei
* @since 2026/1/10 10:21
* @param staffRecordId 喜报记录ID
* @param pushRequest 按照模版推送
* @param staffRecordRequest 按照员工推送
*/
void enterpriseWeChatGroupPush(Integer staffRecordId, RecordRequestDTO pushRequest, StaffRecordRequestDTO staffRecordRequest);
}
package cn.com.glsx.dj.mindworkplate.service.digitalmanagement.goodnewssave;
import lombok.AllArgsConstructor;
import lombok.Data;
import java.util.HashMap;
import java.util.Map;
/**
* @author yangwei
* @version 1.0
* @since 2026/01/09 14:35
*/
@Data
@AllArgsConstructor
public class ValidationResult {
private boolean valid;
private String message;
private Map<String, String> errors;
public static ValidationResult success() {
return new ValidationResult(true, "验证通过", null);
}
public static ValidationResult error(String message) {
return new ValidationResult(false, message, new HashMap<>());
}
public static ValidationResult error(String message, Map<String, String> errors) {
return new ValidationResult(false, message, errors);
}
}
\ No newline at end of file \ No newline at end of file
...@@ -783,6 +783,13 @@ public class LongcourseSceneConfigService { ...@@ -783,6 +783,13 @@ public class LongcourseSceneConfigService {
.max(Integer::compareTo) .max(Integer::compareTo)
.orElse(null)); .orElse(null));
// 取最大值或第一个即可(看你业务需要)
merged.setTaskStatus(group.stream()
.map(StaffConfigDTO::getTaskStatus)
.filter(Objects::nonNull)
.max(Byte::compareTo)
.orElse(null));
return merged; return merged;
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
...@@ -825,6 +832,7 @@ public class LongcourseSceneConfigService { ...@@ -825,6 +832,7 @@ public class LongcourseSceneConfigService {
if (CollectionUtils.isNotEmpty(contentManagerTaskStaffDTOS)){ if (CollectionUtils.isNotEmpty(contentManagerTaskStaffDTOS)){
oneMonthOrderStaffDTO.setCourseConfigFlag(1); oneMonthOrderStaffDTO.setCourseConfigFlag(1);
oneMonthOrderStaffDTO.setTaskId(contentManagerTaskStaffDTOS.get(0).getCmtId()); oneMonthOrderStaffDTO.setTaskId(contentManagerTaskStaffDTOS.get(0).getCmtId());
oneMonthOrderStaffDTO.setTaskStatus(contentManagerTaskStaffDTOS.get(0).getTaskStatus());
} }
Optional<StaffConfigDTO> staffConfigDTO = list.stream() Optional<StaffConfigDTO> staffConfigDTO = list.stream()
.filter(item -> Objects.equals(item.getPhone(), oneMonthOrderStaffDTO.getPhone())) .filter(item -> Objects.equals(item.getPhone(), oneMonthOrderStaffDTO.getPhone()))
......
package cn.com.glsx.dj.mindworkplate.service.script; package cn.com.glsx.dj.mindworkplate.service.script;
import cn.com.glsx.dj.mindworkplate.dto.aiagent.AiAgentInfoDTO; import cn.com.glsx.dj.mindworkplate.dto.aiagent.AiAgentInfoDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.*;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.StatusRequestDTO; import cn.com.glsx.dj.mindworkplate.dto.messagebox.StatusRequestDTO;
import cn.com.glsx.dj.mindworkplate.dto.messagebox.*;
import cn.com.glsx.dj.mindworkplate.dto.script.*; import cn.com.glsx.dj.mindworkplate.dto.script.*;
import cn.com.glsx.dj.mindworkplate.dto.sop.SopTaskDetailInsertDTO; import cn.com.glsx.dj.mindworkplate.dto.sop.SopTaskDetailInsertDTO;
import cn.com.glsx.dj.mindworkplate.dto.sop.SopTaskInfoDTO; import cn.com.glsx.dj.mindworkplate.dto.sop.SopTaskInfoDTO;
...@@ -16,18 +16,17 @@ import cn.com.glsx.dj.mindworkplate.mapper.script.ExtractRecordPadPushMapper; ...@@ -16,18 +16,17 @@ import cn.com.glsx.dj.mindworkplate.mapper.script.ExtractRecordPadPushMapper;
import cn.com.glsx.dj.mindworkplate.mapper.script.SopTaskPadPushMapper; import cn.com.glsx.dj.mindworkplate.mapper.script.SopTaskPadPushMapper;
import cn.com.glsx.dj.mindworkplate.model.ActivityMsgRelation; import cn.com.glsx.dj.mindworkplate.model.ActivityMsgRelation;
import cn.com.glsx.dj.mindworkplate.model.PadMessageBox; import cn.com.glsx.dj.mindworkplate.model.PadMessageBox;
import cn.com.glsx.dj.mindworkplate.model.WarningNotification;
import cn.com.glsx.dj.mindworkplate.model.script.ExtractRecord; import cn.com.glsx.dj.mindworkplate.model.script.ExtractRecord;
import cn.com.glsx.dj.mindworkplate.model.script.ExtractRecordPadPush; import cn.com.glsx.dj.mindworkplate.model.script.ExtractRecordPadPush;
import cn.com.glsx.dj.mindworkplate.model.script.SopTaskPadPush; import cn.com.glsx.dj.mindworkplate.model.script.SopTaskPadPush;
import cn.com.glsx.dj.mindworkplate.model.sop.SopTaskDetailInfo;
import cn.com.glsx.dj.mindworkplate.model.sop.SopTaskInfo;
import cn.com.glsx.dj.mindworkplate.service.aiagent.AiAgentAccountInfoService; import cn.com.glsx.dj.mindworkplate.service.aiagent.AiAgentAccountInfoService;
import cn.com.glsx.dj.mindworkplate.service.warning.WarningNotificationService; import cn.com.glsx.dj.mindworkplate.service.warning.WarningNotificationService;
import cn.com.glsx.dj.mindworkplate.util.validation.BeanValidationUtils; import cn.com.glsx.dj.mindworkplate.util.validation.BeanValidationUtils;
import cn.com.glsx.dj.riskmanage.dto.activity.ActivityRespDTO;
import cn.com.glsx.dj.riskmanage.dto.activity.FindActivityByIdOrCycleIdQry;
import cn.com.glsx.dj.riskmanage.remote.ActivityRemote;
import cn.com.glsx.dj.smartcarlife.dto.contentManager.ContentManagerTaskDTO; import cn.com.glsx.dj.smartcarlife.dto.contentManager.ContentManagerTaskDTO;
import cn.com.glsx.dj.smartcarlife.enums.ContentManagerEnum; import cn.com.glsx.dj.smartcarlife.enums.ContentManagerEnum;
import cn.com.glsx.dj.smartcarlife.enums.RpcErrorEnum;
import cn.com.glsx.dj.smartcarlife.remote.ContentManagerTaskRemote; import cn.com.glsx.dj.smartcarlife.remote.ContentManagerTaskRemote;
import cn.com.glsx.framework.core.beans.rpc.RpcPagination; import cn.com.glsx.framework.core.beans.rpc.RpcPagination;
import cn.com.glsx.framework.core.beans.rpc.RpcResponse; import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
...@@ -38,13 +37,12 @@ import cn.com.glsx.framework.core.util.RpcAssert; ...@@ -38,13 +37,12 @@ import cn.com.glsx.framework.core.util.RpcAssert;
import cn.com.glsx.scrm.equity.enums.DeleteFlagEnum; import cn.com.glsx.scrm.equity.enums.DeleteFlagEnum;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ObjUtil; import cn.hutool.core.util.ObjUtil;
import com.alibaba.fastjson.JSON; import cn.hutool.core.util.ObjectUtil;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists; import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -57,7 +55,6 @@ import tk.mybatis.mapper.entity.Example; ...@@ -57,7 +55,6 @@ import tk.mybatis.mapper.entity.Example;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
@Service @Service
@Slf4j @Slf4j
...@@ -90,6 +87,9 @@ public class PadMessageBoxService { ...@@ -90,6 +87,9 @@ public class PadMessageBoxService {
@Resource @Resource
private ActivityMsgRelationMapper activityMsgRelationMapper; private ActivityMsgRelationMapper activityMsgRelationMapper;
@Resource(name = "riskManageActivityRemote")
private ActivityRemote activityRemote;
/** /**
* 查询未阅读的优秀话术接口 * 查询未阅读的优秀话术接口
...@@ -628,4 +628,62 @@ public class PadMessageBoxService { ...@@ -628,4 +628,62 @@ public class PadMessageBoxService {
} }
return true; return true;
} }
/**
* 获取活动消息弹窗
* @author yangwei
* @since 2026/1/4 10:37
* @param request 活动消息弹窗参数
* @return cn.com.glsx.dj.mindworkplate.dto.messagebox.ActivityMessagePopUpWindowRespDTO
*/
public ActivityMessagePopUpWindowRespDTO getActivityMsgPopUpWindow(ActivityMessagePopUpWindowDTO request) {
BeanValidationUtils.validateAndThrow(request);
ActivityMessagePopUpWindowRespDTO activityMsgPopUpWindow = padMessageBoxMapper.getActivityMsgPopUpWindow(request);
if (ObjectUtil.isNull(activityMsgPopUpWindow)) {
return null;
}
FindActivityByIdOrCycleIdQry qryActivityInfo = FindActivityByIdOrCycleIdQry.builder()
.id(activityMsgPopUpWindow.getRelId())
.type(activityMsgPopUpWindow.getType())
.build();
RpcResponse<ActivityRespDTO> rpcResponse = activityRemote.getActivityInfoByAssignId(qryActivityInfo);
// 不影响主业务,如果没查询到,直接不进行弹窗
if (!rpcResponse.isSuccess()) {
log.warn("根据活动id或者周期id查询活动调用异常!");
return null;
}
ActivityRespDTO result = rpcResponse.getResult();
if (ObjectUtil.isNull(result)) {
log.warn("关联id:{}未查询到对应活动信息!", activityMsgPopUpWindow.getRelId());
return null;
}
activityMsgPopUpWindow.setActivityName(result.getName());
activityMsgPopUpWindow.setActivityId(result.getId());
return activityMsgPopUpWindow;
}
/**
* 更新活动消息弹窗状态
* @author yangwei
* @since 2026/1/4 10:37
* @param msgId 活动消息id
* @return java.lang.Boolean
*/
public Boolean updActivityPopUpWindowStatus(Integer msgId) {
PadMessageBox padMessageBox = new PadMessageBox();
padMessageBox.setId(msgId);
padMessageBox.setStatus(1);
padMessageBox.setPopupCount(1);
padMessageBox.setLatestReadTime(new Date());
int result = padMessageBoxMapper.updateByPrimaryKeySelective(padMessageBox);
if (result == 0) {
throw new RpcServiceException(DefaultErrorEnum.DATABASE_ERROR, "更新活动消息状态失败!");
}
return true;
}
} }
...@@ -326,4 +326,94 @@ ...@@ -326,4 +326,94 @@
order by si.register_time, si.created_date desc order by si.register_time, si.created_date desc
</select> </select>
<select id="findReportByUuidAndDate"
resultType="cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.StaffRecordDTO">
select id, staff_uuid staffUuid, template_code templateCode, DATE_FORMAT(created_date, '%Y%m%d') as submitDate
from digital_management_staff_record
<where>
deleted_flag = 'N'
and template_code = #{code}
<if test="dates != null and dates.size() > 0">
and DATE_FORMAT(created_date, '%Y%m%d') in
<foreach collection="dates" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
and staff_uuid = #{uuid}
</where>
</select>
<select id="findStaffGoodNewsTemplate"
resultType="cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.StaffGoodNewsTemplateRespDTO">
SELECT
t3.code ,
t3.name ,
t3.`type`,
t3.type_name as typeName,
t3.scene_type sceneType,
t3.business_type businessType,
t3.report_type reportType,
t3.id
FROM (
SELECT t1.*
FROM digital_management_template_staff_ref t1
where
NOT EXISTS (
SELECT 1
FROM digital_management_template_staff_ref t2
WHERE t2.template_code = t1.template_code
AND t2.deleted_flag = 'N'
AND (
t2.effective_date > t1.effective_date
OR (t2.effective_date = t1.effective_date AND t2.id > t1.id)
)
)
AND t1.deleted_flag = 'N'
) AS latest_templates
join digital_management_template t3 on latest_templates.template_code = t3.code and t3.deleted_flag = 'N'
<where>
<if test="uuid != null and uuid != ''">
and FIND_IN_SET(#{uuid}, staff_uuid_list) > 0
</if>
<if test="sceneType != null">
and t3.scene_type = #{sceneType}
</if>
<if test="reportType != null">
and t3.report_type = #{reportType}
</if>
</where>
ORDER BY t3.report_type, t3.code
</select>
<select id="selectSubmitCountAssignRange"
resultType="cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.SubmitCountDTO">
select
staff_uuid uuid, count(0) submitCount
from digital_management_staff_record
where
staff_uuid in
<foreach item="item" collection="uuids" separator="," open="(" close=")" index="">
#{item}
</foreach>
and deleted_flag = 'N'
and DATE_FORMAT(created_date, '%Y%m%d') between #{startDate} and #{endDate}
and template_code = #{templateCode}
group by staff_uuid
</select>
<select id="selectRecentlySubmitDate"
resultType="cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.SubmitCountDTO">
select
staff_uuid uuid, created_date recentlySubmitDate
from digital_management_staff_record
where
staff_uuid in
<foreach item="item" collection="uuids" separator="," open="(" close=")" index="">
#{item}
</foreach>
and template_code = #{templateCode}
and deleted_flag = 'N'
group by staff_uuid
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -17,6 +17,9 @@ ...@@ -17,6 +17,9 @@
<result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" /> <result column="deleted_flag" property="deletedFlag" jdbcType="CHAR" />
<result column="display_summary" property="displaySummary" jdbcType="INTEGER" /> <result column="display_summary" property="displaySummary" jdbcType="INTEGER" />
<result column="extend_field" property="extendField" jdbcType="VARCHAR" /> <result column="extend_field" property="extendField" jdbcType="VARCHAR" />
<result column="scene_type" property="sceneType" jdbcType="INTEGER" />
<result column="business_type" property="businessType" jdbcType="INTEGER" />
<result column="report_type" property="reportType" jdbcType="INTEGER" />
</resultMap> </resultMap>
<resultMap id="SimpleDTOResult" type="cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementTemplateDTO" extends="BaseResultMap" /> <resultMap id="SimpleDTOResult" type="cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementTemplateDTO" extends="BaseResultMap" />
<resultMap id="DTOResult" type="cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementTemplateDTO" extends="BaseResultMap"> <resultMap id="DTOResult" type="cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.DigitalManagementTemplateDTO" extends="BaseResultMap">
...@@ -29,7 +32,7 @@ ...@@ -29,7 +32,7 @@
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
id, code, name, type, type_name, created_by, created_date, updated_by, updated_date, id, code, name, type, type_name, created_by, created_date, updated_by, updated_date,
deleted_flag,extend_field, display_summary deleted_flag,extend_field, display_summary ,scene_type ,business_type ,report_type
</sql> </sql>
<select id="findAllType" resultMap="SimpleDTOResult"> <select id="findAllType" resultMap="SimpleDTOResult">
......
...@@ -115,4 +115,32 @@ ...@@ -115,4 +115,32 @@
</if> </if>
</where> </where>
</select> </select>
<resultMap id="TemplateStaffRefDTO" type="cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.TemplateStaffRefDTO" extends="BaseResultMap">
<result column="target_date" property="targetDate" jdbcType="VARCHAR" />
</resultMap>
<select id="findLatestRecordsByDates"
resultMap="TemplateStaffRefDTO">
SELECT
d.*,
tmp.target_date
FROM (
<foreach collection="targetDates" item="date" index="index" separator=" UNION ALL ">
SELECT #{date} AS target_date
</foreach>
) tmp
LEFT JOIN digital_management_template_staff_ref d ON d.id = (
SELECT d1.id
FROM digital_management_template_staff_ref d1
WHERE d1.deleted_flag = 'N'
AND d1.template_code = #{templateCode}
AND d1.effective_date &lt;= tmp.target_date
ORDER BY d1.effective_date DESC
LIMIT 1
)
WHERE d.id IS NOT NULL
ORDER BY tmp.target_date
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
...@@ -125,11 +125,9 @@ ...@@ -125,11 +125,9 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="condition.storePhoneList != null and condition.storePhoneList.size>0">
AND t1.phone_number in <if test="condition.customerPhone != null">
<foreach close=")" collection="condition.storePhoneList" item="item" open="(" separator=","> AND re.phone_number like concat('%', #{condition.customerPhone}, '%')
#{item}
</foreach>
</if> </if>
<if test="condition.recDevList != null and condition.recDevList.size>0"> <if test="condition.recDevList != null and condition.recDevList.size>0">
AND t1.badge_id in AND t1.badge_id in
...@@ -459,6 +457,9 @@ ...@@ -459,6 +457,9 @@
<if test="condition.enterpriseCustomerFlag != null and condition.enterpriseCustomerFlag ==1 "> <if test="condition.enterpriseCustomerFlag != null and condition.enterpriseCustomerFlag ==1 ">
and t1.customer_name like concat('%','公司','%') and t1.customer_name like concat('%','公司','%')
</if> </if>
<if test="condition.customerPhone != null and condition.customerPhone != ''">
and t1.phone_number like concat('%',#{condition.customerPhone},'%')
</if>
and t2.badge_id is not null and t2.badge_id is not null
</select> </select>
......
...@@ -328,4 +328,23 @@ ...@@ -328,4 +328,23 @@
group by module_type group by module_type
</where> </where>
</select> </select>
<select id="getActivityMsgPopUpWindow"
resultType="cn.com.glsx.dj.mindworkplate.dto.messagebox.ActivityMessagePopUpWindowRespDTO">
select
t2.rel_id as relId,
t2.`type`,
t1.id as msgId
from pad_message_box t1
inner join activity_msg_relation t2 on t1.id = t2.msg_box_id
where
t1.del_flag = 'N'
and t1.module_type = '5'
and t1.uuid = #{uuid}
and t1.business_type = #{businessType}
and t1.status = 0
and t1.created_time >= DATE_SUB(CURDATE(), interval 6 day)
order by t2.`type` desc, t1.created_time desc
limit 1
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
package cn.com.glsx.dj.mindworkplate.handler;
import cn.com.glsx.dj.mindworkplate.enums.GoodNewsTemplateReportTypeEnum;
import cn.com.glsx.dj.mindworkplate.service.BaseServiceTest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @author yangwei
* @version 1.0
* @since 2026/01/13 15:17
*/
public class ReportUnSummitStatisticsHandlerTest extends BaseServiceTest {
@Autowired
private ReportUnSummitStatisticsHandler reportUnSummitStatisticsHandler;
@Test
public void statisticsThenPushTest() {
// GoodNewsTemplateReportTypeEnum reportType = GoodNewsTemplateReportTypeEnum.DAY;
// reportUnSummitStatisticsHandler.statisticsThenPush(reportType);
GoodNewsTemplateReportTypeEnum reportType2 = GoodNewsTemplateReportTypeEnum.MONTH;
reportUnSummitStatisticsHandler.statisticsThenPush(reportType2);
// GoodNewsTemplateReportTypeEnum reportType3 = GoodNewsTemplateReportTypeEnum.WEEK;
// reportUnSummitStatisticsHandler.statisticsThenPush(reportType3);
}
}
...@@ -117,12 +117,6 @@ public class EmployeeBadgeServiceTest extends BaseServiceTest{ ...@@ -117,12 +117,6 @@ public class EmployeeBadgeServiceTest extends BaseServiceTest{
employeeBadgeDTO.setSearchStartDate("2024-06-01"); employeeBadgeDTO.setSearchStartDate("2024-06-01");
employeeBadgeDTO.setSearchEndDate("2024-06-30"); employeeBadgeDTO.setSearchEndDate("2024-06-30");
employeeBadgeDTO.setBussinessType(1); employeeBadgeDTO.setBussinessType(1);
employeeBadgeDTO.setQualityTestScoreBegin(1);
employeeBadgeDTO.setQualityTestScoreEnd(30);
employeeBadgeDTO.setOrderTransactionFlag(1);
employeeBadgeDTO.setOrderAxbTransactionFlag(1);
employeeBadgeDTO.setOrderTransactionAmount(new BigDecimal(10));
employeeBadgeDTO.setCarBrandIds(Arrays.asList(1,2));
String s = employeeBadgeService.customerBaseListExportV2(employeeBadgeDTO); String s = employeeBadgeService.customerBaseListExportV2(employeeBadgeDTO);
log.info("返回结果{}", JSONObject.toJSONString(s)); log.info("返回结果{}", JSONObject.toJSONString(s));
} }
......
...@@ -3,6 +3,7 @@ package cn.com.glsx.dj.mindworkplate.service.digitalmanagement; ...@@ -3,6 +3,7 @@ package cn.com.glsx.dj.mindworkplate.service.digitalmanagement;
import cn.com.glsx.dj.mindworkplate.constant.DigitalManagementConstants; import cn.com.glsx.dj.mindworkplate.constant.DigitalManagementConstants;
import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.SaveStaffRecordRequestDTO; import cn.com.glsx.dj.mindworkplate.dto.digitalmanagement.SaveStaffRecordRequestDTO;
import cn.com.glsx.dj.mindworkplate.service.BaseServiceTest; import cn.com.glsx.dj.mindworkplate.service.BaseServiceTest;
import cn.hutool.json.JSONUtil;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -20,6 +21,14 @@ public class DigitalManagementStaffRecordServiceTest extends BaseServiceTest { ...@@ -20,6 +21,14 @@ public class DigitalManagementStaffRecordServiceTest extends BaseServiceTest {
@Autowired @Autowired
private DigitalManagementStaffRecordService digitalManagementStaffRecordService; private DigitalManagementStaffRecordService digitalManagementStaffRecordService;
@Autowired
private DigitalManagementTemplateService digitalManagementTemplateService;
@Test
public void testTypeList() {
System.out.println(JSONUtil.toJsonStr(digitalManagementTemplateService.typeList(null)));
}
@Test @Test
public void testSave() { public void testSave() {
String uuid = "b8039dc086c34f54966e425f6f789737"; String uuid = "b8039dc086c34f54966e425f6f789737";
......
...@@ -19,7 +19,6 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse; ...@@ -19,7 +19,6 @@ import cn.com.glsx.framework.core.beans.rpc.RpcResponse;
import cn.com.glsx.framework.core.util.DateUtils; import cn.com.glsx.framework.core.util.DateUtils;
import cn.com.glsx.merchants.model.response.MerchantStaffResponse; import cn.com.glsx.merchants.model.response.MerchantStaffResponse;
import cn.com.glsx.merchants.remote.MerchantStaffRemote; import cn.com.glsx.merchants.remote.MerchantStaffRemote;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
...@@ -239,8 +238,9 @@ public class DigitalManagementServiceTest extends BaseServiceTest { ...@@ -239,8 +238,9 @@ public class DigitalManagementServiceTest extends BaseServiceTest {
RpcPagination<DigitalManagementStaffRecordDTO> req = new RpcPagination<>(); RpcPagination<DigitalManagementStaffRecordDTO> req = new RpcPagination<>();
DigitalManagementStaffRecordDTO condition = new DigitalManagementStaffRecordDTO(); DigitalManagementStaffRecordDTO condition = new DigitalManagementStaffRecordDTO();
condition.setTypeName("督导培训日报模板"); condition.setTypeName("督导培训日报模板");
condition.setStartTime(DateUtil.parse("2025-04-08", "yyyy-MM-dd")); condition.setTemplateCode("uuid-temp-001");
condition.setEndTime(DateUtil.parse("2025-04-08", "yyyy-MM-dd")); condition.setStartTime(DateUtil.parse("2026-01-12 00:00:00", "yyyy-MM-dd HH:mm:ss"));
condition.setEndTime(DateUtil.parse("2026-01-12 23:59:59", "yyyy-MM-dd HH:mm:ss"));
// condition.setOrderByType(2); // condition.setOrderByType(2);
// condition.setOrderByKey("managedStoreCount"); // condition.setOrderByKey("managedStoreCount");
req.setCondition(condition); req.setCondition(condition);
...@@ -248,29 +248,29 @@ public class DigitalManagementServiceTest extends BaseServiceTest { ...@@ -248,29 +248,29 @@ public class DigitalManagementServiceTest extends BaseServiceTest {
req.setPageNum(1); req.setPageNum(1);
Page<DigitalManagementStaffRecordDTO> res = staffRecordService.recordPage(req); Page<DigitalManagementStaffRecordDTO> res = staffRecordService.recordPage(req);
System.out.println(JSON.toJSONString(res)); System.out.println(JSON.toJSONString(res));
condition.setOrderByKey("managedStoreCount"); // condition.setOrderByKey("managedStoreCount");
res = staffRecordService.recordPage(req); // res = staffRecordService.recordPage(req);
System.out.println(JSON.toJSONString(res)); // System.out.println(JSON.toJSONString(res));
condition.setOrderByKey("equityStoreAverageCartValue"); // condition.setOrderByKey("equityStoreAverageCartValue");
res = staffRecordService.recordPage(req); // res = staffRecordService.recordPage(req);
System.out.println(JSON.toJSONString(res)); // System.out.println(JSON.toJSONString(res));
condition.setOrderByKey("equityStorePenetrationAverage"); // condition.setOrderByKey("equityStorePenetrationAverage");
res = staffRecordService.recordPage(req); // res = staffRecordService.recordPage(req);
System.out.println(JSON.toJSONString(res)); // System.out.println(JSON.toJSONString(res));
condition.setOrderByKey("warrantyStoreAverageCartValue"); // condition.setOrderByKey("warrantyStoreAverageCartValue");
res = staffRecordService.recordPage(req); // res = staffRecordService.recordPage(req);
System.out.println(JSON.toJSONString(res)); // System.out.println(JSON.toJSONString(res));
condition.setOrderByKey("boutiqueStorePenetrationAverage"); // condition.setOrderByKey("boutiqueStorePenetrationAverage");
res = staffRecordService.recordPage(req); // res = staffRecordService.recordPage(req);
System.out.println(JSON.toJSONString(res)); // System.out.println(JSON.toJSONString(res));
} }
@Test @Test
public void staffRecordSummaryTest() { public void staffRecordSummaryTest() {
DigitalManagementStaffRecordDTO condition = new DigitalManagementStaffRecordDTO(); DigitalManagementStaffRecordDTO condition = new DigitalManagementStaffRecordDTO();
condition.setTemplateCode("uuid-temp-003"); condition.setTemplateCode("uuid-temp-018");
condition.setStartTime(DateUtil.parse("2025-04-08", "yyyy-MM-dd")); condition.setStartTime(DateUtil.parse("2025-11-01", "yyyy-MM-dd"));
condition.setEndTime(DateUtil.parse("2025-04-08", "yyyy-MM-dd")); condition.setEndTime(DateUtil.parse("2025-11-30", "yyyy-MM-dd"));
List<DigitalManagementStaffRecordSummaryDTO> res = staffRecordService.staffRecordSummary(condition); List<DigitalManagementStaffRecordSummaryDTO> res = staffRecordService.staffRecordSummary(condition);
System.out.println(JSON.toJSONString(res)); System.out.println(JSON.toJSONString(res));
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!