Browse Source

提现代码

master
主管理员 2 days ago
parent
commit
18301b754d
7 changed files with 69 additions and 18 deletions
  1. +1
    -1
      admin-hanhai-vue/.env.development
  2. +1
    -1
      admin-hanhai-vue/.env.production
  3. +15
    -15
      admin-hanhai-vue/src/views/cityMoneyLog/CityMoneyLogList.vue
  4. +4
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/YaoDuApiService.java
  5. +37
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuApiServiceImpl.java
  6. +10
    -0
      jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/YaoDuApiTokenController.java
  7. +1
    -1
      jeecg-boot-module-system/src/main/resources/application-dev.yml

+ 1
- 1
admin-hanhai-vue/.env.development View File

@ -1,5 +1,5 @@
NODE_ENV=development
VUE_APP_API_BASE_URL=http://localhost:8001/api/
VUE_APP_API_BASE_URL=http://localhost:8081/api/
VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview


+ 1
- 1
admin-hanhai-vue/.env.production View File

@ -1,4 +1,4 @@
NODE_ENV=production
VUE_APP_API_BASE_URL=http://localhost:8001/api/
VUE_APP_API_BASE_URL=http://localhost:8081/api/
VUE_APP_CAS_BASE_URL=http://localhost:8888/cas
VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview

+ 15
- 15
admin-hanhai-vue/src/views/cityMoneyLog/CityMoneyLogList.vue View File

@ -88,22 +88,22 @@
</template>
<span slot="action" slot-scope="text, record">
<a @click="handleEdit(record)">编辑</a>
<a @click="handleEdit(record)">提现审核</a>
<a-divider type="vertical" />
<a-dropdown>
<a class="ant-dropdown-link">更多 <a-icon type="down" /></a>
<a-menu slot="overlay">
<a-menu-item>
<a @click="handleDetail(record)">详情</a>
</a-menu-item>
<a-menu-item>
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
<a>删除</a>
</a-popconfirm>
</a-menu-item>
</a-menu>
</a-dropdown>
<!-- <a-divider type="vertical" />-->
<!-- <a-dropdown>-->
<!-- <a class="ant-dropdown-link">更多 <a-icon type="down" /></a>-->
<!-- <a-menu slot="overlay">-->
<!-- <a-menu-item>-->
<!-- <a @click="handleDetail(record)">详情</a>-->
<!-- </a-menu-item>-->
<!-- <a-menu-item>-->
<!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">-->
<!-- <a>删除</a>-->
<!-- </a-popconfirm>-->
<!-- </a-menu-item>-->
<!-- </a-menu>-->
<!-- </a-dropdown>-->
</span>
</a-table>


+ 4
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/YaoDuApiService.java View File

@ -10,6 +10,7 @@ import org.jeecg.modules.cityCat.entity.CityCat;
import org.jeecg.modules.cityComment.entity.CityComment;
import org.jeecg.modules.cityHome.entity.CityHome;
import org.jeecg.modules.cityJob.entity.CityJob;
import org.jeecg.modules.cityMoneyLog.entity.CityMoneyLog;
import org.jeecg.modules.cityShopping.entity.CityShopping;
import org.jeecg.modules.cityTrends.entity.CityTrends;
import org.jeecg.modules.hanHaiMember.entity.HanHaiMember;
@ -210,6 +211,9 @@ public interface YaoDuApiService {
Result<?> getWalletFlow(String token,PageBean pageBean);
//提现
Result<?> withdraw(String token, CityMoneyLog bean);
//根据商品查询店铺商品
Result<?> getGoodsList(String token,String shopId,PageBean pageBean);


+ 37
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/YaoDuApiServiceImpl.java View File

@ -1559,6 +1559,43 @@ public class YaoDuApiServiceImpl implements YaoDuApiService {
}
//提现
@Override
public Result<?> withdraw(String token, CityMoneyLog bean){
HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token);
if(bean.getPrice().compareTo(hanHaiMember.getPrice())>0){
return Result.error("余额不足");
}
//姓名不能为空
if(StringUtils.isEmpty(bean.getName())){
return Result.error("请填写姓名");
}
//金额不能为空
if(bean.getPrice().compareTo(new BigDecimal(0))<=0){
return Result.error("请填写金额");
}
//提现金额要为整数
if(bean.getPrice().scale()>0){
return Result.error("请填写整数金额");
}
//提现金额要大于1
if(bean.getPrice().compareTo(new BigDecimal(1))<=0){
return Result.error("请填写大于1的整数金额");
}
CityMoneyLog cityMoneyLog = new CityMoneyLog();
cityMoneyLog.setUserId(hanHaiMember.getId());
cityMoneyLog.setName(bean.getName());
cityMoneyLog.setPrice(bean.getPrice());
cityMoneyLog.setState(0);
cityMoneyLog.setType(0);
cityMoneyLog.setTitle("用户提现");
cityMoneyLog.setCreateTime(new Date());
cityMoneyLogService.save(cityMoneyLog);
hanHaiMember.setPrice(hanHaiMember.getPrice().subtract(bean.getPrice()));
hanHaiMemberService.updateById(hanHaiMember);
return Result.OK("提现成功,等待平台审核");
}
@Override
public Result<?> getGoodsList(String token,String shopId,PageBean pageBean){


+ 10
- 0
jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/yaoduapi/YaoDuApiTokenController.java View File

@ -13,6 +13,7 @@ import org.jeecg.modules.cityCat.entity.CityCat;
import org.jeecg.modules.cityComment.entity.CityComment;
import org.jeecg.modules.cityHome.entity.CityHome;
import org.jeecg.modules.cityJob.entity.CityJob;
import org.jeecg.modules.cityMoneyLog.entity.CityMoneyLog;
import org.jeecg.modules.cityShopping.entity.CityShopping;
import org.jeecg.modules.cityTrends.entity.CityTrends;
import org.jeecg.modules.hanHaiMember.entity.HanHaiMember;
@ -262,6 +263,15 @@ public class YaoDuApiTokenController {
}
//提现
@ApiOperation(value="提现")
@PostMapping("/withdraw")
public Result<?> withdraw(@RequestHeader("X-Access-Token") String token, CityMoneyLog bean){
return yaoDuApiService.withdraw(token,bean);
}
//查询商品信息列表根据关联店铺标识
@ApiOperation(value="查询商品信息列表根据关联店铺标识")
@GetMapping("/getGoodsList")


+ 1
- 1
jeecg-boot-module-system/src/main/resources/application-dev.yml View File

@ -1,5 +1,5 @@
server:
port: 8001
port: 8081
tomcat:
max-swallow-size: -1
error:


Loading…
Cancel
Save