Merge remote-tracking branch 'origin/master'

zpl 4 years ago
commit 8d3b4e506e

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

@ -1,5 +1,7 @@
package com.foreverwin.mesnac.dispatch.controller; 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.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.foreverwin.mesnac.dispatch.dto.UserResourceDto; 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 org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* *
@ -137,8 +140,12 @@ public class UserResourceController {
} }
@PostMapping("saveAll") @PostMapping("saveAll")
public R saveAll(@RequestBody List<UserResourceDto> userResourceList){ public R saveAll(@RequestBody Map<String,Object> param){
userResourceService.saveAll(userResourceList); 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(); 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<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); 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); 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 @Override
public void saveAll(List<UserResourceDto> userResourceDtoList) { public void saveAll(List<UserResourceDto> userResourceDtoList,String resource,String user) {
List<UserResource> userResourceList = new ArrayList<>(); List<UserResource> userResourceList = new ArrayList<>();
String site = CommonMethods.getSite(); String site = CommonMethods.getSite();
for (int i = 0; i < userResourceDtoList.size(); i++) { for (int i = 0; i < userResourceDtoList.size(); i++) {
@ -113,7 +113,7 @@ public class UserResourceServiceImpl extends ServiceImpl<UserResourceMapper, Use
userResourceList.add(userResource); userResourceList.add(userResource);
} }
userResourceMapper.deleteByUserAndResource(user,resource);
this.saveOrUpdateBatch(userResourceList); this.saveOrUpdateBatch(userResourceList);
} }

@ -485,6 +485,16 @@
OR ZUR.USER_DESCRIPTION LIKE '%${userId}%') OR ZUR.USER_DESCRIPTION LIKE '%${userId}%')
</if> </if>
</select> </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> </mapper>

Loading…
Cancel
Save