自动化立体仓库 - WMS系统
#
Junjie
2025-04-07 3015d66dae1fef9850c9c990570e8ca90f0ded60
src/main/java/com/zy/asrs/controller/ManLocDetlController.java
@@ -1,5 +1,6 @@
package com.zy.asrs.controller;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.core.annotations.ManagerAuth;
@@ -10,12 +11,14 @@
import com.zy.asrs.entity.param.LocDetlAdjustParam;
import com.zy.asrs.service.ManLocDetlService;
import com.zy.common.web.BaseController;
import com.zy.system.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
@RestController
@@ -76,7 +79,8 @@
    @RequestMapping("/manLocDetl/adjust/start")
    @ManagerAuth(memo = "库存调整")
    public R locDetlAdjustStart(@RequestBody LocDetlAdjustParam param) {
        manLocDetlService.adjustLocDetl(param, getUserId(),getUser());
        User user = getUser();
        manLocDetlService.adjustLocDetl(param, getUserId(), user == null ? "" : user.getUsername());
        return R.ok("库存调整成功");
    }
@@ -120,4 +124,34 @@
        }
    }
    @RequestMapping(value = "/manLocDetl/export/auth")
    @ManagerAuth(memo = "库位明细导出")
    public synchronized R export(@RequestBody JSONObject param){
        List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
        EntityWrapper<ManLocDetl> wrapper = new EntityWrapper<>();
        Map<String, Object> map = excludeTrash(param.getJSONObject("locDetl"));
        String row = "";
        if (map.get("row") != null) {
            String chooseRow = (String) map.get("row");
            if (chooseRow.length() == 1) {
                row = "0" + chooseRow;
                map.remove("row");
            }else {
                row = chooseRow;
                map.remove("row");
            }
        }
        convert(map, wrapper);
        if (!row.equals("")){
            wrapper.and()
                    .where("loc_no like '" +row +"%'");
        }
        List<ManLocDetl> list = manLocDetlService.selectList(wrapper);
        list.forEach(m -> {
            m.setMatnr(m.getMatnr() + " ");
        });
        return R.ok(exportSupport(list, fields));
    }
}