+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dto;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+
+/**
+ * 初始化客户规则
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-20
+ */
+@Data
+public class InitPointRuleResultDTO implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * 客户总数
+ */
+ private Integer customerTotal;
+
+ /**
+ * 已经初始化总数
+ */
+ private Integer initedTotal;
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java
index 5d3c6dabfa..00c02df232 100644
--- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java
+++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointRuleFormDTO.java
@@ -53,7 +53,7 @@ public class PointRuleFormDTO implements Serializable {
@NotBlank(message = "是否开启不能为空", groups = {UpdateGroup.class})
private String enabledFlag;
/**
- * 是否启用
+ * 积分上限不能为空
*/
@NotNull(message = "积分上限不能为空", groups = {UpdateGroup.class})
private Integer upLimit;
@@ -62,6 +62,15 @@ public class PointRuleFormDTO implements Serializable {
* 积分上限描述
*/
private String upLimitDesc;
+ /**
+ * 积分上限前缀
+ */
+ private String upLimitPrefix;
+
+ /**
+ * 上限积分计算周期
+ */
+ private String rulePeriod;
//=======系统添加时的属性======
/**
diff --git a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml
index e5eb396fc1..8826b287c0 100644
--- a/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml
+++ b/epmet-module/epmet-point/epmet-point-server/deploy/docker-compose-dev.yml
@@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-point-server:
container_name: epmet-point-server-dev
- image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.23
+ image: 192.168.1.130:10080/epmet-cloud-dev/epmet-point-server:0.0.25
ports:
- "8112:8112"
network_mode: host # 使用现有网络
diff --git a/epmet-module/epmet-point/epmet-point-server/pom.xml b/epmet-module/epmet-point/epmet-point-server/pom.xml
index 208af44b10..58f94c9626 100644
--- a/epmet-module/epmet-point/epmet-point-server/pom.xml
+++ b/epmet-module/epmet-point/epmet-point-server/pom.xml
@@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
- 0.0.23
+ 0.0.25epmet-pointcom.epmet
@@ -81,6 +81,12 @@
2.0.0compile
+
+ com.epmet
+ oper-crm-client
+ 2.0.0
+ compile
+
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java
index 5c9dc10f67..cbbbbeebf5 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/BackDoorController.java
@@ -5,6 +5,7 @@ import com.epmet.common.enu.PointUnitEnum;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
+import com.epmet.dto.InitPointRuleResultDTO;
import com.epmet.dto.form.PointRuleFormDTO;
import com.epmet.service.PointRuleService;
import org.springframework.beans.factory.annotation.Autowired;
@@ -13,6 +14,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import java.util.List;
+
/**
* @author jianjun liu
* @date 2020-06-04 20:39
@@ -24,18 +27,32 @@ public class BackDoorController {
private PointRuleService pointRuleService;
/**
- * desc:添加规则
+ * desc:批量添加规则
*
- * @param formDTO
+ * @param list
* @return
*/
@PostMapping(value = "addpointrule")
- public Result add(@RequestBody PointRuleFormDTO formDTO) {
- ValidatorUtils.validateEntity(formDTO, AddGroup.class);
- pointRuleService.add(null, formDTO);
+ public Result add(@RequestBody List list) {
+ for (PointRuleFormDTO formDTO:list){
+ ValidatorUtils.validateEntity(list, AddGroup.class);
+ pointRuleService.add(null, formDTO);
+ }
return new Result().ok(true);
}
+ /**
+ * desc:批量添加规则
+ *
+ * @param list
+ * @return
+ */
+ @PostMapping(value = "initpointrule")
+ public Result initPointRule() {
+ InitPointRuleResultDTO resultDTO = pointRuleService.initPointRule();
+ return new Result().ok(resultDTO);
+ }
+
public static void main(String[] args) {
PointRuleFormDTO formDTO = new PointRuleFormDTO();
formDTO.setPoint(0);
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java
index 9361d09442..9d5dbecdd3 100644
--- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDao.java
@@ -22,7 +22,6 @@ import com.epmet.dto.form.PointRuleListFormDTO;
import com.epmet.entity.PointRuleEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
-import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@@ -54,4 +53,7 @@ public interface PointRuleDao extends BaseDao {
int updateByCustomerId(PointRuleEntity entity);
PointRuleEntity selectByEventCodeAndCustomerId(@Param("customerId") String customerId, @Param("eventCode") String eventCode);
+
+ List selectCustomerIds();
+
}
\ No newline at end of file
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDefaultDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDefaultDao.java
new file mode 100644
index 0000000000..4f83bca16c
--- /dev/null
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointRuleDefaultDao.java
@@ -0,0 +1,33 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+package com.epmet.dao;
+
+import com.epmet.commons.mybatis.dao.BaseDao;
+import com.epmet.entity.PointRuleDefaultEntity;
+import org.apache.ibatis.annotations.Mapper;
+
+/**
+ * 积分规则表
+ *
+ * @author generator generator@elink-cn.com
+ * @since v1.0.0 2020-07-20
+ */
+@Mapper
+public interface PointRuleDefaultDao extends BaseDao {
+
+}
\ No newline at end of file
diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleDefaultEntity.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleDefaultEntity.java
new file mode 100644
index 0000000000..bbb6055148
--- /dev/null
+++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/entity/PointRuleDefaultEntity.java
@@ -0,0 +1,97 @@
+/**
+ * Copyright 2018 人人开源 https://www.renren.io
+ *
+ * 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.
+ *
+ * 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.
+ *