|
@@ -14,9 +14,7 @@ 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.exception.CustomException;
|
|
|
import com.zhongzheng.common.type.EncryptHandler;
|
|
|
-import com.zhongzheng.common.utils.DateUtils;
|
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
|
import com.zhongzheng.common.utils.ToolsUtils;
|
|
|
import com.zhongzheng.common.utils.file.FileUploadUtils;
|
|
@@ -26,9 +24,6 @@ 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.course.domain.CourseFile;
|
|
|
-import com.zhongzheng.modules.course.service.ICourseFileService;
|
|
|
-import com.zhongzheng.modules.course.service.ICourseHandoutsService;
|
|
|
import com.zhongzheng.modules.distribution.bo.DistributionActivityGoodsQueryBo;
|
|
|
import com.zhongzheng.modules.distribution.bo.DistributionCashWithdrawalPayBo;
|
|
|
import com.zhongzheng.modules.distribution.service.IDistributionActivityGoodsService;
|
|
@@ -76,17 +71,11 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
-import java.io.BufferedOutputStream;
|
|
|
-import java.io.File;
|
|
|
-import java.io.FileOutputStream;
|
|
|
-import java.nio.charset.Charset;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.stream.Collectors;
|
|
|
-import java.util.zip.ZipEntry;
|
|
|
-import java.util.zip.ZipInputStream;
|
|
|
|
|
|
/**
|
|
|
* 通用请求处理
|
|
@@ -94,8 +83,7 @@ import java.util.zip.ZipInputStream;
|
|
|
* @author zhongzheng
|
|
|
*/
|
|
|
@RestController
|
|
|
-public class CommonController extends BaseController
|
|
|
-{
|
|
|
+public class CommonController extends BaseController {
|
|
|
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
|
|
|
|
|
|
@Autowired
|
|
@@ -117,40 +105,34 @@ public class CommonController extends BaseController
|
|
|
@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;
|
|
|
+ private IDistributionSellerService iDistributionSellerService;
|
|
|
@Autowired
|
|
|
- private IDistributionActivityGoodsService iDistributionActivityGoodsService;
|
|
|
- @Autowired
|
|
|
- private ICourseHandoutsService iCourseHandoutsService;
|
|
|
- @Autowired
|
|
|
- private ICourseFileService iCourseFileService;
|
|
|
+ private IDistributionActivityGoodsService iDistributionActivityGoodsService;
|
|
|
+
|
|
|
/**
|
|
|
* 通用下载请求
|
|
|
*
|
|
|
* @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);
|
|
@@ -164,9 +146,7 @@ public class CommonController extends BaseController
|
|
|
FileUtils.deleteFile(filePath);
|
|
|
}*/
|
|
|
FileUtils.deleteFile(filePath);
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
+ } catch (Exception e) {
|
|
|
log.error("下载文件失败", e);
|
|
|
}
|
|
|
}
|
|
@@ -175,10 +155,8 @@ public class CommonController extends BaseController
|
|
|
* 通用上传请求
|
|
|
*/
|
|
|
@PostMapping("/common/upload")
|
|
|
- public AjaxResult uploadFile(MultipartFile file) throws Exception
|
|
|
- {
|
|
|
- try
|
|
|
- {
|
|
|
+ public AjaxResult uploadFile(MultipartFile file) throws Exception {
|
|
|
+ try {
|
|
|
// 上传文件路径
|
|
|
String filePath = RuoYiConfig.getUploadPath();
|
|
|
// 上传并返回新文件名称
|
|
@@ -188,143 +166,50 @@ public class CommonController extends BaseController
|
|
|
ajax.put("fileName", fileName);
|
|
|
ajax.put("url", url);
|
|
|
return ajax;
|
|
|
- }
|
|
|
- catch (Exception e)
|
|
|
- {
|
|
|
+ } catch (Exception e) {
|
|
|
return AjaxResult.error(e.getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
- /**
|
|
|
- * 通用上传请求
|
|
|
- */
|
|
|
- @PostMapping("/common/decompression")
|
|
|
- public AjaxResult uploadDecompression(MultipartFile file) throws Exception {
|
|
|
- String destDirPath = "D:/workpro/saas_entrepot/zhongzheng-admin/src/main/resources/cesz";
|
|
|
- ZipInputStream zipIn = new ZipInputStream(file.getInputStream(),Charset.forName("GBK"));
|
|
|
- ZipEntry entry = zipIn.getNextEntry();
|
|
|
- while (entry != null) {
|
|
|
- String entryName = entry.getName();
|
|
|
- String filePath = destDirPath + File.separator + entryName;
|
|
|
- if (entry.isDirectory()) {
|
|
|
- File dir = new File(filePath);
|
|
|
- dir.mkdirs();
|
|
|
- } else {
|
|
|
- BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath));
|
|
|
- byte[] bytesIn = new byte[4096];
|
|
|
- int read = 0;
|
|
|
- while ((read = zipIn.read(bytesIn)) != -1) {
|
|
|
- bos.write(bytesIn, 0, read);
|
|
|
- }
|
|
|
- bos.close();
|
|
|
- }
|
|
|
- zipIn.closeEntry();
|
|
|
- entry = zipIn.getNextEntry();
|
|
|
- }
|
|
|
- zipIn.close();
|
|
|
- //处理讲义文件
|
|
|
- getFileNames(new File(destDirPath),0L,999L);
|
|
|
- return AjaxResult.success();
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 得到文件名称
|
|
|
- *
|
|
|
- * @param file 文件
|
|
|
- * @param parentId 父ID
|
|
|
- * @return {@link List}<{@link String}>
|
|
|
- */
|
|
|
- private void getFileNames(File file,Long parentId,Long handoutsId) {
|
|
|
- File[] files = file.listFiles();
|
|
|
- for (File f : files) {
|
|
|
- if (f.isDirectory()) {
|
|
|
- //文件夹
|
|
|
- CourseFile courseFile = new CourseFile();
|
|
|
- courseFile.setUrlName(f.getName());
|
|
|
- courseFile.setStatus(1);
|
|
|
- courseFile.setSort(1);
|
|
|
- courseFile.setCreateTime(DateUtils.getNowTime());
|
|
|
- courseFile.setUpdateTime(DateUtils.getNowTime());
|
|
|
- courseFile.setHandoutsId(handoutsId);
|
|
|
- courseFile.setType(2);//文件夹
|
|
|
- courseFile.setParentId(parentId);
|
|
|
- iCourseFileService.save(courseFile);
|
|
|
- getFileNames(f, courseFile.getFileId(),handoutsId);
|
|
|
- } else {
|
|
|
- try {
|
|
|
- //文件
|
|
|
- CourseFile courseFile = new CourseFile();
|
|
|
- //上传oss
|
|
|
- // 上传文件路径
|
|
|
- String filePath = RuoYiConfig.getUploadPath();
|
|
|
- String fileName = FileUploadUtils.upload(filePath, FileUtils.getMultipartFile(f));
|
|
|
- String url = serverConfig.getUrl() + fileName;
|
|
|
- courseFile.setUrlName(f.getName());
|
|
|
- courseFile.setUrl(url);
|
|
|
- courseFile.setStatus(1);
|
|
|
- courseFile.setSort(1);
|
|
|
- courseFile.setCreateTime(DateUtils.getNowTime());
|
|
|
- courseFile.setUpdateTime(DateUtils.getNowTime());
|
|
|
- courseFile.setHandoutsId(handoutsId);
|
|
|
- courseFile.setType(1);//文件
|
|
|
- courseFile.setParentId(parentId);
|
|
|
- iCourseFileService.save(courseFile);
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
- throw new CustomException("上传文件失败");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 本地资源通用下载
|
|
|
*/
|
|
|
@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);
|
|
@@ -335,9 +220,8 @@ public class CommonController extends BaseController
|
|
|
|
|
|
@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();
|
|
@@ -349,9 +233,8 @@ public class CommonController extends BaseController
|
|
|
|
|
|
@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);
|
|
@@ -361,9 +244,8 @@ public class CommonController extends BaseController
|
|
|
|
|
|
@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);
|
|
@@ -372,20 +254,19 @@ public class CommonController extends BaseController
|
|
|
|
|
|
@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);
|
|
@@ -394,7 +275,7 @@ public class CommonController extends BaseController
|
|
|
@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));
|
|
@@ -403,7 +284,7 @@ public class CommonController extends BaseController
|
|
|
@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));
|
|
@@ -412,7 +293,7 @@ public class CommonController extends BaseController
|
|
|
@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);
|
|
@@ -421,32 +302,29 @@ public class CommonController extends BaseController
|
|
|
|
|
|
@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("/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();
|
|
|
}
|
|
|
|
|
@@ -483,7 +361,7 @@ public class CommonController extends BaseController
|
|
|
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)))
|
|
@@ -494,16 +372,16 @@ public class CommonController extends BaseController
|
|
|
@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();
|
|
@@ -521,7 +399,7 @@ public class CommonController extends BaseController
|
|
|
@GetMapping("common/free/dual_auth")
|
|
|
public AjaxResult<String> dual_auth() {
|
|
|
String dualAuth = configService.selectConfigByKey("login.dual.auth");
|
|
|
- return AjaxResult.success("成功",dualAuth);
|
|
|
+ return AjaxResult.success("成功", dualAuth);
|
|
|
}
|
|
|
|
|
|
@ApiOperation("decodeTel")
|
|
@@ -535,7 +413,7 @@ public class CommonController extends BaseController
|
|
|
@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())){
|
|
|
+ if (!ToolsUtils.checkSignCwSnFromOldSys(bo.getCwSn(), bo.getStamp().toString(), bo.getSign())) {
|
|
|
return AjaxResult.error("签名错误");
|
|
|
}
|
|
|
return AjaxResult.success("成功", iDistributionCashWithdrawalService.payCashCallBack(bo) ? 1 : 0);
|
|
@@ -548,25 +426,25 @@ public class CommonController extends BaseController
|
|
|
@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(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.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.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.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");
|
|
|
+ if (Validator.isNotEmpty(bo.getHostH5Seller()) && bo.getHostH5Seller().equals("120.79.166.78:19012")) {
|
|
|
+ return AjaxResult.success("成功", "867735392558919680");
|
|
|
}
|
|
|
- return AjaxResult.error(511,"失败",null);
|
|
|
+ return AjaxResult.error(511, "失败", null);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -575,39 +453,38 @@ public class CommonController extends BaseController
|
|
|
*/
|
|
|
@ApiOperation("获取系统配置")
|
|
|
@GetMapping("common/free/config")
|
|
|
- public AjaxResult<Map<String,Object>> findConfig(SysTenantQueryBo bo) {
|
|
|
- Map<String,Object> map = new HashMap<>();
|
|
|
+ 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")));
|
|
|
+ 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<>();
|
|
|
+ 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);
|
|
|
+ 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<>();
|
|
|
+ public AjaxResult<Map<String, Object>> mobileConfig(ConfigQueryBo bo) {
|
|
|
+ Map<String, Object> map = new HashMap<>();
|
|
|
String json = configService.selectConfigByKey("home.mobile");
|
|
|
- map.put("mobileConfig",json);
|
|
|
+ map.put("mobileConfig", json);
|
|
|
return AjaxResult.success(map);
|
|
|
}
|
|
|
|
|
|
|
|
|
@ApiOperation("通过分享code查询业务员用户信息")
|
|
|
@GetMapping("app/common/distribution/getInfoByShareCode")
|
|
|
- public AjaxResult<DistributionSellerVo> getInfoByShareCode(String shareCode)
|
|
|
- {
|
|
|
+ public AjaxResult<DistributionSellerVo> getInfoByShareCode(String shareCode) {
|
|
|
DistributionSellerVo vo = iDistributionSellerService.queryByShareCode(shareCode);
|
|
|
vo.setNull();
|
|
|
String jsonStr = configService.selectConfigByKey("home.header");
|
|
@@ -619,8 +496,7 @@ public class CommonController extends BaseController
|
|
|
|
|
|
@ApiOperation("获取分销活动商品列表")
|
|
|
@GetMapping("app/common/distribution/getGoodsList")
|
|
|
- public TableDataInfo<ActivityGoodsPriceVo> distributionGoodsList(DistributionActivityGoodsQueryBo bo)
|
|
|
- {
|
|
|
+ public TableDataInfo<ActivityGoodsPriceVo> distributionGoodsList(DistributionActivityGoodsQueryBo bo) {
|
|
|
startPage();
|
|
|
List<ActivityGoodsPriceVo> list = iDistributionActivityGoodsService.getGoodsList(bo);
|
|
|
return getDataTable(list);
|