UserResource提交

赵嘉伟 4 years ago
parent 26af4cd000
commit 1443a18705

@ -880,7 +880,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl<AbnormalBillMapper, Abn
if(Constants.NEW.equals(abnormalBill.getStatus()) || Constants.CORRECTION_CONFIRM.equals(abnormalBill.getStatus())){
abnormalMessage.setUpUserGroup(abnormalMessage.getSendUserGroup()+"_UP");
//得到升级的时间和等级
UserGroup customFieldByGroup = userGroupMapper.getCustomFieldByGroup(site, abnormalMessage.getSendUserGroup());
if(customFieldByGroup != null && !StringUtil.isBlank(customFieldByGroup.getMessageNoticeTime())){
abnormalMessage.setUpDateTime(abnormalMessage.getResponseDateTime().plusMinutes(Integer.parseInt(customFieldByGroup.getMessageNoticeTime())));

@ -1,5 +1,7 @@
package com.foreverwin.mesnac.dispatch.controller;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.dispatch.dto.UserResourceDto;
@ -12,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Map;
/**
*
@ -137,8 +140,12 @@ public class UserResourceController {
}
@PostMapping("saveAll")
public R saveAll(@RequestBody List<UserResourceDto> userResourceList){
userResourceService.saveAll(userResourceList);
public R saveAll(@RequestBody Map<String,Object> param){
String resource = (String) param.get("resource");
String user = (String) param.get("user");
String str = JSONUtil.toJsonStr(param.get("userResourceList"));
List<UserResourceDto> userResourceList = JSONArray.parseArray(str, UserResourceDto.class);
userResourceService.saveAll(userResourceList,resource,user);
return R.ok();
}

@ -25,4 +25,6 @@ public interface UserResourceMapper extends BaseMapper<UserResource> {
List<UserResource> findEnableList(@Param("site") String site, @Param("resource") String resource, @Param("user") String user);
List<UserResourceDto> findAll(@Param("site") String site, @Param("resource") String resource, @Param("userId") String userId);
void deleteByUserAndResource(@Param("user")String user,@Param("resource")String resource);
}

@ -34,7 +34,7 @@ public interface UserResourceService extends IService<UserResource> {
List<UserResourceDto> findAll(UserResourceDto userResourceDto);
void saveAll(List<UserResourceDto> userResourceDtoList);
void saveAll(List<UserResourceDto> userResourceDtoList,String resource,String user);
}

@ -77,7 +77,7 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
}
@Override
public void saveAll(List<UserResourceDto> userResourceDtoList) {
public void saveAll(List<UserResourceDto> userResourceDtoList,String resource,String user) {
List<UserResource> userResourceList = new ArrayList<>();
String site = CommonMethods.getSite();
for (int i = 0; i < userResourceDtoList.size(); i++) {
@ -113,7 +113,7 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
userResourceList.add(userResource);
}
userResourceMapper.deleteByUserAndResource(user,resource);
this.saveOrUpdateBatch(userResourceList);
}

@ -485,6 +485,16 @@
OR ZUR.USER_DESCRIPTION LIKE '%${userId}%')
</if>
</select>
<select id="deleteByUserAndResource">
DELETE FROM Z_USER_RESOURCE
<where>
<if test="user != null and user != ''">
USER_ID = #{user}
</if>
<if test="resource != null and resource != ''">
AND RESRCE = #{resource}
</if>
</where>
</select>
</mapper>

Loading…
Cancel
Save