| | |
| | | package com.vincent.rsf.server.manager.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.vincent.rsf.framework.common.Cools; |
| | | import com.vincent.rsf.framework.common.R; |
| | |
| | | import com.vincent.rsf.server.common.domain.BaseParam; |
| | | import com.vincent.rsf.server.common.domain.KeyValVo; |
| | | import com.vincent.rsf.server.common.domain.PageParam; |
| | | import com.vincent.rsf.server.manager.entity.Companys; |
| | | import com.vincent.rsf.server.manager.entity.DeliveryItem; |
| | | import com.vincent.rsf.server.manager.entity.*; |
| | | import com.vincent.rsf.server.manager.entity.excel.AsnOrderTemplate; |
| | | import com.vincent.rsf.server.manager.entity.excel.DeliveryTemplate; |
| | | import com.vincent.rsf.server.manager.enums.OrderType; |
| | | import com.vincent.rsf.server.manager.enums.OrderWorkType; |
| | | import com.vincent.rsf.server.manager.service.CompanysService; |
| | | import com.vincent.rsf.server.manager.service.DeliveryItemService; |
| | | import com.vincent.rsf.server.manager.service.impl.DeliveryServiceImpl; |
| | | import com.vincent.rsf.server.system.controller.BaseController; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | private DeliveryItemService deliveryItemService; |
| | | |
| | | |
| | | @Autowired |
| | | private CompanysService companysService; |
| | | @Autowired |
| | | private DeliveryServiceImpl deliveryService; |
| | | |
| | | @PreAuthorize("hasAuthority('manager:deliveryItem:list')") |
| | | @PostMapping("/deliveryItem/page") |
| | | public R page(@RequestBody Map<String, Object> map) { |
| | | BaseParam baseParam = buildParam(map, BaseParam.class); |
| | | PageParam<DeliveryItem, BaseParam> pageParam = new PageParam<>(baseParam, DeliveryItem.class); |
| | | return R.ok().add(deliveryItemService.page(pageParam, pageParam.buildWrapper(true))); |
| | | QueryWrapper<DeliveryItem> wrapper = pageParam.buildWrapper(true); |
| | | wrapper.apply("anfme > work_qty + qty "); |
| | | return R.ok().add(deliveryItemService.page(pageParam, wrapper)); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:deliveryItem:list')") |
| | |
| | | ); |
| | | return R.ok().add(vos); |
| | | } |
| | | |
| | | @PreAuthorize("hasAuthority('manager:deliveryItem:list')") |
| | | @PostMapping("/deliveryItem/export") |
| | | public void export(@RequestBody Map<String, Object> map, HttpServletResponse response) throws Exception { |
| | | if (!Cools.isEmpty(map) && !Cools.isEmpty(map.get("ids"))) { |
| | | throw new CoolException("参数不能为空!!"); |
| | | } |
| | | List<Long> jsonArray = JSONArray.parseArray(JSONArray.toJSONString(map.get("ids")), Long.class); |
| | | // if (jsonArray.isEmpty()) { |
| | | // ExcelUtil.build(ExcelUtil.create(deliveryItemService.getOne(new La), DeliveryItem.class), response); |
| | | // } else { |
| | | // ExcelUtil.build(ExcelUtil.create(deliveryItemService.list(), DeliveryItem.class), response); |
| | | // } |
| | | } |
| | | |
| | | |
| | | @PostMapping("/deliveryItem/import") |
| | | @ApiOperation("DO单导入接口") |
| | | @PreAuthorize("hasAuthority('manager:asnOrderItem:update')") |
| | | public R importExcel(@RequestParam(value = "file") MultipartFile file) throws Exception { |
| | | if (Objects.isNull(file)) { |
| | | return R.error("文件不能为空!!"); |
| | | } |
| | | Map<String, Object> hashMap = new HashMap<>(); |
| | | |
| | | return R.ok(); |
| | | // return deliveryItemService.excelImport(file, hashMap, getLoginUserId()); |
| | | } |
| | | |
| | | } |