mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-12 04:16:51 +08:00
提交导å发起推荐 ¥导入
This commit is contained in:
@@ -17,6 +17,11 @@
|
|||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-all</artifactId>
|
||||||
|
<version>5.8.16</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.xboe</groupId>
|
<groupId>com.xboe</groupId>
|
||||||
<artifactId>xboe-api</artifactId>
|
<artifactId>xboe-api</artifactId>
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
package com.xboe.module.boecase.api;
|
package com.xboe.module.boecase.api;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import cn.hutool.poi.excel.ExcelReader;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import cn.hutool.poi.excel.ExcelUtil;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import io.netty.util.internal.ObjectUtil;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import com.xboe.common.utils.StringUtil;
|
import com.xboe.common.utils.StringUtil;
|
||||||
import com.xboe.core.JsonResponse;
|
import com.xboe.core.JsonResponse;
|
||||||
@@ -18,10 +20,11 @@ import com.xboe.module.boecase.entity.Recommend;
|
|||||||
import com.xboe.module.boecase.service.IRecommendService;
|
import com.xboe.module.boecase.service.IRecommendService;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 案例推荐表
|
* 案例推荐表
|
||||||
* */
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping(value = "xboe/m/boe/recommend")
|
@RequestMapping(value = "xboe/m/boe/recommend")
|
||||||
@@ -29,9 +32,10 @@ public class RecommendApi extends ApiBaseController {
|
|||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IRecommendService recommendService;
|
private IRecommendService recommendService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推荐
|
* 推荐
|
||||||
* */
|
*/
|
||||||
@PostMapping("/save")
|
@PostMapping("/save")
|
||||||
@AutoLog(module = "案例推荐", action = "推荐案例", info = "推荐案例")
|
@AutoLog(module = "案例推荐", action = "推荐案例", info = "推荐案例")
|
||||||
public JsonResponse<Boolean> save(String id, AcceptVo acceptVo) {
|
public JsonResponse<Boolean> save(String id, AcceptVo acceptVo) {
|
||||||
@@ -46,9 +50,10 @@ public class RecommendApi extends ApiBaseController {
|
|||||||
return error("推荐失败", e.getMessage());
|
return error("推荐失败", e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 推荐列表
|
* 推荐列表
|
||||||
* */
|
*/
|
||||||
@GetMapping("/query")
|
@GetMapping("/query")
|
||||||
public JsonResponse<List<Recommend>> selectRecommend() {
|
public JsonResponse<List<Recommend>> selectRecommend() {
|
||||||
List<Recommend> recommends = recommendService.selectRecommend();
|
List<Recommend> recommends = recommendService.selectRecommend();
|
||||||
@@ -56,5 +61,13 @@ public class RecommendApi extends ApiBaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PostMapping("/import")
|
||||||
|
public JsonResponse<String> excelImport(@RequestParam("file") MultipartFile file) throws Exception {
|
||||||
|
ExcelReader reader = ExcelUtil.getReader(file.getInputStream());
|
||||||
|
List<List<Object>> read = reader.read();
|
||||||
|
|
||||||
|
return success(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.xboe.module.boecase.dao;
|
||||||
|
|
||||||
|
import com.xboe.core.orm.BaseDao;
|
||||||
|
import com.xboe.module.boecase.entity.CasesRecommendLaunchImport;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class CasesRecommendLaunchImportDao extends BaseDao<CasesRecommendLaunchImport> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.xboe.module.boecase.dao;
|
||||||
|
|
||||||
|
import com.xboe.core.orm.BaseDao;
|
||||||
|
import com.xboe.module.boecase.entity.CasesRecommendLaunchImportData;
|
||||||
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
|
@Repository
|
||||||
|
public class CasesRecommendLaunchImportDataDao extends BaseDao<CasesRecommendLaunchImportData> {
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.xboe.module.boecase.entity;
|
||||||
|
|
||||||
|
import com.xboe.core.SysConstant;
|
||||||
|
import com.xboe.core.orm.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案例推荐发起导入
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Table(name = SysConstant.TABLE_PRE + "cases_recommend_launch_import")
|
||||||
|
public class CasesRecommendLaunchImport extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 总条数
|
||||||
|
*/
|
||||||
|
@Column(name = "total_num",length = 20)
|
||||||
|
private Long totalNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成功条数
|
||||||
|
*/
|
||||||
|
@Column(name = "success_num",length = 20)
|
||||||
|
private Long successNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 失败条数
|
||||||
|
*/
|
||||||
|
@Column(name = "fail_num",length = 20)
|
||||||
|
private Long failNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上传状态1进行中2成功3失败
|
||||||
|
*/
|
||||||
|
@Column(name = "process_status",length = 20)
|
||||||
|
private Integer processStatus;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.xboe.module.boecase.entity;
|
||||||
|
|
||||||
|
import com.xboe.core.SysConstant;
|
||||||
|
import com.xboe.core.orm.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 案例推荐发起导入
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Entity
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@Table(name = SysConstant.TABLE_PRE + "cases_recommend_launch_import")
|
||||||
|
public class CasesRecommendLaunchImportData extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入id
|
||||||
|
*/
|
||||||
|
@Column(name = "import_id", length = 20)
|
||||||
|
private String importId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入类容第一例标题
|
||||||
|
*/
|
||||||
|
@Column(name = "case_title")
|
||||||
|
private String caseTitle;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入类容匹配的案例id
|
||||||
|
*/
|
||||||
|
@Column(name = "case_id")
|
||||||
|
private String caseId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态1成功2失败
|
||||||
|
*/
|
||||||
|
@Column(name = "status")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package com.xboe.module.boecase.service;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public interface ICasesRecommendLaunchImportDataService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.xboe.module.boecase.service;
|
||||||
|
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ICasesRecommendLaunchImportService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入数据
|
||||||
|
*
|
||||||
|
* @param dataList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
String importData(List<List<Object>> dataList);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.xboe.module.boecase.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xboe.module.boecase.service.ICasesRecommendLaunchImportDataService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CasesRecommendLaunchImportDataServiceImpl implements ICasesRecommendLaunchImportDataService {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package com.xboe.module.boecase.service.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.xboe.module.boecase.service.ICasesRecommendLaunchImportService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class CasesRecommendLaunchImportServiceImpl implements ICasesRecommendLaunchImportService {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String importData(List<List<Object>> dataList) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user