skyouc
昨天 3d2e154d70d3976a5f33c9fcef7422992297c19b
rsf-server/src/main/java/com/vincent/rsf/server/api/controller/ReceiveMsgController.java
@@ -1,19 +1,21 @@
package com.vincent.rsf.server.api.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.vincent.rsf.framework.common.R;
import com.vincent.rsf.framework.exception.CoolException;
import com.vincent.rsf.server.api.controller.params.BaseMatParms;
import com.vincent.rsf.server.api.controller.params.OrderParams;
import com.vincent.rsf.server.api.controller.params.QueryOrderParam;
import com.vincent.rsf.server.api.service.ReceiveMsgService;
import com.vincent.rsf.server.common.domain.BaseParam;
import com.vincent.rsf.server.common.domain.PageParam;
import com.vincent.rsf.server.common.utils.ExcelUtil;
import com.vincent.rsf.server.manager.entity.Matnr;
import com.vincent.rsf.server.manager.entity.Loc;
import com.vincent.rsf.server.manager.entity.excel.AsnOrderTemplate;
import com.vincent.rsf.server.manager.entity.excel.MatnrsTemplate;
import com.vincent.rsf.server.manager.service.MatnrGroupService;
import com.vincent.rsf.server.manager.service.MatnrService;
import com.vincent.rsf.server.system.controller.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@@ -24,6 +26,7 @@
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
@@ -64,6 +67,23 @@
        }
    }
    /**
     * @author Ryan
     * @date 2025/8/15
     * @description: DO单同步
     * @version 1.0
     */
    @ApiOperation("出库通知单(DO单同步)")
    @PostMapping("/sync/delivery")
    public R syncDelivery(@RequestBody List<OrderParams> orders) {
        if (!receiveMsgService.syncPurchasee(orders)) {
            return R.error("保存失败");
        } else {
            return R.ok("保存成功!!");
        }
    }
    /**
     * @author Ryan
     * @description 同步质检结果信息
@@ -82,6 +102,7 @@
//        return R.ok();
    }
    @ApiOperation("基础物料信息同步")
    @PostMapping("/sync/base/matnrs")
    public R syncMatnrs(@RequestBody List<BaseMatParms> matnrs) {
@@ -92,6 +113,29 @@
        return R.ok();
    }
    public R syc
    @ApiOperation("查询单据状态")
    @PostMapping("/query/order")
    public R queryOrderStatus(@RequestBody QueryOrderParam queryParams) {
        if (Objects.isNull(queryParams)) {
            throw new CoolException("参数不能为空!!");
        }
       return receiveMsgService.queryOrderStatus(queryParams);
    }
    /**
     * @author Ryan
     * @date 2025/8/15
     * @description: 库位明细同步
     * @version 1.0
     */
    @PostMapping("/sync/locs/detls")
    @ApiOperation("库位信息明细同步")
    public R syncLocDetls(@RequestBody Map<String, Object> map) {
        BaseParam baseParam = buildParam(map, BaseParam.class);
        PageParam<Loc, BaseParam> pageParam = new PageParam<>(baseParam, Loc.class);
        QueryWrapper<Loc> wrapper = pageParam.buildWrapper(true);
        return receiveMsgService.syncLocsDetl(pageParam, wrapper);
    }
}