zhangfeng
2022-12-23 f7d2f20365467a834188edd35c464d9fb9349214
equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialDetailController.java
@@ -1,6 +1,8 @@
package com.gkhy.safePlatform.equipment.controller;
import com.alibaba.fastjson.JSONObject;
import com.gkhy.safePlatform.commons.co.ContextCacheUser;
import com.gkhy.safePlatform.commons.enums.ResultCodes;
import com.gkhy.safePlatform.commons.query.PageQuery;
import com.gkhy.safePlatform.commons.vo.ResultVO;
import com.gkhy.safePlatform.commons.vo.SearchResultVO;
@@ -45,15 +47,7 @@
    public ResultVO update(Authentication authentication,@Validated @RequestBody SafeMaterialDetailReq req){
        return safeMaterialDetailService.update(req);
    }
    /**
     * 单独出入库
     * @param authentication
     * @return
     */
    @PostMapping(value = "/single/delivery0rReceipt")
    public ResultVO singleDdelivery0rReceipt(Authentication authentication, @Validated @RequestBody SafeMaterialDetailReq req){
        return safeMaterialDetailService.singleDdelivery0rReceipt(req);
    }
    /**
     * 单独出库
@@ -62,7 +56,9 @@
     */
    @PostMapping(value = "/single/delivery")
    public ResultVO singleDelivery(Authentication authentication, @Validated @RequestBody SafeMaterialDetailReq req){
        return safeMaterialDetailService.singleDelivery(req);
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        safeMaterialDetailService.singleDelivery(currentUser,req);
        return new ResultVO(ResultCodes.OK);
    }
    /**
@@ -72,8 +68,10 @@
     */
    @PostMapping(value = "/single/receipt")
    public ResultVO singleReceipt(Authentication authentication,@RequestBody JSONObject jsonObject){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        Long id = jsonObject.getLong("id");
        return safeMaterialDetailService.singleReceipt(id);
        safeMaterialDetailService.singleReceipt(id,currentUser);
        return new ResultVO(ResultCodes.OK);
    }
    /**
     * 批量出库 - 根据ids
@@ -82,8 +80,9 @@
     */
    @PostMapping(value = "/batch/delivery/ids")
    public ResultVO deliveryBatchByIds(Authentication authentication, @Validated @RequestBody MterialDeliveryReq req){
        return safeMaterialDetailService.deliveryBatchByIds(req);
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        safeMaterialDetailService.deliveryBatchByIds(req,currentUser);
        return new ResultVO(ResultCodes.OK);
    }
    /**
     * 批量出库
@@ -92,15 +91,18 @@
     */
    @PostMapping(value = "/batch/delivery/random")
    public ResultVO deliveryBatchRandom(Authentication authentication,@Validated @RequestBody MterialRandomDeliveryReq req){
        return safeMaterialDetailService.deliveryBatchRandom(req);
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        safeMaterialDetailService.deliveryBatchBySmId(req,currentUser);
        return new ResultVO(ResultCodes.OK);
    }
    /**
     * 批量重新入库
     */
    @PostMapping(value = "/batch/receipt")
    public ResultVO receiptBatch(Authentication authentication, @RequestBody Long[] ids){
        return safeMaterialDetailService.receiptBatch(ids);
    public ResultVO receiptBatch(Authentication authentication ,@Validated @RequestBody ParamForm paramForm){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return safeMaterialDetailService.receiptBatch(paramForm);
    }
    /**
     * 删除-单条
@@ -119,8 +121,9 @@
     * @return
     */
    @PostMapping(value = "/deleteBatch")
    public ResultVO deleteBatch(Authentication authentication,@RequestBody Long[] ids){
        return safeMaterialDetailService.deleteBatch(ids);
    public ResultVO deleteBatch(Authentication authentication,@Validated @RequestBody ParamForm paramForm){
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return safeMaterialDetailService.deleteBatch(currentUser,paramForm);
    }
@@ -131,7 +134,8 @@
     */
    @PostMapping(value = "/page/list")
    public SearchResultVO<List<SafeMaterialDetailDto>> listByPage(Authentication authentication, @RequestBody PageQuery<SafeMatetrialDetailQuery> pageQuery){
        return safeMaterialDetailService.listByPage(pageQuery);
        ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal();
        return safeMaterialDetailService.listByPage(currentUser,pageQuery);
    }
    /**
@@ -144,5 +148,23 @@
        Long id = jsonObject.getLong("id");
        return safeMaterialDetailService.queryById(id);
    }
    /**
     * 特殊作业批量出库接口
     * @param authentication
     * @return
     */
    @PostMapping(value = "/deliveryBatchSpw")
    public ResultVO deliveryBatchSpw(Authentication authentication, @Validated @RequestBody MaterialSpwReq req){
        safeMaterialDetailService.deliveryBatchSpw(req);
        return new ResultVO<>(ResultCodes.OK);
    }
 /**
     * 根据rfid获去数据
     * @param authentication
     * @return
     *//*
    @PostMapping(value = "/rfid/list")
    public ResultVO getListByRfid(Authentication authentication, @RequestBody String[] rfids){
        return new ResultVO(ResultCodes.OK,safeMaterialDetailService.getListByRfids(rfids));
    }*/
}