|
|
@ -38,6 +38,7 @@ import org.apache.commons.codec.Charsets; |
|
|
|
import org.energy.modules.inspection.entity.InspectionRoute; |
|
|
|
import org.energy.modules.inspection.entity.InspectionRoute; |
|
|
|
import org.energy.modules.inspection.excel.InspectionRouteExcel; |
|
|
|
import org.energy.modules.inspection.excel.InspectionRouteExcel; |
|
|
|
import org.energy.modules.spares.excel.MaterialExcel; |
|
|
|
import org.energy.modules.spares.excel.MaterialExcel; |
|
|
|
|
|
|
|
import org.energy.modules.system.util.DataUtils; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
@ -195,8 +196,8 @@ public class MaterialController extends DafController { |
|
|
|
@GetMapping("/getDetailList") |
|
|
|
@GetMapping("/getDetailList") |
|
|
|
@ApiOperationSupport(order = 9) |
|
|
|
@ApiOperationSupport(order = 9) |
|
|
|
@ApiOperation(value = "获取物资信息", notes = "获取物资信息") |
|
|
|
@ApiOperation(value = "获取物资信息", notes = "获取物资信息") |
|
|
|
public R<Material> getDetailList(String materialNo) { |
|
|
|
public R<MaterialVO> getDetailList(String materialNo) { |
|
|
|
Material DetailList = materialService.getDetailList("'" + materialNo + "'"); |
|
|
|
MaterialVO DetailList = materialService.getDetailList(materialNo); |
|
|
|
return R.data(DetailList); |
|
|
|
return R.data(DetailList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -209,15 +210,15 @@ public class MaterialController extends DafController { |
|
|
|
@ApiOperation(value = "导出", notes = "传入") |
|
|
|
@ApiOperation(value = "导出", notes = "传入") |
|
|
|
@ApiLog |
|
|
|
@ApiLog |
|
|
|
public void exportMaterial(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { |
|
|
|
public void exportMaterial(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { |
|
|
|
if (entity.containsKey("station_equal")) { |
|
|
|
entity.remove("daf-auth"); |
|
|
|
entity.put("station_equal", Integer.parseInt((String) entity.get("station_equal"))); |
|
|
|
entity.forEach((key, value) -> { |
|
|
|
} |
|
|
|
if (!"station".equals(key)) |
|
|
|
|
|
|
|
{ |
|
|
|
QueryWrapper<Material> queryWrapper = Condition.getQueryWrapper(entity, Material.class); |
|
|
|
entity.put(key, "%" + value + "%"); |
|
|
|
queryWrapper.lambda().eq(Material::getIsDeleted, DafConstant.DB_NOT_DELETED); |
|
|
|
} |
|
|
|
queryWrapper.orderByAsc("material_no"); |
|
|
|
}); |
|
|
|
|
|
|
|
Material vo = DataUtils.mapToEntity(entity, Material::new); |
|
|
|
List<MaterialExcel> list = materialService.exportData(queryWrapper); |
|
|
|
List<MaterialExcel> list = materialService.exportData(vo); |
|
|
|
response.setContentType("application/vnd.ms-excel"); |
|
|
|
response.setContentType("application/vnd.ms-excel"); |
|
|
|
response.setCharacterEncoding(Charsets.UTF_8.name()); |
|
|
|
response.setCharacterEncoding(Charsets.UTF_8.name()); |
|
|
|
String fileName = URLEncoder.encode("物资数据导出", Charsets.UTF_8.name()); |
|
|
|
String fileName = URLEncoder.encode("物资数据导出", Charsets.UTF_8.name()); |
|
|
|