|
@@ -13,6 +13,7 @@ import com.jsh.erp.datasource.entities.MaterialVo4Unit;
|
|
|
import com.jsh.erp.datasource.entities.Supplier;
|
|
|
import com.jsh.erp.datasource.entities.*;
|
|
|
import com.jsh.erp.datasource.pda.dto.PDADepotHeadDTO;
|
|
|
+import com.jsh.erp.datasource.pda.dto.PDAInventoryDTO;
|
|
|
import com.jsh.erp.datasource.pda.dto.PDATaskStocktakingDTO;
|
|
|
import com.jsh.erp.datasource.pda.dto.PDATaskStocktakingItemDTO;
|
|
|
import com.jsh.erp.datasource.pda.vo.PDADepotHeadVO;
|
|
@@ -24,13 +25,21 @@ import com.jsh.erp.datasource.vo.TaskStocktakingVO;
|
|
|
import com.jsh.erp.datasource.vo.TreeNode;
|
|
|
import com.jsh.erp.query.LambdaQueryWrapperX;
|
|
|
import com.jsh.erp.service.*;
|
|
|
+import com.jsh.erp.utils.FileUtils;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import org.springframework.http.HttpStatus;
|
|
|
+import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.io.*;
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.nio.file.Path;
|
|
|
+import java.nio.file.Paths;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -66,6 +75,9 @@ public class PdaController extends BaseController {
|
|
|
@Resource
|
|
|
private MaterialExtendService materialExtendService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private ApkVersionService apkVersionService;
|
|
|
+
|
|
|
/**
|
|
|
* 采购入库
|
|
|
* @return
|
|
@@ -176,7 +188,6 @@ public class PdaController extends BaseController {
|
|
|
@ApiOperation("开始任务")
|
|
|
@GetMapping("/startTask/{id}")
|
|
|
public AjaxResult startTask(@PathVariable("id") Long id){
|
|
|
-
|
|
|
taskStocktakingService.update(new UpdateWrapper<TaskStocktaking>()
|
|
|
.set("task_status", 2)
|
|
|
.eq("id", id));
|
|
@@ -232,7 +243,6 @@ public class PdaController extends BaseController {
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@ApiOperation("负责人下拉列表")
|
|
|
@GetMapping("/creatorSpinnerList/{taskId}")
|
|
|
public AjaxResult creatorSpinnerList(@PathVariable("taskId") Long taskId) {
|
|
@@ -267,12 +277,69 @@ public class PdaController extends BaseController {
|
|
|
return AjaxResult.success();
|
|
|
}
|
|
|
|
|
|
- @ApiOperation("商品存货查询")
|
|
|
- @GetMapping("/inventoryInquiry/{type}/{keyword}")
|
|
|
- public TableDataInfo inventoryInquiry(@PathVariable("type") String type,@PathVariable("keyword") String keyword){
|
|
|
+ @PostMapping("/inventoryInquiry")
|
|
|
+ @ApiOperation("存货查询-商品存货查询")
|
|
|
+ public TableDataInfo inventoryInquiry(@RequestBody PDAInventoryDTO pdaInventoryDTO){
|
|
|
startPage();
|
|
|
- List<PDADepotItemVO> list = materialService.inventoryInquiry(type , keyword);
|
|
|
+ List<PDADepotItemVO> list = materialService.inventoryInquiry(pdaInventoryDTO);
|
|
|
return getDataTable(list);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("存货查询-库位树查询")
|
|
|
+ @GetMapping("/inventoryPositionTree")
|
|
|
+ public AjaxResult inventoryPositionTree() throws Exception {
|
|
|
+ return AjaxResult.success(materialService.selectPosition());
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("存货查询-类型树查询")
|
|
|
+ @GetMapping("/inventoryTypeTree")
|
|
|
+ public AjaxResult inventoryTypeTree() throws Exception {
|
|
|
+ return AjaxResult.success(materialCategoryService.getMaterialCategoryTree(null));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @ApiOperation("下载安装包")
|
|
|
+ @PostMapping("/downloadApk")
|
|
|
+ public void downloadApk(@RequestBody ApkVersion apkVersion, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
|
|
+ // 将文件路径转换为 Path 对象
|
|
|
+ Path path = Paths.get(apkVersion.getUrl()).toAbsolutePath().normalize();
|
|
|
+ File file = path.toFile();
|
|
|
+ String fileUrl = apkVersion.getUrl();
|
|
|
+ // 检查文件是否存在
|
|
|
+ if (!file.exists() || !file.isFile()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ InputStream inputStream = null;
|
|
|
+ OutputStream outputStream = null;
|
|
|
+ inputStream = new BufferedInputStream(new FileInputStream(fileUrl));
|
|
|
+ outputStream = response.getOutputStream();
|
|
|
+ byte[] buf = new byte[1024];
|
|
|
+ int len;
|
|
|
+ while ((len = inputStream.read(buf)) > 0) {
|
|
|
+ outputStream.write(buf, 0, len);
|
|
|
+ }
|
|
|
+ response.flushBuffer();
|
|
|
+ if (inputStream != null) {
|
|
|
+ try {
|
|
|
+ inputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ logger.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (outputStream != null) {
|
|
|
+ try {
|
|
|
+ outputStream.close();
|
|
|
+ } catch (IOException e) {
|
|
|
+ logger.error(e.getMessage(), e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @ApiOperation("查询版本信息")
|
|
|
+ @GetMapping("/selectVersion")
|
|
|
+ public AjaxResult selectVersion() {
|
|
|
+ ApkVersion apkVersion = apkVersionService.getOne(new LambdaQueryWrapperX<ApkVersion>().orderByDesc(ApkVersion::getId).last("limit 1"));
|
|
|
+ return AjaxResult.success(apkVersion);
|
|
|
+ }
|
|
|
+
|
|
|
}
|