MobileBatchReceiptController.java 3.88 KB
//package com.huaheng.mobile.receipt;
//
//import com.alibaba.fastjson.JSONException;
//import com.huaheng.common.core.web.controller.BaseController;
//import com.huaheng.common.core.web.domain.AjaxResult;
//import com.huaheng.config.api.RemoteLocationService;
//import com.huaheng.config.api.RemoteMaterialService;
//import com.huaheng.config.api.domain.Material;
//import com.huaheng.receipt.api.RemoteReceiptHeaderService;
//import com.huaheng.receipt.api.domain.ReceiptHeader;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import io.swagger.annotations.ApiParam;
//import org.springframework.transaction.annotation.Transactional;
//import org.springframework.web.bind.annotation.*;
//
//import javax.annotation.Resource;
//import java.math.BigDecimal;
//import java.text.SimpleDateFormat;
//import java.util.*;
//
///**
// *
// * @author Enzo Cotter
// * @date 2019/12/15
// */
//@CrossOrigin
//@RestController
//@RequestMapping("/mobile/receipt/batch")
//@Api(tags = {"移动端收货"}, value = "移动端收货MobileBatchReceiptController")
//public class MobileBatchReceiptController extends BaseController {
//
//    @Resource
//    private RemoteMaterialService materialService;
//    @Resource
//    private RemoteReceiptHeaderService receiptHeaderService;
//    @Resource
//    private RemoteLocationService locationService;
//
//
//    @PostMapping("/getLatestMaterial")
//    @ApiOperation("移动端获取物料信息")
//    public AjaxResult getLatestMaterial(@RequestBody @ApiParam(value = "物料号") Map<String, String> param) throws Exception {
//        List<Material> materials = materialService.findLatest();
//        if (materials == null) {
//            return AjaxResult.error("没有找到物料");
//        }
//
//        return AjaxResult.success(materials);
//    }
//
//    @PostMapping("/getLatestReceipt")
//    @ApiOperation("移动端获取入库单")
//    public AjaxResult getLatestReceipt(@RequestBody @ApiParam(value = "物料号") Map<String, String> param) throws Exception {
//
//        List<ReceiptHeader> receiptHeaders = receiptHeaderService.getLatestReceipt(param.get("warehouseCode"),  param.get("companyCode"));
//        if (receiptHeaders == null) {
//            return AjaxResult.error("没有找到入库单");
//        }
//        return AjaxResult.success(receiptHeaders);
//    }
//
//
//
////    @PostMapping("/checkLocation")
////    @ApiOperation("移动端验证库位")
////    public AjaxResult checkLocation(@RequestBody @ApiParam(value = "物料号") Map<String, String> param) throws Exception {
////        if (param.get("code") == null || param.get("code").trim().length() < 1) {
////            throw new JSONException("容器号(code)不能为空");
////        }
////        boolean result = locationService.checkLocation(param.get("code"));
////        if (!result) {
////            return AjaxResult.error("没有该库位");
////        }
////        return AjaxResult.success(result);
////    }
////
////    @PostMapping("/getFreeLocation")
////    @ApiOperation("移动端获得空闲库位")
////    public AjaxResult getFreeLocation(@RequestBody @ApiParam(value = "物料号") Map<String, String> param) throws Exception {
////        if (param.get("materialCode") == null || param.get("materialCode").trim().length() < 1) {
////            throw new JSONException("materialCode不能为空");
////        }
////
////        if (param.get("batch") == null || param.get("batch").trim().length() < 1) {
////            throw new JSONException("batch不能为空");
////        }
////        String materialCode = param.get("materialCode");
////        String batch = param.get("batch");
////        boolean result = locationService.getFreeLocation(materialCode, batch);
////        if (!result) {
////            return AjaxResult.error("没有空闲的分区库位");
////        }
////        return AjaxResult.success(result);
////    }
//
//
//}