|
@@ -4,6 +4,7 @@ import java.io.FileOutputStream;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.time.LocalDateTime;
|
|
import java.time.LocalDateTime;
|
|
import java.time.format.DateTimeFormatter;
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
import java.util.Objects;
|
|
|
|
|
|
@@ -32,7 +33,7 @@ import javax.swing.filechooser.FileSystemView;
|
|
|
|
|
|
/**
|
|
/**
|
|
* Service: tb_enterprise -- 商家
|
|
* Service: tb_enterprise -- 商家
|
|
- * @author qzy
|
|
|
|
|
|
+ * @author qzy
|
|
*/
|
|
*/
|
|
@Service
|
|
@Service
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@@ -69,9 +70,9 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
|
|
return super.getById(id);
|
|
return super.getById(id);
|
|
}
|
|
}
|
|
|
|
|
|
- /** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
|
|
|
|
- List<TbEnterprise> getList(SoMap so) {
|
|
|
|
- return tbEnterpriseMapper.getList(so);
|
|
|
|
|
|
+ /** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
|
|
|
|
+ List<TbEnterprise> getList(SoMap so) {
|
|
|
|
+ return tbEnterpriseMapper.getList(so);
|
|
}
|
|
}
|
|
|
|
|
|
public int audit(TbEnterpriseDto tbEnterpriseDto){
|
|
public int audit(TbEnterpriseDto tbEnterpriseDto){
|
|
@@ -115,6 +116,35 @@ public class TbEnterpriseService extends ServiceImpl<TbEnterpriseMapper, TbEnter
|
|
return line;
|
|
return line;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /** 商家认证 */
|
|
|
|
+ boolean identification(TbEnterprise enterprise){
|
|
|
|
+ if(null == enterprise) return false;
|
|
|
|
+
|
|
|
|
+ //手机号去重
|
|
|
|
+ String idCard = enterprise.getIdCard();
|
|
|
|
+ if(tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getIdCard,idCard).eq(TbEnterprise::getDeleteStatus,1)).size() != 0)
|
|
|
|
+ throw new RuntimeException("当前手机号已被认证!");
|
|
|
|
+ //身份证号去重
|
|
|
|
+ String contact = enterprise.getContact();
|
|
|
|
+ if(tbEnterpriseMapper.selectList(new LambdaQueryWrapper<TbEnterprise>().eq(TbEnterprise::getContact,contact).eq(TbEnterprise::getDeleteStatus,1)).size() != 0)
|
|
|
|
+ throw new RuntimeException("当前身份证号已被认证!");
|
|
|
|
+
|
|
|
|
+ //是否需要手机发送验证码认证?
|
|
|
|
+
|
|
|
|
+ //开始保存商家信息
|
|
|
|
+ //注册/认证时间
|
|
|
|
+ enterprise.setRegisterTime(new Date());
|
|
|
|
+ //创建时间
|
|
|
|
+ enterprise.setCreateTime(new Date());
|
|
|
|
+ //删除状态:启用
|
|
|
|
+ enterprise.setDeleteStatus(1);
|
|
|
|
+
|
|
|
|
+ // 保存商家信息
|
|
|
|
+ int insert = tbEnterpriseMapper.insert(enterprise);
|
|
|
|
+ return insert == 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 导入
|
|
* 导入
|
|
* @param file excel文件
|
|
* @param file excel文件
|