132 changed files with 3314 additions and 367 deletions
@ -0,0 +1,29 @@ |
|||||
|
package com.epmet.controller; |
||||
|
|
||||
|
import com.epmet.redis.CustomerAppWxServiceUtil; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.Set; |
||||
|
|
||||
|
/** |
||||
|
* @author jianjun liu |
||||
|
* @date 2020-06-04 20:39 |
||||
|
**/ |
||||
|
@RestController |
||||
|
@RequestMapping("opback") |
||||
|
public class BackDoorController { |
||||
|
@Autowired |
||||
|
private CustomerAppWxServiceUtil customerAppWxServiceUtil; |
||||
|
|
||||
|
/** |
||||
|
* 数据库添加新客户app后 |
||||
|
* |
||||
|
* @return |
||||
|
*/ |
||||
|
@RequestMapping("reloadcustomerapp") |
||||
|
public Set<String> initWxMaService() { |
||||
|
return customerAppWxServiceUtil.initWxMaService(); |
||||
|
} |
||||
|
} |
@ -1,94 +0,0 @@ |
|||||
package com.epmet.utils; |
|
||||
|
|
||||
import com.alibaba.nacos.client.utils.StringUtils; |
|
||||
import com.epmet.commons.tools.constant.NumConstant; |
|
||||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
||||
import com.epmet.commons.tools.exception.RenException; |
|
||||
import com.epmet.commons.tools.scan.param.ImgScanParamDTO; |
|
||||
import com.epmet.commons.tools.scan.param.ImgTaskDTO; |
|
||||
import com.epmet.commons.tools.scan.param.TextScanParamDTO; |
|
||||
import com.epmet.commons.tools.scan.param.TextTaskDTO; |
|
||||
import com.epmet.commons.tools.scan.result.SyncScanResult; |
|
||||
import com.epmet.commons.tools.utils.Result; |
|
||||
import com.epmet.commons.tools.utils.ScanContentUtils; |
|
||||
import org.springframework.beans.factory.annotation.Value; |
|
||||
import lombok.extern.slf4j.Slf4j; |
|
||||
|
|
||||
import java.util.List; |
|
||||
import java.util.UUID; |
|
||||
|
|
||||
/** |
|
||||
* 文字、图片合法性校验 |
|
||||
* |
|
||||
* @author zhangyong |
|
||||
* @date 2020-07-15 14:26 |
|
||||
*/ |
|
||||
@Slf4j |
|
||||
public class ValidityVerification { |
|
||||
|
|
||||
@Value("${openapi.scan.server.url}") |
|
||||
private String scanApiUrl; |
|
||||
@Value("${openapi.scan.method.textSyncScan}") |
|
||||
private String textSyncScanMethod; |
|
||||
@Value("${openapi.scan.method.imgSyncScan}") |
|
||||
private String imgSyncScanMethod; |
|
||||
|
|
||||
/** |
|
||||
* 文本校验 |
|
||||
* @param context 被校验的文本,,不能超过10000 |
|
||||
* @param businessEnum 业务枚举,定义校验失败后,输出的日志信息 |
|
||||
* @return void |
|
||||
* @auther zhangyong |
|
||||
* @Date 14:42 2020-07-15 |
|
||||
**/ |
|
||||
public void textScanVerification(String context, String businessEnum){ |
|
||||
if (StringUtils.isNotBlank(context)) { |
|
||||
TextScanParamDTO textScanParamDTO = new TextScanParamDTO(); |
|
||||
TextTaskDTO taskDTO = new TextTaskDTO(); |
|
||||
taskDTO.setContent(context); |
|
||||
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|
||||
textScanParamDTO.getTasks().add(taskDTO); |
|
||||
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO); |
|
||||
if (!textSyncScanResult.success()) { |
|
||||
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|
||||
} else { |
|
||||
if (!textSyncScanResult.getData().isAllPass()) { |
|
||||
// 业务枚举:例如:评论话题失败,评论内容为:%s"
|
|
||||
log.error(String.format(businessEnum, context)); |
|
||||
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode()); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
/** |
|
||||
* 图片列表校验 |
|
||||
* @param imgList 被校验的图片列表 |
|
||||
* @param businessEnum 业务枚举,定义校验失败后,输出的日志信息 |
|
||||
* |
|
||||
* @return void |
|
||||
* @auther zhangyong |
|
||||
* @Date 14:42 2020-07-15 |
|
||||
**/ |
|
||||
public void imgScanVerification(List<String> imgList, String businessEnum){ |
|
||||
if (null != imgList && NumConstant.ZERO != imgList.size()){ |
|
||||
ImgScanParamDTO imgScanParamDTO = new ImgScanParamDTO(); |
|
||||
imgList.forEach(url -> { |
|
||||
ImgTaskDTO task = new ImgTaskDTO(); |
|
||||
task.setDataId(UUID.randomUUID().toString().replace("-", "")); |
|
||||
task.setUrl(url); |
|
||||
imgScanParamDTO.getTasks().add(task); |
|
||||
}); |
|
||||
Result<SyncScanResult> imgScanResult = ScanContentUtils.imgSyncScan(scanApiUrl.concat(imgSyncScanMethod), imgScanParamDTO); |
|
||||
if (!imgScanResult.success()){ |
|
||||
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
|
||||
} else { |
|
||||
if (!imgScanResult.getData().isAllPass()) { |
|
||||
// 业务枚举:例如:评论话题失败,评论内容为:%s"
|
|
||||
log.error(String.format(businessEnum)); |
|
||||
throw new RenException(EpmetErrorCode.IMG_SCAN_FAILED.getCode()); |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,106 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.Date; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-07-27 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PointAdjustmentLogDTO implements Serializable { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String id; |
||||
|
|
||||
|
/** |
||||
|
* 关联的积分动作Id |
||||
|
*/ |
||||
|
private String actionId; |
||||
|
|
||||
|
/** |
||||
|
* 调整人名称【xx机关-xx】 |
||||
|
*/ |
||||
|
private String operatorName; |
||||
|
|
||||
|
/** |
||||
|
* 调整原因 |
||||
|
*/ |
||||
|
private String adjustReason; |
||||
|
|
||||
|
/** |
||||
|
* 调整积分 |
||||
|
*/ |
||||
|
private Integer point; |
||||
|
|
||||
|
/** |
||||
|
* plus/minus |
||||
|
*/ |
||||
|
private String adjustmentType; |
||||
|
|
||||
|
/** |
||||
|
* 调整人所属机关Id |
||||
|
*/ |
||||
|
private String operatorAgencyId; |
||||
|
|
||||
|
/** |
||||
|
* 居民Id |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Integer revision; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Date createdTime; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String createdBy; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private Date updatedTime; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
*/ |
||||
|
private String updatedBy; |
||||
|
|
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Min; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 用户Id 分页参数 |
||||
|
* @ClassName CommonPageUserFormDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-07-24 13:24 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CommonPageUserFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -6721313124444595189L; |
||||
|
|
||||
|
public interface PageUserGroup extends CustomerClientShowGroup{} |
||||
|
|
||||
|
@NotBlank(message = "获取不到用户Id" , groups = PageUserGroup.class) |
||||
|
private String userId; |
||||
|
|
||||
|
@Min(value = 1) |
||||
|
private Integer pageNo = 1; |
||||
|
|
||||
|
private Integer pageSize = 10; |
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 积分调整传参积分dto |
||||
|
* @ClassName PointAdjustmentFormDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-07-27 13:36 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PointAdjustmentFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -1879530107301465633L; |
||||
|
|
||||
|
public interface PointAdjustmentGroup extends CustomerClientShowGroup{} |
||||
|
|
||||
|
/** |
||||
|
* 用户Id |
||||
|
* */ |
||||
|
@NotBlank(message = "用户Id不能为空", groups = PointAdjustmentGroup.class) |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 积分调整标识 key:add/minus |
||||
|
* */ |
||||
|
@NotBlank(message = "调整类型不能为空", groups = PointAdjustmentGroup.class) |
||||
|
private String adjustmentType; |
||||
|
|
||||
|
/** |
||||
|
* 调整的分值 |
||||
|
* */ |
||||
|
private Integer point; |
||||
|
|
||||
|
/** |
||||
|
* 调整原因 |
||||
|
* */ |
||||
|
@NotBlank(message = "调整原因不能为空", groups = PointAdjustmentGroup.class) |
||||
|
private String reason; |
||||
|
|
||||
|
/** |
||||
|
* 操作人Id |
||||
|
* */ |
||||
|
@NotBlank(message = "当前工作人员Id不能为空", groups = PointAdjustmentGroup.class) |
||||
|
private String operatorId; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
* */ |
||||
|
@NotBlank(message = "客户Id不能为空", groups = PointAdjustmentGroup.class) |
||||
|
private String customerId; |
||||
|
|
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Min; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 积分核销传参dto |
||||
|
* |
||||
|
* @ClassName PointVerificationFormDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-07-27 13:45 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PointVerificationFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -154634518066538184L; |
||||
|
|
||||
|
public interface PointVerificationGroup extends CustomerClientShowGroup{} |
||||
|
|
||||
|
/** |
||||
|
* 用户Id |
||||
|
* */ |
||||
|
@NotBlank(message = "用户Id不能为空", groups = PointVerificationGroup.class) |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 核销备注 |
||||
|
* */ |
||||
|
@NotBlank(message = "核销备注不能为空", groups = PointVerificationGroup.class) |
||||
|
private String remark; |
||||
|
|
||||
|
/** |
||||
|
* 核销积分数 |
||||
|
* */ |
||||
|
@Min(0) |
||||
|
private Integer point; |
||||
|
|
||||
|
/** |
||||
|
* 操作人Id |
||||
|
* */ |
||||
|
@NotBlank(message = "当前工作人员Id不能为空", groups = PointVerificationGroup.class) |
||||
|
private String operatorId; |
||||
|
|
||||
|
|
||||
|
private String longitude; |
||||
|
|
||||
|
private String dimension; |
||||
|
|
||||
|
private String address; |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Max; |
||||
|
import javax.validation.constraints.Min; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 工作端核销记录传参 |
||||
|
* @ClassName WorkPointVerificationFormDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-07-24 16:25 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class WorkPointVerificationFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -590822390667788693L; |
||||
|
|
||||
|
@NotBlank(message = "获取不到用户Id",groups = ResiCommonUserIdFormDTO.UserIdGroup.class) |
||||
|
private String staffId; |
||||
|
|
||||
|
/** |
||||
|
* yyyy-MM |
||||
|
* */ |
||||
|
private String timeParam; |
||||
|
|
||||
|
@Min(1) |
||||
|
private Integer pageNo; |
||||
|
|
||||
|
private Integer pageSize; |
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description |
||||
|
* @ClassName PointAdjustmentResultDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-07-27 09:45 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PointAdjustmentResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -5339173292750971212L; |
||||
|
|
||||
|
/** |
||||
|
* 操作日期 |
||||
|
* */ |
||||
|
private String date; |
||||
|
|
||||
|
/** |
||||
|
* 调整积分 |
||||
|
* */ |
||||
|
private String point; |
||||
|
|
||||
|
/** |
||||
|
* 调整原因 |
||||
|
* */ |
||||
|
private String reason; |
||||
|
|
||||
|
/** |
||||
|
* 调整人昵称 |
||||
|
* */ |
||||
|
private String staffNickname; |
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 积分核销返参Dto |
||||
|
* @ClassName PointVerificationResultDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-07-27 13:57 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class PointVerificationResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 6990717665110392389L; |
||||
|
|
||||
|
/** |
||||
|
* 核销成功标识 |
||||
|
* */ |
||||
|
private boolean successFlag; |
||||
|
|
||||
|
/** |
||||
|
* 失败原因 |
||||
|
* */ |
||||
|
private String failureReason; |
||||
|
|
||||
|
/** |
||||
|
* 用户(居民)昵称 |
||||
|
* */ |
||||
|
private String userNickname; |
||||
|
|
||||
|
/** |
||||
|
* 用户(居民)头像 |
||||
|
* */ |
||||
|
private String userHeadPhoto; |
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @Description 工作端积分核销记录列表 |
||||
|
* @ClassName WorkPointVerficationListResultDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-07-24 15:38 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class WorkPointVerficationListResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = 2737976236826002595L; |
||||
|
|
||||
|
/** |
||||
|
* 当月总积分 |
||||
|
* */ |
||||
|
private Integer totalPoint; |
||||
|
|
||||
|
/** |
||||
|
* 核销列表 |
||||
|
* */ |
||||
|
List<WorkPointVerificationDetailResultDTO> checkingList; |
||||
|
} |
@ -0,0 +1,33 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 工作端积分核销显示记录 |
||||
|
* @ClassName WorkPointVerificationDetailResultDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-07-24 15:38 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class WorkPointVerificationDetailResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -205177259417194562L; |
||||
|
|
||||
|
/** |
||||
|
* 被核销用户昵称 |
||||
|
* */ |
||||
|
private String userNickname; |
||||
|
|
||||
|
/** |
||||
|
* 核销积分 "-100" |
||||
|
* */ |
||||
|
private String point; |
||||
|
|
||||
|
/** |
||||
|
* 核销备注 |
||||
|
* */ |
||||
|
private String remark; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
package com.epmet.dto.result; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 工作端积分核销记录 |
||||
|
* @ClassName WorkPointVerificationLogResultDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-07-24 15:38 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class WorkPointVerificationLogResultDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -3570820382554221450L; |
||||
|
|
||||
|
/** |
||||
|
* 积分 |
||||
|
* */ |
||||
|
private Integer point; |
||||
|
|
||||
|
/** |
||||
|
* 用户Id |
||||
|
* */ |
||||
|
private String userId; |
||||
|
|
||||
|
/** |
||||
|
* 日期 yyyy-MM-dd HH:mm:ss |
||||
|
* */ |
||||
|
private String date; |
||||
|
|
||||
|
/** |
||||
|
* 核销备注 |
||||
|
* */ |
||||
|
private String remark; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dao; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.dao.BaseDao; |
||||
|
import com.epmet.dto.result.PointAdjustmentResultDTO; |
||||
|
import com.epmet.entity.PointAdjustmentLogEntity; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-07-27 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface PointAdjustmentLogDao extends BaseDao<PointAdjustmentLogEntity> { |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询积分调整列表 |
||||
|
* @param userId |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.07.27 10:44 |
||||
|
**/ |
||||
|
List<PointAdjustmentResultDTO> selectAdjustmentListByUserId(@Param("userId") String userId); |
||||
|
|
||||
|
} |
@ -0,0 +1,76 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.entity; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
||||
|
import lombok.Data; |
||||
|
import lombok.EqualsAndHashCode; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-07-27 |
||||
|
*/ |
||||
|
@Data |
||||
|
@EqualsAndHashCode(callSuper=false) |
||||
|
@TableName("point_adjustment_log") |
||||
|
public class PointAdjustmentLogEntity extends BaseEpmetEntity { |
||||
|
|
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** |
||||
|
* 关联的积分动作Id |
||||
|
*/ |
||||
|
private String actionId; |
||||
|
|
||||
|
/** |
||||
|
* 调整人名称【xx机关-xx】 |
||||
|
*/ |
||||
|
private String operatorName; |
||||
|
|
||||
|
/** |
||||
|
* 调整原因 |
||||
|
*/ |
||||
|
private String adjustReason; |
||||
|
|
||||
|
/** |
||||
|
* 调整积分 |
||||
|
*/ |
||||
|
private Integer point; |
||||
|
|
||||
|
/** |
||||
|
* plus/minus |
||||
|
*/ |
||||
|
private String adjustmentType; |
||||
|
|
||||
|
/** |
||||
|
* 调整人所属机关Id |
||||
|
*/ |
||||
|
private String operatorAgencyId; |
||||
|
|
||||
|
/** |
||||
|
* 居民Id |
||||
|
*/ |
||||
|
private String userId; |
||||
|
|
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.epmet.redis; |
||||
|
|
||||
|
import com.epmet.commons.tools.redis.RedisUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @Description 积分缓存相关 |
||||
|
* @ClassName PointRedis |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-07-27 17:25 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class PointRedis { |
||||
|
|
||||
|
@Autowired |
||||
|
private RedisUtils redisUtils; |
||||
|
} |
@ -0,0 +1,126 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service; |
||||
|
|
||||
|
import com.epmet.commons.mybatis.service.BaseService; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.dto.PointAdjustmentLogDTO; |
||||
|
import com.epmet.dto.form.IssueInitiatorFormDTO; |
||||
|
import com.epmet.dto.form.PointAdjustmentFormDTO; |
||||
|
import com.epmet.dto.result.CustomerUserDetailResultDTO; |
||||
|
import com.epmet.dto.result.PointAdjustmentResultDTO; |
||||
|
import com.epmet.entity.PointAdjustmentLogEntity; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-07-27 |
||||
|
*/ |
||||
|
public interface PointAdjustmentLogService extends BaseService<PointAdjustmentLogEntity> { |
||||
|
|
||||
|
/** |
||||
|
* 默认分页 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return PageData<PointAdjustmentLogDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-07-27 |
||||
|
*/ |
||||
|
PageData<PointAdjustmentLogDTO> page(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 默认查询 |
||||
|
* |
||||
|
* @param params |
||||
|
* @return java.util.List<PointAdjustmentLogDTO> |
||||
|
* @author generator |
||||
|
* @date 2020-07-27 |
||||
|
*/ |
||||
|
List<PointAdjustmentLogDTO> list(Map<String, Object> params); |
||||
|
|
||||
|
/** |
||||
|
* 单条查询 |
||||
|
* |
||||
|
* @param id |
||||
|
* @return PointAdjustmentLogDTO |
||||
|
* @author generator |
||||
|
* @date 2020-07-27 |
||||
|
*/ |
||||
|
PointAdjustmentLogDTO get(String id); |
||||
|
|
||||
|
/** |
||||
|
* 默认保存 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-07-27 |
||||
|
*/ |
||||
|
void save(PointAdjustmentLogDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 默认更新 |
||||
|
* |
||||
|
* @param dto |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-07-27 |
||||
|
*/ |
||||
|
void update(PointAdjustmentLogDTO dto); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除 |
||||
|
* |
||||
|
* @param ids |
||||
|
* @return void |
||||
|
* @author generator |
||||
|
* @date 2020-07-27 |
||||
|
*/ |
||||
|
void delete(String[] ids); |
||||
|
|
||||
|
/** |
||||
|
* @Description 根据UserId获取积分调整记录 |
||||
|
* @param param :: getUserId |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.07.27 10:51 |
||||
|
**/ |
||||
|
List<PointAdjustmentResultDTO> adjustRecord(IssueInitiatorFormDTO param); |
||||
|
|
||||
|
/** |
||||
|
* @Description 用户详情 |
||||
|
* @param param |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.07.27 10:57 |
||||
|
**/ |
||||
|
CustomerUserDetailResultDTO userDetail(IssueInitiatorFormDTO param); |
||||
|
|
||||
|
/** |
||||
|
* @Description 积分调整 |
||||
|
* @param param |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.07.27 13:52 |
||||
|
**/ |
||||
|
void adjustPoint(PointAdjustmentFormDTO param); |
||||
|
} |
@ -0,0 +1,242 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.service.impl; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; |
||||
|
import com.epmet.commons.tools.constant.NumConstant; |
||||
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
||||
|
import com.epmet.commons.tools.exception.RenException; |
||||
|
import com.epmet.commons.tools.page.PageData; |
||||
|
import com.epmet.commons.tools.utils.ConvertUtils; |
||||
|
import com.epmet.commons.tools.constant.FieldConstant; |
||||
|
import com.epmet.commons.tools.utils.Result; |
||||
|
import com.epmet.dao.PointAdjustmentLogDao; |
||||
|
import com.epmet.dao.UserPointActionLogDao; |
||||
|
import com.epmet.dto.PointAdjustmentLogDTO; |
||||
|
import com.epmet.dto.form.IssueInitiatorFormDTO; |
||||
|
import com.epmet.dto.form.PointAdjustmentFormDTO; |
||||
|
import com.epmet.dto.form.ResiCommonUserIdFormDTO; |
||||
|
import com.epmet.dto.result.CustomerUserDetailResultDTO; |
||||
|
import com.epmet.dto.result.PointAdjustmentResultDTO; |
||||
|
import com.epmet.dto.result.ResiPointDetailResultDTO; |
||||
|
import com.epmet.dto.result.StaffEtAgencyResultDTO; |
||||
|
import com.epmet.entity.PointAdjustmentLogEntity; |
||||
|
import com.epmet.entity.UserPointActionLogEntity; |
||||
|
import com.epmet.entity.UserPointStatisticalDailyEntity; |
||||
|
import com.epmet.entity.UserPointTotalEntity; |
||||
|
import com.epmet.feign.EpmetUserOpenFeignClient; |
||||
|
import com.epmet.service.PointAdjustmentLogService; |
||||
|
import com.epmet.service.UserPointStatisticalDailyService; |
||||
|
import com.epmet.service.UserPointTotalService; |
||||
|
import com.epmet.utils.DimIdGenerator; |
||||
|
import com.epmet.utils.ModuleConstant; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
import java.util.Arrays; |
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
import java.util.Map; |
||||
|
|
||||
|
/** |
||||
|
* |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-07-27 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class PointAdjustmentLogServiceImpl extends BaseServiceImpl<PointAdjustmentLogDao, PointAdjustmentLogEntity> implements PointAdjustmentLogService { |
||||
|
|
||||
|
@Autowired |
||||
|
EpmetUserOpenFeignClient epmetUserOpenFeignClient; |
||||
|
@Autowired |
||||
|
UserPointTotalService userPointTotalService; |
||||
|
@Autowired |
||||
|
UserPointActionLogDao userPointActionLogDao; |
||||
|
@Autowired |
||||
|
UserPointStatisticalDailyService userPointStatisticalDailyService; |
||||
|
@Autowired |
||||
|
PointAdjustmentLogDao pointAdjustmentLogDao; |
||||
|
|
||||
|
@Override |
||||
|
public PageData<PointAdjustmentLogDTO> page(Map<String, Object> params) { |
||||
|
IPage<PointAdjustmentLogEntity> page = baseDao.selectPage( |
||||
|
getPage(params, FieldConstant.CREATED_TIME, false), |
||||
|
getWrapper(params) |
||||
|
); |
||||
|
return getPageData(page, PointAdjustmentLogDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public List<PointAdjustmentLogDTO> list(Map<String, Object> params) { |
||||
|
List<PointAdjustmentLogEntity> entityList = baseDao.selectList(getWrapper(params)); |
||||
|
|
||||
|
return ConvertUtils.sourceToTarget(entityList, PointAdjustmentLogDTO.class); |
||||
|
} |
||||
|
|
||||
|
private QueryWrapper<PointAdjustmentLogEntity> getWrapper(Map<String, Object> params){ |
||||
|
String id = (String)params.get(FieldConstant.ID_HUMP); |
||||
|
|
||||
|
QueryWrapper<PointAdjustmentLogEntity> wrapper = new QueryWrapper<>(); |
||||
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
||||
|
|
||||
|
return wrapper; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public PointAdjustmentLogDTO get(String id) { |
||||
|
PointAdjustmentLogEntity entity = baseDao.selectById(id); |
||||
|
return ConvertUtils.sourceToTarget(entity, PointAdjustmentLogDTO.class); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void save(PointAdjustmentLogDTO dto) { |
||||
|
PointAdjustmentLogEntity entity = ConvertUtils.sourceToTarget(dto, PointAdjustmentLogEntity.class); |
||||
|
insert(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void update(PointAdjustmentLogDTO dto) { |
||||
|
PointAdjustmentLogEntity entity = ConvertUtils.sourceToTarget(dto, PointAdjustmentLogEntity.class); |
||||
|
updateById(entity); |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void delete(String[] ids) { |
||||
|
// 逻辑删除(@TableLogic 注解)
|
||||
|
baseDao.deleteBatchIds(Arrays.asList(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 根据UserId获取积分调整记录 |
||||
|
* @param param :: getUserId |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.07.27 10:51 |
||||
|
**/ |
||||
|
@Override |
||||
|
public List<PointAdjustmentResultDTO> adjustRecord(IssueInitiatorFormDTO param) { |
||||
|
return baseDao.selectAdjustmentListByUserId(param.getUserId()); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* @Description 用户详情 |
||||
|
* @param param |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.07.27 10:57 |
||||
|
**/ |
||||
|
@Override |
||||
|
public CustomerUserDetailResultDTO userDetail(IssueInitiatorFormDTO param) { |
||||
|
Result<CustomerUserDetailResultDTO> detailResult = epmetUserOpenFeignClient.customerUserDetail(param); |
||||
|
if(!detailResult.success()){ |
||||
|
throw new RenException(detailResult.getCode()); |
||||
|
} |
||||
|
ResiCommonUserIdFormDTO userParam = ConvertUtils.sourceToTarget(param,ResiCommonUserIdFormDTO.class); |
||||
|
ResiPointDetailResultDTO pointDto = userPointTotalService.getMyPoint(userParam); |
||||
|
if(null != detailResult.getData()){ |
||||
|
CustomerUserDetailResultDTO result = new CustomerUserDetailResultDTO(); |
||||
|
result.setPoint(null != pointDto ? pointDto.getUsablePoint() : NumConstant.ZERO); |
||||
|
} |
||||
|
detailResult.getData().setPoint(null != pointDto ? pointDto.getUsablePoint() : NumConstant.ZERO); |
||||
|
return detailResult.getData(); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* @Description 积分调整 |
||||
|
* @param param |
||||
|
* @return |
||||
|
* @author wangc |
||||
|
* @date 2020.07.27 13:52 |
||||
|
**/ |
||||
|
@Override |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public void adjustPoint(PointAdjustmentFormDTO param) { |
||||
|
if(null == param.getPoint()) throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); |
||||
|
Date currentTime = new Date(); |
||||
|
Integer point = param.getPoint(); |
||||
|
if(StringUtils.equals(ModuleConstant.OPERATION_TYPE_MINUS,param.getAdjustmentType())){ |
||||
|
if(point > NumConstant.ZERO){ |
||||
|
point *= NumConstant.ONE_NEG; |
||||
|
} |
||||
|
}else{ |
||||
|
if(point < NumConstant.ZERO){ |
||||
|
point *= NumConstant.ONE_NEG; |
||||
|
} |
||||
|
} |
||||
|
//0.工作人员基本信息[agencyId 昵称]
|
||||
|
IssueInitiatorFormDTO staffParam = new IssueInitiatorFormDTO(); |
||||
|
staffParam.setUserId(param.getOperatorId()); |
||||
|
Result<StaffEtAgencyResultDTO> staffResult = |
||||
|
epmetUserOpenFeignClient.staffMsg(staffParam); |
||||
|
String agencyId = ModuleConstant.EMPTY_STR; |
||||
|
String operatorName = ModuleConstant.EMPTY_STR; |
||||
|
if(staffResult.success() && null != staffResult.getData()){ |
||||
|
agencyId = staffResult.getData().getAgencyId(); |
||||
|
operatorName = staffResult.getData().getNickname(); |
||||
|
} |
||||
|
//1.记录用户积分行为记录表
|
||||
|
UserPointActionLogEntity userPointActionEntity = new UserPointActionLogEntity(); |
||||
|
userPointActionEntity.setUserId(param.getUserId()); |
||||
|
userPointActionEntity.setCustomerId(param.getCustomerId()); |
||||
|
userPointActionEntity.setActionFlag(param.getAdjustmentType()); |
||||
|
userPointActionEntity.setPoint(point); |
||||
|
userPointActionEntity.setEventStatement(param.getReason()); |
||||
|
userPointActionEntity.setEventName(ModuleConstant.EVENT_NAME_ADJUSTMENT); |
||||
|
userPointActionEntity.setOperatorAgencyId(agencyId); |
||||
|
userPointActionLogDao.insert(userPointActionEntity); |
||||
|
//2.记录积分调整记录表
|
||||
|
PointAdjustmentLogEntity adjustmentEntity = new PointAdjustmentLogEntity(); |
||||
|
adjustmentEntity.setActionId(userPointActionEntity.getId()); |
||||
|
adjustmentEntity.setOperatorName(operatorName); |
||||
|
adjustmentEntity.setAdjustReason(param.getReason()); |
||||
|
adjustmentEntity.setAdjustmentType(param.getAdjustmentType()); |
||||
|
adjustmentEntity.setPoint(point); |
||||
|
adjustmentEntity.setOperatorAgencyId(agencyId); |
||||
|
adjustmentEntity.setUserId(param.getUserId()); |
||||
|
//此处设置无效,会拦截到当前请求token中的userId,实际与这里的operatorId一致
|
||||
|
adjustmentEntity.setCreatedBy(param.getOperatorId()); |
||||
|
pointAdjustmentLogDao.insert(adjustmentEntity); |
||||
|
//3.新增或更新用户积分日统计表
|
||||
|
DimIdGenerator.DimIdBean dim = DimIdGenerator.getDimIdBean(currentTime); |
||||
|
UserPointStatisticalDailyEntity statistical = ConvertUtils.sourceToTarget(dim,UserPointStatisticalDailyEntity.class); |
||||
|
statistical.setUserId(param.getUserId()); |
||||
|
statistical.setActionFlag(param.getAdjustmentType()); |
||||
|
statistical.setCustomerId(param.getCustomerId()); |
||||
|
statistical.setPointChange(point); |
||||
|
userPointStatisticalDailyService.insertOrUpdate(statistical); |
||||
|
//4.更新用户积分总表
|
||||
|
UserPointTotalEntity total = new UserPointTotalEntity(); |
||||
|
total.setUserId(param.getUserId()); |
||||
|
total.setCustomerId(param.getCustomerId()); |
||||
|
//增量
|
||||
|
total.setUsedPoint(NumConstant.ZERO); |
||||
|
total.setUsablePoint(point); |
||||
|
total.setTotalPoint(point); |
||||
|
userPointTotalService.insertOrUpdate(total); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,91 @@ |
|||||
|
package com.epmet.utils; |
||||
|
|
||||
|
import com.epmet.commons.tools.utils.DateUtils; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.Calendar; |
||||
|
import java.util.Date; |
||||
|
|
||||
|
public class DimIdGenerator { |
||||
|
|
||||
|
/** |
||||
|
* 生成日期维度ID |
||||
|
* @param targetDate |
||||
|
* @return |
||||
|
*/ |
||||
|
public static String getDateDimId(Date targetDate) { |
||||
|
return DateUtils.format(targetDate, DateUtils.DATE_PATTERN_YYYYMMDD); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取月维度ID |
||||
|
* @param date |
||||
|
* @return |
||||
|
*/ |
||||
|
public static String getMonthDimId(Date date) { |
||||
|
return DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMM); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取周维度ID ,每周的星期一为 周的开始 |
||||
|
* @param date |
||||
|
* @return |
||||
|
*/ |
||||
|
public static String getWeekDimId(Date date) { |
||||
|
String yyyy = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYY); |
||||
|
Calendar calendar = Calendar.getInstance(); |
||||
|
calendar.setFirstDayOfWeek(Calendar.MONDAY); |
||||
|
calendar.setTime(date); |
||||
|
return yyyy.concat("W").concat(calendar.get(Calendar.WEEK_OF_YEAR)+""); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取季度维度ID |
||||
|
* @param date |
||||
|
* @return |
||||
|
*/ |
||||
|
public static String getQuarterDimId(Date date) { |
||||
|
String yyyy = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYY); |
||||
|
return yyyy.concat("Q").concat(DateUtils.getQuarterIndex(date) + ""); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取年维度ID |
||||
|
* @param date |
||||
|
* @return |
||||
|
*/ |
||||
|
public static String getYearDimId(Date date) { |
||||
|
return DateUtils.format(date, DateUtils.DATE_PATTERN_YYYY); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 获取封装了所有ID的对象 |
||||
|
* @return |
||||
|
*/ |
||||
|
public static DimIdBean getDimIdBean(Date date) { |
||||
|
DimIdBean dimIdBean = new DimIdBean(); |
||||
|
dimIdBean.setDateId(getDateDimId(date)); |
||||
|
dimIdBean.setMonthId(getMonthDimId(date)); |
||||
|
dimIdBean.setWeekId(getWeekDimId(date)); |
||||
|
dimIdBean.setQuarterId(getQuarterDimId(date)); |
||||
|
dimIdBean.setYearId(getYearDimId(date)); |
||||
|
return dimIdBean; |
||||
|
} |
||||
|
|
||||
|
public static void main(String[] args) { |
||||
|
DimIdBean dimIdBean = getDimIdBean(DateUtils.stringToDate("2020-06-14",DateUtils.DATE_PATTERN)); |
||||
|
System.out.println(dimIdBean); |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
public static class DimIdBean { |
||||
|
private String dateId; |
||||
|
private String monthId; |
||||
|
private String quarterId; |
||||
|
private String yearId; |
||||
|
private String weekId; |
||||
|
|
||||
|
public DimIdBean() { |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
||||
|
|
||||
|
<mapper namespace="com.epmet.dao.PointAdjustmentLogDao"> |
||||
|
|
||||
|
<resultMap type="com.epmet.entity.PointAdjustmentLogEntity" id="pointAdjustmentLogMap"> |
||||
|
<result property="id" column="ID"/> |
||||
|
<result property="actionId" column="ACTION_ID"/> |
||||
|
<result property="operatorName" column="OPERATOR_NAME"/> |
||||
|
<result property="adjustReason" column="ADJUST_REASON"/> |
||||
|
<result property="point" column="POINT"/> |
||||
|
<result property="adjustmentType" column="ADJUSTMENT_TYPE"/> |
||||
|
<result property="operatorAgencyId" column="OPERATOR_AGENCY_ID"/> |
||||
|
<result property="userId" column="USER_ID"/> |
||||
|
<result property="delFlag" column="DEL_FLAG"/> |
||||
|
<result property="revision" column="REVISION"/> |
||||
|
<result property="createdTime" column="CREATED_TIME"/> |
||||
|
<result property="createdBy" column="CREATED_BY"/> |
||||
|
<result property="updatedTime" column="UPDATED_TIME"/> |
||||
|
<result property="updatedBy" column="UPDATED_BY"/> |
||||
|
</resultMap> |
||||
|
|
||||
|
<!-- 查询积分调整记录 --> |
||||
|
<select id="selectAdjustmentListByUserId" resultType="com.epmet.dto.result.PointAdjustmentResultDTO"> |
||||
|
SELECT |
||||
|
operator_name AS staffNickname, |
||||
|
adjust_reason AS reason, |
||||
|
DATE_FORMAT( created_time, '%Y-%m-%d %H:%i:%s' ) AS date, |
||||
|
CASE |
||||
|
action_flag |
||||
|
WHEN 'plus' THEN |
||||
|
CONCAT( '+', POINT ) ELSE CONCAT( '-', POINT ) |
||||
|
END AS POINT |
||||
|
FROM |
||||
|
point_adjustment_log |
||||
|
WHERE |
||||
|
del_flag = '0' |
||||
|
AND user_id = #{userId} |
||||
|
ORDER BY |
||||
|
created_time DESC |
||||
|
</select> |
||||
|
|
||||
|
</mapper> |
@ -0,0 +1,55 @@ |
|||||
|
/** |
||||
|
* Copyright 2018 人人开源 https://www.renren.io
|
||||
|
* <p> |
||||
|
* This program is free software: you can redistribute it and/or modify |
||||
|
* it under the terms of the GNU General Public License as published by |
||||
|
* the Free Software Foundation, either version 3 of the License, or |
||||
|
* (at your option) any later version. |
||||
|
* <p> |
||||
|
* This program is distributed in the hope that it will be useful, |
||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
|
* GNU General Public License for more details. |
||||
|
* <p> |
||||
|
* You should have received a copy of the GNU General Public License |
||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
*/ |
||||
|
|
||||
|
package com.epmet.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 客户表 app redis 缓存对象 |
||||
|
* |
||||
|
* @author generator generator@elink-cn.com |
||||
|
* @since v1.0.0 2020-07-27 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CustomerAppRedisDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -1619187268905620766L; |
||||
|
|
||||
|
/** |
||||
|
* 客户Id |
||||
|
*/ |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 小程序的appId |
||||
|
*/ |
||||
|
private String appId; |
||||
|
|
||||
|
/** |
||||
|
* resi,work |
||||
|
*/ |
||||
|
private String client; |
||||
|
|
||||
|
/** |
||||
|
* app的secret |
||||
|
*/ |
||||
|
private String secret; |
||||
|
|
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
package com.epmet.dto.form; |
||||
|
|
||||
|
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import javax.validation.constraints.Min; |
||||
|
import javax.validation.constraints.NotBlank; |
||||
|
import java.io.Serializable; |
||||
|
|
||||
|
/** |
||||
|
* @Description 查询一个客户下所有用户包括陌生人 |
||||
|
* @ClassName CustomerUserFormDTO |
||||
|
* @Auth wangc |
||||
|
* @Date 2020-07-25 15:38 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class CustomerUserFormDTO implements Serializable { |
||||
|
private static final long serialVersionUID = -8209934663808878617L; |
||||
|
|
||||
|
public interface CustomerIdGroup extends CustomerClientShowGroup{} |
||||
|
|
||||
|
@NotBlank(message = "客户Id不能为空", groups = CustomerIdGroup.class) |
||||
|
private String customerId; |
||||
|
|
||||
|
/** |
||||
|
* 查询参数:全名 |
||||
|
* */ |
||||
|
private String name; |
||||
|
|
||||
|
@Min(1) |
||||
|
private Integer pageNo = 1; |
||||
|
|
||||
|
private Integer pageSize = 20; |
||||
|
} |
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue