diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java index 12cc3da..741604e 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/controller/AssetCurrentController.java @@ -19,13 +19,10 @@ import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import javax.validation.Valid; import java.io.Serializable; -import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import java.util.stream.Collectors; /** * 现有资产表(AssetCurrent)表控制层 @@ -83,8 +80,14 @@ public class AssetCurrentController extends BaseController { * @return 所有数据 */ @ApiOperation(value = "查询所有数据(带子表)", response = AssetCurrent.class) - @GetMapping("/selectAllAsset") - public AjaxResult selectAllAsset(AssetCurrentPageRequest as) { + @PostMapping("/selectAllAsset") + public AjaxResult selectAllAsset(@RequestBody AssetCurrentPageRequest as, HttpServletRequest request) { + if (!"U2FsdGVkX199X+bZRylJnFMCCCrHgQw7OJ0DIV7jDQHnrX//trM2UNQx00jKvg4Oi16bAi2VWcg=".equals(request.getHeader("token"))) { + throw new ServiceException("token验证失败"); + } + if (!"OB4J7ZcpC8aLDuH0InPRhYjxNx0TGaRK".equals(request.getHeader("signature"))) { + throw new ServiceException("签名验证失败"); + } return success(assetCurrentService.selectAllAsset(as)); } @@ -113,16 +116,16 @@ public class AssetCurrentController extends BaseController { @Transactional(rollbackFor = Exception.class) public AjaxResult insert(@RequestBody AssetCurrent assetCurrent) { StringBuilder a = new StringBuilder(); - if(!assetCurrent.getGlymList().isEmpty()){ - assetCurrent.getGlymList().forEach(x->{ + if (!assetCurrent.getGlymList().isEmpty()) { + assetCurrent.getGlymList().forEach(x -> { a.append(x.getKey()); a.append(","); }); } assetCurrent.setGlym(a.toString()); StringBuilder b = new StringBuilder(); - if(!assetCurrent.getGlIpList().isEmpty()){ - assetCurrent.getGlymList().forEach(x->{ + if (!assetCurrent.getGlIpList().isEmpty()) { + assetCurrent.getGlymList().forEach(x -> { b.append(x.getKey()); b.append(","); }); @@ -167,18 +170,18 @@ public class AssetCurrentController extends BaseController { @ApiOperation(value = "修改数据") @PreAuthorize("@ss.hasAnyRoles('admin,common')") @PutMapping - public AjaxResult update(@RequestBody AssetCurrent assetCurrent) { + public AjaxResult update(@RequestBody AssetCurrent assetCurrent) { StringBuilder a = new StringBuilder(); - if(!assetCurrent.getGlymList().isEmpty()){ - assetCurrent.getGlymList().forEach(x->{ + if (!assetCurrent.getGlymList().isEmpty()) { + assetCurrent.getGlymList().forEach(x -> { a.append(x.getKey()); a.append(","); }); } assetCurrent.setGlym(a.toString()); StringBuilder b = new StringBuilder(); - if(!assetCurrent.getGlIpList().isEmpty()){ - assetCurrent.getGlymList().forEach(x->{ + if (!assetCurrent.getGlIpList().isEmpty()) { + assetCurrent.getGlymList().forEach(x -> { b.append(x.getKey()); b.append(","); }); diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/AssetCurrentPageRequest.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/AssetCurrentPageRequest.java index ecfc792..962c1b4 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/AssetCurrentPageRequest.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/entity/request/AssetCurrentPageRequest.java @@ -15,7 +15,6 @@ import java.util.Date; @Data public class AssetCurrentPageRequest { - /** * 系统名称 */ diff --git a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentMapper.java b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentMapper.java index 7bbfcd3..6e57afd 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentMapper.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/tc/mapper/AssetCurrentMapper.java @@ -45,6 +45,6 @@ public interface AssetCurrentMapper extends BaseMapper { /** * 查询所有数据(带子表) */ - List selectAllAsset(AssetCurrentPageRequest as); + List selectAllAsset(@Param("req") AssetCurrentPageRequest as); } diff --git a/ruoyi-admin/src/main/resources/application-test.yml b/ruoyi-admin/src/main/resources/application-test.yml index c8ffe3a..74e373a 100644 --- a/ruoyi-admin/src/main/resources/application-test.yml +++ b/ruoyi-admin/src/main/resources/application-test.yml @@ -61,6 +61,6 @@ spring: multi-statement-allow: true # Swagger配置 -knife4j: - production: true - enable: false \ No newline at end of file +#knife4j: +# production: true +# enable: false \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/mapper/AssetCurrentMapper.xml b/ruoyi-admin/src/main/resources/mapper/AssetCurrentMapper.xml index f2b28e8..be0bb1c 100644 --- a/ruoyi-admin/src/main/resources/mapper/AssetCurrentMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/AssetCurrentMapper.xml @@ -48,7 +48,8 @@ l.* FROM asset_current a - LEFT JOIN ( SELECT asset_id, NAME, tyshxydm, lxr, lxdh, gyszcdz, sfwtc FROM asset_supply_chain WHERE type = 5 GROUP BY asset_id,NAME, tyshxydm, lxr, lxdh, gyszcdz, sfwtc ) b ON a.id = b.asset_id + LEFT JOIN ( SELECT asset_id, NAME, tyshxydm, lxr, lxdh, gyszcdz, sfwtc FROM asset_supply_chain WHERE type = 5 + GROUP BY asset_id,NAME, tyshxydm, lxr, lxdh, gyszcdz, sfwtc ) b ON a.id = b.asset_id LEFT JOIN ( SELECT asset_id, @@ -116,8 +117,8 @@ pp,sb_ip,yjxh,yjxlh,yjbbxx,yjyt,yjbsxx ) e ON a.id = e.asset_id LEFT JOIN ( SELECT - asset_id, sblx AS aqwlsblx, pp AS aqwlpp, sb_ip AS aqwlsbIp - FROM asset_basic_network WHERE type = 3 GROUP BY asset_id,sblx,pp,sb_ip ) l ON a.id = l.asset_id + asset_id, sblx AS aqwlsblx, pp AS aqwlpp, sb_ip AS aqwlsbIp + FROM asset_basic_network WHERE type = 3 GROUP BY asset_id,sblx,pp,sb_ip ) l ON a.id = l.asset_id a.del_flag = '0' and a.isbf = '0' @@ -146,7 +147,315 @@ set del_flag = '2' where id = #{id} - + select a.*,b.*,c.*,d.*,e.* from asset_current as a + left join asset_business_form b on a.id = b.asset_id + left join asset_basic_network c on a.id = c.asset_id + left join asset_supply_chain d on a.id = d.asset_id + left join unit_other_contact e on a.id = e.asset_id + + a.del_flag = '0' + + and a.xtmc like concat('%',#{req.xtmc},'%') + + + and a.dwmc like concat('%',#{req.dwmc},'%') + + + and a.xtlx = #{req.xtlx} + + + and a.xtzt = #{req.xtzt} + + + and a.create_time >= #{req.startTime} + + + and a.create_time <= #{req.endTime} + + + order by a.create_time desc \ No newline at end of file diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java index 34a0d7e..04f15aa 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java @@ -117,7 +117,8 @@ public class SecurityConfig .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() // .antMatchers("/unit/assetTask/**","/tc/**","/unit/assetLc/**","/tc/unit/**").permitAll() // 除上面外的所有请求全部需要鉴权认证 - .anyRequest().authenticated(); + .antMatchers("/tc/assetCurrent/selectAllAsset").permitAll() + .anyRequest().authenticated(); }) // 添加Logout filter .logout(logout -> logout.logoutUrl("/logout").logoutSuccessHandler(logoutSuccessHandler))