From 415c752af6d792e78a95a535bf079edbbeb6561c Mon Sep 17 00:00:00 2001 From: zjj <3272660260@qq.com> Date: 星期五, 14 六月 2024 15:48:27 +0800 Subject: [PATCH] # --- src/main/java/com/zy/asrs/controller/BasDevpController.java | 51 +++++++++++++++++-------- src/main/java/com/zy/system/entity/license/CustomLicenseManager.java | 36 +++++++++--------- src/main/webapp/views/user/user.html | 4 +- src/main/webapp/static/js/user/user.js | 4 +- src/main/resources/application.yml | 4 +- 5 files changed, 59 insertions(+), 40 deletions(-) diff --git a/src/main/java/com/zy/asrs/controller/BasDevpController.java b/src/main/java/com/zy/asrs/controller/BasDevpController.java index 5182bc4..d69797b 100644 --- a/src/main/java/com/zy/asrs/controller/BasDevpController.java +++ b/src/main/java/com/zy/asrs/controller/BasDevpController.java @@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.plugins.Page; +import com.core.exception.CoolException; import com.zy.asrs.entity.BasDevp; import com.zy.asrs.entity.param.BasDevpInitParam; +import com.zy.asrs.mapper.BasDevpMapper; import com.zy.asrs.service.BasDevpService; import com.zy.common.web.BaseController; import com.core.annotations.ManagerAuth; @@ -14,6 +16,9 @@ import com.core.common.Cools; import com.core.common.DateUtils; import com.core.common.R; +import org.apache.ibatis.session.ExecutorType; +import org.apache.ibatis.session.SqlSession; +import org.apache.ibatis.session.SqlSessionFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -24,29 +29,43 @@ @Autowired private BasDevpService basDevpService; + @Autowired + private SqlSessionFactory sqlSessionFactory; @RequestMapping(value = "/basDevp/init/auth") @ManagerAuth(memo = "鍒濆鍖栫珯鐐�") public R init(BasDevpInitParam param) { List<BasDevp> list = new ArrayList<>(); - for (int devNo = param.getStartDev() ; devNo<=param.getEndDev() ; devNo++){ - BasDevp basDevp = basDevpService.selectById(devNo); - if (Cools.isEmpty(basDevp)){ - BasDevp basDevp1 = new BasDevp(); - basDevp1.setDevNo(devNo); - basDevp1.setInEnable("Y"); - basDevp1.setOutEnable("Y"); - basDevp1.setAutoing("Y"); - basDevp1.setLoading("Y"); - basDevp1.setCanining("Y"); - basDevp1.setCanouting("Y"); - basDevp1.setModiUser(getUserId()); - basDevp1.setModiTime(new Date()); - list.add(basDevp1); + SqlSession sqlSession = null; + try { + sqlSession = sqlSessionFactory.openSession(ExecutorType.SIMPLE,false); + BasDevpMapper sessionMapper = sqlSession.getMapper(BasDevpMapper.class); + for (int devNo = param.getStartDev() ; devNo<=param.getEndDev() ; devNo++){ + BasDevp basDevp = basDevpService.selectById(devNo); + if (Cools.isEmpty(basDevp)){ + BasDevp basDevp1 = new BasDevp(); + basDevp1.setDevNo(devNo); + basDevp1.setInEnable("Y"); + basDevp1.setOutEnable("Y"); + basDevp1.setAutoing("Y"); + basDevp1.setLoading("Y"); + basDevp1.setCanining("Y"); + basDevp1.setCanouting("Y"); + basDevp1.setModiUser(getUserId()); + basDevp1.setModiTime(new Date()); + sessionMapper.insert(basDevp1); +// list.add(basDevp1); + } } + sqlSession.flushStatements(); + sqlSession.clearCache(); + }catch (Exception e) { + throw new CoolException(e.getMessage()); + }finally { + sqlSession.close(); + return R.ok("鍒濆鍖栨垚鍔�"); } - basDevpService.insertBatch(list); - return R.ok("鍒濆鍖栨垚鍔�"); + } @RequestMapping(value = "/basDevp/{id}/auth") diff --git a/src/main/java/com/zy/system/entity/license/CustomLicenseManager.java b/src/main/java/com/zy/system/entity/license/CustomLicenseManager.java index 1ad2cc1..27d83af 100644 --- a/src/main/java/com/zy/system/entity/license/CustomLicenseManager.java +++ b/src/main/java/com/zy/system/entity/license/CustomLicenseManager.java @@ -128,24 +128,24 @@ if(expectedCheckModel != null && serverCheckModel != null){ //鏍¢獙IP鍦板潃 - if(!checkIpAddress(expectedCheckModel.getIpAddress(),serverCheckModel.getIpAddress())){ - throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑IP娌″湪鎺堟潈鑼冨洿鍐�"); - } - - //鏍¢獙Mac鍦板潃 - if(!checkIpAddress(expectedCheckModel.getMacAddress(),serverCheckModel.getMacAddress())){ - throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑Mac鍦板潃娌″湪鎺堟潈鑼冨洿鍐�"); - } - - //鏍¢獙涓绘澘搴忓垪鍙� - if(!checkSerial(expectedCheckModel.getMainBoardSerial(),serverCheckModel.getMainBoardSerial())){ - throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑涓绘澘搴忓垪鍙锋病鍦ㄦ巿鏉冭寖鍥村唴"); - } - - //鏍¢獙CPU搴忓垪鍙� - if(!checkSerial(expectedCheckModel.getCpuSerial(),serverCheckModel.getCpuSerial())){ - throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑CPU搴忓垪鍙锋病鍦ㄦ巿鏉冭寖鍥村唴"); - } +// if(!checkIpAddress(expectedCheckModel.getIpAddress(),serverCheckModel.getIpAddress())){ +// throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑IP娌″湪鎺堟潈鑼冨洿鍐�"); +// } +// +// //鏍¢獙Mac鍦板潃 +// if(!checkIpAddress(expectedCheckModel.getMacAddress(),serverCheckModel.getMacAddress())){ +// throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑Mac鍦板潃娌″湪鎺堟潈鑼冨洿鍐�"); +// } +// +// //鏍¢獙涓绘澘搴忓垪鍙� +// if(!checkSerial(expectedCheckModel.getMainBoardSerial(),serverCheckModel.getMainBoardSerial())){ +// throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑涓绘澘搴忓垪鍙锋病鍦ㄦ巿鏉冭寖鍥村唴"); +// } +// +// //鏍¢獙CPU搴忓垪鍙� +// if(!checkSerial(expectedCheckModel.getCpuSerial(),serverCheckModel.getCpuSerial())){ +// throw new LicenseContentException("褰撳墠鏈嶅姟鍣ㄧ殑CPU搴忓垪鍙锋病鍦ㄦ巿鏉冭寖鍥村唴"); +// } }else{ throw new LicenseContentException("涓嶈兘鑾峰彇鏈嶅姟鍣ㄧ‖浠朵俊鎭�"); } diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index b41e798..4ff9260 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -10,7 +10,7 @@ enabled: false datasource: driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver - url: jdbc:sqlserver://192.168.4.15:1433;databasename=source + url: jdbc:sqlserver://127.0.0.1:1433;databasename=dlzasrs username: sa password: sa@123 mvc: @@ -32,7 +32,7 @@ path: /stock/out/@pom.build.finalName@/logs super: - pwd: asrs2023 + pwd: xltys1995 swagger: enable: false diff --git a/src/main/webapp/static/js/user/user.js b/src/main/webapp/static/js/user/user.js index 0e06c7e..c9234f5 100644 --- a/src/main/webapp/static/js/user/user.js +++ b/src/main/webapp/static/js/user/user.js @@ -25,8 +25,8 @@ {type: 'checkbox'} // ,{field: 'hostName', align: 'center',title: '鎺堟潈鍟嗘埛', templet: '#hostTpl', width: 140} // ,{field: 'nickname', align: 'center',title: '鐢ㄦ埛鍚�'} - ,{field: 'username', align: 'center',title: '鐧诲綍璐︽埛'} - ,{field: 'mobile', align: 'center',title: '鎵嬫満鍙�'} + ,{field: 'username', align: 'center',title: '鐢ㄦ埛鍚�'} + ,{field: 'mobile', align: 'center',title: '璐﹀彿'} // ,{field: 'deptName', align: 'center',title: '鎵�灞為儴闂�'} ,{field: 'roleName', align: 'center',title: '瑙掕壊'} ,{field: 'email', align: 'center',title: '閭'} diff --git a/src/main/webapp/views/user/user.html b/src/main/webapp/views/user/user.html index d2611c8..51c1dbd 100644 --- a/src/main/webapp/views/user/user.html +++ b/src/main/webapp/views/user/user.html @@ -103,7 +103,7 @@ <div class="layui-col-md6"> <div class="layui-form-item"> - <label class="layui-form-label layui-form-required">鐧诲綍璐︽埛</label> + <label class="layui-form-label layui-form-required">鐢ㄦ埛鍚�</label> <div class="layui-input-block"> <input name="username" placeholder="璇疯緭鍏ョ櫥褰曡处鎴�" class="layui-input" lay-vertype="tips" lay-verify="required" required=""> </div> @@ -125,7 +125,7 @@ <div class="layui-col-md6"> <div class="layui-form-item"> - <label class="layui-form-label layui-form-required">鎵嬫満鍙�</label> + <label class="layui-form-label layui-form-required">璐﹀彿</label> <div class="layui-input-block"> <input name="mobile" placeholder="璇疯緭鍏ユ墜鏈哄彿" class="layui-input" lay-vertype="tips" lay-verify="required" required=""> </div> -- Gitblit v1.9.1