| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 单独出库 |
| | |
| | | */ |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @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 |
| | |
| | | */ |
| | | @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); |
| | | } |
| | | /** |
| | | * 批量出库 |
| | |
| | | */ |
| | | @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 ,@Validated @RequestBody ParamForm paramForm){ |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return safeMaterialDetailService.receiptBatch(paramForm); |
| | | } |
| | | /** |
| | |
| | | */ |
| | | @PostMapping(value = "/deleteBatch") |
| | | public ResultVO deleteBatch(Authentication authentication,@Validated @RequestBody ParamForm paramForm){ |
| | | return safeMaterialDetailService.deleteBatch(paramForm); |
| | | ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); |
| | | return safeMaterialDetailService.deleteBatch(currentUser,paramForm); |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | @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); |
| | | } |
| | | |
| | | /** |
| | |
| | | safeMaterialDetailService.deliveryBatchSpw(req); |
| | | return new ResultVO<>(ResultCodes.OK); |
| | | } |
| | | /* *//** |
| | | /** |
| | | * 根据rfid获去数据 |
| | | * @param authentication |
| | | * @return |