| | |
| | | <relativePath/> |
| | | </parent> |
| | | <groupId>com.zy</groupId> |
| | | <artifactId>asrs</artifactId> |
| | | <artifactId>asrs</artifactId>t |
| | | <version>1.1.1</version> |
| | | <packaging>war</packaging> |
| | | |
| | |
| | | } |
| | | |
| | | @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); |
| | |
| | | |
| | | // 添加明细 |
| | | 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()); |
| | |
| | | response, |
| | | success |
| | | ); |
| | | } catch (Exception e) { log.error("", e); } |
| | | } catch (Exception e) { |
| | | log.error("", e); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | 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()); |
| | |
| | | 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 |
| | |
| | | ; |
| | | } |
| | | |
| | | @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; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | 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"; |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |
| | |
| | | @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); |
| | |
| | | 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()); |
| | |
| | | # 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 |
| | |
| | | // http请求 |
| | | !function (n) { |
| | | "use strict"; |
| | | |
| | | var http = { |
| | | toAjax: function (params) { |
| | | $.ajax(params); |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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'); |
| | | } |
| | |
| | | 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'); |
| | | } |
| | |
| | | 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){ |
| | |
| | | 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){ |
| | |
| | | width: 100%; |
| | | height: 100%; |
| | | } |
| | | |
| | | .login-box { |
| | | position: absolute; |
| | | top: 50%; |
| | |
| | | <!-- <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> |
| | |
| | | } |
| | | }) |
| | | |
| | | window.onload = function(){document.getElementById("username").focus();} |
| | | window.onload = function () { |
| | | document.getElementById("username").focus(); |
| | | } |
| | | |
| | | $(document).on('click','.login-btn', function () { |
| | | let username = $("#username").val(); |
| | |
| | | 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){ |