Просмотр исходного кода

小程序账号密码管理,用户扫码生成预订单,后台首页统计

LIDEXI 4 лет назад
Родитель
Сommit
df6b43e276
35 измененных файлов с 999 добавлено и 51 удалено
  1. 30 26
      pom.xml
  2. 20 0
      src/main/java/org/springblade/common/constant/SystemConstant.java
  3. 3 3
      src/main/java/org/springblade/common/enums/OrderType.java
  4. 12 0
      src/main/java/org/springblade/modules/ldt/activityjoinrecord/entity/ActivityJoinRecord.java
  5. 216 0
      src/main/java/org/springblade/modules/ldt/appaccount/controller/AppAccountController.java
  6. 34 0
      src/main/java/org/springblade/modules/ldt/appaccount/dto/AppAccountDTO.java
  7. 57 0
      src/main/java/org/springblade/modules/ldt/appaccount/entity/AppAccount.java
  8. 42 0
      src/main/java/org/springblade/modules/ldt/appaccount/mapper/AppAccountMapper.java
  9. 25 0
      src/main/java/org/springblade/modules/ldt/appaccount/mapper/AppAccountMapper.xml
  10. 41 0
      src/main/java/org/springblade/modules/ldt/appaccount/service/IAppAccountService.java
  11. 41 0
      src/main/java/org/springblade/modules/ldt/appaccount/service/impl/AppAccountServiceImpl.java
  12. 40 0
      src/main/java/org/springblade/modules/ldt/appaccount/vo/AppAccountVO.java
  13. 18 6
      src/main/java/org/springblade/modules/ldt/billrecord/entity/BillRecord.java
  14. 31 0
      src/main/java/org/springblade/modules/ldt/loginuser/controller/LoginUserController.java
  15. 24 0
      src/main/java/org/springblade/modules/ldt/loginuser/dto/PayDto.java
  16. 5 0
      src/main/java/org/springblade/modules/ldt/loginuser/service/ILoginUserService.java
  17. 148 0
      src/main/java/org/springblade/modules/ldt/loginuser/service/impl/LoginUserServiceImpl.java
  18. 5 3
      src/main/java/org/springblade/modules/ldt/mall/controller/AppMallController.java
  19. 6 0
      src/main/java/org/springblade/modules/ldt/mall/entity/Mall.java
  20. 1 0
      src/main/java/org/springblade/modules/ldt/mall/mapper/MallMapper.xml
  21. 1 1
      src/main/java/org/springblade/modules/ldt/member/mapper/MemberMapper.xml
  22. 6 0
      src/main/java/org/springblade/modules/ldt/pointdetail/entity/PointDetail.java
  23. 34 1
      src/main/java/org/springblade/modules/ldt/shop/controller/AppShopController.java
  24. 7 2
      src/main/java/org/springblade/modules/ldt/shop/controller/ShopController.java
  25. 6 0
      src/main/java/org/springblade/modules/ldt/shop/entity/Shop.java
  26. 1 0
      src/main/java/org/springblade/modules/ldt/shop/mapper/ShopMapper.xml
  27. 2 0
      src/main/java/org/springblade/modules/ldt/shop/vo/ShopVO.java
  28. 8 0
      src/main/java/org/springblade/modules/ldt/shop/vo/yingshouVO.java
  29. 11 3
      src/main/java/org/springblade/modules/ldt/shop/wrapper/ShopWrapper.java
  30. 69 0
      src/main/java/org/springblade/modules/ldt/statistic/controller/StaticController.java
  31. 27 0
      src/main/java/org/springblade/modules/ldt/statistic/vo/StatisticVO.java
  32. 1 1
      src/main/java/org/springblade/modules/payment/plugin/Payment.java
  33. 22 1
      src/main/java/org/springblade/modules/payment/plugin/YeePayPlugin.java
  34. 4 4
      src/main/resources/application-prod.yml
  35. 1 0
      src/main/resources/application.yml

+ 30 - 26
pom.xml

@@ -252,7 +252,7 @@
     </dependencies>
 
     <build>
-        <finalName>${bladex.project.id}</finalName>
+        <finalName>guosen-ldt</finalName>
         <resources>
             <resource>
                 <directory>src/main/resources</directory>
@@ -272,6 +272,13 @@
                     <version>${spring.boot.version}</version>
                     <configuration>
                         <finalName>${project.build.finalName}</finalName>
+                        <layout>ZIP</layout>
+                        <includes>
+                            <include>
+                                <groupId>non-exists</groupId>
+                                <artifactId>non-exists</artifactId>
+                            </include>
+                        </includes>
                     </configuration>
                     <executions>
                         <execution>
@@ -281,31 +288,6 @@
                         </execution>
                     </executions>
                 </plugin>
-                <plugin>
-                    <groupId>com.spotify</groupId>
-                    <artifactId>dockerfile-maven-plugin</artifactId>
-                    <version>${docker.plugin.version}</version>
-                    <configuration>
-                        <username>${docker.username}</username>
-                        <password>${docker.password}</password>
-                        <repository>${docker.registry.url}/${docker.namespace}/${project.build.finalName}</repository>
-                        <tag>${project.version}</tag>
-                        <useMavenSettingsForAuth>true</useMavenSettingsForAuth>
-                        <buildArgs>
-                            <JAR_FILE>target/${project.build.finalName}.jar</JAR_FILE>
-                        </buildArgs>
-                    </configuration>
-                    <!--添加如下配置,运行 mvn deploy 命令便会自动打包镜像-->
-                    <!--<executions>
-                        <execution>
-                            <id>default</id>
-                            <goals>
-                                <goal>build</goal>
-                                <goal>push</goal>
-                            </goals>
-                        </execution>
-                    </executions>-->
-                </plugin>
             </plugins>
         </pluginManagement>
         <plugins>
@@ -313,6 +295,7 @@
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-maven-plugin</artifactId>
             </plugin>
+
             <plugin>
                 <artifactId>maven-compiler-plugin</artifactId>
                 <version>${maven.plugin.version}</version>
@@ -325,6 +308,27 @@
                     </compilerArgs>
                 </configuration>
             </plugin>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-dependencies</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <!--target/lib是依赖jar包的输出目录,根据自己喜好配置-->
+                            <outputDirectory>target/lib</outputDirectory>
+                            <excludeTransitive>false</excludeTransitive>
+                            <stripVersion>false</stripVersion>
+                            <includeScope>runtime</includeScope>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
 

+ 20 - 0
src/main/java/org/springblade/common/constant/SystemConstant.java

@@ -77,4 +77,24 @@ public interface SystemConstant {
 			this.value = value;
 		}
 	}
+
+	/**
+	 * 积分明细类型
+	 */
+	@Getter
+	enum PointDetailType{
+
+		MALL_SEND("商场赠送",1),
+		SHOP_SEND("商家赠送",2),
+		USER_PAY("用户付款",3),
+		CHANNEL("积分授权",4);
+
+
+		String name;
+		Integer value;
+		PointDetailType(String name, Integer value){
+			this.name = name;
+			this.value = value;
+		}
+	}
 }

+ 3 - 3
src/main/java/org/springblade/common/enums/OrderType.java

@@ -13,9 +13,9 @@ import lombok.Getter;
 public enum OrderType {
 
 	/* 用户付款 */
-	USER_PAY("userPay)"),
-	AGENT_CHARGE("agentCharge)"),
-	MALL_CHARGE("mallCharge)");
+	USER_PAY("USER_PAY)"),
+	AGENT_CHARGE("AGENT_CHARGE)"),
+	MALL_CHARGE("MALL_CHARGE)");
 
 	String name;
 

+ 12 - 0
src/main/java/org/springblade/modules/ldt/activityjoinrecord/entity/ActivityJoinRecord.java

@@ -84,5 +84,17 @@ public class ActivityJoinRecord extends BaseEntity {
 	@ApiModelProperty(value = "最终的折扣(百分比)")
 	private BigDecimal finalSupplyPrice;
 
+	/**
+	 * 国信活动服务费率
+	 */
+	@ApiModelProperty(value = "国信活动服务费率")
+	private BigDecimal gxRewardSupply;
+
+	/**
+	 * 审核状态
+	 */
+	@ApiModelProperty(value = "审核状态")
+	private Integer auditStatus;
+
 
 }

+ 216 - 0
src/main/java/org/springblade/modules/ldt/appaccount/controller/AppAccountController.java

@@ -0,0 +1,216 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ldt.appaccount.controller;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Assert;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.log.exception.ServiceException;
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.DigestUtil;
+import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.system.entity.User;
+import org.springframework.data.redis.core.RedisTemplate;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestParam;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.ldt.appaccount.entity.AppAccount;
+import org.springblade.modules.ldt.appaccount.vo.AppAccountVO;
+import org.springblade.modules.ldt.appaccount.service.IAppAccountService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ *  控制器
+ *
+ * @author BladeX
+ * @since 2021-08-08
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("cyzh-ldt/appaccount")
+@Api(value = "", tags = "接口")
+public class AppAccountController extends BladeController {
+
+	private final IAppAccountService appAccountService;
+	private final RedisTemplate<String,String> redisTemplate;
+	private static final String REDIS_KEY_CODE = "sms:code:";
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入appAccount")
+	public R<AppAccount> detail(AppAccount appAccount) {
+		AppAccount detail = appAccountService.getOne(Condition.getQueryWrapper(appAccount));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入appAccount")
+	public R<IPage<AppAccount>> list(AppAccount appAccount, Query query) {
+		IPage<AppAccount> pages = appAccountService.page(Condition.getPage(query), Condition.getQueryWrapper(appAccount));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入appAccount")
+	public R<IPage<AppAccountVO>> page(AppAccountVO appAccount, Query query) {
+		IPage<AppAccountVO> pages = appAccountService.selectAppAccountPage(Condition.getPage(query), appAccount);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入appAccount")
+	public R save(@Valid @RequestBody AppAccount appAccount) {
+		return R.status(appAccountService.save(appAccount));
+	}
+
+	/**
+	 * 修改
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入appAccount")
+	public R update(@Valid @RequestBody AppAccount appAccount) {
+		return R.status(appAccountService.updateById(appAccount));
+	}
+
+	/**
+	 * 新增或修改
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入appAccount")
+	public R submit(@Valid @RequestBody AppAccount appAccount) {
+		return R.status(appAccountService.saveOrUpdate(appAccount));
+	}
+
+
+	/**
+	 * 删除
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "逻辑删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(appAccountService.deleteLogic(Func.toLongList(ids)));
+	}
+
+	/**
+	 * 商户商场登录
+	 * type: 1-商场 2-商户
+	 */
+	@PostMapping("/login")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "商户商场登录", notes = "传入ids")
+	public R login(@RequestBody AppAccount appAccount) {
+		Assert.notNull(appAccount.getPassword(),"密码不能为空");
+		Assert.notNull(appAccount.getPhone(),"手机号码不能为空");
+		Assert.notNull(appAccount.getType(),"登录类型不能为空");
+		AppAccount isExist = appAccountService.getBaseMapper().selectOne(new QueryWrapper<>(new AppAccount()).lambda()
+			.eq(AppAccount::getPhone, appAccount.getPhone()).eq(AppAccount::getType, appAccount.getType())
+			.eq(AppAccount::getPassword,DigestUtil.hex(appAccount.getPassword())));
+		if(isExist != null){
+			return R.status(true);
+		}
+		return R.status(false);
+	}
+
+	/**
+	 * 忘记密码
+	 * type: 1-商场 2-商户
+	 */
+	@PostMapping("/forgetPassword")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "忘记密码", notes = "传入ids")
+	public R login(@RequestBody AppAccountVO appAccount) {
+		Assert.notNull(appAccount.getPassword(),"密码不能为空");
+		Assert.notNull(appAccount.getPhone(),"手机号码不能为空");
+		Assert.notNull(appAccount.getType(),"登录类型不能为空");
+		String redisCodeKey = REDIS_KEY_CODE + appAccount.getPhone();
+		String codeValue = redisTemplate.opsForValue().get(redisCodeKey);
+		if(codeValue!=null&&codeValue.equals(appAccount.getCode())){
+			AppAccount isExist = appAccountService.getBaseMapper().selectOne(new QueryWrapper<>(new AppAccount()).lambda()
+				.eq(AppAccount::getPhone, appAccount.getPhone()).eq(AppAccount::getType, appAccount.getType()));
+			Assert.notNull(isExist,"账号不存在,请先注册");
+			isExist.setPassword(DigestUtil.hex(appAccount.getPassword()));
+			return R.status(appAccountService.updateById(isExist));
+		}else {
+			return R.fail("验证码错误");
+		}
+	}
+
+	/**
+	 * 商户商场设置密码/修改密码
+	 * type: 1-商场 2-商户
+	 */
+	@PostMapping("/setPassword")
+	@ApiOperationSupport(order = 7)
+	@ApiOperation(value = "商户商场设置密码/修改密码", notes = "传入ids")
+	public R setPassword(@RequestBody AppAccountVO appAccount) {
+		Assert.notNull(appAccount.getPassword(),"密码不能为空");
+		Assert.notNull(appAccount.getPhone(),"手机号码不能为空");
+		Assert.notNull(appAccount.getType(),"登录类型不能为空");
+		AppAccount isExist = appAccountService.getBaseMapper().selectOne(new QueryWrapper<>(new AppAccount()).lambda()
+			.eq(AppAccount::getPhone, appAccount.getPhone()).eq(AppAccount::getType, appAccount.getType()));
+		if(isExist != null){
+			//修改密码
+			Assert.notNull(appAccount.getOldPassword(),"旧密码不能为空");
+			Assert.isTrue(isExist.getPassword().equals(DigestUtil.hex(appAccount.getOldPassword())),"旧密码错误");
+			//设置新的密码
+			isExist.setPassword(DigestUtil.hex(appAccount.getPassword()));
+			return R.status(appAccountService.updateById(isExist));
+		}else{
+			AppAccount newObject = new AppAccount();
+			newObject.setPassword(DigestUtil.hex(appAccount.getPassword()));
+			newObject.setPhone(appAccount.getPhone());
+			newObject.setType(appAccount.getType());
+			return R.status(appAccountService.save(newObject));
+		}
+
+	}
+
+
+//	public static void main(String[] args) {
+//
+//		System.out.println((DigestUtil.hex("ac3c655d24a78327f1e6a53e25aa1e46")));;
+//
+//	}
+
+}

+ 34 - 0
src/main/java/org/springblade/modules/ldt/appaccount/dto/AppAccountDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ldt.appaccount.dto;
+
+import org.springblade.modules.ldt.appaccount.entity.AppAccount;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2021-08-08
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class AppAccountDTO extends AppAccount {
+	private static final long serialVersionUID = 1L;
+
+}

+ 57 - 0
src/main/java/org/springblade/modules/ldt/appaccount/entity/AppAccount.java

@@ -0,0 +1,57 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ldt.appaccount.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.springblade.core.mp.base.BaseEntity;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 实体类
+ *
+ * @author BladeX
+ * @since 2021-08-08
+ */
+@Data
+@TableName("ldt_app_account")
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "AppAccount对象", description = "AppAccount对象")
+public class AppAccount extends BaseEntity {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	* 类型:1-商场 2-商家
+	*/
+		@ApiModelProperty(value = "类型:1-商场 2-商家")
+		private Integer type;
+	/**
+	* 手机号
+	*/
+		@ApiModelProperty(value = "手机号")
+		private String phone;
+	/**
+	* 密码
+	*/
+		@ApiModelProperty(value = "密码")
+		private String password;
+
+
+}

+ 42 - 0
src/main/java/org/springblade/modules/ldt/appaccount/mapper/AppAccountMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ldt.appaccount.mapper;
+
+import org.springblade.modules.ldt.appaccount.entity.AppAccount;
+import org.springblade.modules.ldt.appaccount.vo.AppAccountVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ *  Mapper 接口
+ *
+ * @author BladeX
+ * @since 2021-08-08
+ */
+public interface AppAccountMapper extends BaseMapper<AppAccount> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param appAccount
+	 * @return
+	 */
+	List<AppAccountVO> selectAppAccountPage(IPage page, AppAccountVO appAccount);
+
+}

+ 25 - 0
src/main/java/org/springblade/modules/ldt/appaccount/mapper/AppAccountMapper.xml

@@ -0,0 +1,25 @@
+<?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="org.springblade.modules.ldt.appaccount.mapper.AppAccountMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="appAccountResultMap" type="org.springblade.modules.ldt.appaccount.entity.AppAccount">
+        <result column="id" property="id"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_dept" property="createDept"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="status" property="status"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="type" property="type"/>
+        <result column="phone" property="phone"/>
+        <result column="password" property="password"/>
+    </resultMap>
+
+
+    <select id="selectAppAccountPage" resultMap="appAccountResultMap">
+        select * from ldt_app_account where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
src/main/java/org/springblade/modules/ldt/appaccount/service/IAppAccountService.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ldt.appaccount.service;
+
+import org.springblade.modules.ldt.appaccount.entity.AppAccount;
+import org.springblade.modules.ldt.appaccount.vo.AppAccountVO;
+import org.springblade.core.mp.base.BaseService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务类
+ *
+ * @author BladeX
+ * @since 2021-08-08
+ */
+public interface IAppAccountService extends BaseService<AppAccount> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param appAccount
+	 * @return
+	 */
+	IPage<AppAccountVO> selectAppAccountPage(IPage<AppAccountVO> page, AppAccountVO appAccount);
+
+}

+ 41 - 0
src/main/java/org/springblade/modules/ldt/appaccount/service/impl/AppAccountServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ldt.appaccount.service.impl;
+
+import org.springblade.modules.ldt.appaccount.entity.AppAccount;
+import org.springblade.modules.ldt.appaccount.vo.AppAccountVO;
+import org.springblade.modules.ldt.appaccount.mapper.AppAccountMapper;
+import org.springblade.modules.ldt.appaccount.service.IAppAccountService;
+import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ *  服务实现类
+ *
+ * @author BladeX
+ * @since 2021-08-08
+ */
+@Service
+public class AppAccountServiceImpl extends BaseServiceImpl<AppAccountMapper, AppAccount> implements IAppAccountService {
+
+	@Override
+	public IPage<AppAccountVO> selectAppAccountPage(IPage<AppAccountVO> page, AppAccountVO appAccount) {
+		return page.setRecords(baseMapper.selectAppAccountPage(page, appAccount));
+	}
+
+}

+ 40 - 0
src/main/java/org/springblade/modules/ldt/appaccount/vo/AppAccountVO.java

@@ -0,0 +1,40 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.modules.ldt.appaccount.vo;
+
+import org.springblade.modules.ldt.appaccount.entity.AppAccount;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 视图实体类
+ *
+ * @author BladeX
+ * @since 2021-08-08
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "AppAccountVO对象", description = "AppAccountVO对象")
+public class AppAccountVO extends AppAccount {
+	private static final long serialVersionUID = 1L;
+
+	private String oldPassword;
+
+	private String code;
+
+}

+ 18 - 6
src/main/java/org/springblade/modules/ldt/billrecord/entity/BillRecord.java

@@ -52,6 +52,12 @@ public class BillRecord extends BaseEntity {
 		@ApiModelProperty(value = "商店id")
 		private Long shopId;
 
+	/**
+	 * 联营折扣
+	 */
+	@ApiModelProperty(value = "联营折扣")
+	private BigDecimal subsidy;
+
 	/**
 	 * 商场id
 	 */
@@ -63,14 +69,14 @@ public class BillRecord extends BaseEntity {
 		@ApiModelProperty(value = "该用户在该商店的会员id")
 		private Long memberId;
 	/**
-	* 价
+	* 
 	*/
-		@ApiModelProperty(value = "价")
+		@ApiModelProperty(value = "价")
 		private BigDecimal price;
 	/**
-	* 1:用户扫码支付 2:商家扫码收款 3:代理费
+	* USER_PAY,AGENT_CHARGE,MALL_CHARGE
 	*/
-		@ApiModelProperty(value = "1:用户扫码支付 2:商家扫码收款 3:代理费")
+		@ApiModelProperty(value = "USER_PAY,AGENT_CHARGE,MALL_CHARGE")
 		private String type;
 	/**
 	* 唯一的订单号
@@ -103,11 +109,17 @@ public class BillRecord extends BaseEntity {
 	*/
 		@ApiModelProperty(value = "易支付返回的支付状态")
 		private String thirdPayStatus;
+
+	/**
+	 * 应付款
+	 */
+	@ApiModelProperty(value = "应付款")
+	private BigDecimal yingfuAmount;
 	/**
 	* 实际付款价格
 	*/
-		@ApiModelProperty(value = "实际付款价格")
-		private String realPayAmount;
+		@ApiModelProperty(value = "实际付款价格 应付款")
+		private BigDecimal realPayAmount;
 	/**
 	* parent_merchant_no
 	*/

+ 31 - 0
src/main/java/org/springblade/modules/ldt/loginuser/controller/LoginUserController.java

@@ -16,6 +16,7 @@
  */
 package org.springblade.modules.ldt.loginuser.controller;
 
+import com.baomidou.mybatisplus.core.toolkit.Assert;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -28,7 +29,13 @@ import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.ldt.activityjoinrecord.service.IActivityJoinRecordService;
+import org.springblade.modules.ldt.billrecord.entity.BillRecord;
 import org.springblade.modules.ldt.loginuser.dto.LoginUserDTO;
+import org.springblade.modules.ldt.loginuser.dto.PayDto;
+import org.springblade.modules.ldt.member.service.IMemberService;
+import org.springblade.modules.ldt.shop.entity.Shop;
+import org.springblade.modules.ldt.shop.service.IShopService;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -52,6 +59,10 @@ import java.util.Map;
 public class LoginUserController extends BladeController {
 
 	private final ILoginUserService loginUserService;
+	private final IActivityJoinRecordService activityJoinRecordService;
+	private final IMemberService memberService;
+	private final IShopService shopService;
+
 
 	/**
 	 * 详情
@@ -135,4 +146,24 @@ public class LoginUserController extends BladeController {
 	public R login(@RequestBody LoginUserDTO loginUserDTO) {
 		return R.data(loginUserService.login(loginUserDTO));
 	}
+
+	/**
+	 * 用户扫码支付生成预订单
+	 */
+	@PostMapping("/payBefore")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "用户扫码支付", notes = "传入loginUser")
+	public R<BillRecord> payBefore(@RequestBody PayDto payDto) {
+		Assert.notNull(payDto.getLoginUserId(),"用户信息不能为空");
+		Assert.notNull(payDto.getMoney(),"商品价格不能为空");
+		Assert.notNull(payDto.getShopId(),"商店信息不能为空");
+		Shop shop = shopService.getById(payDto.getShopId());
+		Assert.notNull(shop,"商店信息不存在");
+		LoginUser loginUser = loginUserService.getById(payDto.getLoginUserId());
+		Assert.notNull(loginUser,"用户信息不存在");
+
+		return R.data(this.loginUserService.payBefore(loginUser,shop,payDto));
+	}
+
+
 }

+ 24 - 0
src/main/java/org/springblade/modules/ldt/loginuser/dto/PayDto.java

@@ -0,0 +1,24 @@
+package org.springblade.modules.ldt.loginuser.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * Created By lidexi in 2021/8/8
+ * 用户发起支付时传递的参数
+ **/
+@Data
+public class PayDto {
+
+	@ApiModelProperty("商店id")
+	private Long shopId;
+
+	@ApiModelProperty("用户id")
+	private Long loginUserId;
+
+	@ApiModelProperty("金额")
+	private BigDecimal money;
+
+}

+ 5 - 0
src/main/java/org/springblade/modules/ldt/loginuser/service/ILoginUserService.java

@@ -16,11 +16,14 @@
  */
 package org.springblade.modules.ldt.loginuser.service;
 
+import org.springblade.modules.ldt.billrecord.entity.BillRecord;
 import org.springblade.modules.ldt.loginuser.dto.LoginUserDTO;
+import org.springblade.modules.ldt.loginuser.dto.PayDto;
 import org.springblade.modules.ldt.loginuser.entity.LoginUser;
 import org.springblade.modules.ldt.loginuser.vo.LoginUserVO;
 import org.springblade.core.mp.base.BaseService;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.modules.ldt.shop.entity.Shop;
 
 /**
  *  服务类
@@ -45,4 +48,6 @@ public interface ILoginUserService extends BaseService<LoginUser> {
 	 * @return 用户id
 	 */
 	LoginUser login(LoginUserDTO loginUserDTO);
+
+    BillRecord payBefore(LoginUser loginUser,Shop shop, PayDto payDto);
 }

+ 148 - 0
src/main/java/org/springblade/modules/ldt/loginuser/service/impl/LoginUserServiceImpl.java

@@ -16,16 +16,40 @@
  */
 package org.springblade.modules.ldt.loginuser.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Assert;
+import org.springblade.common.constant.SystemConstant;
+import org.springblade.common.enums.OrderType;
+import org.springblade.common.enums.PaymentType;
 import org.springblade.core.mp.support.Condition;
+import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.modules.ldt.activityjoinrecord.entity.ActivityJoinRecord;
+import org.springblade.modules.ldt.activityjoinrecord.service.IActivityJoinRecordService;
+import org.springblade.modules.ldt.billrecord.entity.BillRecord;
+import org.springblade.modules.ldt.billrecord.service.IBillRecordService;
 import org.springblade.modules.ldt.loginuser.dto.LoginUserDTO;
+import org.springblade.modules.ldt.loginuser.dto.PayDto;
 import org.springblade.modules.ldt.loginuser.entity.LoginUser;
 import org.springblade.modules.ldt.loginuser.vo.LoginUserVO;
 import org.springblade.modules.ldt.loginuser.mapper.LoginUserMapper;
 import org.springblade.modules.ldt.loginuser.service.ILoginUserService;
 import org.springblade.core.mp.base.BaseServiceImpl;
+import org.springblade.modules.ldt.member.entity.Member;
+import org.springblade.modules.ldt.member.service.IMemberService;
+import org.springblade.modules.ldt.pointdetail.entity.PointDetail;
+import org.springblade.modules.ldt.pointdetail.service.IPointDetailService;
+import org.springblade.modules.ldt.shop.entity.Shop;
+import org.springblade.modules.ldt.shop.service.IShopService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.math.BigDecimal;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  *  服务实现类
@@ -36,6 +60,17 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 @Service
 public class LoginUserServiceImpl extends BaseServiceImpl<LoginUserMapper, LoginUser> implements ILoginUserService {
 
+	@Autowired
+	private  IActivityJoinRecordService activityJoinRecordService;
+	@Autowired
+	private  IMemberService memberService;
+	@Autowired
+	private IBillRecordService billRecordService;
+	@Autowired
+	private IPointDetailService pointDetailService;
+	@Autowired
+	private ILoginUserService loginUserService;
+
 	@Override
 	public IPage<LoginUserVO> selectLoginUserPage(IPage<LoginUserVO> page, LoginUserVO loginUser) {
 		return page.setRecords(baseMapper.selectLoginUserPage(page, loginUser));
@@ -54,4 +89,117 @@ public class LoginUserServiceImpl extends BaseServiceImpl<LoginUserMapper, Login
 		return loginUser;
 	}
 
+	@Override
+	@Transactional
+	public BillRecord payBefore(LoginUser loginUser,Shop shop, PayDto payDto) {
+
+		BillRecord billRecord = new BillRecord();
+		billRecord.setShopId(payDto.getShopId());
+		billRecord.setMallId(shop.getMallId());
+		billRecord.setType(OrderType.USER_PAY.getName());
+		billRecord.setUserId(payDto.getLoginUserId());
+		billRecord.setPrice(payDto.getMoney());//总价
+		billRecord.setSubsidy(BigDecimal.valueOf(100));
+		BigDecimal gxServerRate = BigDecimal.valueOf(10);//国信服务费,默认10%
+
+		Map<String,Member> memberMap = this.getMembers(shop,payDto);
+		Member shopMember = memberMap.get("shopMember");//商店会员
+		Member mallMember = memberMap.get("mallMember");//商场会员
+		Assert.notNull(shopMember,"程序异常");
+		billRecord.setMemberId(shopMember.getId());
+
+		//先查询该小B的活动折扣
+		List<ActivityJoinRecord> activityJoinRecords = activityJoinRecordService.getBaseMapper().selectList(new QueryWrapper<>(new ActivityJoinRecord()).lambda()
+			.eq(ActivityJoinRecord::getJoinType, SystemConstant.MALLORSHOP.SHOP.getValue())
+			.eq(ActivityJoinRecord::getJoinId, payDto.getShopId()).eq(ActivityJoinRecord::getAuditStatus,SystemConstant.AuditStatus.PASS.getValue()));
+		if(activityJoinRecords.size()>0){//小B参与了大B的活动
+			//联营折扣
+			billRecord.setSubsidy(activityJoinRecords.get(0).getFinalSupplyPrice());
+			gxServerRate = activityJoinRecords.get(0).getGxRewardSupply();
+		}else{//小B没有参加大B的活动,查看小B是否自己有创建活动
+
+		}
+
+		//用户应付金额 = 商品价格* 小B折扣*大B折扣+国信活动服务费
+		BigDecimal yingfu = payDto.getMoney().multiply(billRecord.getSubsidy()).add(payDto.getMoney().multiply(gxServerRate).divide(BigDecimal.valueOf(100)));
+		billRecord.setYingfuAmount(yingfu);
+		//判断用户积分是否足够抵扣 : (用户应付金额 - 用户积分价值*(1+国信服务费率))     0
+		boolean scoreEnough =  yingfu.subtract(
+			loginUser.getPointValue().multiply(BigDecimal.ONE.add(BigDecimal.valueOf(0.005)))).compareTo(BigDecimal.ZERO) > 0 ?false : true;
+
+		if(scoreEnough){//积分足够扣
+			billRecord.setRealPayAmount(BigDecimal.ZERO);
+
+		}else{//积分不够支付
+			billRecord.setRealPayAmount(yingfu.subtract(loginUser.getPointValue()));
+		}
+		billRecordService.save(billRecord);
+		//积分明细(从积分渠道中先扣)
+		PointDetail pointDetail = new PointDetail();
+		pointDetail.setBillRecordId(billRecord.getId());
+		pointDetail.setType(SystemConstant.PointDetailType.USER_PAY.getValue());
+		pointDetail.setMallId(shop.getMallId());
+		pointDetail.setMemberId(shopMember.getId());
+		pointDetail.setUserId(loginUser.getId());
+		//用户实际支付积分价值
+		pointDetail.setPointValue(yingfu);
+		//国信服务费
+		pointDetail.setGxRewardPointValue(yingfu.subtract(yingfu.multiply(BigDecimal.valueOf(0.005))));
+		pointDetail.setPrice(yingfu);
+		pointDetailService.save(pointDetail);
+
+		//扣除用户积分价值
+		loginUser.setPointValue(loginUser.getPointValue().subtract(yingfu));
+		loginUserService.updateById(loginUser);
+		return billRecord;
+	}
+
+
+	/**
+	 * 获取用户在该店该商场的会员信息
+	 */
+
+	private Map<String,Member> getMembers(Shop shop,PayDto payDto){
+		Map<String,Member> memberMap = new HashMap<>();
+		//获取该用户在该店的会员信息
+		Member isMember = memberService.getBaseMapper().selectOne(new QueryWrapper<>(new Member()).lambda()
+			.eq(Member::getType, SystemConstant.MALLORSHOP.SHOP.getValue())
+			.eq(Member::getShopId, payDto.getShopId()).eq(Member::getUserId, payDto.getLoginUserId()));
+		if(isMember != null){//是该店的会员
+			memberMap.put("shopMember",isMember);
+		}else{//不是该店的会员,新建会员信息,并判断是否为该商场的会员
+
+			Member shopMember = new Member();
+			shopMember.setType(SystemConstant.MALLORSHOP.SHOP.getValue());
+			shopMember.setMallId(shop.getMallId());
+			shopMember.setShopId(shop.getId());
+			shopMember.setPointTotal(BigDecimal.ZERO);
+			shopMember.setPointValue(BigDecimal.ZERO);
+			shopMember.setUserId(payDto.getLoginUserId());
+			memberService.save(shopMember);
+			memberMap.put("shopMember",shopMember);
+			//获取该用户在该商场的会员信息
+			if(shop.getMallId() != null){//该商店有商场信息
+				Member isMallMember = memberService.getBaseMapper().selectOne(new QueryWrapper<>(new Member()).lambda()
+					.eq(Member::getMallId,shop.getMallId()).eq(Member::getType,SystemConstant.MALLORSHOP.MALL.getValue())
+					.eq(Member::getUserId,payDto.getLoginUserId()));
+				if(isMallMember != null){//该用户是该商场的会员
+					memberMap.put("mallMember",isMallMember);
+				}else{//不是该商场的会员,创建
+					Member mallMember = new Member();
+					mallMember.setUserId(payDto.getLoginUserId());
+					mallMember.setPointValue(BigDecimal.ZERO);
+					mallMember.setPointTotal(BigDecimal.ZERO);
+					mallMember.setType(SystemConstant.MALLORSHOP.MALL.getValue());
+					mallMember.setMallId(shop.getMallId());
+					memberService.save(mallMember);
+					memberMap.put("mallMember",mallMember);
+				}
+			}
+
+		}
+
+		return memberMap;
+	}
+
 }

+ 5 - 3
src/main/java/org/springblade/modules/ldt/mall/controller/AppMallController.java

@@ -136,7 +136,7 @@ public class AppMallController {
 			.eq(shopDTO.getMallId() != null, Shop::getMallId, shopDTO.getMallId()).like(shopDTO.getLabelId() != null, Shop::getLabelIds, shopDTO.getLabelId())
 			.eq(shopDTO.getMallAreaId() != null, Shop::getMallAreaId, shopDTO.getMallAreaId())
 			.like(shopDTO.getFullName() != null, Shop::getFullName, shopDTO.getFullName()));
-		return R.data(ShopWrapper.build(mallAreaService).pageVO(shops));
+		return R.data(ShopWrapper.build(mallAreaService,mallService).pageVO(shops));
 	}
 
 	/**
@@ -148,6 +148,7 @@ public class AppMallController {
 	@GetMapping("/statistic")
 	@ApiOperation(value = "商场首页获取统计数据", notes = "传入商场id")
 	public R<AppMallStaticVO> statistic(@RequestParam Long mallId) {
+		Assert.notNull(mallId,"商场id不能为空");
 		AppMallStaticVO appMallStaticVO = new AppMallStaticVO();
 		//统计会员总数
 		List<Member> members = memberService.getBaseMapper().selectList(new QueryWrapper<>(new Member()).lambda()
@@ -166,9 +167,10 @@ public class AppMallController {
 		Date today = new Date();
 		//今日新增会员数
 		try {
-			Date todayDate = sdf.parse(today.toString());
+			Date todayDate = sdf.parse(sdf.format(today));
 			todayMemberIn = members.stream().filter(member -> member.getCreateTime().after(todayDate)).collect(Collectors.toList()).size();
-			List<Shop> shops = shopService.getBaseMapper().selectList(new QueryWrapper<>(new Shop()).lambda().eq(Shop::getMallId, mallId));
+			List<Shop> shops = shopService.getBaseMapper().selectList(new QueryWrapper<>(new Shop()).lambda().eq(Shop::getMallId, mallId)
+				.eq(Shop::getAuditStatus,SystemConstant.AuditStatus.PASS.getValue()));
 			shopCount = shops.size();
 
 			//今日营收

+ 6 - 0
src/main/java/org/springblade/modules/ldt/mall/entity/Mall.java

@@ -153,5 +153,11 @@ public class Mall extends BaseEntity {
 	@ApiModelProperty(value = "简介")
 	private String introduce;
 
+	/**
+	 * 账期
+	 */
+	@ApiModelProperty(value = "账期")
+	private Integer paymentDays;
+
 
 }

+ 1 - 0
src/main/java/org/springblade/modules/ldt/mall/mapper/MallMapper.xml

@@ -27,6 +27,7 @@
         <result column="boundary_path" property="boundaryPath"/>
         <result column="pic" property="pic"/>
         <result column="introduce" property="introduce"/>
+        <result column="payment_days" property="paymentDays"/>
     </resultMap>
 
     <resultMap id="mallResultVOMap" type="org.springblade.modules.ldt.mall.vo.MallVO" extends="mallResultMap">

+ 1 - 1
src/main/java/org/springblade/modules/ldt/member/mapper/MemberMapper.xml

@@ -31,7 +31,7 @@
 
     <select id="selectMemberPage" resultMap="memberVOResultMap">
         select
-            lm.user_id,lm.mall_id,lm.shop_id,lm.point_total,lm.point_value,lm.type,
+            lm.id,lm.user_id,lm.mall_id,lm.shop_id,lm.point_total,lm.point_value,lm.type,
             llu.nick_name,llu.avatar,llu.phone,llu.gender
         from
             ldt_member lm,ldt_login_user llu

+ 6 - 0
src/main/java/org/springblade/modules/ldt/pointdetail/entity/PointDetail.java

@@ -87,6 +87,12 @@ public class PointDetail extends BaseEntity {
 	@ApiModelProperty(value = "积分价值")
 	private BigDecimal pointValue;
 
+	/**
+	 * 国信积分服务费
+	 */
+	@ApiModelProperty(value = "国信积分服务费")
+	private BigDecimal gxRewardPointValue;
+
 	/**
 	 * 支付金额
 	 */

+ 34 - 1
src/main/java/org/springblade/modules/ldt/shop/controller/AppShopController.java

@@ -20,6 +20,9 @@ import org.springblade.modules.ldt.billrecord.service.IBillRecordService;
 import org.springblade.modules.ldt.member.entity.Member;
 import org.springblade.modules.ldt.member.service.IMemberService;
 import org.springblade.modules.ldt.member.vo.MemberVO;
+import org.springblade.modules.ldt.pointdetail.entity.PointDetail;
+import org.springblade.modules.ldt.pointdetail.service.IPointDetailService;
+import org.springblade.modules.ldt.pointdetail.vo.PointDetailVO;
 import org.springblade.modules.ldt.shop.entity.Shop;
 import org.springblade.modules.ldt.shop.service.IShopService;
 import org.springblade.modules.ldt.shop.vo.AppShopStaticVO;
@@ -45,6 +48,7 @@ public class AppShopController {
 	private final IActivityService activityService;
 	private final IMemberService memberService;
 	private final IBillRecordService billRecordService;
+	private final IPointDetailService pointDetailService;
 
 
 
@@ -112,6 +116,35 @@ public class AppShopController {
 		return R.data(pages);
 	}
 
+	/**
+	 * 应收明细
+	 */
+	@GetMapping("/getYingShouPage")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "应收明细", notes = "传入pointDetail")
+	public R<IPage<PointDetail>> getYingShouPage(PointDetail pointDetail, Query query) {
+		Assert.notNull(pointDetail.getShopId(),"商店id不能为空");
+		IPage<PointDetail> pages = pointDetailService.page(Condition.getPage(query),new QueryWrapper<>(new PointDetail()).lambda()
+			.eq(PointDetail::getShopId,pointDetail.getShopId())
+			.like(PointDetail::getCreateTime,pointDetail.getCreateTime()));
+		return R.data(pages);
+	}
+
+	/**
+	 * 余额明细
+	 */
+	@GetMapping("/getRemainDetailPage")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "通过商店id获取会员列表", notes = "传入billRecord")
+	public R<IPage<BillRecord>> getRemainDetailPage(BillRecord billRecord, Query query) {
+		Assert.notNull(billRecord.getShopId(),"商店id不能为空");
+		IPage<BillRecord> pages = billRecordService.page(Condition.getPage(query),new QueryWrapper<>(new BillRecord()).lambda()
+			.eq(BillRecord::getShopId,billRecord.getShopId()).eq(BillRecord::getPayStatus,1)
+			.like(BillRecord::getUpdateTime,billRecord.getUpdateTime()));
+
+		return R.data(pages);
+	}
+
 	/**
 	 * 商店首页获取统计数据
 	 *
@@ -141,7 +174,7 @@ public class AppShopController {
 		Date today = new Date();
 		//今日新增会员数
 		try {
-			Date todayDate = sdf.parse(today.toString());
+			Date todayDate = sdf.parse(sdf.format(today));
 			todayMemberIn = members.stream().filter(member -> member.getCreateTime().after(todayDate)).collect(Collectors.toList()).size();
 
 

+ 7 - 2
src/main/java/org/springblade/modules/ldt/shop/controller/ShopController.java

@@ -28,8 +28,11 @@ import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
 import org.springblade.core.tool.api.R;
 import org.springblade.core.tool.utils.Func;
+import org.springblade.modules.ldt.mall.service.IMallService;
+import org.springblade.modules.ldt.mallarea.service.IMallAreaService;
 import org.springblade.modules.ldt.mallshoplabel.entity.MallShopLabel;
 import org.springblade.modules.ldt.mallshoplabel.service.IMallShopLabelService;
+import org.springblade.modules.ldt.shop.wrapper.ShopWrapper;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.RequestParam;
 import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -52,6 +55,8 @@ public class ShopController extends BladeController {
 
 	private final IShopService shopService;
 	private final IMallShopLabelService mallShopLabelService;
+	private final IMallService mallService;
+	private final IMallAreaService mallAreaService;
 
 	/**
 	 * 详情
@@ -59,9 +64,9 @@ public class ShopController extends BladeController {
 	@GetMapping("/detail")
 	@ApiOperationSupport(order = 1)
 	@ApiOperation(value = "详情", notes = "传入shop")
-	public R<Shop> detail(Shop shop) {
+	public R<ShopVO> detail(Shop shop) {
 		Shop detail = shopService.getOne(Condition.getQueryWrapper(shop));
-		return R.data(detail);
+		return R.data(ShopWrapper.build(mallAreaService,mallService).entityVO(detail));
 	}
 
 	/**

+ 6 - 0
src/main/java/org/springblade/modules/ldt/shop/entity/Shop.java

@@ -246,4 +246,10 @@ public class Shop extends BaseEntity {
 	@ApiModelProperty(value = "提现密码")
 	private String withdrawPassword;
 
+	/**
+	 * 代理人id
+	 */
+	@ApiModelProperty(value = "代理人id")
+	private Long agenterId;
+
 }

+ 1 - 0
src/main/java/org/springblade/modules/ldt/shop/mapper/ShopMapper.xml

@@ -44,6 +44,7 @@
         <result column="audit_advice" property="auditAdvice"/>
         <result column="member_count" property="memberCount"/>
         <result column="total_point_value" property="totalPointValue"/>
+        <result column="agenter_id" property="agenterId"/>
     </resultMap>
 
 

+ 2 - 0
src/main/java/org/springblade/modules/ldt/shop/vo/ShopVO.java

@@ -35,4 +35,6 @@ public class ShopVO extends Shop {
 
 	private String mallAreaName;
 
+	private String mallName;
+
 }

+ 8 - 0
src/main/java/org/springblade/modules/ldt/shop/vo/yingshouVO.java

@@ -0,0 +1,8 @@
+package org.springblade.modules.ldt.shop.vo;
+
+import lombok.Data;
+
+/**
+ * Created By lidexi in 2021/8/8
+ **/
+

+ 11 - 3
src/main/java/org/springblade/modules/ldt/shop/wrapper/ShopWrapper.java

@@ -6,6 +6,8 @@ package org.springblade.modules.ldt.shop.wrapper;
 
 import org.springblade.core.mp.support.BaseEntityWrapper;
 import org.springblade.core.tool.utils.BeanUtil;
+import org.springblade.modules.ldt.mall.entity.Mall;
+import org.springblade.modules.ldt.mall.service.IMallService;
 import org.springblade.modules.ldt.mallarea.entity.MallArea;
 import org.springblade.modules.ldt.mallarea.service.IMallAreaService;
 import org.springblade.modules.ldt.mallshoplabel.service.IMallShopLabelService;
@@ -23,13 +25,15 @@ import java.util.Objects;
 public class ShopWrapper extends BaseEntityWrapper<Shop, ShopVO> {
 
 	private IMallAreaService mallAreaService;
+	private IMallService mallService;
 
-	private ShopWrapper(IMallAreaService mallAreaService){
+	private ShopWrapper(IMallAreaService mallAreaService,IMallService mallService){
 		this.mallAreaService = mallAreaService;
+		this.mallService = mallService;
 	}
 
-	public static ShopWrapper build(IMallAreaService mallAreaService) {
-		return new ShopWrapper(mallAreaService);
+	public static ShopWrapper build(IMallAreaService mallAreaService,IMallService mallService) {
+		return new ShopWrapper(mallAreaService,mallService);
 	}
 
 	@Override
@@ -39,6 +43,10 @@ public class ShopWrapper extends BaseEntityWrapper<Shop, ShopVO> {
 		if(mallArea != null){
 			shopVO.setMallAreaName(mallArea.getName());
 		}
+		Mall mall = mallService.getById(shop.getMallId());
+		if(mall != null){
+			shopVO.setMallName(mall.getName());
+		}
 
 		return shopVO;
 	}

+ 69 - 0
src/main/java/org/springblade/modules/ldt/statistic/controller/StaticController.java

@@ -0,0 +1,69 @@
+package org.springblade.modules.ldt.statistic.controller;
+
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.AllArgsConstructor;
+
+import org.springblade.core.tool.api.R;
+
+import org.springblade.modules.ldt.activity.service.IActivityService;
+import org.springblade.modules.ldt.agenter.entity.Agenter;
+import org.springblade.modules.ldt.agenter.service.IAgenterService;
+import org.springblade.modules.ldt.billrecord.service.IBillRecordService;
+
+import org.springblade.modules.ldt.loginuser.entity.LoginUser;
+import org.springblade.modules.ldt.loginuser.service.ILoginUserService;
+import org.springblade.modules.ldt.mall.entity.Mall;
+import org.springblade.modules.ldt.mall.service.IMallService;
+import org.springblade.modules.ldt.member.service.IMemberService;
+import org.springblade.modules.ldt.shop.entity.Shop;
+import org.springblade.modules.ldt.shop.service.IShopService;
+import org.springblade.modules.ldt.statistic.vo.StatisticVO;
+import org.springframework.web.bind.annotation.*;
+import sun.management.Agent;
+
+
+/**
+ * Created By lidexi in 2021/7/30
+ **/
+@RestController
+@AllArgsConstructor
+@RequestMapping("cyzh-static")
+@Api(value = "后台首页统计", tags = "后台首页统计")
+public class StaticController {
+
+	private final IMallService mallService;
+	private final IShopService shopService;
+	private final IAgenterService agenterService;
+	private final ILoginUserService loginUserService;
+
+
+
+	/**
+	 * 首页统计
+	 * @return
+	 */
+	@GetMapping("/staticAccountStatic")
+	@ApiOperation(value = "首页统计", notes = "首页统计")
+	public R<StatisticVO> staticAccountStatic() {
+
+		StatisticVO statisticVO = new StatisticVO();
+		//商场总数
+		Integer mallCount = mallService.getBaseMapper().selectCount(new QueryWrapper<>(new Mall()));
+		//商店总数
+		Integer shopCount = shopService.getBaseMapper().selectCount(new QueryWrapper<>(new Shop()));
+		//用户总数
+		Integer userCount = loginUserService.getBaseMapper().selectCount(new QueryWrapper<>(new LoginUser()));
+		//代理总数
+		Integer agenterCount = agenterService.getBaseMapper().selectCount(new QueryWrapper<>(new Agenter()));
+
+		return R.data(statisticVO.setAgenterCount(agenterCount)
+									.setMallCount(mallCount)
+									.setShopCount(shopCount)
+									.setUserCount(userCount));
+	}
+
+
+}

+ 27 - 0
src/main/java/org/springblade/modules/ldt/statistic/vo/StatisticVO.java

@@ -0,0 +1,27 @@
+package org.springblade.modules.ldt.statistic.vo;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Created By lidexi in 2021/8/6
+ **/
+@Data
+@Accessors(chain = true)
+public class StatisticVO {
+
+	@ApiModelProperty("商场总数")
+	private Integer mallCount;
+
+	@ApiModelProperty("商店总数")
+	private Integer shopCount;
+
+	@ApiModelProperty("用户总数")
+	private Integer userCount;
+
+	@ApiModelProperty("代理总数")
+	private Integer agenterCount;
+
+
+}

+ 1 - 1
src/main/java/org/springblade/modules/payment/plugin/Payment.java

@@ -16,7 +16,7 @@ import javax.servlet.http.HttpServletRequest;
  */
 public interface Payment {
 
-	String CALLBACK_DOMAIN = "http://192.168.1.48";
+	String CALLBACK_DOMAIN = "http://121.37.220.71:1890/api";
 
 	String CALLBACK_PREFIX = "/payment/callback/";
 	/**

+ 22 - 1
src/main/java/org/springblade/modules/payment/plugin/YeePayPlugin.java

@@ -2,6 +2,7 @@ package org.springblade.modules.payment.plugin;
 
 import cn.hutool.core.convert.Convert;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
 import lombok.extern.slf4j.Slf4j;
 import org.springblade.common.cache.PaymentCache;
 import org.springblade.common.enums.OrderType;
@@ -104,7 +105,7 @@ public class YeePayPlugin implements Payment {
 
 		log.info("易宝网关支付回调: map"+ JSON.toJSONString(request.getParameterMap()));
 
-		com.alibaba.fastjson.JSONObject jsonObject = yeePayService.deCodeNotifyData(request.getParameterMap().get("cipherText")[0]);
+		JSONObject jsonObject = yeePayService.deCodeNotifyData(request.getParameterMap().get("cipherText")[0]);
 		log.info("易宝网关支付解密回调密文:"+jsonObject.toJSONString());
 
 		SuccessParams successParams = PaymentCache.getSuccessParams(jsonObject.getString("orderId"));
@@ -120,5 +121,25 @@ public class YeePayPlugin implements Payment {
 		paymentService.success(successParams);
 	}
 
+	public static void main(String[] args) {
+		String s = "{\n" +
+			"    \"channelOrderId\":\"4200001123202108069046794860\",\n" +
+			"    \"orderId\":\"1423594166159466497\",\n" +
+			"    \"bankOrderId\":\"5955072001210806\",\n" +
+			"    \"paySuccessDate\":\"2021-08-06 18:38:19\",\n" +
+			"    \"channel\":\"WECHAT\",\n" +
+			"    \"payWay\":\"USER_SCAN\",\n" +
+			"    \"uniqueOrderNo\":\"1013202108060000002490940644\",\n" +
+			"    \"orderAmount\":\"0.10\",\n" +
+			"    \"payAmount\":\"0.10\",\n" +
+			"    \"payerInfo\":\"{\\\"bankCardNo\\\":\\\"\\\",\\\"bankId\\\":\\\"CFT\\\",\\\"cardType\\\":\\\"CFT\\\",\\\"mobilePhoneNo\\\":\\\"\\\",\\\"userID\\\":\\\"o19581JoLz7p2SjLLoQ6jBBLN7Ws\\\"}\",\n" +
+			"    \"realPayAmount\":\"0.10\",\n" +
+			"    \"parentMerchantNo\":\"10086062555\",\n" +
+			"    \"merchantNo\":\"10086062555\",\n" +
+			"    \"status\":\"SUCCESS\"\n" +
+			"}";
+		JSONObject jsonObject = JSON.parseObject(s);
+		System.out.println(jsonObject.getString("uniqueOrderNo"));
 
+	}
 }

+ 4 - 4
src/main/resources/application-prod.yml

@@ -5,18 +5,18 @@ spring:
     ##将docker脚本部署的redis服务映射为宿主机ip
     ##生产环境推荐使用阿里云高可用redis服务并设置密码
     host: 127.0.0.1
-    port: 6379
+    port: 9737
     password:
-    database: 0
+    database: 5
     ssl: false
     ##redis 集群环境配置
     #cluster:
     #  nodes: 127.0.0.1:7001,127.0.0.1:7002,127.0.0.1:7003
     #  commandTimeout: 5000
   datasource:
-    url: jdbc:mysql://localhost:3306/bladex_boot?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
+    url: jdbc:mysql://192.168.0.191:3306/guosen_tongdui?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true
     username: root
-    password: root
+    password: Gmtdb__b2b888
 
 #第三方登陆
 social:

+ 1 - 0
src/main/resources/application.yml

@@ -193,6 +193,7 @@ blade:
     #接口放行
     skip-url:
       - /blade-test/**
+      - /payment/callback/**
 #      - /cyzh-ldt/app/**
     #授权认证配置
     auth: