소스 검색

林武泰/优化通知公告、设备信息接口功能

LinWuTai 1 년 전
부모
커밋
fe7f2a9b01

+ 3 - 8
lab-admin/src/main/java/com/ruoyi/asset/controller/TbAssetController.java

@@ -139,18 +139,13 @@ public class TbAssetController extends BaseController
     @ApiOperation("小程序:获取资产信息")
     @PreAuthorize("@ss.hasPermi('asset:asset:query')")
     @GetMapping(value = "/search")
-    public AjaxResult selectTbAssetByBarCode(
+    public TableDataInfo selectTbAssetByBarCode(
             @RequestParam(value = "barCode", required = false) String barCode,
             @RequestParam(value = "numberOrName", required = false) String numberOrName
     ) {
+        startPage();
         List<TbAssetDTO> tbAssetDTOS = tbAssetService.selectTbAsset(barCode, numberOrName);
-        if (barCode != null) {
-            if (tbAssetDTOS.isEmpty()) {
-                return AjaxResult.success("查询成功", new TbAsset());
-            }
-            return AjaxResult.success(tbAssetDTOS.get(0));
-        }
-        return AjaxResult.success(tbAssetDTOS);
+        return getDataTable(tbAssetDTOS);
     }
 
     /**

+ 7 - 4
lab-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java

@@ -213,13 +213,16 @@ public class SysUserController extends BaseController
     @PreAuthorize("@ss.hasPermi('system:user:resetPwd')")
     @ApiOperation("重置密码(工号)")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
-    @PutMapping("/resetPwd/{username}")
-    public AjaxResult resetPwd2(@PathVariable("username") String username)
+    @PutMapping("/resetPwd2")
+    public AjaxResult resetPwd2(@RequestBody SysUser user)
     {
-        SysUser user = userService.selectUserByUserName(username);
-        if (user == null) {
+        String username = user.getUserName();
+        SysUser sysUser = userService.selectUserByUserName(username);
+        if (sysUser == null) {
             throw new ServiceException("工号不存在");
         }
+        user.setUserId(sysUser.getUserId());
+
         userService.checkUserAllowed(user);
         userService.checkUserDataScope(user.getUserId());
         user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));

+ 3 - 0
lab-system/src/main/resources/mapper/system/SysNoticeMapper.xml

@@ -39,6 +39,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="createBy != null and createBy != ''">
 				AND create_by like concat('%', #{createBy}, '%')
 			</if>
+            <if test="status != null and status != ''">
+                AND status = #{status}
+            </if>
 		</where>
     </select>
     

+ 4 - 4
lab-ui/vue.config.js

@@ -35,7 +35,7 @@ module.exports = {
     proxy: {
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        target: `http://192.168.0.102:8080`,
+        target: `http://192.168.0.103:8080`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''
@@ -97,7 +97,7 @@ module.exports = {
             .plugin('ScriptExtHtmlWebpackPlugin')
             .after('html')
             .use('script-ext-html-webpack-plugin', [{
-            // `runtime` must same as runtimeChunk name. default is `runtime`
+              // `runtime` must same as runtimeChunk name. default is `runtime`
               inline: /runtime\..*\.js$/
             }])
             .end()
@@ -127,8 +127,8 @@ module.exports = {
             })
           config.optimization.runtimeChunk('single'),
           {
-             from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
-             to: './' //到根目录下
+            from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
+            to: './' //到根目录下
           }
         }
       )