| | |
| | | import com.zy.asrs.entity.LocMast; |
| | | import com.zy.asrs.entity.param.LocMastInitParam; |
| | | import com.zy.asrs.service.LocMastService; |
| | | import com.zy.common.entity.Parameter; |
| | | import com.zy.common.model.Shelves; |
| | | import com.zy.common.web.BaseController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private LocMastService locMastService; |
| | | |
| | | @RequestMapping(value = "/locMast/init/pwd") |
| | | public R locMastInitPwd(@RequestParam(required = false) String pwd) { |
| | | if (Cools.isEmpty(pwd)) { |
| | | return R.error("请输入口令"); |
| | | } |
| | | return R.ok().add(Parameter.get().getLocMastInitPwd().equals(pwd)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/locMast/{id}/auth") |
| | | @ManagerAuth |
| | | public R get(@PathVariable("id") String id) { |
| | |
| | | public void setCodeSwitch(String codeSwitch) { |
| | | this.codeSwitch = codeSwitch; |
| | | } |
| | | |
| | | // 库位初始化口令 |
| | | private String locMastInitPwd; |
| | | |
| | | public String getLocMastInitPwd() { |
| | | return locMastInitPwd; |
| | | } |
| | | |
| | | public void setLocMastInitPwd(String locMastInitPwd) { |
| | | this.locMastInitPwd = locMastInitPwd; |
| | | } |
| | | } |
| | |
| | | url: url, |
| | | data: data, |
| | | dataType: 'json', |
| | | header: {'Content-Type': 'application/json'}, |
| | | header: {'token': localStorage.getItem('token')}, |
| | | timeout: 10000, |
| | | cache: false, |
| | | success: function (result) { |
| | | callback(result); |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | callback(res); |
| | | } else if (res.code === 403){ |
| | | top.location.href = baseUrl+"/"; |
| | | } else { |
| | | layer.msg(res.msg); |
| | | } |
| | | }, |
| | | error: function (res, type) { |
| | | |
| | |
| | | break; |
| | | case "init": |
| | | layer.prompt({title: '请输入口令,并重置库位', formType: 1, shadeClose: true}, function(pass, idx){ |
| | | if (pass === "123456") { |
| | | layer.open({ |
| | | type: 1, |
| | | title: '初始化库位', |
| | | area: ["400px"], |
| | | maxmin: true, |
| | | shadeClose: true, |
| | | content: $("#resetLocDiv"), |
| | | success: function (layero, index) { |
| | | http.get(baseUrl+"/locMast/init/pwd", {pwd: pass}, function (res) { |
| | | if (res.data) { |
| | | layer.open({ |
| | | type: 1, |
| | | title: '初始化库位', |
| | | area: ["400px"], |
| | | maxmin: true, |
| | | shadeClose: true, |
| | | content: $("#resetLocDiv"), |
| | | success: function (layero, index) { |
| | | |
| | | } |
| | | }) |
| | | } else { |
| | | layer.msg("口令错误"); |
| | | } |
| | | layer.close(idx); |
| | | } |
| | | }) |
| | | } else { |
| | | layer.msg("口令错误"); |
| | | } |
| | | layer.close(idx); |
| | | }) |
| | | |
| | | }); |
| | | break; |
| | | } |
| | |
| | | if (res.code === 200){ |
| | | layer.msg(res.msg); |
| | | layer.closeAll(); |
| | | tableReload(false); |
| | | } else if (res.code === 403){ |
| | | parent.location.href = "/"; |
| | | }else { |