|
|
@ -3,19 +3,13 @@ package com.win.module.wms.controller.rule; |
|
|
|
import com.win.framework.common.pojo.CommonResult; |
|
|
|
import com.win.framework.common.pojo.CustomConditions; |
|
|
|
import com.win.framework.common.pojo.PageResult; |
|
|
|
import com.win.framework.dict.core.util.DictFrameworkUtils; |
|
|
|
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.ItembasicExportReqVO; |
|
|
|
import com.win.module.wms.controller.rule.vo.*; |
|
|
|
import com.win.module.wms.convert.itembasic.ItembasicConvert; |
|
|
|
import com.win.module.wms.convert.rule.RuleConvert; |
|
|
|
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO; |
|
|
|
import com.win.module.wms.dal.dataobject.rule.RuleDO; |
|
|
|
import com.win.module.wms.enums.DictTypeConstants; |
|
|
|
import com.win.module.wms.service.rule.RuleService; |
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
import io.swagger.v3.oas.annotations.Parameter; |
|
|
@ -27,7 +21,6 @@ import org.springframework.web.bind.annotation.*; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.servlet.http.HttpServletResponse; |
|
|
|
import javax.validation.Valid; |
|
|
|
|
|
|
|
import java.io.IOException; |
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
@ -80,6 +73,7 @@ public class RuleController { |
|
|
|
RuleDO rule = ruleService.getRule(id); |
|
|
|
return success(RuleConvert.INSTANCE.convert(rule)); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/senior") |
|
|
|
@Operation(summary = "高级搜索获得物品基本信息分页") |
|
|
|
@PreAuthorize("@ss.hasPermission('wms:rule:query')") |
|
|
@ -109,17 +103,26 @@ public class RuleController { |
|
|
|
List<HashMap<String, Object>> list = ruleService.getPrecisionStrategyByItemCodes(reqVO); |
|
|
|
return success(list); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/getPrecisionStrategy") |
|
|
|
@Operation(summary = "根据零件号和库位号查询管理精度策略") |
|
|
|
@PreAuthorize("@ss.hasPermission('wms:rule:query')") |
|
|
|
public CommonResult<Object> getPrecisionStrategy(@Valid @RequestBody List<PrecisionStrategyReqVO2> reqVO2List) { |
|
|
|
List<HashMap<String, Object>> list = ruleService.getPrecisionStrategy(reqVO2List); |
|
|
|
return success(list); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("/export-excel") |
|
|
|
@Operation(summary = "导出规则配置 Excel") |
|
|
|
@PreAuthorize("@ss.hasPermission('wms:rule:export')") |
|
|
|
@OperateLog(type = EXPORT) |
|
|
|
public void exportRuleExcel(@Valid RuleExportReqVO exportReqVO, |
|
|
|
HttpServletResponse response) throws IOException { |
|
|
|
public void exportRuleExcel(@Valid RuleExportReqVO exportReqVO, HttpServletResponse response) throws IOException { |
|
|
|
List<RuleDO> list =ruleService.getRuleList(exportReqVO); |
|
|
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
|
|
|
List<RuleExcelVO> resultList = this.getExcelVo(list, mapDropDown); |
|
|
|
ExcelUtils.write(response, "物品基本信息.xlsx", "数据", RuleExcelVO.class, resultList, mapDropDown); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping("/export-excel-senior") |
|
|
|
@Operation(summary = "导出规则配置 Excel") |
|
|
|
@PreAuthorize("@ss.hasPermission('wms:rule:export')") |
|
|
@ -130,8 +133,8 @@ public class RuleController { |
|
|
|
List<RuleExcelVO> resultList = this.getExcelVo(list, mapDropDown); |
|
|
|
ExcelUtils.write(response, "物品基本信息.xlsx", "数据", RuleExcelVO.class, resultList, mapDropDown); |
|
|
|
} |
|
|
|
private List<RuleExcelVO> getExcelVo(List<RuleDO> list, Map<Integer, String[]> mapDropDown) { |
|
|
|
|
|
|
|
private List<RuleExcelVO> getExcelVo(List<RuleDO> list, Map<Integer, String[]> mapDropDown) { |
|
|
|
// 导出 Excel
|
|
|
|
List<RuleExcelVO> resultList = RuleConvert.INSTANCE.convertList02(list); |
|
|
|
for(RuleExcelVO vo : resultList) { |
|
|
|