自动化立体仓库 - WMS系统
dubin
昨天 cc4e0bd14edeeb43268216f18c70be62e482b8f0
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -4,7 +4,10 @@
import com.core.annotations.AppAuth;
import com.core.common.*;
import com.core.exception.CoolException;
import com.zy.asrs.entity.WaitPakin;
import com.zy.asrs.entity.WrkDetl;
import com.zy.asrs.entity.param.*;
import com.zy.asrs.entity.result.TokenVo;
import com.zy.asrs.service.ApiLogService;
import com.zy.asrs.service.OpenService;
import com.zy.common.model.DetlDto;
@@ -37,7 +40,21 @@
    @Autowired
    private OpenService openService;
    @PostMapping("/order/matSync/default/v2")
    @PostMapping("/getToken")
    public synchronized R getToken(@RequestBody(required = true) TokenParam param,
                                   HttpServletRequest request){
        authNew(param, param, request);
        if (Cools.isEmpty(param)) {
            return R.parse(BaseRes.PARAM);
        }
        TokenVo tokenVo = new TokenVo();
        String token = Cools.enToken(System.currentTimeMillis() + param.getAppId(), param.getAppSecret());
        tokenVo.setToken(token);
        tokenVo.setValidTime(30);
        return R.ok().add(tokenVo);
    }
    @PostMapping("/erp/mat/sync")
//    @AppAuth(memo = "商品信息同步接口")
    public synchronized R syncMatInfoV2(@RequestHeader(required = false) String appkey,
                                      @RequestBody(required = false) MatSyncParam.MatParam param,
@@ -181,6 +198,23 @@
        }
    }
    private void authNew(TokenParam param, Object obj, HttpServletRequest request) {
        log.info("{}接口被访问;appSecret:{};请求数据:{}", "open/sensorType/list/auth/v1", param.getAppSecret(), JSON.toJSONString(obj));
        request.setAttribute("cache", obj);
        if (!auth) {
            return;
        }
        if (Cools.isEmpty(param.getAppId()) || Cools.isEmpty(param.getAppSecret())) {
            throw new CoolException("认证失败,请确认appId和appSecret无误!");
        }
        if (!param.getAppId().contains("FNWMS")){
            throw new CoolException("认证失败,请确认appId无误!");
        }
        if (!APP_KEY_LIST.contains(param.getAppSecret())) {
            throw new CoolException("认证失败,请确认appSecret无误!");
        }
    }
    public static void main(String[] args) {
        // 1
        System.out.println("======================================");
@@ -248,9 +282,9 @@
        if (Cools.isEmpty(param.getItem())) {
            return R.error("UPC[item]不能为空");
        }
//        if (Cools.isEmpty(param.getSupplier())) {
//            return R.error("货源[supplier]不能为空");
//        }
        if (Cools.isEmpty(param.getSupplier())) {
            return R.error("货源[supplier]不能为空");
        }
        if (Cools.isEmpty(param.getStaNo())) {
            return R.error("分拣点位[staNo]不能为空");
        }
@@ -525,6 +559,23 @@
    }
    /**
     * PDA检索盘点数量
     */
    @PostMapping("/pick/v1/getPickList")
    @AppAuth(memo = "PDA检索盘点数量")
    public synchronized R getPickList(@RequestHeader(required = false) String appkey,
                                        @RequestBody PdaPickListParam param,
                                        HttpServletRequest request) {
//        auth(appkey, param, request);
        List<PickWrkDetlListParam> list = openService.getPickList(param);
        if (!list.isEmpty()) {
            return R.ok(list);
        }
        return R.error("库位不存在或无明细");
    }
    /**
     * PDA绑定解绑
     */
    @PostMapping("/agv/bindCtnrAndBin/v1")