|
|
|
@ -69,13 +69,13 @@ public class BaseTeamTServiceImpl implements IBaseTeamTService {
|
|
|
|
|
public int insertBaseTeamT(BaseTeamT baseTeamT) {
|
|
|
|
|
baseTeamT.setCreateDate(DateUtils.getNowDate());
|
|
|
|
|
baseTeamT.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
//删掉当前关联重新建
|
|
|
|
|
baseTeamUserMapper.deleteBaseTeamUserByTeamId(baseTeamT.getTeamId());
|
|
|
|
|
baseTeamTMapper.insertBaseTeamT(baseTeamT);
|
|
|
|
|
String teamId = baseTeamTMapper.getBaseTeamTByCode(baseTeamT);
|
|
|
|
|
for(int i = 0;i<baseTeamT.getRightData().size();i++){
|
|
|
|
|
BaseTeamUser baseTeamUser = new BaseTeamUser();
|
|
|
|
|
baseTeamUser.setCreateBy(SecurityUtils.getUsername());
|
|
|
|
|
baseTeamUser.setCreateTime(DateUtils.getNowDate());
|
|
|
|
|
baseTeamUser.setTeamId(baseTeamT.getTeamId());
|
|
|
|
|
baseTeamUser.setTeamId(teamId);
|
|
|
|
|
baseTeamUser.setTeamCode(baseTeamT.getTeamCode());
|
|
|
|
|
baseTeamUser.setId(IdUtils.fastSimpleUUID());
|
|
|
|
|
List<String> list = new ArrayList<>();
|
|
|
|
@ -86,17 +86,8 @@ public class BaseTeamTServiceImpl implements IBaseTeamTService {
|
|
|
|
|
//判断班组人员有没有变动 挨个遍历
|
|
|
|
|
baseTeamUser.setUserName(userName);
|
|
|
|
|
baseTeamUserMapper.insertBaseTeamUser(baseTeamUser);
|
|
|
|
|
// BaseTeamUser baseTeamUser1 = new BaseTeamUser();
|
|
|
|
|
// List<String> members = baseTeamUserMapper.selectTeamMembersIds(baseTeamUser1);
|
|
|
|
|
// boolean bool = members.contains(userId);
|
|
|
|
|
//倒查id
|
|
|
|
|
// String id = baseTeamUserMapper.selectId(baseTeamUser);
|
|
|
|
|
// baseTeamUser.setUpdateTime(DateUtils.getNowDate());
|
|
|
|
|
// baseTeamUser.setUpdateBy(SecurityUtils.getUsername());
|
|
|
|
|
// baseTeamUserMapper.updateBaseTeamUser(baseTeamUser);
|
|
|
|
|
//如果过来的班组成员ID不存在于表中,直接新增
|
|
|
|
|
}
|
|
|
|
|
return baseTeamTMapper.insertBaseTeamT(baseTeamT);
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -149,6 +140,7 @@ public class BaseTeamTServiceImpl implements IBaseTeamTService {
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public int deleteBaseTeamTByTeamIds(String[] teamIds) {
|
|
|
|
|
baseTeamUserMapper.deleteBaseTeamUserByTeamIds(teamIds);
|
|
|
|
|
return baseTeamTMapper.deleteBaseTeamTByTeamIds(teamIds);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -161,6 +153,39 @@ public class BaseTeamTServiceImpl implements IBaseTeamTService {
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public int deleteBaseTeamTByTeamId(String teamId) {
|
|
|
|
|
baseTeamUserMapper.deleteBaseTeamUserByTeamId(teamId);
|
|
|
|
|
return baseTeamTMapper.deleteBaseTeamTByTeamId(teamId);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 判断仓库信息
|
|
|
|
|
*
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public boolean checkTeamCodeUnique(BaseTeamT baseTeamT) {
|
|
|
|
|
String code = baseTeamTMapper.checkTeamCodeUnique(baseTeamT);
|
|
|
|
|
if(code == null){
|
|
|
|
|
return false;
|
|
|
|
|
}else{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 判断仓库信息
|
|
|
|
|
*
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@DS("#header.poolName")
|
|
|
|
|
public boolean checkTeamDescUnique(BaseTeamT baseTeamT) {
|
|
|
|
|
String name = baseTeamTMapper.checkTeamDescUnique(baseTeamT);
|
|
|
|
|
if(name == null){
|
|
|
|
|
return false;
|
|
|
|
|
}else{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|