自动化立体仓库 - WMS系统
skyouc
22 小时以前 9e6d4880ca1ce6ae5cb9b9dc1b865f0ee9f65fe8
缓冲区库存调整
11个文件已修改
165 ■■■■ 已修改文件
pom.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/asrs/utils/OrderInAndOutUtil.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/config/WebConfig.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/constant/MesConstant.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/utils/Http.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/zy/common/web/AuthController.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/resources/application.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/common.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/static/js/waitPakin/waitPakin.js 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/webapp/views/login.html 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pom.xml
@@ -9,7 +9,7 @@
        <relativePath/>
    </parent>
    <groupId>com.zy</groupId>
    <artifactId>asrs</artifactId>
    <artifactId>asrs</artifactId>t
    <version>1.1.1</version>
    <packaging>war</packaging>
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -539,7 +539,7 @@
    }
    @Override
    @Transactional
    @Transactional(rollbackFor = Exception.class)
    public void comb(CombParam param, Long userId) {
        if (Cools.isEmpty(param.getBarcode(), param.getCombMats())) {
            throw new CoolException(BaseRes.PARAM);
@@ -777,7 +777,9 @@
        // 添加明细
        for (WrkDetl wrkDetl : list) {
            if (wrkDetl.getAnfme() == 0.0D) { continue; }
            if (wrkDetl.getAnfme() == 0.0D) {
                continue;
            }
            // todo 盘点记录、保存调整记录
            String orderNo = wrkDetl.getOrderNo();
            Mat mat = matService.selectByMatnr(wrkDetl.getMatnr());
@@ -894,7 +896,9 @@
                                response,
                                success
                        );
                    } catch (Exception e) { log.error("", e); }
                    } catch (Exception e) {
                        log.error("", e);
                    }
                }
            }
src/main/java/com/zy/asrs/utils/OrderInAndOutUtil.java
@@ -132,6 +132,8 @@
                    return casual.getDeclaredMethod(OrderMethodVo.INCREASE_QTY_BY_ORDER_NO.getCode(), String.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class,Double.class);
                case INCREASE_WORKING_QTY:
                    return casual.getDeclaredMethod(OrderMethodVo.INCREASE_WORKING_QTY.getCode(), Long.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class,String.class,Double.class);
                default:
                    break;
            }
        } catch (Exception e) {
            throw new CoolException(e.getCause().getMessage());
src/main/java/com/zy/common/config/WebConfig.java
@@ -1,9 +1,23 @@
package com.zy.common.config;
import com.zy.common.constant.MesConstant;
import com.zy.common.utils.Http;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
import org.springframework.web.filter.CorsFilter;
import org.springframework.web.servlet.AsyncHandlerInterceptor;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
 * Created by vincent on 2019-06-13
@@ -21,4 +35,48 @@
                ;
    }
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*") // 使用 allowedOriginPatterns 而不是 allowedOrigins
                .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
                .allowedHeaders("*")
                .allowCredentials(true)
                .maxAge(3600);
    }
    /**
     * 方式二:使用 Filter(更全面,优先级更高)
     */
    @Bean
    public FilterRegistrationBean<CorsFilter> corsFilter() {
        CorsConfiguration config = new CorsConfiguration();
        // 允许所有域名
        config.addAllowedOrigin("*");
        // 允许任何头
        config.addAllowedHeader("*");
        // 允许任何方法(GET, POST, PUT, DELETE, OPTIONS等)
        config.addAllowedMethod("*");
        // 允许凭证(如果需要cookie等凭证,设置为true,但需要指定具体域名)
        config.setAllowCredentials(false);
        // 预检请求的有效期,单位为秒
        config.setMaxAge(3600L);
        UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
        source.registerCorsConfiguration("/**", config);
        FilterRegistrationBean<CorsFilter> bean = new FilterRegistrationBean<>(new CorsFilter(source));
        // 设置优先级最高
        bean.setOrder(Ordered.HIGHEST_PRECEDENCE);
        return bean;
    }
}
src/main/java/com/zy/common/constant/MesConstant.java
@@ -13,4 +13,15 @@
    public static final String PAKOUT_URL = "wmsFinprd/api/zy/v1/packOut/sendList";
    /**
     * token通过header传递的名称
     */
    public static final String TOKEN_HEADER_NAME = "Authorization";
    /**
     * token通过参数传递的名称
     */
    public static final String TOKEN_PARAM_NAME = "access_token";
}
src/main/java/com/zy/common/utils/Http.java
@@ -4,6 +4,7 @@
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.core.common.R;
import com.zy.common.constant.MesConstant;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
@@ -28,4 +29,15 @@
            e.printStackTrace();
        }
    }
    public static void cors(HttpServletResponse response){
        // 跨域设置
        response.setHeader("Access-Control-Max-Age", "3600");
        response.setHeader("Access-Control-Allow-Origin", "*");
        response.setHeader("Access-Control-Allow-Methods", "*");
        response.setHeader("Access-Control-Allow-Headers", "*");
        response.setHeader("Access-Control-Expose-Headers", MesConstant.TOKEN_HEADER_NAME);
    }
}
src/main/java/com/zy/common/web/AuthController.java
@@ -50,21 +50,21 @@
    @Autowired
    private LicenseTimer licenseTimer;
    @RequestMapping("/login.action")
    @PostMapping("/login.action")
    @ManagerAuth(value = ManagerAuth.Auth.NONE, memo = "登录")
    public R loginAction(String username, String password){
    public R loginAction(@RequestBody Map<String, String> param) {
        //验证许可证是否有效
        if (!licenseTimer.getSystemSupport()){
            return R.parse(CodeRes.SYSTEM_20001);
        }
        EntityWrapper<User> userWrapper = new EntityWrapper<>();
        userWrapper.eq("username", username);
        userWrapper.eq("username", param.get("username"));
        User user = userService.selectOne(userWrapper);
        if (Cools.isEmpty(user)){
            if (username.equals("super") && password.equals(Cools.md5(superPwd))) {
            if (param.get("username").equals("super") && param.get("password").equals(Cools.md5(superPwd))) {
                Map<String, Object> res = new HashMap<>();
                res.put("username", username);
                res.put("token", Cools.enToken(System.currentTimeMillis() + username, superPwd));
                res.put("username", param.get("username"));
                res.put("token", Cools.enToken(System.currentTimeMillis() + param.get("username"), superPwd));
                return R.ok(res);
            }
            return R.parse(CodeRes.USER_10001);
@@ -72,10 +72,10 @@
        if (user.getStatus()!=1){
            return R.parse(CodeRes.USER_10002);
        }
        if (!user.getPassword().equals(password)){
        if (!user.getPassword().equals(param.get("password"))) {
            return R.parse(CodeRes.USER_10003);
        }
        String token = Cools.enToken(System.currentTimeMillis() + username, user.getPassword());
        String token = Cools.enToken(System.currentTimeMillis() + param.get("username"), user.getPassword());
        userLoginService.delete(new EntityWrapper<UserLogin>().eq("user_id", user.getId()));
        UserLogin userLogin = new UserLogin();
        userLogin.setUserId(user.getId());
src/main/resources/application.yml
@@ -43,7 +43,7 @@
  #  global-config:
  #    field-strategy: 0
  configuration:
    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
#    log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
    map-underscore-to-camel-case: true
    cache-enabled: true
    call-setters-on-nulls: true
src/main/webapp/static/js/common.js
@@ -103,7 +103,6 @@
// http请求
!function (n) {
    "use strict";
    var http = {
        toAjax: function (params) {
            $.ajax(params);
src/main/webapp/static/js/waitPakin/waitPakin.js
@@ -1,20 +1,29 @@
var pageCurr;
function getCol() {
    var cols = [ {type: 'checkbox'} ];
    cols.push.apply(cols, detlCols);
    cols.push({field: 'locNo', align: 'center',title: '库位号'}
        ,{field: 'status', align: 'center',title: '数据状态', templet:function(row){
        , {
            field: 'status', align: 'center', title: '数据状态', templet: function (row) {
                var html = "<input value='status' type='checkbox' lay-skin='switch' lay-text='正常|锁定'' lay-filter='tableCheckbox' disabled='disabled' table-index='"+row.LAY_TABLE_INDEX+"'";
                if(row.status === 'Y'){html += " checked ";}
                if (row.status === 'Y') {
                    html += " checked ";
                }
                html += ">";
                return html;
            }, hide: true}
        ,{field: 'ioStatus', align: 'center',title: '入出状态', templet:function(row){
            }, hide: true
        }
        , {
            field: 'ioStatus', align: 'center', title: '入出状态', templet: function (row) {
                var html = "<input value='ioStatus' type='checkbox' lay-skin='switch' lay-text='入库中|待入库' lay-filter='tableCheckbox' disabled='disabled' table-index='"+row.LAY_TABLE_INDEX+"'";
                if(row.ioStatus === 'Y'){html += " checked ";}
                if (row.ioStatus === 'Y') {
                    html += " checked ";
                }
                html += ">";
                return html;
            }}
            }
        }
        ,{field: 'modiUser$', align: 'center',title: '修改人员', hide:true}
        ,{field: 'modiTime$', align: 'center',title: '修改时间', hide:true})
    return cols;
@@ -139,7 +148,8 @@
                    success: function(layero, index){
                        layer.getChildFrame('#data-detail-submit-edit', index).hide();
                        clearFormVal(layer.getChildFrame('#detail', index));
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                        layer.iframeAuto(index);
                        layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"});
                    }
                });
                break;
@@ -227,7 +237,8 @@
                        setFormVal(layer.getChildFrame('#detail', index), data, true);
                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                        layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                        layer.iframeAuto(index);
                        layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"});
                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                    }
@@ -246,7 +257,8 @@
                        setFormVal(layer.getChildFrame('#detail', index), data, false);
                        top.convertDisabled(layer.getChildFrame('#data-detail :input', index), false);
                        top.convertDisabled(layer.getChildFrame('#id', index), true);
                        layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                        layer.iframeAuto(index);
                        layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"});
                        layero.find('iframe')[0].contentWindow.layui.form.render('select');
                        layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                    }
@@ -274,7 +286,8 @@
                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                        layer.iframeAuto(index);
                                        layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"});
                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                   } else if (res.code === 403){
@@ -310,7 +323,8 @@
                                       setFormVal(layer.getChildFrame('#detail', index), res.data, true);
                                       top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true);
                                       layer.getChildFrame('#data-detail-submit-save,#data-detail-submit-edit,#prompt', index).hide();
                                       layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
                                        layer.iframeAuto(index);
                                        layer.style(index, {top: (($(window).height() - layer.getChildFrame('#data-detail', index).height()) / 3) + "px"});
                                       layero.find('iframe')[0].contentWindow.layui.form.render('select');
                                       layero.find('iframe')[0].contentWindow.layui.form.render('checkbox');
                                   } else if (res.code === 403){
src/main/webapp/views/login.html
@@ -36,6 +36,7 @@
        width: 100%;
        height: 100%;
      }
      .login-box {
        position: absolute;
        top: 50%;
@@ -71,7 +72,8 @@
<!--          <span class="login100-form-title p-t-20 p-b-45">中扬立库</span>-->
<!--          <span class="login100-form-title p-t-20 p-b-45" style="margin: 15px 0;color: #868686;font-size: 24px">WMS</span>-->
          <div class="wrap-input100 validate-input m-b-10" data-validate="请输入用户名">
            <input id="username" class="input100" type="text" name="username" placeholder="username" autocomplete="off">
                <input id="username" class="input100" type="text" name="username" placeholder="username"
                       autocomplete="off">
            <span class="focus-input100"></span>
            <span class="symbol-input100">
              <i class="fa fa-user"></i>
@@ -115,7 +117,9 @@
        }
      })
      window.onload = function(){document.getElementById("username").focus();}
    window.onload = function () {
        document.getElementById("username").focus();
    }
      $(document).on('click','.login-btn', function () {
        let username = $("#username").val();
@@ -128,12 +132,11 @@
          layer.tips('请输入密码', '#password', {tips: [4, '#ff0000']});
          return;
        }
        let params = {username: username, password: hex_md5(password)}
        $.ajax({
          url: baseUrl+"/login.action",
          data: {
            username: username,
            password: hex_md5(password)
          },
            headers: {'Content-Type': 'application/json'},
            data: JSON.stringify(params),
          method: 'POST',
          success: function (res) {
            if (res.code === 200){