|
@@ -8,6 +8,7 @@ import com.poteviohealth.cgp.common.model.VaultsResponse;
|
|
|
import com.poteviohealth.ym.ipos.model.back.BaseBack;
|
|
import com.poteviohealth.ym.ipos.model.back.BaseBack;
|
|
|
import com.poteviohealth.ym.ipos.model.merchant.*;
|
|
import com.poteviohealth.ym.ipos.model.merchant.*;
|
|
|
import com.poteviohealth.ym.ipos.model.merchant.detail.*;
|
|
import com.poteviohealth.ym.ipos.model.merchant.detail.*;
|
|
|
|
|
+import com.poteviohealth.ym.ipos.model.merchant.dto.ImageDto;
|
|
|
import com.poteviohealth.ym.ipos.model.merchant.dto.UserDto;
|
|
import com.poteviohealth.ym.ipos.model.merchant.dto.UserDto;
|
|
|
import com.poteviohealth.ym.ipos.model.merchant.back.PictureBack;
|
|
import com.poteviohealth.ym.ipos.model.merchant.back.PictureBack;
|
|
|
import com.poteviohealth.ym.ipos.model.merchant.back.UserBack;
|
|
import com.poteviohealth.ym.ipos.model.merchant.back.UserBack;
|
|
@@ -29,7 +30,7 @@ import java.io.IOException;
|
|
|
*/
|
|
*/
|
|
|
@Service
|
|
@Service
|
|
|
@Log4j2
|
|
@Log4j2
|
|
|
-public class IMerchantServiceImpl implements IMerchantService {
|
|
|
|
|
|
|
+public class MerchantServiceImpl implements IMerchantService {
|
|
|
|
|
|
|
|
final String SUCCESS = "0000";
|
|
final String SUCCESS = "0000";
|
|
|
|
|
|
|
@@ -40,27 +41,16 @@ public class IMerchantServiceImpl implements IMerchantService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 上传图片
|
|
* 上传图片
|
|
|
- * @param file
|
|
|
|
|
- * @param type
|
|
|
|
|
|
|
+ * @param dto
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
- public VaultsResponse merchantPicture(MultipartFile file, String type){
|
|
|
|
|
- if (file == null || file.isEmpty()) {
|
|
|
|
|
- throw new RuntimeException("图片不能为空!");
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ public VaultsResponse merchantPicture(ImageDto dto){
|
|
|
Picture p = new Picture();
|
|
Picture p = new Picture();
|
|
|
PictureDetail detail = new PictureDetail();
|
|
PictureDetail detail = new PictureDetail();
|
|
|
- detail.setType(type);
|
|
|
|
|
- detail.setImage_name(file.getOriginalFilename());
|
|
|
|
|
- byte[] binaryData = new byte[0];
|
|
|
|
|
- try {
|
|
|
|
|
- binaryData = file.getBytes();
|
|
|
|
|
- } catch (IOException e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- String encodedPolicy = Base64Encoder.encode(binaryData);
|
|
|
|
|
- detail.setImage_content(encodedPolicy);
|
|
|
|
|
|
|
+ detail.setType(dto.getType());
|
|
|
|
|
+ detail.setImage_name(dto.getName());
|
|
|
|
|
+ detail.setImage_content(dto.getBase64Str());
|
|
|
p.setMerchant_picture_request(detail);
|
|
p.setMerchant_picture_request(detail);
|
|
|
|
|
|
|
|
PictureBack back = (PictureBack) YmUtil.resultBack(p,new PictureBack());
|
|
PictureBack back = (PictureBack) YmUtil.resultBack(p,new PictureBack());
|
|
@@ -205,9 +195,9 @@ public class IMerchantServiceImpl implements IMerchantService {
|
|
|
IndvregisterAdd iAdd = new IndvregisterAdd();
|
|
IndvregisterAdd iAdd = new IndvregisterAdd();
|
|
|
IndvregisterAddDetail detail = new IndvregisterAddDetail();
|
|
IndvregisterAddDetail detail = new IndvregisterAddDetail();
|
|
|
detail.setMerchant_id(dto.getMerchant_id());
|
|
detail.setMerchant_id(dto.getMerchant_id());
|
|
|
- detail.setIdentity_begin_date(DateFormatUtils.format(dto.getIdentity_begin_date(),"yyyyMMdd"));
|
|
|
|
|
- if(dto.getIdentity_end_date() != null){
|
|
|
|
|
- detail.setIdentity_end_date(DateFormatUtils.format(dto.getIdentity_end_date(),"yyyyMMdd"));
|
|
|
|
|
|
|
+ detail.setIdentity_begin_date(dto.getIdentity_begin_date());
|
|
|
|
|
+ if(StringUtils.isNotEmpty(dto.getIdentity_end_date())){
|
|
|
|
|
+ detail.setIdentity_end_date(dto.getIdentity_end_date());
|
|
|
}
|
|
}
|
|
|
detail.setIdentity_validity_type(dto.getIdentity_validity_type());
|
|
detail.setIdentity_validity_type(dto.getIdentity_validity_type());
|
|
|
detail.setContact_phone(dto.getContact_phone());
|
|
detail.setContact_phone(dto.getContact_phone());
|
|
@@ -235,9 +225,9 @@ public class IMerchantServiceImpl implements IMerchantService {
|
|
|
IndvregisterUpdate iUpdate = new IndvregisterUpdate();
|
|
IndvregisterUpdate iUpdate = new IndvregisterUpdate();
|
|
|
IndvregisterUpdateDetail iUpdateDetail = new IndvregisterUpdateDetail();
|
|
IndvregisterUpdateDetail iUpdateDetail = new IndvregisterUpdateDetail();
|
|
|
iUpdateDetail.setMerchant_id(dto.getMerchant_id());
|
|
iUpdateDetail.setMerchant_id(dto.getMerchant_id());
|
|
|
- iUpdateDetail.setIdentity_begin_date(DateFormatUtils.format(dto.getIdentity_begin_date(),"yyyyMMdd"));
|
|
|
|
|
- if(dto.getIdentity_end_date() != null){
|
|
|
|
|
- iUpdateDetail.setIdentity_end_date(DateFormatUtils.format(dto.getIdentity_end_date(),"yyyyMMdd"));
|
|
|
|
|
|
|
+ iUpdateDetail.setIdentity_begin_date(dto.getIdentity_begin_date());
|
|
|
|
|
+ if(StringUtils.isNotEmpty(dto.getIdentity_end_date())){
|
|
|
|
|
+ iUpdateDetail.setIdentity_end_date(dto.getIdentity_end_date());
|
|
|
}
|
|
}
|
|
|
iUpdateDetail.setIdentity_validity_type(dto.getIdentity_validity_type());
|
|
iUpdateDetail.setIdentity_validity_type(dto.getIdentity_validity_type());
|
|
|
iUpdateDetail.setContact_phone(dto.getContact_phone());
|
|
iUpdateDetail.setContact_phone(dto.getContact_phone());
|
|
@@ -262,9 +252,9 @@ public class IMerchantServiceImpl implements IMerchantService {
|
|
|
EntregisterAdd iAdd = new EntregisterAdd();
|
|
EntregisterAdd iAdd = new EntregisterAdd();
|
|
|
EntregisterAddDetail detail = new EntregisterAddDetail();
|
|
EntregisterAddDetail detail = new EntregisterAddDetail();
|
|
|
detail.setMerchant_id(dto.getMerchant_id());
|
|
detail.setMerchant_id(dto.getMerchant_id());
|
|
|
- detail.setLicense_begin_date(DateFormatUtils.format(dto.getLicense_begin_date(),"yyyyMMdd"));
|
|
|
|
|
- if(dto.getLicense_end_date() != null){
|
|
|
|
|
- detail.setLicense_end_date(DateFormatUtils.format(dto.getLicense_end_date(),"yyyyMMdd"));
|
|
|
|
|
|
|
+ detail.setLicense_begin_date(dto.getLicense_begin_date());
|
|
|
|
|
+ if(StringUtils.isNotEmpty(dto.getLicense_end_date())){
|
|
|
|
|
+ detail.setLicense_end_date(dto.getLicense_end_date());
|
|
|
}
|
|
}
|
|
|
detail.setLicense_validity_type(dto.getLicense_validity_type());
|
|
detail.setLicense_validity_type(dto.getLicense_validity_type());
|
|
|
detail.setLicense_province_code(dto.getLicense_province_code());
|
|
detail.setLicense_province_code(dto.getLicense_province_code());
|
|
@@ -273,9 +263,9 @@ public class IMerchantServiceImpl implements IMerchantService {
|
|
|
detail.setLicense_address(dto.getLicense_address());
|
|
detail.setLicense_address(dto.getLicense_address());
|
|
|
detail.setLegal_name(dto.getLegal_name());
|
|
detail.setLegal_name(dto.getLegal_name());
|
|
|
detail.setIdentity_no(dto.getIdentity_no());
|
|
detail.setIdentity_no(dto.getIdentity_no());
|
|
|
- detail.setIdentity_begin_date(DateFormatUtils.format(dto.getIdentity_begin_date(),"yyyyMMdd"));
|
|
|
|
|
- if(dto.getIdentity_end_date() != null){
|
|
|
|
|
- detail.setIdentity_end_date(DateFormatUtils.format(dto.getIdentity_end_date(),"yyyyMMdd"));
|
|
|
|
|
|
|
+ detail.setIdentity_begin_date(dto.getIdentity_begin_date());
|
|
|
|
|
+ if(StringUtils.isNotEmpty(dto.getIdentity_end_date())){
|
|
|
|
|
+ detail.setIdentity_end_date(dto.getIdentity_end_date());
|
|
|
}
|
|
}
|
|
|
detail.setIdentity_validity_type(dto.getIdentity_validity_type());
|
|
detail.setIdentity_validity_type(dto.getIdentity_validity_type());
|
|
|
detail.setContact_name(dto.getContact_name());
|
|
detail.setContact_name(dto.getContact_name());
|
|
@@ -304,9 +294,9 @@ public class IMerchantServiceImpl implements IMerchantService {
|
|
|
EntregisterUpdate iUpdate = new EntregisterUpdate();
|
|
EntregisterUpdate iUpdate = new EntregisterUpdate();
|
|
|
EntregisterUpdateDetail iUpdateDetail = new EntregisterUpdateDetail();
|
|
EntregisterUpdateDetail iUpdateDetail = new EntregisterUpdateDetail();
|
|
|
iUpdateDetail.setMerchant_id(dto.getMerchant_id());
|
|
iUpdateDetail.setMerchant_id(dto.getMerchant_id());
|
|
|
- iUpdateDetail.setLicense_begin_date(DateFormatUtils.format(dto.getLicense_begin_date(),"yyyyMMdd"));
|
|
|
|
|
- if(dto.getLicense_end_date() != null){
|
|
|
|
|
- iUpdateDetail.setLicense_end_date(DateFormatUtils.format(dto.getLicense_end_date(),"yyyyMMdd"));
|
|
|
|
|
|
|
+ iUpdateDetail.setLicense_begin_date(dto.getLicense_begin_date());
|
|
|
|
|
+ if(StringUtils.isNotEmpty(dto.getLicense_end_date())){
|
|
|
|
|
+ iUpdateDetail.setLicense_end_date(dto.getLicense_end_date());
|
|
|
}
|
|
}
|
|
|
iUpdateDetail.setLicense_validity_type(dto.getLicense_validity_type());
|
|
iUpdateDetail.setLicense_validity_type(dto.getLicense_validity_type());
|
|
|
iUpdateDetail.setLicense_province_code(dto.getLicense_province_code());
|
|
iUpdateDetail.setLicense_province_code(dto.getLicense_province_code());
|
|
@@ -315,9 +305,9 @@ public class IMerchantServiceImpl implements IMerchantService {
|
|
|
iUpdateDetail.setLicense_address(dto.getLicense_address());
|
|
iUpdateDetail.setLicense_address(dto.getLicense_address());
|
|
|
iUpdateDetail.setLegal_name(dto.getLegal_name());
|
|
iUpdateDetail.setLegal_name(dto.getLegal_name());
|
|
|
iUpdateDetail.setIdentity_no(dto.getIdentity_no());
|
|
iUpdateDetail.setIdentity_no(dto.getIdentity_no());
|
|
|
- iUpdateDetail.setIdentity_begin_date(DateFormatUtils.format(dto.getIdentity_begin_date(),"yyyyMMdd"));
|
|
|
|
|
- if(dto.getIdentity_end_date() != null){
|
|
|
|
|
- iUpdateDetail.setIdentity_end_date(DateFormatUtils.format(dto.getIdentity_end_date(),"yyyyMMdd"));
|
|
|
|
|
|
|
+ iUpdateDetail.setIdentity_begin_date(dto.getIdentity_begin_date());
|
|
|
|
|
+ if(StringUtils.isNotEmpty(dto.getIdentity_end_date())){
|
|
|
|
|
+ iUpdateDetail.setIdentity_end_date(dto.getIdentity_end_date());
|
|
|
}
|
|
}
|
|
|
iUpdateDetail.setIdentity_validity_type(dto.getIdentity_validity_type());
|
|
iUpdateDetail.setIdentity_validity_type(dto.getIdentity_validity_type());
|
|
|
iUpdateDetail.setContact_name(dto.getContact_name());
|
|
iUpdateDetail.setContact_name(dto.getContact_name());
|