فهرست منبع

Merge branch 'zx_saas_goods' of http://git.dayaedu.com/yonge/mec into zx_saas_goods

刘俊驰 1 سال پیش
والد
کامیت
bf10b7c0cc

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/ReplacementInstrumentActivityStatDto.java

@@ -19,6 +19,8 @@ public class ReplacementInstrumentActivityStatDto extends ReplacementInstrumentA
     /** 品牌 */
     private String brand;
 
+    private String brandName;
+
     /** 型号 */
     private String specification;
 
@@ -158,4 +160,12 @@ public class ReplacementInstrumentActivityStatDto extends ReplacementInstrumentA
     public void setBalance(BigDecimal balance) {
         this.balance = balance;
     }
+
+    public String getBrandName() {
+        return brandName;
+    }
+
+    public void setBrandName(String brandName) {
+        this.brandName = brandName;
+    }
 }

+ 11 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/entity/ReplacementInstrument.java

@@ -17,6 +17,8 @@ public class ReplacementInstrument extends BaseEntity {
 	
 	/** 品牌 */
 	private String brand;
+
+	private String brandName;
 	
 	/** 型号 */
 	private String specification;
@@ -129,7 +131,15 @@ public class ReplacementInstrument extends BaseEntity {
 	public java.util.Date getUpdateTime(){
 		return this.updateTime;
 	}
-			
+
+	public String getBrandName() {
+		return brandName;
+	}
+
+	public void setBrandName(String brandName) {
+		this.brandName = brandName;
+	}
+
 	@Override
 	public String toString() {
 		return ToStringBuilder.reflectionToString(this);

+ 10 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/page/GoodsQuery.java

@@ -27,6 +27,8 @@ public class GoodsQuery {
 
     private Integer subjectId;
 
+    private Boolean delFlag;
+
     public String getType() {
         return type;
     }
@@ -90,4 +92,12 @@ public class GoodsQuery {
     public void setReplacementShowOrganId(Integer replacementShowOrganId) {
         this.replacementShowOrganId = replacementShowOrganId;
     }
+
+    public Boolean getDelFlag() {
+        return delFlag;
+    }
+
+    public void setDelFlag(Boolean delFlag) {
+        this.delFlag = delFlag;
+    }
 }

+ 18 - 13
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ReplacementInstrumentActivityServiceImpl.java

@@ -8,7 +8,11 @@ import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.entity.*;
 import com.ym.mec.biz.service.*;
+import com.ym.mec.common.dto.BrandDto;
+import com.ym.mec.mall.MallFeignService;
+import org.apache.commons.lang.math.NumberUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -33,19 +37,6 @@ import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityDto;
 import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityStatDto;
 import com.ym.mec.biz.dal.dto.ReplacementInstrumentActivityStatHead;
 import com.ym.mec.biz.dal.dto.ReplacementPayDto;
-import com.ym.mec.biz.dal.entity.CooperationOrgan;
-import com.ym.mec.biz.dal.entity.Goods;
-import com.ym.mec.biz.dal.entity.QuestionnaireQuestion;
-import com.ym.mec.biz.dal.entity.QuestionnaireQuestionItem;
-import com.ym.mec.biz.dal.entity.QuestionnaireTopic;
-import com.ym.mec.biz.dal.entity.QuestionnaireUserResult;
-import com.ym.mec.biz.dal.entity.ReplacementInstrumentActivity;
-import com.ym.mec.biz.dal.entity.ReplacementInstrumentCooperation;
-import com.ym.mec.biz.dal.entity.SellOrder;
-import com.ym.mec.biz.dal.entity.Student;
-import com.ym.mec.biz.dal.entity.StudentPaymentOrder;
-import com.ym.mec.biz.dal.entity.SysUserCashAccount;
-import com.ym.mec.biz.dal.entity.SysUserCashAccountDetail;
 import com.ym.mec.biz.dal.enums.AccountType;
 import com.ym.mec.biz.dal.enums.DealStatusEnum;
 import com.ym.mec.biz.dal.enums.GoodsType;
@@ -68,6 +59,8 @@ import com.ym.mec.thirdparty.message.MessageSenderPluginContext;
 import com.ym.mec.util.collection.MapUtil;
 import com.ym.mec.util.http.HttpUtil;
 
+import javax.annotation.Resource;
+
 @Service
 public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<Integer, ReplacementInstrumentActivity> implements ReplacementInstrumentActivityService {
 
@@ -121,6 +114,8 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
     private QuestionnaireQuestionItemDao questionnaireQuestionItemDao;
     @Autowired
     private SysCouponCodeService sysCouponCodeService;
+    @Resource
+    private MallFeignService mallFeignService;
 
     private final Logger logger = LoggerFactory.getLogger(this.getClass());
 
@@ -555,6 +550,16 @@ public class ReplacementInstrumentActivityServiceImpl extends BaseServiceImpl<In
                     replacementInstrumentActivityStatDto.setBalance(activityOrders.get(0).getBalancePaymentAmount());
                 }
             }
+            List<String> brandIdList = dataList.stream().map(ReplacementInstrumentActivityStatDto::getBrand).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
+            if (!brandIdList.isEmpty()) {
+                Map<Long, String> idNameMap = mallFeignService.getList().stream().collect(Collectors.toMap(BrandDto::getId, BrandDto::getName));
+                for (ReplacementInstrumentActivityStatDto statDto : dataList) {
+                    String brand = statDto.getBrand();
+                    if (StringUtils.isNotEmpty(brand) && NumberUtils.isNumber(brand)) {
+                        statDto.setBrandName(idNameMap.getOrDefault(Long.valueOf(brand), ""));
+                    }
+                }
+            }
         }
         pageInfo.setRows(dataList);
         return pageInfo;

+ 18 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ReplacementInstrumentServiceImpl.java

@@ -4,19 +4,25 @@ import com.ym.mec.biz.dal.dao.GoodsDao;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.page.ReplacementInstrumentQueryInfo;
 import com.ym.mec.common.dal.BaseDAO;
+import com.ym.mec.common.dto.BrandDto;
 import com.ym.mec.common.page.PageInfo;
 import com.ym.mec.common.service.impl.BaseServiceImpl;
+import com.ym.mec.mall.MallFeignService;
 import com.ym.mec.util.collection.MapUtil;
+import org.apache.commons.lang.math.NumberUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import com.ym.mec.biz.dal.entity.ReplacementInstrument;
 import com.ym.mec.biz.service.ReplacementInstrumentService;
 import com.ym.mec.biz.dal.dao.ReplacementInstrumentDao;
 import org.springframework.stereotype.Service;
 
+import javax.annotation.Resource;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.stream.Collectors;
 
 @Service
 public class ReplacementInstrumentServiceImpl extends BaseServiceImpl<Integer, ReplacementInstrument> implements ReplacementInstrumentService {
@@ -25,6 +31,8 @@ public class ReplacementInstrumentServiceImpl extends BaseServiceImpl<Integer, R
     private ReplacementInstrumentDao replacementInstrumentDao;
     @Autowired
     private GoodsDao goodsDao;
+    @Resource
+    private MallFeignService mallFeignService;
 
     @Override
     public BaseDAO<Integer, ReplacementInstrument> getDAO() {
@@ -44,6 +52,16 @@ public class ReplacementInstrumentServiceImpl extends BaseServiceImpl<Integer, R
             pageInfo.setTotal(count);
             params.put("offset", pageInfo.getOffset());
             dataList = goodsDao.getReplacementGoodsPage(params);
+            List<String> brandIdList = dataList.stream().map(ReplacementInstrument::getBrand).filter(StringUtils::isNotEmpty).distinct().collect(Collectors.toList());
+            if (!brandIdList.isEmpty()) {
+                Map<Long, String> idNameMap = mallFeignService.getList().stream().collect(Collectors.toMap(BrandDto::getId, BrandDto::getName));
+                for (ReplacementInstrument instrument : dataList) {
+                    String brand = instrument.getBrand();
+                    if (StringUtils.isNotEmpty(brand) && NumberUtils.isNumber(brand)) {
+                        instrument.setBrandName(idNameMap.getOrDefault(Long.valueOf(brand), ""));
+                    }
+                }
+            }
         }
         pageInfo.setRows(dataList);
         return pageInfo;

+ 4 - 1
mec-biz/src/main/resources/config/mybatis/GoodsMapper.xml

@@ -405,7 +405,10 @@
 
     <sql id="queryOrganIdSql">
         <where>
-            AND g.status_ != 0 and g.tenant_id_ = #{goodsQuery.tenantId} and g.del_flag_ = 0
+            AND g.status_ != 0 and g.tenant_id_ = #{goodsQuery.tenantId}
+            <if test="goodsQuery.delFlag != null">
+                AND g.del_flag_ = #{goodsQuery.delFlag}
+            </if>
             <if test="goodsQuery.subjectId != null">
                 AND sgm.subject_id_ = #{goodsQuery.subjectId}
             </if>

+ 1 - 0
mec-biz/src/main/resources/config/mybatis/StudentPaymentOrderDetailMapper.xml

@@ -25,6 +25,7 @@
         <result column="minuend_stock_goods_id_list_" property="minuendStockGoodsIdList"/>
         <result column="user_id_" property="userId"/>
         <result column="delivery_batch_no_" property="deliveryBatchNo"/>
+        <result column="remit_fee_" property="remitFee"/>
         <collection property="goodsList" ofType="com.ym.mec.biz.dal.entity.Goods">
             <result column="goods_id_" property="id"/>
             <result column="goods_name_" property="name"/>