Browse Source

二级市场收购商发布需求列表修改

linbl 1 year ago
parent
commit
0a6b26038b

+ 22 - 22
sp-service/level-two-server/src/main/java/com/pj/tb_demand_quotation/TbDemandQuotation.java

@@ -13,7 +13,7 @@ import lombok.experimental.Accessors;
 
 /**
  * Model: tb_demand_quotation -- 一级市场组长需求报价表
- * @author yzs 
+ * @author yzs
  */
 @Data
 @Accessors(chain = true)
@@ -23,15 +23,15 @@ public class TbDemandQuotation extends Model<TbDemandQuotation> implements Seria
 
 	// ---------- 模块常量 ----------
 	/**
-	 * 序列化版本id 
+	 * 序列化版本id
 	 */
-	private static final long serialVersionUID = 1L;	
+	private static final long serialVersionUID = 1L;
 	/**
-	 * 此模块对应的表名 
+	 * 此模块对应的表名
 	 */
-	public static final String TABLE_NAME = "tb_demand_quotation";	
+	public static final String TABLE_NAME = "tb_demand_quotation";
 	/**
-	 * 此模块对应的权限码 
+	 * 此模块对应的权限码
 	 */
 	public static final String PERMISSION_CODE = "tb-demand-quotation";
 	public static final String PERMISSION_CODE_ADD = "tb-demand-quotation-add";
@@ -46,47 +46,47 @@ public class TbDemandQuotation extends Model<TbDemandQuotation> implements Seria
 	 * 一级市场组长需求报价表ID
 	 */
 	@TableId(type = IdType.AUTO)
-	private Long id;	
+	private Long id;
 
 	/**
-	 * 一级市场互市组组长ID(tb_people) 
+	 * 一级市场互市组组长ID(tb_people)
 	 */
-	private Long leaderId;	
+	private Long leaderId;
 	/**
 	 * 组ID
 	 */
 	private Long groupId;
 
 	/**
-	 * 组名称 
+	 * 组名称
 	 */
-	private String groupName;	
+	private String groupName;
 	/**
 	 *  联系电话
 	 */
 	private String linkPhone;
 
 	/**
-	 * 二级市场收购商需求表ID 
+	 * 二级市场收购商需求表ID
 	 */
 	private Long demandId;
 
 	/**
-	 * 二级市场收购商需求表ID
+	 * 互市区ID
 	 */
 	private Long tradeAreaId;
 	/**
-	 * 二级市场收购商需求表
+	 * 互市区名称
 	 */
 	private String tradeAreaName;
 
 	/**
-	 * 报价(CNY) 
+	 * 报价(CNY)
 	 */
-	private Double quotation;	
+	private Double quotation;
 
 	/**
-	 * 创建人编号 
+	 * 创建人编号
 	 */
 	private Long createBy;
 	/**
@@ -95,16 +95,16 @@ public class TbDemandQuotation extends Model<TbDemandQuotation> implements Seria
 	private Long purchaserId;
 
 	/**
-	 * 创建人名称(报价人) 
+	 * 创建人名称(报价人)
 	 */
-	private String createName;	
+	private String createName;
 	/**
 	 * 组长备注
 	 */
 	private String remark;
 
 	/**
-	 * 创建时间 
+	 * 创建时间
 	 */
 	@JsonFormat(pattern = "yyyy-MM-dd")
 	private Date createTime;
@@ -115,7 +115,7 @@ public class TbDemandQuotation extends Model<TbDemandQuotation> implements Seria
 	private Date resultTime;
 
 	/**
-	 * 删除状态 
+	 * 删除状态
 	 */
 	private Integer deleteStatus;
 
@@ -128,7 +128,7 @@ public class TbDemandQuotation extends Model<TbDemandQuotation> implements Seria
 
 
 
-	
+
 
 
 }

+ 23 - 22
sp-service/level-two-server/src/main/java/com/pj/tb_goods_demand/AppTbGoodsDemandController.java

@@ -14,7 +14,7 @@ import java.util.List;
 
 /**
  * Controller: tb_goods_demand -- 二级收购商需求发布表
- * @author yzs 
+ * @author yzs
  */
 @RestController
 @RequestMapping("/app/TbGoodsDemand/")
@@ -24,7 +24,7 @@ public class AppTbGoodsDemandController {
 	@Autowired
 	TbGoodsDemandService tbGoodsDemandService;
 
-	/** 二级市场收购商发布需求 */
+	/**  */
 	@RequestMapping("add")
 //	@SaCheckPermission(TbGoodsDemand.PERMISSION_CODE_ADD)
 	public AjaxJson add(TbGoodsDemand t){
@@ -33,24 +33,24 @@ public class AppTbGoodsDemandController {
 		return AjaxJson.getSuccessData(t);
 	}
 
-	/** 删 */  
+	/** 删 */
 	@RequestMapping("delete")
 //	@SaCheckPermission(TbGoodsDemand.PERMISSION_CODE_DEL)
 	public AjaxJson delete(Long id){
 		 tbGoodsDemandService.delete(id);
 		return AjaxJson.getSuccess();
 	}
-	
-	/** 删 - 根据id列表 */  
+
+	/** 删 - 根据id列表 */
 	@RequestMapping("deleteByIds")
 //	@SaCheckPermission(TbGoodsDemand.PERMISSION_CODE_DEL)
 	public AjaxJson deleteByIds(){
-		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class);
 		int line = SP.publicMapper.deleteByIds(TbGoodsDemand.TABLE_NAME, ids);
 		return AjaxJson.getByLine(line);
 	}
-	
-	/** 改 */  
+
+	/** 改 */
 	@RequestMapping("update")
 //	@SaCheckPermission(TbGoodsDemand.PERMISSION_CODE_EDIT)
 	public AjaxJson update(TbGoodsDemand t){
@@ -58,7 +58,7 @@ public class AppTbGoodsDemandController {
 		return AjaxJson.getSuccess();
 	}
 
-	/** 查 - 根据id */  
+	/** 查 - 根据id */
 	@RequestMapping("getById")
 //		@SaCheckPermission(TbGoodsDemand.PERMISSION_CODE)
 	public AjaxJson getById(Long id){
@@ -66,21 +66,22 @@ public class AppTbGoodsDemandController {
 		return AjaxJson.getSuccessData(t);
 	}
 
-	/** app端:专供给级市场查看的需求列表*/
+	/** app端:专供给级市场查看的需求列表*/
 	@RequestMapping("getAppList")
 //		@SaCheckPermission(TbGoodsDemand.PERMISSION_CODE)
-	public AjaxJson getAppList(@RequestParam(value = "isOrders",required = false)Integer isOrders) {
+	public AjaxJson getAppList() {
 		SoMap so = SoMap.getRequestSoMap();
-		List<TbGoodsDemand> list = tbGoodsDemandService.getAppList(so.startPage(),isOrders);
+		List<TbGoodsDemand> list = tbGoodsDemandService.getAppList(so.startPage());
 		return AjaxJson.getPageData(so.getDataCount(), list);
 	}
-	
-	/** app端:二级收购商查看当前已被报价的需求列表*/
-	@RequestMapping("goodsDemandList")
+
+	/** app端:二级收购商查看需求发布列表(包括报价信息)*/
+	@RequestMapping("goodsDemandDetail")
 //		@SaCheckPermission(TbGoodsDemand.PERMISSION_CODE)
-	public AjaxJson goodsDemandList(@RequestParam(value = "isOrders",required = false)Integer isOrders) {
+	public AjaxJson goodsDemandDetail(Long id) {
 		SoMap so = SoMap.getRequestSoMap();
-		List<GoodsDemandVo> goodsDemandVos = tbGoodsDemandService.goodsDemandList(so.startPage(),isOrders);
+		so.put("id",id);
+		GoodsDemandVo goodsDemandVos = tbGoodsDemandService.goodsDemandList(so.startPage());
 		return AjaxJson.getPageData(so.getDataCount(), goodsDemandVos);
 	}
 
@@ -104,11 +105,11 @@ public class AppTbGoodsDemandController {
 
 
 
-	
-	
 
-	
-	
-	
+
+
+
+
+
 
 }

+ 4 - 0
sp-service/level-two-server/src/main/java/com/pj/tb_goods_demand/MethodGoodsDemandService.java

@@ -54,6 +54,8 @@ public class MethodGoodsDemandService {
             Long id = item.getId();
             //查询报价表
             so.put("demandId",id);
+            //报价结果[0=待确认,1=确认,2=拒绝]
+            so.put("quotationResult",1);
             so.put("deleteStatus",DeleteStatus.DELETE_STATUS_ON.getCode());
             List<TbDemandQuotation> tbDemandQuotations = tbDemandQuotationMapper.getList(so);
             if(tbDemandQuotations.size() == 0)return;
@@ -71,6 +73,8 @@ public class MethodGoodsDemandService {
             goodsDemandVo.setCreateTime(tbDemandQuotation.getCreateTime());
             goodsDemandVo.setQuotation(tbDemandQuotation.getQuotation());
             goodsDemandVo.setRemark(tbDemandQuotation.getRemark());
+            goodsDemandVo.setGoodsQuantity(item.getGoodsQuantity());
+            goodsDemandVo.setGoodsDemandTime(item.getCreateTime());
             //执行添加
             resultList.add(goodsDemandVo);
 

+ 16 - 17
sp-service/level-two-server/src/main/java/com/pj/tb_goods_demand/TbGoodsDemandService.java

@@ -21,7 +21,7 @@ import com.pj.utils.sg.*;
 
 /**
  * Service: tb_goods_demand -- 二级收购商需求发布表
- * @author yzs 
+ * @author yzs
  */
 @Service
 @Transactional(rollbackFor = Exception.class)
@@ -79,31 +79,30 @@ public class TbGoodsDemandService extends ServiceImpl<TbGoodsDemandMapper, TbGoo
 	}
 
 	/** app端:专供给二级市场查看的需求列表 */
-	List<TbGoodsDemand> getAppList(SoMap so,Integer isOrders) {
-		so.put("isOrders",isOrders);
-		so.put("sortType",10); //根据日期降序
+	List<TbGoodsDemand> getAppList(SoMap so) {
+		//获取并判断当前登陆人
+		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
+		if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
+			throw new ServiceException("当前登录账号信息已失效!");
+		//获取当前收购商发布的需求
+		so.put("purchaserId",appLoginInfo.getFk());
+		so.put("sortType",10); //根据创建日期降序
 		so.put("deleteStatus", DeleteStatus.DELETE_STATUS_ON.getCode()); // 状态可用
-		return tbGoodsDemandMapper.getList(so);	
+		return tbGoodsDemandMapper.getList(so);
 	}
 
 	/**
-	 * 二级收购商查看当前已被报价的需求列表
-	 * @param isOrders
+	 * 二级收购商查看需求发布列表(包括报价信息)
 	 * @return
 	 */
-	public List<GoodsDemandVo> goodsDemandList(SoMap so,Integer isOrders){
-		//获取并判断当前登陆人
-		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
-		if(appLoginInfo == null || appLoginInfo.getLoginId() == null)
-			throw new ServiceException("当前登录账号信息已失效!");
-		//匹配已被报价的列表
-		so.put("purchaserId",appLoginInfo.getFk());
-		if(isOrders != null) so.put("isOrders",isOrders);
+	public GoodsDemandVo goodsDemandList(SoMap so){
 		so.put("deleteStatus",DeleteStatus.DELETE_STATUS_ON.getCode());
 		List<TbGoodsDemand> goodsDemandMapperList = tbGoodsDemandMapper.getList(so);
-		if(goodsDemandMapperList.size() != 0){
+
+		//匹配已被报价的列表
+		if(goodsDemandMapperList.size() > 0){
 			List<GoodsDemandVo> goodsDemandVos = methodGoodsDemandService.setGoodsDemandVo(goodsDemandMapperList,so);
-			return goodsDemandVos;
+			if(goodsDemandVos.size() > 0) return goodsDemandVos.get(0);
 		}
 		return null;
 	}

+ 15 - 0
sp-service/level-two-server/src/main/java/com/pj/tb_goods_demand/vo/GoodsDemandVo.java

@@ -58,4 +58,19 @@ public class GoodsDemandVo {
      */
     private String remark;
 
+    /**
+     * 是否被接单[0=待接单,1=已被接单]
+     */
+    private Integer isOrders;
+
+    /**
+     * 商品量(根据海关允许发布表的计量单位决定,例如:柜,KG,吨)
+     */
+    private String goodsQuantity;
+
+    /**
+     * 商品发布时间
+     */
+    private Date goodsDemandTime;
+
 }