|
|
@ -10,9 +10,12 @@ import com.win.module.system.api.user.AdminUserApi; |
|
|
|
import com.win.module.system.api.user.dto.AdminUserRespDTO; |
|
|
|
import com.win.module.wms.controller.customerdock.vo.CustomerdockRespVO; |
|
|
|
import com.win.module.wms.controller.customeritem.vo.*; |
|
|
|
import com.win.module.wms.controller.itembasic.vo.ItembasicExcelVO; |
|
|
|
import com.win.module.wms.convert.customerdock.CustomerdockConvert; |
|
|
|
import com.win.module.wms.convert.customeritem.CustomeritemConvert; |
|
|
|
import com.win.module.wms.convert.itembasic.ItembasicConvert; |
|
|
|
import com.win.module.wms.dal.dataobject.customeritem.CustomeritemDO; |
|
|
|
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO; |
|
|
|
import com.win.module.wms.enums.DictTypeConstants; |
|
|
|
import com.win.module.wms.service.customeritem.CustomeritemService; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
@ -80,14 +83,6 @@ public class CustomeritemController { |
|
|
|
return success(CustomeritemConvert.INSTANCE.convert(customeritem)); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/list") |
|
|
|
@Operation(summary = "获得客户物品列表") |
|
|
|
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|
|
|
@PreAuthorize("@ss.hasPermission('wms:customeritem:query')") |
|
|
|
public CommonResult<List<CustomeritemRespVO>> getCustomeritemList(@RequestParam("ids") Collection<Long> ids) { |
|
|
|
List<CustomeritemDO> list = customeritemService.getCustomeritemList(ids); |
|
|
|
return success(CustomeritemConvert.INSTANCE.convertList(list)); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/page") |
|
|
|
@Operation(summary = "获得客户物品分页") |
|
|
@ -122,14 +117,21 @@ public class CustomeritemController { |
|
|
|
public void exportCustomeritemExcel(@Valid CustomeritemExportReqVO exportReqVO, |
|
|
|
HttpServletResponse response) throws IOException { |
|
|
|
List<CustomeritemDO> list = customeritemService.getCustomeritemList(exportReqVO); |
|
|
|
// 导出 Excel
|
|
|
|
List<CustomeritemExcelVO> datas = CustomeritemConvert.INSTANCE.convertList02(list); |
|
|
|
for(CustomeritemExcelVO vo : datas) { |
|
|
|
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); |
|
|
|
//后端创建个字段作为前端展示的虚拟字段
|
|
|
|
vo.setCreator(user.getNickname()); |
|
|
|
} |
|
|
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
|
|
|
List<CustomeritemExcelVO> resultList = this.getExcelVo(list, mapDropDown); |
|
|
|
ExcelUtils.write(response, "客户物品.xlsx", "数据", CustomeritemExcelVO.class, resultList, mapDropDown); |
|
|
|
} |
|
|
|
@PostMapping("/export-excel-senior") |
|
|
|
@Operation(summary = "导出客户物品 Excel") |
|
|
|
@PreAuthorize("@ss.hasPermission('wms:customeritem:export')") |
|
|
|
@OperateLog(type = EXPORT) |
|
|
|
public void exportCustomeritemExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException { |
|
|
|
List<CustomeritemDO> list = customeritemService.getCustomeritemList(conditions); |
|
|
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
|
|
|
List<CustomeritemExcelVO> resultList = this.getExcelVo(list, mapDropDown); |
|
|
|
ExcelUtils.write(response, "客户物品.xlsx", "数据", CustomeritemExcelVO.class, resultList, mapDropDown); |
|
|
|
} |
|
|
|
private List<CustomeritemExcelVO> getExcelVo(List<CustomeritemDO> list, Map<Integer, String[]> mapDropDown) { |
|
|
|
String[] cusotmerUom = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.UOM); |
|
|
|
mapDropDown.put(3, cusotmerUom); |
|
|
|
String[] packUnit = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.PACK_UNIT); |
|
|
@ -138,7 +140,14 @@ public class CustomeritemController { |
|
|
|
mapDropDown.put(7, altPackUnit); |
|
|
|
String[] available = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE); |
|
|
|
mapDropDown.put(10, available); |
|
|
|
ExcelUtils.write(response, "客户物品.xls", "数据", CustomeritemExcelVO.class, datas,mapDropDown); |
|
|
|
// 导出 Excel
|
|
|
|
List<CustomeritemExcelVO> resultList = CustomeritemConvert.INSTANCE.convertList02(list); |
|
|
|
for(CustomeritemExcelVO vo : resultList) { |
|
|
|
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); |
|
|
|
//后端创建个字段作为前端展示的虚拟字段
|
|
|
|
vo.setCreator(user.getNickname()); |
|
|
|
} |
|
|
|
return resultList; |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/get-import-template") |
|
|
|