|
@@ -8,6 +8,7 @@ import com.uas.platform.b2b.support.SystemSession;
|
|
|
import com.uas.platform.core.model.Constant;
|
|
import com.uas.platform.core.model.Constant;
|
|
|
import com.uas.platform.core.model.Status;
|
|
import com.uas.platform.core.model.Status;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
+import org.springframework.util.StringUtils;
|
|
|
|
|
|
|
|
import java.io.UnsupportedEncodingException;
|
|
import java.io.UnsupportedEncodingException;
|
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
@@ -408,10 +409,12 @@ public class Purchase extends KeyEntity {
|
|
|
@Override
|
|
@Override
|
|
|
public List<String> getProductCode() {
|
|
public List<String> getProductCode() {
|
|
|
if (!CollectionUtils.isEmpty(this.purchaseDetails)) {
|
|
if (!CollectionUtils.isEmpty(this.purchaseDetails)) {
|
|
|
- List<String> codeList = null;
|
|
|
|
|
|
|
+ List<String> codeList = new ArrayList<>();
|
|
|
this.getPurchaseDetails().forEach(detail -> {
|
|
this.getPurchaseDetails().forEach(detail -> {
|
|
|
try {
|
|
try {
|
|
|
- codeList.add(URLEncoder.encode(detail.getPd_prodcode(), "UTF-8"));
|
|
|
|
|
|
|
+ if (!StringUtils.isEmpty(detail.getPd_prodcode())) {
|
|
|
|
|
+ codeList.add(URLEncoder.encode(detail.getPd_prodcode(), "UTF-8"));
|
|
|
|
|
+ }
|
|
|
} catch (UnsupportedEncodingException e) {
|
|
} catch (UnsupportedEncodingException e) {
|
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
|
}
|
|
}
|