|
@@ -8,6 +8,7 @@ import com.yh.saas.plugin.base.service.ICommonBillOperateHisService;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.NumberConstant;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.constant.StatusEnum;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.entity.IdentityAuthenticationInfo;
|
|
|
+import com.yh.saas.plugin.yiliangyiyun.entity.ProcurementPlanInfo;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.exception.*;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.mapper.IdentityAuthenticationInfoMapper;
|
|
|
import com.yh.saas.plugin.yiliangyiyun.service.*;
|
|
@@ -87,7 +88,7 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public String addIdentityAuthenticationInfo(IdentityAuthenticationInfo identityAuthenticationInfo){
|
|
|
+ public String addIdentityAuthenticationInfo(IdentityAuthenticationInfo identityAuthenticationInfo)throws ServiceException{
|
|
|
// 根据传参手机号判断手机号是否存在
|
|
|
// 空是新增
|
|
|
identityAuthenticationInfo.setId(IdGenerator.generateUUID());
|
|
@@ -100,16 +101,7 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
|
|
|
.eq(IdentityAuthenticationInfo.QueryFiles.DELETE_FLAG, NumberConstant.CONSTANT0));
|
|
|
//同一手机号再次被认证
|
|
|
if (identityAuthenticationInfoList.size() > 0) {
|
|
|
- //认证状态改为已覆盖
|
|
|
- identityAuthenticationInfo.setAuthenticationStatus(StatusEnum.IDENTITY_COVERED.getName());
|
|
|
- identityAuthenticationInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_COVERED.getFlag());
|
|
|
- // 操作主表数据
|
|
|
- this.updateById(identityAuthenticationInfo);
|
|
|
- // 插入操作历史
|
|
|
- String staffName = this.billOperateHisService.getStaffAndName();
|
|
|
- // 插入操作历史
|
|
|
- this.billOperateHisService.saveBillOperateHis(identityAuthenticationInfo.getId(), NumberConstant.CONSTANT_PURCHASE, staffName, null,
|
|
|
- identityAuthenticationInfo.getAuthenticationStatus(), null, "");
|
|
|
+ throw new AppServiceException(ExceptionDefinition.PHONE_NUMBER_ALREADY_EXISTS);
|
|
|
}
|
|
|
// 操作主表数据
|
|
|
this.insert(identityAuthenticationInfo);
|
|
@@ -132,13 +124,14 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
|
|
|
*/
|
|
|
@Override
|
|
|
public String editIdentityAuthenticationInfo(IdentityAuthenticationInfo identityAuthenticationInfo) {
|
|
|
- if("5".equals(identityAuthenticationInfo.getAuthenticationStatusKey())){
|
|
|
- this.updateById(identityAuthenticationInfo);
|
|
|
- return "OK";
|
|
|
- }
|
|
|
- //身份认证状态非未通过
|
|
|
- else{
|
|
|
- throw new YException(YExceptionEnum.AUTHENTICATION_INFORMATION_CHANGE_FAILED);
|
|
|
+ identityAuthenticationInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_COVERED.getFlag());
|
|
|
+ identityAuthenticationInfo.setAuthenticationStatus(StatusEnum.IDENTITY_COVERED.getName());
|
|
|
+ boolean one=this.updateById(identityAuthenticationInfo);
|
|
|
+ //成功返回ok
|
|
|
+ if (one ) {
|
|
|
+ return "OK";
|
|
|
+ } else {
|
|
|
+ return "NG";
|
|
|
}
|
|
|
}
|
|
|
/**
|
|
@@ -150,7 +143,7 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
|
|
|
public IdentityAuthenticationInfo getIdentityAuthenticationInfo(String id) {
|
|
|
//查看身份认证
|
|
|
IdentityAuthenticationInfo identityAuthenticationInfo = this.selectById(id);
|
|
|
- return identityAuthenticationInfo;
|
|
|
+ return identityAuthenticationInfo;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -191,6 +184,35 @@ public class IdentityAuthenticationInfoServiceImpl extends ServiceImpl<IdentityA
|
|
|
}
|
|
|
return identityAuthenticationInfo;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 审核
|
|
|
+ * @param id
|
|
|
+ * @param flag 1通过 2 驳回
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public String examine(String id, Integer flag) {
|
|
|
+ //查询粮商列表
|
|
|
+ IdentityAuthenticationInfo identityAuthenticationInfo = this.selectById(id);
|
|
|
+ if (identityAuthenticationInfo != null ){
|
|
|
+ //通过
|
|
|
+ if(flag==1){
|
|
|
+ identityAuthenticationInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_COMPLETED.getFlag());
|
|
|
+ identityAuthenticationInfo.setAuthenticationStatus(StatusEnum.IDENTITY_COMPLETED.getName());
|
|
|
+ }
|
|
|
+ //驳回
|
|
|
+ else{
|
|
|
+ identityAuthenticationInfo.setAuthenticationStatusKey(StatusEnum.IDENTITY_FAILED.getFlag());
|
|
|
+ identityAuthenticationInfo.setAuthenticationStatus(StatusEnum.IDENTITY_FAILED.getName());
|
|
|
+ }
|
|
|
+ //更改粮商信息
|
|
|
+ this.updateById(identityAuthenticationInfo);
|
|
|
+ return "OK";
|
|
|
+ }
|
|
|
+ return "NG";
|
|
|
+ }
|
|
|
+
|
|
|
public void DBConnection(){
|
|
|
try{
|
|
|
//加载驱动程序
|