无关风月
2024-09-03 56dfe0d4bf81262622a1919cceb2b039fd356209
ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/InventoriesSuppliesInfoController.java
@@ -3,6 +3,7 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.page.PageDTO;
import com.ruoyi.common.security.service.TokenService;
import com.ruoyi.management.domain.InventoriesSupplies;
import com.ruoyi.management.domain.InventoriesSuppliesInfo;
import com.ruoyi.management.domain.SlStoreManagement;
@@ -39,6 +40,8 @@
public class InventoriesSuppliesInfoController {
    @Resource
    private SysUserClient sysUserClient;
    @Resource
    private TokenService tokenService;
    @Autowired
    private SlGoodsMaterialsService slGoodsMaterialsService;
@@ -51,6 +54,7 @@
    @GetMapping("/getInfoById")
    @ApiOperation(value = "根据盘点id获取盘点信息")
    public R<PdInfoVO> inventoriesSuppliesInfoService(Long id) {
        tokenService.getLoginUser();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        InventoriesSupplies byId = inventoriesSuppliesService.getById(id);
        String format = simpleDateFormat.format(byId.getPdTime());
@@ -64,12 +68,14 @@
    @PostMapping("/getInventoriesSuppliesInfoList")
    @ApiOperation(value = "分页获物资盘点详情")
    public R<PageDTO<InventoriesSuppliesInfoVO>> inventoriesSuppliesInfoService(@RequestBody InventoriesSuppliesInfoQuery inventoriesSuppliesInfoQuery) {
        tokenService.getLoginUser();
        return R.ok(inventoriesSuppliesInfoService.inventoriesSuppliesInfoService(inventoriesSuppliesInfoQuery));
    }
    @PostMapping("/addInventoriesSuppliesInfo")
    @ApiOperation(value = "添加/修改物资盘点详情")
    public R addInventoriesSuppliesInfo(@RequestBody List<InventoriesSuppliesInfoDTO> inventoriesSuppliesInfoDTO) {
        tokenService.getLoginUser();
        inventoriesSuppliesInfoService.addInventoriesSuppliesInfo(inventoriesSuppliesInfoDTO);
        return R.ok();
    }
@@ -77,19 +83,21 @@
    @PostMapping("/getInventoriesSuppliesInfo")
    @ApiOperation(value = "通过入库id查询是否已经有物资详情")
    public R<InventoriesSuppliesInfo> getInventoriesSuppliesInfo(@RequestBody InventoriesSuppliesInfoDTO inventoriesSuppliesInfoDTO) {
        tokenService.getLoginUser();
        return R.ok(   inventoriesSuppliesInfoService.getInventoriesSuppliesInfo(inventoriesSuppliesInfoDTO));
    }
    @PostMapping("/submitInventoriesSuppliesInfo")
    @ApiOperation(value = "提交物资盘点数据")
    public R submitInventoriesSuppliesInfo(@RequestBody ADDPdDTO dto) {
        tokenService.getLoginUser();
        return R.ok(inventoriesSuppliesInfoService.submitInventoriesSuppliesInfo(dto));
    }
    @PostMapping("/accomplishInventoriesSuppliesInfo")
    @ApiOperation(value = "完成物资盘点数据--更新库存")
    public R accomplishInventoriesSuppliesInfo(@RequestBody InventoriesSuppliesInfoDTO inventoriesSuppliesInfoDTO) {
        tokenService.getLoginUser();
        inventoriesSuppliesInfoService.accomplishInventoriesSuppliesInfo(inventoriesSuppliesInfoDTO);
        return R.ok();
    }