客户查询明细表
This commit is contained in:
		
							parent
							
								
									3e497200ba
								
							
						
					
					
						commit
						b4e2fcc348
					
				|  | @ -163,4 +163,30 @@ public class StockReportController extends BaseController { | |||
|         return toPage(clientStockReportService.pageList(params, ".getClientStockReportSql")); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @description 客户库存盘点明细的详情 | ||||
|      * @author mzr | ||||
|      * @date 2024/10/31 | ||||
|      **/ | ||||
|     @ApiOperation("客户库存盘点明细的详情") | ||||
|     @PostMapping(value = "/getClientStockDetail") | ||||
|     public Map<String, Object> getClientStockDetail( | ||||
|             @ApiParam(required = true, value = "开始日期") @RequestParam(required = true) String startDate, | ||||
|             @ApiParam(required = true, value = "结束日期") @RequestParam(required = true) String endDate, | ||||
|             @ApiParam(required = true, value = "客户id") @RequestParam(required = true) String clientId, | ||||
|             HttpServletRequest request) { | ||||
|         Map<String, Object> result = new HashMap<>(); | ||||
|         Map<String, Object> params = new HashMap<>(); | ||||
|         String token = request.getHeader("token"); | ||||
|         if (!redisService.isKey(token)) { | ||||
|             return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录"); | ||||
|         } | ||||
|         Map<String, String> tokenMap = redisService.hmget(token); | ||||
|         params.put("companyId", tokenMap.get("companyId")); | ||||
|         params.put("startDate", startDate); | ||||
|         params.put("endDate", endDate); | ||||
|         params.put("clientId", clientId); | ||||
|         return AjaxResult.success(clientStockReportService.listClientStockDetail(params)); | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
|  | @ -15,7 +15,9 @@ | |||
| 
 | ||||
|     <!-- 客户库存盘点明细 --> | ||||
|     <select id="getClientStockReportSql" resultType="com.yb.lb.webapp.stock.entity.ClientStockReport" parameterType="map"> | ||||
|         SELECT t0.uecode "uecode", | ||||
|         SELECT | ||||
|         t0.id "clientId", | ||||
|         t0.uecode "uecode", | ||||
|         t0.distributor_name "clientName", | ||||
|         csui.name "staffName", | ||||
|         cmai.area_name "areaName", | ||||
|  | @ -169,4 +171,20 @@ | |||
|         </if> | ||||
|     </select> | ||||
| 
 | ||||
|     <!-- 根据条件参数查询盘点子表列表 --> | ||||
|     <select id="getClientInventoryDetail" resultType="map" parameterType="map"> | ||||
|         SELECT a.goods_no       AS "goodsNo", | ||||
|                b.goods_name     AS "goodsName", | ||||
|                b.specifications AS "specifications" | ||||
|         FROM ( | ||||
|                  SELECT goods_no | ||||
|                  FROM crm_inventory_detail | ||||
|                  WHERE confirm_status = '1' | ||||
|                    AND company_id = #{companyId} | ||||
|                    AND client_id = #{clientId} | ||||
|                  GROUP BY goods_no | ||||
|              ) a | ||||
|                  LEFT JOIN crm_goods_info b ON a.goods_no = b.goods_no and b.company_id = #{companyId} | ||||
|     </select> | ||||
| 
 | ||||
| </mapper> | ||||
|  | @ -65,6 +65,14 @@ | |||
|             <if test="companyId != null and companyId != ''"> | ||||
|                 AND a.company_id = #{companyId} | ||||
|             </if> | ||||
|             <if test="startDate != null and startDate !=''"> | ||||
|                 AND TO_CHAR(TO_DATE(SUBSTR(a.bill_date,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') >= | ||||
|                 TO_CHAR(TO_DATE(SUBSTR(#{startDate},1,10),'yyyy-MM-dd'),'yyyy-MM-dd') | ||||
|             </if> | ||||
|             <if test="endDate != null and endDate !=''"> | ||||
|                 AND TO_CHAR(TO_DATE(SUBSTR(a.bill_date,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') <= | ||||
|                 TO_CHAR(TO_DATE(SUBSTR(#{endDate},1,10),'yyyy-MM-dd'),'yyyy-MM-dd') | ||||
|             </if> | ||||
|             <if test="startDateP != null and startDateP !=''"> | ||||
|                 AND TO_CHAR(TO_DATE(SUBSTR(a.prod_date,1,10),'yyyy-MM-dd'),'yyyy-MM-dd') >= | ||||
|                 TO_CHAR(TO_DATE(SUBSTR(#{startDateP},1,10),'yyyy-MM-dd'),'yyyy-MM-dd') | ||||
|  |  | |||
|  | @ -14,6 +14,10 @@ public class ClientStockReport implements java.io.Serializable { | |||
|     /** 版本号 */ | ||||
|     private static final long serialVersionUID = -1267096003093637603L; | ||||
| 
 | ||||
|     /** 客户id */ | ||||
|     @ApiModelProperty(value = "客户id") | ||||
|     private String clientId; | ||||
| 
 | ||||
|     /** 客户编码-u8 */ | ||||
|     @ApiModelProperty(value = "客户编码-u8") | ||||
|     private String uecode; | ||||
|  |  | |||
|  | @ -6,6 +6,8 @@ import com.yb.lb.webapp.stock.entity.ClientStockReport; | |||
| import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.stereotype.Service; | ||||
| 
 | ||||
| import java.util.ArrayList; | ||||
| import java.util.HashMap; | ||||
| import java.util.List; | ||||
| import java.util.Map; | ||||
| 
 | ||||
|  | @ -20,6 +22,8 @@ public class ClientStockReportService { | |||
| 
 | ||||
|     @Autowired | ||||
|     BaseOracleDao<ClientStockReport> dao; | ||||
|     @Autowired | ||||
|     InventoryInfoService inventoryInfoService; | ||||
| 
 | ||||
|     /** | ||||
|      * @description 分页查询 | ||||
|  | @ -39,4 +43,22 @@ public class ClientStockReportService { | |||
|         return dao.list(ClientStockReport.class.getName() + id, params); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * @description 客户库存盘点明细的详情 | ||||
|      * @author mzr | ||||
|      * @date 2024/10/31 | ||||
|      **/ | ||||
|     public List listClientStockDetail(Map<String, Object> params) { | ||||
|         List<Map<String, Object>> list = new ArrayList<>(); | ||||
|         List<Map<String, Object>> goodsList = this.findList(params, "ListClientStockDetail"); | ||||
|         for (Map<String, Object> goodsMap : goodsList) { | ||||
|             Map<String, Object> selMap = new HashMap<>(params); | ||||
|             selMap.put("goodsNo", goodsMap.get("goodsNo")); | ||||
|             selMap.put("confirmStatus", "1"); | ||||
|             goodsMap.put("pdList", inventoryInfoService.findDetailList(selMap, ".findCrmInventoryDetailByCondition")); | ||||
|             list.add(goodsMap); | ||||
|         } | ||||
|         return list; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue