Browse Source

新增收购商采购需求管理

李书文 1 year ago
parent
commit
9982a01309

+ 1 - 1
sp-service/level-one-server/src/main/java/com/pj/tb_goods/TbGoodsMapper.xml

@@ -23,7 +23,7 @@
 		<include refid="select_sql"></include>
 		<where>
 			<if test=' this.has("id") '> and id = #{id} </if>
-			<if test=' this.has("name") '> and name = #{name} </if>
+			<if test=' this.has("name") '> and name like concat('%', #{name}, '%')</if>
 			<if test=' this.has("typeIds") '> and type_ids = #{typeIds} </if>
 			<if test=' this.has("typeNames") '> and type_names = #{typeNames} </if>
 			<if test=' this.has("code") '> and code = #{code} </if>

+ 9 - 12
sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/GoodsTransitAppController.java

@@ -50,7 +50,6 @@ public class GoodsTransitAppController {
      * 查集合 - 根据自己的互市区ID查询对应互市区的商品
      */
     @RequestMapping("getTransitList")
-//		@SaCheckPermission(TbGoodsTransit.PERMISSION_CODE)
     public AjaxJson getTransitList() {
         SoMap so = SoMap.getRequestSoMap();
         List<TbGoodsTransit> list = tbGoodsTransitService.getAppList(so.startPage());
@@ -83,27 +82,28 @@ public class GoodsTransitAppController {
      * 改
      */
     @RequestMapping("update")
-//	@SaCheckPermission(TbGoodsTransit.PERMISSION_CODE_EDIT)
     public AjaxJson update(TbGoodsTransit t) {
         tbGoodsTransitService.update(t);
         return AjaxJson.getSuccess();
     }
 
-    /** 改    enterprise_confirm:'商铺确认情况[0=待确认,1=已确认,2=拒绝]',*/
+    /**
+     * 改    enterprise_confirm:'商铺确认情况[0=待确认,1=已确认,2=拒绝]',
+     */
     @RequestMapping("updateEnterpriseConfirm")
 //	@SaCheckPermission(TbGoodsTransit.PERMISSION_CODE_EDIT)
-    public AjaxJson updateEnterpriseConfirm(Long id,Integer enterpriseConfirm) {
+    public AjaxJson updateEnterpriseConfirm(Long id, Integer enterpriseConfirm) {
         TbGoodsTransit t = new TbGoodsTransit();
         t.setId(id);
         t.setEnterpriseConfirm(enterpriseConfirm);
         // 商户拒绝接单后把订单状态恢复为未被下单
-        if(2 == enterpriseConfirm) {
+        if (2 == enterpriseConfirm) {
             t.setIsOrders(0);
         }
         tbGoodsTransitService.update(t);
 
         // 商户确认接单后修改订单表的‘商家确认状态’为已确认
-        if(1 == enterpriseConfirm) {
+        if (1 == enterpriseConfirm) {
             LambdaUpdateWrapper<TbOrder> wrapper = new LambdaUpdateWrapper();
             //一级市场商户确认(0=待确认,1=是,2=否)
             wrapper.set(TbOrder::getEnterpriseConfirm, 1);
@@ -120,12 +120,9 @@ public class GoodsTransitAppController {
     /**
      * app端用户添加商品
      */
-    @RequestMapping("transactionGoods")
-//    @SaCheckPermission(TbGoodsTransit.PERMISSION_CODE_ADD)
-    public AjaxJson transactionGoods(TransactionGoodsParam t) {
-        boolean goods = tbGoodsTransitService.transactionGoods(t);
-        if (goods) return AjaxJson.getSuccess("商品添加成功!");
-        return AjaxJson.getError("商品添加失败!");
+    @RequestMapping("add")
+    public AjaxJson add(TransactionGoodsParam t) {
+        return AjaxJson.toAjax(tbGoodsTransitService.transactionGoods(t));
     }
 
     /**

+ 0 - 1
sp-service/level-one-server/src/main/java/com/pj/tb_goods_transit/TbGoodsTransitService.java

@@ -120,7 +120,6 @@ public class TbGoodsTransitService extends ServiceImpl<TbGoodsTransitMapper, TbG
 		//添加互市区条件
 		so.put("tradeAreaId",appLoginInfo.getTradeAreaId()); // 根据边民的所在互市区匹配其能查看的商品
 		so.put("merchantId", appLoginInfo.getFk()); // 外键
-		so.put("goodsStatus",GoodsStatus.GOODS_STATUS_ON.getCode()); // 商品上架
 		so.put("isOrders",0); // 未被下单
 		so.set("auditStatus",AuditStatus.AUDIT_STATUS_ON.getCode()); // 审核通过
 		so.put("deleteStatus", DeleteStatus.DELETE_STATUS_ON.getCode()); // 未被逻辑删除

+ 27 - 27
sp-service/level-one-server/src/main/java/com/pj/tb_trade_area/TbTradeAreaMapper.xml

@@ -36,33 +36,33 @@
 	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
 	<select id="getList" resultMap="model">
 		<include refid="select_sql"></include>
-<!--		<where>-->
-<!--			<if test=' this.has("id") '> and id = #{id} </if>-->
-<!--			<if test=' this.has("name") '> and name = #{name} </if>-->
-<!--			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>-->
-<!--			<if test=' this.has("detailAddress") '> and detail_address = #{detailAddress} </if>-->
-<!--			<if test=' this.has("address") '> and address = #{address} </if>-->
-<!--			<if test=' this.has("createBy") '> and create_by = #{createBy} </if>-->
-<!--			<if test=' this.has("createName") '> and create_name = #{createName} </if>-->
-<!--			<if test=' this.has("updateBy") '> and update_by = #{updateBy} </if>-->
-<!--			<if test=' this.has("updateName") '> and update_name = #{updateName} </if>-->
-<!--			<if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>-->
-<!--		</where>-->
-<!--		order by-->
-<!--		<choose>-->
-<!--			<when test='sortType == 1'> id desc </when>-->
-<!--			<when test='sortType == 2'> name desc </when>-->
-<!--			<when test='sortType == 3'> address_ids desc </when>-->
-<!--			<when test='sortType == 4'> detail_address desc </when>-->
-<!--			<when test='sortType == 5'> address desc </when>-->
-<!--			<when test='sortType == 6'> create_time desc </when>-->
-<!--			<when test='sortType == 7'> create_by desc </when>-->
-<!--			<when test='sortType == 8'> create_name desc </when>-->
-<!--			<when test='sortType == 9'> update_by desc </when>-->
-<!--			<when test='sortType == 10'> update_name desc </when>-->
-<!--			<when test='sortType == 11'> update_time desc </when>-->
-<!--			<otherwise> id desc </otherwise>-->
-<!--		</choose>-->
+		<where>
+			<if test=' this.has("id") '> and id = #{id} </if>
+			<if test=' this.has("name") '> and name like concat('%', #{name}, '%') </if>
+			<if test=' this.has("addressIds") '> and address_ids = #{addressIds} </if>
+			<if test=' this.has("detailAddress") '> and detail_address = #{detailAddress} </if>
+			<if test=' this.has("address") '> and address = #{address} </if>
+			<if test=' this.has("createBy") '> and create_by = #{createBy} </if>
+			<if test=' this.has("createName") '> and create_name = #{createName} </if>
+			<if test=' this.has("updateBy") '> and update_by = #{updateBy} </if>
+			<if test=' this.has("updateName") '> and update_name = #{updateName} </if>
+			<if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> name desc </when>
+			<when test='sortType == 3'> address_ids desc </when>
+			<when test='sortType == 4'> detail_address desc </when>
+			<when test='sortType == 5'> address desc </when>
+			<when test='sortType == 6'> create_time desc </when>
+			<when test='sortType == 7'> create_by desc </when>
+			<when test='sortType == 8'> create_name desc </when>
+			<when test='sortType == 9'> update_by desc </when>
+			<when test='sortType == 10'> update_name desc </when>
+			<when test='sortType == 11'> update_time desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
 	</select>
 	
 	

+ 13 - 2
sp-service/level-two-server/src/main/java/com/pj/tb_goods_demand/TbGoodsDemand.java

@@ -10,6 +10,7 @@ import lombok.EqualsAndHashCode;
 
 import lombok.Data;
 import lombok.experimental.Accessors;
+import org.springframework.format.annotation.DateTimeFormat;
 
 /**
  * Model: tb_goods_demand -- 二级收购商需求发布表
@@ -114,6 +115,7 @@ public class TbGoodsDemand extends Model<TbGoodsDemand> implements Serializable
 	 * 到货时间
 	 */
 	@JsonFormat(pattern = "yyyy-MM-dd")
+	@DateTimeFormat(pattern = "yyyy-MM-dd")
 	private Date arrivalTime;
 
 
@@ -158,10 +160,19 @@ public class TbGoodsDemand extends Model<TbGoodsDemand> implements Serializable
 	private String isRelease;
 
 	/**
-	 * 收购商地址
+	 * 收地址
 	 */
-	private Long addressId;
+	private String addressName;
 
+	/**
+	 * 联系电话
+	 */
+	private String phone;
+
+	/**
+	 * 收件人姓名
+	 */
+	private String name;
 
 
 }

+ 5 - 0
sp-service/level-two-server/src/main/java/com/pj/tb_purchaser_address/PurchaserAddressAppController.java

@@ -42,6 +42,11 @@ public class PurchaserAddressAppController {
         return AjaxJson.getSuccessData(service.getById(id));
     }
 
+    @GetMapping("getByUserId")
+    public AjaxJson getByUserId(@PathVariable Long id) {
+        return AjaxJson.getSuccessData(service.getById(id));
+    }
+
     /**
      * 删除
      */