lichao 3 лет назад
Родитель
Сommit
83ecee9166

+ 6 - 0
blade-service-api/blade-client-api/src/main/java/org/springblade/client/entity/CorpsDesc.java

@@ -372,4 +372,10 @@ public class CorpsDesc implements Serializable {
 	@ApiModelProperty(value = "代理商编码")
 	private String agentCode;
 
+	/**
+	 * 首字母
+	 */
+	@ApiModelProperty(value = "首字母")
+	private String initials;
+
 }

+ 2 - 1
blade-service/blade-land/src/main/java/org/springblade/land/mapper/OrderMapper.xml

@@ -133,7 +133,8 @@
                     #{dept}
                 </foreach>
             </if>
-            <if test="acct.shippingMode != null and acct.shippingMode != ''">and t1.shipping_mode = #{acct.shippingMode}</if>
+            <if test="acct.shippingMode != null and acct.shippingMode != '' and acct.shippingMode == '散货'">and t1.shipping_mode = #{acct.shippingMode}</if>
+            <if test="acct.shippingMode != null and acct.shippingMode != '' and acct.shippingMode != '散货'">and t2.shipping_mode = #{acct.shippingMode}</if>
             <if test="acct.confirmStatus != null and acct.shippingMode != '散货'">and t2.confirm_status = #{acct.confirmStatus}</if>
             <if test="acct.status == 1 and acct.shippingMode != '散货'">and t2.status in (0, 1)</if>
             <if test="acct.status == 2 and acct.shippingMode != '散货'">and t2.status not in (0, 1, 4)</if>

+ 8 - 0
blade-service/blade-land/src/main/java/org/springblade/land/service/impl/OrderServiceImpl.java

@@ -854,6 +854,14 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 		);
 		detail.setUnloadedAddressList(unloadedAddressList);
 
+		//附件
+		R<List<CommonFile>> fileList = commonFileClient.getList(order.getId(), LandConstant.ORDER);
+		if (fileList.isSuccess() && fileList.getData() != null) {
+			detail.setFileList(fileList.getData());
+		} else {
+			detail.setFileList(Collections.emptyList());
+		}
+
 		return detail;
 	}
 

+ 25 - 26
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/export/ExportOrderController.java

@@ -666,7 +666,6 @@ public class ExportOrderController extends BladeController {
 	@ApiOperation(value = "销售明细导出", notes = "销售明细导出")
 	public void salesDetailsExport(SalesDetailsVo detailsVo, Query query, HttpServletResponse response){
 		detailsVo.setTenantId(SecureUtil.getTenantId());
-		System.out.println(SecureUtil.getTenantId());
 		List<SalesDetailsExcel> list = orderService.salesDetailsExport(detailsVo);
 		ExcelUtil.export(response, "销售明细", "销售明细", list, SalesDetailsExcel.class);
 	}
@@ -751,29 +750,29 @@ public class ExportOrderController extends BladeController {
 		ExcelUtil.export(response, "品牌采购对账", "品牌采购对账", list, PurchaseExcel.class);
 	}
 
-//	/**
-//	 * 统计分析 销售利润
-//	 * @param
-//	 * @return
-//	 */
-//	@GetMapping("/selSalesProfit")
-//	@ApiOperation(value = "统计分析 销售利润", notes = "传入detailsVo")
-//	public R<IPage<SalesDetailsVo>> selSalesProfit(SalesDetailsVo detailsVo,Query query){
-//		detailsVo.setTenantId(SecureUtil.getTenantId());
-//		IPage<SalesDetailsVo> pages = orderService.selSalesProfit(Condition.getPage(query), detailsVo);
-//		return R.data(pages);
-//	}
-//
-//	/**
-//	 * 统计分析 销售利润列表导出
-//	 * @param detailsVo
-//	 * @return
-//	 */
-//	@GetMapping("/selPurchaseExport")
-//	@ApiOperation(value = "销售利润导出", notes = "销售利润导出")
-//	public void selSalesProfitExport(SalesDetailsVo detailsVo, HttpServletResponse response){
-//		detailsVo.setTenantId(SecureUtil.getTenantId());
-//		List<SalesProfitExcel> list = orderService.selSalesProfitExport(detailsVo);
-//		ExcelUtil.export(response, "销售利润", "销售利润", list, SalesProfitExcel.class);
-//	}
+	/**
+	 * 统计分析 销售利润
+	 * @param
+	 * @return
+	 */
+	@GetMapping("/selSalesProfit")
+	@ApiOperation(value = "统计分析 销售利润", notes = "传入detailsVo")
+	public R<IPage<SalesDetailsVo>> selSalesProfit(SalesDetailsVo detailsVo,Query query){
+		detailsVo.setTenantId(SecureUtil.getTenantId());
+		IPage<SalesDetailsVo> pages = orderService.selSalesProfit(Condition.getPage(query), detailsVo);
+		return R.data(pages);
+	}
+
+	/**
+	 * 统计分析 销售利润列表导出
+	 * @param detailsVo
+	 * @return
+	 */
+	@GetMapping("/selSalesProfitExport")
+	@ApiOperation(value = "销售利润导出", notes = "销售利润导出")
+	public void selSalesProfitExport(SalesDetailsVo detailsVo, HttpServletResponse response){
+		detailsVo.setTenantId(SecureUtil.getTenantId());
+		List<SalesProfitExcel> list = orderService.selSalesProfitExport(detailsVo);
+		ExcelUtil.export(response, "销售利润", "销售利润", list, SalesProfitExcel.class);
+	}
 }

+ 1 - 0
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/mapper/OrderItemsMapper.xml

@@ -500,6 +500,7 @@ WHERE
                 and t2.create_time &lt;= #{dataset.endCreateTime}
             </if>
         </where>
+        order by t2.create_time desc
     </select>
     <update id="submitPay" parameterType="long">
         UPDATE business_order_items SET submit_pay = '1' WHERE pid = #{id}

+ 20 - 12
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/mapper/OrderMapper.xml

@@ -555,7 +555,14 @@ ORDER BY
             BOF.Amount
         END) AS feesAmount,
         BGD.Brand AS brand,
-        BO.order_no as orderNo
+        BO.order_no as orderNo,
+        (CASE WHEN
+            trim(BOI.price_type) != ''
+        THEN
+            BOI.amount
+        ELSE
+            0.00
+        END) AS specialPrice
         FROM business_order_items AS BOI
         LEFT JOIN business_order BO ON BOI.pid = BO.id
         LEFT JOIN basic_goods_desc BGD ON BOI.Item_id = BGD.id
@@ -568,11 +575,8 @@ ORDER BY
             <if test="detailsVo.corpName != null and detailsVo.corpName != ''">
                 AND BCD.cname like concat('%', #{detailsVo.corpName}, '%')
             </if>
-            <if test="detailsVo.brand != null and detailsVo.brand != ''">
-                AND BGD.Brand like concat('%', #{detailsVo.brand}, '%')
-            </if>
             <if test="detailsVo.salesName != null and detailsVo.salesName != ''">
-                AND BO.Sales_name like concat('%', #{detailsVo.salesName}, '%')
+                AND BO.charge_member like concat('%', #{detailsVo.salesName}, '%')
             </if>
             <if test="detailsVo.beginCreateTime !=null and detailsVo.beginCreateTime != ''">
                 and BO.create_time &gt;= #{detailsVo.beginCreateTime}
@@ -602,7 +606,14 @@ ORDER BY
         BOF.Amount
         ELSE ''
         END) AS feesAmount,
-        BO.order_no as orderNo
+        BO.order_no as orderNo,
+        (CASE WHEN
+            trim(BOI.price_type) != ''
+        THEN
+            BOI.amount
+        ELSE
+            0.00
+        END) AS specialPrice
         FROM business_order_items AS BOI
         LEFT JOIN business_order BO ON BOI.pid = BO.id
         LEFT JOIN basic_goods_desc BGD ON BOI.Item_id = BGD.id
@@ -615,11 +626,8 @@ ORDER BY
             <if test="detailsVo.corpName != null and detailsVo.corpName != ''">
                 AND BCD.cname like concat('%', #{detailsVo.corpName}, '%')
             </if>
-            <if test="detailsVo.brand != null and detailsVo.brand != ''">
-                AND BGD.Brand like concat('%', #{detailsVo.brand}, '%')
-            </if>
             <if test="detailsVo.salesName != null and detailsVo.salesName != ''">
-                AND BO.Sales_name like concat('%', #{detailsVo.salesName}, '%')
+                AND BO.charge_member like concat('%', #{detailsVo.salesName}, '%')
             </if>
             <if test="detailsVo.beginCreateTime !=null and detailsVo.beginCreateTime != ''">
                 and BO.create_time &gt;= #{detailsVo.beginCreateTime}
@@ -922,7 +930,7 @@ ORDER BY
             LEFT JOIN business_order_fees BOF ON BOF.pid = BO.id
             LEFT JOIN basic_corps_desc BCD ON BO.Corp_id = BCD.id
         <where>
-            BOI.is_deleted = 0
+            BO.is_deleted = 0
             AND BO.bill_type = 'XS'
             AND BO.tenant_id = #{detailsVo.tenantId}
             <if test="detailsVo.brand != null and detailsVo.brand != ''">
@@ -1013,7 +1021,7 @@ ORDER BY
         LEFT JOIN business_order_fees BOF ON BOF.pid = BO.id
         LEFT JOIN basic_corps_desc BCD ON BO.Corp_id = BCD.id
         <where>
-            BOI.is_deleted = 0
+            BO.is_deleted = 0
             AND BO.bill_type = 'XS'
             AND BO.tenant_id = #{detailsVo.tenantId}
             <if test="detailsVo.brand != null and detailsVo.brand != ''">