diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java index b3cbf19d45..59437dcff3 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/TestController.java @@ -4,8 +4,12 @@ import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; +import com.epmet.entity.PointVerificationStatisticalDailyEntity; import com.epmet.entity.UserPointStatisticalDailyEntity; +import com.epmet.entity.UserPointTotalEntity; +import com.epmet.service.PointVerificationStatisticalDailyService; import com.epmet.service.UserPointStatisticalDailyService; +import com.epmet.service.UserPointTotalService; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; @@ -29,6 +33,10 @@ public class TestController { private LoginUserUtil loginUserUtil; @Autowired private UserPointStatisticalDailyService userPointStatisticalDailyService; + @Autowired + private PointVerificationStatisticalDailyService pointVerificationStatisticalDailyService; + @Autowired + private UserPointTotalService userPointTotalService; @GetMapping("test") public Result test(@LoginUser TokenDto tokenDto){ Map map=new HashMap<>(); @@ -49,5 +57,15 @@ public class TestController { userPointStatisticalDailyService.test(entity); return new Result(); } + @PostMapping("testunixkeyverification") + public Result testUnixKeyVerification(@RequestBody PointVerificationStatisticalDailyEntity entity){ + pointVerificationStatisticalDailyService.testUnixKey(entity); + return new Result(); + } + @PostMapping("testtotal") + public Result testTotal(@RequestBody UserPointTotalEntity entity){ + userPointTotalService.testInsertOrUpdate(entity); + return new Result(); + } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationStatisticalDailyDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationStatisticalDailyDao.java index 5880d4bc3e..4ad495b7e4 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationStatisticalDailyDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationStatisticalDailyDao.java @@ -39,4 +39,6 @@ public interface PointVerificationStatisticalDailyDao extends BaseDao { **/ UserPointTotalEntity selectIfExisted(@Param("userId") String userId); + + void insertOrUpdate(UserPointTotalEntity userPointTotalEntity); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationStatisticalDailyService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationStatisticalDailyService.java index d48e70529b..a87601131d 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationStatisticalDailyService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointVerificationStatisticalDailyService.java @@ -101,4 +101,6 @@ public interface PointVerificationStatisticalDailyService extends BaseService * @date 2020.07.27 16:45 **/ void insertOrUpdate(UserPointTotalEntity entity); + + void testInsertOrUpdate(UserPointTotalEntity entity); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java index 14194f057f..f8f3974e80 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java @@ -330,6 +330,7 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl + + + + + SELECT replace(uuid(),'-','') AS ID + + INSERT INTO point_verification_statistical_daily + ( + id, + date_id, + week_id, + month_id, + quarter_id, + year_id, + customer_id, + verificated_point, + agency_id, + pid, + pids, + created_by, + created_time, + updated_by, + updated_time + ) VALUE ( + #{id}, + #{dateId}, + #{weekId}, + #{monthId}, + #{quarterId}, + #{yearId}, + #{customerId}, + #{verificatedPoint}, + #{agencyId}, + #{pid}, + #{pids}, + #{createdBy}, + now(), + #{createdBy}, + now() + ) ON DUPLICATE KEY UPDATE + VERIFICATED_POINT = (VERIFICATED_POINT + #{verificatedPoint}), + UPDATED_TIME = NOW(), + UPDATED_BY = #{createdBy} + + \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml index db72188a9e..d84b1b02ed 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml @@ -59,4 +59,39 @@ user_id = #{userId} + + + SELECT replace(uuid(),'-','') AS ID + + INSERT INTO user_point_total + ( + id, + user_id, + customer_id, + used_point, + usable_point, + total_point, + created_by, + created_time, + updated_by, + updated_time + ) VALUE ( + #{id}, + #{userId}, + #{customerId}, + #{usedPoint}, + #{usablePoint}, + #{totalPoint}, + #{createdBy}, + now(), + #{createdBy}, + now() + ) ON DUPLICATE KEY UPDATE + USED_POINT = (USED_POINT + #{usedPoint}), + USABLE_POINT = (USABLE_POINT + #{usablePoint}), + TOTAL_POINT = (TOTAL_POINT + #{totalPoint}), + UPDATED_TIME = NOW(), + UPDATED_BY = #{createdBy} + + \ No newline at end of file