Browse Source

系统设置导出

master
张立 2 years ago
parent
commit
d0ea31c499
  1. 39
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/accountcalendar/AccountcalendarController.java
  2. 44
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/currencyexchange/CurrencyexchangeController.java
  3. 39
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/systemcalendar/SystemcalendarController.java
  4. 3
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/accountcalendar/AccountcalendarMapper.java
  5. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/currencyexchange/CurrencyexchangeMapper.java
  6. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/systemcalendar/SystemcalendarMapper.java
  7. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/accountcalendar/AccountcalendarService.java
  8. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/accountcalendar/AccountcalendarServiceImpl.java
  9. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/currencyexchange/CurrencyexchangeService.java
  10. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/currencyexchange/CurrencyexchangeServiceImpl.java
  11. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/systemcalendar/SystemcalendarService.java
  12. 4
      win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/systemcalendar/SystemcalendarServiceImpl.java

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

@ -9,10 +9,13 @@ 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.itembasic.vo.ItembasicExcelVO;
import com.win.module.wms.controller.systemcalendar.vo.SystemcalendarRespVO;
import com.win.module.wms.convert.accountcalendar.AccountcalendarConvert;
import com.win.module.wms.convert.itembasic.ItembasicConvert;
import com.win.module.wms.convert.systemcalendar.SystemcalendarConvert;
import com.win.module.wms.dal.dataobject.accountcalendar.AccountcalendarDO;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.service.accountcalendar.AccountcalendarService;
import io.swagger.v3.oas.annotations.Operation;
@ -80,15 +83,6 @@ public class AccountcalendarController {
return success(AccountcalendarConvert.INSTANCE.convert(accountcalendar));
}
@GetMapping("/list")
@Operation(summary = "获得账期日历列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('wms:accountcalendar:query')")
public CommonResult<List<AccountcalendarRespVO>> getAccountcalendarList(@RequestParam("ids") Collection<Long> ids) {
List<AccountcalendarDO> list = accountcalendarService.getAccountcalendarList(ids);
return success(AccountcalendarConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得账期日历分页")
@PreAuthorize("@ss.hasPermission('wms:accountcalendar:query')")
@ -123,16 +117,31 @@ public class AccountcalendarController {
public void exportAccountcalendarExcel(@Valid AccountcalendarExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<AccountcalendarDO> list = accountcalendarService.getAccountcalendarList(exportReqVO);
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<AccountcalendarExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "账期日历.xlsx", "数据", AccountcalendarExcelVO.class, resultList, mapDropDown);
}
@PostMapping("/export-excel-senior")
@Operation(summary = "导出账期日历 Excel")
@PreAuthorize("@ss.hasPermission('wms:accountcalendar:export')")
@OperateLog(type = EXPORT)
public void exportAccountcalendarExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException {
List<AccountcalendarDO> list = accountcalendarService.getAccountcalendarList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<AccountcalendarExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "账期日历.xlsx", "数据", AccountcalendarExcelVO.class, resultList, mapDropDown);
}
private List<AccountcalendarExcelVO> getExcelVo(List<AccountcalendarDO> list, Map<Integer, String[]> mapDropDown) {
String[] available = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE);
mapDropDown.put(6, available);
// 导出 Excel
List<AccountcalendarExcelVO> datas = AccountcalendarConvert.INSTANCE.convertList02(list);
for(AccountcalendarExcelVO vo : datas) {
List<AccountcalendarExcelVO> resultList = AccountcalendarConvert.INSTANCE.convertList02(list);
for(AccountcalendarExcelVO vo : resultList) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
}Map<Integer, String[]> mapDropDown = new HashMap<>();
String[] available = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE);
mapDropDown.put(6, available);
ExcelUtils.write(response, "账期日历.xls", "数据", AccountcalendarExcelVO.class, datas,mapDropDown);
}
return resultList;
}
@GetMapping("/get-import-template")

44
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/currencyexchange/CurrencyexchangeController.java

@ -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.accountcalendar.vo.AccountcalendarRespVO;
import com.win.module.wms.controller.currencyexchange.vo.*;
import com.win.module.wms.controller.itembasic.vo.ItembasicExcelVO;
import com.win.module.wms.convert.accountcalendar.AccountcalendarConvert;
import com.win.module.wms.convert.currencyexchange.CurrencyexchangeConvert;
import com.win.module.wms.convert.itembasic.ItembasicConvert;
import com.win.module.wms.dal.dataobject.currencyexchange.CurrencyexchangeDO;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.service.currencyexchange.CurrencyexchangeService;
import io.swagger.v3.oas.annotations.Operation;
@ -80,15 +83,6 @@ public class CurrencyexchangeController {
return success(CurrencyexchangeConvert.INSTANCE.convert(currencyexchange));
}
@GetMapping("/list")
@Operation(summary = "获得货币转换列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('wms:currencyexchange:query')")
public CommonResult<List<CurrencyexchangeRespVO>> getCurrencyexchangeList(@RequestParam("ids") Collection<Long> ids) {
List<CurrencyexchangeDO> list = currencyexchangeService.getCurrencyexchangeList(ids);
return success(CurrencyexchangeConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得货币转换分页")
@PreAuthorize("@ss.hasPermission('wms:currencyexchange:query')")
@ -122,19 +116,35 @@ public class CurrencyexchangeController {
public void exportCurrencyexchangeExcel(@Valid CurrencyexchangeExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<CurrencyexchangeDO> list = currencyexchangeService.getCurrencyexchangeList(exportReqVO);
// 导出 Excel
List<CurrencyexchangeExcelVO> datas = CurrencyexchangeConvert.INSTANCE.convertList02(list);
for(CurrencyexchangeExcelVO 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<CurrencyexchangeExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "货币转换.xlsx", "数据", CurrencyexchangeExcelVO.class, resultList, mapDropDown);
}
@PostMapping("/export-excel-senior")
@Operation(summary = "导出货币转换 Excel")
@PreAuthorize("@ss.hasPermission('wms:currencyexchange:export')")
@OperateLog(type = EXPORT)
public void exportCurrencyexchangeExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException {
List<CurrencyexchangeDO> list = currencyexchangeService.getCurrencyexchangeList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<CurrencyexchangeExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "货币转换.xlsx", "数据", CurrencyexchangeExcelVO.class, resultList, mapDropDown);
}
private List<CurrencyexchangeExcelVO> getExcelVo(List<CurrencyexchangeDO> list, Map<Integer, String[]> mapDropDown) {
String[] currency = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.CURRENCY);
mapDropDown.put(0, currency);
String[] isRequired = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE);
mapDropDown.put(3, isRequired);
ExcelUtils.write(response, "货币转换.xls", "数据", CurrencyexchangeExcelVO.class, datas,mapDropDown);
// 导出 Excel
List<CurrencyexchangeExcelVO> resultList = CurrencyexchangeConvert.INSTANCE.convertList02(list);
for(CurrencyexchangeExcelVO 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 {

39
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/controller/systemcalendar/SystemcalendarController.java

@ -8,11 +8,14 @@ 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.process.vo.ProcessRespVO;
import com.win.module.wms.controller.systemcalendar.vo.*;
import com.win.module.wms.controller.systemcalendar.vo.SystemcalendarImportExcelVo;
import com.win.module.wms.convert.itembasic.ItembasicConvert;
import com.win.module.wms.convert.process.ProcessConvert;
import com.win.module.wms.convert.systemcalendar.SystemcalendarConvert;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.dal.dataobject.systemcalendar.SystemcalendarDO;
import com.win.module.wms.enums.DictTypeConstants;
import com.win.module.wms.service.systemcalendar.SystemcalendarService;
@ -79,14 +82,6 @@ public class SystemcalendarController {
return success(SystemcalendarConvert.INSTANCE.convert(systemcalendar));
}
@GetMapping("/list")
@Operation(summary = "获得系统日历列表")
@Parameter(name = "ids", description = "编号列表", required = true, example = "1024,2048")
@PreAuthorize("@ss.hasPermission('wms:systemcalendar:query')")
public CommonResult<List<SystemcalendarRespVO>> getSystemcalendarList(@RequestParam("ids") Collection<Long> ids) {
List<SystemcalendarDO> list = systemcalendarService.getSystemcalendarList(ids);
return success(SystemcalendarConvert.INSTANCE.convertList(list));
}
@GetMapping("/page")
@Operation(summary = "获得系统日历分页")
@ -121,17 +116,33 @@ public class SystemcalendarController {
public void exportSystemcalendarExcel(@Valid SystemcalendarExportReqVO exportReqVO,
HttpServletResponse response) throws IOException {
List<SystemcalendarDO> list = systemcalendarService.getSystemcalendarList(exportReqVO);
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<SystemcalendarExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "系统日历.xlsx", "数据", SystemcalendarExcelVO.class, resultList, mapDropDown);
}
@PostMapping("/export-excel-senior")
@Operation(summary = "导出系统日历 Excel")
@PreAuthorize("@ss.hasPermission('wms:systemcalendar:export')")
@OperateLog(type = EXPORT)
public void exportSystemcalendarExcel(@Valid @RequestBody CustomConditions conditions, HttpServletResponse response) throws IOException {
List<SystemcalendarDO> list = systemcalendarService.getSystemcalendarList(conditions);
Map<Integer, String[]> mapDropDown = new HashMap<>();
List<SystemcalendarExcelVO> resultList = this.getExcelVo(list, mapDropDown);
ExcelUtils.write(response, "系统日历.xlsx", "数据", SystemcalendarExcelVO.class, resultList, mapDropDown);
}
private List<SystemcalendarExcelVO> getExcelVo(List<SystemcalendarDO> list, Map<Integer, String[]> mapDropDown) {
String[] available = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE);
mapDropDown.put(3, available);
// 导出 Excel
List<SystemcalendarExcelVO> datas = SystemcalendarConvert.INSTANCE.convertList02(list);
for(SystemcalendarExcelVO vo : datas) {
List<SystemcalendarExcelVO> resultList = SystemcalendarConvert.INSTANCE.convertList02(list);
for(SystemcalendarExcelVO vo : resultList) {
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator()));
//后端创建个字段作为前端展示的虚拟字段
vo.setCreator(user.getNickname());
} Map<Integer, String[]> mapDropDown = new HashMap<>();
String[] available = DictFrameworkUtils.dictTypeDictDataValue(DictTypeConstants.TRUE_FALSE);
mapDropDown.put(3, available);
ExcelUtils.write(response, "系统日历.xls", "数据", SystemcalendarExcelVO.class, datas,mapDropDown);
}
return resultList;
}
@GetMapping("/get-import-template")
@Operation(summary = "获得导入班组信息模板")
public void importTemplate(HttpServletResponse response) throws IOException {

3
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/accountcalendar/AccountcalendarMapper.java

@ -60,5 +60,8 @@ public interface AccountcalendarMapper extends BaseMapperX<AccountcalendarDO> {
.eqIfPresent(AccountcalendarDO::getCreator, reqVO.getCreator())
.orderByDesc(AccountcalendarDO::getId));
}
default List<AccountcalendarDO> selectSeniorList(CustomConditions conditions) {
return selectList(QueryWrapperUtils.structure(conditions));
}
}

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/currencyexchange/CurrencyexchangeMapper.java

@ -8,6 +8,7 @@ import com.win.framework.mybatis.core.util.QueryWrapperUtils;
import com.win.module.wms.controller.currencyexchange.vo.CurrencyexchangeExportReqVO;
import com.win.module.wms.controller.currencyexchange.vo.CurrencyexchangePageReqVO;
import com.win.module.wms.dal.dataobject.currencyexchange.CurrencyexchangeDO;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@ -49,5 +50,8 @@ public interface CurrencyexchangeMapper extends BaseMapperX<CurrencyexchangeDO>
.eqIfPresent(CurrencyexchangeDO::getCreator, reqVO.getCreator())
.orderByDesc(CurrencyexchangeDO::getId));
}
default List<CurrencyexchangeDO> selectSeniorList(CustomConditions conditions) {
return selectList(QueryWrapperUtils.structure(conditions));
}
}

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/dal/mysql/systemcalendar/SystemcalendarMapper.java

@ -7,6 +7,7 @@ import com.win.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.win.framework.mybatis.core.util.QueryWrapperUtils;
import com.win.module.wms.controller.systemcalendar.vo.SystemcalendarExportReqVO;
import com.win.module.wms.controller.systemcalendar.vo.SystemcalendarPageReqVO;
import com.win.module.wms.dal.dataobject.itembasic.ItembasicDO;
import com.win.module.wms.dal.dataobject.systemcalendar.SystemcalendarDO;
import org.apache.ibatis.annotations.Mapper;
@ -49,5 +50,8 @@ public interface SystemcalendarMapper extends BaseMapperX<SystemcalendarDO> {
.eqIfPresent(SystemcalendarDO::getCreator, reqVO.getCreator())
.orderByDesc(SystemcalendarDO::getId));
}
default List<SystemcalendarDO> selectSeniorList(CustomConditions conditions) {
return selectList(QueryWrapperUtils.structure(conditions));
}
}

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/accountcalendar/AccountcalendarService.java

@ -49,10 +49,10 @@ public interface AccountcalendarService {
/**
* 获得账期日历列表
*
* @param ids 编号
* @param conditions 编号
* @return 账期日历列表
*/
List<AccountcalendarDO> getAccountcalendarList(Collection<Long> ids);
List<AccountcalendarDO> getAccountcalendarList(CustomConditions conditions);
/**
* 获得账期日历分页

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/accountcalendar/AccountcalendarServiceImpl.java

@ -70,8 +70,8 @@ public class AccountcalendarServiceImpl implements AccountcalendarService {
}
@Override
public List<AccountcalendarDO> getAccountcalendarList(Collection<Long> ids) {
return accountcalendarMapper.selectBatchIds(ids);
public List<AccountcalendarDO> getAccountcalendarList(CustomConditions conditions) {
return accountcalendarMapper.selectSeniorList(conditions);
}
@Override

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/currencyexchange/CurrencyexchangeService.java

@ -49,10 +49,10 @@ public interface CurrencyexchangeService {
/**
* 获得货币转换列表
*
* @param ids 编号
* @param conditions 编号
* @return 货币转换列表
*/
List<CurrencyexchangeDO> getCurrencyexchangeList(Collection<Long> ids);
List<CurrencyexchangeDO> getCurrencyexchangeList(CustomConditions conditions);
/**
* 获得货币转换分页

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/currencyexchange/CurrencyexchangeServiceImpl.java

@ -80,8 +80,8 @@ public class CurrencyexchangeServiceImpl implements CurrencyexchangeService {
}
@Override
public List<CurrencyexchangeDO> getCurrencyexchangeList(Collection<Long> ids) {
return currencyexchangeMapper.selectBatchIds(ids);
public List<CurrencyexchangeDO> getCurrencyexchangeList(CustomConditions conditions) {
return currencyexchangeMapper.selectSeniorList(conditions);
}
@Override

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/systemcalendar/SystemcalendarService.java

@ -55,10 +55,10 @@ public interface SystemcalendarService {
/**
* 获得系统日历列表
*
* @param ids 编号
* @param conditions 编号
* @return 系统日历列表
*/
List<SystemcalendarDO> getSystemcalendarList(Collection<Long> ids);
List<SystemcalendarDO> getSystemcalendarList(CustomConditions conditions);
/**
* 获得系统日历分页

4
win-module-wms/win-module-wms-biz/src/main/java/com/win/module/wms/service/systemcalendar/SystemcalendarServiceImpl.java

@ -70,8 +70,8 @@ public class SystemcalendarServiceImpl implements SystemcalendarService {
}
@Override
public List<SystemcalendarDO> getSystemcalendarList(Collection<Long> ids) {
return systemcalendarMapper.selectBatchIds(ids);
public List<SystemcalendarDO> getSystemcalendarList(CustomConditions conditions) {
return systemcalendarMapper.selectSeniorList(conditions);
}
@Override

Loading…
Cancel
Save