|
|
|
|
@ -22,10 +22,13 @@ import org.springblade.core.mp.support.Condition; |
|
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
|
import org.springblade.core.secure.BladeUser; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.BeanUtil; |
|
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
import org.springblade.core.tool.utils.Func; |
|
|
|
|
import org.springblade.desk.basic.constant.BAModuleConst; |
|
|
|
|
import org.springblade.desk.basic.excel.MaterialQuotaExcel; |
|
|
|
|
import org.springblade.desk.basic.excel.PlanAssignSteerExcel; |
|
|
|
|
import org.springblade.desk.basic.pojo.entity.MaterialQuota; |
|
|
|
|
import org.springblade.desk.basic.pojo.entity.PlanAssignSteer; |
|
|
|
|
import org.springblade.desk.basic.pojo.vo.PlanAssignSteerVO; |
|
|
|
|
import org.springblade.desk.basic.service.IPlanAssignSteerService; |
|
|
|
|
@ -35,6 +38,7 @@ import org.springframework.http.ResponseEntity; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
@ -80,6 +84,8 @@ public class PlanAssignSteerController extends BladeController { |
|
|
|
|
public R<IPage<PlanAssignSteerVO>> list(@Parameter(hidden = true) @RequestParam Map<String, Object> planAssignSteer, |
|
|
|
|
Query query) { |
|
|
|
|
QueryWrapper<PlanAssignSteer> qw = Condition.getQueryWrapper(planAssignSteer, PlanAssignSteer.class); |
|
|
|
|
qw.eq(planAssignSteer.containsKey("platingId"), PlanAssignSteer.COL_PLATING_ID, Func.toInt(planAssignSteer.get("platingId"))); |
|
|
|
|
|
|
|
|
|
IPage<PlanAssignSteer> pages = service.page(Condition.getPage(query), qw); |
|
|
|
|
IPage<PlanAssignSteerVO> pagesVO = PlanAssignSteerWrapper.build().pageVO(pages); |
|
|
|
|
pagesVO.getRecords() |
|
|
|
|
@ -226,13 +232,23 @@ public class PlanAssignSteerController extends BladeController { |
|
|
|
|
@ApiOperationSupport(order = 72) |
|
|
|
|
@Operation(summary = "导入Excel", description = "MultipartFile") |
|
|
|
|
public R importExcel(@RequestParam("file") MultipartFile file) { |
|
|
|
|
R checkR = ExcelExtUtil.importExcelCheck(file); |
|
|
|
|
if (checkR != null) { |
|
|
|
|
return checkR; |
|
|
|
|
} |
|
|
|
|
List<PlanAssignSteer> importList = ExcelUtil.read( |
|
|
|
|
file, 0, 1, PlanAssignSteer.class |
|
|
|
|
); |
|
|
|
|
return R.status(service.saveBatch(importList)); |
|
|
|
|
// R checkR = ExcelExtUtil.importExcelCheck(file);
|
|
|
|
|
// if (checkR != null) {
|
|
|
|
|
// return checkR;
|
|
|
|
|
// }
|
|
|
|
|
// List<PlanAssignSteer> importList = ExcelUtil.read(
|
|
|
|
|
// file, 0, 1, PlanAssignSteer.class
|
|
|
|
|
// );
|
|
|
|
|
// return R.status(service.saveBatch(importList));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<PlanAssignSteer> noticeList = new ArrayList<>(); |
|
|
|
|
List<PlanAssignSteerExcel> list = ExcelUtil.read(file, PlanAssignSteerExcel.class); |
|
|
|
|
list.forEach(noticeExcel -> { |
|
|
|
|
|
|
|
|
|
PlanAssignSteer notice = BeanUtil.copy(noticeExcel, PlanAssignSteer.class); |
|
|
|
|
noticeList.add(notice); |
|
|
|
|
}); |
|
|
|
|
return R.data(service.saveBatch(noticeList)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|