|
|
@ -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; |
|
|
@ -247,21 +249,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); |
|
|
@ -300,6 +308,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); |
|
|
@ -419,7 +430,31 @@ public class ProvinceService implements IProvinceService { |
|
|
|
|
|
|
|
@Override |
|
|
|
public ProvinceCompeteVo.PlayerInfo getPlayerInfo(CompeteDto.DelPlayer param) { |
|
|
|
//<<<<<<< HEAD
|
|
|
|
return competePlayerDao.getPlayerByPlayerId(param.getPlayerId()); |
|
|
|
//=======
|
|
|
|
////
|
|
|
|
// 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());
|
|
|
|
//// playerInfo.setGroupId(competePlayer.getCompeteGroupId());
|
|
|
|
//// playerInfo.setPlayerName(competePlayer.getName());
|
|
|
|
//// playerInfo.setGender(competePlayer.getGender());
|
|
|
|
//// playerInfo.setIdCard(competePlayer.getIdCard());
|
|
|
|
//// playerInfo.setIdCardFront(competePlayer.getIdCardFront());
|
|
|
|
//// playerInfo.setIdCardBack(competePlayer.getIdCardBack());
|
|
|
|
//// playerInfo.setIdPhone(competePlayer.getIdPhotoFile());
|
|
|
|
//// playerInfo.setStudentRecord(competePlayer.getStudentRecordFile());
|
|
|
|
//// playerInfo.setHealthRecord(competePlayer.getHealthRecordFile());
|
|
|
|
//// playerInfo.setInsuranceRecord(competePlayer.getInsuranceRecordFile());
|
|
|
|
//// return playerInfo;
|
|
|
|
// return competePlayerDao.getPlayerByPlayerId(playerId);
|
|
|
|
//>>>>>>> f1a5f1b5d162548202a10e15eaec41aacda91a21
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@ -434,15 +469,26 @@ 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); |
|
|
|
competeCoachMapper.insertSelective(competeCoach1); |
|
|
|
}else { |
|
|
|
CompeteCoach competeCoach2 = new CompeteCoach(); |
|
|
|
competeCoach2.setId(snowflake.nextId()); |
|
|
|
BeanUtil.copyProperties(param, competeCoach2); |
|
|
|
competeCoachMapper.insertSelective(competeCoach2); |
|
|
|
competeCoachMapper.updateByPrimaryKeySelective(competeCoach2); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|