无关风月
2024-08-27 b5ef65d0103a71dc7af2b9be6d2ac43aca5bb726
ruoyi-modules/ruoyi-management/src/main/java/com/ruoyi/management/controller/InventoriesSuppliesInfoController.java
@@ -3,23 +3,26 @@
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.utils.page.PageDTO;
import com.ruoyi.management.domain.InventoriesSupplies;
import com.ruoyi.management.domain.InventoriesSuppliesInfo;
import com.ruoyi.management.domain.dto.InventoriesSuppDTO;
import com.ruoyi.management.domain.dto.InventoriesSuppliesInfoDTO;
import com.ruoyi.management.domain.dto.InventoriesSuppliesInfoQuery;
import com.ruoyi.management.domain.dto.InventoriesSuppliesQuery;
import com.ruoyi.management.domain.SlStoreManagement;
import com.ruoyi.management.domain.dto.*;
import com.ruoyi.management.domain.vo.InventoriesSuppliesInfoVO;
import com.ruoyi.management.domain.vo.InventoriesSuppliesVO;
import com.ruoyi.management.domain.vo.PdInfoVO;
import com.ruoyi.management.mapper.SlVolumeProductionRkMapper;
import com.ruoyi.management.service.InventoriesSuppliesInfoService;
import com.ruoyi.management.service.InventoriesSuppliesService;
import com.ruoyi.management.service.SlGoodsMaterialsService;
import com.ruoyi.management.service.SlStoreManagementService;
import com.ruoyi.system.api.feignClient.SysUserClient;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.List;
/**
@@ -34,9 +37,30 @@
@RequestMapping("/inventories-supplies-info")
@Api(value = "物资盘点详情接口", tags = "物资盘点详情接口", description = "物资盘点详情接口")
public class InventoriesSuppliesInfoController {
    @Resource
    private SysUserClient sysUserClient;
    @Autowired
    private SlGoodsMaterialsService slGoodsMaterialsService;
    @Resource
    private InventoriesSuppliesInfoService inventoriesSuppliesInfoService;
    @Resource
    private InventoriesSuppliesService inventoriesSuppliesService;
    @Autowired
    private SlStoreManagementService slStoreManagementService;
    @GetMapping("/getInfoById")
    @ApiOperation(value = "根据盘点id获取盘点信息")
    public R<PdInfoVO> inventoriesSuppliesInfoService(Long id) {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        InventoriesSupplies byId = inventoriesSuppliesService.getById(id);
        String format = simpleDateFormat.format(byId.getPdTime());
        SlStoreManagement byId1 = slStoreManagementService.getById(byId.getMaterialsId());
        PdInfoVO pdInfoVO = new PdInfoVO();
        pdInfoVO.setManagementName(byId1.getStoreManagementName());
        pdInfoVO.setPdName(byId.getPdrName());
        pdInfoVO.setPdTime(format);
        return R.ok(pdInfoVO);
    }
    @PostMapping("/getInventoriesSuppliesInfoList")
    @ApiOperation(value = "分页获物资盘点详情")
    public R<PageDTO<InventoriesSuppliesInfoVO>> inventoriesSuppliesInfoService(@RequestBody InventoriesSuppliesInfoQuery inventoriesSuppliesInfoQuery) {
@@ -58,13 +82,13 @@
    @PostMapping("/submitInventoriesSuppliesInfo")
    @ApiOperation(value = "提交物资盘点数据")
    public R submitInventoriesSuppliesInfo(@RequestBody InventoriesSuppliesInfoDTO inventoriesSuppliesInfoDTO) {
        inventoriesSuppliesInfoService.submitInventoriesSuppliesInfo(inventoriesSuppliesInfoDTO);
        return R.ok();
    public R submitInventoriesSuppliesInfo(@RequestBody ADDPdDTO dto) {
        return R.ok(inventoriesSuppliesInfoService.submitInventoriesSuppliesInfo(dto));
    }
    @PostMapping("/accomplishInventoriesSuppliesInfo")
    @ApiOperation(value = "完成物资盘点数据")
    @ApiOperation(value = "完成物资盘点数据--更新库存")
    public R accomplishInventoriesSuppliesInfo(@RequestBody InventoriesSuppliesInfoDTO inventoriesSuppliesInfoDTO) {
        inventoriesSuppliesInfoService.accomplishInventoriesSuppliesInfo(inventoriesSuppliesInfoDTO);
        return R.ok();