feat: 111
This commit is contained in:
+1
-1
@@ -17,7 +17,7 @@ import com.adc.da.base.web.BaseController;
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|SarStandAttrInfo|")
|
||||
@RequestMapping("/SarStandAttrInfo/sar-stand-attr-info")
|
||||
@RequestMapping("/${restPath}/SarStandAttrInfo/sar-stand-attr-info")
|
||||
public class SarStandAttrInfoController extends BaseController<SarStandAttrInfo> {
|
||||
|
||||
}
|
||||
|
||||
+58
-1
@@ -1,12 +1,25 @@
|
||||
package com.adc.da.slrs.sarStandMenu.controller;
|
||||
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarMenu.entity.SarMenu;
|
||||
import com.adc.da.slrs.sarMenu.service.ISarMenuService;
|
||||
import com.adc.da.slrs.sarStandMenu.service.ISarStandMenuService;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import com.adc.da.slrs.sarStandMenu.entity.SarStandMenu;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
@@ -17,7 +30,51 @@ import com.adc.da.base.web.BaseController;
|
||||
*/
|
||||
@RestController
|
||||
@Api(description = "|SarStandMenu|")
|
||||
@RequestMapping("/SarStandMenu/sar-stand-menu")
|
||||
@RequestMapping("/${restPath}/lawss/sarStandMenu")
|
||||
public class SarStandMenuController extends BaseController<SarStandMenu> {
|
||||
|
||||
@Autowired
|
||||
private ISarStandMenuService sarStandMenuEOService;
|
||||
|
||||
@Autowired
|
||||
private ISarMenuService sarMenuEOService;
|
||||
|
||||
@ApiOperation(value = "|SarStandMenuEO|修改")
|
||||
@PutMapping("/removeStandInfo")
|
||||
// @RequiresPermissions("lawss:sarStandMenu:update")
|
||||
public ResponseMessage update(@RequestBody SarStandMenu standardsInfoEO) throws Exception {
|
||||
String[] idList = standardsInfoEO.getIdlist();
|
||||
int count = 0;
|
||||
if(idList != null){
|
||||
for(String id : idList){
|
||||
SarStandMenu menuEO = new SarStandMenu();
|
||||
menuEO.setStandId(id);
|
||||
menuEO.setMenuId(standardsInfoEO.getMenuId());
|
||||
//删除所选目录下关联
|
||||
String oldMenuId = standardsInfoEO.getOldMenuId();
|
||||
if (StringUtils.isEmpty(oldMenuId)) {
|
||||
oldMenuId = standardsInfoEO.getMenuId();
|
||||
}
|
||||
menuEO.setOldMenuId(oldMenuId);
|
||||
count += sarStandMenuEOService.deleteByMenuId(menuEO);
|
||||
//查询是否还有与其他节点的关联,若没有则增加与根节点的关联
|
||||
List<SarStandMenu> getList = sarStandMenuEOService.selectAllMenuByStandId(menuEO);
|
||||
if (getList == null || getList.isEmpty()) {
|
||||
// 查询根节点
|
||||
SarMenu sarMenuEO = new SarMenu();
|
||||
sarMenuEO.setSorDivide(standardsInfoEO.getStandType() + "_STAND");
|
||||
List<SarMenu> getRootMenu = sarMenuEOService.queryMenuByDis(sarMenuEO);
|
||||
menuEO.setMenuId(getRootMenu.get(0).getId());
|
||||
menuEO.setId(UUIDUtils.randomUUID20());
|
||||
menuEO.setValidFlag(0);
|
||||
sarStandMenuEOService.saveOrUpdate(menuEO);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(count>0){
|
||||
return Result.success("0","移除成功!",true);
|
||||
} else {
|
||||
return Result.error("移除失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,4 +24,9 @@ public interface SarStandMenuDao extends BaseMapper<SarStandMenu> {
|
||||
int updateByStandIdAndMenuId(SarStandMenu sarStandMenuEO);
|
||||
|
||||
int deleteByStandIdAndMenuId(SarStandMenu sarStandMenuEO);
|
||||
|
||||
int deleteByMenuId (SarStandMenu sarStandMenuEO);
|
||||
|
||||
List<SarStandMenu> selectAllMenuByStandId(SarStandMenu sarStandMenuEO);
|
||||
|
||||
}
|
||||
|
||||
+6
@@ -3,6 +3,8 @@ package com.adc.da.slrs.sarStandMenu.service;
|
||||
import com.adc.da.slrs.sarStandMenu.entity.SarStandMenu;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
@@ -13,4 +15,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface ISarStandMenuService extends IService<SarStandMenu> {
|
||||
|
||||
int deleteByMenuId (SarStandMenu sarStandMenuEO);
|
||||
|
||||
List<SarStandMenu> selectAllMenuByStandId(SarStandMenu sarStandMenuEO);
|
||||
|
||||
}
|
||||
|
||||
+22
@@ -1,11 +1,15 @@
|
||||
package com.adc.da.slrs.sarStandMenu.service.impl;
|
||||
|
||||
import com.adc.da.slrs.sarMenu.service.ISarMenuService;
|
||||
import com.adc.da.slrs.sarStandMenu.entity.SarStandMenu;
|
||||
import com.adc.da.slrs.sarStandMenu.dao.SarStandMenuDao;
|
||||
import com.adc.da.slrs.sarStandMenu.service.ISarStandMenuService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
@@ -17,4 +21,22 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class SarStandMenuServiceImpl extends ServiceImpl<SarStandMenuDao, SarStandMenu> implements ISarStandMenuService {
|
||||
|
||||
@Autowired
|
||||
private SarStandMenuDao dao;
|
||||
|
||||
@Autowired
|
||||
private ISarMenuService sarMenuEOService;
|
||||
|
||||
@Override
|
||||
public int deleteByMenuId (SarStandMenu sarStandMenuEO){
|
||||
List<String> menuIds = sarMenuEOService.getChildMenuList(sarStandMenuEO.getOldMenuId());
|
||||
sarStandMenuEO.setMenuIds(menuIds);
|
||||
return dao.deleteByMenuId(sarStandMenuEO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SarStandMenu> selectAllMenuByStandId(SarStandMenu sarStandMenuEO){
|
||||
return dao.selectAllMenuByStandId(sarStandMenuEO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -68,4 +68,19 @@
|
||||
where stand_id = #{standId, jdbcType=VARCHAR} and MENU_ID = #{menuId, jdbcType=VARCHAR}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByMenuId" parameterType="com.adc.da.slrs.sarStandMenu.entity.SarStandMenu">
|
||||
delete from SAR_STAND_MENU
|
||||
where stand_id = #{standId}
|
||||
and MENU_ID in
|
||||
<foreach collection="menuIds" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectAllMenuByStandId" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.sarStandMenu.entity.SarStandMenu">
|
||||
select <include refid="Base_Column_List" />
|
||||
from SAR_STAND_MENU
|
||||
where stand_id = #{standId} and valid_flag=0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user