2个文件已删除
4个文件已修改
5 文件已重命名
13个文件已添加
| | |
| | | private String url; |
| | | private String communityId; |
| | | private String seq; |
| | | private String statusCd="0"; |
| | | |
| | | |
| | | public String getAdvertItemId() { |
| | |
| | | public void setSeq(String seq) { |
| | | this.seq = seq; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| | |
| | | private String viewType; |
| | | private String advertType ; |
| | | private String pageUrl ; |
| | | private String statusCd = "0"; |
| | | |
| | | public String getAdvertId() { |
| | | return advertId; |
| | |
| | | public void setPageUrl(String pageUrl) { |
| | | this.pageUrl = pageUrl; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| | |
| | | * 数据格式校验方法 |
| | | * |
| | | * @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; |
| | | } |
| New file |
| | |
| | | <?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> |
| New file |
| | |
| | | <?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> |
| New file |
| | |
| | | /* |
| | | * 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; |
| | | |
| | | /** |
| | | * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用 |
| | | * add by 吴学文 at 2022-06-19 10:12:15 mail: 928255095@qq.com |
| | | * open source address: https://gitee.com/wuxw7/MicroCommunity |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释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); |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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; |
| | | |
| | | /** |
| | | * 类表述: 服务之前调用的接口类,不对外提供接口能力 只用于接口建调用 |
| | | * add by 吴学文 at 2022-06-19 10:07:43 mail: 928255095@qq.com |
| | | * open source address: https://gitee.com/wuxw7/MicroCommunity |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释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); |
| | | } |
| | |
| | | <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> |
| New file |
| | |
| | | /* |
| | | * 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; |
| | | |
| | | /** |
| | | * 类表述:删除 |
| | | * 服务编码:advert.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 |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释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()); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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; |
| | | |
| | | |
| | | /** |
| | | * 类表述:查询 |
| | | * 服务编码:advert.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 |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释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); |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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; |
| | | |
| | | |
| | | /** |
| | | * 类表述:查询 |
| | | * 服务编码:advertItem.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 |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释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()); |
| | | } |
| | | } |
| | | } |
| | | } |
old mode 100755
new mode 100644
| File was renamed from service-api/src/main/java/com/java110/api/listener/advert/ListAdvertPhotoAndVediosListener.java |
| | |
| | | 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; |
| | |
| | | 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(); |
| | |
| | | //查询 单元的广告,没有找 楼栋,再找找不到 就要查小区 |
| | | 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; |
| | | } |
| | | ; |
| | |
| | | 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; |
| | | } |
| | | //房屋找不到,找 单元 |
| | |
| | | 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; |
| | | } |
| | | |
| | |
| | | |
| | | responseEntity = new ResponseEntity<String>(advertPhotoAndVideos.toJSONString(), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | cmdDataFlowContext.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
old mode 100755
new mode 100644
| File was renamed from service-api/src/main/java/com/java110/api/listener/advert/ListAdvertPhotoListener.java |
| | |
| | | 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; |
| | | |
| | |
| | | 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; |
| | |
| | | @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; |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | public IAdvertItemInnerServiceSMO getAdvertItemInnerServiceSMOImpl() { |
| | | return advertItemInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setAdvertItemInnerServiceSMOImpl(IAdvertItemInnerServiceSMO advertItemInnerServiceSMOImpl) { |
| | | this.advertItemInnerServiceSMOImpl = advertItemInnerServiceSMOImpl; |
| | | } |
| | | |
| | | } |
old mode 100755
new mode 100644
| File was renamed from service-api/src/main/java/com/java110/api/listener/advert/ListAdvertsListener.java |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | } |
| | | } |
| | | |
| | | 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; |
| | | } |
| | | } |
old mode 100755
new mode 100644
| File was renamed from service-api/src/main/java/com/java110/api/listener/advert/SaveAdvertListener.java |
| | |
| | | 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 |
| | | * 类表述:保存 |
| | | * 服务编码:advert.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 |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释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; |
| | |
| | | @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", "必填,请选择广告类型"); |
| | |
| | | if (!hasKeyAndValue(reqJson, "photos") && !hasKeyAndValue(reqJson, "vedioName")) { |
| | | throw new IllegalArgumentException("请求报文中没有包含视频或图片"); |
| | | } |
| | | |
| | | } |
| | | |
| | | private boolean hasKeyAndValue(JSONObject paramIn, String key) { |
| | |
| | | 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(); |
| | |
| | | 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("保存广告失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | * @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"); |
| | |
| | | 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("保存广告失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | * @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")); |
| | |
| | | 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; |
| | | } |
| | | } |
old mode 100755
new mode 100644
| File was renamed from service-api/src/main/java/com/java110/api/listener/advert/UpdateAdvertListener.java |
| | |
| | | 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 |
| | | * 类表述:更新 |
| | | * 服务编码:advert.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 |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释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; |
| | |
| | | |
| | | @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", "必填,请选择广告类型"); |
| | |
| | | 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")); |
| | |
| | | |
| | | 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"}); |
| | |
| | | //删除照片或视频 |
| | | 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("保存失败"); |
| | | } |
| | | } |
| | | |
| | | //删除文件和广告的关系 |
| | |
| | | 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("保存失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | 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(); |
| | |
| | | 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("保存广告失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | * @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"); |
| | |
| | | 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("保存广告失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | * @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")); |
| | |
| | | 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; |
| | | } |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行 |
| | | */ |
| | | public interface IAdvertItemV1ServiceDao { |
| | | |
| | | |
| | | /** |
| | | * 保存 广告内容信息 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | int saveAdvertItemInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询广告内容信息(instance过程) |
| | | * 根据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); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释10至20行 加入 20行至30行 |
| | | */ |
| | | public interface IAdvertV1ServiceDao { |
| | | |
| | | |
| | | /** |
| | | * 保存 广告信息 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | int saveAdvertInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询广告信息(instance过程) |
| | | * 根据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); |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释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; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询广告内容信息(instance) |
| | | * @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()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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 |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释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; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询广告信息(instance) |
| | | * @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()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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; |
| | | |
| | | /** |
| | | * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用 |
| | | * add by 吴学文 at 2022-06-19 10:12:15 mail: 928255095@qq.com |
| | | * open source address: https://gitee.com/wuxw7/MicroCommunity |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释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)); } |
| | | |
| | | } |
| New file |
| | |
| | | /* |
| | | * 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; |
| | | |
| | | /** |
| | | * 类表述: 服务之前调用的接口实现类,不对外提供接口能力 只用于接口建调用 |
| | | * add by 吴学文 at 2022-06-19 10:07:43 mail: 928255095@qq.com |
| | | * open source address: https://gitee.com/wuxw7/MicroCommunity |
| | | * 官网:http://www.homecommunity.cn |
| | | * 温馨提示:如果您对此文件进行修改 请不要删除原有作者及注释信息,请补充您的 修改的原因以及联系邮箱如下 |
| | | * // modify by 张三 at 2021-09-12 第10行在某种场景下存在某种bug 需要修复,注释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)); } |
| | | |
| | | } |