|
|
@ -8,10 +8,12 @@ import com.win.framework.excel.core.util.ExcelUtils; |
|
|
|
import com.win.framework.operatelog.core.annotations.OperateLog; |
|
|
|
import com.win.module.system.api.user.AdminUserApi; |
|
|
|
import com.win.module.system.api.user.dto.AdminUserRespDTO; |
|
|
|
import com.win.module.wms.controller.itembasic.vo.ItembasicExcelVO; |
|
|
|
import com.win.module.wms.controller.itembasic.vo.ItembasicRespVO; |
|
|
|
import com.win.module.wms.controller.itempackaging.vo.*; |
|
|
|
import com.win.module.wms.convert.itembasic.ItembasicConvert; |
|
|
|
import com.win.module.wms.convert.itempackaging.ItempackagingConvert; |
|
|
|
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO; |
|
|
|
import com.win.module.wms.dal.dataobject.itempackaging.ItempackagingDO; |
|
|
|
import com.win.module.wms.enums.DictTypeConstants; |
|
|
|
import com.win.module.wms.service.itempackaging.ItempackagingService; |
|
|
@ -79,14 +81,14 @@ public class ItempackagingController { |
|
|
|
return success(ItempackagingConvert.INSTANCE.convert(itempackaging)); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/list") |
|
|
|
@Operation(summary = "获得物品包装信息 列表") |
|
|
|
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|
|
|
@PreAuthorize("@ss.hasPermission('wms:itempackaging:query')") |
|
|
|
public CommonResult<List<ItempackagingRespVO>> getItempackagingList(@RequestParam("ids") Collection<Long> ids) { |
|
|
|
List<ItempackagingDO> list = itempackagingService.getItempackagingList(ids); |
|
|
|
return success(ItempackagingConvert.INSTANCE.convertList(list)); |
|
|
|
} |
|
|
|
// @GetMapping("/list")
|
|
|
|
// @Operation(summary = "获得物品包装信息 列表")
|
|
|
|
// @Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
|
|
|
|
// @PreAuthorize("@ss.hasPermission('wms:itempackaging:query')")
|
|
|
|
// public CommonResult<List<ItempackagingRespVO>> getItempackagingList(@RequestParam("ids") Collection<Long> ids) {
|
|
|
|
// List<ItempackagingDO> list = itempackagingService.getItempackagingList(ids);
|
|
|
|
// return success(ItempackagingConvert.INSTANCE.convertList(list));
|
|
|
|
// }
|
|
|
|
|
|
|
|
@GetMapping("/page") |
|
|
|
@Operation(summary = "获得物品包装信息分页") |
|
|
@ -130,6 +132,20 @@ public class ItempackagingController { |
|
|
|
vo.setCreator(user.getNickname()); |
|
|
|
} |
|
|
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
|
|
|
|
|
|
|
ExcelUtils.write(response, "物品包装信息 .xls", "数据", ItempackagingExcelVO.class, datas,mapDropDown); |
|
|
|
} |
|
|
|
@PostMapping("/export-excel-senior") |
|
|
|
@Operation(summary = "导出物品包装信息 Excel") |
|
|
|
@PreAuthorize("@ss.hasPermission('wms:itembasic:export')") |
|
|
|
@OperateLog(type = EXPORT) |
|
|
|
public void exportItempackagingExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException { |
|
|
|
List<ItempackagingDO> list = itempackagingService.getItempackagingList(conditions); |
|
|
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
|
|
|
List<ItempackagingExcelVO> resultList = this.getExcelVo(list, mapDropDown); |
|
|
|
ExcelUtils.write(response, "物品包装信息.xlsx", "数据", ItempackagingExcelVO.class, resultList, mapDropDown); |
|
|
|
} |
|
|
|
private List<ItempackagingExcelVO> getExcelVo(List<ItempackagingDO> list, Map<Integer, String[]> mapDropDown) { |
|
|
|
String[] uom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM); |
|
|
|
mapDropDown.put(1, uom); |
|
|
|
String[] description = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM); |
|
|
@ -144,9 +160,17 @@ public class ItempackagingController { |
|
|
|
mapDropDown.put(11, altPackUnit4);; |
|
|
|
String[] available = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE); |
|
|
|
mapDropDown.put(13, available);; |
|
|
|
ExcelUtils.write(response, "物品包装信息 .xls", "数据", ItempackagingExcelVO.class, datas,mapDropDown); |
|
|
|
// 导出 Excel
|
|
|
|
List<ItempackagingExcelVO> resultList = ItempackagingConvert.INSTANCE.convertList02(list); |
|
|
|
for(ItempackagingExcelVO vo : resultList) { |
|
|
|
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); |
|
|
|
//后端创建个字段作为前端展示的虚拟字段
|
|
|
|
vo.setCreator(user.getNickname()); |
|
|
|
} |
|
|
|
return resultList; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/get-import-template") |
|
|
|
@Operation(summary = "获得导入物品包装信息模板") |
|
|
|
public void importTemplate(HttpServletResponse response) throws IOException { |
|
|
|