Forráskód Böngészése

销售报价历史价格

yuansh 10 órája
szülő
commit
f452a6b9bc

+ 17 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/controller/SaleQuotationController.java

@@ -550,6 +550,23 @@ public class SaleQuotationController {
     @GetMapping(value = "/querySaleQuotationProductByMainId")
     public Result<List<SaleQuotationProduct>> querySaleQuotationProductListByMainId(@RequestParam(name = "id", required = true) String id) {
         List<SaleQuotationProduct> saleQuotationProductList = saleQuotationProductService.selectByMainId(id);
+        for(SaleQuotationProduct o:saleQuotationProductList){
+            o.setLastPrice(new BigDecimal("23"));
+        }
+        return Result.OK(saleQuotationProductList);
+    }
+
+    /**
+     * 查看历史报价
+     *
+     * @return
+     */
+    @ApiOperation(value = "销售报价单-查看历史报价", notes = "销售报价单-查看历史报价")
+    @GetMapping(value = "/queryHisByInfo")
+    public Result<List<SaleQuotation>> queryHisByInfo(@RequestParam(name = "quotationCustomer", required = true) String quotationCustomer,
+                                                             @RequestParam(name = "productId", required = true) String productId) {
+        List<SaleQuotation> saleQuotationProductList = saleQuotationProductService.selectHisByInfo(quotationCustomer,productId);
+
         return Result.OK(saleQuotationProductList);
     }
 

+ 3 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/SaleQuotationProductMapper.java

@@ -5,6 +5,7 @@ import java.util.List;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.jeecg.modules.saleCode.entity.SaleQuotation;
 import org.jeecg.modules.saleCode.entity.SaleQuotationProduct;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import org.apache.ibatis.annotations.Param;
@@ -34,6 +35,8 @@ public interface SaleQuotationProductMapper extends BaseMapper<SaleQuotationProd
    */
 	public List<SaleQuotationProduct> selectByMainId(@Param("mainId") String mainId);
 
+	public List<SaleQuotation> selectHisByInfo(@Param("quotationCustomer") String quotationCustomer,@Param("productId") String productId);
+
 	public IPage<SaleQuotationAlert> saleQuotationDetailsAlert(Page<SaleQuotationAlert> page, @Param("ew") QueryWrapper<SaleQuotationAlert> queryWrapper);
 
 

+ 9 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/mapper/xml/SaleQuotationProductMapper.xml

@@ -15,6 +15,15 @@
 			a.head_id = #{mainId} 	</select>
 
 
+	<select id="selectHisByInfo" parameterType="java.lang.String" resultType="org.jeecg.modules.saleCode.entity.SaleQuotation">
+
+		select b.quotation_project_name , a.sale_price sale_amount,b.bill_date from sale_quotation_product a
+			left join sale_quotation b on a.head_id = b.id
+
+		where b.quotation_customer=#{quotationCustomer} and a.product_id=#{productId} order by b.bill_date desc
+
+	</select>
+
 	<select id="saleQuotationDetailsAlert" resultType="org.jeecg.modules.saleCode.vo.SaleQuotationAlert">
 		select *
 		from (

+ 3 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/ISaleQuotationProductService.java

@@ -3,6 +3,7 @@ package org.jeecg.modules.saleCode.service;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.jeecg.modules.saleCode.entity.SaleQuotation;
 import org.jeecg.modules.saleCode.entity.SaleQuotationProduct;
 import com.baomidou.mybatisplus.extension.service.IService;
 import org.jeecg.modules.saleCode.vo.SaleQuotationAlert;
@@ -25,5 +26,7 @@ public interface ISaleQuotationProductService extends IService<SaleQuotationProd
 	 */
 	public List<SaleQuotationProduct> selectByMainId(String mainId);
 
+	public List<SaleQuotation> selectHisByInfo(String quotationCustomer, String productId);
+
 	public IPage<SaleQuotationAlert> saleQuotationDetailsAlert(Page<SaleQuotationAlert> page, QueryWrapper<SaleQuotationAlert> queryWrapper);
 }

+ 6 - 0
srm-module-code/src/main/java/org/jeecg/modules/saleCode/service/impl/SaleQuotationProductServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
+import org.jeecg.modules.saleCode.entity.SaleQuotation;
 import org.jeecg.modules.saleCode.entity.SaleQuotationProduct;
 import org.jeecg.modules.saleCode.mapper.SaleQuotationProductMapper;
 import org.jeecg.modules.saleCode.service.ISaleQuotationProductService;
@@ -32,6 +33,11 @@ public class SaleQuotationProductServiceImpl extends ServiceImpl<SaleQuotationPr
         return saleQuotationProductMapper.selectByMainId(mainId);
     }
 
+    @Override
+    public List<SaleQuotation> selectHisByInfo(String quotationCustomer, String productId) {
+        return saleQuotationProductMapper.selectHisByInfo(quotationCustomer,productId);
+    }
+
     @Override
     public IPage<SaleQuotationAlert> saleQuotationDetailsAlert(Page<SaleQuotationAlert> page, QueryWrapper<SaleQuotationAlert> queryWrapper) {
         return saleQuotationProductMapper.saleQuotationDetailsAlert(page, queryWrapper);