Browse Source

创建人从缓存获取数据

master_hella_20240701
赵雪冰 1 year ago
parent
commit
203b6ee85b
  1. 18
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/accountcalendar/AccountcalendarController.java
  2. 11
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/areabasic/AreabasicController.java
  3. 21
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/balance/BalanceController.java
  4. 9
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/barcode/BarcodeController.java
  5. 10
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/bom/BomController.java
  6. 7
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/businesstype/BusinesstypeController.java
  7. 56
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/callmaterials/CallmaterialsController.java
  8. 12
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/carrier/CarrierController.java

18
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/accountcalendar/AccountcalendarController.java

@ -7,9 +7,7 @@ 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.accountcalendar.vo.*;
import com.win.module.wms.controller.bom.vo.BomImportErrorVO;
import com.win.module.wms.convert.accountcalendar.AccountcalendarConvert;
import com.win.module.wms.dal.dataobject.accountcalendar.AccountcalendarDO;
import com.win.module.wms.enums.DictTypeConstants;
@ -29,7 +27,10 @@ import javax.validation.Valid;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.win.framework.common.pojo.CommonResult.success;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@ -84,9 +85,8 @@ public class AccountcalendarController {
PageResult<AccountcalendarDO> pageResult = accountcalendarService.getAccountcalendarPage(pageVO);
PageResult<AccountcalendarRespVO> result = AccountcalendarConvert.INSTANCE.convertPage(pageResult);
for(AccountcalendarRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@ -97,9 +97,8 @@ public class AccountcalendarController {
PageResult<AccountcalendarDO> pageResult = accountcalendarService.getAccountcalendarSenior(conditions);
PageResult<AccountcalendarRespVO> result = AccountcalendarConvert.INSTANCE.convertPage(pageResult);
for(AccountcalendarRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@ -130,9 +129,8 @@ public class AccountcalendarController {
// 导出 Excel
List<AccountcalendarExcelVO> resultList = AccountcalendarConvert.INSTANCE.convertList02(list);
for(AccountcalendarExcelVO vo : resultList) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return resultList;
}
@ -142,8 +140,6 @@ public class AccountcalendarController {
public void importTemplate(HttpServletResponse response) throws IOException {
// 手动创建导出 demo
List<AccountcalendarImportExcelVo> list = Arrays.asList(
// AccountcalendarImportExcelVo.builder().year("1").month("2").descriiption("描述").beginTime(LocalDateTime.now()).endTime(LocalDateTime.now())
// .converttotime(LocalDateTime.now()).available("TRUE").activeTime(LocalDateTime.now()).expireTime(LocalDateTime.now()).remark("备注").build()
);
Map<Integer, String[]> mapDropDown = new HashMap<>();
String[] available = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE);

11
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/areabasic/AreabasicController.java

@ -28,7 +28,10 @@ import javax.validation.Valid;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.*;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.win.framework.common.pojo.CommonResult.success;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@ -128,9 +131,8 @@ public class AreabasicController {
String[] available = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE);
mapDropDown.put(5, available);
for(AreabasicExcelVO vo : resultList) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return resultList;
}
@ -141,9 +143,8 @@ public class AreabasicController {
PageResult<AreabasicDO> pageResult = areabasicService.getAreabasicSenior(conditions);
PageResult<AreabasicRespVO> result = AreabasicConvert.INSTANCE.convertPage(pageResult);
for(AreabasicRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}

21
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/balance/BalanceController.java

@ -69,7 +69,7 @@ public class BalanceController {
PageResult<BalanceRespVO> result = BalanceConvert.INSTANCE.convertPage(pageResult);
for (BalanceRespVO vo : result.getList()) {
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(userApi.getUser(Long.valueOf(vo.getCreator())).getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@ -112,9 +112,8 @@ public class BalanceController {
PageResult<BalanceDO> pageResult = balanceService.getBalanceSenior(conditions);
PageResult<BalanceRespVO> result = BalanceConvert.INSTANCE.convertPage(pageResult);
for(BalanceRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@ -154,9 +153,8 @@ public class BalanceController {
// 导出 Excel
List<BalanceExcelVO> resultList = BalanceConvert.INSTANCE.convertList02(list);
for(BalanceExcelVO vo : resultList) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return resultList;
}
@ -168,7 +166,7 @@ public class BalanceController {
PageResult<BalanceRespVO> result = BalanceConvert.INSTANCE.convertPage(pageResult);
for (BalanceRespVO vo : result.getList()) {
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(userApi.getUser(Long.valueOf(vo.getCreator())).getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@ -179,9 +177,8 @@ public class BalanceController {
PageResult<BalanceDO> pageResult = balanceService.getSeniroBalanceItemsPage(conditions);
PageResult<BalanceRespVO> result = BalanceConvert.INSTANCE.convertPage(pageResult);
for(BalanceRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@ -198,7 +195,7 @@ public class BalanceController {
PageResult<BalanceRespVO> result = BalanceConvert.INSTANCE.convertPage(pageResult);
for (BalanceRespVO vo : result.getList()) {
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(userApi.getUser(Long.valueOf(vo.getCreator())).getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@ -214,9 +211,8 @@ public class BalanceController {
PageResult<BalanceDO> pageResult = balanceService.getSeniroBalancePageBusinessType(conditions);
PageResult<BalanceRespVO> result = BalanceConvert.INSTANCE.convertPage(pageResult);
for(BalanceRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@ -249,9 +245,8 @@ public class BalanceController {
PageResult<BalanceDO> pageResult = balanceService.getLocationTypeToBalanceSenior(conditions);
PageResult<BalanceRespVO> result = BalanceConvert.INSTANCE.convertPage(pageResult);
for(BalanceRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}

9
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/barcode/BarcodeController.java

@ -92,7 +92,11 @@ public class BarcodeController {
@Operation(summary = "获得标签规则设置分页")
public CommonResult<PageResult<BarcodeRespVO>> getBarcodePage(@Valid BarcodePageReqVO pageVO) {
PageResult<BarcodeDO> pageResult = barcodeService.getBarcodePage(pageVO);
return success(BarcodeConvert.INSTANCE.convertPage(pageResult));
PageResult<BarcodeRespVO> result = BarcodeConvert.INSTANCE.convertPage(pageResult);
for(BarcodeRespVO vo:result.getList()){
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@PostMapping("/senior")
@ -101,9 +105,8 @@ public class BarcodeController {
PageResult<BarcodeDO> pageResult = barcodeService.getBarcodeSenior(conditions);
PageResult<BarcodeRespVO> result = BarcodeConvert.INSTANCE.convertPage(pageResult);
for (BarcodeRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}

10
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/bom/BomController.java

@ -84,9 +84,8 @@ public class BomController {
PageResult<BomDO> pageResult = bomService.getBomPage(pageVO);
PageResult<BomRespVO> result =BomConvert.INSTANCE.convertPage(pageResult);
for(BomRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@ -97,9 +96,8 @@ public class BomController {
PageResult<BomDO> pageResult = bomService.getBomSenior(conditions);
PageResult<BomRespVO> result = BomConvert.INSTANCE.convertPage(pageResult);
for(BomRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@ -116,6 +114,7 @@ public class BomController {
List<BomExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "物料基本信息.xlsx", "数据", BomExcelVO.class, resultList, mapDropDown);
}
@PostMapping("/export-excel-senior")
@Operation(summary = "导出物料清单 Excel")
@PreAuthorize("@ss.hasPermission('wms:bom:export')")
@ -134,9 +133,8 @@ public class BomController {
// 导出 Excel
List<BomExcelVO> resultList = BomConvert.INSTANCE.convertList02(list);
for(BomExcelVO vo : resultList) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return resultList;
}

7
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/businesstype/BusinesstypeController.java

@ -93,9 +93,8 @@ public class BusinesstypeController {
PageResult<BusinesstypeDO> pageResult = businesstypeService.getBusinesstypePage(pageVO);
PageResult<BusinesstypeRespVO> result = BusinesstypeConvert.INSTANCE.convertPage(pageResult);
for(BusinesstypeRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@ -106,9 +105,9 @@ public class BusinesstypeController {
PageResult<BusinesstypeDO> pageResult = businesstypeService.getBusinesstypeSenior(conditions);
PageResult<BusinesstypeRespVO> result = BusinesstypeConvert.INSTANCE.convertPage(pageResult);
for(BusinesstypeRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
}
return success(result);
}

56
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/callmaterials/CallmaterialsController.java

@ -1,42 +1,34 @@
package com.win.module.wms.controller.callmaterials;
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.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.issueRequest.vo.IssueRequestMainRespVO;
import com.win.module.wms.convert.issueRequest.IssueRequestMainConvert;
import com.win.module.wms.dal.dataobject.issueRequest.IssueRequestMainDO;
import com.win.module.wms.controller.callmaterials.vo.*;
import com.win.module.wms.convert.callmaterials.CallmaterialsConvert;
import com.win.module.wms.dal.dataobject.callmaterials.CallmaterialsDO;
import com.win.module.wms.service.callmaterials.CallmaterialsService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.*;
import java.io.IOException;
import com.win.framework.common.pojo.PageResult;
import com.win.framework.common.pojo.CommonResult;
import static com.win.framework.common.pojo.CommonResult.success;
import com.win.framework.excel.core.util.ExcelUtils;
import com.win.framework.operatelog.core.annotations.OperateLog;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.*;
import com.win.module.wms.controller.callmaterials.vo.*;
import com.win.module.wms.dal.dataobject.callmaterials.CallmaterialsDO;
import com.win.module.wms.convert.callmaterials.CallmaterialsConvert;
import com.win.module.wms.service.callmaterials.CallmaterialsService;
import org.springframework.web.multipart.MultipartFile;
import static com.win.framework.operatelog.core.enums.OperateTypeEnum.EXPORT;
@Tag(name = "管理后台 - 叫料标签")
@RestController
@ -94,10 +86,9 @@ public class CallmaterialsController {
public CommonResult<PageResult<CallmaterialsRespVO>> getCallmaterialsPage(@Valid CallmaterialsPageReqVO pageVO) {
PageResult<CallmaterialsDO> pageResult = callmaterialsService.getCallmaterialsPage(pageVO);
for(CallmaterialsDO callmaterialsDO : pageResult.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(callmaterialsDO.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
callmaterialsDO.setCreator(user.getNickname());
callmaterialsDO.setUpdater(user.getNickname());
callmaterialsDO.setCreator(userApi.getUserNickname(callmaterialsDO.getCreator()));
callmaterialsDO.setUpdater(userApi.getUserNickname(callmaterialsDO.getUpdater()));
}
return success(CallmaterialsConvert.INSTANCE.convertPage(pageResult));
}
@ -108,10 +99,9 @@ public class CallmaterialsController {
PageResult<CallmaterialsDO> pageResult = callmaterialsService.getCallmaterialsSenior(conditions);
PageResult<CallmaterialsRespVO> result = CallmaterialsConvert.INSTANCE.convertPage(pageResult);
for(CallmaterialsRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setUpdater(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
vo.setUpdater(userApi.getUserNickname(vo.getUpdater()));
}
return success(result);
}

12
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/carrier/CarrierController.java

@ -91,9 +91,8 @@ public class CarrierController {
PageResult<CarrierDO> pageResult = carrierService.getCarrierPage(pageVO);
PageResult<CarrierRespVO> result = CarrierConvert.INSTANCE.convertPage(pageResult);
for(CarrierRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@ -103,9 +102,8 @@ public class CarrierController {
PageResult<CarrierDO> pageResult = carrierService.getCarrierSenior(conditions);
PageResult<CarrierRespVO> result = CarrierConvert.INSTANCE.convertPage(pageResult);
for(CarrierRespVO vo : result.getList()) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return success(result);
}
@ -119,9 +117,8 @@ public class CarrierController {
// 导出 Excel
List<CarrierExcelVO> datas = CarrierConvert.INSTANCE.convertList02(list);
for(CarrierExcelVO vo : datas) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
ExcelUtils.write(response, "承运商.xls", "数据", CarrierExcelVO.class, datas);
}
@ -139,9 +136,8 @@ public class CarrierController {
// 导出 Excel
List<CarrierExcelVO> resultList = CarrierConvert.INSTANCE.convertList02(list);
for(CarrierExcelVO vo : resultList) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
vo.setCreator(userApi.getUserNickname(vo.getCreator()));
}
return resultList;
}

Loading…
Cancel
Save