|
|
|
@ -461,17 +461,23 @@ public class SsmBaseStaffServiceImpl extends BaseServiceImpl<BaseStaff> implemen
|
|
|
|
if (!CollectionUtils.isEmpty(staffTemporaries)) {
|
|
|
|
if (!CollectionUtils.isEmpty(staffTemporaries)) {
|
|
|
|
throw new SmsException(ResponseCode.MSG,"请勿重复提交");
|
|
|
|
throw new SmsException(ResponseCode.MSG,"请勿重复提交");
|
|
|
|
}*/
|
|
|
|
}*/
|
|
|
|
StaffTemporary query = new StaffTemporary();
|
|
|
|
Example example2 = new Example(StaffTemporary.class);
|
|
|
|
query.setIdentityCard(identityCard);
|
|
|
|
example2.selectProperties("id");
|
|
|
|
query.setRuzhiTime(ruzhiTime);
|
|
|
|
Example.Criteria criteria2 = example2.createCriteria();
|
|
|
|
StaffTemporary staffTemp = staffTemporaryDao.selectOne(query);
|
|
|
|
criteria2.andEqualTo("identityCard",identityCard);
|
|
|
|
if (staffTemp != null) {
|
|
|
|
criteria2.andEqualTo("ruzhiTime",ruzhiTime);
|
|
|
|
|
|
|
|
List<StaffTemporary> staffTemporaries = staffTemporaryDao.selectByExample(example2);
|
|
|
|
|
|
|
|
if(Objects.nonNull(staffTemporaries) && !staffTemporaries.isEmpty()){
|
|
|
|
throw new SmsException(ResponseCode.MSG,"请勿重复提交");
|
|
|
|
throw new SmsException(ResponseCode.MSG,"请勿重复提交");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Example example = new Example(BlackList.class);
|
|
|
|
Example example = new Example(BlackList.class);
|
|
|
|
Example.Criteria criteria = example.createCriteria();
|
|
|
|
Example.Criteria criteria = example.createCriteria();
|
|
|
|
// criteria.andEqualTo(StaffRequest.Fields.staffName,staffRequest.getStaffName());
|
|
|
|
// criteria.andEqualTo(StaffRequest.Fields.staffName,staffRequest.getStaffName());
|
|
|
|
|
|
|
|
example.selectProperties("urgentName","urgentPhone","urgentRelationship","id","beisenUserId",
|
|
|
|
|
|
|
|
"email","sex","staffNum","staffName","mobilePhone","identityCard","storeId","inputId",
|
|
|
|
|
|
|
|
"inputName","inputDate","type","job","regionId","endType","endId","endName","endTime",
|
|
|
|
|
|
|
|
"updateTime","employeeInformationId","employmentRecordId","isBeisen","isZhongkong","blacklistReasons");
|
|
|
|
criteria.andEqualTo(StaffRequest.Fields.identityCard, identityCard);
|
|
|
|
criteria.andEqualTo(StaffRequest.Fields.identityCard, identityCard);
|
|
|
|
criteria.andEqualTo(StaffRequest.Fields.mobilePhone, mobilePhone);
|
|
|
|
criteria.andEqualTo(StaffRequest.Fields.mobilePhone, mobilePhone);
|
|
|
|
criteria.andEqualTo(StaffRequest.Fields.storeId,staffRequest.getStoreId());
|
|
|
|
criteria.andEqualTo(StaffRequest.Fields.storeId,staffRequest.getStoreId());
|
|
|
|
@ -537,34 +543,75 @@ public class SsmBaseStaffServiceImpl extends BaseServiceImpl<BaseStaff> implemen
|
|
|
|
temporary.setRegionId(staffRequest.getRegionId());
|
|
|
|
temporary.setRegionId(staffRequest.getRegionId());
|
|
|
|
|
|
|
|
|
|
|
|
//查询有没有员工,判断是否是异常状态
|
|
|
|
//查询有没有员工,判断是否是异常状态
|
|
|
|
Example blackExample = new Example(BlackList.class);
|
|
|
|
// Example blackExample = new Example(BlackList.class);
|
|
|
|
|
|
|
|
// Example.Criteria blackExampleCriteria = blackExample.createCriteria();
|
|
|
|
|
|
|
|
// //身份证、手机号、名字
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// blackExampleCriteria.andEqualTo(BlackListDto.Fields.identityCard, identityCard);
|
|
|
|
|
|
|
|
// blackExample.or(blackExample.createCriteria().andEqualTo(BlackListDto.Fields.mobilePhone, mobilePhone));
|
|
|
|
|
|
|
|
// blackExample.selectProperties("identityCard","type","staffName","mobilePhone");
|
|
|
|
|
|
|
|
// List<BlackList> blackLists = blackListDao.selectByExample(blackExample);
|
|
|
|
|
|
|
|
// if (!CollectionUtils.isEmpty(blackLists)){
|
|
|
|
|
|
|
|
// for (BlackList blackList : blackLists) {
|
|
|
|
|
|
|
|
// temporary.setIsOne(1);
|
|
|
|
|
|
|
|
// //身份证相同、手机不同
|
|
|
|
|
|
|
|
// //手机相同身份证不同
|
|
|
|
|
|
|
|
// if (blackList.getIdentityCard().equals(temporary.getIdentityCard()) && blackList.getType()==1){
|
|
|
|
|
|
|
|
// throw new SmsException(ResponseCode.MSG,"已拉入系统黑名单,请联系管理员!");
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (blackList.getIdentityCard().equals(temporary.getIdentityCard())){
|
|
|
|
|
|
|
|
// if (!blackList.getMobilePhone().equals(temporary.getMobilePhone()) || !blackList.getStaffName().equals(temporary.getStaffName())){
|
|
|
|
|
|
|
|
// temporary.setState(1);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// if (blackList.getMobilePhone().equals(temporary.getMobilePhone())){
|
|
|
|
|
|
|
|
// if (!blackList.getIdentityCard().equals(temporary.getIdentityCard()) || !blackList.getStaffName().equals(temporary.getStaffName())){
|
|
|
|
|
|
|
|
// temporary.setState(1);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
//查询有没有员工,判断是否是异常状态
|
|
|
|
|
|
|
|
Example blackExample = new Example(StaffTemporary.class);
|
|
|
|
Example.Criteria blackExampleCriteria = blackExample.createCriteria();
|
|
|
|
Example.Criteria blackExampleCriteria = blackExample.createCriteria();
|
|
|
|
//身份证、手机号、名字
|
|
|
|
//身份证、手机号、名字
|
|
|
|
|
|
|
|
|
|
|
|
blackExampleCriteria.andEqualTo(BlackListDto.Fields.identityCard, identityCard);
|
|
|
|
blackExampleCriteria.andEqualTo(BlackListDto.Fields.identityCard, identityCard);
|
|
|
|
blackExample.or(blackExample.createCriteria().andEqualTo(BlackListDto.Fields.mobilePhone, mobilePhone));
|
|
|
|
blackExample.or(blackExample.createCriteria().andEqualTo(BlackListDto.Fields.mobilePhone, mobilePhone));
|
|
|
|
blackExample.selectProperties("identityCard","type","staffName","mobilePhone");
|
|
|
|
blackExample.setOrderByClause("scan_time desc");
|
|
|
|
List<BlackList> blackLists = blackListDao.selectByExample(blackExample);
|
|
|
|
blackExample.selectProperties("identityCard","staffName","mobilePhone");
|
|
|
|
if (!CollectionUtils.isEmpty(blackLists)){
|
|
|
|
// List<BlackList> blackLists = blackListDao.selectByExample(blackExample);
|
|
|
|
|
|
|
|
List<StaffTemporary> staffTemporaries1 = staffTemporaryDao.selectByExample(blackExample);
|
|
|
|
|
|
|
|
if (!CollectionUtils.isEmpty(staffTemporaries1)){
|
|
|
|
|
|
|
|
StaffTemporary staffTemporary = staffTemporaries1.get(0);
|
|
|
|
|
|
|
|
staffTemporary.setIsOne(1);
|
|
|
|
|
|
|
|
//身份证相同、手机不同
|
|
|
|
|
|
|
|
//手机相同身份证不同
|
|
|
|
|
|
|
|
if (staffTemporary.getIdentityCard().equals(temporary.getIdentityCard())){
|
|
|
|
|
|
|
|
if (!staffTemporary.getMobilePhone().equals(temporary.getMobilePhone()) || !staffTemporary.getStaffName().equals(temporary.getStaffName())){
|
|
|
|
|
|
|
|
temporary.setState(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (staffTemporary.getMobilePhone().equals(temporary.getMobilePhone())){
|
|
|
|
|
|
|
|
if (!staffTemporary.getIdentityCard().equals(temporary.getIdentityCard()) || !staffTemporary.getStaffName().equals(temporary.getStaffName())){
|
|
|
|
|
|
|
|
temporary.setState(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//判断是否被拉进黑名单
|
|
|
|
|
|
|
|
Example example3 = new Example(BlackList.class);
|
|
|
|
|
|
|
|
example3.selectProperties("identityCard","staffName","mobilePhone","type");
|
|
|
|
|
|
|
|
Example.Criteria criteria3 = example3.createCriteria();
|
|
|
|
|
|
|
|
criteria3.andEqualTo(BlackListDto.Fields.identityCard, identityCard);
|
|
|
|
|
|
|
|
example3.or(example3.createCriteria().andEqualTo(BlackListDto.Fields.mobilePhone, mobilePhone));
|
|
|
|
|
|
|
|
List<BlackList> blackLists = blackListDao.selectByExample(example3);
|
|
|
|
|
|
|
|
if(!CollectionUtils.isEmpty(staffTemporaries1)){
|
|
|
|
for (BlackList blackList : blackLists) {
|
|
|
|
for (BlackList blackList : blackLists) {
|
|
|
|
temporary.setIsOne(1);
|
|
|
|
|
|
|
|
//身份证相同、手机不同
|
|
|
|
|
|
|
|
//手机相同身份证不同
|
|
|
|
|
|
|
|
if (blackList.getIdentityCard().equals(temporary.getIdentityCard()) && blackList.getType()==1){
|
|
|
|
if (blackList.getIdentityCard().equals(temporary.getIdentityCard()) && blackList.getType()==1){
|
|
|
|
throw new SmsException(ResponseCode.MSG,"已拉入系统黑名单,请联系管理员!");
|
|
|
|
throw new SmsException(ResponseCode.MSG,"已拉入系统黑名单,请联系管理员!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (blackList.getIdentityCard().equals(temporary.getIdentityCard())){
|
|
|
|
|
|
|
|
if (!blackList.getMobilePhone().equals(temporary.getMobilePhone()) || !blackList.getStaffName().equals(temporary.getStaffName())){
|
|
|
|
|
|
|
|
temporary.setState(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (blackList.getMobilePhone().equals(temporary.getMobilePhone())){
|
|
|
|
|
|
|
|
if (!blackList.getIdentityCard().equals(temporary.getIdentityCard()) || !blackList.getStaffName().equals(temporary.getStaffName())){
|
|
|
|
|
|
|
|
temporary.setState(1);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//查询临时工是否存在,存在则带 ???
|
|
|
|
//查询临时工是否存在,存在则带 ???
|
|
|
|
@ -617,7 +664,7 @@ public class SsmBaseStaffServiceImpl extends BaseServiceImpl<BaseStaff> implemen
|
|
|
|
String staffNum = getStaffNum(staffRequest.getStoreId(),identityCard);
|
|
|
|
String staffNum = getStaffNum(staffRequest.getStoreId(),identityCard);
|
|
|
|
String email = getEmail(staffRequest.getStoreId());
|
|
|
|
String email = getEmail(staffRequest.getStoreId());
|
|
|
|
temporary.setEmail(email);
|
|
|
|
temporary.setEmail(email);
|
|
|
|
temporary.setState(0);
|
|
|
|
// temporary.setState(0);
|
|
|
|
staffTemporaryVo.setStaffNum(staffNum);
|
|
|
|
staffTemporaryVo.setStaffNum(staffNum);
|
|
|
|
temporary.setStaffNum(staffNum);
|
|
|
|
temporary.setStaffNum(staffNum);
|
|
|
|
// TODO 更新可能导致数据被覆盖...
|
|
|
|
// TODO 更新可能导致数据被覆盖...
|
|
|
|
@ -715,12 +762,16 @@ public class SsmBaseStaffServiceImpl extends BaseServiceImpl<BaseStaff> implemen
|
|
|
|
|
|
|
|
|
|
|
|
//查询新添加进黑白名单表的数据
|
|
|
|
//查询新添加进黑白名单表的数据
|
|
|
|
Example example1 = new Example(BlackList.class);
|
|
|
|
Example example1 = new Example(BlackList.class);
|
|
|
|
Example.Criteria criteria1 = example.createCriteria();
|
|
|
|
Example.Criteria criteria1 = example1.createCriteria();
|
|
|
|
// criteria.andEqualTo(StaffRequest.Fields.staffName,staffRequest.getStaffName());
|
|
|
|
// criteria.andEqualTo(StaffRequest.Fields.staffName,staffRequest.getStaffName());
|
|
|
|
|
|
|
|
example1.selectProperties("urgentName","urgentPhone","urgentRelationship","id","beisenUserId",
|
|
|
|
|
|
|
|
"email","sex","staffNum","staffName","mobilePhone","identityCard","storeId","inputId",
|
|
|
|
|
|
|
|
"inputName","inputDate","type","job","regionId","endType","endId","endName","endTime",
|
|
|
|
|
|
|
|
"updateTime","employeeInformationId","employmentRecordId","isBeisen","isZhongkong","blacklistReasons");
|
|
|
|
criteria1.andEqualTo(StaffRequest.Fields.identityCard, identityCard);
|
|
|
|
criteria1.andEqualTo(StaffRequest.Fields.identityCard, identityCard);
|
|
|
|
criteria1.andEqualTo(StaffRequest.Fields.mobilePhone, mobilePhone);
|
|
|
|
criteria1.andEqualTo(StaffRequest.Fields.mobilePhone, mobilePhone);
|
|
|
|
criteria1.andEqualTo(StaffRequest.Fields.storeId,staffRequest.getStoreId());
|
|
|
|
criteria1.andEqualTo(StaffRequest.Fields.storeId,staffRequest.getStoreId());
|
|
|
|
List<BlackList> blackLists1 = blackListDao.selectByExample(example);
|
|
|
|
List<BlackList> blackLists1 = blackListDao.selectByExample(example1);
|
|
|
|
if(!CollectionUtils.isEmpty(blackLists1)){
|
|
|
|
if(!CollectionUtils.isEmpty(blackLists1)){
|
|
|
|
staffTemporaryVo.setBlackList(blackLists1.get(0));
|
|
|
|
staffTemporaryVo.setBlackList(blackLists1.get(0));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|