From 783f0a3125ad9500ff55e6e352dca4da7e8f8c7b Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: 星期日, 19 六月 2022 10:41:57 +0800
Subject: [PATCH] 优化广告调整为cmd 模式
---
java110-interface/src/main/java/com/java110/intf/common/IAdvertV1InnerServiceSMO.java | 68 ++
service-common/src/main/java/com/java110/common/dao/IAdvertItemV1ServiceDao.java | 77 ++
service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertPhotoCmd.java | 63 -
service-common/src/main/java/com/java110/common/cmd/advert/DeleteAdvertCmd.java | 69 ++
java110-core/src/main/java/com/java110/core/event/cmd/ServiceCmdListener.java | 8
java110-interface/src/main/java/com/java110/intf/common/IAdvertItemV1InnerServiceSMO.java | 68 ++
service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertCmd.java | 81 ++
pom.xml | 2
java110-db/src/main/resources/mapper/common/AdvertItemV1ServiceDaoImplMapper.xml | 115 +++
service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertsCmd.java | 90 --
/dev/null | 101 ---
service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertItemsCmd.java | 101 +++
service-common/src/main/java/com/java110/common/cmd/advert/SaveAdvertCmd.java | 118 ++-
service-common/src/main/java/com/java110/common/dao/impl/AdvertItemV1ServiceDaoImpl.java | 112 +++
service-common/src/main/java/com/java110/common/dao/impl/AdvertV1ServiceDaoImpl.java | 112 +++
java110-bean/src/main/java/com/java110/po/advert/AdvertItemPo.java | 9
java110-db/src/main/resources/mapper/common/AdvertV1ServiceDaoImplMapper.xml | 186 +++++
service-common/src/main/java/com/java110/common/cmd/advert/UpdateAdvertCmd.java | 136 ++--
service-common/src/main/java/com/java110/common/dao/IAdvertV1ServiceDao.java | 77 ++
service-common/src/main/java/com/java110/common/smo/impl/AdvertItemV1InnerServiceSMOImpl.java | 89 ++
java110-bean/src/main/java/com/java110/po/advert/AdvertPo.java | 9
service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertPhotoAndVediosCmd.java | 107 --
service-common/src/main/java/com/java110/common/smo/impl/AdvertV1InnerServiceSMOImpl.java | 89 ++
23 files changed, 1,459 insertions(+), 428 deletions(-)
diff --git a/java110-bean/src/main/java/com/java110/po/advert/AdvertItemPo.java b/java110-bean/src/main/java/com/java110/po/advert/AdvertItemPo.java
index c0fc2e0..3b7ce89 100755
--- a/java110-bean/src/main/java/com/java110/po/advert/AdvertItemPo.java
+++ b/java110-bean/src/main/java/com/java110/po/advert/AdvertItemPo.java
@@ -19,6 +19,7 @@
private String url;
private String communityId;
private String seq;
+ private String statusCd="0";
public String getAdvertItemId() {
@@ -68,4 +69,12 @@
public void setSeq(String seq) {
this.seq = seq;
}
+
+ public String getStatusCd() {
+ return statusCd;
+ }
+
+ public void setStatusCd(String statusCd) {
+ this.statusCd = statusCd;
+ }
}
diff --git a/java110-bean/src/main/java/com/java110/po/advert/AdvertPo.java b/java110-bean/src/main/java/com/java110/po/advert/AdvertPo.java
index 0a6eafa..856f2d4 100755
--- a/java110-bean/src/main/java/com/java110/po/advert/AdvertPo.java
+++ b/java110-bean/src/main/java/com/java110/po/advert/AdvertPo.java
@@ -27,6 +27,7 @@
private String viewType;
private String advertType ;
private String pageUrl ;
+ private String statusCd = "0";
public String getAdvertId() {
return advertId;
@@ -147,4 +148,12 @@
public void setPageUrl(String pageUrl) {
this.pageUrl = pageUrl;
}
+
+ public String getStatusCd() {
+ return statusCd;
+ }
+
+ public void setStatusCd(String statusCd) {
+ this.statusCd = statusCd;
+ }
}
diff --git a/java110-core/src/main/java/com/java110/core/event/cmd/ServiceCmdListener.java b/java110-core/src/main/java/com/java110/core/event/cmd/ServiceCmdListener.java
index eeed022..d4e08c0 100644
--- a/java110-core/src/main/java/com/java110/core/event/cmd/ServiceCmdListener.java
+++ b/java110-core/src/main/java/com/java110/core/event/cmd/ServiceCmdListener.java
@@ -18,17 +18,17 @@
* 鏁版嵁鏍煎紡鏍¢獙鏂规硶
*
* @param event 浜嬩欢瀵硅薄
- * @param cmdDataFlowContext 璇锋眰鎶ユ枃鏁版嵁
+ * @param context 璇锋眰鎶ユ枃鏁版嵁
*/
- void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException;
+ void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException;
/**
* 鎵ц鎸囦护
*
* @param event 浜嬩欢瀵硅薄
- * @param cmdDataFlowContext 鏁版嵁涓婃枃瀵硅薄
+ * @param context 鏁版嵁涓婃枃瀵硅薄
* @param reqJson 璇锋眰鎶ユ枃
*/
- void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException;
+ void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException;
}
diff --git a/java110-db/src/main/resources/mapper/common/AdvertItemV1ServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/common/AdvertItemV1ServiceDaoImplMapper.xml
new file mode 100644
index 0000000..c5ccdb6
--- /dev/null
+++ b/java110-db/src/main/resources/mapper/common/AdvertItemV1ServiceDaoImplMapper.xml
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="advertItemV1ServiceDaoImpl">
+
+
+
+
+
+ <!-- 淇濆瓨骞垮憡鍐呭淇℃伅 add by wuxw 2018-07-03 -->
+ <insert id="saveAdvertItemInfo" parameterType="Map">
+ insert into advert_item(
+item_type_cd,community_id,advert_item_id,advert_id,url,seq
+) values (
+#{itemTypeCd},#{communityId},#{advertItemId},#{advertId},#{url},#{seq}
+)
+ </insert>
+
+
+
+ <!-- 鏌ヨ骞垮憡鍐呭淇℃伅 add by wuxw 2018-07-03 -->
+ <select id="getAdvertItemInfo" parameterType="Map" resultType="Map">
+ select t.item_type_cd,t.item_type_cd itemTypeCd,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.advert_item_id,t.advert_item_id advertItemId,t.advert_id,t.advert_id advertId,t.url,t.seq
+from advert_item t
+where 1 =1
+<if test="itemTypeCd !=null and itemTypeCd != ''">
+ and t.item_type_cd= #{itemTypeCd}
+</if>
+<if test="statusCd !=null and statusCd != ''">
+ and t.status_cd= #{statusCd}
+</if>
+<if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+</if>
+<if test="advertItemId !=null and advertItemId != ''">
+ and t.advert_item_id= #{advertItemId}
+</if>
+<if test="advertId !=null and advertId != ''">
+ and t.advert_id= #{advertId}
+</if>
+<if test="url !=null and url != ''">
+ and t.url= #{url}
+</if>
+<if test="seq !=null and seq != ''">
+ and t.seq= #{seq}
+</if>
+order by t.create_time desc
+<if test="page != -1 and page != null ">
+ limit #{page}, #{row}
+</if>
+
+ </select>
+
+
+
+
+ <!-- 淇敼骞垮憡鍐呭淇℃伅 add by wuxw 2018-07-03 -->
+ <update id="updateAdvertItemInfo" parameterType="Map">
+ update advert_item t set t.status_cd = #{statusCd}
+<if test="newBId != null and newBId != ''">
+,t.b_id = #{newBId}
+</if>
+<if test="itemTypeCd !=null and itemTypeCd != ''">
+, t.item_type_cd= #{itemTypeCd}
+</if>
+<if test="communityId !=null and communityId != ''">
+, t.community_id= #{communityId}
+</if>
+<if test="advertId !=null and advertId != ''">
+, t.advert_id= #{advertId}
+</if>
+<if test="url !=null and url != ''">
+, t.url= #{url}
+</if>
+<if test="seq !=null and seq != ''">
+, t.seq= #{seq}
+</if>
+ where 1=1 <if test="advertItemId !=null and advertItemId != ''">
+and t.advert_item_id= #{advertItemId}
+</if>
+
+ </update>
+
+ <!-- 鏌ヨ骞垮憡鍐呭鏁伴噺 add by wuxw 2018-07-03 -->
+ <select id="queryAdvertItemsCount" parameterType="Map" resultType="Map">
+ select count(1) count
+from advert_item t
+where 1 =1
+<if test="itemTypeCd !=null and itemTypeCd != ''">
+ and t.item_type_cd= #{itemTypeCd}
+</if>
+<if test="statusCd !=null and statusCd != ''">
+ and t.status_cd= #{statusCd}
+</if>
+<if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+</if>
+<if test="advertItemId !=null and advertItemId != ''">
+ and t.advert_item_id= #{advertItemId}
+</if>
+<if test="advertId !=null and advertId != ''">
+ and t.advert_id= #{advertId}
+</if>
+<if test="url !=null and url != ''">
+ and t.url= #{url}
+</if>
+<if test="seq !=null and seq != ''">
+ and t.seq= #{seq}
+</if>
+
+
+ </select>
+
+</mapper>
diff --git a/java110-db/src/main/resources/mapper/common/AdvertV1ServiceDaoImplMapper.xml b/java110-db/src/main/resources/mapper/common/AdvertV1ServiceDaoImplMapper.xml
new file mode 100644
index 0000000..e4c97dd
--- /dev/null
+++ b/java110-db/src/main/resources/mapper/common/AdvertV1ServiceDaoImplMapper.xml
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+ "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="advertV1ServiceDaoImpl">
+
+
+ <!-- 淇濆瓨骞垮憡淇℃伅 add by wuxw 2018-07-03 -->
+ <insert id="saveAdvertInfo" parameterType="Map">
+ insert into advert(
+ classify,ad_name,location_type_cd,ad_type_cd,advert_type,advert_id,view_type,start_time,page_url,state,end_time,community_id,location_obj_id,seq
+ ) values (
+ #{classify},#{adName},#{locationTypeCd},#{adTypeCd},#{advertType},#{advertId},#{viewType},#{startTime},#{pageUrl},#{state},#{endTime},#{communityId},#{locationObjId},#{seq}
+ )
+ </insert>
+
+
+ <!-- 鏌ヨ骞垮憡淇℃伅 add by wuxw 2018-07-03 -->
+ <select id="getAdvertInfo" parameterType="Map" resultType="Map">
+ select t.classify,t.ad_name,t.ad_name adName,t.location_type_cd,t.location_type_cd
+ locationTypeCd,t.status_cd,t.status_cd statusCd,t.ad_type_cd,t.ad_type_cd adTypeCd,t.advert_type,t.advert_type
+ advertType,t.advert_id,t.advert_id advertId,t.view_type,t.view_type viewType,t.start_time,t.start_time
+ startTime,t.page_url,t.page_url pageUrl,t.state,t.end_time,t.end_time endTime,t.community_id,t.community_id
+ communityId,t.location_obj_id,t.location_obj_id locationObjId,t.seq
+ from advert t
+ where 1 =1
+ <if test="classify !=null and classify != ''">
+ and t.classify= #{classify}
+ </if>
+ <if test="adName !=null and adName != ''">
+ and t.ad_name= #{adName}
+ </if>
+ <if test="locationTypeCd !=null and locationTypeCd != ''">
+ and t.location_type_cd= #{locationTypeCd}
+ </if>
+ <if test="statusCd !=null and statusCd != ''">
+ and t.status_cd= #{statusCd}
+ </if>
+ <if test="adTypeCd !=null and adTypeCd != ''">
+ and t.ad_type_cd= #{adTypeCd}
+ </if>
+ <if test="advertType !=null and advertType != ''">
+ and t.advert_type= #{advertType}
+ </if>
+ <if test="advertId !=null and advertId != ''">
+ and t.advert_id= #{advertId}
+ </if>
+ <if test="viewType !=null and viewType != ''">
+ and t.view_type= #{viewType}
+ </if>
+ <if test="startTime !=null and startTime != ''">
+ and t.start_time= #{startTime}
+ </if>
+ <if test="pageUrl !=null and pageUrl != ''">
+ and t.page_url= #{pageUrl}
+ </if>
+ <if test="state !=null and state != ''">
+ and t.state= #{state}
+ </if>
+ <if test="endTime !=null and endTime != ''">
+ and t.end_time= #{endTime}
+ </if>
+ <if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+ </if>
+ <if test="locationObjId !=null and locationObjId != ''">
+ and t.location_obj_id= #{locationObjId}
+ </if>
+ <if test="seq !=null and seq != ''">
+ and t.seq= #{seq}
+ </if>
+ order by t.create_time desc
+ <if test="page != -1 and page != null ">
+ limit #{page}, #{row}
+ </if>
+
+ </select>
+
+
+ <!-- 淇敼骞垮憡淇℃伅 add by wuxw 2018-07-03 -->
+ <update id="updateAdvertInfo" parameterType="Map">
+ update advert t set t.status_cd = #{statusCd}
+ <if test="newBId != null and newBId != ''">
+ ,t.b_id = #{newBId}
+ </if>
+ <if test="classify !=null and classify != ''">
+ , t.classify= #{classify}
+ </if>
+ <if test="adName !=null and adName != ''">
+ , t.ad_name= #{adName}
+ </if>
+ <if test="locationTypeCd !=null and locationTypeCd != ''">
+ , t.location_type_cd= #{locationTypeCd}
+ </if>
+ <if test="adTypeCd !=null and adTypeCd != ''">
+ , t.ad_type_cd= #{adTypeCd}
+ </if>
+ <if test="advertType !=null and advertType != ''">
+ , t.advert_type= #{advertType}
+ </if>
+ <if test="viewType !=null and viewType != ''">
+ , t.view_type= #{viewType}
+ </if>
+ <if test="startTime !=null and startTime != ''">
+ , t.start_time= #{startTime}
+ </if>
+ <if test="pageUrl !=null and pageUrl != ''">
+ , t.page_url= #{pageUrl}
+ </if>
+ <if test="state !=null and state != ''">
+ , t.state= #{state}
+ </if>
+ <if test="endTime !=null and endTime != ''">
+ , t.end_time= #{endTime}
+ </if>
+ <if test="communityId !=null and communityId != ''">
+ , t.community_id= #{communityId}
+ </if>
+ <if test="locationObjId !=null and locationObjId != ''">
+ , t.location_obj_id= #{locationObjId}
+ </if>
+ <if test="seq !=null and seq != ''">
+ , t.seq= #{seq}
+ </if>
+ where 1=1
+ <if test="advertId !=null and advertId != ''">
+ and t.advert_id= #{advertId}
+ </if>
+
+ </update>
+
+ <!-- 鏌ヨ骞垮憡鏁伴噺 add by wuxw 2018-07-03 -->
+ <select id="queryAdvertsCount" parameterType="Map" resultType="Map">
+ select count(1) count
+ from advert t
+ where 1 =1
+ <if test="classify !=null and classify != ''">
+ and t.classify= #{classify}
+ </if>
+ <if test="adName !=null and adName != ''">
+ and t.ad_name= #{adName}
+ </if>
+ <if test="locationTypeCd !=null and locationTypeCd != ''">
+ and t.location_type_cd= #{locationTypeCd}
+ </if>
+ <if test="statusCd !=null and statusCd != ''">
+ and t.status_cd= #{statusCd}
+ </if>
+ <if test="adTypeCd !=null and adTypeCd != ''">
+ and t.ad_type_cd= #{adTypeCd}
+ </if>
+ <if test="advertType !=null and advertType != ''">
+ and t.advert_type= #{advertType}
+ </if>
+ <if test="advertId !=null and advertId != ''">
+ and t.advert_id= #{advertId}
+ </if>
+ <if test="viewType !=null and viewType != ''">
+ and t.view_type= #{viewType}
+ </if>
+ <if test="startTime !=null and startTime != ''">
+ and t.start_time= #{startTime}
+ </if>
+ <if test="pageUrl !=null and pageUrl != ''">
+ and t.page_url= #{pageUrl}
+ </if>
+ <if test="state !=null and state != ''">
+ and t.state= #{state}
+ </if>
+ <if test="endTime !=null and endTime != ''">
+ and t.end_time= #{endTime}
+ </if>
+ <if test="communityId !=null and communityId != ''">
+ and t.community_id= #{communityId}
+ </if>
+ <if test="locationObjId !=null and locationObjId != ''">
+ and t.location_obj_id= #{locationObjId}
+ </if>
+ <if test="seq !=null and seq != ''">
+ and t.seq= #{seq}
+ </if>
+
+
+ </select>
+
+</mapper>
diff --git a/java110-interface/src/main/java/com/java110/intf/common/IAdvertItemV1InnerServiceSMO.java b/java110-interface/src/main/java/com/java110/intf/common/IAdvertItemV1InnerServiceSMO.java
new file mode 100644
index 0000000..49e5ed4
--- /dev/null
+++ b/java110-interface/src/main/java/com/java110/intf/common/IAdvertItemV1InnerServiceSMO.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2017-2020 鍚村鏂� and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.intf.common;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.advert.AdvertItemDto;
+import com.java110.po.advert.AdvertItemPo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * 绫昏〃杩帮細 鏈嶅姟涔嬪墠璋冪敤鐨勬帴鍙g被锛屼笉瀵瑰鎻愪緵鎺ュ彛鑳藉姏 鍙敤浜庢帴鍙e缓璋冪敤
+ * add by 鍚村鏂� at 2022-06-19 10:12:15 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 瀹樼綉锛歨ttp://www.homecommunity.cn
+ * 娓╅Θ鎻愮ず锛氬鏋滄偍瀵规鏂囦欢杩涜淇敼 璇蜂笉瑕佸垹闄ゅ師鏈変綔鑰呭強娉ㄩ噴淇℃伅锛岃琛ュ厖鎮ㄧ殑 淇敼鐨勫師鍥犱互鍙婅仈绯婚偖绠卞涓�
+ * // modify by 寮犱笁 at 2021-09-12 绗�10琛屽湪鏌愮鍦烘櫙涓嬪瓨鍦ㄦ煇绉峛ug 闇�瑕佷慨澶嶏紝娉ㄩ噴10鑷�20琛� 鍔犲叆 20琛岃嚦30琛�
+ */
+@FeignClient(name = "common-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/advertItemV1Api")
+public interface IAdvertItemV1InnerServiceSMO {
+
+
+ @RequestMapping(value = "/saveAdvertItem", method = RequestMethod.POST)
+ public int saveAdvertItem(@RequestBody AdvertItemPo advertItemPo);
+
+ @RequestMapping(value = "/updateAdvertItem", method = RequestMethod.POST)
+ public int updateAdvertItem(@RequestBody AdvertItemPo advertItemPo);
+
+ @RequestMapping(value = "/deleteAdvertItem", method = RequestMethod.POST)
+ public int deleteAdvertItem(@RequestBody AdvertItemPo advertItemPo);
+
+ /**
+ * <p>鏌ヨ灏忓尯妤间俊鎭�</p>
+ *
+ *
+ * @param advertItemDto 鏁版嵁瀵硅薄鍒嗕韩
+ * @return AdvertItemDto 瀵硅薄鏁版嵁
+ */
+ @RequestMapping(value = "/queryAdvertItems", method = RequestMethod.POST)
+ List<AdvertItemDto> queryAdvertItems(@RequestBody AdvertItemDto advertItemDto);
+
+ /**
+ * 鏌ヨ<p>灏忓尯妤�</p>鎬昏褰曟暟
+ *
+ * @param advertItemDto 鏁版嵁瀵硅薄鍒嗕韩
+ * @return 灏忓尯涓嬬殑灏忓尯妤艰褰曟暟
+ */
+ @RequestMapping(value = "/queryAdvertItemsCount", method = RequestMethod.POST)
+ int queryAdvertItemsCount(@RequestBody AdvertItemDto advertItemDto);
+}
diff --git a/java110-interface/src/main/java/com/java110/intf/common/IAdvertV1InnerServiceSMO.java b/java110-interface/src/main/java/com/java110/intf/common/IAdvertV1InnerServiceSMO.java
new file mode 100644
index 0000000..b54c6d3
--- /dev/null
+++ b/java110-interface/src/main/java/com/java110/intf/common/IAdvertV1InnerServiceSMO.java
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2017-2020 鍚村鏂� and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.intf.common;
+
+import com.java110.config.feign.FeignConfiguration;
+import com.java110.dto.advert.AdvertDto;
+import com.java110.po.advert.AdvertPo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+
+import java.util.List;
+
+/**
+ * 绫昏〃杩帮細 鏈嶅姟涔嬪墠璋冪敤鐨勬帴鍙g被锛屼笉瀵瑰鎻愪緵鎺ュ彛鑳藉姏 鍙敤浜庢帴鍙e缓璋冪敤
+ * add by 鍚村鏂� at 2022-06-19 10:07:43 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 瀹樼綉锛歨ttp://www.homecommunity.cn
+ * 娓╅Θ鎻愮ず锛氬鏋滄偍瀵规鏂囦欢杩涜淇敼 璇蜂笉瑕佸垹闄ゅ師鏈変綔鑰呭強娉ㄩ噴淇℃伅锛岃琛ュ厖鎮ㄧ殑 淇敼鐨勫師鍥犱互鍙婅仈绯婚偖绠卞涓�
+ * // modify by 寮犱笁 at 2021-09-12 绗�10琛屽湪鏌愮鍦烘櫙涓嬪瓨鍦ㄦ煇绉峛ug 闇�瑕佷慨澶嶏紝娉ㄩ噴10鑷�20琛� 鍔犲叆 20琛岃嚦30琛�
+ */
+@FeignClient(name = "common-service", configuration = {FeignConfiguration.class})
+@RequestMapping("/advertV1Api")
+public interface IAdvertV1InnerServiceSMO {
+
+
+ @RequestMapping(value = "/saveAdvert", method = RequestMethod.POST)
+ public int saveAdvert(@RequestBody AdvertPo advertPo);
+
+ @RequestMapping(value = "/updateAdvert", method = RequestMethod.POST)
+ public int updateAdvert(@RequestBody AdvertPo advertPo);
+
+ @RequestMapping(value = "/deleteAdvert", method = RequestMethod.POST)
+ public int deleteAdvert(@RequestBody AdvertPo advertPo);
+
+ /**
+ * <p>鏌ヨ灏忓尯妤间俊鎭�</p>
+ *
+ *
+ * @param advertDto 鏁版嵁瀵硅薄鍒嗕韩
+ * @return AdvertDto 瀵硅薄鏁版嵁
+ */
+ @RequestMapping(value = "/queryAdverts", method = RequestMethod.POST)
+ List<AdvertDto> queryAdverts(@RequestBody AdvertDto advertDto);
+
+ /**
+ * 鏌ヨ<p>灏忓尯妤�</p>鎬昏褰曟暟
+ *
+ * @param advertDto 鏁版嵁瀵硅薄鍒嗕韩
+ * @return 灏忓尯涓嬬殑灏忓尯妤艰褰曟暟
+ */
+ @RequestMapping(value = "/queryAdvertsCount", method = RequestMethod.POST)
+ int queryAdvertsCount(@RequestBody AdvertDto advertDto);
+}
diff --git a/pom.xml b/pom.xml
index 9a0f5db..defc01f 100755
--- a/pom.xml
+++ b/pom.xml
@@ -99,7 +99,7 @@
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
- <version>1.2.79</version>
+ <version>1.2.83</version>
</dependency>
<dependency>
<groupId>org.mybatis.spring.boot</groupId>
diff --git a/service-api/src/main/java/com/java110/api/listener/advert/DeleteAdvertListener.java b/service-api/src/main/java/com/java110/api/listener/advert/DeleteAdvertListener.java
deleted file mode 100755
index 0eaf1ef..0000000
--- a/service-api/src/main/java/com/java110/api/listener/advert/DeleteAdvertListener.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package com.java110.api.listener.advert;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.po.advert.AdvertPo;
-import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ServiceCodeAdvertConstant;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
-import org.springframework.http.HttpMethod;
-
-/**
- * 淇濆瓨灏忓尯渚﹀惉
- * add by wuxw 2019-06-30
- */
-@Java110Listener("deleteAdvertListener")
-public class DeleteAdvertListener extends AbstractServiceApiPlusListener {
-
-
- @Override
- protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
- //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
-
- Assert.hasKeyAndValue(reqJson, "advertId", "骞垮憡ID涓嶈兘涓虹┖");
-
- }
-
- @Override
- protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
- AdvertPo advertPo = BeanConvertUtil.covertBean(reqJson, AdvertPo.class);
- super.delete(context, advertPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_ADVERT);
- }
-
-
- @Override
- public String getServiceCode() {
- return ServiceCodeAdvertConstant.DELETE_ADVERT;
- }
-
- @Override
- public HttpMethod getHttpMethod() {
- return HttpMethod.POST;
- }
-
- @Override
- public int getOrder() {
- return DEFAULT_ORDER;
- }
-
-
-}
diff --git a/service-api/src/main/java/com/java110/api/listener/advert/ListAdvertItemsListener.java b/service-api/src/main/java/com/java110/api/listener/advert/ListAdvertItemsListener.java
deleted file mode 100755
index c2bbfe9..0000000
--- a/service-api/src/main/java/com/java110/api/listener/advert/ListAdvertItemsListener.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package com.java110.api.listener.advert;
-
-import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.intf.common.IAdvertItemInnerServiceSMO;
-import com.java110.dto.advert.AdvertItemDto;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeAdvertConstant;
-import com.java110.utils.util.Assert;
-import com.java110.utils.util.BeanConvertUtil;
-import com.java110.vo.api.advert.ApiAdvertItemDataVo;
-import com.java110.vo.api.advert.ApiAdvertItemVo;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-/**
- * 鏌ヨ灏忓尯渚﹀惉绫�
- */
-@Java110Listener("listAdvertItemsListener")
-public class ListAdvertItemsListener extends AbstractServiceApiListener {
-
- @Autowired
- private IAdvertItemInnerServiceSMO advertItemInnerServiceSMOImpl;
-
- @Override
- public String getServiceCode() {
- return ServiceCodeAdvertConstant.LIST_ADVERT_ITEMS;
- }
-
- @Override
- public HttpMethod getHttpMethod() {
- return HttpMethod.GET;
- }
-
-
- @Override
- public int getOrder() {
- return DEFAULT_ORDER;
- }
-
- public IAdvertItemInnerServiceSMO getAdvertItemInnerServiceSMOImpl() {
- return advertItemInnerServiceSMOImpl;
- }
-
- public void setAdvertItemInnerServiceSMOImpl(IAdvertItemInnerServiceSMO advertItemInnerServiceSMOImpl) {
- this.advertItemInnerServiceSMOImpl = advertItemInnerServiceSMOImpl;
- }
-
- @Override
- protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
-
- super.validatePageInfo(reqJson);
-
- Assert.hasKeyAndValue(reqJson, "advertId", "璇锋眰鎶ユ枃涓湭鍖呭惈骞垮憡ID");
- }
-
- @Override
- protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
- AdvertItemDto advertItemDto = BeanConvertUtil.covertBean(reqJson, AdvertItemDto.class);
-
- int count = advertItemInnerServiceSMOImpl.queryAdvertItemsCount(advertItemDto);
-
- List<ApiAdvertItemDataVo> advertItems = null;
-
- if (count > 0) {
- List<AdvertItemDto> advertItemDtos = advertItemInnerServiceSMOImpl.queryAdvertItems(advertItemDto);
- //refreshAdvertUrl(advertItemDtos);
- advertItems = BeanConvertUtil.covertBeanList(advertItemDtos, ApiAdvertItemDataVo.class);
- } else {
- advertItems = new ArrayList<>();
- }
-
- ApiAdvertItemVo apiAdvertItemVo = new ApiAdvertItemVo();
-
- apiAdvertItemVo.setTotal(count);
- apiAdvertItemVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
- apiAdvertItemVo.setAdvertItems(advertItems);
-
- ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiAdvertItemVo), HttpStatus.OK);
-
- context.setResponseEntity(responseEntity);
-
- }
-
- private void refreshAdvertUrl(List<AdvertItemDto> advertItemDtos) {
- for(AdvertItemDto advertItemDto : advertItemDtos){
- if("8888".equals(advertItemDto.getItemTypeCd())){
- advertItemDto.setUrl("/callComponent/download/getFile/file?fileId=" + advertItemDto.getUrl() + "&communityId=" + advertItemDto.getCommunityId());
- }
- }
- }
-}
diff --git a/service-common/src/main/java/com/java110/common/cmd/advert/DeleteAdvertCmd.java b/service-common/src/main/java/com/java110/common/cmd/advert/DeleteAdvertCmd.java
new file mode 100644
index 0000000..a12b3fc
--- /dev/null
+++ b/service-common/src/main/java/com/java110/common/cmd/advert/DeleteAdvertCmd.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2017-2020 鍚村鏂� and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.cmd.advert;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.intf.common.IAdvertV1InnerServiceSMO;
+import com.java110.po.advert.AdvertPo;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * 绫昏〃杩帮細鍒犻櫎
+ * 鏈嶅姟缂栫爜锛歛dvert.deleteAdvert
+ * 璇锋眰璺姴锛�/app/advert.DeleteAdvert
+ * add by 鍚村鏂� at 2022-06-19 10:07:43 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 瀹樼綉锛歨ttp://www.homecommunity.cn
+ * 娓╅Θ鎻愮ず锛氬鏋滄偍瀵规鏂囦欢杩涜淇敼 璇蜂笉瑕佸垹闄ゅ師鏈変綔鑰呭強娉ㄩ噴淇℃伅锛岃琛ュ厖鎮ㄧ殑 淇敼鐨勫師鍥犱互鍙婅仈绯婚偖绠卞涓�
+ * // modify by 寮犱笁 at 2021-09-12 绗�10琛屽湪鏌愮鍦烘櫙涓嬪瓨鍦ㄦ煇绉峛ug 闇�瑕佷慨澶嶏紝娉ㄩ噴10鑷�20琛� 鍔犲叆 20琛岃嚦30琛�
+ */
+@Java110Cmd(serviceCode = "advert.deleteAdvert")
+public class DeleteAdvertCmd extends Cmd {
+ private static Logger logger = LoggerFactory.getLogger(DeleteAdvertCmd.class);
+
+ @Autowired
+ private IAdvertV1InnerServiceSMO advertV1InnerServiceSMOImpl;
+
+ @Override
+ public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+ Assert.hasKeyAndValue(reqJson, "advertId", "advertId涓嶈兘涓虹┖");
+ }
+
+ @Override
+ @Java110Transactional
+ public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+ AdvertPo advertPo = BeanConvertUtil.covertBean(reqJson, AdvertPo.class);
+ int flag = advertV1InnerServiceSMOImpl.deleteAdvert(advertPo);
+
+ if (flag < 1) {
+ throw new CmdException("鍒犻櫎鏁版嵁澶辫触");
+ }
+
+ cmdDataFlowContext.setResponseEntity(ResultVo.success());
+ }
+}
diff --git a/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertCmd.java b/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertCmd.java
new file mode 100644
index 0000000..5af4452
--- /dev/null
+++ b/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertCmd.java
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2017-2020 鍚村鏂� and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.cmd.advert;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.advert.AdvertDto;
+import com.java110.intf.common.IAdvertV1InnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.ResultVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 绫昏〃杩帮細鏌ヨ
+ * 鏈嶅姟缂栫爜锛歛dvert.listAdvert
+ * 璇锋眰璺姴锛�/app/advert.ListAdvert
+ * add by 鍚村鏂� at 2022-06-19 10:07:43 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 瀹樼綉锛歨ttp://www.homecommunity.cn
+ * 娓╅Θ鎻愮ず锛氬鏋滄偍瀵规鏂囦欢杩涜淇敼 璇蜂笉瑕佸垹闄ゅ師鏈変綔鑰呭強娉ㄩ噴淇℃伅锛岃琛ュ厖鎮ㄧ殑 淇敼鐨勫師鍥犱互鍙婅仈绯婚偖绠卞涓�
+ * // modify by 寮犱笁 at 2021-09-12 绗�10琛屽湪鏌愮鍦烘櫙涓嬪瓨鍦ㄦ煇绉峛ug 闇�瑕佷慨澶嶏紝娉ㄩ噴10鑷�20琛� 鍔犲叆 20琛岃嚦30琛�
+ */
+@Java110Cmd(serviceCode = "advert.listAdvert")
+public class ListAdvertCmd extends Cmd {
+
+ private static Logger logger = LoggerFactory.getLogger(ListAdvertCmd.class);
+ @Autowired
+ private IAdvertV1InnerServiceSMO advertV1InnerServiceSMOImpl;
+
+ @Override
+ public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+ super.validatePageInfo(reqJson);
+ }
+
+ @Override
+ public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+ AdvertDto advertDto = BeanConvertUtil.covertBean(reqJson, AdvertDto.class);
+
+ int count = advertV1InnerServiceSMOImpl.queryAdvertsCount(advertDto);
+
+ List<AdvertDto> advertDtos = null;
+
+ if (count > 0) {
+ advertDtos = advertV1InnerServiceSMOImpl.queryAdverts(advertDto);
+ } else {
+ advertDtos = new ArrayList<>();
+ }
+
+ ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) reqJson.getInteger("row")), count, advertDtos);
+
+ ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK);
+
+ cmdDataFlowContext.setResponseEntity(responseEntity);
+ }
+}
diff --git a/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertItemsCmd.java b/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertItemsCmd.java
new file mode 100644
index 0000000..00c565d
--- /dev/null
+++ b/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertItemsCmd.java
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2017-2020 鍚村鏂� and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.cmd.advert;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
+import com.java110.dto.advert.AdvertItemDto;
+import com.java110.intf.common.IAdvertItemInnerServiceSMO;
+import com.java110.utils.exception.CmdException;
+import com.java110.utils.util.Assert;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.vo.api.advert.ApiAdvertItemDataVo;
+import com.java110.vo.api.advert.ApiAdvertItemVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 绫昏〃杩帮細鏌ヨ
+ * 鏈嶅姟缂栫爜锛歛dvertItem.listAdvertItem
+ * 璇锋眰璺姴锛�/app/advertItem.ListAdvertItem
+ * add by 鍚村鏂� at 2022-06-19 10:12:15 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 瀹樼綉锛歨ttp://www.homecommunity.cn
+ * 娓╅Θ鎻愮ず锛氬鏋滄偍瀵规鏂囦欢杩涜淇敼 璇蜂笉瑕佸垹闄ゅ師鏈変綔鑰呭強娉ㄩ噴淇℃伅锛岃琛ュ厖鎮ㄧ殑 淇敼鐨勫師鍥犱互鍙婅仈绯婚偖绠卞涓�
+ * // modify by 寮犱笁 at 2021-09-12 绗�10琛屽湪鏌愮鍦烘櫙涓嬪瓨鍦ㄦ煇绉峛ug 闇�瑕佷慨澶嶏紝娉ㄩ噴10鑷�20琛� 鍔犲叆 20琛岃嚦30琛�
+ */
+@Java110Cmd(serviceCode = "advert.listAdvertItems")
+public class ListAdvertItemsCmd extends Cmd {
+
+ private static Logger logger = LoggerFactory.getLogger(ListAdvertItemsCmd.class);
+ @Autowired
+ private IAdvertItemInnerServiceSMO advertItemInnerServiceSMOImpl;
+
+ @Override
+ public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
+ super.validatePageInfo(reqJson);
+
+ Assert.hasKeyAndValue(reqJson, "advertId", "璇锋眰鎶ユ枃涓湭鍖呭惈骞垮憡ID");
+ }
+
+ @Override
+ public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
+
+ AdvertItemDto advertItemDto = BeanConvertUtil.covertBean(reqJson, AdvertItemDto.class);
+
+ int count = advertItemInnerServiceSMOImpl.queryAdvertItemsCount(advertItemDto);
+
+ List<ApiAdvertItemDataVo> advertItems = null;
+
+ if (count > 0) {
+ List<AdvertItemDto> advertItemDtos = advertItemInnerServiceSMOImpl.queryAdvertItems(advertItemDto);
+ //refreshAdvertUrl(advertItemDtos);
+ advertItems = BeanConvertUtil.covertBeanList(advertItemDtos, ApiAdvertItemDataVo.class);
+ } else {
+ advertItems = new ArrayList<>();
+ }
+
+ ApiAdvertItemVo apiAdvertItemVo = new ApiAdvertItemVo();
+
+ apiAdvertItemVo.setTotal(count);
+ apiAdvertItemVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
+ apiAdvertItemVo.setAdvertItems(advertItems);
+
+ ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiAdvertItemVo), HttpStatus.OK);
+
+ cmdDataFlowContext.setResponseEntity(responseEntity);
+
+ }
+
+ private void refreshAdvertUrl(List<AdvertItemDto> advertItemDtos) {
+ for(AdvertItemDto advertItemDto : advertItemDtos){
+ if("8888".equals(advertItemDto.getItemTypeCd())){
+ advertItemDto.setUrl("/callComponent/download/getFile/file?fileId=" + advertItemDto.getUrl() + "&communityId=" + advertItemDto.getCommunityId());
+ }
+ }
+ }
+}
diff --git a/service-api/src/main/java/com/java110/api/listener/advert/ListAdvertPhotoAndVediosListener.java b/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertPhotoAndVediosCmd.java
old mode 100755
new mode 100644
similarity index 75%
rename from service-api/src/main/java/com/java110/api/listener/advert/ListAdvertPhotoAndVediosListener.java
rename to service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertPhotoAndVediosCmd.java
index 191bef6..419aff0
--- a/service-api/src/main/java/com/java110/api/listener/advert/ListAdvertPhotoAndVediosListener.java
+++ b/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertPhotoAndVediosCmd.java
@@ -1,36 +1,31 @@
-package com.java110.api.listener.advert;
+package com.java110.common.cmd.advert;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.intf.common.IAdvertInnerServiceSMO;
-import com.java110.intf.common.IAdvertItemInnerServiceSMO;
-import com.java110.intf.common.IMachineInnerServiceSMO;
-import com.java110.intf.community.IRoomInnerServiceSMO;
-import com.java110.intf.community.IUnitInnerServiceSMO;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
import com.java110.dto.RoomDto;
import com.java110.dto.UnitDto;
import com.java110.dto.advert.AdvertDto;
import com.java110.dto.advert.AdvertItemDto;
import com.java110.dto.machine.MachineDto;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeAdvertConstant;
+import com.java110.intf.common.IAdvertInnerServiceSMO;
+import com.java110.intf.common.IAdvertItemInnerServiceSMO;
+import com.java110.intf.common.IMachineInnerServiceSMO;
+import com.java110.intf.community.IRoomInnerServiceSMO;
+import com.java110.intf.community.IUnitInnerServiceSMO;
+import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import java.util.List;
-
-/**
- * 鏌ヨ骞垮憡淇℃伅
- */
-@Java110Listener("listAdvertPhotoAndVediosListener")
-public class ListAdvertPhotoAndVediosListener extends AbstractServiceApiListener {
+@Java110Cmd(serviceCode = "advert.listAdvertPhotoAndVedios")
+public class ListAdvertPhotoAndVediosCmd extends Cmd {
@Autowired
private IAdvertInnerServiceSMO advertInnerServiceSMOImpl;
@@ -49,40 +44,14 @@
private IMachineInnerServiceSMO machineInnerServiceSMOImpl;
@Override
- public String getServiceCode() {
- return ServiceCodeAdvertConstant.LIST_ADVERT_PHOTO_VEDIOS;
- }
-
- @Override
- public HttpMethod getHttpMethod() {
- return HttpMethod.GET;
- }
-
-
- @Override
- public int getOrder() {
- return DEFAULT_ORDER;
- }
-
-
- public IAdvertInnerServiceSMO getAdvertInnerServiceSMOImpl() {
- return advertInnerServiceSMOImpl;
- }
-
- public void setAdvertInnerServiceSMOImpl(IAdvertInnerServiceSMO advertInnerServiceSMOImpl) {
- this.advertInnerServiceSMOImpl = advertInnerServiceSMOImpl;
- }
-
- @Override
- protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+ public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
//super.validatePageInfo(reqJson);
Assert.hasKeyAndValue(reqJson, "machineCode", "璇锋眰鎶ユ枃涓湭鍖呭惈璁惧缂栫爜");
Assert.hasKeyAndValue(reqJson, "communityId", "璇锋眰鎶ユ枃涓湭鍖呭惈灏忓尯淇℃伅");
}
@Override
- protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
+ public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
ResponseEntity<String> responseEntity = null;
MachineDto machineDto = new MachineDto();
@@ -115,20 +84,20 @@
//鏌ヨ 鍗曞厓鐨勫箍鍛婏紝娌℃湁鎵� 妤兼爧锛屽啀鎵炬壘涓嶅埌 灏辫鏌ュ皬鍖�
if (getUnitAdvert(reqJson.getString("communityId"), locationObjId, advertPhotoAndVideos)) {
responseEntity = new ResponseEntity<String>(advertPhotoAndVideos.toJSONString(), HttpStatus.OK);
- context.setResponseEntity(responseEntity);
+ cmdDataFlowContext.setResponseEntity(responseEntity);
return;
}
// 鏌ヨ妤兼爧骞垮憡
if (getFloorAdvert(reqJson.getString("communityId"), locationObjId, advertPhotoAndVideos)) {
responseEntity = new ResponseEntity<String>(advertPhotoAndVideos.toJSONString(), HttpStatus.OK);
- context.setResponseEntity(responseEntity);
+ cmdDataFlowContext.setResponseEntity(responseEntity);
return;
}
if (getCommunityAdvert(reqJson.getString("communityId"), advertPhotoAndVideos)) {
responseEntity = new ResponseEntity<String>(advertPhotoAndVideos.toJSONString(), HttpStatus.OK);
- context.setResponseEntity(responseEntity);
+ cmdDataFlowContext.setResponseEntity(responseEntity);
return;
}
;
@@ -142,7 +111,7 @@
if (advertDtos != null && advertDtos.size() != 0) {
this.getAdvertItem(advertDtos, advertPhotoAndVideos);
responseEntity = new ResponseEntity<String>(advertPhotoAndVideos.toJSONString(), HttpStatus.OK);
- context.setResponseEntity(responseEntity);
+ cmdDataFlowContext.setResponseEntity(responseEntity);
return;
}
//鎴垮眿鎵句笉鍒帮紝鎵� 鍗曞厓
@@ -153,14 +122,14 @@
Assert.listOnlyOne(roomDtos, "鏈壘鍒版埧灞嬫垨鏌ヨ澶氭潯鎴垮眿淇℃伅");
if (getUnitAdvert(reqJson.getString("communityId"), roomDtos.get(0).getUnitId(), advertPhotoAndVideos)) {
responseEntity = new ResponseEntity<String>(advertPhotoAndVideos.toJSONString(), HttpStatus.OK);
- context.setResponseEntity(responseEntity);
+ cmdDataFlowContext.setResponseEntity(responseEntity);
return;
}
// 鏌ヨ妤兼爧骞垮憡
if (getFloorAdvert(reqJson.getString("communityId"), roomDtos.get(0).getUnitId(), advertPhotoAndVideos)) {
responseEntity = new ResponseEntity<String>(advertPhotoAndVideos.toJSONString(), HttpStatus.OK);
- context.setResponseEntity(responseEntity);
+ cmdDataFlowContext.setResponseEntity(responseEntity);
return;
}
@@ -170,7 +139,7 @@
responseEntity = new ResponseEntity<String>(advertPhotoAndVideos.toJSONString(), HttpStatus.OK);
- context.setResponseEntity(responseEntity);
+ cmdDataFlowContext.setResponseEntity(responseEntity);
}
@@ -267,37 +236,5 @@
}
}
- }
-
- public IAdvertItemInnerServiceSMO getAdvertItemInnerServiceSMOImpl() {
- return advertItemInnerServiceSMOImpl;
- }
-
- public void setAdvertItemInnerServiceSMOImpl(IAdvertItemInnerServiceSMO advertItemInnerServiceSMOImpl) {
- this.advertItemInnerServiceSMOImpl = advertItemInnerServiceSMOImpl;
- }
-
- public IMachineInnerServiceSMO getMachineInnerServiceSMOImpl() {
- return machineInnerServiceSMOImpl;
- }
-
- public void setMachineInnerServiceSMOImpl(IMachineInnerServiceSMO machineInnerServiceSMOImpl) {
- this.machineInnerServiceSMOImpl = machineInnerServiceSMOImpl;
- }
-
- public IUnitInnerServiceSMO getUnitInnerServiceSMOImpl() {
- return unitInnerServiceSMOImpl;
- }
-
- public void setUnitInnerServiceSMOImpl(IUnitInnerServiceSMO unitInnerServiceSMOImpl) {
- this.unitInnerServiceSMOImpl = unitInnerServiceSMOImpl;
- }
-
- public IRoomInnerServiceSMO getRoomInnerServiceSMOImpl() {
- return roomInnerServiceSMOImpl;
- }
-
- public void setRoomInnerServiceSMOImpl(IRoomInnerServiceSMO roomInnerServiceSMOImpl) {
- this.roomInnerServiceSMOImpl = roomInnerServiceSMOImpl;
}
}
diff --git a/service-api/src/main/java/com/java110/api/listener/advert/ListAdvertPhotoListener.java b/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertPhotoCmd.java
old mode 100755
new mode 100644
similarity index 69%
rename from service-api/src/main/java/com/java110/api/listener/advert/ListAdvertPhotoListener.java
rename to service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertPhotoCmd.java
index f68428d..c0380ec
--- a/service-api/src/main/java/com/java110/api/listener/advert/ListAdvertPhotoListener.java
+++ b/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertPhotoCmd.java
@@ -1,21 +1,20 @@
-package com.java110.api.listener.advert;
+package com.java110.common.cmd.advert;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
import com.java110.dto.advert.AdvertDto;
import com.java110.dto.advert.AdvertItemDto;
import com.java110.intf.common.IAdvertInnerServiceSMO;
import com.java110.intf.common.IAdvertItemInnerServiceSMO;
import com.java110.utils.cache.MappingCache;
-import com.java110.utils.constant.ServiceCodeAdvertConstant;
+import com.java110.utils.exception.CmdException;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
@@ -23,12 +22,8 @@
import java.util.Date;
import java.util.List;
-
-/**
- * 鏌ヨ骞垮憡淇℃伅
- */
-@Java110Listener("listAdvertPhotoListener")
-public class ListAdvertPhotoListener extends AbstractServiceApiListener {
+@Java110Cmd(serviceCode = "advert.listAdvertPhoto")
+public class ListAdvertPhotoCmd extends Cmd {
@Autowired
private IAdvertInnerServiceSMO advertInnerServiceSMOImpl;
@@ -36,40 +31,13 @@
@Autowired
private IAdvertItemInnerServiceSMO advertItemInnerServiceSMOImpl;
-
@Override
- public String getServiceCode() {
- return ServiceCodeAdvertConstant.LIST_ADVERT_PHOTO;
+ public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
}
@Override
- public HttpMethod getHttpMethod() {
- return HttpMethod.GET;
- }
-
-
- @Override
- public int getOrder() {
- return DEFAULT_ORDER;
- }
-
-
- public IAdvertInnerServiceSMO getAdvertInnerServiceSMOImpl() {
- return advertInnerServiceSMOImpl;
- }
-
- public void setAdvertInnerServiceSMOImpl(IAdvertInnerServiceSMO advertInnerServiceSMOImpl) {
- this.advertInnerServiceSMOImpl = advertInnerServiceSMOImpl;
- }
-
- @Override
- protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
- //super.validatePageInfo(reqJson);
- }
-
- @Override
- protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
-
+ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
ResponseEntity<String> responseEntity = null;
@@ -142,13 +110,4 @@
}
}
-
- public IAdvertItemInnerServiceSMO getAdvertItemInnerServiceSMOImpl() {
- return advertItemInnerServiceSMOImpl;
- }
-
- public void setAdvertItemInnerServiceSMOImpl(IAdvertItemInnerServiceSMO advertItemInnerServiceSMOImpl) {
- this.advertItemInnerServiceSMOImpl = advertItemInnerServiceSMOImpl;
- }
-
}
diff --git a/service-api/src/main/java/com/java110/api/listener/advert/ListAdvertsListener.java b/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertsCmd.java
old mode 100755
new mode 100644
similarity index 75%
rename from service-api/src/main/java/com/java110/api/listener/advert/ListAdvertsListener.java
rename to service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertsCmd.java
index 4dbde39..115b96c
--- a/service-api/src/main/java/com/java110/api/listener/advert/ListAdvertsListener.java
+++ b/service-common/src/main/java/com/java110/common/cmd/advert/ListAdvertsCmd.java
@@ -1,38 +1,34 @@
-package com.java110.api.listener.advert;
+package com.java110.common.cmd.advert;
import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiListener;
-import com.java110.core.annotation.Java110Listener;
-import com.java110.core.context.DataFlowContext;
-import com.java110.intf.common.IAdvertInnerServiceSMO;
-import com.java110.intf.community.ICommunityInnerServiceSMO;
-import com.java110.intf.community.IFloorInnerServiceSMO;
-import com.java110.intf.community.IRoomInnerServiceSMO;
-import com.java110.intf.community.IUnitInnerServiceSMO;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
import com.java110.dto.FloorDto;
import com.java110.dto.RoomDto;
import com.java110.dto.advert.AdvertDto;
import com.java110.dto.community.CommunityDto;
import com.java110.dto.unit.FloorAndUnitDto;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
-import com.java110.utils.constant.ServiceCodeAdvertConstant;
-import com.java110.utils.util.Assert;
+import com.java110.intf.common.IAdvertInnerServiceSMO;
+import com.java110.intf.community.ICommunityInnerServiceSMO;
+import com.java110.intf.community.IFloorInnerServiceSMO;
+import com.java110.intf.community.IRoomInnerServiceSMO;
+import com.java110.intf.community.IUnitInnerServiceSMO;
+import com.java110.utils.exception.CmdException;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.api.advert.ApiAdvertDataVo;
import com.java110.vo.api.advert.ApiAdvertVo;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import java.util.ArrayList;
import java.util.List;
-/**
- * 鏌ヨ灏忓尯渚﹀惉绫�
- */
-@Java110Listener("listAdvertsListener")
-public class ListAdvertsListener extends AbstractServiceApiListener {
+@Java110Cmd(serviceCode = "advert.listAdverts")
+public class ListAdvertsCmd extends Cmd {
+
@Autowired
private IAdvertInnerServiceSMO advertInnerServiceSMOImpl;
@@ -50,35 +46,12 @@
private IRoomInnerServiceSMO roomInnerServiceSMOImpl;
@Override
- public String getServiceCode() {
- return ServiceCodeAdvertConstant.LIST_ADVERTS;
- }
-
- @Override
- public HttpMethod getHttpMethod() {
- return HttpMethod.GET;
- }
-
- @Override
- public int getOrder() {
- return DEFAULT_ORDER;
- }
-
- public IAdvertInnerServiceSMO getAdvertInnerServiceSMOImpl() {
- return advertInnerServiceSMOImpl;
- }
-
- public void setAdvertInnerServiceSMOImpl(IAdvertInnerServiceSMO advertInnerServiceSMOImpl) {
- this.advertInnerServiceSMOImpl = advertInnerServiceSMOImpl;
- }
-
- @Override
- protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+ public void validate(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
super.validatePageInfo(reqJson);
}
@Override
- protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
AdvertDto advertDto = BeanConvertUtil.covertBean(reqJson, AdvertDto.class);
int count = advertInnerServiceSMOImpl.queryAdvertsCount(advertDto);
List<ApiAdvertDataVo> adverts = null;
@@ -236,35 +209,4 @@
}
}
- public ICommunityInnerServiceSMO getCommunityInnerServiceSMOImpl() {
- return communityInnerServiceSMOImpl;
- }
-
- public void setCommunityInnerServiceSMOImpl(ICommunityInnerServiceSMO communityInnerServiceSMOImpl) {
- this.communityInnerServiceSMOImpl = communityInnerServiceSMOImpl;
- }
-
- public IFloorInnerServiceSMO getFloorInnerServiceSMOImpl() {
- return floorInnerServiceSMOImpl;
- }
-
- public void setFloorInnerServiceSMOImpl(IFloorInnerServiceSMO floorInnerServiceSMOImpl) {
- this.floorInnerServiceSMOImpl = floorInnerServiceSMOImpl;
- }
-
- public IUnitInnerServiceSMO getUnitInnerServiceSMOImpl() {
- return unitInnerServiceSMOImpl;
- }
-
- public void setUnitInnerServiceSMOImpl(IUnitInnerServiceSMO unitInnerServiceSMOImpl) {
- this.unitInnerServiceSMOImpl = unitInnerServiceSMOImpl;
- }
-
- public IRoomInnerServiceSMO getRoomInnerServiceSMOImpl() {
- return roomInnerServiceSMOImpl;
- }
-
- public void setRoomInnerServiceSMOImpl(IRoomInnerServiceSMO roomInnerServiceSMOImpl) {
- this.roomInnerServiceSMOImpl = roomInnerServiceSMOImpl;
- }
}
diff --git a/service-api/src/main/java/com/java110/api/listener/advert/SaveAdvertListener.java b/service-common/src/main/java/com/java110/common/cmd/advert/SaveAdvertCmd.java
old mode 100755
new mode 100644
similarity index 62%
rename from service-api/src/main/java/com/java110/api/listener/advert/SaveAdvertListener.java
rename to service-common/src/main/java/com/java110/common/cmd/advert/SaveAdvertCmd.java
index 76fcf71..63a7872
--- a/service-api/src/main/java/com/java110/api/listener/advert/SaveAdvertListener.java
+++ b/service-common/src/main/java/com/java110/common/cmd/advert/SaveAdvertCmd.java
@@ -1,34 +1,65 @@
-package com.java110.api.listener.advert;
+/*
+ * Copyright 2017-2020 鍚村鏂� and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.cmd.advert;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.annotation.Java110Listener;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
import com.java110.core.context.DataFlowContext;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.dto.file.FileDto;
+import com.java110.intf.common.IAdvertItemV1InnerServiceSMO;
+import com.java110.intf.common.IAdvertV1InnerServiceSMO;
import com.java110.intf.common.IFileInnerServiceSMO;
import com.java110.intf.common.IFileRelInnerServiceSMO;
import com.java110.po.advert.AdvertItemPo;
import com.java110.po.advert.AdvertPo;
import com.java110.po.file.FileRelPo;
import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ServiceCodeAdvertConstant;
+import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.StringUtil;
+import com.java110.vo.ResultVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
import java.util.Date;
/**
- * 淇濆瓨灏忓尯渚﹀惉
- * add by wuxw 2019-06-30
+ * 绫昏〃杩帮細淇濆瓨
+ * 鏈嶅姟缂栫爜锛歛dvert.saveAdvert
+ * 璇锋眰璺姴锛�/app/advert.SaveAdvert
+ * add by 鍚村鏂� at 2022-06-19 10:07:43 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 瀹樼綉锛歨ttp://www.homecommunity.cn
+ * 娓╅Θ鎻愮ず锛氬鏋滄偍瀵规鏂囦欢杩涜淇敼 璇蜂笉瑕佸垹闄ゅ師鏈変綔鑰呭強娉ㄩ噴淇℃伅锛岃琛ュ厖鎮ㄧ殑 淇敼鐨勫師鍥犱互鍙婅仈绯婚偖绠卞涓�
+ * // modify by 寮犱笁 at 2021-09-12 绗�10琛屽湪鏌愮鍦烘櫙涓嬪瓨鍦ㄦ煇绉峛ug 闇�瑕佷慨澶嶏紝娉ㄩ噴10鑷�20琛� 鍔犲叆 20琛岃嚦30琛�
*/
-@Java110Listener("saveAdvertListener")
-public class SaveAdvertListener extends AbstractServiceApiPlusListener {
+@Java110Cmd(serviceCode = "advert.saveAdvert")
+public class SaveAdvertCmd extends Cmd {
+
+ private static Logger logger = LoggerFactory.getLogger(SaveAdvertCmd.class);
+
+ public static final String CODE_PREFIX_ID = "10";
@Autowired
private IFileInnerServiceSMO fileInnerServiceSMOImpl;
@@ -36,8 +67,14 @@
@Autowired
private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl;
+ @Autowired
+ private IAdvertV1InnerServiceSMO advertV1InnerServiceSMOImpl;
+
+ @Autowired
+ private IAdvertItemV1InnerServiceSMO advertItemV1InnerServiceSMOImpl;
+
@Override
- protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+ public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
//Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
Assert.hasKeyAndValue(reqJson, "adName", "蹇呭~锛岃濉啓骞垮憡鍚嶇О");
Assert.hasKeyAndValue(reqJson, "adTypeCd", "蹇呭~锛岃閫夋嫨骞垮憡绫诲瀷");
@@ -52,6 +89,7 @@
if (!hasKeyAndValue(reqJson, "photos") && !hasKeyAndValue(reqJson, "vedioName")) {
throw new IllegalArgumentException("璇锋眰鎶ユ枃涓病鏈夊寘鍚棰戞垨鍥剧墖");
}
+
}
private boolean hasKeyAndValue(JSONObject paramIn, String key) {
@@ -64,28 +102,34 @@
return true;
}
+
@Override
- protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+ @Java110Transactional
+ public void doCmd(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) throws CmdException {
+
String advertId = GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_advertId);
reqJson.put("advertId", advertId);
reqJson.put("state", "1000");
reqJson.put("createTime", new Date());
reqJson.put("communityId", "9999");
AdvertPo advertPo = BeanConvertUtil.covertBean(reqJson, AdvertPo.class);
- super.insert(context, advertPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ADVERT);
+ int flag = advertV1InnerServiceSMOImpl.saveAdvert(advertPo);
+ if(flag < 1){
+ throw new CmdException("淇濆瓨澶辫触");
+ }
if (hasKeyAndValue(reqJson, "photos") && reqJson.getJSONArray("photos").size() > 0) {
JSONArray photos = reqJson.getJSONArray("photos");
for (int _photoIndex = 0; _photoIndex < photos.size(); _photoIndex++) {
- addAdvertItemPhoto(reqJson, context, photos.getString(_photoIndex));
- addAdvertFileRel(reqJson, context, "40000");
+ addAdvertItemPhoto(reqJson, cmdDataFlowContext, photos.getString(_photoIndex));
+ addAdvertFileRel(reqJson, cmdDataFlowContext, "40000");
}
} else {
- addAdvertItemVedio(reqJson, context);
- addAdvertFileRel(reqJson, context, "50000");
+ addAdvertItemVedio(reqJson, cmdDataFlowContext);
+ addAdvertFileRel(reqJson, cmdDataFlowContext, "50000");
}
}
- public void addAdvertItemPhoto(JSONObject paramInJson, DataFlowContext dataFlowContext, String photo) {
+ public void addAdvertItemPhoto(JSONObject paramInJson, ICmdDataFlowContext dataFlowContext, String photo) {
String itemTypeCd = "";
String url = "";
FileDto fileDto = new FileDto();
@@ -106,7 +150,10 @@
advertItemPo.setItemTypeCd(itemTypeCd);
advertItemPo.setUrl(fileName);
advertItemPo.setSeq("1");
- super.insert(dataFlowContext, advertItemPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ADVERT_ITEM);
+ int flag = advertItemV1InnerServiceSMOImpl.saveAdvertItem(advertItemPo);
+ if(flag < 1){
+ throw new CmdException("淇濆瓨骞垮憡澶辫触");
+ }
}
@@ -117,7 +164,7 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public void addAdvertFileRel(JSONObject paramInJson, DataFlowContext dataFlowContext, String relTypeCd) {
+ public void addAdvertFileRel(JSONObject paramInJson, ICmdDataFlowContext dataFlowContext, String relTypeCd) {
FileRelPo fileRelPo = new FileRelPo();
fileRelPo.setRelTypeCd(relTypeCd);
fileRelPo.setSaveWay("40000".equals(relTypeCd) ? "table" : "ftp");
@@ -125,7 +172,10 @@
fileRelPo.setObjId(paramInJson.getString("advertId"));
fileRelPo.setFileRealName(paramInJson.getString("vedioName"));
fileRelPo.setFileSaveName(paramInJson.getString("vedioName"));
- super.insert(dataFlowContext, fileRelPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL);
+ int flag = fileRelInnerServiceSMOImpl.saveFileRel(fileRelPo);
+ if(flag < 1){
+ throw new CmdException("淇濆瓨骞垮憡澶辫触");
+ }
}
@@ -136,7 +186,7 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public void addAdvertItemVedio(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+ public void addAdvertItemVedio(JSONObject paramInJson, ICmdDataFlowContext dataFlowContext) {
FileRelPo fileRelPo = new FileRelPo();
fileRelPo.setFileRelId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_fileRelId));
fileRelPo.setObjId(paramInJson.getString("advertId"));
@@ -158,29 +208,5 @@
advertItemPo.setUrl(url);
advertItemPo.setSeq("1");
super.insert(dataFlowContext, advertItemPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ADVERT_ITEM);*/
- }
-
- @Override
- public String getServiceCode() {
- return ServiceCodeAdvertConstant.ADD_ADVERT;
- }
-
- @Override
- public HttpMethod getHttpMethod() {
- return HttpMethod.POST;
- }
-
- @Override
- public int getOrder() {
- return DEFAULT_ORDER;
- }
-
-
- public IFileInnerServiceSMO getFileInnerServiceSMOImpl() {
- return fileInnerServiceSMOImpl;
- }
-
- public void setFileInnerServiceSMOImpl(IFileInnerServiceSMO fileInnerServiceSMOImpl) {
- this.fileInnerServiceSMOImpl = fileInnerServiceSMOImpl;
}
}
diff --git a/service-api/src/main/java/com/java110/api/listener/advert/UpdateAdvertListener.java b/service-common/src/main/java/com/java110/common/cmd/advert/UpdateAdvertCmd.java
old mode 100755
new mode 100644
similarity index 68%
rename from service-api/src/main/java/com/java110/api/listener/advert/UpdateAdvertListener.java
rename to service-common/src/main/java/com/java110/common/cmd/advert/UpdateAdvertCmd.java
index 0272359..6f4add3
--- a/service-api/src/main/java/com/java110/api/listener/advert/UpdateAdvertListener.java
+++ b/service-common/src/main/java/com/java110/common/cmd/advert/UpdateAdvertCmd.java
@@ -1,40 +1,65 @@
-package com.java110.api.listener.advert;
+/*
+ * Copyright 2017-2020 鍚村鏂� and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.cmd.advert;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
-import com.java110.api.listener.AbstractServiceApiPlusListener;
-import com.java110.core.annotation.Java110Listener;
+import com.java110.core.annotation.Java110Cmd;
+import com.java110.core.annotation.Java110Transactional;
import com.java110.core.context.DataFlowContext;
+import com.java110.core.context.ICmdDataFlowContext;
+import com.java110.core.event.cmd.Cmd;
+import com.java110.core.event.cmd.CmdEvent;
import com.java110.core.factory.GenerateCodeFactory;
-import com.java110.intf.common.IAdvertInnerServiceSMO;
-import com.java110.intf.common.IAdvertItemInnerServiceSMO;
-import com.java110.intf.common.IFileInnerServiceSMO;
-import com.java110.intf.common.IFileRelInnerServiceSMO;
import com.java110.dto.advert.AdvertDto;
import com.java110.dto.advert.AdvertItemDto;
import com.java110.dto.file.FileDto;
import com.java110.dto.file.FileRelDto;
-import com.java110.core.event.service.api.ServiceDataFlowEvent;
+import com.java110.intf.common.*;
import com.java110.po.advert.AdvertItemPo;
import com.java110.po.advert.AdvertPo;
import com.java110.po.file.FileRelPo;
import com.java110.utils.constant.BusinessTypeConstant;
-import com.java110.utils.constant.ServiceCodeAdvertConstant;
+import com.java110.utils.exception.CmdException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.utils.util.StringUtil;
+import com.java110.vo.ResultVo;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpMethod;
import java.util.Date;
import java.util.List;
+
/**
- * 淇濆瓨鍙戝竷骞垮憡渚﹀惉
- * add by wuxw 2019-06-30
+ * 绫昏〃杩帮細鏇存柊
+ * 鏈嶅姟缂栫爜锛歛dvert.updateAdvert
+ * 璇锋眰璺姴锛�/app/advert.UpdateAdvert
+ * add by 鍚村鏂� at 2022-06-19 10:07:43 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 瀹樼綉锛歨ttp://www.homecommunity.cn
+ * 娓╅Θ鎻愮ず锛氬鏋滄偍瀵规鏂囦欢杩涜淇敼 璇蜂笉瑕佸垹闄ゅ師鏈変綔鑰呭強娉ㄩ噴淇℃伅锛岃琛ュ厖鎮ㄧ殑 淇敼鐨勫師鍥犱互鍙婅仈绯婚偖绠卞涓�
+ * // modify by 寮犱笁 at 2021-09-12 绗�10琛屽湪鏌愮鍦烘櫙涓嬪瓨鍦ㄦ煇绉峛ug 闇�瑕佷慨澶嶏紝娉ㄩ噴10鑷�20琛� 鍔犲叆 20琛岃嚦30琛�
*/
-@Java110Listener("updateAdvertListener")
-public class UpdateAdvertListener extends AbstractServiceApiPlusListener {
+@Java110Cmd(serviceCode = "advert.updateAdvert")
+public class UpdateAdvertCmd extends Cmd {
+
+ private static Logger logger = LoggerFactory.getLogger(UpdateAdvertCmd.class);
@Autowired
private IAdvertInnerServiceSMO advertInnerServiceSMOImpl;
@@ -47,9 +72,14 @@
@Autowired
private IFileRelInnerServiceSMO fileRelInnerServiceSMOImpl;
+ @Autowired
+ private IAdvertV1InnerServiceSMO advertV1InnerServiceSMOImpl;
+
+ @Autowired
+ private IAdvertItemV1InnerServiceSMO advertItemV1InnerServiceSMOImpl;
@Override
- protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+ public void validate(CmdEvent event, ICmdDataFlowContext cmdDataFlowContext, JSONObject reqJson) {
Assert.hasKeyAndValue(reqJson, "advertId", "骞垮憡ID涓嶈兘涓虹┖");
Assert.hasKeyAndValue(reqJson, "adName", "蹇呭~锛岃濉啓骞垮憡鍚嶇О");
Assert.hasKeyAndValue(reqJson, "adTypeCd", "蹇呭~锛岃閫夋嫨骞垮憡绫诲瀷");
@@ -76,9 +106,10 @@
return true;
}
-
@Override
- protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+ @Java110Transactional
+ public void doCmd(CmdEvent event, ICmdDataFlowContext context, JSONObject reqJson) throws CmdException {
+
AdvertDto advertDto = new AdvertDto();
advertDto.setAdvertId(reqJson.getString("advertId"));
advertDto.setCommunityId(reqJson.getString("communityId"));
@@ -87,8 +118,10 @@
AdvertPo advert = BeanConvertUtil.covertBean(reqJson, AdvertPo.class);
advert.setState(advertDtos.get(0).getState());
- super.update(context, advert, BusinessTypeConstant.BUSINESS_TYPE_UPDATE_ADVERT);
-
+ int flag = advertV1InnerServiceSMOImpl.updateAdvert(advert);
+ if(flag < 1){
+ throw new CmdException("淇濆瓨澶辫触");
+ }
AdvertItemDto advertItemDto = new AdvertItemDto();
advertItemDto.setAdvertId(reqJson.getString("advertId"));
advertItemDto.setItemTypeCds(new String[]{"8888", "9999"});
@@ -96,7 +129,10 @@
//鍒犻櫎鐓х墖鎴栬棰�
for (AdvertItemDto tmpAdvertItemDto : advertItemDtos) {
AdvertItemPo advertItemPo = BeanConvertUtil.covertBean(tmpAdvertItemDto, AdvertItemPo.class);
- super.delete(context, advertItemPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_ADVERT_ITEM);
+ flag = advertItemV1InnerServiceSMOImpl.deleteAdvertItem(advertItemPo);
+ if(flag < 1){
+ throw new CmdException("淇濆瓨澶辫触");
+ }
}
//鍒犻櫎鏂囦欢鍜屽箍鍛婄殑鍏崇郴
@@ -105,7 +141,10 @@
List<FileRelDto> fileRelDtos = fileRelInnerServiceSMOImpl.queryFileRels(fileRelDto);
for (FileRelDto tmpFileRelDto : fileRelDtos) {
FileRelPo fileRelPo = BeanConvertUtil.covertBean(tmpFileRelDto, FileRelPo.class);
- super.delete(context, fileRelPo, BusinessTypeConstant.BUSINESS_TYPE_DELETE_FILE_REL);
+ flag = fileRelInnerServiceSMOImpl.deleteFileRel(fileRelPo);
+ if(flag < 1){
+ throw new CmdException("淇濆瓨澶辫触");
+ }
}
@@ -121,7 +160,7 @@
}
}
- public void addAdvertItemPhoto(JSONObject paramInJson, DataFlowContext dataFlowContext, String photo) {
+ public void addAdvertItemPhoto(JSONObject paramInJson, ICmdDataFlowContext dataFlowContext, String photo) {
String itemTypeCd = "";
String url = "";
FileDto fileDto = new FileDto();
@@ -141,7 +180,10 @@
advertItemPo.setItemTypeCd(itemTypeCd);
advertItemPo.setUrl(fileName);
advertItemPo.setSeq("1");
- super.insert(dataFlowContext, advertItemPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ADVERT_ITEM);
+ int flag = advertItemV1InnerServiceSMOImpl.saveAdvertItem(advertItemPo);
+ if(flag < 1){
+ throw new CmdException("淇濆瓨骞垮憡澶辫触");
+ }
}
@@ -152,7 +194,7 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public void addAdvertFileRel(JSONObject paramInJson, DataFlowContext dataFlowContext, String relTypeCd) {
+ public void addAdvertFileRel(JSONObject paramInJson, ICmdDataFlowContext dataFlowContext, String relTypeCd) {
FileRelPo fileRelPo = new FileRelPo();
fileRelPo.setRelTypeCd(relTypeCd);
fileRelPo.setSaveWay("40000".equals(relTypeCd) ? "table" : "ftp");
@@ -160,7 +202,10 @@
fileRelPo.setObjId(paramInJson.getString("advertId"));
fileRelPo.setFileRealName(paramInJson.getString("advertPhotoId"));
fileRelPo.setFileSaveName(paramInJson.getString("fileSaveName"));
- super.insert(dataFlowContext, fileRelPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_FILE_REL);
+ int flag = fileRelInnerServiceSMOImpl.saveFileRel(fileRelPo);
+ if(flag < 1){
+ throw new CmdException("淇濆瓨骞垮憡澶辫触");
+ }
}
@@ -171,7 +216,7 @@
* @param dataFlowContext 鏁版嵁涓婁笅鏂�
* @return 璁㈠崟鏈嶅姟鑳藉鎺ュ彈鐨勬姤鏂�
*/
- public void addAdvertItemVedio(JSONObject paramInJson, DataFlowContext dataFlowContext) {
+ public void addAdvertItemVedio(JSONObject paramInJson, ICmdDataFlowContext dataFlowContext) {
FileRelPo fileRelPo = new FileRelPo();
fileRelPo.setFileRelId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_fileRelId));
fileRelPo.setObjId(paramInJson.getString("advertId"));
@@ -195,44 +240,5 @@
advertItemPo.setUrl(url);
advertItemPo.setSeq("1");
super.insert(dataFlowContext, advertItemPo, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ADVERT_ITEM);*/
- }
-
- @Override
- public String getServiceCode() {
- return ServiceCodeAdvertConstant.UPDATE_ADVERT;
- }
-
- @Override
- public HttpMethod getHttpMethod() {
- return HttpMethod.POST;
- }
-
- @Override
- public int getOrder() {
- return DEFAULT_ORDER;
- }
-
- public IAdvertInnerServiceSMO getAdvertInnerServiceSMOImpl() {
- return advertInnerServiceSMOImpl;
- }
-
- public void setAdvertInnerServiceSMOImpl(IAdvertInnerServiceSMO advertInnerServiceSMOImpl) {
- this.advertInnerServiceSMOImpl = advertInnerServiceSMOImpl;
- }
-
- public IAdvertItemInnerServiceSMO getAdvertItemInnerServiceSMOImpl() {
- return advertItemInnerServiceSMOImpl;
- }
-
- public void setAdvertItemInnerServiceSMOImpl(IAdvertItemInnerServiceSMO advertItemInnerServiceSMOImpl) {
- this.advertItemInnerServiceSMOImpl = advertItemInnerServiceSMOImpl;
- }
-
- public IFileInnerServiceSMO getFileInnerServiceSMOImpl() {
- return fileInnerServiceSMOImpl;
- }
-
- public void setFileInnerServiceSMOImpl(IFileInnerServiceSMO fileInnerServiceSMOImpl) {
- this.fileInnerServiceSMOImpl = fileInnerServiceSMOImpl;
}
}
diff --git a/service-common/src/main/java/com/java110/common/dao/IAdvertItemV1ServiceDao.java b/service-common/src/main/java/com/java110/common/dao/IAdvertItemV1ServiceDao.java
new file mode 100644
index 0000000..e318713
--- /dev/null
+++ b/service-common/src/main/java/com/java110/common/dao/IAdvertItemV1ServiceDao.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2017-2020 鍚村鏂� and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 绫昏〃杩帮細
+ * add by 鍚村鏂� at 2022-06-19 10:12:15 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 瀹樼綉锛歨ttp://www.homecommunity.cn
+ * 娓╅Θ鎻愮ず锛氬鏋滄偍瀵规鏂囦欢杩涜淇敼 璇蜂笉瑕佸垹闄ゅ師鏈変綔鑰呭強娉ㄩ噴淇℃伅锛岃琛ュ厖鎮ㄧ殑 淇敼鐨勫師鍥犱互鍙婅仈绯婚偖绠卞涓�
+ * // modify by 寮犱笁 at 2021-09-12 绗�10琛屽湪鏌愮鍦烘櫙涓嬪瓨鍦ㄦ煇绉峛ug 闇�瑕佷慨澶嶏紝娉ㄩ噴10鑷�20琛� 鍔犲叆 20琛岃嚦30琛�
+ */
+public interface IAdvertItemV1ServiceDao {
+
+
+ /**
+ * 淇濆瓨 骞垮憡鍐呭淇℃伅
+ * @param info
+ * @throws DAOException DAO寮傚父
+ */
+ int saveAdvertItemInfo(Map info) throws DAOException;
+
+
+
+
+ /**
+ * 鏌ヨ骞垮憡鍐呭淇℃伅锛坕nstance杩囩▼锛�
+ * 鏍规嵁bId 鏌ヨ骞垮憡鍐呭淇℃伅
+ * @param info bId 淇℃伅
+ * @return 骞垮憡鍐呭淇℃伅
+ * @throws DAOException DAO寮傚父
+ */
+ List<Map> getAdvertItemInfo(Map info) throws DAOException;
+
+
+
+ /**
+ * 淇敼骞垮憡鍐呭淇℃伅
+ * @param info 淇敼淇℃伅
+ * @throws DAOException DAO寮傚父
+ */
+ int updateAdvertItemInfo(Map info) throws DAOException;
+
+
+ /**
+ * 鏌ヨ骞垮憡鍐呭鎬绘暟
+ *
+ * @param info 骞垮憡鍐呭淇℃伅
+ * @return 骞垮憡鍐呭鏁伴噺
+ */
+ int queryAdvertItemsCount(Map info);
+
+}
diff --git a/service-common/src/main/java/com/java110/common/dao/IAdvertV1ServiceDao.java b/service-common/src/main/java/com/java110/common/dao/IAdvertV1ServiceDao.java
new file mode 100644
index 0000000..c7281bd
--- /dev/null
+++ b/service-common/src/main/java/com/java110/common/dao/IAdvertV1ServiceDao.java
@@ -0,0 +1,77 @@
+/*
+ * Copyright 2017-2020 鍚村鏂� and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.dao;
+
+
+import com.java110.utils.exception.DAOException;
+import com.java110.entity.merchant.BoMerchant;
+import com.java110.entity.merchant.BoMerchantAttr;
+import com.java110.entity.merchant.Merchant;
+import com.java110.entity.merchant.MerchantAttr;
+
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 绫昏〃杩帮細
+ * add by 鍚村鏂� at 2022-06-19 10:07:43 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 瀹樼綉锛歨ttp://www.homecommunity.cn
+ * 娓╅Θ鎻愮ず锛氬鏋滄偍瀵规鏂囦欢杩涜淇敼 璇蜂笉瑕佸垹闄ゅ師鏈変綔鑰呭強娉ㄩ噴淇℃伅锛岃琛ュ厖鎮ㄧ殑 淇敼鐨勫師鍥犱互鍙婅仈绯婚偖绠卞涓�
+ * // modify by 寮犱笁 at 2021-09-12 绗�10琛屽湪鏌愮鍦烘櫙涓嬪瓨鍦ㄦ煇绉峛ug 闇�瑕佷慨澶嶏紝娉ㄩ噴10鑷�20琛� 鍔犲叆 20琛岃嚦30琛�
+ */
+public interface IAdvertV1ServiceDao {
+
+
+ /**
+ * 淇濆瓨 骞垮憡淇℃伅
+ * @param info
+ * @throws DAOException DAO寮傚父
+ */
+ int saveAdvertInfo(Map info) throws DAOException;
+
+
+
+
+ /**
+ * 鏌ヨ骞垮憡淇℃伅锛坕nstance杩囩▼锛�
+ * 鏍规嵁bId 鏌ヨ骞垮憡淇℃伅
+ * @param info bId 淇℃伅
+ * @return 骞垮憡淇℃伅
+ * @throws DAOException DAO寮傚父
+ */
+ List<Map> getAdvertInfo(Map info) throws DAOException;
+
+
+
+ /**
+ * 淇敼骞垮憡淇℃伅
+ * @param info 淇敼淇℃伅
+ * @throws DAOException DAO寮傚父
+ */
+ int updateAdvertInfo(Map info) throws DAOException;
+
+
+ /**
+ * 鏌ヨ骞垮憡鎬绘暟
+ *
+ * @param info 骞垮憡淇℃伅
+ * @return 骞垮憡鏁伴噺
+ */
+ int queryAdvertsCount(Map info);
+
+}
diff --git a/service-common/src/main/java/com/java110/common/dao/impl/AdvertItemV1ServiceDaoImpl.java b/service-common/src/main/java/com/java110/common/dao/impl/AdvertItemV1ServiceDaoImpl.java
new file mode 100644
index 0000000..f79c836
--- /dev/null
+++ b/service-common/src/main/java/com/java110/common/dao/impl/AdvertItemV1ServiceDaoImpl.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2017-2020 鍚村鏂� and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.common.dao.IAdvertItemV1ServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 绫昏〃杩帮細
+ * add by 鍚村鏂� at 2022-06-19 10:12:15 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 瀹樼綉锛歨ttp://www.homecommunity.cn
+ * 娓╅Θ鎻愮ず锛氬鏋滄偍瀵规鏂囦欢杩涜淇敼 璇蜂笉瑕佸垹闄ゅ師鏈変綔鑰呭強娉ㄩ噴淇℃伅锛岃琛ュ厖鎮ㄧ殑 淇敼鐨勫師鍥犱互鍙婅仈绯婚偖绠卞涓�
+ * // modify by 寮犱笁 at 2021-09-12 绗�10琛屽湪鏌愮鍦烘櫙涓嬪瓨鍦ㄦ煇绉峛ug 闇�瑕佷慨澶嶏紝娉ㄩ噴10鑷�20琛� 鍔犲叆 20琛岃嚦30琛�
+ */
+@Service("advertItemV1ServiceDaoImpl")
+public class AdvertItemV1ServiceDaoImpl extends BaseServiceDao implements IAdvertItemV1ServiceDao {
+
+ private static Logger logger = LoggerFactory.getLogger(AdvertItemV1ServiceDaoImpl.class);
+
+
+
+
+
+ /**
+ * 淇濆瓨骞垮憡鍐呭淇℃伅 鍒� instance
+ * @param info bId 淇℃伅
+ * @throws DAOException DAO寮傚父
+ */
+ @Override
+ public int saveAdvertItemInfo(Map info) throws DAOException {
+ logger.debug("淇濆瓨 saveAdvertItemInfo 鍏ュ弬 info : {}",info);
+
+ int saveFlag = sqlSessionTemplate.insert("advertItemV1ServiceDaoImpl.saveAdvertItemInfo",info);
+
+ return saveFlag;
+ }
+
+
+ /**
+ * 鏌ヨ骞垮憡鍐呭淇℃伅锛坕nstance锛�
+ * @param info bId 淇℃伅
+ * @return List<Map>
+ * @throws DAOException DAO寮傚父
+ */
+ @Override
+ public List<Map> getAdvertItemInfo(Map info) throws DAOException {
+ logger.debug("鏌ヨ getAdvertItemInfo 鍏ュ弬 info : {}",info);
+
+ List<Map> businessAdvertItemInfos = sqlSessionTemplate.selectList("advertItemV1ServiceDaoImpl.getAdvertItemInfo",info);
+
+ return businessAdvertItemInfos;
+ }
+
+
+ /**
+ * 淇敼骞垮憡鍐呭淇℃伅
+ * @param info 淇敼淇℃伅
+ * @throws DAOException DAO寮傚父
+ */
+ @Override
+ public int updateAdvertItemInfo(Map info) throws DAOException {
+ logger.debug("淇敼 updateAdvertItemInfo 鍏ュ弬 info : {}",info);
+
+ int saveFlag = sqlSessionTemplate.update("advertItemV1ServiceDaoImpl.updateAdvertItemInfo",info);
+
+ return saveFlag;
+ }
+
+ /**
+ * 鏌ヨ骞垮憡鍐呭鏁伴噺
+ * @param info 骞垮憡鍐呭淇℃伅
+ * @return 骞垮憡鍐呭鏁伴噺
+ */
+ @Override
+ public int queryAdvertItemsCount(Map info) {
+ logger.debug("鏌ヨ queryAdvertItemsCount 鍏ュ弬 info : {}",info);
+
+ List<Map> businessAdvertItemInfos = sqlSessionTemplate.selectList("advertItemV1ServiceDaoImpl.queryAdvertItemsCount", info);
+ if (businessAdvertItemInfos.size() < 1) {
+ return 0;
+ }
+
+ return Integer.parseInt(businessAdvertItemInfos.get(0).get("count").toString());
+ }
+
+
+}
diff --git a/service-common/src/main/java/com/java110/common/dao/impl/AdvertV1ServiceDaoImpl.java b/service-common/src/main/java/com/java110/common/dao/impl/AdvertV1ServiceDaoImpl.java
new file mode 100644
index 0000000..72875e6
--- /dev/null
+++ b/service-common/src/main/java/com/java110/common/dao/impl/AdvertV1ServiceDaoImpl.java
@@ -0,0 +1,112 @@
+/*
+ * Copyright 2017-2020 鍚村鏂� and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.dao.impl;
+
+import com.alibaba.fastjson.JSONObject;
+import com.java110.utils.constant.ResponseConstant;
+import com.java110.utils.exception.DAOException;
+import com.java110.utils.util.DateUtil;
+import com.java110.core.base.dao.BaseServiceDao;
+import com.java110.common.dao.IAdvertV1ServiceDao;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 绫昏〃杩帮細
+ * add by 鍚村鏂� at 2022-06-19 10:07:43 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 瀹樼綉锛歨ttp://www.homecommunity.cn
+ * 娓╅Θ鎻愮ず锛氬鏋滄偍瀵规鏂囦欢杩涜淇敼 璇蜂笉瑕佸垹闄ゅ師鏈変綔鑰呭強娉ㄩ噴淇℃伅锛岃琛ュ厖鎮ㄧ殑 淇敼鐨勫師鍥犱互鍙婅仈绯婚偖绠卞涓�
+ * // modify by 寮犱笁 at 2021-09-12 绗�10琛屽湪鏌愮鍦烘櫙涓嬪瓨鍦ㄦ煇绉峛ug 闇�瑕佷慨澶嶏紝娉ㄩ噴10鑷�20琛� 鍔犲叆 20琛岃嚦30琛�
+ */
+@Service("advertV1ServiceDaoImpl")
+public class AdvertV1ServiceDaoImpl extends BaseServiceDao implements IAdvertV1ServiceDao {
+
+ private static Logger logger = LoggerFactory.getLogger(AdvertV1ServiceDaoImpl.class);
+
+
+
+
+
+ /**
+ * 淇濆瓨骞垮憡淇℃伅 鍒� instance
+ * @param info bId 淇℃伅
+ * @throws DAOException DAO寮傚父
+ */
+ @Override
+ public int saveAdvertInfo(Map info) throws DAOException {
+ logger.debug("淇濆瓨 saveAdvertInfo 鍏ュ弬 info : {}",info);
+
+ int saveFlag = sqlSessionTemplate.insert("advertV1ServiceDaoImpl.saveAdvertInfo",info);
+
+ return saveFlag;
+ }
+
+
+ /**
+ * 鏌ヨ骞垮憡淇℃伅锛坕nstance锛�
+ * @param info bId 淇℃伅
+ * @return List<Map>
+ * @throws DAOException DAO寮傚父
+ */
+ @Override
+ public List<Map> getAdvertInfo(Map info) throws DAOException {
+ logger.debug("鏌ヨ getAdvertInfo 鍏ュ弬 info : {}",info);
+
+ List<Map> businessAdvertInfos = sqlSessionTemplate.selectList("advertV1ServiceDaoImpl.getAdvertInfo",info);
+
+ return businessAdvertInfos;
+ }
+
+
+ /**
+ * 淇敼骞垮憡淇℃伅
+ * @param info 淇敼淇℃伅
+ * @throws DAOException DAO寮傚父
+ */
+ @Override
+ public int updateAdvertInfo(Map info) throws DAOException {
+ logger.debug("淇敼 updateAdvertInfo 鍏ュ弬 info : {}",info);
+
+ int saveFlag = sqlSessionTemplate.update("advertV1ServiceDaoImpl.updateAdvertInfo",info);
+
+ return saveFlag;
+ }
+
+ /**
+ * 鏌ヨ骞垮憡鏁伴噺
+ * @param info 骞垮憡淇℃伅
+ * @return 骞垮憡鏁伴噺
+ */
+ @Override
+ public int queryAdvertsCount(Map info) {
+ logger.debug("鏌ヨ queryAdvertsCount 鍏ュ弬 info : {}",info);
+
+ List<Map> businessAdvertInfos = sqlSessionTemplate.selectList("advertV1ServiceDaoImpl.queryAdvertsCount", info);
+ if (businessAdvertInfos.size() < 1) {
+ return 0;
+ }
+
+ return Integer.parseInt(businessAdvertInfos.get(0).get("count").toString());
+ }
+
+
+}
diff --git a/service-common/src/main/java/com/java110/common/smo/impl/AdvertItemV1InnerServiceSMOImpl.java b/service-common/src/main/java/com/java110/common/smo/impl/AdvertItemV1InnerServiceSMOImpl.java
new file mode 100644
index 0000000..461c6d4
--- /dev/null
+++ b/service-common/src/main/java/com/java110/common/smo/impl/AdvertItemV1InnerServiceSMOImpl.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2017-2020 鍚村鏂� and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.smo.impl;
+
+
+import com.java110.common.dao.IAdvertItemV1ServiceDao;
+import com.java110.dto.advert.AdvertItemDto;
+import com.java110.intf.common.IAdvertItemV1InnerServiceSMO;
+import com.java110.po.advert.AdvertItemPo;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.dto.PageDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 绫昏〃杩帮細 鏈嶅姟涔嬪墠璋冪敤鐨勬帴鍙e疄鐜扮被锛屼笉瀵瑰鎻愪緵鎺ュ彛鑳藉姏 鍙敤浜庢帴鍙e缓璋冪敤
+ * add by 鍚村鏂� at 2022-06-19 10:12:15 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 瀹樼綉锛歨ttp://www.homecommunity.cn
+ * 娓╅Θ鎻愮ず锛氬鏋滄偍瀵规鏂囦欢杩涜淇敼 璇蜂笉瑕佸垹闄ゅ師鏈変綔鑰呭強娉ㄩ噴淇℃伅锛岃琛ュ厖鎮ㄧ殑 淇敼鐨勫師鍥犱互鍙婅仈绯婚偖绠卞涓�
+ * // modify by 寮犱笁 at 2021-09-12 绗�10琛屽湪鏌愮鍦烘櫙涓嬪瓨鍦ㄦ煇绉峛ug 闇�瑕佷慨澶嶏紝娉ㄩ噴10鑷�20琛� 鍔犲叆 20琛岃嚦30琛�
+ */
+@RestController
+public class AdvertItemV1InnerServiceSMOImpl extends BaseServiceSMO implements IAdvertItemV1InnerServiceSMO {
+
+ @Autowired
+ private IAdvertItemV1ServiceDao advertItemV1ServiceDaoImpl;
+
+
+ @Override
+ public int saveAdvertItem(@RequestBody AdvertItemPo advertItemPo) {
+ int saveFlag = advertItemV1ServiceDaoImpl.saveAdvertItemInfo(BeanConvertUtil.beanCovertMap(advertItemPo));
+ return saveFlag;
+ }
+
+ @Override
+ public int updateAdvertItem(@RequestBody AdvertItemPo advertItemPo) {
+ int saveFlag = advertItemV1ServiceDaoImpl.updateAdvertItemInfo(BeanConvertUtil.beanCovertMap(advertItemPo));
+ return saveFlag;
+ }
+
+ @Override
+ public int deleteAdvertItem(@RequestBody AdvertItemPo advertItemPo) {
+ advertItemPo.setStatusCd("1");
+ int saveFlag = advertItemV1ServiceDaoImpl.updateAdvertItemInfo(BeanConvertUtil.beanCovertMap(advertItemPo));
+ return saveFlag;
+ }
+
+ @Override
+ public List<AdvertItemDto> queryAdvertItems(@RequestBody AdvertItemDto advertItemDto) {
+
+ //鏍¢獙鏄惁浼犱簡 鍒嗛〉淇℃伅
+
+ int page = advertItemDto.getPage();
+
+ if (page != PageDto.DEFAULT_PAGE) {
+ advertItemDto.setPage((page - 1) * advertItemDto.getRow());
+ }
+
+ List<AdvertItemDto> advertItems = BeanConvertUtil.covertBeanList(advertItemV1ServiceDaoImpl.getAdvertItemInfo(BeanConvertUtil.beanCovertMap(advertItemDto)), AdvertItemDto.class);
+
+ return advertItems;
+ }
+
+
+ @Override
+ public int queryAdvertItemsCount(@RequestBody AdvertItemDto advertItemDto) {
+ return advertItemV1ServiceDaoImpl.queryAdvertItemsCount(BeanConvertUtil.beanCovertMap(advertItemDto)); }
+
+}
diff --git a/service-common/src/main/java/com/java110/common/smo/impl/AdvertV1InnerServiceSMOImpl.java b/service-common/src/main/java/com/java110/common/smo/impl/AdvertV1InnerServiceSMOImpl.java
new file mode 100644
index 0000000..cd07de5
--- /dev/null
+++ b/service-common/src/main/java/com/java110/common/smo/impl/AdvertV1InnerServiceSMOImpl.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright 2017-2020 鍚村鏂� and java110 team.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package com.java110.common.smo.impl;
+
+
+import com.java110.common.dao.IAdvertV1ServiceDao;
+import com.java110.intf.common.IAdvertV1InnerServiceSMO;
+import com.java110.dto.advert.AdvertDto;
+import com.java110.po.advert.AdvertPo;
+import com.java110.utils.util.BeanConvertUtil;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.dto.user.UserDto;
+import com.java110.dto.PageDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 绫昏〃杩帮細 鏈嶅姟涔嬪墠璋冪敤鐨勬帴鍙e疄鐜扮被锛屼笉瀵瑰鎻愪緵鎺ュ彛鑳藉姏 鍙敤浜庢帴鍙e缓璋冪敤
+ * add by 鍚村鏂� at 2022-06-19 10:07:43 mail: 928255095@qq.com
+ * open source address: https://gitee.com/wuxw7/MicroCommunity
+ * 瀹樼綉锛歨ttp://www.homecommunity.cn
+ * 娓╅Θ鎻愮ず锛氬鏋滄偍瀵规鏂囦欢杩涜淇敼 璇蜂笉瑕佸垹闄ゅ師鏈変綔鑰呭強娉ㄩ噴淇℃伅锛岃琛ュ厖鎮ㄧ殑 淇敼鐨勫師鍥犱互鍙婅仈绯婚偖绠卞涓�
+ * // modify by 寮犱笁 at 2021-09-12 绗�10琛屽湪鏌愮鍦烘櫙涓嬪瓨鍦ㄦ煇绉峛ug 闇�瑕佷慨澶嶏紝娉ㄩ噴10鑷�20琛� 鍔犲叆 20琛岃嚦30琛�
+ */
+@RestController
+public class AdvertV1InnerServiceSMOImpl extends BaseServiceSMO implements IAdvertV1InnerServiceSMO {
+
+ @Autowired
+ private IAdvertV1ServiceDao advertV1ServiceDaoImpl;
+
+
+ @Override
+ public int saveAdvert(@RequestBody AdvertPo advertPo) {
+ int saveFlag = advertV1ServiceDaoImpl.saveAdvertInfo(BeanConvertUtil.beanCovertMap(advertPo));
+ return saveFlag;
+ }
+
+ @Override
+ public int updateAdvert(@RequestBody AdvertPo advertPo) {
+ int saveFlag = advertV1ServiceDaoImpl.updateAdvertInfo(BeanConvertUtil.beanCovertMap(advertPo));
+ return saveFlag;
+ }
+
+ @Override
+ public int deleteAdvert(@RequestBody AdvertPo advertPo) {
+ advertPo.setStatusCd("1");
+ int saveFlag = advertV1ServiceDaoImpl.updateAdvertInfo(BeanConvertUtil.beanCovertMap(advertPo));
+ return saveFlag;
+ }
+
+ @Override
+ public List<AdvertDto> queryAdverts(@RequestBody AdvertDto advertDto) {
+
+ //鏍¢獙鏄惁浼犱簡 鍒嗛〉淇℃伅
+
+ int page = advertDto.getPage();
+
+ if (page != PageDto.DEFAULT_PAGE) {
+ advertDto.setPage((page - 1) * advertDto.getRow());
+ }
+
+ List<AdvertDto> adverts = BeanConvertUtil.covertBeanList(advertV1ServiceDaoImpl.getAdvertInfo(BeanConvertUtil.beanCovertMap(advertDto)), AdvertDto.class);
+
+ return adverts;
+ }
+
+
+ @Override
+ public int queryAdvertsCount(@RequestBody AdvertDto advertDto) {
+ return advertV1ServiceDaoImpl.queryAdvertsCount(BeanConvertUtil.beanCovertMap(advertDto)); }
+
+}
--
Gitblit v1.8.0