|
|
@ -10,8 +10,11 @@ import com.win.module.system.api.user.AdminUserApi; |
|
|
|
import com.win.module.system.api.user.dto.AdminUserRespDTO; |
|
|
|
import com.win.module.wms.controller.configurationsetting.vo.ConfigurationsettingRespVO; |
|
|
|
import com.win.module.wms.controller.configurationsetting.vo.*; |
|
|
|
import com.win.module.wms.controller.itembasic.vo.ItembasicExcelVO; |
|
|
|
import com.win.module.wms.convert.configurationsetting.ConfigurationsettingConvert; |
|
|
|
import com.win.module.wms.convert.itembasic.ItembasicConvert; |
|
|
|
import com.win.module.wms.dal.dataobject.configurationsetting.ConfigurationsettingDO; |
|
|
|
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO; |
|
|
|
import com.win.module.wms.enums.DictTypeConstants; |
|
|
|
import com.win.module.wms.service.configurationsetting.ConfigurationsettingService; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
@ -79,15 +82,6 @@ public class ConfigurationsettingController { |
|
|
|
return success(ConfigurationsettingConvert.INSTANCE.convert(configurationsetting)); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/list") |
|
|
|
@Operation(summary = "获得配置设置列表") |
|
|
|
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|
|
|
@PreAuthorize("@ss.hasPermission('wms:configurationsetting:query')") |
|
|
|
public CommonResult<List<ConfigurationsettingRespVO>> getConfigurationsettingList(@RequestParam("ids") Collection<Long> ids) { |
|
|
|
List<ConfigurationsettingDO> list = configurationsettingService.getConfigurationsettingList(ids); |
|
|
|
return success(ConfigurationsettingConvert.INSTANCE.convertList(list)); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/page") |
|
|
|
@Operation(summary = "获得配置设置分页") |
|
|
|
@PreAuthorize("@ss.hasPermission('wms:configurationsetting:query')") |
|
|
@ -115,22 +109,37 @@ public class ConfigurationsettingController { |
|
|
|
public void exportConfigurationsettingExcel(@Valid ConfigurationsettingExportReqVO exportReqVO, |
|
|
|
HttpServletResponse response) throws IOException { |
|
|
|
List<ConfigurationsettingDO> list = configurationsettingService.getConfigurationsettingList(exportReqVO); |
|
|
|
// 导出 Excel
|
|
|
|
List<ConfigurationsettingExcelVO> datas = ConfigurationsettingConvert.INSTANCE.convertList02(list); |
|
|
|
for(ConfigurationsettingExcelVO vo : datas) { |
|
|
|
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); |
|
|
|
//后端创建个字段作为前端展示的虚拟字段
|
|
|
|
vo.setCreator(user.getNickname()); |
|
|
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
|
|
|
List<ConfigurationsettingExcelVO> resultList = this.getExcelVo(list, mapDropDown); |
|
|
|
ExcelUtils.write(response, "配置设置.xlsx", "数据", ConfigurationsettingExcelVO.class, resultList, mapDropDown); |
|
|
|
} |
|
|
|
@PostMapping("/export-excel-senior") |
|
|
|
@Operation(summary = "导出配置设置 Excel") |
|
|
|
@PreAuthorize("@ss.hasPermission('wms:configurationsetting:export')") |
|
|
|
@OperateLog(type = EXPORT) |
|
|
|
public void exportConfigurationsettingExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException { |
|
|
|
List<ConfigurationsettingDO> list = configurationsettingService.getConfigurationsettingList(conditions); |
|
|
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
|
|
|
List<ConfigurationsettingExcelVO> resultList = this.getExcelVo(list, mapDropDown); |
|
|
|
ExcelUtils.write(response, "配置设置.xlsx", "数据", ConfigurationsettingExcelVO.class, resultList, mapDropDown); |
|
|
|
} |
|
|
|
private List<ConfigurationsettingExcelVO> getExcelVo(List<ConfigurationsettingDO> list, Map<Integer, String[]> mapDropDown) { |
|
|
|
String[] strategyType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.STRATEGY_TYPE); |
|
|
|
mapDropDown.put(0, strategyType); |
|
|
|
String[] isRequired = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE); |
|
|
|
mapDropDown.put(3, isRequired); |
|
|
|
String[] dataType = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.DATA_TYPE); |
|
|
|
mapDropDown.put(4, dataType); |
|
|
|
ExcelUtils.write(response, "配置设置.xls", "数据", ConfigurationsettingExcelVO.class, datas,mapDropDown); |
|
|
|
// 导出 Excel
|
|
|
|
List<ConfigurationsettingExcelVO> resultList = ConfigurationsettingConvert.INSTANCE.convertList02(list); |
|
|
|
for(ConfigurationsettingExcelVO 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 { |
|
|
|