zhuo
2025-03-16 9c44236ba81e1f5d9cb50251da8fdc883192e612
inspect-server/src/main/java/com/ruoyi/inspect/controller/RawMaterialOrderController.java
@@ -5,9 +5,12 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.basic.dto.*;
import com.ruoyi.basic.pojo.IfsInventoryQuantity;
import com.ruoyi.common.annotation.PersonalScope;
import com.ruoyi.inspect.dto.InsPlaceOrderDto;
import com.ruoyi.inspect.dto.SampleProductDto;
import com.ruoyi.inspect.pojo.InsOrder;
import com.ruoyi.inspect.pojo.RawMaterialOrderTemplate;
import com.ruoyi.inspect.service.InsOrderService;
import com.ruoyi.inspect.service.RawMaterialOrderService;
import com.ruoyi.inspect.service.RawMaterialOrderTemplateService;
import com.ruoyi.common.core.domain.Result;
@@ -17,6 +20,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
@@ -34,13 +38,14 @@
@Api(tags = "原材料下单")
public class RawMaterialOrderController {
    private InsOrderService insOrderService;
    private RawMaterialOrderService rawMaterialOrderService;
    private RawMaterialOrderTemplateService rawMaterialOrderTemplateService;
    @ApiOperation(value = "更具零件号获取标准树")
    @GetMapping("/selectStandardTreeListByPartNo")
    public Result selectStandardTreeListByPartNo(String partNo) {
        return Result.success(rawMaterialOrderService.selectStandardTreeListByPartNo(partNo));
        return rawMaterialOrderService.selectStandardTreeListByPartNo(partNo);
    }
    @ApiOperation(value = "原材料检验查询代下单")
@@ -51,13 +56,17 @@
    @ApiOperation(value = "原材料检验查询检验中")
    @GetMapping("/getIfsByStateOne")
    public Result getIfsByStateOne(Page page, IfsInventoryQuantityDto ifsInventoryQuantityDto) throws Exception {
    @PreAuthorize("@ss.hasPermi('business:order')")
    @PersonalScope(permsName = "business:order", objectName = IfsInventoryQuantityDto.class, paramName = "createUser")
    public Result getIfsByStateOne(Page page, IfsInventoryQuantityDto ifsInventoryQuantityDto){
        return Result.success(rawMaterialOrderService.getIfsByStateOne(page, ifsInventoryQuantityDto));
    }
    @ApiOperation(value = "原材料检验查询已检验")
    @GetMapping("/getIfsByOver")
    public Result getIfsByOver(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) throws Exception {
    @PreAuthorize("@ss.hasPermi('business:order')")
    @PersonalScope(permsName = "business:order", objectName = IfsInventoryQuantitySupplierDto.class, paramName = "createUser")
    public Result getIfsByOver(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto){
        return Result.success(rawMaterialOrderService.getIfsByOver(page, ifsInventoryQuantityDto));
    }
@@ -75,11 +84,11 @@
    @ApiOperation(value = "通过原材料检验单模板id获取检验单模板内容")
    @GetMapping("/selectRawMaterOrderTemplateById")
    public Result<?> selectRawMaterOrderTemplateById(Integer id) {
        return Result.success("成功", rawMaterialOrderTemplateService.selectRawMaterOrderTemplateById(id));
        return Result.success(rawMaterialOrderTemplateService.selectRawMaterOrderTemplateById(id));
    }
    @ApiOperation(value = "删除原材料检验单模板")
    @PostMapping("/delRawMaterOrderTemplate")
    @DeleteMapping("/delRawMaterOrderTemplate")
    public Result<?> delRawMaterOrderTemplate(Integer id) {
        return Result.success(rawMaterialOrderTemplateService.delRawMaterOrderTemplate(id));
    }
@@ -99,12 +108,13 @@
    /**
     * 取消报检
     * @param id 原材料下单
     * @param param
     * @return
     */
    @ApiOperation(value = "撤销报检")
    @PostMapping("/revokeInspectionReport")
    public Result<?> revokeInspectionReport(Integer id) {
    public Result<?> revokeInspectionReport(@RequestBody Map<String, Object> param) {
        Integer id = (Integer) param.get("id");
        return Result.success(rawMaterialOrderService.revokeInspectionReport(id));
    }
@@ -140,47 +150,42 @@
    @ApiOperation(value = "获取铜产业链检测数据")
    @GetMapping("/getIndustryChain")
    public Result<?> getIndustryChain(Integer id) {
        return Result.success("成功", rawMaterialOrderService.getIndustryChain(id));
        return Result.success(rawMaterialOrderService.getIndustryChain(id));
    }
    /**
     * 原材料撤销
     * @param ifsInventoryId
     * @param param
     * @return
     */
    @ApiOperation(value = "原材料撤销下单")
    @PutMapping("/repealRawOrder")
    public Result<?> repealRawOrder(Integer ifsInventoryId){
    @GetMapping("/repealRawOrder")
    public Result<?> repealRawOrder(@RequestBody Map<String, Object> param){
        Integer ifsInventoryId = (Integer) param.get("ifsInventoryId");
        return Result.success(rawMaterialOrderService.repealRawOrder(ifsInventoryId));
    }
    @ApiOperation(value = "原材料下单免检")
    @PostMapping("/addExemptionOrder")
    public Result<?> addExemptionOrder(String str) {
        Map<String, Object> map = JSON.parseObject(str, Map.class);
        JSONArray jsonArray = JSON.parseArray(map.get("list")+"");
        List<SampleProductDto> list = jsonArray.toJavaList(SampleProductDto.class);
        InsOrder insOrder = JSON.parseObject(JSON.toJSONString(map.get("insOrder")), InsOrder.class);
        return Result.success(rawMaterialOrderService.addExemptionOrder(list, insOrder));
    public Result<?> addExemptionOrder(@RequestBody InsPlaceOrderDto insPlaceOrderDto) {
        return Result.success(rawMaterialOrderService.addExemptionOrder(insPlaceOrderDto.getSampleList(), insPlaceOrderDto.getInsOrder()));
    }
    @ApiOperation(value = "仓库报检查询")
    @PostMapping("/getWarehouseSubmit")
    public Result getWarehouseSubmit(@RequestBody Map<String, Object> data) throws Exception {
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        IfsInventoryQuantity ifsInventoryQuantity = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), IfsInventoryQuantity.class);
    @GetMapping("/getWarehouseSubmit")
    public Result getWarehouseSubmit(Page page, IfsInventoryQuantity ifsInventoryQuantity) throws Exception {
        return Result.success(rawMaterialOrderService.getWarehouseSubmit(page, ifsInventoryQuantity));
    }
    /**
     * 取消报检
     * @param id 原材料下单
     * @param id
     * @return
     */
    @ApiOperation(value = "删除原材料报检信息")
    @PostMapping("/delIfsInventory")
    @DeleteMapping("/delIfsInventory")
    public Result<?> delIfsInventory(Integer id) {
        return Result.success(rawMaterialOrderService.delIfsInventory(id));
    }
@@ -211,10 +216,9 @@
    @ApiOperation(value = "原材料报检查询全部")
    @PostMapping("/getIfsByAll")
    public Result getIfsByAll(@RequestBody Map<String, Object> data) throws Exception {
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), IfsInventoryQuantitySupplierDto.class);
    @PreAuthorize("@ss.hasPermi('get:Ifs:ByAll')")
    @GetMapping("/getIfsByAll")
    public Result getIfsByAll(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto){
        return Result.success(rawMaterialOrderService.getIfsByOver(page, ifsInventoryQuantityDto));
    }
@@ -227,19 +231,10 @@
    }
    @ApiOperation(value = "原材料下单查看已完成信息")
    @PostMapping("/getIfsByFinish")
    public Result getIfsByFinish(@RequestBody Map<String, Object> data) throws Exception {
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), IfsInventoryQuantitySupplierDto.class);
    @GetMapping("/getIfsByFinish")
    public Result getIfsByFinish(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto) throws Exception {
        ifsInventoryQuantityDto.setIsFinish(1);
        return Result.success(rawMaterialOrderService.getIfsByOver(page, ifsInventoryQuantityDto));
    }
    @ApiOperation(value = "测试移库")
    @PostMapping("/shiftingParking")
    public Result shiftingParking(@RequestBody List<Integer> ids){
        rawMaterialOrderService.shiftingParking(ids);
        return Result.success();
    }
    @ApiOperation(value = "微信发送文件测试")
@@ -249,70 +244,79 @@
        return Result.success();
    }
    @ApiOperation(value = "铜单丝下单")
    @PostMapping("/addRawCopperOrder")
    public Result<?> addRawCopperOrder(@RequestBody InsPlaceOrderDto insPlaceOrderDto) {
        return Result.success(insOrderService.addRawCopperOrder(insPlaceOrderDto.getSampleList(), insPlaceOrderDto.getCopperInsOrder()));
    }
    @ApiOperation(value = "铜单丝下单免检")
    @PostMapping("/addRawCopperOrderExemptionOrder")
    public Result<?> addRawCopperOrderExemptionOrder(String str) {
        Map<String, Object> map = JSON.parseObject(str, Map.class);
        JSONArray jsonArray = JSON.parseArray(map.get("list")+"");
        List<SampleProductDto> list = jsonArray.toJavaList(SampleProductDto.class);
        CopperInsOrderDto CopperInsOrder = JSON.parseObject(JSON.toJSONString(map.get("insOrder")), CopperInsOrderDto.class);
        return Result.success(rawMaterialOrderService.addRawCopperOrderExemptionOrder(list, CopperInsOrder));
    public Result<?> addRawCopperOrderExemptionOrder(@RequestBody InsPlaceOrderDto insPlaceOrderDto) {
        return Result.success(rawMaterialOrderService.addRawCopperOrderExemptionOrder(insPlaceOrderDto.getSampleList(), insPlaceOrderDto.getCopperInsOrder()));
    }
    /**
     * 让步放行
     * @param ifsInventoryId
     * @param param
     * @return
     */
    @ApiOperation(value = "让步放行")
    @PostMapping("/concessionRelease")
    public Result<?> concessionRelease(Integer ifsInventoryId){
    public Result<?> concessionRelease(@RequestBody Map<String, Object> param){
        Integer ifsInventoryId = (Integer) param.get("ifsInventoryId");
        return Result.success(rawMaterialOrderService.concessionRelease(ifsInventoryId));
    }
    /**
     * 原材料进厂撤销下单
     * @param enterOrderId
     * @param param
     * @return
     */
    @ApiOperation(value = "原材料进厂撤销下单")
    @PostMapping("/repealEnterRawOrder")
    public Result<?> repealEnterRawOrder(Integer enterOrderId){
    public Result<?> repealEnterRawOrder(@RequestBody Map<String, Object> param){
        Integer enterOrderId = (Integer) param.get("enterOrderId");
        return Result.success(rawMaterialOrderService.repealEnterRawOrder(enterOrderId));
    }
    /**
     * 原材料季度撤销下单
     * @param quarterOrderId
     * @param param
     * @return
     */
    @ApiOperation(value = "原材料季度撤销下单")
    @PostMapping("/repealQuarterRawOrder")
    public Result<?> repealQuarterRawOrder(Integer quarterOrderId){
    public Result<?> repealQuarterRawOrder(@RequestBody Map<String, Object> param){
        Integer quarterOrderId = (Integer) param.get("quarterOrderId");
        return Result.success(rawMaterialOrderService.repealQuarterRawOrder(quarterOrderId));
    }
    @ApiOperation(value = "全部信息导出")
    @PostMapping("/rawAllExport")
    public void rawAllExport(@RequestBody Map<String, Object> data, HttpServletResponse response) throws Exception {
        IfsInventoryQuantitySupplierDto dto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), IfsInventoryQuantitySupplierDto.class);
    @GetMapping("/rawAllExport")
    public void rawAllExport(IfsInventoryQuantitySupplierDto dto, HttpServletResponse response) throws Exception {
        rawMaterialOrderService.rawAllExport(dto,response);
    }
    @ApiOperation(value = "原材料检验查询季度检验")
    @GetMapping("/getIfsByQuarter")
    @PreAuthorize("@ss.hasPermi('business:order')")
    @PersonalScope(permsName = "business:order", objectName = IfsInventoryQuantitySupplierDto.class, paramName = "createUser")
    public Result getIfsByQuarter(Page page, IfsInventoryQuantitySupplierDto ifsInventoryQuantityDto){
        return Result.success(rawMaterialOrderService.getIfsByQuarter(page, ifsInventoryQuantityDto));
    }
    /**
     * 提前入库
     * @param ifsInventoryId
     * @param param
     * @return
     */
    @ApiOperation(value = "提前入库")
    @PostMapping("/advancedGodown")
    public Result<?> advancedGodown(Integer ifsInventoryId){
    public Result<?> advancedGodown(@RequestBody Map<String, Object> param){
        Integer ifsInventoryId = (Integer) param.get("ifsInventoryId");
        return Result.success(rawMaterialOrderService.advancedGodown(ifsInventoryId));
    }