自动化立体仓库 - WMS系统
zjj
2023-06-15 36ee5dcf26d772d3e1debb4893f65a42cb65e8f3
出入库日志优化
13个文件已修改
69 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/ManLocDetlController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/MobileController.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/NodeController.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/ManLocDetlService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/MobileService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/NodeService.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/ManLocDetlServiceImpl.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/NodeServiceImpl.java 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/SaasUtils.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/system/entity/SaasLog.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/SaasLogMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/saasLog/saasLog.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/ManLocDetlController.java
@@ -76,7 +76,7 @@
    @RequestMapping("/manLocDetl/adjust/start")
    @ManagerAuth(memo = "库存调整")
    public R locDetlAdjustStart(@RequestBody LocDetlAdjustParam param) {
        manLocDetlService.adjustLocDetl(param, getUserId());
        manLocDetlService.adjustLocDetl(param, getUserId(),getUser());
        return R.ok("库存调整成功");
    }
src/main/java/com/zy/asrs/controller/MobileController.java
@@ -346,7 +346,7 @@
        if (json == null){
            return R.error("传入数据为空");
        }
        return mobileService.manDetlIn(json);
        return mobileService.manDetlIn(json , getUser());
    }
    //平库pda下架
@@ -355,7 +355,7 @@
        if (json == null){
            return R.error("传入数据为空");
        }
        return mobileService.manDetlOut(json);
        return mobileService.manDetlOut(json,getUser());
    }
}
src/main/java/com/zy/asrs/controller/NodeController.java
@@ -314,13 +314,13 @@
        if (node.getType() != 3) {
          return R.error("仅可选择货位");
        }
        return nodeService.stockPakin(number, getUserId(), getHostId());
        return nodeService.stockPakin(number, getUserId(), getHostId(),getUser());
    }
    @RequestMapping("/work/stock/pakout")
    @ManagerAuth(memo = "出库")
    public R initPakout(@RequestBody List<InitPakoutParam> params) {
        return nodeService.initPakout(params, getUserId(), getHostId());
        return nodeService.initPakout(params, getUserId(), getHostId(),getUser());
    }
    @PostMapping(value = "/work/empty/stock")
@@ -333,7 +333,7 @@
    @ManagerAuth(memo = "库位移转")
    public R locMoveStart(@RequestParam String sourceLocNo,
                          @RequestParam String targetLocNo) {
        nodeService.locMove(sourceLocNo, targetLocNo, getUserId());
        nodeService.locMove(sourceLocNo, targetLocNo, getUserId(),getUser());
        return R.ok("移库启动成功");
    }
    @RequestMapping(value = "/node/select/{id}/auth")
src/main/java/com/zy/asrs/service/ManLocDetlService.java
@@ -5,6 +5,7 @@
import com.zy.asrs.entity.ManLocDetl;
import com.zy.asrs.entity.param.LocDetlAdjustParam;
import com.zy.asrs.entity.result.StockVo;
import com.zy.system.entity.User;
import java.util.List;
import java.util.Set;
@@ -58,7 +59,7 @@
    Page<ManLocDetl> getOutPage(Page<ManLocDetl> manLocDetlPage);
    void adjustLocDetl(LocDetlAdjustParam param, Long userId);
    void adjustLocDetl(LocDetlAdjustParam param, Long userId, User user);
    Page<ManLocDetl> selectAllPage(Page<ManLocDetl> param);
src/main/java/com/zy/asrs/service/MobileService.java
@@ -8,6 +8,7 @@
import com.zy.asrs.entity.param.CombParam;
import com.zy.asrs.entity.param.MobileAdjustParam;
import com.zy.asrs.entity.param.OffSaleParam;
import com.zy.system.entity.User;
import java.util.Date;
@@ -40,7 +41,7 @@
    void stockOut(OrderDetl orderDetl, BasDevp staNo, LocDetl locDetl,
                  Double curOutQty, Integer ioType, Long userId, Date now);
    R manDetlIn(JSONObject json);
    R manDetlIn(JSONObject json, User user);
    R manDetlOut(JSONObject json);
    R manDetlOut(JSONObject json,User user);
}
src/main/java/com/zy/asrs/service/NodeService.java
@@ -7,6 +7,7 @@
import com.zy.asrs.entity.Node;
import com.zy.asrs.entity.param.InitPakoutParam;
import com.zy.asrs.entity.param.PakinParam;
import com.zy.system.entity.User;
import java.util.List;
@@ -22,11 +23,11 @@
        Node selectByUuid(String uuid, Long hostId, Integer type, Long parentId);
    R stockPakin(PakinParam number, Long userId, Long hostId);
    R stockPakin(PakinParam number, Long userId, Long hostId, User user);
        R initPakout(List<InitPakoutParam> params, Long userId, Long hostId);
        R initPakout(List<InitPakoutParam> params, Long userId, Long hostId, User user);
    void locMove(String sourceLocNo, String targetLocNo, Long userId);
    void locMove(String sourceLocNo, String targetLocNo, Long userId , User user);
    Page<Node> getPage(Page<Node> page);
}
src/main/java/com/zy/asrs/service/impl/ManLocDetlServiceImpl.java
@@ -12,6 +12,7 @@
import com.zy.asrs.service.MatService;
import com.zy.asrs.service.NodeService;
import com.zy.asrs.utils.SaasUtils;
import com.zy.system.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -142,7 +143,7 @@
    @Transactional
    @Override
    public void adjustLocDetl(LocDetlAdjustParam param, Long userId) {
    public void adjustLocDetl(LocDetlAdjustParam param, Long userId , User user) {
        Date now = new Date();
        this.baseMapper.delete(new EntityWrapper<ManLocDetl>()
                .eq("loc_no", param.getLocNo()));
@@ -172,7 +173,7 @@
            manLocDetl.setUnit(mat.getUnit());
            manLocDetl.setBarcode(mat.getBarcode());
            manLocDetl.setPrice(mat.getPrice());
            SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme());
            SaasUtils.insertLog(3,manLocDetl.getLocNo(), manLocDetl.getMatnr(),manLocDetl.getAnfme(),user.getUsername());
            this.baseMapper.insert(manLocDetl);
        }
    }
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -24,6 +24,8 @@
import com.zy.common.service.CommonService;
import com.zy.common.utils.HttpHandler;
import com.zy.common.utils.Synchro;
import com.zy.common.web.BaseController;
import com.zy.system.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -80,6 +82,8 @@
    private ManLocDetlService manLocDetlService;
    @Autowired
    private ManLocDetlMapper manLocDetlMapper;
    private BaseController baseController;
    @Override
@@ -519,7 +523,7 @@
    @Transactional
    @Override
    public R manDetlIn(JSONObject json) {
    public R manDetlIn(JSONObject json, User user) {
        Date date = new Date();
        String jsonLocNo = (String) json.get("locNo");
        Node node = nodeService.selectOne(new EntityWrapper<Node>()
@@ -604,7 +608,7 @@
            }
            orderService.checkComplete(order.getOrderNo());
            SaasUtils.insertLog(0,jsonLocNo,jsonOrderDetl.getMatnr(), jsonOrderDetl.getAnfme());
            SaasUtils.insertLog(0,jsonLocNo,jsonOrderDetl.getMatnr(), jsonOrderDetl.getAnfme(),user.getUsername());
        }
@@ -613,7 +617,7 @@
    @Transactional
    @Override
    public R manDetlOut(JSONObject json) {
    public R manDetlOut(JSONObject json,User user) {
        Date date = new Date();
        String jsonLocNo = (String) json.get("locNo");
        Node node = nodeService.selectOne(new EntityWrapper<Node>()
@@ -723,7 +727,7 @@
                    return R.error("更新平库库存状态失败");
                }
            }
            SaasUtils.insertLog(1,jsonLocNo,jsonOrderDetl.getMatnr(), jsonOrderDetl.getAnfme());
            SaasUtils.insertLog(1,jsonLocNo,jsonOrderDetl.getMatnr(), jsonOrderDetl.getAnfme(),user.getUsername());
        }
        return R.ok("下架完成");
src/main/java/com/zy/asrs/service/impl/NodeServiceImpl.java
@@ -19,6 +19,7 @@
import com.zy.asrs.service.*;
import com.zy.asrs.utils.SaasUtils;
import com.zy.asrs.utils.VersionUtils;
import com.zy.system.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -84,7 +85,7 @@
    }
    @Override
    public R stockPakin(PakinParam param, Long userId, Long hostId) {
    public R stockPakin(PakinParam param, Long userId, Long hostId , User user) {
        Node node = nodeService.selectByUuid(param.getNodeId(), hostId);
        if (node == null) {
            node = nodeService.selectById(param.getNodeId());
@@ -122,7 +123,7 @@
                manLocDetl.setCreateBy(userId);
                manLocDetl.setStatus(1);
                manLocDetl.setPayment(1);
                SaasUtils.insertLog(0,manLocDetl.getLocNo(),manLocDetl.getMatnr(), manLocDetl.getAnfme());
                SaasUtils.insertLog(0,manLocDetl.getLocNo(),manLocDetl.getMatnr(), manLocDetl.getAnfme(),user.getUsername());
                manLocDetlService.insert(manLocDetl);
            }else {
                check.setAnfme(dto.getCount() + check.getAnfme());
@@ -144,7 +145,7 @@
    @Transactional
    @Override
    public R initPakout(List<InitPakoutParam> params, Long userId, Long hostId) {
    public R initPakout(List<InitPakoutParam> params, Long userId, Long hostId, User user) {
        if (!Cools.isEmpty(params)) {
            Date now = new Date();
            for (InitPakoutParam param : params) {
@@ -162,7 +163,7 @@
                if (manLocDetl.getAnfme() - param.getCount() < 0) {
                    return R.error("物料:"+ param.getMatnr() + " 在库位中数量不足");
                } else if (manLocDetl.getAnfme() - param.getCount() == 0) {
                    SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount());
                    SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount(),user.getUsername());
                    manLocDetlService.delete(new EntityWrapper<ManLocDetl>()
                            .eq("loc_no",node.getUuid())
                            .eq("matnr",param.getMatnr()));
@@ -172,7 +173,7 @@
                    manLocDetlService.update(manLocDetl,new EntityWrapper<ManLocDetl>()
                            .eq("loc_no",node.getUuid())
                            .eq("matnr",param.getMatnr()));
                    SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount());
                    SaasUtils.insertLog(1,manLocDetl.getLocNo(), manLocDetl.getMatnr(),param.getCount(),user.getUsername());
                }
            }
        }
@@ -181,7 +182,7 @@
    @Transactional
    @Override
    public void locMove(String sourceLocNo, String targetLocNo, Long userId) {
    public void locMove(String sourceLocNo, String targetLocNo, Long userId, User user) {
        List<ManLocDetl> sourceManDetl = manLocDetlService.selectList(new EntityWrapper<ManLocDetl>()
                .like("loc_no", sourceLocNo));
        for (ManLocDetl source : sourceManDetl) {
@@ -200,7 +201,7 @@
                source.setLocNo(targetNode.getUuid());
                source.setNodeId(targetNode.getId());
                SaasUtils.insertLog(2,source.getLocNo(), source.getMatnr(), source.getAnfme());
                SaasUtils.insertLog(2,source.getLocNo(), source.getMatnr(), source.getAnfme(),user.getUsername());
                manLocDetlService.insert(source);
            }else {
                check.setAnfme(check.getAnfme() + source.getAnfme());
src/main/java/com/zy/asrs/utils/SaasUtils.java
@@ -1,14 +1,13 @@
package com.zy.asrs.utils;
import com.core.common.SpringUtils;
import com.fasterxml.jackson.databind.util.BeanUtil;
import com.zy.system.entity.SaasLog;
import com.zy.system.service.SaasLogService;
import java.util.Date;
public class SaasUtils {
    public static void insertLog(Integer type, String locNo, String matnr,Double anfme){
    public static void insertLog(Integer type, String locNo, String matnr,Double anfme,String user){
        SaasLogService bean = SpringUtils.getBean(SaasLogService.class);
        SaasLog saasLog = new SaasLog();
        saasLog.setType(type);
@@ -17,6 +16,7 @@
        saasLog.setIoTime(new Date());
        saasLog.setAnfme(anfme);
        saasLog.setCreateBy(1L);
        saasLog.setCreateByName(user);
        bean.insert(saasLog);
    }
}
src/main/java/com/zy/system/entity/SaasLog.java
@@ -47,6 +47,10 @@
    @TableField("create_by")
    private Long createBy;
    @ApiModelProperty(value= "")
    @TableField("create_by_name")
    private String createByName;
    @TableField("anfme")
    private Double anfme;
src/main/resources/mapper/SaasLogMapper.xml
@@ -10,6 +10,7 @@
        <result column="matnr" property="matnr" />
        <result column="io_time" property="ioTime" />
        <result column="create_by" property="createBy" />
        <result column="create_by_name" property="createByName" />
    </resultMap>
src/main/webapp/static/js/saasLog/saasLog.js
@@ -27,6 +27,7 @@
            ,{field: 'type$', align: 'center',title: '操作类型'}
            ,{field: 'matnr', align: 'center',title: '物料号'}
            ,{field: 'anfme', align: 'center',title: '数量'}
            ,{field: 'createByName', align: 'center',title: '操作人'}
            ,{field: 'ioTime$', align: 'center',title: '操作时间'}
            ,{field: 'createBy', align: 'center',title: '', hide:true}