|
@@ -7,6 +7,7 @@ import com.ym.mec.biz.dal.dto.BasicUserDto;
|
|
|
import com.ym.mec.biz.dal.dto.GoodsSellDto;
|
|
|
import com.ym.mec.biz.dal.entity.Goods;
|
|
|
import com.ym.mec.biz.dal.entity.GoodsProcurement;
|
|
|
+import com.ym.mec.biz.dal.entity.Organization;
|
|
|
import com.ym.mec.biz.dal.entity.SellOrder;
|
|
|
import com.ym.mec.biz.dal.enums.*;
|
|
|
import com.ym.mec.biz.dal.page.GoodsQuery;
|
|
@@ -78,6 +79,77 @@ public class GoodsServiceImpl extends BaseServiceImpl<Integer, Goods> implement
|
|
|
if (CollectionUtils.isEmpty(rows)) {
|
|
|
throw new BizException("没有查询到商品信息");
|
|
|
}
|
|
|
+ List<Organization> all = organizationDao.findAll(null);
|
|
|
+ Map<Integer, String> organizationMap = all.stream().collect(Collectors.toMap(Organization::getId, Organization::getName));
|
|
|
+ for (Goods goods : rows) {
|
|
|
+ if(StringUtils.isNotEmpty(goods.getStudentShowOrganId())){
|
|
|
+ String[] split = goods.getStudentShowOrganId().split(",");
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ for (String s : split) {
|
|
|
+ if(sb.length() > 0){
|
|
|
+ sb.append(",");
|
|
|
+ }
|
|
|
+ sb.append(organizationMap.get(Integer.valueOf(s)));
|
|
|
+ }
|
|
|
+ goods.setStudentShowOrganName(sb.toString());
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(goods.getEducationShowOrganId())){
|
|
|
+ String[] split = goods.getEducationShowOrganId().split(",");
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ for (String s : split) {
|
|
|
+ if(sb.length() > 0){
|
|
|
+ sb.append(",");
|
|
|
+ }
|
|
|
+ sb.append(organizationMap.get(Integer.valueOf(s)));
|
|
|
+ }
|
|
|
+ goods.setEducationShowOrganName(sb.toString());
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(goods.getReplacementShowOrganId())){
|
|
|
+ String[] split = goods.getReplacementShowOrganId().split(",");
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ for (String s : split) {
|
|
|
+ if(sb.length() > 0){
|
|
|
+ sb.append(",");
|
|
|
+ }
|
|
|
+ sb.append(organizationMap.get(Integer.valueOf(s)));
|
|
|
+ }
|
|
|
+ goods.setReplacementShowOrganName(sb.toString());
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(goods.getCourseFeeShowOrganId())){
|
|
|
+ String[] split = goods.getCourseFeeShowOrganId().split(",");
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ for (String s : split) {
|
|
|
+ if(sb.length() > 0){
|
|
|
+ sb.append(",");
|
|
|
+ }
|
|
|
+ sb.append(organizationMap.get(Integer.valueOf(s)));
|
|
|
+ }
|
|
|
+ goods.setCourseFeeShowOrganName(sb.toString());
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(goods.getMemberFeeShowOrganId())){
|
|
|
+ String[] split = goods.getMemberFeeShowOrganId().split(",");
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ for (String s : split) {
|
|
|
+ if(sb.length() > 0){
|
|
|
+ sb.append(",");
|
|
|
+ }
|
|
|
+ sb.append(organizationMap.get(Integer.valueOf(s)));
|
|
|
+ }
|
|
|
+ goods.setMemberFeeShowOrganName(sb.toString());
|
|
|
+ }
|
|
|
+ if(StringUtils.isNotEmpty(goods.getFreeFeeShowOrganId())){
|
|
|
+ String[] split = goods.getFreeFeeShowOrganId().split(",");
|
|
|
+ StringBuffer sb = new StringBuffer();
|
|
|
+ for (String s : split) {
|
|
|
+ if(sb.length() > 0){
|
|
|
+ sb.append(",");
|
|
|
+ }
|
|
|
+ sb.append(organizationMap.get(Integer.valueOf(s)));
|
|
|
+ }
|
|
|
+ goods.setFreeFeeShowOrganName(sb.toString());
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
return rows;
|
|
|
}
|
|
|
|