|
@@ -6,15 +6,21 @@ import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.sunxung.factoring.component.exception.ValidatorException;
|
|
import com.sunxung.factoring.component.exception.ValidatorException;
|
|
import com.sunxung.factoring.component.util.*;
|
|
import com.sunxung.factoring.component.util.*;
|
|
|
|
+import com.sunxung.factoring.dict.impl.FileModuleDict;
|
|
import com.sunxung.factoring.entity.GridPage;
|
|
import com.sunxung.factoring.entity.GridPage;
|
|
import com.sunxung.factoring.entity.acceptance.AcceptanceSignConfirmationElectronicInfo;
|
|
import com.sunxung.factoring.entity.acceptance.AcceptanceSignConfirmationElectronicInfo;
|
|
import com.sunxung.factoring.entity.customerinformation.ElectronicSignaturePersonal;
|
|
import com.sunxung.factoring.entity.customerinformation.ElectronicSignaturePersonal;
|
|
import com.sunxung.factoring.entity.entprise.Enterprise;
|
|
import com.sunxung.factoring.entity.entprise.Enterprise;
|
|
import com.sunxung.factoring.entity.signconfirmation.SignConfirmationElectronicInfo;
|
|
import com.sunxung.factoring.entity.signconfirmation.SignConfirmationElectronicInfo;
|
|
|
|
+import com.sunxung.factoring.entity.sys.Dictionary;
|
|
|
|
+import com.sunxung.factoring.entity.sys.FileStorage;
|
|
import com.sunxung.factoring.mapper.customerinformation.ElectronicSignaturePersonalMapper;
|
|
import com.sunxung.factoring.mapper.customerinformation.ElectronicSignaturePersonalMapper;
|
|
import com.sunxung.factoring.service.acceptancesheet.IAcceptanceSignConfirmationElectronicInfoService;
|
|
import com.sunxung.factoring.service.acceptancesheet.IAcceptanceSignConfirmationElectronicInfoService;
|
|
import com.sunxung.factoring.service.customerinformation.IElectronicSignaturePersonalService;
|
|
import com.sunxung.factoring.service.customerinformation.IElectronicSignaturePersonalService;
|
|
import com.sunxung.factoring.service.signconfirmation.ISignConfirmationElectronicInfoService;
|
|
import com.sunxung.factoring.service.signconfirmation.ISignConfirmationElectronicInfoService;
|
|
|
|
+import com.sunxung.factoring.service.sys.DictionaryService;
|
|
|
|
+import com.sunxung.factoring.service.sys.FileStorageService;
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -42,10 +48,22 @@ public class ElectronicSignaturePersonalServiceImpl extends ServiceImpl<Electron
|
|
@Autowired
|
|
@Autowired
|
|
private ElectronicSignaturePersonalMapper electronicSignaturePersonalMapper;
|
|
private ElectronicSignaturePersonalMapper electronicSignaturePersonalMapper;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private FileStorageService fileStorageService;
|
|
|
|
+
|
|
|
|
+ @Autowired
|
|
|
|
+ private DictionaryService dictionaryService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public GridPage findByName(String name,Integer status, Integer page, Integer rows) {
|
|
public GridPage findByName(String name,Integer status, Integer page, Integer rows) {
|
|
Page objectPage = PageHelper.startPage(page, rows);
|
|
Page objectPage = PageHelper.startPage(page, rows);
|
|
List<ElectronicSignaturePersonal> list = electronicSignaturePersonalMapper.findByName(name,status);
|
|
List<ElectronicSignaturePersonal> list = electronicSignaturePersonalMapper.findByName(name,status);
|
|
|
|
+ for (ElectronicSignaturePersonal personal : list){
|
|
|
|
+ if (StringUtils.isNotEmpty(personal.getCardType())){
|
|
|
|
+ Dictionary dictionary = dictionaryService.getByCode(personal.getCardType());
|
|
|
|
+ personal.setCardTypeName(dictionary.getName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
return new GridPage(rows,page,objectPage.getTotal(),list);
|
|
return new GridPage(rows,page,objectPage.getTotal(),list);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -67,6 +85,24 @@ public class ElectronicSignaturePersonalServiceImpl extends ServiceImpl<Electron
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public ElectronicSignaturePersonal getDetail(Long id) {
|
|
|
|
+ ElectronicSignaturePersonal electronicSignaturePersonal = getById(id);
|
|
|
|
+ if (StringUtils.isNotEmpty(electronicSignaturePersonal.getCardType())){
|
|
|
|
+ Dictionary dictionary = dictionaryService.getByCode(electronicSignaturePersonal.getCardType());
|
|
|
|
+ electronicSignaturePersonal.setCardTypeName(dictionary.getName());
|
|
|
|
+ }
|
|
|
|
+ List<FileStorage> fileStorages = fileStorageService.findByBelongIdAndBelongType(id.toString(), FileModuleDict.ChildEnum.ENTERPRISE_CARD_PHOTO.getCode());
|
|
|
|
+ if (CollectionUtil.isNotEmpty(fileStorages)){
|
|
|
|
+ electronicSignaturePersonal.setCardPhotoFile(fileStorages.get(0));
|
|
|
|
+ }
|
|
|
|
+ List<FileStorage> list = fileStorageService.findByBelongIdAndBelongType(id.toString(), FileModuleDict.ChildEnum.ENTERPRISE_CARD_REV_PHOTO.getCode());
|
|
|
|
+ if (CollectionUtil.isNotEmpty(list)){
|
|
|
|
+ electronicSignaturePersonal.setCardRevPhotoFile(list.get(0));
|
|
|
|
+ }
|
|
|
|
+ return electronicSignaturePersonal;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<ElectronicSignaturePersonal> findByIdForC(Long id) {
|
|
public List<ElectronicSignaturePersonal> findByIdForC(Long id) {
|
|
List<ElectronicSignaturePersonal> list ;
|
|
List<ElectronicSignaturePersonal> list ;
|
|
@@ -94,6 +130,17 @@ public class ElectronicSignaturePersonalServiceImpl extends ServiceImpl<Electron
|
|
throw new ValidatorException(CodeUtil.FAIL, "已认证,不能修改!");
|
|
throw new ValidatorException(CodeUtil.FAIL, "已认证,不能修改!");
|
|
} else if (oldInfo.getAuthStatus().equals(0)) {
|
|
} else if (oldInfo.getAuthStatus().equals(0)) {
|
|
electronicSignaturePersonal = getAuthInfo(electronicSignaturePersonal);
|
|
electronicSignaturePersonal = getAuthInfo(electronicSignaturePersonal);
|
|
|
|
+ //更新附件
|
|
|
|
+ if (CollectionUtil.isNotEmpty(electronicSignaturePersonal.getDeleteIds())){
|
|
|
|
+ for (Long id : electronicSignaturePersonal.getDeleteIds()){
|
|
|
|
+ fileStorageService.deleteFileStorage(id);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (CollectionUtil.isNotEmpty(electronicSignaturePersonal.getFileIds())){
|
|
|
|
+ for (Long id : electronicSignaturePersonal.getFileIds()){
|
|
|
|
+ fileStorageService.updateBusinessId(id,electronicSignaturePersonal.getId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
updateById(electronicSignaturePersonal);
|
|
updateById(electronicSignaturePersonal);
|
|
} else {
|
|
} else {
|
|
throw new ValidatorException(CodeUtil.FAIL, "数据状态错误!");
|
|
throw new ValidatorException(CodeUtil.FAIL, "数据状态错误!");
|