|
|
@@ -1,12 +1,20 @@
|
|
|
package com.zhongzheng.controller.common;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
|
+import cn.hutool.core.lang.Validator;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
|
+import com.zhongzheng.common.annotation.Log;
|
|
|
import com.zhongzheng.common.config.RuoYiConfig;
|
|
|
import com.zhongzheng.common.constant.Constants;
|
|
|
+import com.zhongzheng.common.core.controller.BaseController;
|
|
|
import com.zhongzheng.common.core.domain.AjaxResult;
|
|
|
+import com.zhongzheng.common.core.page.TableDataInfo;
|
|
|
+import com.zhongzheng.common.enums.BusinessType;
|
|
|
+import com.zhongzheng.common.type.EncryptHandler;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.common.utils.ToolsUtils;
|
|
|
import com.zhongzheng.common.utils.file.FileUploadUtils;
|
|
|
@@ -14,23 +22,38 @@ import com.zhongzheng.common.utils.file.FileUtils;
|
|
|
import com.zhongzheng.common.utils.poi.ExcelUtil;
|
|
|
import com.zhongzheng.framework.config.ServerConfig;
|
|
|
import com.zhongzheng.framework.web.service.WxLoginService;
|
|
|
+import com.zhongzheng.modules.activity.vo.ActivityGoodsPriceVo;
|
|
|
import com.zhongzheng.modules.base.bo.ConfigQueryBo;
|
|
|
+import com.zhongzheng.modules.distribution.bo.DistributionActivityGoodsQueryBo;
|
|
|
+import com.zhongzheng.modules.distribution.bo.DistributionCashWithdrawalPayBo;
|
|
|
+import com.zhongzheng.modules.distribution.service.IDistributionActivityGoodsService;
|
|
|
+import com.zhongzheng.modules.distribution.service.IDistributionCashWithdrawalService;
|
|
|
+import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
|
|
|
+import com.zhongzheng.modules.distribution.vo.DistributionSellerVo;
|
|
|
+import com.zhongzheng.modules.goods.bo.AlikeGoodsBo;
|
|
|
import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
|
|
|
import com.zhongzheng.modules.goods.bo.GoodsStudyUrlBo;
|
|
|
import com.zhongzheng.modules.goods.bo.UserGoodsListBo;
|
|
|
import com.zhongzheng.modules.goods.service.IGoodsService;
|
|
|
import com.zhongzheng.modules.goods.vo.GoodsJzsVo;
|
|
|
+import com.zhongzheng.modules.goods.vo.GoodsVo;
|
|
|
import com.zhongzheng.modules.goods.vo.UserGoodsListVo;
|
|
|
import com.zhongzheng.modules.grade.bo.*;
|
|
|
import com.zhongzheng.modules.grade.service.IClassGradeService;
|
|
|
import com.zhongzheng.modules.grade.service.IUserPeriodService;
|
|
|
import com.zhongzheng.modules.grade.vo.SyncGoodsExport;
|
|
|
+import com.zhongzheng.modules.order.bo.TopOldOrderRefundBo;
|
|
|
import com.zhongzheng.modules.order.domain.Order;
|
|
|
import com.zhongzheng.modules.order.domain.OrderGoods;
|
|
|
+import com.zhongzheng.modules.order.service.IOrderGoodsRefundService;
|
|
|
import com.zhongzheng.modules.order.service.IOrderGoodsService;
|
|
|
import com.zhongzheng.modules.order.service.IOrderService;
|
|
|
+import com.zhongzheng.modules.order.vo.OrderGoodsVo;
|
|
|
import com.zhongzheng.modules.system.bo.SysTenantAdminBo;
|
|
|
+import com.zhongzheng.modules.system.bo.SysTenantAdminOldBo;
|
|
|
+import com.zhongzheng.modules.system.bo.SysTenantQueryBo;
|
|
|
import com.zhongzheng.modules.system.domain.SysTenant;
|
|
|
+import com.zhongzheng.modules.system.service.ISysConfigService;
|
|
|
import com.zhongzheng.modules.system.service.ISysTenantService;
|
|
|
import com.zhongzheng.modules.system.service.ISysWebService;
|
|
|
import com.zhongzheng.modules.system.vo.SysTenantVo;
|
|
|
@@ -44,6 +67,7 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.MediaType;
|
|
|
+import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
@@ -64,8 +88,7 @@ import java.util.stream.Collectors;
|
|
|
* @author zhongzheng
|
|
|
*/
|
|
|
@RestController
|
|
|
-public class CommonController
|
|
|
-{
|
|
|
+public class CommonController extends BaseController {
|
|
|
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
|
|
|
|
|
@Autowired
|
|
|
@@ -87,28 +110,36 @@ public class CommonController
|
|
|
@Autowired
|
|
|
private IWxPayService iWxPayService;
|
|
|
@Autowired
|
|
|
- private IClassGradeService iClassGradeService;
|
|
|
+ private IClassGradeService iClassGradeService;
|
|
|
@Autowired
|
|
|
private ISysTenantService iSysTenantService;
|
|
|
@Autowired
|
|
|
private IUserService iUserService;
|
|
|
@Autowired
|
|
|
- private ITopSysTenantRegisterService iTopSysTenantRegisterService;
|
|
|
+ private ITopSysTenantRegisterService iTopSysTenantRegisterService;
|
|
|
@Autowired
|
|
|
- private ISysWebService webService;
|
|
|
+ private ISysWebService webService;
|
|
|
+ @Autowired
|
|
|
+ private ISysConfigService configService;
|
|
|
+ @Autowired
|
|
|
+ private IDistributionCashWithdrawalService iDistributionCashWithdrawalService;
|
|
|
+ @Autowired
|
|
|
+ private IDistributionSellerService iDistributionSellerService;
|
|
|
+ @Autowired
|
|
|
+ private IDistributionActivityGoodsService iDistributionActivityGoodsService;
|
|
|
+ @Autowired
|
|
|
+ private IOrderGoodsRefundService iOrderGoodsRefundService;
|
|
|
+
|
|
|
/**
|
|
|
* 通用下载请求
|
|
|
*
|
|
|
* @param fileName 文件名称
|
|
|
- * @param delete 是否删除
|
|
|
+ * @param delete 是否删除
|
|
|
*/
|
|
|
@GetMapping("common/download")
|
|
|
- public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- if (!FileUtils.checkAllowDownload(fileName))
|
|
|
- {
|
|
|
+ public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request) {
|
|
|
+ try {
|
|
|
+ if (!FileUtils.checkAllowDownload(fileName)) {
|
|
|
throw new Exception(StrUtil.format("文件名称({})非法,不允许下载。 ", fileName));
|
|
|
}
|
|
|
String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
|
|
|
@@ -122,9 +153,7 @@ public class CommonController
|
|
|
FileUtils.deleteFile(filePath);
|
|
|
}*/
|
|
|
FileUtils.deleteFile(filePath);
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
+ } catch (Exception e) {
|
|
|
log.error("下载文件失败", e);
|
|
|
}
|
|
|
}
|
|
|
@@ -133,10 +162,8 @@ public class CommonController
|
|
|
* 通用上传请求
|
|
|
*/
|
|
|
@PostMapping("/common/upload")
|
|
|
- public AjaxResult uploadFile(MultipartFile file) throws Exception
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
+ public AjaxResult uploadFile(MultipartFile file) throws Exception {
|
|
|
+ try {
|
|
|
// 上传文件路径
|
|
|
String filePath = RuoYiConfig.getUploadPath();
|
|
|
// 上传并返回新文件名称
|
|
|
@@ -146,59 +173,50 @@ public class CommonController
|
|
|
ajax.put("fileName", fileName);
|
|
|
ajax.put("url", url);
|
|
|
return ajax;
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
+ } catch (Exception e) {
|
|
|
return AjaxResult.error(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 本地资源通用下载
|
|
|
*/
|
|
|
@GetMapping("/common/download/resource")
|
|
|
public void resourceDownload(String resource, HttpServletRequest request, HttpServletResponse response)
|
|
|
- throws Exception
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
- if (!FileUtils.checkAllowDownload(resource))
|
|
|
- {
|
|
|
+ throws Exception {
|
|
|
+ try {
|
|
|
+ if (!FileUtils.checkAllowDownload(resource)) {
|
|
|
throw new Exception(StrUtil.format("资源文件({})非法,不允许下载。 ", resource));
|
|
|
}
|
|
|
// 本地资源路径
|
|
|
String localPath = RuoYiConfig.getProfile();
|
|
|
// 数据库资源地址
|
|
|
- String downloadPath = localPath + StrUtil.subAfter(resource, Constants.RESOURCE_PREFIX,false);
|
|
|
+ String downloadPath = localPath + StrUtil.subAfter(resource, Constants.RESOURCE_PREFIX, false);
|
|
|
// 下载名称
|
|
|
- String downloadName = StrUtil.subAfter(downloadPath, "/",true);
|
|
|
+ String downloadName = StrUtil.subAfter(downloadPath, "/", true);
|
|
|
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE);
|
|
|
FileUtils.setAttachmentResponseHeader(response, downloadName);
|
|
|
FileUtils.writeBytes(downloadPath, response.getOutputStream());
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
+ } catch (Exception e) {
|
|
|
log.error("下载文件失败", e);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@ApiOperation("获取继教二建的商品结构列表")
|
|
|
@GetMapping("common/jzs/goodsList")
|
|
|
- public AjaxResult<GoodsJzsVo> goodsList()
|
|
|
- {
|
|
|
+ public AjaxResult<GoodsJzsVo> goodsList() {
|
|
|
GoodsQueryBo queryBo = new GoodsQueryBo();
|
|
|
List<SyncGoodsExport> goodsJzsVoList = iGoodsService.selectRjJzsList(queryBo);
|
|
|
ExcelUtil<SyncGoodsExport> util = new ExcelUtil<SyncGoodsExport>(SyncGoodsExport.class);
|
|
|
- // ExcelUtil<SyncGoodsExport> util = new ExcelUtil<>(SyncGoodsExport.class);
|
|
|
+ // ExcelUtil<SyncGoodsExport> util = new ExcelUtil<>(SyncGoodsExport.class);
|
|
|
return util.exportEasyExcel(util.exportEasyData(goodsJzsVoList), "继建商品");
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@ApiOperation("测试列表")
|
|
|
@PostMapping("common/jzs/test")
|
|
|
- public AjaxResult<Void> testList(@RequestBody UserPeriodEditBo bo)
|
|
|
- {
|
|
|
+ public AjaxResult<Void> testList(@RequestBody UserPeriodEditBo bo) {
|
|
|
UserPeriodEditBo queryBo = new UserPeriodEditBo();
|
|
|
queryBo.setGoodsId(1085L);
|
|
|
queryBo.setGradeId(978L);
|
|
|
@@ -209,9 +227,8 @@ public class CommonController
|
|
|
|
|
|
@ApiOperation("旧系统打回重审")
|
|
|
@PostMapping("common/rollback/period")
|
|
|
- public AjaxResult<Void> rollbackPeriod(@RequestBody RollBackPeriodBo bo)
|
|
|
- {
|
|
|
- if(!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(),bo.getSign())){
|
|
|
+ public AjaxResult<Void> rollbackPeriod(@RequestBody RollBackPeriodBo bo) {
|
|
|
+ if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
|
|
|
return AjaxResult.error("签名错误");
|
|
|
}
|
|
|
UserPeriodEditBo queryBo = new UserPeriodEditBo();
|
|
|
@@ -223,9 +240,8 @@ public class CommonController
|
|
|
|
|
|
@ApiOperation("旧系统获取用户商品信息")
|
|
|
@PostMapping("common/get/goods")
|
|
|
- public AjaxResult getUserGoodsList(@RequestBody UserGoodsListBo bo)
|
|
|
- {
|
|
|
- if(!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(),bo.getSign())){
|
|
|
+ public AjaxResult getUserGoodsList(@RequestBody UserGoodsListBo bo) {
|
|
|
+ if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
|
|
|
return AjaxResult.error("签名错误");
|
|
|
}
|
|
|
List<UserGoodsListVo> voList = iGoodsService.getUserGoodsList(bo);
|
|
|
@@ -235,9 +251,8 @@ public class CommonController
|
|
|
|
|
|
@ApiOperation("旧系统获取商品学习中心路径")
|
|
|
@PostMapping("common/get/goods/studyUrl")
|
|
|
- public AjaxResult getGoodsStudyUrl(@RequestBody GoodsStudyUrlBo bo)
|
|
|
- {
|
|
|
- if(!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(),bo.getSign())){
|
|
|
+ public AjaxResult getGoodsStudyUrl(@RequestBody GoodsStudyUrlBo bo) {
|
|
|
+ if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
|
|
|
return AjaxResult.error("签名错误");
|
|
|
}
|
|
|
String studyUrl = iGoodsService.getGoodsStudyUrl(bo);
|
|
|
@@ -246,20 +261,19 @@ public class CommonController
|
|
|
|
|
|
@ApiOperation("批量查询官方班级人数")
|
|
|
@PostMapping("common/free/batch/officialGradeCount")
|
|
|
- public AjaxResult batchOfficialGradeCount(@RequestBody ClassGradeBatchQueryBo bo)
|
|
|
- {
|
|
|
- if(!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(),bo.getSign())){
|
|
|
+ public AjaxResult batchOfficialGradeCount(@RequestBody ClassGradeBatchQueryBo bo) {
|
|
|
+ if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
|
|
|
return AjaxResult.error("签名错误");
|
|
|
}
|
|
|
String[] list = bo.getOfficialNameStr().split(",");
|
|
|
- List<Map<String,Object>> numList = new ArrayList<>();
|
|
|
- for(String officialName : list){
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
+ List<Map<String, Object>> numList = new ArrayList<>();
|
|
|
+ for (String officialName : list) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
ClassGradeQueryBo queryBo = new ClassGradeQueryBo();
|
|
|
queryBo.setOfficialName(officialName);
|
|
|
- map.put("officialName",officialName);
|
|
|
+ map.put("officialName", officialName);
|
|
|
Integer num = iClassGradeService.queryOfficialGradeCount(queryBo);
|
|
|
- map.put("num",num);
|
|
|
+ map.put("num", num);
|
|
|
numList.add(map);
|
|
|
}
|
|
|
return AjaxResult.success(numList);
|
|
|
@@ -268,7 +282,7 @@ public class CommonController
|
|
|
@ApiOperation("查询官方班级详情")
|
|
|
@PostMapping("common/free/officialGradeDetail")
|
|
|
public AjaxResult officialGradeDetail(@RequestBody ClassNpUserInfoBo bo) {
|
|
|
- if(!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(),bo.getSign())){
|
|
|
+ if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
|
|
|
return AjaxResult.error("签名错误");
|
|
|
}
|
|
|
return AjaxResult.success(iClassGradeService.officialGradeDetail(bo));
|
|
|
@@ -277,7 +291,7 @@ public class CommonController
|
|
|
@ApiOperation("查询预开班官方班级编号")
|
|
|
@PostMapping("common/free/officialGrade/num")
|
|
|
public AjaxResult getOfficialGradeNum(@RequestBody ClassOfficialNumBo bo) {
|
|
|
- if(!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(),bo.getSign())){
|
|
|
+ if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
|
|
|
return AjaxResult.error("签名错误");
|
|
|
}
|
|
|
return AjaxResult.success(iClassGradeService.getOfficialGradeNum(bo));
|
|
|
@@ -286,7 +300,7 @@ public class CommonController
|
|
|
@ApiOperation("预报名班级开班")
|
|
|
@PostMapping("common/free/open/class")
|
|
|
public AjaxResult openOfficialGrade(@RequestBody ClassGradeOpenBo bo) {
|
|
|
- if(!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(),bo.getSign())){
|
|
|
+ if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
|
|
|
return AjaxResult.error("签名错误");
|
|
|
}
|
|
|
iClassGradeService.openOfficialGrade(bo);
|
|
|
@@ -295,32 +309,39 @@ public class CommonController
|
|
|
|
|
|
@ApiOperation("测试分班")
|
|
|
@GetMapping("common/jzs/grade")
|
|
|
- public AjaxResult<Void> testGrade()
|
|
|
- {
|
|
|
- // iClassGradeService.checkEjjjPeopleNumLimit(195L,984L);
|
|
|
- iUserService.batchUpdateTelId();
|
|
|
+ public AjaxResult<Void> testGrade() {
|
|
|
+ // iClassGradeService.checkEjjjPeopleNumLimit(195L,984L);
|
|
|
+ // iUserService.batchUpdateTelId();
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
|
|
|
@ApiOperation("获取商品分享码")
|
|
|
@PostMapping("/shareGoodsCode")
|
|
|
- public AjaxResult getWxSmallAccessToken(@RequestBody WxShareGoodsBo bo)
|
|
|
- {
|
|
|
+ public AjaxResult getWxSmallAccessToken(@RequestBody WxShareGoodsBo bo) {
|
|
|
String token = wxLoginService.shareGoodsCode(bo);
|
|
|
return AjaxResult.success(token);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("获取同价格商品")
|
|
|
+ @PostMapping("/common/alike/goods")
|
|
|
+ public AjaxResult getAlikeGoods(@RequestBody AlikeGoodsBo bo) {
|
|
|
+ if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
|
|
|
+ return AjaxResult.error("签名错误");
|
|
|
+ }
|
|
|
+ List<GoodsVo> voList = iGoodsService.getAlikeGoods(bo);
|
|
|
+ return AjaxResult.success(voList);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("推送分销商品")
|
|
|
@PostMapping("/toshareGoods")
|
|
|
- public AjaxResult toshareGoods(@RequestBody WxShareGoodsBo bo)
|
|
|
- {
|
|
|
+ public AjaxResult toshareGoods(@RequestBody WxShareGoodsBo bo) {
|
|
|
String out_trade_no = "22110210122554298238";
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
map.put("order_sn", out_trade_no);
|
|
|
List<OrderGoods> goodsList = iOrderGoodsService.listByMap(map);
|
|
|
Order order = iOrderService.getOne(new LambdaQueryWrapper<Order>().eq(Order::getOrderSn, out_trade_no));
|
|
|
- iWxPayService.shareToOldSys(order,goodsList);
|
|
|
+ iWxPayService.shareToOldSys(order, goodsList);
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
@@ -331,12 +352,51 @@ public class CommonController
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("创建新机构后台(旧系统)")
|
|
|
+ @PostMapping("common/create/tenant/admin/old")
|
|
|
+ public AjaxResult createTenantAdminOld(@RequestBody SysTenantAdminOldBo bo) {
|
|
|
+ iSysTenantService.createTenantAdminOld(bo);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("同步其他机构角色菜单")
|
|
|
+ @PostMapping("common/update/role")
|
|
|
+ public AjaxResult updateRoleTenant(@RequestBody List<Long> tenantIds) {
|
|
|
+ iSysTenantService.updateRoleTenant(tenantIds);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("同步其他机构字典")
|
|
|
+ @PostMapping("common/update/dict")
|
|
|
+ public AjaxResult updateDictTenant(@RequestBody List<Long> tenantIds) {
|
|
|
+ iSysTenantService.updateDictTenant(tenantIds);
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总平台退款支付
|
|
|
+ */
|
|
|
+ @ApiOperation("总平台退款支付")
|
|
|
+ @PostMapping("/common/platform/pay")
|
|
|
+ public AjaxResult<Void> platformRefundPay(@RequestBody List<TopOldOrderRefundBo> bo) {
|
|
|
+ return toAjax(iOrderGoodsRefundService.platformRefundPay(bo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 总平台退款支付订单处理
|
|
|
+ */
|
|
|
+ @ApiOperation("总平台退款支付订单处理")
|
|
|
+ @PostMapping("/common/platform/pay/handle")
|
|
|
+ public AjaxResult<Void> platformRefundPayHandle(@RequestBody List<OrderGoodsVo> orderGoodsVos) {
|
|
|
+ return toAjax(iOrderGoodsRefundService.handleRefundOrder(orderGoodsVos) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
@ApiOperation("获取企业列表")
|
|
|
@GetMapping("common/tenant/list")
|
|
|
public AjaxResult<List<SysTenantVo>> getTenantList() {
|
|
|
String tenant = ServletUtils.getRequest().getHeader("TenantId");
|
|
|
List<SysTenant> list = iSysTenantService.list();
|
|
|
- if (CollectionUtils.isEmpty(list)){
|
|
|
+ if (CollectionUtils.isEmpty(list)) {
|
|
|
return AjaxResult.success(new ArrayList<>());
|
|
|
}
|
|
|
List<SysTenantVo> collect = list.stream().filter(x -> !x.getTenantId().equals(Long.valueOf(tenant)))
|
|
|
@@ -347,16 +407,16 @@ public class CommonController
|
|
|
@ApiOperation("机构注册开通")
|
|
|
@PostMapping("common/free/tenant/register")
|
|
|
public AjaxResult tenantRegister(@RequestBody TopSysTenantRegisterAddBo bo) {
|
|
|
- if(!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(),bo.getSign())){
|
|
|
+ if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
|
|
|
return AjaxResult.error("签名错误");
|
|
|
}
|
|
|
- return AjaxResult.success("成功",iTopSysTenantRegisterService.insertByAddBo(bo) ? 1 : 0);
|
|
|
+ return AjaxResult.success("成功", iTopSysTenantRegisterService.insertByAddBo(bo) ? 1 : 0);
|
|
|
}
|
|
|
|
|
|
@ApiOperation("重启服务restart")
|
|
|
@PostMapping("common/free/webRestart")
|
|
|
public AjaxResult<Void> webRestart(@RequestBody ConfigQueryBo bo) {
|
|
|
- if(!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(),bo.getSign())){
|
|
|
+ if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
|
|
|
return AjaxResult.error("签名错误");
|
|
|
}
|
|
|
webService.restartWebService();
|
|
|
@@ -369,4 +429,111 @@ public class CommonController
|
|
|
iTopSysTenantRegisterService.test(new TopSysTenantRegisterAddBo());
|
|
|
return AjaxResult.success();
|
|
|
}*/
|
|
|
+
|
|
|
+ @ApiOperation("登录双重验证")
|
|
|
+ @GetMapping("common/free/dual_auth")
|
|
|
+ public AjaxResult<String> dual_auth() {
|
|
|
+ String dualAuth = configService.selectConfigByKey("login.dual.auth");
|
|
|
+ return AjaxResult.success("成功", dualAuth);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("decodeTel加密")
|
|
|
+ @GetMapping("common/free/decodeTel")
|
|
|
+ public AjaxResult<String> decodeTel(String key) {
|
|
|
+ return AjaxResult.success("成功", EncryptHandler.decrypt(key));
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("分销打款结果回调")
|
|
|
+ @PreAuthorize("@ss.hasPermi('system:withdrawal:add')")
|
|
|
+ @Log(title = "打款", businessType = BusinessType.INSERT)
|
|
|
+ @PostMapping("/common/free/payCashCallBack")
|
|
|
+ public AjaxResult payCashCallBack(@RequestBody DistributionCashWithdrawalPayBo bo) {
|
|
|
+ if (!ToolsUtils.checkSignCwSnFromOldSys(bo.getCwSn(), bo.getStamp().toString(), bo.getSign())) {
|
|
|
+ return AjaxResult.error("签名错误");
|
|
|
+ }
|
|
|
+ return AjaxResult.success("成功", iDistributionCashWithdrawalService.payCashCallBack(bo) ? 1 : 0);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取企业ID
|
|
|
+ */
|
|
|
+ @ApiOperation("获取企业ID")
|
|
|
+ @GetMapping("common/free/findTenantId")
|
|
|
+ public AjaxResult<String> findTenantId(SysTenantQueryBo bo) {
|
|
|
+ Long tenantId = iSysTenantService.findTenantId(bo);
|
|
|
+ if (Validator.isNotEmpty(tenantId)) {
|
|
|
+ return AjaxResult.success("成功", tenantId.toString());
|
|
|
+ } else {
|
|
|
+ if (Validator.isNotEmpty(bo.getHostH5()) && bo.getHostH5().equals("120.79.166.78:19012")) {
|
|
|
+ return AjaxResult.success("成功", "867735392558919680");
|
|
|
+ }
|
|
|
+ if (Validator.isNotEmpty(bo.getHostLive()) && bo.getHostLive().equals("120.79.166.78:19012")) {
|
|
|
+ return AjaxResult.success("成功", "867735392558919680");
|
|
|
+ }
|
|
|
+ if (Validator.isNotEmpty(bo.getHostPc()) && bo.getHostPc().equals("120.79.166.78:19012")) {
|
|
|
+ return AjaxResult.success("成功", "867735392558919680");
|
|
|
+ }
|
|
|
+ if (Validator.isNotEmpty(bo.getHostAdmin()) && bo.getHostAdmin().equals("120.79.166.78:19012")) {
|
|
|
+ return AjaxResult.success("成功", "867735392558919680");
|
|
|
+ }
|
|
|
+ if (Validator.isNotEmpty(bo.getHostH5Seller()) && bo.getHostH5Seller().equals("120.79.166.78:19012")) {
|
|
|
+ return AjaxResult.success("成功", "867735392558919680");
|
|
|
+ }
|
|
|
+ return AjaxResult.error(511, "失败", null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取企业ID
|
|
|
+ */
|
|
|
+ @ApiOperation("获取系统配置")
|
|
|
+ @GetMapping("common/free/config")
|
|
|
+ public AjaxResult<Map<String, Object>> findConfig(SysTenantQueryBo bo) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ String jsonStr = configService.selectConfigByKey("home.header");
|
|
|
+ JSONObject objectJson = JSON.parseObject(jsonStr);
|
|
|
+ map.put("companyName", String.valueOf(objectJson.get("companyName")));
|
|
|
+ return AjaxResult.success(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("获取微信参数")
|
|
|
+ @GetMapping("app/common/wx/config")
|
|
|
+ public AjaxResult<Map<String, Object>> wxConfig() {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ String smallAppId = configService.selectConfigByKey("wx.small.appid");
|
|
|
+ String gzhAppId = configService.selectConfigByKey("wx.gzh.appid");
|
|
|
+ map.put("smallAppId", smallAppId);
|
|
|
+ map.put("gzhAppId", gzhAppId);
|
|
|
+ return AjaxResult.success(map);
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("移动端配置参数")
|
|
|
+ @GetMapping("app/common/mobileConfig")
|
|
|
+ public AjaxResult<Map<String, Object>> mobileConfig(ConfigQueryBo bo) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
+ String json = configService.selectConfigByKey("home.mobile");
|
|
|
+ map.put("mobileConfig", json);
|
|
|
+ return AjaxResult.success(map);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("通过分享code查询业务员用户信息")
|
|
|
+ @GetMapping("app/common/distribution/getInfoByShareCode")
|
|
|
+ public AjaxResult<DistributionSellerVo> getInfoByShareCode(String shareCode) {
|
|
|
+ DistributionSellerVo vo = iDistributionSellerService.queryByShareCode(shareCode);
|
|
|
+ vo.setNull();
|
|
|
+ String jsonStr = configService.selectConfigByKey("home.header");
|
|
|
+ JSONObject objectJson = JSON.parseObject(jsonStr);
|
|
|
+ vo.setTenantName(String.valueOf(objectJson.get("companyName")));
|
|
|
+ return AjaxResult.success(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("获取分销活动商品列表")
|
|
|
+ @GetMapping("app/common/distribution/getGoodsList")
|
|
|
+ public TableDataInfo<ActivityGoodsPriceVo> distributionGoodsList(DistributionActivityGoodsQueryBo bo) {
|
|
|
+ startPage();
|
|
|
+ List<ActivityGoodsPriceVo> list = iDistributionActivityGoodsService.getGoodsList(bo);
|
|
|
+ return getDataTable(list);
|
|
|
+ }
|
|
|
}
|