|
|
@ -22,8 +22,10 @@ import com.ccsens.mt.util.Constant; |
|
|
|
import com.ccsens.util.CodeEnum; |
|
|
|
import com.ccsens.util.PropUtil; |
|
|
|
import com.ccsens.util.UploadFileUtil_Servlet3; |
|
|
|
import com.ccsens.util.WebConstant; |
|
|
|
import com.ccsens.util.exception.BaseException; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.aspectj.apache.bcel.classfile.Code; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Propagation; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -238,21 +240,27 @@ public class ProvinceService implements IProvinceService { |
|
|
|
Long id = snowflake.nextId(); |
|
|
|
competeCompany.setId(id); |
|
|
|
competeCompany.setCoachNum(param.getCoachNum()); |
|
|
|
if (ObjectUtil.isNull(param.getCompanyName())){ |
|
|
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
|
|
|
} |
|
|
|
competeCompany.setName(param.getCompanyName()); |
|
|
|
if (ObjectUtil.isNull(param.getContactsName())){ |
|
|
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
|
|
|
} |
|
|
|
competeCompany.setContactsName(param.getContactsName()); |
|
|
|
if (ObjectUtil.isNull(param.getContactsPhone())){ |
|
|
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
|
|
|
} |
|
|
|
competeCompany.setContactsPhone(param.getContactsPhone()); |
|
|
|
competeCompany.setLeaderNum(param.getGuideNum()); |
|
|
|
competeCompany.setJoinNum(param.getPlayerNum()); |
|
|
|
competeCompany.setUserId(userId); |
|
|
|
competeCompany.setCompeteTimeId(param.getCompeteTimeId()); |
|
|
|
// if (ObjectUtil.isNull(authorization)){
|
|
|
|
// throw new BaseException(CodeEnum.PARAM_ERROR);
|
|
|
|
// }
|
|
|
|
competeCompany.setAuthorization(param.getAuthorization()); |
|
|
|
competeCompanyDao.insertSelective(competeCompany); |
|
|
|
// //
|
|
|
|
// competeCompany1.setCompanyId(competeCompany.getId());
|
|
|
|
// competeCompany1.setCoachNum(competeCompany.getCoachNum());
|
|
|
|
// competeCompany1.setContactsName(competeCompany.getContactsName());
|
|
|
|
// competeCompany1.setContactsPhone(competeCompany.getContactsPhone());
|
|
|
|
// competeCompany1.setGuideNum(competeCompany.getLeaderNum());
|
|
|
|
// competeCompany1.setPlayerNum(competeCompany.getJoinNum());
|
|
|
|
}else { |
|
|
|
//不为空,根据单位id查出来修改 判断传进来的参数是否为空 为空则跳过 不为空则修改
|
|
|
|
competeCompany = competeCompanyDao.selectByPrimaryKey(companyid); |
|
|
@ -291,6 +299,9 @@ public class ProvinceService implements IProvinceService { |
|
|
|
@Override |
|
|
|
public ProvinceCompeteVo.CompeteCompanyHeadList queryCoach(ProvinceCompeteDto.CompanyIdVo param) { |
|
|
|
Long company = param.getCompanyId(); |
|
|
|
if (ObjectUtil.isNull(company)){ |
|
|
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
|
|
|
} |
|
|
|
CompeteCoachExample competeCoachExample = new CompeteCoachExample(); |
|
|
|
competeCoachExample.createCriteria().andCompanyIdEqualTo(company); |
|
|
|
List<CompeteCoach> competeCoachList = competeCoachMapper.selectByExample(competeCoachExample); |
|
|
@ -415,11 +426,11 @@ public class ProvinceService implements IProvinceService { |
|
|
|
@Override |
|
|
|
public ProvinceCompeteVo.PlayerInfo getPlayerInfo(CompeteDto.DelPlayer param) { |
|
|
|
//
|
|
|
|
// Long playerId = param.getPlayerId();
|
|
|
|
// CompetePlayer competePlayer = competePlayerMapper.selectByPrimaryKey(playerId);
|
|
|
|
// if (ObjectUtil.isNull(competePlayer)){
|
|
|
|
// throw new BaseException(CodeEnum.PARAM_ERROR);
|
|
|
|
// }
|
|
|
|
Long playerId = param.getPlayerId(); |
|
|
|
CompetePlayer competePlayer = competePlayerMapper.selectByPrimaryKey(playerId); |
|
|
|
if (ObjectUtil.isNull(competePlayer)){ |
|
|
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
|
|
|
} |
|
|
|
// ProvinceCompeteVo.PlayerInfo playerInfo = new ProvinceCompeteVo.PlayerInfo();
|
|
|
|
// playerInfo.setPlayerId(competePlayer.getId());
|
|
|
|
// playerInfo.setCompeteId(competePlayer.getCompeteTimeId());
|
|
|
@ -434,7 +445,7 @@ public class ProvinceService implements IProvinceService { |
|
|
|
// playerInfo.setHealthRecord(competePlayer.getHealthRecordFile());
|
|
|
|
// playerInfo.setInsuranceRecord(competePlayer.getInsuranceRecordFile());
|
|
|
|
// return playerInfo;
|
|
|
|
return competePlayerDao.getPlayerByPlayerId(param.getPlayerId()); |
|
|
|
return competePlayerDao.getPlayerByPlayerId(playerId); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -449,6 +460,18 @@ public class ProvinceService implements IProvinceService { |
|
|
|
if (param.getIdentity() == 1 && count >=3){ |
|
|
|
throw new BaseException(CodeEnum.COACH_NUM_FULL); |
|
|
|
} |
|
|
|
//手机号不能为空,且正确
|
|
|
|
if(StrUtil.isEmpty(param.getPhone()) || !param.getPhone().matches(WebConstant.REGEX_PHONE)){ |
|
|
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
|
|
|
} |
|
|
|
//身份证不能为空,且正确
|
|
|
|
if(StrUtil.isEmpty(param.getIdCard()) || !IdcardUtil.isValidCard(param.getIdCard())){ |
|
|
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
|
|
|
} |
|
|
|
//证件照判断
|
|
|
|
if (ObjectUtil.isNull(param.getIdPhoto())){ |
|
|
|
throw new BaseException(CodeEnum.PARAM_ERROR); |
|
|
|
} |
|
|
|
CompeteCoach competeCoach1 = new CompeteCoach(); |
|
|
|
competeCoach1.setId(snowflake.nextId()); |
|
|
|
BeanUtil.copyProperties(param, competeCoach1); |
|
|
|