futian.liu
2023-11-15 dc1800d4d2d252b7b37d80d9f54285200c94ff3c
consum-base/src/main/java/com/consum/base/controller/LWhFormScrappedController.java
@@ -1,24 +1,27 @@
package com.consum.base.controller;
import com.consum.base.BaseController;
import com.consum.base.pojo.*;
import com.consum.base.pojo.LWhFormScrappedExtend;
import com.consum.base.pojo.LWhFormScrappedParam;
import com.consum.base.service.LWhFormScrappedGoodsService;
import com.consum.base.service.LWhFormScrappedServiceImpl;
import com.consum.model.po.*;
import com.consum.model.vo.LWhFormOutputVo;
import com.consum.model.vo.LWhFormTransferVo;
import com.iplatform.model.po.S_user_core;
import com.consum.model.po.FinSysTenantUser;
import com.consum.model.po.LWhFormScrapped;
import com.consum.model.po.LWhFormScrappedGoods;
import com.walker.db.page.GenericPager;
import com.walker.infrastructure.utils.CollectionUtils;
import com.walker.web.ResponseValue;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
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;
/**
 * @Description 报废单
@@ -35,20 +38,22 @@
    private LWhFormScrappedGoodsService scrappedGoodsService;
    /**
     * @Description  新增报废单
     * @Description 新增报废单
     * @Author 卢庆阳
     * @Date 2023/11/1
     */
    @PostMapping("/add")
    public ResponseValue add(@RequestBody LWhFormScrappedParam param) {
        FinSysTenantUser sysInfo = this.getSysInfo();
        int result = this.lWhFormScrappedService.add(param, this.getCurrentUser(),sysInfo);
        if (result > 0) return ResponseValue.success(1);
        int result = this.lWhFormScrappedService.add(param, this.getCurrentUser(), sysInfo);
        if (result > 0) {
            return ResponseValue.success(1);
        }
        return ResponseValue.error("新增失败!");
    }
    /**
     * @Description  列表查询
     * @Description 列表查询
     * @Author 卢庆阳
     * @Date 2023/11/02
     */
@@ -61,7 +66,7 @@
            return ResponseValue.error("登录用户信息不存在");
        }
        GenericPager genericPager = lWhFormScrappedService.queryList(param,sysInfo);
        GenericPager genericPager = lWhFormScrappedService.queryList(param, sysInfo);
        List<LWhFormScrapped> datas = genericPager.getDatas();
        ArrayList<LWhFormScrappedExtend> newDatas = new ArrayList<>();
        if (!CollectionUtils.isEmpty(datas)) {
@@ -88,7 +93,7 @@
    }
    /**
     * @Description  根据id查询详情
     * @Description 根据id查询详情
     * @Author 卢庆阳
     * @Date 2023/11/2
     */
@@ -103,6 +108,7 @@
    /**
     * 报废明细
     *
     * @param param
     * @return
     */
@@ -112,12 +118,12 @@
        if (sysInfo == null) {
            return ResponseValue.error("登录用户信息不存在");
        }
        GenericPager<Map<String, Object>> genericPager = lWhFormScrappedService.queryDetailList(param,sysInfo);
        GenericPager<Map<String, Object>> genericPager = lWhFormScrappedService.queryDetailList(param, sysInfo);
        return ResponseValue.success(genericPager);
    }
    /**
     * @Description  导出报废登记单
     * @Description 导出报废登记单
     * @Author 卢庆阳
     * @Date 2023/11/2
     */
@@ -126,7 +132,7 @@
        if (id == null) {
            return ResponseValue.error("报废单id为空");
        }
        LWhFormScrappedExtend scrappedExtend = this.lWhFormScrappedService.export(id,this.getSysInfo());
        LWhFormScrappedExtend scrappedExtend = this.lWhFormScrappedService.export(id, this.getSysInfo());
        return ResponseValue.success(scrappedExtend);
    }