|
@ -8,11 +8,14 @@ import com.win.framework.excel.core.util.ExcelUtils; |
|
|
import com.win.framework.operatelog.core.annotations.OperateLog; |
|
|
import com.win.framework.operatelog.core.annotations.OperateLog; |
|
|
import com.win.module.system.api.user.AdminUserApi; |
|
|
import com.win.module.system.api.user.AdminUserApi; |
|
|
import com.win.module.system.api.user.dto.AdminUserRespDTO; |
|
|
import com.win.module.system.api.user.dto.AdminUserRespDTO; |
|
|
|
|
|
import com.win.module.wms.controller.itembasic.vo.ItembasicExcelVO; |
|
|
import com.win.module.wms.controller.project.vo.ProjectRespVO; |
|
|
import com.win.module.wms.controller.project.vo.ProjectRespVO; |
|
|
import com.win.module.wms.controller.saleprice.vo.*; |
|
|
import com.win.module.wms.controller.saleprice.vo.*; |
|
|
import com.win.module.wms.controller.saleprice.vo.SalepriceImportExcelVo; |
|
|
import com.win.module.wms.controller.saleprice.vo.SalepriceImportExcelVo; |
|
|
|
|
|
import com.win.module.wms.convert.itembasic.ItembasicConvert; |
|
|
import com.win.module.wms.convert.project.ProjectConvert; |
|
|
import com.win.module.wms.convert.project.ProjectConvert; |
|
|
import com.win.module.wms.convert.saleprice.SalepriceConvert; |
|
|
import com.win.module.wms.convert.saleprice.SalepriceConvert; |
|
|
|
|
|
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO; |
|
|
import com.win.module.wms.dal.dataobject.saleprice.SalepriceDO; |
|
|
import com.win.module.wms.dal.dataobject.saleprice.SalepriceDO; |
|
|
import com.win.module.wms.enums.DictTypeConstants; |
|
|
import com.win.module.wms.enums.DictTypeConstants; |
|
|
import com.win.module.wms.service.saleprice.SalepriceService; |
|
|
import com.win.module.wms.service.saleprice.SalepriceService; |
|
@ -81,14 +84,6 @@ public class SalepriceController { |
|
|
return success(SalepriceConvert.INSTANCE.convert(saleprice)); |
|
|
return success(SalepriceConvert.INSTANCE.convert(saleprice)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@GetMapping("/list") |
|
|
|
|
|
@Operation(summary = "获得销售价格单列表") |
|
|
|
|
|
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048") |
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('wms:saleprice:query')") |
|
|
|
|
|
public CommonResult<List<SalepriceRespVO>> getSalepriceList(@RequestParam("ids") Collection<Long> ids) { |
|
|
|
|
|
List<SalepriceDO> list = salepriceService.getSalepriceList(ids); |
|
|
|
|
|
return success(SalepriceConvert.INSTANCE.convertList(list)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@GetMapping("/page") |
|
|
@GetMapping("/page") |
|
|
@Operation(summary = "获得销售价格单分页") |
|
|
@Operation(summary = "获得销售价格单分页") |
|
@ -123,20 +118,35 @@ public class SalepriceController { |
|
|
public void exportSalepriceExcel(@Valid SalepriceExportReqVO exportReqVO, |
|
|
public void exportSalepriceExcel(@Valid SalepriceExportReqVO exportReqVO, |
|
|
HttpServletResponse response) throws IOException { |
|
|
HttpServletResponse response) throws IOException { |
|
|
List<SalepriceDO> list = salepriceService.getSalepriceList(exportReqVO); |
|
|
List<SalepriceDO> list = salepriceService.getSalepriceList(exportReqVO); |
|
|
// 导出 Excel
|
|
|
|
|
|
List<SalepriceExcelVO> datas = SalepriceConvert.INSTANCE.convertList02(list); |
|
|
|
|
|
for(SalepriceExcelVO vo : datas) { |
|
|
|
|
|
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); |
|
|
|
|
|
//后端创建个字段作为前端展示的虚拟字段
|
|
|
|
|
|
vo.setCreator(user.getNickname()); |
|
|
|
|
|
} |
|
|
|
|
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
|
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
|
|
|
|
|
List<SalepriceExcelVO> resultList = this.getExcelVo(list, mapDropDown); |
|
|
|
|
|
ExcelUtils.write(response, "销售价格单.xlsx", "数据", SalepriceExcelVO.class, resultList, mapDropDown); |
|
|
|
|
|
} |
|
|
|
|
|
@PostMapping("/export-excel-senior") |
|
|
|
|
|
@Operation(summary = "导出销售价格单 Excel") |
|
|
|
|
|
@PreAuthorize("@ss.hasPermission('wms:saleprice:export')") |
|
|
|
|
|
@OperateLog(type = EXPORT) |
|
|
|
|
|
public void exportSalepriceExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException { |
|
|
|
|
|
List<SalepriceDO> list =salepriceService.getSalepriceList(conditions); |
|
|
|
|
|
Map<Integer, String[]> mapDropDown = new HashMap<>(); |
|
|
|
|
|
List<SalepriceExcelVO> resultList = this.getExcelVo(list, mapDropDown); |
|
|
|
|
|
ExcelUtils.write(response, "销售价格单.xlsx", "数据", SalepriceExcelVO.class, resultList, mapDropDown); |
|
|
|
|
|
} |
|
|
|
|
|
private List<SalepriceExcelVO> getExcelVo(List<SalepriceDO> list, Map<Integer, String[]> mapDropDown) { |
|
|
String[] available = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE); |
|
|
String[] available = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE); |
|
|
mapDropDown.put(4, available); |
|
|
mapDropDown.put(4, available); |
|
|
String[] currency = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.CURRENCY); |
|
|
String[] currency = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.CURRENCY); |
|
|
mapDropDown.put(2, currency); |
|
|
mapDropDown.put(2, currency); |
|
|
ExcelUtils.write(response, "销售价格单.xls", "数据", SalepriceExcelVO.class, datas,mapDropDown); |
|
|
// 导出 Excel
|
|
|
|
|
|
List<SalepriceExcelVO> resultList = SalepriceConvert.INSTANCE.convertList02(list); |
|
|
|
|
|
for(SalepriceExcelVO vo : resultList) { |
|
|
|
|
|
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); |
|
|
|
|
|
//后端创建个字段作为前端展示的虚拟字段
|
|
|
|
|
|
vo.setCreator(user.getNickname()); |
|
|
|
|
|
} |
|
|
|
|
|
return resultList; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@GetMapping("/get-import-template") |
|
|
@GetMapping("/get-import-template") |
|
|
@Operation(summary = "获得导销售价格单信息模板") |
|
|
@Operation(summary = "获得导销售价格单信息模板") |
|
|
public void importTemplate(HttpServletResponse response) throws IOException { |
|
|
public void importTemplate(HttpServletResponse response) throws IOException { |
|
|