|
|
@@ -2,10 +2,10 @@ package com.poteviohealth.cgp.integration.mapstruct;
|
|
|
|
|
|
import com.poteviohealth.cgp.common.integrated.customer.model.CustomerIntegration;
|
|
|
import com.poteviohealth.cgp.common.model.CommonPage;
|
|
|
+import com.poteviohealth.cgp.integration.mapstruct.transform.ConverterUtils;
|
|
|
import com.poteviohealth.cgp.integration.model.IntegralDetail;
|
|
|
import com.poteviohealth.cgp.integration.model.outvo.app.IntegrationDetailOutDTO;
|
|
|
import com.poteviohealth.cgp.integration.model.outvo.web.IntegralDetailWebOutDTO;
|
|
|
-import org.apache.commons.lang.StringUtils;
|
|
|
import org.mapstruct.Mapper;
|
|
|
import org.mapstruct.Mapping;
|
|
|
import org.mapstruct.Mappings;
|
|
|
@@ -18,7 +18,7 @@ import java.util.List;
|
|
|
* @Date 6:30 PM 2019/7/25
|
|
|
* @Author MoonJiDoo
|
|
|
**/
|
|
|
-@Mapper()
|
|
|
+@Mapper(imports = ConverterUtils.class)
|
|
|
public interface IntegralConverter {
|
|
|
IntegralConverter INSTANCE = Mappers.getMapper(IntegralConverter.class);
|
|
|
|
|
|
@@ -43,18 +43,10 @@ public interface IntegralConverter {
|
|
|
CommonPage<IntegralDetailWebOutDTO> model2WebDTO(CommonPage<IntegralDetail> integralDetailIPage);
|
|
|
|
|
|
@Mappings({
|
|
|
- @Mapping(source = "sn", target = "content")
|
|
|
+ @Mapping(target = "content", expression = "java(ConverterUtils.setContent(integralDetail.getSn()))")
|
|
|
})
|
|
|
IntegrationDetailOutDTO model2AppDTO(IntegralDetail integralDetail);
|
|
|
|
|
|
- default String setContent(String sn){
|
|
|
- if(StringUtils.isBlank(sn)){
|
|
|
- return "账户调整";
|
|
|
- }else{
|
|
|
- return "订单号:"+sn;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
CommonPage<IntegrationDetailOutDTO> model2AppDTO(CommonPage<IntegralDetail> integralDetailIPage);
|
|
|
|
|
|
IntegralDetail model2FeginDTO(CustomerIntegration customerIntegration);
|