自动化立体仓库 - WMS系统
pjb
昨天 9ea93abc2606948e5724316a4a3ec338ea14a130
Merge remote-tracking branch 'origin/tzhneasrs' into tzhneasrs
14个文件已修改
1个文件已添加
211 ■■■■■ 已修改文件
src/main/java/com/zy/asrs/controller/PlaController.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/DropdownValuesDto.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/Pla.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/entity/PlaLog.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/mapper/PlaMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/PlaService.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/PlaExcelListener.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/mapper/PlaMapper.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/css/common.css 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/pla/plaDetl.js 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/operateLog/operateLog.html 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pla/plaDetl.html 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pla2/plaDetl.html 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/pla3/plaDetl.html 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/controller/PlaController.java
@@ -20,6 +20,8 @@
import com.zy.common.CodeRes;
import com.zy.common.entity.PlaExcel;
import com.zy.common.web.BaseController;
import com.zy.system.entity.OperateLog;
import com.zy.system.service.OperateLogService;
import lombok.Synchronized;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
@@ -28,10 +30,12 @@
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.*;
import java.util.stream.Collectors;
@RestController
@Slf4j
@@ -53,6 +57,32 @@
    private MatService matService;
    @Autowired
    private SnowflakeIdWorker snowflakeIdWorker;
    @Resource
    private OperateLogService operateLogService;
    // 获取下拉选择框值列表
    @GetMapping(value = "/pla/dropdownValues/list")
    @ManagerAuth
    public R list() {
        List<DropdownValuesDto> list = plaService.getDropdownValues();
        Map<String, List<String>> map = new HashMap<>();
        // owner 去重并加入 map
        List<String> owners = list.stream()
                .filter(dropdownValuesDto -> dropdownValuesDto.getType().equals("owner"))
                .map(DropdownValuesDto::getValue)
                .collect(Collectors.toList());
        map.put("owner", owners);
        // workshop 去重并加入 map
        List<String> workshops = list.stream()
                .filter(dropdownValuesDto -> dropdownValuesDto.getType().equals("workshop"))
                .map(DropdownValuesDto::getValue)
                .collect(Collectors.toList());
        map.put("workshop", workshops);
        return R.ok(map);
    }
    @RequestMapping(value = "/pla/list/auth")
@@ -103,7 +133,7 @@
    @RequestMapping(value = "/pla/update/auth")
    @ManagerAuth
    public R update(@RequestBody List<Pla> plas) {
        log.info(plas.toString());
        Date date = new Date();
        plas.forEach(pla -> {
            Pla plaSave = plaService.selectById(pla.getId());
            pla.setModifyTime(new Date());
@@ -112,10 +142,20 @@
            PlaLog plaLog = new PlaLog();
            BeanUtils.copyProperties(plaSave, plaLog);
            plaLog.setId(null);
            plaLog.setCreateTime(new Date());
            plaLog.setCreateTime(date);
            plaLog.setModifyUser(getUser().getUsername());
            plaLogService.insert(plaLog);
            // 记录操作日志
            OperateLog operateLog = new OperateLog();
            operateLog.setAction("聚乳酸库存明细修改");
            operateLog.setUserId(getUserId());
            operateLog.setIp(request.getRemoteAddr());
            operateLog.setRequest(pla.toString());
            operateLog.setResponse(plaSave.toString());
            operateLog.setCreateTime(new Date());
            operateLogService.insert(operateLog);
        });
        return R.ok();
    }
src/main/java/com/zy/asrs/entity/DropdownValuesDto.java
New file
@@ -0,0 +1,16 @@
package com.zy.asrs.entity;
import lombok.Data;
/**
 * @author pang.jiabao
 * @description 下拉选择框值通用视图
 * @createDate 2025/10/23 13:36
 */
@Data
public class DropdownValuesDto {
    private String type;
    private String value;
}
src/main/java/com/zy/asrs/entity/Pla.java
@@ -149,6 +149,10 @@
    @ExcelProperty(value = "不透明度,%")
    private Double opacity;
    @TableField("lactide_content")
    @ExcelProperty(value = "丙交酯含量,%")
    private Double lactideContent;
    //L值
    @TableField("l")
    @ExcelProperty(value = "L*")
src/main/java/com/zy/asrs/entity/PlaLog.java
@@ -236,6 +236,10 @@
    @TableField("memo")
    private String memo;
    @TableField("lactide_content")
    @ExcelProperty(value = "丙交酯含量,%")
    private Double lactideContent;
    public String getPakinTime$() {
        if (Cools.isEmpty(this.pakinTime)){
            return "";
src/main/java/com/zy/asrs/mapper/PlaMapper.java
@@ -1,6 +1,7 @@
package com.zy.asrs.mapper;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zy.asrs.entity.DropdownValuesDto;
import com.zy.asrs.entity.Pla;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@@ -26,6 +27,11 @@
    Integer getStockStatisCountAll(Map<String, Object> map);
    /**
     * 获取下拉列表值
     */
    List<DropdownValuesDto> getDropdownValues();
    /**
     * 自动解冻冻结时间超过90天的库存
     * @return 更新数量
     */
src/main/java/com/zy/asrs/service/PlaService.java
@@ -2,6 +2,7 @@
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.IService;
import com.zy.asrs.entity.DropdownValuesDto;
import com.zy.asrs.entity.OrderDetl;
import com.zy.asrs.entity.Pla;
import com.zy.asrs.entity.PlaQty;
@@ -11,6 +12,8 @@
public interface PlaService extends IService<Pla> {
    List<DropdownValuesDto> getDropdownValues();
    Pla selectByBatchAndPackageNo(String batch, Integer packageNo, String brand);
    void queryStock(OrderDetl orderDetl, List<PlaQty> plaQties);
src/main/java/com/zy/asrs/service/impl/PlaServiceImpl.java
@@ -7,6 +7,7 @@
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.exception.CoolException;
import com.zy.asrs.entity.DropdownValuesDto;
import com.zy.asrs.entity.OrderDetl;
import com.zy.asrs.entity.Pla;
import com.zy.asrs.entity.PlaQty;
@@ -21,6 +22,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
@@ -29,6 +31,14 @@
    @Autowired
    private PlaQtyService plaQtyService;
    @Resource
    private PlaMapper plaMapper;
    @Override
    public List<DropdownValuesDto> getDropdownValues() {
        return plaMapper.getDropdownValues();
    }
    public Pla selectByBatchAndPackageNo(String batch, Integer packageNo, String brand) {
        return this.selectOne(new EntityWrapper<Pla>().eq("batch",batch).eq("package_no",packageNo).eq("brand",brand));
    }
src/main/java/com/zy/asrs/utils/PlaExcelListener.java
@@ -120,6 +120,7 @@
            pla.setVadf2(excel.getVadf2());
            pla.setYellowness(excel.getYellowness());
            pla.setOpacity(excel.getOpacity());
            pla.setLactideContent(excel.getLactideContent());
            pla.setL(excel.getL());
            pla.setA(excel.getA());
            pla.setB(excel.getB());
src/main/resources/mapper/PlaMapper.xml
@@ -43,4 +43,8 @@
        </where>
        GROUP BY brand,matnr,workshop HAVING SUM(weight_anfme) > 0 ORDER BY matnr,workshop
    </select>
    <select id="getDropdownValues" resultType="com.zy.asrs.entity.DropdownValuesDto">
        SELECT type, value
        FROM dropdown_values_view
    </select>
</mapper>
src/main/webapp/static/css/common.css
@@ -88,7 +88,7 @@
    text-align: center;
}
div .layui-table-tool .layui-table-tool-self .layui-inline[title='导出']{
    display: none;
    /*display: none;*/
}
.layui-form.layui-border-box.layui-table-view{
    margin: 15px 0 35px 0;
src/main/webapp/static/js/pla/plaDetl.js
@@ -29,6 +29,7 @@
        ,{field: 'vadf2', align: 'center',title: '分解段,%', hide:true,edit:true}
        ,{field: 'yellowness', align: 'center',title: '黄度',edit:true}
        ,{field: 'opacity', align: 'center',title: '不透明度,%',edit:true}
        ,{field: 'lactideContent', align: 'center',title: '丙交酯含量,%',edit:true}
        ,{field: 'l', align: 'center',title: 'L*', hide:true,edit:true}
        ,{field: 'a', align: 'center',title: 'a*', hide:true,edit:true}
        ,{field: 'b', align: 'center',title: 'b*', hide:true,edit:true}
@@ -103,6 +104,33 @@
    laydate = layui.laydate;
    var form = layui.form;
    admin = layui.admin;
    // 模拟从后端接口获取数据
    $.ajax({
        url: baseUrl + "/pla/dropdownValues/list",
        headers: {'token': localStorage.getItem('token')},
        method: 'GET',
        success: function (res) {
            if (res.code === 200) {
                var data = res.data
                if (data.owner && Array.isArray(data.owner)) {
                    data.owner.forEach(function(item) {
                        $('#ownerSelect').append(new Option(item, item));
                    });
                }
                if (data.workshop && Array.isArray(data.workshop)) {
                    data.workshop.forEach(function(item) {
                        $('#workshopSelect').append(new Option(item, item));
                    });
                }
                // 重新渲染 LayUI 表单
                form.render('select');
            }
        }
    });
    // 日期时间范围
    laydate.render({
@@ -826,6 +854,10 @@
                var iframe = window['layui-layer-iframe' + index];
                iframe.child(dataSave)
            },
            end: function() {
                // ✅ 子页面关闭时刷新表格
                tableReload(false); // 或根据实际情况传 true/false
            }
        });
    })
src/main/webapp/views/operateLog/operateLog.html
@@ -16,7 +16,7 @@
<div id="search-box" class="layui-form layui-card-header">
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="id" placeholder="编号" autocomplete="off">
            <input class="layui-input" type="text" name="action" placeholder="操作内容" autocomplete="off">
        </div>
    </div>
    <div class="layui-inline">
@@ -30,6 +30,16 @@
            </div>
        </div>
    </div>
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="request" placeholder="请求数据" autocomplete="off">
        </div>
    </div>
    <div class="layui-inline">
        <div class="layui-input-inline">
            <input class="layui-input" type="text" name="response" placeholder="返回数据" autocomplete="off">
        </div>
    </div>
    <!-- 日期范围 -->
    <div class="layui-inline" style="width: 300px">
        <div class="layui-input-inline">
src/main/webapp/views/pla/plaDetl.html
@@ -304,7 +304,16 @@
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="owner" placeholder="主体" autocomplete="off">
                <select id="ownerSelect" name="owner" lay-search>
                    <option value="">主体</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select id="workshopSelect" name="workshop" lay-search>
                    <option value="">车间</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
@@ -320,6 +329,16 @@
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="lactide_contentMax" placeholder="最小丙交酯" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="lactide_contentMax" placeholder="最大丙交酯" autocomplete="off">
            </div>
        </div>
    </div>
</div>
src/main/webapp/views/pla2/plaDetl.html
@@ -296,6 +296,32 @@
            </div>
        </div>
    </div>
    <div class="layui-form layui-card-header">
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select id="ownerSelect" name="owner" lay-search>
                    <option value="">主体</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select id="workshopSelect" name="workshop" lay-search>
                    <option value="">车间</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="lactide_contentMax" placeholder="最小丙交酯" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="lactide_contentMax" placeholder="最大丙交酯" autocomplete="off">
            </div>
        </div>
    </div>
</div>
<script type="text/html" id="toolbar">
src/main/webapp/views/pla3/plaDetl.html
@@ -296,6 +296,32 @@
            </div>
        </div>
    </div>
    <div class="layui-form layui-card-header">
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select id="ownerSelect" name="owner" lay-search>
                    <option value="">主体</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select id="workshopSelect" name="workshop" lay-search>
                    <option value="">车间</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="lactide_contentMax" placeholder="最小丙交酯" autocomplete="off">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input class="layui-input" type="text" name="lactide_contentMax" placeholder="最大丙交酯" autocomplete="off">
            </div>
        </div>
    </div>
</div>
<script type="text/html" id="toolbar">