init
This commit is contained in:
28
ct/pom.xml
Normal file
28
ct/pom.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
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">
|
||||
<parent>
|
||||
<artifactId>ruoyi-vue-plus</artifactId>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<version>4.8.1</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>ct</artifactId>
|
||||
|
||||
<description>
|
||||
CT
|
||||
</description>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- 通用工具-->
|
||||
<dependency>
|
||||
<groupId>com.ruoyi</groupId>
|
||||
<artifactId>ruoyi-common</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
138
ct/src/main/java/com/ruoyi/ct/controller/AgentAccountController.java
Executable file
138
ct/src/main/java/com/ruoyi/ct/controller/AgentAccountController.java
Executable file
@@ -0,0 +1,138 @@
|
||||
package com.ruoyi.ct.controller;
|
||||
|
||||
import java.security.KeyPair;
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import cn.hutool.crypto.SmUtil;
|
||||
import cn.hutool.crypto.asymmetric.SM2;
|
||||
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||
import com.ruoyi.ct.service.IAgentAccountGoodService;
|
||||
import com.ruoyi.ct.service.IGoodService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||
import com.ruoyi.ct.domain.bo.AgentAccountBo;
|
||||
import com.ruoyi.ct.service.IAgentAccountService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 代理商账号
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ct/agentAccount")
|
||||
public class AgentAccountController extends BaseController {
|
||||
|
||||
private final IAgentAccountService iAgentAccountService;
|
||||
private final IAgentAccountGoodService iAgentAccountGoodService;
|
||||
private final IGoodService iGoodService;
|
||||
|
||||
/**
|
||||
* 查询代理商账号列表
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccount:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<AgentAccountVo> list(AgentAccountBo bo, PageQuery pageQuery) {
|
||||
TableDataInfo<AgentAccountVo> result = iAgentAccountService.queryPageList(bo, pageQuery);
|
||||
for(AgentAccountVo vo: result.getRows()) {
|
||||
AgentAccountGoodBo agentAccountGoodBo = new AgentAccountGoodBo();
|
||||
agentAccountGoodBo.setAgentAccountId(vo.getId());
|
||||
List<AgentAccountGoodVo> agentAccountGoodVoList = iAgentAccountGoodService.queryList(agentAccountGoodBo);
|
||||
for (AgentAccountGoodVo agentAccountGoodVo: agentAccountGoodVoList){
|
||||
agentAccountGoodVo.setTitle(iGoodService.queryById(agentAccountGoodVo.getGoodId()).getName());
|
||||
}
|
||||
vo.setAgentAccountGoodVoList(agentAccountGoodVoList);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出代理商账号列表
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccount:export")
|
||||
@Log(title = "代理商账号", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(AgentAccountBo bo, HttpServletResponse response) {
|
||||
List<AgentAccountVo> list = iAgentAccountService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "代理商账号", AgentAccountVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取代理商账号详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccount:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<AgentAccountVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
AgentAccountVo vo = iAgentAccountService.queryById(id);
|
||||
AgentAccountGoodBo bo = new AgentAccountGoodBo();
|
||||
bo.setAgentAccountId(vo.getId());
|
||||
List<AgentAccountGoodVo> agentAccountGoodVoList = iAgentAccountGoodService.queryList(bo);
|
||||
vo.setAgentAccountGoodVoList(agentAccountGoodVoList);
|
||||
return R.ok(vo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理商账号
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccount:add")
|
||||
@Log(title = "代理商账号", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody AgentAccountBo bo) {
|
||||
// if (iAgentAccountService.checkPersonnelId(bo)) {
|
||||
// return R.fail("电信ID重复");
|
||||
// }
|
||||
return toAjax(iAgentAccountService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理商账号
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccount:edit")
|
||||
@Log(title = "代理商账号", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AgentAccountBo bo) {
|
||||
return toAjax(iAgentAccountService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理商账号
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccount:remove")
|
||||
@Log(title = "代理商账号", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iAgentAccountService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
114
ct/src/main/java/com/ruoyi/ct/controller/AgentAccountGoodController.java
Executable file
114
ct/src/main/java/com/ruoyi/ct/controller/AgentAccountGoodController.java
Executable file
@@ -0,0 +1,114 @@
|
||||
package com.ruoyi.ct.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||
import com.ruoyi.ct.service.IAgentAccountGoodService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 代理商商品
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ct/agentAccountGood")
|
||||
public class AgentAccountGoodController extends BaseController {
|
||||
|
||||
private final IAgentAccountGoodService iAgentAccountGoodService;
|
||||
|
||||
/**
|
||||
* 查询代理商商品列表
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccountGood:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<AgentAccountGoodVo> list(AgentAccountGoodBo bo, PageQuery pageQuery) {
|
||||
return iAgentAccountGoodService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出代理商商品列表
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccountGood:export")
|
||||
@Log(title = "代理商商品", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(AgentAccountGoodBo bo, HttpServletResponse response) {
|
||||
List<AgentAccountGoodVo> list = iAgentAccountGoodService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "代理商商品", AgentAccountGoodVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取代理商商品详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccountGood:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<AgentAccountGoodVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(iAgentAccountGoodService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理商商品
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccountGood:add")
|
||||
@Log(title = "代理商商品", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody AgentAccountGoodBo bo) {
|
||||
AgentAccountGoodBo agentAccountGoodBo = new AgentAccountGoodBo();
|
||||
agentAccountGoodBo.setAgentAccountId(bo.getAgentAccountId());
|
||||
agentAccountGoodBo.setGoodId(bo.getGoodId());
|
||||
if (iAgentAccountGoodService.queryList(agentAccountGoodBo).size() > 0) {
|
||||
return R.fail("已存在相同商品");
|
||||
}
|
||||
return toAjax(iAgentAccountGoodService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理商商品
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccountGood:edit")
|
||||
@Log(title = "代理商商品", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AgentAccountGoodBo bo) {
|
||||
return toAjax(iAgentAccountGoodService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理商商品
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccountGood:remove")
|
||||
@Log(title = "代理商商品", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iAgentAccountGoodService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
108
ct/src/main/java/com/ruoyi/ct/controller/AgentAccountGoodUserController.java
Executable file
108
ct/src/main/java/com/ruoyi/ct/controller/AgentAccountGoodUserController.java
Executable file
@@ -0,0 +1,108 @@
|
||||
package com.ruoyi.ct.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountGoodUserVo;
|
||||
import com.ruoyi.ct.domain.bo.AgentAccountGoodUserBo;
|
||||
import com.ruoyi.ct.service.IAgentAccountGoodUserService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 商品预制用户
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2024-03-13
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ct/agentAccountGoodUser")
|
||||
public class AgentAccountGoodUserController extends BaseController {
|
||||
|
||||
private final IAgentAccountGoodUserService iAgentAccountGoodUserService;
|
||||
|
||||
/**
|
||||
* 查询商品预制用户列表
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccountGoodUser:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<AgentAccountGoodUserVo> list(AgentAccountGoodUserBo bo, PageQuery pageQuery) {
|
||||
return iAgentAccountGoodUserService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出商品预制用户列表
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccountGoodUser:export")
|
||||
@Log(title = "商品预制用户", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(AgentAccountGoodUserBo bo, HttpServletResponse response) {
|
||||
List<AgentAccountGoodUserVo> list = iAgentAccountGoodUserService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "商品预制用户", AgentAccountGoodUserVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取商品预制用户详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccountGoodUser:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<AgentAccountGoodUserVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(iAgentAccountGoodUserService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品预制用户
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccountGoodUser:add")
|
||||
@Log(title = "商品预制用户", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody AgentAccountGoodUserBo bo) {
|
||||
return toAjax(iAgentAccountGoodUserService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品预制用户
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccountGoodUser:edit")
|
||||
@Log(title = "商品预制用户", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AgentAccountGoodUserBo bo) {
|
||||
return toAjax(iAgentAccountGoodUserService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品预制用户
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("ct:agentAccountGoodUser:remove")
|
||||
@Log(title = "商品预制用户", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iAgentAccountGoodUserService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
108
ct/src/main/java/com/ruoyi/ct/controller/AgentController.java
Executable file
108
ct/src/main/java/com/ruoyi/ct/controller/AgentController.java
Executable file
@@ -0,0 +1,108 @@
|
||||
package com.ruoyi.ct.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.ct.domain.vo.AgentVo;
|
||||
import com.ruoyi.ct.domain.bo.AgentBo;
|
||||
import com.ruoyi.ct.service.IAgentService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 代理商
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ct/agent")
|
||||
public class AgentController extends BaseController {
|
||||
|
||||
private final IAgentService iAgentService;
|
||||
|
||||
/**
|
||||
* 查询代理商列表
|
||||
*/
|
||||
@SaCheckPermission("ct:agent:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<AgentVo> list(AgentBo bo, PageQuery pageQuery) {
|
||||
return iAgentService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出代理商列表
|
||||
*/
|
||||
@SaCheckPermission("ct:agent:export")
|
||||
@Log(title = "代理商", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(AgentBo bo, HttpServletResponse response) {
|
||||
List<AgentVo> list = iAgentService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "代理商", AgentVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取代理商详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("ct:agent:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<AgentVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(iAgentService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理商
|
||||
*/
|
||||
@SaCheckPermission("ct:agent:add")
|
||||
@Log(title = "代理商", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody AgentBo bo) {
|
||||
return toAjax(iAgentService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理商
|
||||
*/
|
||||
@SaCheckPermission("ct:agent:edit")
|
||||
@Log(title = "代理商", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AgentBo bo) {
|
||||
return toAjax(iAgentService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除代理商
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("ct:agent:remove")
|
||||
@Log(title = "代理商", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iAgentService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
108
ct/src/main/java/com/ruoyi/ct/controller/AgentOrderController.java
Executable file
108
ct/src/main/java/com/ruoyi/ct/controller/AgentOrderController.java
Executable file
@@ -0,0 +1,108 @@
|
||||
package com.ruoyi.ct.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.ct.domain.vo.AgentOrderVo;
|
||||
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||
import com.ruoyi.ct.service.IAgentOrderService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 订单
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ct/agentOrder")
|
||||
public class AgentOrderController extends BaseController {
|
||||
|
||||
private final IAgentOrderService iAgentOrderService;
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
@SaCheckPermission("ct:agentOrder:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<AgentOrderVo> list(AgentOrderBo bo, PageQuery pageQuery) {
|
||||
return iAgentOrderService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出订单列表
|
||||
*/
|
||||
@SaCheckPermission("ct:agentOrder:export")
|
||||
@Log(title = "订单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(AgentOrderBo bo, HttpServletResponse response) {
|
||||
List<AgentOrderVo> list = iAgentOrderService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "订单", AgentOrderVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("ct:agentOrder:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<AgentOrderVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(iAgentOrderService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*/
|
||||
@SaCheckPermission("ct:agentOrder:add")
|
||||
@Log(title = "订单", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody AgentOrderBo bo) {
|
||||
return toAjax(iAgentOrderService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
@SaCheckPermission("ct:agentOrder:edit")
|
||||
@Log(title = "订单", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody AgentOrderBo bo) {
|
||||
return toAjax(iAgentOrderService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("ct:agentOrder:remove")
|
||||
@Log(title = "订单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iAgentOrderService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
108
ct/src/main/java/com/ruoyi/ct/controller/ApiLogController.java
Executable file
108
ct/src/main/java/com/ruoyi/ct/controller/ApiLogController.java
Executable file
@@ -0,0 +1,108 @@
|
||||
package com.ruoyi.ct.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.ct.domain.vo.ApiLogVo;
|
||||
import com.ruoyi.ct.domain.bo.ApiLogBo;
|
||||
import com.ruoyi.ct.service.IApiLogService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* API调用日志
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ct/apiLog")
|
||||
public class ApiLogController extends BaseController {
|
||||
|
||||
private final IApiLogService iApiLogService;
|
||||
|
||||
/**
|
||||
* 查询API调用日志列表
|
||||
*/
|
||||
@SaCheckPermission("ct:apiLog:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ApiLogVo> list(ApiLogBo bo, PageQuery pageQuery) {
|
||||
return iApiLogService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出API调用日志列表
|
||||
*/
|
||||
@SaCheckPermission("ct:apiLog:export")
|
||||
@Log(title = "API调用日志", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ApiLogBo bo, HttpServletResponse response) {
|
||||
List<ApiLogVo> list = iApiLogService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "API调用日志", ApiLogVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取API调用日志详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("ct:apiLog:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<ApiLogVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(iApiLogService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增API调用日志
|
||||
*/
|
||||
@SaCheckPermission("ct:apiLog:add")
|
||||
@Log(title = "API调用日志", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ApiLogBo bo) {
|
||||
return toAjax(iApiLogService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改API调用日志
|
||||
*/
|
||||
@SaCheckPermission("ct:apiLog:edit")
|
||||
@Log(title = "API调用日志", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ApiLogBo bo) {
|
||||
return toAjax(iApiLogService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除API调用日志
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("ct:apiLog:remove")
|
||||
@Log(title = "API调用日志", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iApiLogService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
108
ct/src/main/java/com/ruoyi/ct/controller/GoodController.java
Executable file
108
ct/src/main/java/com/ruoyi/ct/controller/GoodController.java
Executable file
@@ -0,0 +1,108 @@
|
||||
package com.ruoyi.ct.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.ruoyi.common.annotation.RepeatSubmit;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.ruoyi.common.core.domain.R;
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import com.ruoyi.common.core.validate.QueryGroup;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.ct.domain.vo.GoodVo;
|
||||
import com.ruoyi.ct.domain.bo.GoodBo;
|
||||
import com.ruoyi.ct.service.IGoodService;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 电信商品
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/ct/good")
|
||||
public class GoodController extends BaseController {
|
||||
|
||||
private final IGoodService iGoodService;
|
||||
|
||||
/**
|
||||
* 查询电信商品列表
|
||||
*/
|
||||
@SaCheckPermission("ct:good:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<GoodVo> list(GoodBo bo, PageQuery pageQuery) {
|
||||
return iGoodService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出电信商品列表
|
||||
*/
|
||||
@SaCheckPermission("ct:good:export")
|
||||
@Log(title = "电信商品", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(GoodBo bo, HttpServletResponse response) {
|
||||
List<GoodVo> list = iGoodService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "电信商品", GoodVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电信商品详细信息
|
||||
*
|
||||
* @param id 主键
|
||||
*/
|
||||
@SaCheckPermission("ct:good:query")
|
||||
@GetMapping("/{id}")
|
||||
public R<GoodVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long id) {
|
||||
return R.ok(iGoodService.queryById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电信商品
|
||||
*/
|
||||
@SaCheckPermission("ct:good:add")
|
||||
@Log(title = "电信商品", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody GoodBo bo) {
|
||||
return toAjax(iGoodService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电信商品
|
||||
*/
|
||||
@SaCheckPermission("ct:good:edit")
|
||||
@Log(title = "电信商品", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody GoodBo bo) {
|
||||
return toAjax(iGoodService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电信商品
|
||||
*
|
||||
* @param ids 主键串
|
||||
*/
|
||||
@SaCheckPermission("ct:good:remove")
|
||||
@Log(title = "电信商品", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] ids) {
|
||||
return toAjax(iGoodService.deleteWithValidByIds(Arrays.asList(ids), true));
|
||||
}
|
||||
}
|
||||
BIN
ct/src/main/java/com/ruoyi/ct/domain/.DS_Store
vendored
Normal file
BIN
ct/src/main/java/com/ruoyi/ct/domain/.DS_Store
vendored
Normal file
Binary file not shown.
48
ct/src/main/java/com/ruoyi/ct/domain/Agent.java
Executable file
48
ct/src/main/java/com/ruoyi/ct/domain/Agent.java
Executable file
@@ -0,0 +1,48 @@
|
||||
package com.ruoyi.ct.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 代理商对象 ct_agent
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ct_agent")
|
||||
public class Agent extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
88
ct/src/main/java/com/ruoyi/ct/domain/AgentAccount.java
Executable file
88
ct/src/main/java/com/ruoyi/ct/domain/AgentAccount.java
Executable file
@@ -0,0 +1,88 @@
|
||||
package com.ruoyi.ct.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 代理商账号对象 ct_agent_account
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ct_agent_account")
|
||||
public class AgentAccount extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long agentId;
|
||||
/**
|
||||
* 代理商名称
|
||||
*/
|
||||
private String agentName;
|
||||
/**
|
||||
* 电信ID
|
||||
*/
|
||||
private String personnelId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String appId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String appSecret;
|
||||
/**
|
||||
* IP白名单
|
||||
*/
|
||||
private String ipList;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String verifyUrl;
|
||||
/**
|
||||
* 平台公钥
|
||||
*/
|
||||
private String platformPublicKey;
|
||||
/**
|
||||
* 平台私钥
|
||||
*/
|
||||
private String platformPrivateKey;
|
||||
/**
|
||||
* 代理商公钥
|
||||
*/
|
||||
private String agentPublicKey;
|
||||
/**
|
||||
* 代理商私钥
|
||||
*/
|
||||
private String agentPrivateKey;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
66
ct/src/main/java/com/ruoyi/ct/domain/AgentAccountGood.java
Executable file
66
ct/src/main/java/com/ruoyi/ct/domain/AgentAccountGood.java
Executable file
@@ -0,0 +1,66 @@
|
||||
package com.ruoyi.ct.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 代理商商品对象 ct_agent_account_good
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ct_agent_account_good")
|
||||
public class AgentAccountGood extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long agentId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long agentAccountId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String personnelId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long goodId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String saleId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
private Integer isNeedVerify;
|
||||
private Integer registerCount;
|
||||
private Integer completeCount;
|
||||
private Integer waitCount;
|
||||
private Integer verifyCount;
|
||||
private Integer verifiedCount;
|
||||
private String tmpPassword;
|
||||
private String images;
|
||||
private String imageIds;
|
||||
private String remark;
|
||||
}
|
||||
74
ct/src/main/java/com/ruoyi/ct/domain/AgentAccountGoodUser.java
Executable file
74
ct/src/main/java/com/ruoyi/ct/domain/AgentAccountGoodUser.java
Executable file
@@ -0,0 +1,74 @@
|
||||
package com.ruoyi.ct.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 商品预制用户对象 ct_agent_account_good_user
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2024-03-13
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ct_agent_account_good_user")
|
||||
public class AgentAccountGoodUser extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long agentAccountGoodId;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
private String idCardNo;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String mobile;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date createTime;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date updateTime;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
178
ct/src/main/java/com/ruoyi/ct/domain/AgentOrder.java
Executable file
178
ct/src/main/java/com/ruoyi/ct/domain/AgentOrder.java
Executable file
@@ -0,0 +1,178 @@
|
||||
package com.ruoyi.ct.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 订单对象 ct_agent_order
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ct_agent_order")
|
||||
public class AgentOrder extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 代理商ID
|
||||
*/
|
||||
private Long agentId;
|
||||
/**
|
||||
* 代理商名称
|
||||
*/
|
||||
private String agentName;
|
||||
/**
|
||||
* 代理商账号ID
|
||||
*/
|
||||
private Long agentAccountId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String saleId;
|
||||
private String title;
|
||||
private String content;
|
||||
/**
|
||||
* 厅店ID,默认13
|
||||
*/
|
||||
private String storeId;
|
||||
/**
|
||||
* 代理商电信ID
|
||||
*/
|
||||
private String personnelId;
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 用户身份证号
|
||||
*/
|
||||
private String idCard;
|
||||
/**
|
||||
* 用户联系电话
|
||||
*/
|
||||
private String contactMobile;
|
||||
/**
|
||||
* 收货地址
|
||||
*/
|
||||
private String installedAddress;
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
private String province;
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
private String city;
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
private String county;
|
||||
/**
|
||||
* 下单流水号
|
||||
*/
|
||||
private String serialNumber;
|
||||
/**
|
||||
* 入网号码
|
||||
*/
|
||||
private String number;
|
||||
/**
|
||||
* 物流备注
|
||||
*/
|
||||
private String logiRemark;
|
||||
/**
|
||||
* 业务办理页面url
|
||||
*/
|
||||
private String pageUrl;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 宽带安装地址
|
||||
*/
|
||||
private String installAddress;
|
||||
/**
|
||||
* 第二发展人工号
|
||||
*/
|
||||
private String ynumber2;
|
||||
/**
|
||||
* 上传过的站牌类型,逗号分隔
|
||||
*/
|
||||
private String images;
|
||||
/**
|
||||
* 电信订单号
|
||||
*/
|
||||
private String orderNum;
|
||||
/**
|
||||
* 电信订单状态
|
||||
*/
|
||||
private String orderStatus;
|
||||
/**
|
||||
* 平台订单状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 快递单号
|
||||
*/
|
||||
private String expressNum;
|
||||
/**
|
||||
* 快递公司
|
||||
*/
|
||||
private String expressVendor;
|
||||
/**
|
||||
* 物流信息
|
||||
*/
|
||||
private String expressRoutes;
|
||||
/**
|
||||
* 物流状态码
|
||||
*/
|
||||
private String statusCd;
|
||||
/**
|
||||
* 订单路由信息
|
||||
*/
|
||||
private String routeArr;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* 是否首冲
|
||||
*/
|
||||
private Integer isRecharge;
|
||||
|
||||
/**
|
||||
* 首冲名称
|
||||
*/
|
||||
private String chargeTitle;
|
||||
|
||||
private Integer orderType;
|
||||
|
||||
private String apiVersion;
|
||||
|
||||
private Integer isExpress;
|
||||
|
||||
private Integer idCardFront;
|
||||
|
||||
private Integer idCardBack;
|
||||
|
||||
private Integer frontFace;
|
||||
|
||||
private String uploadMsgId;
|
||||
|
||||
}
|
||||
67
ct/src/main/java/com/ruoyi/ct/domain/ApiLog.java
Executable file
67
ct/src/main/java/com/ruoyi/ct/domain/ApiLog.java
Executable file
@@ -0,0 +1,67 @@
|
||||
package com.ruoyi.ct.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* API调用日志对象 ct_api_log
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ct_api_log")
|
||||
public class ApiLog extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String personnelId;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String url;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String requestBody;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String requestHeader;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long isSuccess;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String errorMsg;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String response;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String ip;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
56
ct/src/main/java/com/ruoyi/ct/domain/Good.java
Executable file
56
ct/src/main/java/com/ruoyi/ct/domain/Good.java
Executable file
@@ -0,0 +1,56 @@
|
||||
package com.ruoyi.ct.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 电信商品对象 ct_good
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("ct_good")
|
||||
public class Good extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String saleId;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@TableLogic
|
||||
private String delFlag;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
}
|
||||
98
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentAccountBo.java
Executable file
98
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentAccountBo.java
Executable file
@@ -0,0 +1,98 @@
|
||||
package com.ruoyi.ct.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 代理商账号业务对象 ct_agent_account
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AgentAccountBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long agentId;
|
||||
|
||||
/**
|
||||
* 代理商名称
|
||||
*/
|
||||
private String agentName;
|
||||
|
||||
/**
|
||||
* 电信ID
|
||||
*/
|
||||
private String personnelId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String appSecret;
|
||||
|
||||
/**
|
||||
* IP白名单
|
||||
*/
|
||||
private String ipList;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String verifyUrl;
|
||||
|
||||
/**
|
||||
* 平台公钥
|
||||
*/
|
||||
private String platformPublicKey;
|
||||
|
||||
/**
|
||||
* 平台私钥
|
||||
*/
|
||||
private String platformPrivateKey;
|
||||
|
||||
/**
|
||||
* 代理商公钥
|
||||
*/
|
||||
private String agentPublicKey;
|
||||
|
||||
/**
|
||||
* 代理商私钥
|
||||
*/
|
||||
private String agentPrivateKey;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
private List<Long> goodsIds;
|
||||
}
|
||||
69
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentAccountGoodBo.java
Executable file
69
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentAccountGoodBo.java
Executable file
@@ -0,0 +1,69 @@
|
||||
package com.ruoyi.ct.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 代理商商品业务对象 ct_agent_account_good
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AgentAccountGoodBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long agentId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long agentAccountId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String personnelId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long goodId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String saleId;
|
||||
|
||||
private Integer isNeedVerify;
|
||||
private Integer registerCount;
|
||||
private Integer completeCount;
|
||||
private Integer waitCount;
|
||||
private Integer verifyCount;
|
||||
private Integer verifiedCount;
|
||||
private String tmpPassword;
|
||||
private String images;
|
||||
private String imageIds;
|
||||
private String remark;
|
||||
|
||||
}
|
||||
55
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentAccountGoodUserBo.java
Executable file
55
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentAccountGoodUserBo.java
Executable file
@@ -0,0 +1,55 @@
|
||||
package com.ruoyi.ct.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 商品预制用户业务对象 ct_agent_account_good_user
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2024-03-13
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AgentAccountGoodUserBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long agentAccountGoodId;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
@NotBlank(message = "身份证号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String idCardNo;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@NotBlank(message = "手机号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String mobile;
|
||||
}
|
||||
47
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentBo.java
Executable file
47
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentBo.java
Executable file
@@ -0,0 +1,47 @@
|
||||
package com.ruoyi.ct.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 代理商业务对象 ct_agent
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AgentBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@NotBlank(message = "名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
218
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentOrderBo.java
Executable file
218
ct/src/main/java/com/ruoyi/ct/domain/bo/AgentOrderBo.java
Executable file
@@ -0,0 +1,218 @@
|
||||
package com.ruoyi.ct.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 订单业务对象 ct_agent_order
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class AgentOrderBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 代理商ID
|
||||
*/
|
||||
@NotNull(message = "代理商ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long agentId;
|
||||
|
||||
/**
|
||||
* 代理商名称
|
||||
*/
|
||||
@NotBlank(message = "代理商名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String agentName;
|
||||
|
||||
/**
|
||||
* 代理商账号ID
|
||||
*/
|
||||
@NotNull(message = "代理商账号ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long agentAccountId;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
@NotBlank(message = "商品ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String saleId;
|
||||
private String title;
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 厅店ID,默认13
|
||||
*/
|
||||
@NotBlank(message = "厅店ID,默认13不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String storeId;
|
||||
|
||||
/**
|
||||
* 代理商电信ID
|
||||
*/
|
||||
@NotBlank(message = "代理商电信ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String personnelId;
|
||||
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
@NotBlank(message = "姓名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 用户身份证号
|
||||
*/
|
||||
@NotBlank(message = "身份证号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@Pattern(regexp = "([1-9]\\d{5})(19\\d{2}|20\\d{2})(0[1-9]|1[0-2])(0[1-9]|[1-2]\\d|3[0-1])\\d{3}([0-9]|X|x)", message = "身份证号码错误", groups = { AddGroup.class, EditGroup.class })
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 用户联系电话
|
||||
*/
|
||||
@NotBlank(message = "联系电话不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
@Pattern(regexp = "1[3-9]\\d{9}", message = "联系电话错误", groups = { AddGroup.class, EditGroup.class })
|
||||
private String contactMobile;
|
||||
|
||||
/**
|
||||
* 收货地址
|
||||
*/
|
||||
@NotBlank(message = "收货地址不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String installedAddress;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
@NotBlank(message = "省不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
@NotBlank(message = "市不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
@NotBlank(message = "区不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String county;
|
||||
|
||||
/**
|
||||
* 下单流水号
|
||||
*/
|
||||
@NotBlank(message = "下单流水号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String serialNumber;
|
||||
|
||||
/**
|
||||
* 入网号码
|
||||
*/
|
||||
@NotBlank(message = "入网号码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String number;
|
||||
|
||||
/**
|
||||
* 物流备注
|
||||
*/
|
||||
private String logiRemark;
|
||||
|
||||
/**
|
||||
* 业务办理页面url
|
||||
*/
|
||||
@NotBlank(message = "业务办理页面url不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String pageUrl;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 宽带安装地址
|
||||
*/
|
||||
private String installAddress;
|
||||
|
||||
/**
|
||||
* 第二发展人工号
|
||||
*/
|
||||
private String ynumber2;
|
||||
|
||||
/**
|
||||
* 上传过的站牌类型,逗号分隔
|
||||
*/
|
||||
private String images;
|
||||
|
||||
/**
|
||||
* 电信订单号
|
||||
*/
|
||||
private String orderNum;
|
||||
|
||||
/**
|
||||
* 电信订单状态
|
||||
*/
|
||||
private String orderStatus;
|
||||
|
||||
/**
|
||||
* 平台订单状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 快递单号
|
||||
*/
|
||||
private String expressNum;
|
||||
|
||||
/**
|
||||
* 快递公司
|
||||
*/
|
||||
private String expressVendor;
|
||||
|
||||
/**
|
||||
* 物流信息
|
||||
*/
|
||||
private String expressRoutes;
|
||||
|
||||
/**
|
||||
* 物流状态码
|
||||
*/
|
||||
private String statusCd;
|
||||
|
||||
/**
|
||||
* 订单路由信息
|
||||
*/
|
||||
private String routeArr;
|
||||
|
||||
/**
|
||||
* 是否首冲
|
||||
*/
|
||||
private Integer isRecharge;
|
||||
|
||||
/**
|
||||
* 首冲名称
|
||||
*/
|
||||
private String chargeTitle;
|
||||
|
||||
private Integer orderType;
|
||||
|
||||
private String apiVersion;
|
||||
|
||||
private Integer isExpress;
|
||||
|
||||
private Integer idCardFront;
|
||||
|
||||
private Integer idCardBack;
|
||||
|
||||
private Integer frontFace;
|
||||
|
||||
private String uploadMsgId;
|
||||
}
|
||||
85
ct/src/main/java/com/ruoyi/ct/domain/bo/ApiLogBo.java
Executable file
85
ct/src/main/java/com/ruoyi/ct/domain/bo/ApiLogBo.java
Executable file
@@ -0,0 +1,85 @@
|
||||
package com.ruoyi.ct.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* API调用日志业务对象 ct_api_log
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ApiLogBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String personnelId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String url;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String requestBody;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String requestHeader;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long isSuccess;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String errorMsg;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String response;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
58
ct/src/main/java/com/ruoyi/ct/domain/bo/GoodBo.java
Executable file
58
ct/src/main/java/com/ruoyi/ct/domain/bo/GoodBo.java
Executable file
@@ -0,0 +1,58 @@
|
||||
package com.ruoyi.ct.domain.bo;
|
||||
|
||||
import com.ruoyi.common.core.validate.AddGroup;
|
||||
import com.ruoyi.common.core.validate.EditGroup;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 电信商品业务对象 ct_good
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class GoodBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotNull(message = "不能为空", groups = { EditGroup.class })
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@NotBlank(message = "名称不能为空", groups = { AddGroup.class })
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
private String content;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@NotBlank(message = "不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String saleId;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
87
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentAccountGoodUserVo.java
Executable file
87
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentAccountGoodUserVo.java
Executable file
@@ -0,0 +1,87 @@
|
||||
package com.ruoyi.ct.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 商品预制用户视图对象 ct_agent_account_good_user
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2024-03-13
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AgentAccountGoodUserVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long agentAccountGoodId;
|
||||
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@ExcelProperty(value = "姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 身份证号
|
||||
*/
|
||||
@ExcelProperty(value = "身份证号")
|
||||
private String idCardNo;
|
||||
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
@ExcelProperty(value = "手机号")
|
||||
private String mobile;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
77
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentAccountGoodVo.java
Executable file
77
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentAccountGoodVo.java
Executable file
@@ -0,0 +1,77 @@
|
||||
package com.ruoyi.ct.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 代理商商品视图对象 ct_agent_account_good
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AgentAccountGoodVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long agentId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long agentAccountId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String personnelId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long goodId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String saleId;
|
||||
|
||||
private String title;
|
||||
|
||||
private String content;
|
||||
|
||||
private Long gid;
|
||||
|
||||
private Integer isNeedVerify;
|
||||
private Integer registerCount;
|
||||
private Integer completeCount;
|
||||
private Integer waitCount;
|
||||
private Integer verifyCount;
|
||||
private Integer verifiedCount;
|
||||
private String tmpPassword;
|
||||
private String images;
|
||||
private String imageIds;
|
||||
private String remark;
|
||||
|
||||
}
|
||||
136
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentAccountVo.java
Executable file
136
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentAccountVo.java
Executable file
@@ -0,0 +1,136 @@
|
||||
package com.ruoyi.ct.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理商账号视图对象 ct_agent_account
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AgentAccountVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long agentId;
|
||||
|
||||
/**
|
||||
* 代理商名称
|
||||
*/
|
||||
@ExcelProperty(value = "代理商名称")
|
||||
private String agentName;
|
||||
|
||||
/**
|
||||
* 电信ID
|
||||
*/
|
||||
@ExcelProperty(value = "电信ID")
|
||||
private String personnelId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String appId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String appSecret;
|
||||
|
||||
/**
|
||||
* IP白名单
|
||||
*/
|
||||
@ExcelProperty(value = "IP白名单")
|
||||
private String ipList;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String verifyUrl;
|
||||
|
||||
/**
|
||||
* 平台公钥
|
||||
*/
|
||||
@ExcelProperty(value = "平台公钥")
|
||||
private String platformPublicKey;
|
||||
|
||||
/**
|
||||
* 平台私钥
|
||||
*/
|
||||
@ExcelProperty(value = "平台私钥")
|
||||
private String platformPrivateKey;
|
||||
|
||||
/**
|
||||
* 代理商公钥
|
||||
*/
|
||||
@ExcelProperty(value = "代理商公钥")
|
||||
private String agentPublicKey;
|
||||
|
||||
/**
|
||||
* 代理商私钥
|
||||
*/
|
||||
@ExcelProperty(value = "代理商私钥")
|
||||
private String agentPrivateKey;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ExcelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String remark;
|
||||
|
||||
private List<AgentAccountGoodVo> agentAccountGoodVoList;
|
||||
|
||||
|
||||
}
|
||||
251
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentOrderVo.java
Executable file
251
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentOrderVo.java
Executable file
@@ -0,0 +1,251 @@
|
||||
package com.ruoyi.ct.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 订单视图对象 ct_agent_order
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AgentOrderVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "id")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 代理商ID
|
||||
*/
|
||||
@ExcelProperty(value = "代理商ID")
|
||||
private Long agentId;
|
||||
|
||||
/**
|
||||
* 代理商名称
|
||||
*/
|
||||
@ExcelProperty(value = "代理商名称")
|
||||
private String agentName;
|
||||
|
||||
/**
|
||||
* 代理商账号ID
|
||||
*/
|
||||
@ExcelProperty(value = "代理商账号ID")
|
||||
private Long agentAccountId;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
@ExcelProperty(value = "商品ID")
|
||||
private String saleId;
|
||||
|
||||
@ExcelProperty(value = "商品名称")
|
||||
private String title;
|
||||
@ExcelProperty(value = "商品介绍")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 厅店ID,默认13
|
||||
*/
|
||||
@ExcelProperty(value = "厅店ID,默认13")
|
||||
private String storeId;
|
||||
|
||||
/**
|
||||
* 代理商电信ID
|
||||
*/
|
||||
@ExcelProperty(value = "代理商电信ID")
|
||||
private String personnelId;
|
||||
|
||||
/**
|
||||
* 用户姓名
|
||||
*/
|
||||
@ExcelProperty(value = "用户姓名")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 用户身份证号
|
||||
*/
|
||||
@ExcelProperty(value = "用户身份证号")
|
||||
private String idCard;
|
||||
|
||||
/**
|
||||
* 用户联系电话
|
||||
*/
|
||||
@ExcelProperty(value = "用户联系电话")
|
||||
private String contactMobile;
|
||||
|
||||
/**
|
||||
* 收货地址
|
||||
*/
|
||||
@ExcelProperty(value = "收货地址")
|
||||
private String installedAddress;
|
||||
|
||||
/**
|
||||
* 省
|
||||
*/
|
||||
@ExcelProperty(value = "省")
|
||||
private String province;
|
||||
|
||||
/**
|
||||
* 市
|
||||
*/
|
||||
@ExcelProperty(value = "市")
|
||||
private String city;
|
||||
|
||||
/**
|
||||
* 区
|
||||
*/
|
||||
@ExcelProperty(value = "区")
|
||||
private String county;
|
||||
|
||||
/**
|
||||
* 下单流水号
|
||||
*/
|
||||
@ExcelProperty(value = "下单流水号")
|
||||
private String serialNumber;
|
||||
|
||||
/**
|
||||
* 入网号码
|
||||
*/
|
||||
@ExcelProperty(value = "入网号码")
|
||||
private String number;
|
||||
|
||||
/**
|
||||
* 物流备注
|
||||
*/
|
||||
@ExcelProperty(value = "物流备注")
|
||||
private String logiRemark;
|
||||
|
||||
/**
|
||||
* 业务办理页面url
|
||||
*/
|
||||
@ExcelProperty(value = "业务办理页面url")
|
||||
private String pageUrl;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@ExcelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 宽带安装地址
|
||||
*/
|
||||
@ExcelProperty(value = "宽带安装地址")
|
||||
private String installAddress;
|
||||
|
||||
/**
|
||||
* 第二发展人工号
|
||||
*/
|
||||
@ExcelProperty(value = "第二发展人工号")
|
||||
private String ynumber2;
|
||||
|
||||
/**
|
||||
* 上传过的站牌类型,逗号分隔
|
||||
*/
|
||||
@ExcelProperty(value = "上传过的站牌类型,逗号分隔")
|
||||
private String images;
|
||||
|
||||
/**
|
||||
* 电信订单号
|
||||
*/
|
||||
@ExcelProperty(value = "电信订单号")
|
||||
private String orderNum;
|
||||
|
||||
/**
|
||||
* 电信订单状态
|
||||
*/
|
||||
@ExcelProperty(value = "电信订单状态")
|
||||
private String orderStatus;
|
||||
|
||||
/**
|
||||
* 平台订单状态
|
||||
*/
|
||||
@ExcelProperty(value = "平台订单状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 快递单号
|
||||
*/
|
||||
@ExcelProperty(value = "快递单号")
|
||||
private String expressNum;
|
||||
|
||||
/**
|
||||
* 快递公司
|
||||
*/
|
||||
@ExcelProperty(value = "快递公司")
|
||||
private String expressVendor;
|
||||
|
||||
/**
|
||||
* 物流信息
|
||||
*/
|
||||
@ExcelProperty(value = "物流信息")
|
||||
private String expressRoutes;
|
||||
|
||||
/**
|
||||
* 物流状态码
|
||||
*/
|
||||
@ExcelProperty(value = "物流状态码")
|
||||
private String statusCd;
|
||||
|
||||
/**
|
||||
* 订单路由信息
|
||||
*/
|
||||
@ExcelProperty(value = "订单路由信息")
|
||||
private String routeArr;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "下单时间")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "订单更新时间")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 是否首冲
|
||||
*/
|
||||
@ExcelProperty(value = "是否首冲")
|
||||
private Integer isRecharge;
|
||||
|
||||
/**
|
||||
* 首冲名称
|
||||
*/
|
||||
@ExcelProperty(value = "首冲业务名称")
|
||||
private String chargeTitle;
|
||||
@ExcelProperty(value = "下单类型,0:api,1:h5")
|
||||
private Integer orderType;
|
||||
|
||||
@ExcelProperty(value = "API版本")
|
||||
private String apiVersion;
|
||||
|
||||
@ExcelProperty(value = "是否配送")
|
||||
private Integer isExpress;
|
||||
|
||||
@ExcelProperty(value = "身份证正面是否上传")
|
||||
private Integer idCardFront;
|
||||
|
||||
@ExcelProperty(value = "身份证北面是否上传")
|
||||
private Integer idCardBack;
|
||||
|
||||
@ExcelProperty(value = "正面免冠照是否上传")
|
||||
private Integer frontFace;
|
||||
|
||||
private String uploadMsgId;
|
||||
}
|
||||
73
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentVo.java
Executable file
73
ct/src/main/java/com/ruoyi/ct/domain/vo/AgentVo.java
Executable file
@@ -0,0 +1,73 @@
|
||||
package com.ruoyi.ct.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 代理商视图对象 ct_agent
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AgentVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ExcelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ExcelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
91
ct/src/main/java/com/ruoyi/ct/domain/vo/ApiLogVo.java
Executable file
91
ct/src/main/java/com/ruoyi/ct/domain/vo/ApiLogVo.java
Executable file
@@ -0,0 +1,91 @@
|
||||
package com.ruoyi.ct.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* API调用日志视图对象 ct_api_log
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ApiLogVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String personnelId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String url;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String requestBody;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String requestHeader;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long isSuccess;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String errorMsg;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String response;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String ip;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
85
ct/src/main/java/com/ruoyi/ct/domain/vo/GoodVo.java
Executable file
85
ct/src/main/java/com/ruoyi/ct/domain/vo/GoodVo.java
Executable file
@@ -0,0 +1,85 @@
|
||||
package com.ruoyi.ct.domain.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.ruoyi.common.annotation.ExcelDictFormat;
|
||||
import com.ruoyi.common.convert.ExcelDictConvert;
|
||||
import lombok.Data;
|
||||
import java.util.Date;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 电信商品视图对象 ct_good
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class GoodVo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@ExcelProperty(value = "名称")
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品描述
|
||||
*/
|
||||
@ExcelProperty(value = "商品描述")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String saleId;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@ExcelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ExcelProperty(value = "")
|
||||
private String remark;
|
||||
|
||||
|
||||
}
|
||||
40
ct/src/main/java/com/ruoyi/ct/mapper/AgentAccountGoodMapper.java
Executable file
40
ct/src/main/java/com/ruoyi/ct/mapper/AgentAccountGoodMapper.java
Executable file
@@ -0,0 +1,40 @@
|
||||
package com.ruoyi.ct.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.ct.domain.AgentAccountGood;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理商商品Mapper接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface AgentAccountGoodMapper extends BaseMapperPlus<AgentAccountGoodMapper, AgentAccountGood, AgentAccountGoodVo> {
|
||||
|
||||
@Select("select a.sale_id as sale_id, cg.name as title, cg.content as content\n" +
|
||||
"from ct_agent_account_good a\n" +
|
||||
" left join ct_good cg on a.good_id = cg.id\n" +
|
||||
"where a.del_flag = '0'\n" +
|
||||
" and cg.del_flag = '0'\n" +
|
||||
" and cg.status = 1\n" +
|
||||
" and a.agent_account_id = #{agentAccountId}")
|
||||
List<AgentAccountGoodVo> selectListFotAPI(IPage<AgentAccountGoodVo> page, @Param("agentAccountId") Long agentAccountId);
|
||||
|
||||
@Select("select a.*, cg.name as title, cg.content as content\n" +
|
||||
"from ct_agent_account_good a\n" +
|
||||
" left join ct_good cg on a.good_id = cg.id\n" +
|
||||
"where a.del_flag = '0'\n" +
|
||||
" and cg.del_flag = '0'\n" +
|
||||
" and cg.status = 1\n" +
|
||||
" and a.sale_id = #{saleId} and a.agent_account_id = #{agentAccountId} limit 1")
|
||||
AgentAccountGoodVo getByGoodAndAccount(@Param("saleId") String saleId, @Param("agentAccountId") Long agentAccountId);
|
||||
}
|
||||
15
ct/src/main/java/com/ruoyi/ct/mapper/AgentAccountGoodUserMapper.java
Executable file
15
ct/src/main/java/com/ruoyi/ct/mapper/AgentAccountGoodUserMapper.java
Executable file
@@ -0,0 +1,15 @@
|
||||
package com.ruoyi.ct.mapper;
|
||||
|
||||
import com.ruoyi.ct.domain.AgentAccountGoodUser;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountGoodUserVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 商品预制用户Mapper接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2024-03-13
|
||||
*/
|
||||
public interface AgentAccountGoodUserMapper extends BaseMapperPlus<AgentAccountGoodUserMapper, AgentAccountGoodUser, AgentAccountGoodUserVo> {
|
||||
|
||||
}
|
||||
25
ct/src/main/java/com/ruoyi/ct/mapper/AgentAccountMapper.java
Executable file
25
ct/src/main/java/com/ruoyi/ct/mapper/AgentAccountMapper.java
Executable file
@@ -0,0 +1,25 @@
|
||||
package com.ruoyi.ct.mapper;
|
||||
|
||||
import com.ruoyi.ct.domain.AgentAccount;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* 代理商账号Mapper接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface AgentAccountMapper extends BaseMapperPlus<AgentAccountMapper, AgentAccount, AgentAccountVo> {
|
||||
|
||||
@Select("select a.*\n" +
|
||||
" from ct_agent_account as a\n" +
|
||||
" left join ct_agent ca on a.agent_id = ca.id\n" +
|
||||
" where a.del_flag='0' and ca.del_flag='0'\n" +
|
||||
" and a.status='1' and ca.status='1'\n" +
|
||||
" and a.app_id=#{appId} limit 1")
|
||||
AgentAccountVo getByAppId(String appId);
|
||||
}
|
||||
17
ct/src/main/java/com/ruoyi/ct/mapper/AgentMapper.java
Executable file
17
ct/src/main/java/com/ruoyi/ct/mapper/AgentMapper.java
Executable file
@@ -0,0 +1,17 @@
|
||||
package com.ruoyi.ct.mapper;
|
||||
|
||||
import com.ruoyi.ct.domain.Agent;
|
||||
import com.ruoyi.ct.domain.vo.AgentVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 代理商Mapper接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface AgentMapper extends BaseMapperPlus<AgentMapper, Agent, AgentVo> {
|
||||
|
||||
}
|
||||
17
ct/src/main/java/com/ruoyi/ct/mapper/AgentOrderMapper.java
Executable file
17
ct/src/main/java/com/ruoyi/ct/mapper/AgentOrderMapper.java
Executable file
@@ -0,0 +1,17 @@
|
||||
package com.ruoyi.ct.mapper;
|
||||
|
||||
import com.ruoyi.ct.domain.AgentOrder;
|
||||
import com.ruoyi.ct.domain.vo.AgentOrderVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 订单Mapper接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface AgentOrderMapper extends BaseMapperPlus<AgentOrderMapper, AgentOrder, AgentOrderVo> {
|
||||
|
||||
}
|
||||
17
ct/src/main/java/com/ruoyi/ct/mapper/ApiLogMapper.java
Executable file
17
ct/src/main/java/com/ruoyi/ct/mapper/ApiLogMapper.java
Executable file
@@ -0,0 +1,17 @@
|
||||
package com.ruoyi.ct.mapper;
|
||||
|
||||
import com.ruoyi.ct.domain.ApiLog;
|
||||
import com.ruoyi.ct.domain.vo.ApiLogVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* API调用日志Mapper接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface ApiLogMapper extends BaseMapperPlus<ApiLogMapper, ApiLog, ApiLogVo> {
|
||||
|
||||
}
|
||||
17
ct/src/main/java/com/ruoyi/ct/mapper/GoodMapper.java
Executable file
17
ct/src/main/java/com/ruoyi/ct/mapper/GoodMapper.java
Executable file
@@ -0,0 +1,17 @@
|
||||
package com.ruoyi.ct.mapper;
|
||||
|
||||
import com.ruoyi.ct.domain.Good;
|
||||
import com.ruoyi.ct.domain.vo.GoodVo;
|
||||
import com.ruoyi.common.core.mapper.BaseMapperPlus;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 电信商品Mapper接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface GoodMapper extends BaseMapperPlus<GoodMapper, Good, GoodVo> {
|
||||
|
||||
}
|
||||
29
ct/src/main/java/com/ruoyi/ct/service/CTService.java
Normal file
29
ct/src/main/java/com/ruoyi/ct/service/CTService.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package com.ruoyi.ct.service;
|
||||
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.ruoyi.common.core.domain.CTResponse;
|
||||
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CTService {
|
||||
|
||||
boolean getToken();
|
||||
boolean checkToken();
|
||||
List<JSONObject> selectNumber(String personnelId, String saleId, String page, String pageSize) throws Exception;
|
||||
|
||||
CTResponse<String> saveOrder(String name, String idCard, String contactMobile, String installedAddress,
|
||||
String saleId, String storeId, String personnelId, String province, String city,
|
||||
String county, String serialNumber, String number, String logiRemark, String pageUrl,
|
||||
String remark, String installAddress, String ynumber2, String images) throws Exception;
|
||||
|
||||
CTResponse<String> uploadFile(String serialNumber, String name, String idCard, String type, String msgId, String img) throws Exception;
|
||||
|
||||
CTResponse<String> updateOrder(String name, String orderNum) throws Exception;
|
||||
|
||||
CTResponse<String> updateExpress(String orderNum) throws Exception;
|
||||
|
||||
CTResponse<JSONArray> syncOffer(String orderNum, String offerIds, String salesNumber) throws Exception;
|
||||
}
|
||||
55
ct/src/main/java/com/ruoyi/ct/service/IAgentAccountGoodService.java
Executable file
55
ct/src/main/java/com/ruoyi/ct/service/IAgentAccountGoodService.java
Executable file
@@ -0,0 +1,55 @@
|
||||
package com.ruoyi.ct.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.ct.domain.AgentAccountGood;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理商商品Service接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
public interface IAgentAccountGoodService {
|
||||
|
||||
/**
|
||||
* 查询代理商商品
|
||||
*/
|
||||
AgentAccountGoodVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询代理商商品列表
|
||||
*/
|
||||
TableDataInfo<AgentAccountGoodVo> queryPageList(AgentAccountGoodBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询代理商商品列表
|
||||
*/
|
||||
List<AgentAccountGoodVo> queryList(AgentAccountGoodBo bo);
|
||||
|
||||
/**
|
||||
* 新增代理商商品
|
||||
*/
|
||||
Boolean insertByBo(AgentAccountGoodBo bo);
|
||||
|
||||
/**
|
||||
* 修改代理商商品
|
||||
*/
|
||||
Boolean updateByBo(AgentAccountGoodBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除代理商商品信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
Page<AgentAccountGoodVo> queryPage(AgentAccountGoodBo agentAccountGoodBo, Integer page, Integer pageSize);
|
||||
|
||||
AgentAccountGoodVo getByGoodAndAccount(String saleId, Long agentAccountId);
|
||||
|
||||
}
|
||||
51
ct/src/main/java/com/ruoyi/ct/service/IAgentAccountGoodUserService.java
Executable file
51
ct/src/main/java/com/ruoyi/ct/service/IAgentAccountGoodUserService.java
Executable file
@@ -0,0 +1,51 @@
|
||||
package com.ruoyi.ct.service;
|
||||
|
||||
import com.ruoyi.ct.domain.AgentAccountGoodUser;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountGoodUserVo;
|
||||
import com.ruoyi.ct.domain.bo.AgentAccountGoodUserBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品预制用户Service接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2024-03-13
|
||||
*/
|
||||
public interface IAgentAccountGoodUserService {
|
||||
|
||||
/**
|
||||
* 查询商品预制用户
|
||||
*/
|
||||
AgentAccountGoodUserVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询商品预制用户列表
|
||||
*/
|
||||
TableDataInfo<AgentAccountGoodUserVo> queryPageList(AgentAccountGoodUserBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询商品预制用户列表
|
||||
*/
|
||||
List<AgentAccountGoodUserVo> queryList(AgentAccountGoodUserBo bo);
|
||||
|
||||
/**
|
||||
* 新增商品预制用户
|
||||
*/
|
||||
Boolean insertByBo(AgentAccountGoodUserBo bo);
|
||||
|
||||
/**
|
||||
* 修改商品预制用户
|
||||
*/
|
||||
Boolean updateByBo(AgentAccountGoodUserBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除商品预制用户信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
void deleteByBo(AgentAccountGoodUser agentAccountGoodUser);
|
||||
}
|
||||
53
ct/src/main/java/com/ruoyi/ct/service/IAgentAccountService.java
Executable file
53
ct/src/main/java/com/ruoyi/ct/service/IAgentAccountService.java
Executable file
@@ -0,0 +1,53 @@
|
||||
package com.ruoyi.ct.service;
|
||||
|
||||
import com.ruoyi.ct.domain.AgentAccount;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||
import com.ruoyi.ct.domain.bo.AgentAccountBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理商账号Service接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
public interface IAgentAccountService {
|
||||
|
||||
/**
|
||||
* 查询代理商账号
|
||||
*/
|
||||
AgentAccountVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询代理商账号列表
|
||||
*/
|
||||
TableDataInfo<AgentAccountVo> queryPageList(AgentAccountBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询代理商账号列表
|
||||
*/
|
||||
List<AgentAccountVo> queryList(AgentAccountBo bo);
|
||||
|
||||
/**
|
||||
* 新增代理商账号
|
||||
*/
|
||||
Boolean insertByBo(AgentAccountBo bo);
|
||||
|
||||
/**
|
||||
* 修改代理商账号
|
||||
*/
|
||||
Boolean updateByBo(AgentAccountBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除代理商账号信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
boolean checkPersonnelId(AgentAccountBo bo);
|
||||
|
||||
AgentAccountVo getByAppId(String appId);
|
||||
}
|
||||
61
ct/src/main/java/com/ruoyi/ct/service/IAgentOrderService.java
Executable file
61
ct/src/main/java/com/ruoyi/ct/service/IAgentOrderService.java
Executable file
@@ -0,0 +1,61 @@
|
||||
package com.ruoyi.ct.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.ruoyi.ct.domain.AgentOrder;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||
import com.ruoyi.ct.domain.vo.AgentOrderVo;
|
||||
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 订单Service接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
public interface IAgentOrderService {
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
*/
|
||||
AgentOrderVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
TableDataInfo<AgentOrderVo> queryPageList(AgentOrderBo bo, PageQuery pageQuery);
|
||||
|
||||
TableDataInfo<AgentOrderVo> queryList(LambdaQueryWrapper<AgentOrder> lqw, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
List<AgentOrderVo> queryList(AgentOrderBo bo);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*/
|
||||
Boolean insertByBo(AgentOrderBo bo);
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
Boolean updateByBo(AgentOrderBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除订单信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
|
||||
List<AgentOrderVo> selectOrders();
|
||||
|
||||
List<AgentOrderVo> queryListByLQW(LambdaQueryWrapper<AgentOrder> lqw);
|
||||
|
||||
void updateCount(AgentAccountGoodVo agentAccountGoodVo);
|
||||
|
||||
AgentOrderVo queryBySerialNumber(String serialNumber);
|
||||
}
|
||||
49
ct/src/main/java/com/ruoyi/ct/service/IAgentService.java
Executable file
49
ct/src/main/java/com/ruoyi/ct/service/IAgentService.java
Executable file
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.ct.service;
|
||||
|
||||
import com.ruoyi.ct.domain.Agent;
|
||||
import com.ruoyi.ct.domain.vo.AgentVo;
|
||||
import com.ruoyi.ct.domain.bo.AgentBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 代理商Service接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
public interface IAgentService {
|
||||
|
||||
/**
|
||||
* 查询代理商
|
||||
*/
|
||||
AgentVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询代理商列表
|
||||
*/
|
||||
TableDataInfo<AgentVo> queryPageList(AgentBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询代理商列表
|
||||
*/
|
||||
List<AgentVo> queryList(AgentBo bo);
|
||||
|
||||
/**
|
||||
* 新增代理商
|
||||
*/
|
||||
Boolean insertByBo(AgentBo bo);
|
||||
|
||||
/**
|
||||
* 修改代理商
|
||||
*/
|
||||
Boolean updateByBo(AgentBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除代理商信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
49
ct/src/main/java/com/ruoyi/ct/service/IApiLogService.java
Executable file
49
ct/src/main/java/com/ruoyi/ct/service/IApiLogService.java
Executable file
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.ct.service;
|
||||
|
||||
import com.ruoyi.ct.domain.ApiLog;
|
||||
import com.ruoyi.ct.domain.vo.ApiLogVo;
|
||||
import com.ruoyi.ct.domain.bo.ApiLogBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* API调用日志Service接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
public interface IApiLogService {
|
||||
|
||||
/**
|
||||
* 查询API调用日志
|
||||
*/
|
||||
ApiLogVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询API调用日志列表
|
||||
*/
|
||||
TableDataInfo<ApiLogVo> queryPageList(ApiLogBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询API调用日志列表
|
||||
*/
|
||||
List<ApiLogVo> queryList(ApiLogBo bo);
|
||||
|
||||
/**
|
||||
* 新增API调用日志
|
||||
*/
|
||||
Boolean insertByBo(ApiLogBo bo);
|
||||
|
||||
/**
|
||||
* 修改API调用日志
|
||||
*/
|
||||
Boolean updateByBo(ApiLogBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除API调用日志信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
49
ct/src/main/java/com/ruoyi/ct/service/IGoodService.java
Executable file
49
ct/src/main/java/com/ruoyi/ct/service/IGoodService.java
Executable file
@@ -0,0 +1,49 @@
|
||||
package com.ruoyi.ct.service;
|
||||
|
||||
import com.ruoyi.ct.domain.Good;
|
||||
import com.ruoyi.ct.domain.vo.GoodVo;
|
||||
import com.ruoyi.ct.domain.bo.GoodBo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 电信商品Service接口
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
public interface IGoodService {
|
||||
|
||||
/**
|
||||
* 查询电信商品
|
||||
*/
|
||||
GoodVo queryById(Long id);
|
||||
|
||||
/**
|
||||
* 查询电信商品列表
|
||||
*/
|
||||
TableDataInfo<GoodVo> queryPageList(GoodBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询电信商品列表
|
||||
*/
|
||||
List<GoodVo> queryList(GoodBo bo);
|
||||
|
||||
/**
|
||||
* 新增电信商品
|
||||
*/
|
||||
Boolean insertByBo(GoodBo bo);
|
||||
|
||||
/**
|
||||
* 修改电信商品
|
||||
*/
|
||||
Boolean updateByBo(GoodBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除电信商品信息
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
127
ct/src/main/java/com/ruoyi/ct/service/impl/AgentAccountGoodServiceImpl.java
Executable file
127
ct/src/main/java/com/ruoyi/ct/service/impl/AgentAccountGoodServiceImpl.java
Executable file
@@ -0,0 +1,127 @@
|
||||
package com.ruoyi.ct.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||
import com.ruoyi.ct.domain.AgentAccountGood;
|
||||
import com.ruoyi.ct.mapper.AgentAccountGoodMapper;
|
||||
import com.ruoyi.ct.service.IAgentAccountGoodService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 代理商商品Service业务层处理
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class AgentAccountGoodServiceImpl implements IAgentAccountGoodService {
|
||||
|
||||
private final AgentAccountGoodMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询代理商商品
|
||||
*/
|
||||
@Override
|
||||
public AgentAccountGoodVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理商商品列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<AgentAccountGoodVo> queryPageList(AgentAccountGoodBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<AgentAccountGood> lqw = buildQueryWrapper(bo);
|
||||
Page<AgentAccountGoodVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理商商品列表
|
||||
*/
|
||||
@Override
|
||||
public List<AgentAccountGoodVo> queryList(AgentAccountGoodBo bo) {
|
||||
LambdaQueryWrapper<AgentAccountGood> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<AgentAccountGood> buildQueryWrapper(AgentAccountGoodBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<AgentAccountGood> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getAgentId() != null, AgentAccountGood::getAgentId, bo.getAgentId());
|
||||
lqw.eq(bo.getAgentAccountId() != null, AgentAccountGood::getAgentAccountId, bo.getAgentAccountId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPersonnelId()), AgentAccountGood::getPersonnelId, bo.getPersonnelId());
|
||||
lqw.eq(bo.getGoodId() != null, AgentAccountGood::getGoodId, bo.getGoodId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSaleId()), AgentAccountGood::getSaleId, bo.getSaleId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理商商品
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(AgentAccountGoodBo bo) {
|
||||
AgentAccountGood add = BeanUtil.toBean(bo, AgentAccountGood.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理商商品
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(AgentAccountGoodBo bo) {
|
||||
AgentAccountGood update = BeanUtil.toBean(bo, AgentAccountGood.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(AgentAccountGood entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代理商商品
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<AgentAccountGoodVo> queryPage(AgentAccountGoodBo agentAccountGoodBo, Integer page, Integer pageSize) {
|
||||
Page<AgentAccountGoodVo> result = new Page<>(page, pageSize);
|
||||
List<AgentAccountGoodVo> agentAccountGoodVoList = baseMapper.selectListFotAPI(result, agentAccountGoodBo.getAgentAccountId());
|
||||
result.setRecords(agentAccountGoodVoList);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AgentAccountGoodVo getByGoodAndAccount(String saleId, Long agentAccountId) {
|
||||
return baseMapper.getByGoodAndAccount(saleId, agentAccountId);
|
||||
}
|
||||
|
||||
}
|
||||
119
ct/src/main/java/com/ruoyi/ct/service/impl/AgentAccountGoodUserServiceImpl.java
Executable file
119
ct/src/main/java/com/ruoyi/ct/service/impl/AgentAccountGoodUserServiceImpl.java
Executable file
@@ -0,0 +1,119 @@
|
||||
package com.ruoyi.ct.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.ct.domain.bo.AgentAccountGoodUserBo;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountGoodUserVo;
|
||||
import com.ruoyi.ct.domain.AgentAccountGoodUser;
|
||||
import com.ruoyi.ct.mapper.AgentAccountGoodUserMapper;
|
||||
import com.ruoyi.ct.service.IAgentAccountGoodUserService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 商品预制用户Service业务层处理
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2024-03-13
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class AgentAccountGoodUserServiceImpl implements IAgentAccountGoodUserService {
|
||||
|
||||
private final AgentAccountGoodUserMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询商品预制用户
|
||||
*/
|
||||
@Override
|
||||
public AgentAccountGoodUserVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品预制用户列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<AgentAccountGoodUserVo> queryPageList(AgentAccountGoodUserBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<AgentAccountGoodUser> lqw = buildQueryWrapper(bo);
|
||||
lqw.orderByDesc(AgentAccountGoodUser::getCreateTime);
|
||||
Page<AgentAccountGoodUserVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询商品预制用户列表
|
||||
*/
|
||||
@Override
|
||||
public List<AgentAccountGoodUserVo> queryList(AgentAccountGoodUserBo bo) {
|
||||
LambdaQueryWrapper<AgentAccountGoodUser> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<AgentAccountGoodUser> buildQueryWrapper(AgentAccountGoodUserBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<AgentAccountGoodUser> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getAgentAccountGoodId() != null, AgentAccountGoodUser::getAgentAccountGoodId, bo.getAgentAccountGoodId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), AgentAccountGoodUser::getName, bo.getName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getIdCardNo()), AgentAccountGoodUser::getIdCardNo, bo.getIdCardNo());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getMobile()), AgentAccountGoodUser::getMobile, bo.getMobile());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增商品预制用户
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(AgentAccountGoodUserBo bo) {
|
||||
AgentAccountGoodUser add = BeanUtil.toBean(bo, AgentAccountGoodUser.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品预制用户
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(AgentAccountGoodUserBo bo) {
|
||||
AgentAccountGoodUser update = BeanUtil.toBean(bo, AgentAccountGoodUser.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(AgentAccountGoodUser entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除商品预制用户
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteByBo(AgentAccountGoodUser agentAccountGoodUser) {
|
||||
baseMapper.delete(new QueryWrapper<>(agentAccountGoodUser));
|
||||
}
|
||||
}
|
||||
178
ct/src/main/java/com/ruoyi/ct/service/impl/AgentAccountServiceImpl.java
Executable file
178
ct/src/main/java/com/ruoyi/ct/service/impl/AgentAccountServiceImpl.java
Executable file
@@ -0,0 +1,178 @@
|
||||
package com.ruoyi.ct.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.crypto.SmUtil;
|
||||
import cn.hutool.crypto.asymmetric.SM2;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.ct.domain.AgentAccountGood;
|
||||
import com.ruoyi.ct.domain.vo.GoodVo;
|
||||
import com.ruoyi.ct.mapper.AgentAccountGoodMapper;
|
||||
import com.ruoyi.ct.mapper.GoodMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.ct.domain.bo.AgentAccountBo;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountVo;
|
||||
import com.ruoyi.ct.domain.AgentAccount;
|
||||
import com.ruoyi.ct.mapper.AgentAccountMapper;
|
||||
import com.ruoyi.ct.service.IAgentAccountService;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 代理商账号Service业务层处理
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class AgentAccountServiceImpl implements IAgentAccountService {
|
||||
|
||||
private final AgentAccountMapper baseMapper;
|
||||
private final AgentAccountGoodMapper agentAccountGoodMapper;
|
||||
private final GoodMapper goodMapper;
|
||||
|
||||
/**
|
||||
* 查询代理商账号
|
||||
*/
|
||||
@Override
|
||||
public AgentAccountVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理商账号列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<AgentAccountVo> queryPageList(AgentAccountBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<AgentAccount> lqw = buildQueryWrapper(bo);
|
||||
Page<AgentAccountVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理商账号列表
|
||||
*/
|
||||
@Override
|
||||
public List<AgentAccountVo> queryList(AgentAccountBo bo) {
|
||||
LambdaQueryWrapper<AgentAccount> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<AgentAccount> buildQueryWrapper(AgentAccountBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<AgentAccount> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getAgentId() != null, AgentAccount::getAgentId, bo.getAgentId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getAgentName()), AgentAccount::getAgentName, bo.getAgentName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPersonnelId()), AgentAccount::getPersonnelId, bo.getPersonnelId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAppId()), AgentAccount::getAppId, bo.getAppId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAppSecret()), AgentAccount::getAppSecret, bo.getAppSecret());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getIpList()), AgentAccount::getIpList, bo.getIpList());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getVerifyUrl()), AgentAccount::getVerifyUrl, bo.getVerifyUrl());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPlatformPublicKey()), AgentAccount::getPlatformPublicKey, bo.getPlatformPublicKey());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPlatformPrivateKey()), AgentAccount::getPlatformPrivateKey, bo.getPlatformPrivateKey());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAgentPublicKey()), AgentAccount::getAgentPublicKey, bo.getAgentPublicKey());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAgentPrivateKey()), AgentAccount::getAgentPrivateKey, bo.getAgentPrivateKey());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), AgentAccount::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理商账号
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(AgentAccountBo bo) {
|
||||
SM2 sm2 = SmUtil.sm2();
|
||||
bo.setAgentPrivateKey(sm2.getPrivateKeyBase64());
|
||||
bo.setAgentPublicKey(sm2.getPublicKeyBase64());
|
||||
sm2 = SmUtil.sm2();
|
||||
bo.setPlatformPublicKey(sm2.getPublicKeyBase64());
|
||||
bo.setPlatformPrivateKey(sm2.getPrivateKeyBase64());
|
||||
bo.setAppId(UUID.randomUUID().toString());
|
||||
bo.setAppSecret(UUID.randomUUID().toString());
|
||||
bo.setStatus("1");
|
||||
|
||||
AgentAccount add = BeanUtil.toBean(bo, AgentAccount.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
// Collection<AgentAccountGood> agentAccountGoodCollection = new ArrayList<>();
|
||||
// for (Long goodsId: bo.getGoodsIds()) {
|
||||
// GoodVo goods = goodMapper.selectVoById(goodsId);
|
||||
// AgentAccountGood agentAccountGood = new AgentAccountGood();
|
||||
// agentAccountGood.setGoodId(goodsId);
|
||||
// agentAccountGood.setAgentId(add.getAgentId());
|
||||
// agentAccountGood.setPersonnelId(add.getPersonnelId());
|
||||
// agentAccountGood.setAgentAccountId(add.getId());
|
||||
// agentAccountGood.setSaleId(goods.getSaleId());
|
||||
// agentAccountGoodCollection.add(agentAccountGood);
|
||||
// }
|
||||
// agentAccountGoodMapper.insertBatch(agentAccountGoodCollection);
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理商账号
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(AgentAccountBo bo) {
|
||||
AgentAccount update = BeanUtil.toBean(bo, AgentAccount.class);
|
||||
validEntityBeforeSave(update);
|
||||
boolean flag = baseMapper.updateById(update) > 0;
|
||||
// agentAccountGoodMapper.delete(new LambdaQueryWrapper<AgentAccountGood>().eq(AgentAccountGood::getAgentAccountId, update.getId()));
|
||||
// Collection<AgentAccountGood> agentAccountGoodCollection = new ArrayList<>();
|
||||
// for (Long goodsId: bo.getGoodsIds()) {
|
||||
// GoodVo goods = goodMapper.selectVoById(goodsId);
|
||||
// AgentAccountGood agentAccountGood = new AgentAccountGood();
|
||||
// agentAccountGood.setGoodId(goodsId);
|
||||
// agentAccountGood.setAgentId(update.getAgentId());
|
||||
// agentAccountGood.setPersonnelId(update.getPersonnelId());
|
||||
// agentAccountGood.setAgentAccountId(update.getId());
|
||||
// agentAccountGood.setSaleId(goods.getSaleId());
|
||||
// agentAccountGoodCollection.add(agentAccountGood);
|
||||
// }
|
||||
// agentAccountGoodMapper.insertBatch(agentAccountGoodCollection);
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(AgentAccount entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代理商账号
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkPersonnelId(AgentAccountBo bo) {
|
||||
bo.setPersonnelId(bo.getPersonnelId());
|
||||
bo.setStatus("1");
|
||||
return ObjectUtils.isNotNull(baseMapper.selectVoOne(new QueryWrapper<AgentAccount>().lambda()
|
||||
.eq(AgentAccount::getPersonnelId, bo.getPersonnelId())
|
||||
.eq(AgentAccount::getStatus, "1")));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AgentAccountVo getByAppId(String appId) {
|
||||
return baseMapper.getByAppId(appId);
|
||||
}
|
||||
}
|
||||
193
ct/src/main/java/com/ruoyi/ct/service/impl/AgentOrderServiceImpl.java
Executable file
193
ct/src/main/java/com/ruoyi/ct/service/impl/AgentOrderServiceImpl.java
Executable file
@@ -0,0 +1,193 @@
|
||||
package com.ruoyi.ct.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.ruoyi.ct.domain.AgentAccountGood;
|
||||
import com.ruoyi.ct.domain.bo.AgentAccountGoodBo;
|
||||
import com.ruoyi.ct.domain.vo.AgentAccountGoodVo;
|
||||
import com.ruoyi.ct.mapper.AgentAccountGoodMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||
import com.ruoyi.ct.domain.vo.AgentOrderVo;
|
||||
import com.ruoyi.ct.domain.AgentOrder;
|
||||
import com.ruoyi.ct.mapper.AgentOrderMapper;
|
||||
import com.ruoyi.ct.service.IAgentOrderService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 订单Service业务层处理
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class AgentOrderServiceImpl implements IAgentOrderService {
|
||||
|
||||
private final AgentOrderMapper baseMapper;
|
||||
|
||||
private final AgentAccountGoodMapper agentAccountGoodMapper;
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
*/
|
||||
@Override
|
||||
public AgentOrderVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AgentOrderVo queryBySerialNumber(String serialNumber) {
|
||||
LambdaQueryWrapper<AgentOrder> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(AgentOrder::getSerialNumber, serialNumber);
|
||||
lqw.last("limit 1");
|
||||
return baseMapper.selectVoOne(lqw);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<AgentOrderVo> queryPageList(AgentOrderBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<AgentOrder> lqw = buildQueryWrapper(bo);
|
||||
Page<AgentOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TableDataInfo<AgentOrderVo> queryList(LambdaQueryWrapper<AgentOrder> lqw, PageQuery pageQuery) {
|
||||
Page<AgentOrderVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
@Override
|
||||
public List<AgentOrderVo> queryList(AgentOrderBo bo) {
|
||||
LambdaQueryWrapper<AgentOrder> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<AgentOrder> buildQueryWrapper(AgentOrderBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<AgentOrder> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getAgentId() != null, AgentOrder::getAgentId, bo.getAgentId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getAgentName()), AgentOrder::getAgentName, bo.getAgentName());
|
||||
lqw.eq(bo.getAgentAccountId() != null, AgentOrder::getAgentAccountId, bo.getAgentAccountId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSaleId()), AgentOrder::getSaleId, bo.getSaleId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStoreId()), AgentOrder::getStoreId, bo.getStoreId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPersonnelId()), AgentOrder::getPersonnelId, bo.getPersonnelId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), AgentOrder::getName, bo.getName());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getIdCard()), AgentOrder::getIdCard, bo.getIdCard());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getContactMobile()), AgentOrder::getContactMobile, bo.getContactMobile());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getInstalledAddress()), AgentOrder::getInstalledAddress, bo.getInstalledAddress());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getProvince()), AgentOrder::getProvince, bo.getProvince());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCity()), AgentOrder::getCity, bo.getCity());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCounty()), AgentOrder::getCounty, bo.getCounty());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getSerialNumber()), AgentOrder::getSerialNumber, bo.getSerialNumber());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getNumber()), AgentOrder::getNumber, bo.getNumber());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getLogiRemark()), AgentOrder::getLogiRemark, bo.getLogiRemark());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPageUrl()), AgentOrder::getPageUrl, bo.getPageUrl());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getInstallAddress()), AgentOrder::getInstallAddress, bo.getInstallAddress());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getYnumber2()), AgentOrder::getYnumber2, bo.getYnumber2());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getImages()), AgentOrder::getImages, bo.getImages());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOrderNum()), AgentOrder::getOrderNum, bo.getOrderNum());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getOrderStatus()), AgentOrder::getOrderStatus, bo.getOrderStatus());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), AgentOrder::getStatus, bo.getStatus());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getExpressNum()), AgentOrder::getExpressNum, bo.getExpressNum());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getExpressRoutes()), AgentOrder::getExpressRoutes, bo.getExpressRoutes());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatusCd()), AgentOrder::getStatusCd, bo.getStatusCd());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getRouteArr()), AgentOrder::getRouteArr, bo.getRouteArr());
|
||||
lqw.eq(ObjectUtils.isNotNull(bo.getIsRecharge()), AgentOrder::getIsRecharge, bo.getIsRecharge());
|
||||
lqw.between(params.get("beginCreateTime") != null && params.get("endCreateTime") != null,
|
||||
AgentOrder::getCreateTime ,params.get("beginCreateTime"), params.get("endCreateTime"));
|
||||
lqw.orderByDesc(AgentOrder::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(AgentOrderBo bo) {
|
||||
AgentOrder add = BeanUtil.toBean(bo, AgentOrder.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(AgentOrderBo bo) {
|
||||
AgentOrder update = BeanUtil.toBean(bo, AgentOrder.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(AgentOrder entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AgentOrderVo> selectOrders() {
|
||||
LambdaQueryWrapper<AgentOrder> lqw = new LambdaQueryWrapper<>();
|
||||
lqw.eq(AgentOrder::getStatus, "0");
|
||||
return this.baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<AgentOrderVo> queryListByLQW(LambdaQueryWrapper<AgentOrder> lqw) {
|
||||
return this.baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCount(AgentAccountGoodVo agentAccountGoodVo) {
|
||||
Long waitCount = baseMapper.selectCount(new QueryWrapper<AgentOrder>().lambda()
|
||||
.eq(AgentOrder::getAgentAccountId, agentAccountGoodVo.getAgentAccountId())
|
||||
.eq(AgentOrder::getSaleId, agentAccountGoodVo.getSaleId())
|
||||
.eq(AgentOrder::getStatus, 0));
|
||||
Long completeCount = baseMapper.selectCount(new QueryWrapper<AgentOrder>().lambda()
|
||||
.eq(AgentOrder::getAgentAccountId, agentAccountGoodVo.getAgentAccountId())
|
||||
.eq(AgentOrder::getSaleId, agentAccountGoodVo.getSaleId())
|
||||
.eq(AgentOrder::getStatus, 1));
|
||||
|
||||
AgentAccountGood agentAccountGood = new AgentAccountGood();
|
||||
agentAccountGood.setId(agentAccountGoodVo.getId());
|
||||
agentAccountGood.setWaitCount(Integer.valueOf(String.valueOf(waitCount)));
|
||||
agentAccountGood.setCompleteCount(Integer.valueOf(String.valueOf(completeCount)));
|
||||
agentAccountGood.setVerifiedCount(Integer.valueOf(String.valueOf(completeCount+waitCount)));
|
||||
agentAccountGoodMapper.updateById(agentAccountGood);
|
||||
}
|
||||
}
|
||||
110
ct/src/main/java/com/ruoyi/ct/service/impl/AgentServiceImpl.java
Executable file
110
ct/src/main/java/com/ruoyi/ct/service/impl/AgentServiceImpl.java
Executable file
@@ -0,0 +1,110 @@
|
||||
package com.ruoyi.ct.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.ct.domain.bo.AgentBo;
|
||||
import com.ruoyi.ct.domain.vo.AgentVo;
|
||||
import com.ruoyi.ct.domain.Agent;
|
||||
import com.ruoyi.ct.mapper.AgentMapper;
|
||||
import com.ruoyi.ct.service.IAgentService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 代理商Service业务层处理
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class AgentServiceImpl implements IAgentService {
|
||||
|
||||
private final AgentMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询代理商
|
||||
*/
|
||||
@Override
|
||||
public AgentVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理商列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<AgentVo> queryPageList(AgentBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<Agent> lqw = buildQueryWrapper(bo);
|
||||
Page<AgentVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询代理商列表
|
||||
*/
|
||||
@Override
|
||||
public List<AgentVo> queryList(AgentBo bo) {
|
||||
LambdaQueryWrapper<Agent> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<Agent> buildQueryWrapper(AgentBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<Agent> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), Agent::getName, bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), Agent::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增代理商
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(AgentBo bo) {
|
||||
Agent add = BeanUtil.toBean(bo, Agent.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改代理商
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(AgentBo bo) {
|
||||
Agent update = BeanUtil.toBean(bo, Agent.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(Agent entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除代理商
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
116
ct/src/main/java/com/ruoyi/ct/service/impl/ApiLogServiceImpl.java
Executable file
116
ct/src/main/java/com/ruoyi/ct/service/impl/ApiLogServiceImpl.java
Executable file
@@ -0,0 +1,116 @@
|
||||
package com.ruoyi.ct.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.ct.domain.bo.ApiLogBo;
|
||||
import com.ruoyi.ct.domain.vo.ApiLogVo;
|
||||
import com.ruoyi.ct.domain.ApiLog;
|
||||
import com.ruoyi.ct.mapper.ApiLogMapper;
|
||||
import com.ruoyi.ct.service.IApiLogService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* API调用日志Service业务层处理
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ApiLogServiceImpl implements IApiLogService {
|
||||
|
||||
private final ApiLogMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询API调用日志
|
||||
*/
|
||||
@Override
|
||||
public ApiLogVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询API调用日志列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ApiLogVo> queryPageList(ApiLogBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<ApiLog> lqw = buildQueryWrapper(bo);
|
||||
Page<ApiLogVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询API调用日志列表
|
||||
*/
|
||||
@Override
|
||||
public List<ApiLogVo> queryList(ApiLogBo bo) {
|
||||
LambdaQueryWrapper<ApiLog> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<ApiLog> buildQueryWrapper(ApiLogBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<ApiLog> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getPersonnelId()), ApiLog::getPersonnelId, bo.getPersonnelId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUrl()), ApiLog::getUrl, bo.getUrl());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getRequestBody()), ApiLog::getRequestBody, bo.getRequestBody());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getRequestHeader()), ApiLog::getRequestHeader, bo.getRequestHeader());
|
||||
lqw.eq(bo.getIsSuccess() != null, ApiLog::getIsSuccess, bo.getIsSuccess());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getErrorMsg()), ApiLog::getErrorMsg, bo.getErrorMsg());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getResponse()), ApiLog::getResponse, bo.getResponse());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getIp()), ApiLog::getIp, bo.getIp());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增API调用日志
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ApiLogBo bo) {
|
||||
ApiLog add = BeanUtil.toBean(bo, ApiLog.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改API调用日志
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ApiLogBo bo) {
|
||||
ApiLog update = BeanUtil.toBean(bo, ApiLog.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ApiLog entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除API调用日志
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
445
ct/src/main/java/com/ruoyi/ct/service/impl/CTServiceImpl.java
Normal file
445
ct/src/main/java/com/ruoyi/ct/service/impl/CTServiceImpl.java
Normal file
@@ -0,0 +1,445 @@
|
||||
package com.ruoyi.ct.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.ruoyi.common.core.domain.CTRequestBody;
|
||||
import com.ruoyi.common.core.domain.CTResponse;
|
||||
import com.ruoyi.ct.domain.bo.AgentOrderBo;
|
||||
import com.ruoyi.ct.service.CTService;
|
||||
import com.ruoyi.common.utils.redis.RedisUtils;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
import java.security.MessageDigest;
|
||||
import java.time.Duration;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
@Slf4j
|
||||
public class CTServiceImpl implements CTService {
|
||||
|
||||
@Value("${api.app-id}")
|
||||
private String appId;
|
||||
|
||||
@Value("${api.host}")
|
||||
private String host;
|
||||
|
||||
@Value("${api.local-ip}")
|
||||
private String localIp;
|
||||
|
||||
@Value("${api.token-key}")
|
||||
private String tokenKey;
|
||||
|
||||
@Value("${api.public-key}")
|
||||
private String publicKey;
|
||||
|
||||
private String token;
|
||||
|
||||
private String url;
|
||||
|
||||
private CTRequestBody requestBody;
|
||||
|
||||
/**
|
||||
* 电信返回:
|
||||
* {
|
||||
* 'isSuccess': 1,
|
||||
* 'errorCode': None,
|
||||
* 'errorMsg': None,
|
||||
* 'details': None,
|
||||
* 'needTerminate': False,
|
||||
* 'executeType': None,
|
||||
* 'result': '624eb07c-5488-476d-a7ff-c87f584daa1c',
|
||||
* 'channelCode': '90010160'
|
||||
* }
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean getToken() {
|
||||
String res = HttpUtil.post(String.format("%sdqAuth/token_service_out/rs/token/%s", host, appId), new HashMap<>());
|
||||
System.out.println("res = " + res);
|
||||
JSONObject response = JSONUtil.parseObj(res);
|
||||
if (response.getInt("isSuccess") == 1) {
|
||||
LocalDate today = LocalDate.now();
|
||||
LocalDate tomorrow = today.plusDays(1);
|
||||
LocalDateTime tm = LocalDateTime.of(tomorrow.getYear(), tomorrow.getMonth(), tomorrow.getDayOfMonth(), 0 ,0 ,0);
|
||||
System.out.println("距离明天的时间剩余:"+Duration.between(LocalDateTime.now(), tm));
|
||||
token = response.getStr("result");
|
||||
System.out.println("成功获取 token = " + token);
|
||||
RedisUtils.setCacheObject(tokenKey, token, Duration.between(LocalDateTime.now(), tm));
|
||||
return true;
|
||||
}
|
||||
System.out.println("获取token失败");
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 电信返回:
|
||||
* {
|
||||
* 'isSuccess': 0,
|
||||
* 'errorCode': 'token cannot be null or empty !!',
|
||||
* 'errorMsg': None,
|
||||
* 'details': None,
|
||||
* 'needTerminate': False,
|
||||
* 'executeType': None,
|
||||
* 'result': None,
|
||||
* 'channelCode': None
|
||||
* }
|
||||
* {
|
||||
* 'isSuccess': 1,
|
||||
* 'errorCode': '0003',
|
||||
* 'errorMsg': 'Success!',
|
||||
* 'details': None,
|
||||
* 'needTerminate': False,
|
||||
* 'executeType': None,
|
||||
* 'result': '150126',
|
||||
* 'channelCode': '90010160'
|
||||
* }
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean checkToken() {
|
||||
try {
|
||||
token = RedisUtils.getCacheObject(tokenKey);
|
||||
System.out.println("token = " + token);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// 缓存中没有token,需要重新获取
|
||||
if (!getToken()) {
|
||||
// 没有获取到token,提示稍后再试
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
String res = HttpUtil.post(String.format("%sdqAuth/token_service/token/ckeckToken?ip=%s&token=%s", host, localIp, token), new HashMap<>());
|
||||
System.out.println("res = " + res);
|
||||
JSONObject response = JSONUtil.parseObj(res);
|
||||
if (response.getInt("isSuccess") != 1) {
|
||||
// token已过期,重新获取
|
||||
// 缓存中没有token,需要重新获取
|
||||
if (!getToken()) {
|
||||
// 没有获取到token,提示稍后再试
|
||||
return false;
|
||||
}
|
||||
}
|
||||
url = String.format("%sdqServer/api_out/xt/v1/extInterface", host);
|
||||
requestBody = new CTRequestBody();
|
||||
requestBody.setAppId(appId);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param personnelId 代理商销售员 ID Y
|
||||
* @param saleId 销售品 ID
|
||||
* @param page 页码
|
||||
* @param pageSize 每页返回号码数量,默认 10
|
||||
* @return
|
||||
* number String 号码
|
||||
* level String 号码等级
|
||||
* minAmount String 每月最低消费
|
||||
* prepay String 号码需预存款
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public List<JSONObject> selectNumber(String personnelId, String saleId, String page, String pageSize) throws Exception {
|
||||
if (checkToken()) {
|
||||
requestBody.setInterfaceName("SelectNumber");
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
body.put("personnelId", personnelId);
|
||||
body.put("saleId", saleId);
|
||||
body.put("page", page);
|
||||
body.put("pageSize", pageSize);
|
||||
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||
HttpResponse httpResponse = HttpRequest.post(url)
|
||||
.header("token", token)
|
||||
.form(requestBody.toMap())
|
||||
.execute();
|
||||
System.out.println("httpResponse.body() = " + httpResponse.body());
|
||||
if (httpResponse.isOk()) {
|
||||
CTResponse<List<JSONObject>> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
|
||||
if (response.isSuccess()) {
|
||||
return response.getData();
|
||||
}
|
||||
}
|
||||
System.out.println("response status:"+httpResponse.getStatus());
|
||||
System.out.println("request error");
|
||||
return null;
|
||||
}
|
||||
System.out.println("token error");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CTResponse<String> saveOrder(String name, String idCard, String contactMobile,
|
||||
String installedAddress, String saleId, String storeId,
|
||||
String personnelId, String province, String city,
|
||||
String county, String serialNumber, String number,
|
||||
String logiRemark, String pageUrl, String remark,
|
||||
String installAddress, String ynumber2, String images) throws Exception {
|
||||
if (checkToken()) {
|
||||
requestBody.setInterfaceName("SaveOrder");
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
|
||||
body.put("name", name);
|
||||
body.put("idCard", idCard);
|
||||
body.put("contactMobile", contactMobile);
|
||||
if (ObjectUtil.isNotNull(installedAddress)) {
|
||||
body.put("installedAddress", installedAddress);
|
||||
}
|
||||
body.put("saleId", saleId);
|
||||
body.put("storeId", storeId);
|
||||
body.put("personnelId", personnelId);
|
||||
if (ObjectUtil.isNotNull(province)) {
|
||||
body.put("province", province);
|
||||
}
|
||||
if (ObjectUtil.isNotNull(city)) {
|
||||
body.put("city", city);
|
||||
}
|
||||
if (ObjectUtil.isNotNull(county)) {
|
||||
body.put("county", county);
|
||||
}
|
||||
if (ObjectUtil.isNull(installedAddress) || ObjectUtil.isNull(province) || ObjectUtil.isNull(city) || ObjectUtil.isNull(county)) {
|
||||
body.put("deliveryMethod", "2");
|
||||
} else {
|
||||
body.put("deliveryMethod", "1");
|
||||
}
|
||||
body.put("serialNumber", serialNumber);
|
||||
body.put("number", number);
|
||||
body.put("logiRemark", logiRemark);
|
||||
body.put("pageUrl", pageUrl);
|
||||
body.put("remark", remark);
|
||||
body.put("installAddress", installAddress);
|
||||
// body.put("ynumber2", ynumber2);
|
||||
// body.put("images", images);
|
||||
log.info("body:" + body);
|
||||
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||
HttpResponse httpResponse = HttpRequest.post(url)
|
||||
.header("token", token)
|
||||
.form(requestBody.toMap())
|
||||
.execute();
|
||||
log.error("body:"+httpResponse.body());
|
||||
if (httpResponse.isOk()) {
|
||||
CTResponse<String> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
|
||||
return response;
|
||||
}
|
||||
log.error("response status:"+httpResponse.getStatus());
|
||||
log.error("request error");
|
||||
return null;
|
||||
}
|
||||
log.error("token error");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CTResponse<String> uploadFile(String serialNumber, String name, String idCard, String type, String msgId, String img) throws Exception {
|
||||
if (checkToken()) {
|
||||
requestBody.setInterfaceName("UploadFile");
|
||||
requestBody.setFileBase64(img);
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
|
||||
body.put("name", name);
|
||||
body.put("idCard", idCard);
|
||||
body.put("type", type);
|
||||
body.put("isV4", "1");
|
||||
body.put("serialNumber", serialNumber);
|
||||
if (ObjectUtil.isNotNull(msgId)) {
|
||||
body.put("msgId", msgId);
|
||||
}
|
||||
log.info("body:" + body);
|
||||
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||
HttpResponse httpResponse = HttpRequest.post(url)
|
||||
.header("token", token)
|
||||
.form(requestBody.toMap())
|
||||
.execute();
|
||||
log.error("body:"+httpResponse.body());
|
||||
if (httpResponse.isOk()) {
|
||||
CTResponse<String> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
|
||||
return response;
|
||||
}
|
||||
log.error("response status:"+httpResponse.getStatus());
|
||||
log.error("request error");
|
||||
return null;
|
||||
}
|
||||
log.error("token error");
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CTResponse<String> updateOrder(String name, String orderNum) throws Exception {
|
||||
if (checkToken()) {
|
||||
requestBody.setInterfaceName("QueryOrder");
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
|
||||
body.put("name", name);
|
||||
body.put("orderNum", orderNum);
|
||||
|
||||
log.info("body:" + body);
|
||||
System.out.println("body = " + body);
|
||||
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||
HttpResponse httpResponse = HttpRequest.post(url)
|
||||
.header("token", token)
|
||||
.form(requestBody.toMap())
|
||||
.execute();
|
||||
log.error("body:"+httpResponse.body());
|
||||
System.out.println("httpResponse.body() = " + httpResponse.body());
|
||||
if (httpResponse.isOk()) {
|
||||
CTResponse<String> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
|
||||
String data = response.getData();
|
||||
try {
|
||||
response.setDecryptData(JSONUtil.parseObj(decrypt(data, publicKey)));
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("解密错误");
|
||||
log.error(response.getData());
|
||||
}
|
||||
|
||||
}
|
||||
log.error("response status:"+httpResponse.getStatus());
|
||||
log.error("request error");
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CTResponse<String> updateExpress(String orderNum) throws Exception {
|
||||
if (checkToken()) {
|
||||
requestBody.setInterfaceName("QueryOrderResult");
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
|
||||
body.put("orderNum", orderNum);
|
||||
|
||||
log.info("body:" + body);
|
||||
System.out.println("body = " + body);
|
||||
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||
HttpResponse httpResponse = HttpRequest.post(url)
|
||||
.header("token", token)
|
||||
.form(requestBody.toMap())
|
||||
.execute();
|
||||
log.error("body:"+httpResponse.body());
|
||||
System.out.println("httpResponse.body() = " + httpResponse.body());
|
||||
if (httpResponse.isOk()) {
|
||||
CTResponse<String> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
|
||||
|
||||
try {
|
||||
String data = response.getData();
|
||||
response.setDecryptData(JSONUtil.parseObj(decrypt(data, publicKey)));
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
response.setDecryptData(JSONUtil.parseObj(httpResponse.body()).getJSONObject("data"));
|
||||
return response;
|
||||
}
|
||||
|
||||
}
|
||||
log.error("response status:"+httpResponse.getStatus());
|
||||
log.error("request error");
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CTResponse<JSONArray> syncOffer(String orderNum, String offerIds, String salesNumber) throws Exception {
|
||||
if (checkToken()) {
|
||||
requestBody.setInterfaceName("QueryNumberOffer");
|
||||
Map<String, Object> body = new HashMap<>();
|
||||
|
||||
body.put("orderNo", orderNum);
|
||||
body.put("offerIds", offerIds);
|
||||
body.put("salesNumber", salesNumber);
|
||||
|
||||
log.info("body:" + body);
|
||||
System.out.println("body = " + body);
|
||||
requestBody.setEncryption(JSONUtil.toJsonStr(body), publicKey);
|
||||
HttpResponse httpResponse = HttpRequest.post(url)
|
||||
.header("token", token)
|
||||
.form(requestBody.toMap())
|
||||
.execute();
|
||||
// log.error("body:"+httpResponse.body());
|
||||
System.out.println("httpResponse.body() = " + httpResponse.body());
|
||||
if (httpResponse.isOk()) {
|
||||
CTResponse<JSONArray> response = JSONUtil.toBean(httpResponse.body(), CTResponse.class);
|
||||
response.setData(JSONUtil.parseObj(httpResponse.body()).getJSONArray("data"));
|
||||
return response;
|
||||
// try {
|
||||
// JSONArray data = response.getData();
|
||||
// response.setDecryptData(JSONUtil.parseObj(decrypt(data, publicKey)));
|
||||
// return response;
|
||||
// } catch (Exception e) {
|
||||
// response.setDecryptData(JSONUtil.parseObj(httpResponse.body()).getJSONObject("data"));
|
||||
// return response;
|
||||
// }
|
||||
|
||||
}
|
||||
log.error("response status:"+httpResponse.getStatus());
|
||||
log.error("request error");
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static final String DEFAULT_CODING = "utf-8";
|
||||
|
||||
/**
|
||||
* 解密
|
||||
* @param encryptedText 需要解密的密文字符串
|
||||
* @param key 密钥
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
public static String decrypt(String encryptedText, String key) throws Exception {
|
||||
byte[] encryptedBytes = parseHexStr2Byte(encryptedText);
|
||||
MessageDigest md = MessageDigest.getInstance("MD5");
|
||||
byte[] thedigest = md.digest(key.getBytes("utf-8"));
|
||||
SecretKeySpec skc = new SecretKeySpec(thedigest, "AES");
|
||||
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
|
||||
cipher.init(Cipher.DECRYPT_MODE, skc);
|
||||
byte[] decrypted = cipher.doFinal(encryptedBytes);
|
||||
return new String(decrypted, "utf-8");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 16 进制数组转字节数组
|
||||
*
|
||||
* @param hexStr 16 进制字符串
|
||||
* @return 字节数组
|
||||
*/
|
||||
private static byte[] parseHexStr2Byte(String hexStr) {
|
||||
if (hexStr.length() < 1) {
|
||||
return null;
|
||||
}
|
||||
byte[] result = new byte[hexStr.length() / 2];
|
||||
for (int i = 0; i < hexStr.length() / 2; i++) {
|
||||
int high = Integer.parseInt(hexStr.substring(i * 2, i * 2 + 1), 16);
|
||||
int low = Integer.parseInt(hexStr.substring(i * 2 + 1, i * 2 + 2), 16);
|
||||
result[i] = (byte) (high * 16 + low);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
System.out.println(decrypt("ce3169c7e36ee03af8d18d953aea916292498fc580687cfac135906b267c2d855da0d68071acecae28c7914490ddfe6ffa9175729adc6c22651ffac30fe55d407492588b8b20ff57f96b882b73e2d7fcabbf60766c6da4bb434eb7daeb976826c88aa28051cb559af7ff0e182787347e74403caedea161917e5f4ec2c4e43e557560b1c60a9f88ac6d580722a0d239fb29df9f94afaa41bfd8b0b93018d63c52ac1fb9071c233df9142d757cfa67d7b4282fb620fb614f88868908965e314ad71ee96d8208c59d01370507d7b4f39d59527e69af53bbf315807ee30ef63b80bb2bed76c52b0018b616aba12047a65608", "KEY657a695e0cf254f3bf10fe0a"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
112
ct/src/main/java/com/ruoyi/ct/service/impl/GoodServiceImpl.java
Executable file
112
ct/src/main/java/com/ruoyi/ct/service/impl/GoodServiceImpl.java
Executable file
@@ -0,0 +1,112 @@
|
||||
package com.ruoyi.ct.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.core.domain.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.ct.domain.bo.GoodBo;
|
||||
import com.ruoyi.ct.domain.vo.GoodVo;
|
||||
import com.ruoyi.ct.domain.Good;
|
||||
import com.ruoyi.ct.mapper.GoodMapper;
|
||||
import com.ruoyi.ct.service.IGoodService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 电信商品Service业务层处理
|
||||
*
|
||||
* @author isnail
|
||||
* @date 2023-12-18
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class GoodServiceImpl implements IGoodService {
|
||||
|
||||
private final GoodMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询电信商品
|
||||
*/
|
||||
@Override
|
||||
public GoodVo queryById(Long id){
|
||||
return baseMapper.selectVoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询电信商品列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<GoodVo> queryPageList(GoodBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<Good> lqw = buildQueryWrapper(bo);
|
||||
Page<GoodVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询电信商品列表
|
||||
*/
|
||||
@Override
|
||||
public List<GoodVo> queryList(GoodBo bo) {
|
||||
LambdaQueryWrapper<Good> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<Good> buildQueryWrapper(GoodBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<Good> lqw = Wrappers.lambdaQuery();
|
||||
lqw.like(StringUtils.isNotBlank(bo.getName()), Good::getName, bo.getName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getContent()), Good::getContent, bo.getContent());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getSaleId()), Good::getSaleId, bo.getSaleId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getStatus()), Good::getStatus, bo.getStatus());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电信商品
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(GoodBo bo) {
|
||||
Good add = BeanUtil.toBean(bo, Good.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setId(add.getId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电信商品
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(GoodBo bo) {
|
||||
Good update = BeanUtil.toBean(bo, Good.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(Good entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除电信商品
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteBatchIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user