| New file |
| | |
| | | package com.java110.dto.groupBuyProduct; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 拼团产品数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class GroupBuyProductDto extends PageDto implements Serializable { |
| | | |
| | | private String groupProdName; |
| | | private String productId; |
| | | private String userCount; |
| | | private String groupId; |
| | | private String groupProdDesc; |
| | | private String sort; |
| | | private String state; |
| | | private String storeId; |
| | | private String batchId; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getGroupProdName() { |
| | | return groupProdName; |
| | | } |
| | | public void setGroupProdName(String groupProdName) { |
| | | this.groupProdName = groupProdName; |
| | | } |
| | | public String getProductId() { |
| | | return productId; |
| | | } |
| | | public void setProductId(String productId) { |
| | | this.productId = productId; |
| | | } |
| | | public String getUserCount() { |
| | | return userCount; |
| | | } |
| | | public void setUserCount(String userCount) { |
| | | this.userCount = userCount; |
| | | } |
| | | public String getGroupId() { |
| | | return groupId; |
| | | } |
| | | public void setGroupId(String groupId) { |
| | | this.groupId = groupId; |
| | | } |
| | | public String getGroupProdDesc() { |
| | | return groupProdDesc; |
| | | } |
| | | public void setGroupProdDesc(String groupProdDesc) { |
| | | this.groupProdDesc = groupProdDesc; |
| | | } |
| | | public String getSort() { |
| | | return sort; |
| | | } |
| | | public void setSort(String sort) { |
| | | this.sort = sort; |
| | | } |
| | | public String getState() { |
| | | return state; |
| | | } |
| | | public void setState(String state) { |
| | | this.state = state; |
| | | } |
| | | public String getStoreId() { |
| | | return storeId; |
| | | } |
| | | public void setStoreId(String storeId) { |
| | | this.storeId = storeId; |
| | | } |
| | | public String getBatchId() { |
| | | return batchId; |
| | | } |
| | | public void setBatchId(String batchId) { |
| | | this.batchId = batchId; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.dto.groupBuySetting; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 拼团设置数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class GroupBuySettingDto extends PageDto implements Serializable { |
| | | |
| | | private String groupBuyName; |
| | | private String groupBuyDesc; |
| | | private String validHours; |
| | | private String startTime; |
| | | private String endTime; |
| | | private String storeId; |
| | | private String settingId; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getGroupBuyName() { |
| | | return groupBuyName; |
| | | } |
| | | |
| | | public void setGroupBuyName(String groupBuyName) { |
| | | this.groupBuyName = groupBuyName; |
| | | } |
| | | |
| | | public String getGroupBuyDesc() { |
| | | return groupBuyDesc; |
| | | } |
| | | |
| | | public void setGroupBuyDesc(String groupBuyDesc) { |
| | | this.groupBuyDesc = groupBuyDesc; |
| | | } |
| | | |
| | | public String getValidHours() { |
| | | return validHours; |
| | | } |
| | | |
| | | public void setValidHours(String validHours) { |
| | | this.validHours = validHours; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public String getStoreId() { |
| | | return storeId; |
| | | } |
| | | |
| | | public void setStoreId(String storeId) { |
| | | this.storeId = storeId; |
| | | } |
| | | |
| | | public String getSettingId() { |
| | | return settingId; |
| | | } |
| | | |
| | | public void setSettingId(String settingId) { |
| | | this.settingId = settingId; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.po.groupBuyProduct; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class GroupBuyProductPo implements Serializable { |
| | | |
| | | private String groupProdName; |
| | | private String productId; |
| | | private String userCount; |
| | | private String groupId; |
| | | private String groupProdDesc; |
| | | private String statusCd = "0"; |
| | | private String sort; |
| | | private String state; |
| | | private String storeId; |
| | | private String batchId; |
| | | public String getGroupProdName() { |
| | | return groupProdName; |
| | | } |
| | | public void setGroupProdName(String groupProdName) { |
| | | this.groupProdName = groupProdName; |
| | | } |
| | | public String getProductId() { |
| | | return productId; |
| | | } |
| | | public void setProductId(String productId) { |
| | | this.productId = productId; |
| | | } |
| | | public String getUserCount() { |
| | | return userCount; |
| | | } |
| | | public void setUserCount(String userCount) { |
| | | this.userCount = userCount; |
| | | } |
| | | public String getGroupId() { |
| | | return groupId; |
| | | } |
| | | public void setGroupId(String groupId) { |
| | | this.groupId = groupId; |
| | | } |
| | | public String getGroupProdDesc() { |
| | | return groupProdDesc; |
| | | } |
| | | public void setGroupProdDesc(String groupProdDesc) { |
| | | this.groupProdDesc = groupProdDesc; |
| | | } |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | public String getSort() { |
| | | return sort; |
| | | } |
| | | public void setSort(String sort) { |
| | | this.sort = sort; |
| | | } |
| | | public String getState() { |
| | | return state; |
| | | } |
| | | public void setState(String state) { |
| | | this.state = state; |
| | | } |
| | | public String getStoreId() { |
| | | return storeId; |
| | | } |
| | | public void setStoreId(String storeId) { |
| | | this.storeId = storeId; |
| | | } |
| | | public String getBatchId() { |
| | | return batchId; |
| | | } |
| | | public void setBatchId(String batchId) { |
| | | this.batchId = batchId; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.po.groupBuySetting; |
| | | |
| | | import java.io.Serializable; |
| | | |
| | | public class GroupBuySettingPo implements Serializable { |
| | | |
| | | private String groupBuyName; |
| | | private String groupBuyDesc; |
| | | private String validHours; |
| | | private String startTime; |
| | | private String statusCd = "0"; |
| | | private String endTime; |
| | | private String storeId; |
| | | private String settingId; |
| | | |
| | | public String getGroupBuyName() { |
| | | return groupBuyName; |
| | | } |
| | | |
| | | public void setGroupBuyName(String groupBuyName) { |
| | | this.groupBuyName = groupBuyName; |
| | | } |
| | | |
| | | public String getGroupBuyDesc() { |
| | | return groupBuyDesc; |
| | | } |
| | | |
| | | public void setGroupBuyDesc(String groupBuyDesc) { |
| | | this.groupBuyDesc = groupBuyDesc; |
| | | } |
| | | |
| | | public String getValidHours() { |
| | | return validHours; |
| | | } |
| | | |
| | | public void setValidHours(String validHours) { |
| | | this.validHours = validHours; |
| | | } |
| | | |
| | | public String getStartTime() { |
| | | return startTime; |
| | | } |
| | | |
| | | public void setStartTime(String startTime) { |
| | | this.startTime = startTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | |
| | | public String getEndTime() { |
| | | return endTime; |
| | | } |
| | | |
| | | public void setEndTime(String endTime) { |
| | | this.endTime = endTime; |
| | | } |
| | | |
| | | public String getStoreId() { |
| | | return storeId; |
| | | } |
| | | |
| | | public void setStoreId(String storeId) { |
| | | this.storeId = storeId; |
| | | } |
| | | |
| | | public String getSettingId() { |
| | | return settingId; |
| | | } |
| | | |
| | | public void setSettingId(String settingId) { |
| | | this.settingId = settingId; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public static final String CODE_PREFIX_specId = "88"; |
| | | public static final String CODE_PREFIX_productId = "90"; |
| | | public static final String CODE_PREFIX_valueId = "91"; |
| | | public static final String CODE_PREFIX_groupId = "92"; |
| | | |
| | | |
| | | |
| 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="groupBuyProductServiceDaoImpl"> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 保存拼团产品信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveGroupBuyProductInfo" parameterType="Map"> |
| | | insert into group_buy_product( |
| | | group_prod_name,product_id,user_count,group_id,group_prod_desc,sort,state,store_id,batch_id |
| | | ) values ( |
| | | #{groupProdName},#{productId},#{userCount},#{groupId},#{groupProdDesc},#{sort},#{state},#{storeId},#{batchId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询拼团产品信息 add by wuxw 2018-07-03 --> |
| | | <select id="getGroupBuyProductInfo" parameterType="Map" resultType="Map"> |
| | | select t.group_prod_name,t.group_prod_name groupProdName,t.product_id,t.product_id productId,t.user_count,t.user_count userCount,t.group_id,t.group_id groupId,t.group_prod_desc,t.group_prod_desc groupProdDesc,t.status_cd,t.status_cd statusCd,t.sort,t.state,t.store_id,t.store_id storeId,t.batch_id,t.batch_id batchId |
| | | from group_buy_product t |
| | | where 1 =1 |
| | | <if test="groupProdName !=null and groupProdName != ''"> |
| | | and t.group_prod_name= #{groupProdName} |
| | | </if> |
| | | <if test="productId !=null and productId != ''"> |
| | | and t.product_id= #{productId} |
| | | </if> |
| | | <if test="userCount !=null and userCount != ''"> |
| | | and t.user_count= #{userCount} |
| | | </if> |
| | | <if test="groupId !=null and groupId != ''"> |
| | | and t.group_id= #{groupId} |
| | | </if> |
| | | <if test="groupProdDesc !=null and groupProdDesc != ''"> |
| | | and t.group_prod_desc= #{groupProdDesc} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="sort !=null and sort != ''"> |
| | | and t.sort= #{sort} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="batchId !=null and batchId != ''"> |
| | | and t.batch_id= #{batchId} |
| | | </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="updateGroupBuyProductInfo" parameterType="Map"> |
| | | update group_buy_product t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="groupProdName !=null and groupProdName != ''"> |
| | | , t.group_prod_name= #{groupProdName} |
| | | </if> |
| | | <if test="productId !=null and productId != ''"> |
| | | , t.product_id= #{productId} |
| | | </if> |
| | | <if test="userCount !=null and userCount != ''"> |
| | | , t.user_count= #{userCount} |
| | | </if> |
| | | <if test="groupProdDesc !=null and groupProdDesc != ''"> |
| | | , t.group_prod_desc= #{groupProdDesc} |
| | | </if> |
| | | <if test="sort !=null and sort != ''"> |
| | | , t.sort= #{sort} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | , t.state= #{state} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | , t.store_id= #{storeId} |
| | | </if> |
| | | <if test="batchId !=null and batchId != ''"> |
| | | , t.batch_id= #{batchId} |
| | | </if> |
| | | where 1=1 <if test="groupId !=null and groupId != ''"> |
| | | and t.group_id= #{groupId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询拼团产品数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryGroupBuyProductsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from group_buy_product t |
| | | where 1 =1 |
| | | <if test="groupProdName !=null and groupProdName != ''"> |
| | | and t.group_prod_name= #{groupProdName} |
| | | </if> |
| | | <if test="productId !=null and productId != ''"> |
| | | and t.product_id= #{productId} |
| | | </if> |
| | | <if test="userCount !=null and userCount != ''"> |
| | | and t.user_count= #{userCount} |
| | | </if> |
| | | <if test="groupId !=null and groupId != ''"> |
| | | and t.group_id= #{groupId} |
| | | </if> |
| | | <if test="groupProdDesc !=null and groupProdDesc != ''"> |
| | | and t.group_prod_desc= #{groupProdDesc} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="sort !=null and sort != ''"> |
| | | and t.sort= #{sort} |
| | | </if> |
| | | <if test="state !=null and state != ''"> |
| | | and t.state= #{state} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="batchId !=null and batchId != ''"> |
| | | and t.batch_id= #{batchId} |
| | | </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="groupBuySettingServiceDaoImpl"> |
| | | |
| | | |
| | | <!-- 保存拼团设置信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveGroupBuySettingInfo" parameterType="Map"> |
| | | insert into group_buy_setting( |
| | | group_buy_name,group_buy_desc,valid_hours,start_time,end_time,store_id,setting_id |
| | | ) values ( |
| | | #{groupBuyName},#{groupBuyDesc},#{validHours},#{startTime},#{endTime},#{storeId},#{settingId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询拼团设置信息 add by wuxw 2018-07-03 --> |
| | | <select id="getGroupBuySettingInfo" parameterType="Map" resultType="Map"> |
| | | select t.group_buy_name,t.group_buy_name groupBuyName,t.group_buy_desc,t.group_buy_desc |
| | | groupBuyDesc,t.valid_hours,t.valid_hours validHours,t.start_time,t.start_time startTime,t.status_cd,t.status_cd |
| | | statusCd,t.end_time,t.end_time endTime,t.store_id,t.store_id storeId,t.setting_id,t.setting_id settingId |
| | | from group_buy_setting t |
| | | where 1 =1 |
| | | <if test="groupBuyName !=null and groupBuyName != ''"> |
| | | and t.group_buy_name= #{groupBuyName} |
| | | </if> |
| | | <if test="groupBuyDesc !=null and groupBuyDesc != ''"> |
| | | and t.group_buy_desc= #{groupBuyDesc} |
| | | </if> |
| | | <if test="validHours !=null and validHours != ''"> |
| | | and t.valid_hours= #{validHours} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and t.start_time= #{startTime} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="settingId !=null and settingId != ''"> |
| | | and t.setting_id= #{settingId} |
| | | </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="updateGroupBuySettingInfo" parameterType="Map"> |
| | | update group_buy_setting t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="groupBuyName !=null and groupBuyName != ''"> |
| | | , t.group_buy_name= #{groupBuyName} |
| | | </if> |
| | | <if test="groupBuyDesc !=null and groupBuyDesc != ''"> |
| | | , t.group_buy_desc= #{groupBuyDesc} |
| | | </if> |
| | | <if test="validHours !=null and validHours != ''"> |
| | | , t.valid_hours= #{validHours} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | , t.start_time= #{startTime} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | , t.end_time= #{endTime} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | , t.store_id= #{storeId} |
| | | </if> |
| | | where 1=1 |
| | | <if test="settingId !=null and settingId != ''"> |
| | | and t.setting_id= #{settingId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询拼团设置数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryGroupBuySettingsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from group_buy_setting t |
| | | where 1 =1 |
| | | <if test="groupBuyName !=null and groupBuyName != ''"> |
| | | and t.group_buy_name= #{groupBuyName} |
| | | </if> |
| | | <if test="groupBuyDesc !=null and groupBuyDesc != ''"> |
| | | and t.group_buy_desc= #{groupBuyDesc} |
| | | </if> |
| | | <if test="validHours !=null and validHours != ''"> |
| | | and t.valid_hours= #{validHours} |
| | | </if> |
| | | <if test="startTime !=null and startTime != ''"> |
| | | and t.start_time= #{startTime} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="endTime !=null and endTime != ''"> |
| | | and t.end_time= #{endTime} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="settingId !=null and settingId != ''"> |
| | | and t.setting_id= #{settingId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | { |
| | | "autoMove": true, |
| | | "id": "detailId", |
| | | "name": "productDetail", |
| | | "desc": "产品属性", |
| | | "id": "specId", |
| | | "name": "groupBuyProductSpec", |
| | | "desc": "拼团产品规格", |
| | | "shareParam": "storeId", |
| | | "shareColumn": "store_id", |
| | | "shareName": "goods", |
| | | "tableName": "product_detail", |
| | | "tableName": "group_buy_product_spec", |
| | | "param": { |
| | | "storeId": "store_id", |
| | | "specId": "spec_id", |
| | | "productId": "product_id", |
| | | "detailId": "detail_id", |
| | | "content": "content", |
| | | "groupStock": "group_stock", |
| | | "groupSales": "group_sales", |
| | | "groupPrice": "group_price", |
| | | "defaultShow": "default_show", |
| | | "storeId": "store_id", |
| | | "statusCd": "status_cd" |
| | | }, |
| | | "required": [ |
| | | { |
| | | "code": "groupStock", |
| | | "msg": "拼团产品库存不能为空" |
| | | }, |
| | | { |
| | | "code": "groupSales", |
| | | "msg": "拼团销售不能为空" |
| | | }, |
| | | { |
| | | "code": "defaultShow", |
| | | "msg": "默认显示不能为空" |
| | | }, |
| | | { |
| | | "code": "productId", |
| | | "msg": "产品不能为空" |
| | | }, |
| | | { |
| | | "code": "storeId", |
| | | "msg": "商户ID不能为空" |
| | | }, |
| | | { |
| | | "code": "content", |
| | | "msg": "产品详情不能为空" |
| | | "msg": "商品不能为空" |
| | | } |
| | | ] |
| | | } |
| New file |
| | |
| | | package com.java110.intf; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.groupBuyProduct.GroupBuyProductDto; |
| | | import com.java110.po.groupBuyProduct.GroupBuyProductPo; |
| | | 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; |
| | | |
| | | /** |
| | | * @ClassName IGroupBuyProductInnerServiceSMO |
| | | * @Description 拼团产品接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "goods-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/groupBuyProductApi") |
| | | public interface IGroupBuyProductInnerServiceSMO { |
| | | |
| | | |
| | | @RequestMapping(value = "/saveGroupBuyProduct", method = RequestMethod.POST) |
| | | public int saveGroupBuyProduct(@RequestBody GroupBuyProductPo groupBuyProductPo); |
| | | |
| | | @RequestMapping(value = "/updateGroupBuyProduct", method = RequestMethod.POST) |
| | | public int updateGroupBuyProduct(@RequestBody GroupBuyProductPo groupBuyProductPo); |
| | | |
| | | @RequestMapping(value = "/deleteGroupBuyProduct", method = RequestMethod.POST) |
| | | public int deleteGroupBuyProduct(@RequestBody GroupBuyProductPo groupBuyProductPo); |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * @param groupBuyProductDto 数据对象分享 |
| | | * @return GroupBuyProductDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryGroupBuyProducts", method = RequestMethod.POST) |
| | | List<GroupBuyProductDto> queryGroupBuyProducts(@RequestBody GroupBuyProductDto groupBuyProductDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param groupBuyProductDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryGroupBuyProductsCount", method = RequestMethod.POST) |
| | | int queryGroupBuyProductsCount(@RequestBody GroupBuyProductDto groupBuyProductDto); |
| | | } |
| New file |
| | |
| | | package com.java110.intf; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.groupBuySetting.GroupBuySettingDto; |
| | | import com.java110.po.groupBuySetting.GroupBuySettingPo; |
| | | 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; |
| | | |
| | | /** |
| | | * @ClassName IGroupBuySettingInnerServiceSMO |
| | | * @Description 拼团设置接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "goods-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/groupBuySettingApi") |
| | | public interface IGroupBuySettingInnerServiceSMO { |
| | | |
| | | |
| | | @RequestMapping(value = "/saveGroupBuySetting", method = RequestMethod.POST) |
| | | public int saveGroupBuySetting(@RequestBody GroupBuySettingPo groupBuySettingPo); |
| | | |
| | | @RequestMapping(value = "/updateGroupBuySetting", method = RequestMethod.POST) |
| | | public int updateGroupBuySetting(@RequestBody GroupBuySettingPo groupBuySettingPo); |
| | | |
| | | @RequestMapping(value = "/deleteGroupBuySetting", method = RequestMethod.POST) |
| | | public int deleteGroupBuySetting(@RequestBody GroupBuySettingPo groupBuySettingPo); |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * @param groupBuySettingDto 数据对象分享 |
| | | * @return GroupBuySettingDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryGroupBuySettings", method = RequestMethod.POST) |
| | | List<GroupBuySettingDto> queryGroupBuySettings(@RequestBody GroupBuySettingDto groupBuySettingDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param groupBuySettingDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryGroupBuySettingsCount", method = RequestMethod.POST) |
| | | int queryGroupBuySettingsCount(@RequestBody GroupBuySettingDto groupBuySettingDto); |
| | | } |
| | |
| | | public ResponseEntity<String> queryPreMeterWater(@RequestParam(value = "communityId") String communityId, |
| | | @RequestParam(value = "objId") String objId, |
| | | @RequestParam(value = "objType") String objType, |
| | | @RequestParam(value = "roomNum" ,required = false) String roomNum) { |
| | | @RequestParam(value = "roomNum" ,required = false) String roomNum, |
| | | @RequestParam(value = "meterType",required = false) String meterType) { |
| | | MeterWaterDto meterWaterDto = new MeterWaterDto(); |
| | | meterWaterDto.setObjId(objId); |
| | | meterWaterDto.setObjType(objType); |
| | | meterWaterDto.setPage(1); |
| | | meterWaterDto.setRow(1); |
| | | meterWaterDto.setCommunityId(communityId); |
| | | meterWaterDto.setMeterType(meterType); |
| | | return queryPreMeterWaterImpl.query(meterWaterDto,roomNum); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.store.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.dto.groupBuyProduct.GroupBuyProductDto; |
| | | import com.java110.dto.groupBuySetting.GroupBuySettingDto; |
| | | import com.java110.goods.bmo.groupBuyProduct.IDeleteGroupBuyProductBMO; |
| | | import com.java110.goods.bmo.groupBuyProduct.IGetGroupBuyProductBMO; |
| | | import com.java110.goods.bmo.groupBuyProduct.ISaveGroupBuyProductBMO; |
| | | import com.java110.goods.bmo.groupBuyProduct.IUpdateGroupBuyProductBMO; |
| | | import com.java110.goods.bmo.groupBuySetting.IDeleteGroupBuySettingBMO; |
| | | import com.java110.goods.bmo.groupBuySetting.IGetGroupBuySettingBMO; |
| | | import com.java110.goods.bmo.groupBuySetting.ISaveGroupBuySettingBMO; |
| | | import com.java110.goods.bmo.groupBuySetting.IUpdateGroupBuySettingBMO; |
| | | import com.java110.po.groupBuyProduct.GroupBuyProductPo; |
| | | import com.java110.po.groupBuySetting.GroupBuySettingPo; |
| | | import com.java110.utils.util.Assert; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping(value = "/groupBuyProduct") |
| | | public class GroupBuyProductApi { |
| | | |
| | | @Autowired |
| | | private ISaveGroupBuyProductBMO saveGroupBuyProductBMOImpl; |
| | | @Autowired |
| | | private IUpdateGroupBuyProductBMO updateGroupBuyProductBMOImpl; |
| | | @Autowired |
| | | private IDeleteGroupBuyProductBMO deleteGroupBuyProductBMOImpl; |
| | | |
| | | @Autowired |
| | | private IGetGroupBuyProductBMO getGroupBuyProductBMOImpl; |
| | | |
| | | @Autowired |
| | | private ISaveGroupBuySettingBMO saveGroupBuySettingBMOImpl; |
| | | @Autowired |
| | | private IUpdateGroupBuySettingBMO updateGroupBuySettingBMOImpl; |
| | | @Autowired |
| | | private IDeleteGroupBuySettingBMO deleteGroupBuySettingBMOImpl; |
| | | |
| | | @Autowired |
| | | private IGetGroupBuySettingBMO getGroupBuySettingBMOImpl; |
| | | |
| | | /** |
| | | * 微信保存消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /groupBuyProduct/saveGroupBuyProduct |
| | | * @path /app/groupBuyProduct/saveGroupBuyProduct |
| | | */ |
| | | @RequestMapping(value = "/saveGroupBuyProduct", method = RequestMethod.POST) |
| | | public ResponseEntity<String> saveGroupBuyProduct(@RequestBody JSONObject reqJson, @RequestHeader(value = "store-id") String storeId) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "groupProdName", "请求报文中未包含groupProdName"); |
| | | Assert.hasKeyAndValue(reqJson, "productId", "请求报文中未包含productId"); |
| | | Assert.hasKeyAndValue(reqJson, "groupProdDesc", "请求报文中未包含groupProdDesc"); |
| | | Assert.hasKeyAndValue(reqJson, "sort", "请求报文中未包含sort"); |
| | | |
| | | |
| | | GroupBuyProductPo groupBuyProductPo = BeanConvertUtil.covertBean(reqJson, GroupBuyProductPo.class); |
| | | groupBuyProductPo.setStoreId(storeId); |
| | | return saveGroupBuyProductBMOImpl.save(groupBuyProductPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信修改消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /groupBuyProduct/updateGroupBuyProduct |
| | | * @path /app/groupBuyProduct/updateGroupBuyProduct |
| | | */ |
| | | @RequestMapping(value = "/updateGroupBuyProduct", method = RequestMethod.POST) |
| | | public ResponseEntity<String> updateGroupBuyProduct(@RequestBody JSONObject reqJson, @RequestHeader(value = "store-id") String storeId) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "groupProdName", "请求报文中未包含groupProdName"); |
| | | Assert.hasKeyAndValue(reqJson, "productId", "请求报文中未包含productId"); |
| | | Assert.hasKeyAndValue(reqJson, "groupProdDesc", "请求报文中未包含groupProdDesc"); |
| | | Assert.hasKeyAndValue(reqJson, "sort", "请求报文中未包含sort"); |
| | | Assert.hasKeyAndValue(reqJson, "groupId", "groupId不能为空"); |
| | | |
| | | |
| | | GroupBuyProductPo groupBuyProductPo = BeanConvertUtil.covertBean(reqJson, GroupBuyProductPo.class); |
| | | groupBuyProductPo.setStoreId(storeId); |
| | | return updateGroupBuyProductBMOImpl.update(groupBuyProductPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /groupBuyProduct/deleteGroupBuyProduct |
| | | * @path /app/groupBuyProduct/deleteGroupBuyProduct |
| | | */ |
| | | @RequestMapping(value = "/deleteGroupBuyProduct", method = RequestMethod.POST) |
| | | public ResponseEntity<String> deleteGroupBuyProduct(@RequestBody JSONObject reqJson, @RequestHeader(value = "store-id") String storeId) { |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "groupId", "groupId不能为空"); |
| | | |
| | | |
| | | GroupBuyProductPo groupBuyProductPo = BeanConvertUtil.covertBean(reqJson, GroupBuyProductPo.class); |
| | | groupBuyProductPo.setStoreId(storeId); |
| | | return deleteGroupBuyProductBMOImpl.delete(groupBuyProductPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param storeId 商户 |
| | | * @return |
| | | * @serviceCode /groupBuyProduct/queryGroupBuyProduct |
| | | * @path /app/groupBuyProduct/queryGroupBuyProduct |
| | | */ |
| | | @RequestMapping(value = "/queryGroupBuyProduct", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryGroupBuyProduct(@RequestHeader(value = "store-id") String storeId, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | GroupBuyProductDto groupBuyProductDto = new GroupBuyProductDto(); |
| | | groupBuyProductDto.setPage(page); |
| | | groupBuyProductDto.setRow(row); |
| | | groupBuyProductDto.setStoreId(storeId); |
| | | return getGroupBuyProductBMOImpl.get(groupBuyProductDto); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 微信保存消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /groupBuySetting/saveGroupBuySetting |
| | | * @path /app/groupBuySetting/saveGroupBuySetting |
| | | */ |
| | | @RequestMapping(value = "/saveGroupBuySetting", method = RequestMethod.POST) |
| | | public ResponseEntity<String> saveGroupBuySetting(@RequestBody JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "groupBuyName", "请求报文中未包含groupBuyName"); |
| | | Assert.hasKeyAndValue(reqJson, "validHours", "请求报文中未包含validHours"); |
| | | Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime"); |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime"); |
| | | |
| | | |
| | | GroupBuySettingPo groupBuySettingPo = BeanConvertUtil.covertBean(reqJson, GroupBuySettingPo.class); |
| | | return saveGroupBuySettingBMOImpl.save(groupBuySettingPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信修改消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /groupBuySetting/updateGroupBuySetting |
| | | * @path /app/groupBuySetting/updateGroupBuySetting |
| | | */ |
| | | @RequestMapping(value = "/updateGroupBuySetting", method = RequestMethod.POST) |
| | | public ResponseEntity<String> updateGroupBuySetting(@RequestBody JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "groupBuyName", "请求报文中未包含groupBuyName"); |
| | | Assert.hasKeyAndValue(reqJson, "validHours", "请求报文中未包含validHours"); |
| | | Assert.hasKeyAndValue(reqJson, "startTime", "请求报文中未包含startTime"); |
| | | Assert.hasKeyAndValue(reqJson, "endTime", "请求报文中未包含endTime"); |
| | | Assert.hasKeyAndValue(reqJson, "settingId", "settingId不能为空"); |
| | | |
| | | |
| | | GroupBuySettingPo groupBuySettingPo = BeanConvertUtil.covertBean(reqJson, GroupBuySettingPo.class); |
| | | return updateGroupBuySettingBMOImpl.update(groupBuySettingPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /groupBuySetting/deleteGroupBuySetting |
| | | * @path /app/groupBuySetting/deleteGroupBuySetting |
| | | */ |
| | | @RequestMapping(value = "/deleteGroupBuySetting", method = RequestMethod.POST) |
| | | public ResponseEntity<String> deleteGroupBuySetting(@RequestBody JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "settingId", "settingId不能为空"); |
| | | |
| | | |
| | | GroupBuySettingPo groupBuySettingPo = BeanConvertUtil.covertBean(reqJson, GroupBuySettingPo.class); |
| | | return deleteGroupBuySettingBMOImpl.delete(groupBuySettingPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param storeId 商户ID |
| | | * @return |
| | | * @serviceCode /groupBuySetting/queryGroupBuySetting |
| | | * @path /app/groupBuySetting/queryGroupBuySetting |
| | | */ |
| | | @RequestMapping(value = "/queryGroupBuySetting", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryGroupBuySetting(@RequestHeader(value = "store-id") String storeId, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | GroupBuySettingDto groupBuySettingDto = new GroupBuySettingDto(); |
| | | groupBuySettingDto.setPage(page); |
| | | groupBuySettingDto.setRow(row); |
| | | groupBuySettingDto.setStoreId(storeId); |
| | | return getGroupBuySettingBMOImpl.get(groupBuySettingDto); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyProduct; |
| | | |
| | | import com.java110.po.groupBuyProduct.GroupBuyProductPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IDeleteGroupBuyProductBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改拼团产品 |
| | | * add by wuxw |
| | | * |
| | | * @param groupBuyProductPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> delete(GroupBuyProductPo groupBuyProductPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyProduct; |
| | | |
| | | import com.java110.dto.groupBuyProduct.GroupBuyProductDto; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IGetGroupBuyProductBMO { |
| | | |
| | | |
| | | /** |
| | | * 查询拼团产品 |
| | | * add by wuxw |
| | | * |
| | | * @param groupBuyProductDto |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> get(GroupBuyProductDto groupBuyProductDto); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyProduct; |
| | | |
| | | import com.java110.po.groupBuyProduct.GroupBuyProductPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface ISaveGroupBuyProductBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加拼团产品 |
| | | * add by wuxw |
| | | * |
| | | * @param groupBuyProductPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> save(GroupBuyProductPo groupBuyProductPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyProduct; |
| | | |
| | | import com.java110.po.groupBuyProduct.GroupBuyProductPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IUpdateGroupBuyProductBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改拼团产品 |
| | | * add by wuxw |
| | | * |
| | | * @param groupBuyProductPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> update(GroupBuyProductPo groupBuyProductPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyProduct.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.goods.bmo.groupBuyProduct.IDeleteGroupBuyProductBMO; |
| | | import com.java110.intf.IGroupBuyProductInnerServiceSMO; |
| | | import com.java110.po.groupBuyProduct.GroupBuyProductPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("deleteGroupBuyProductBMOImpl") |
| | | public class DeleteGroupBuyProductBMOImpl implements IDeleteGroupBuyProductBMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuyProductInnerServiceSMO groupBuyProductInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param groupBuyProductPo 数据 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> delete(GroupBuyProductPo groupBuyProductPo) { |
| | | |
| | | int flag = groupBuyProductInnerServiceSMOImpl.deleteGroupBuyProduct(groupBuyProductPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyProduct.impl; |
| | | |
| | | import com.java110.dto.groupBuyProduct.GroupBuyProductDto; |
| | | import com.java110.goods.bmo.groupBuyProduct.IGetGroupBuyProductBMO; |
| | | import com.java110.intf.IGroupBuyProductInnerServiceSMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service("getGroupBuyProductBMOImpl") |
| | | public class GetGroupBuyProductBMOImpl implements IGetGroupBuyProductBMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuyProductInnerServiceSMO groupBuyProductInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param groupBuyProductDto |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public ResponseEntity<String> get(GroupBuyProductDto groupBuyProductDto) { |
| | | |
| | | |
| | | int count = groupBuyProductInnerServiceSMOImpl.queryGroupBuyProductsCount(groupBuyProductDto); |
| | | |
| | | List<GroupBuyProductDto> groupBuyProductDtos = null; |
| | | if (count > 0) { |
| | | groupBuyProductDtos = groupBuyProductInnerServiceSMOImpl.queryGroupBuyProducts(groupBuyProductDto); |
| | | } else { |
| | | groupBuyProductDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) groupBuyProductDto.getRow()), count, groupBuyProductDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyProduct.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.goods.bmo.groupBuyProduct.ISaveGroupBuyProductBMO; |
| | | import com.java110.intf.IGroupBuyProductInnerServiceSMO; |
| | | import com.java110.po.groupBuyProduct.GroupBuyProductPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("saveGroupBuyProductBMOImpl") |
| | | public class SaveGroupBuyProductBMOImpl implements ISaveGroupBuyProductBMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuyProductInnerServiceSMO groupBuyProductInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param groupBuyProductPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> save(GroupBuyProductPo groupBuyProductPo) { |
| | | |
| | | groupBuyProductPo.setGroupId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_groupId)); |
| | | int flag = groupBuyProductInnerServiceSMOImpl.saveGroupBuyProduct(groupBuyProductPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyProduct.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.goods.bmo.groupBuyProduct.IUpdateGroupBuyProductBMO; |
| | | import com.java110.intf.IGroupBuyProductInnerServiceSMO; |
| | | import com.java110.po.groupBuyProduct.GroupBuyProductPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("updateGroupBuyProductBMOImpl") |
| | | public class UpdateGroupBuyProductBMOImpl implements IUpdateGroupBuyProductBMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuyProductInnerServiceSMO groupBuyProductInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param groupBuyProductPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> update(GroupBuyProductPo groupBuyProductPo) { |
| | | |
| | | int flag = groupBuyProductInnerServiceSMOImpl.updateGroupBuyProduct(groupBuyProductPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuySetting; |
| | | import com.java110.po.groupBuySetting.GroupBuySettingPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IDeleteGroupBuySettingBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改拼团设置 |
| | | * add by wuxw |
| | | * @param groupBuySettingPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> delete(GroupBuySettingPo groupBuySettingPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuySetting; |
| | | import com.java110.dto.groupBuySetting.GroupBuySettingDto; |
| | | import org.springframework.http.ResponseEntity; |
| | | public interface IGetGroupBuySettingBMO { |
| | | |
| | | |
| | | /** |
| | | * 查询拼团设置 |
| | | * add by wuxw |
| | | * @param groupBuySettingDto |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> get(GroupBuySettingDto groupBuySettingDto); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuySetting; |
| | | |
| | | import com.java110.po.groupBuySetting.GroupBuySettingPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface ISaveGroupBuySettingBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加拼团设置 |
| | | * add by wuxw |
| | | * |
| | | * @param groupBuySettingPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> save(GroupBuySettingPo groupBuySettingPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuySetting; |
| | | import com.java110.po.groupBuySetting.GroupBuySettingPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IUpdateGroupBuySettingBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改拼团设置 |
| | | * add by wuxw |
| | | * @param groupBuySettingPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> update(GroupBuySettingPo groupBuySettingPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuySetting.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.goods.bmo.groupBuySetting.IDeleteGroupBuySettingBMO; |
| | | import com.java110.intf.IGroupBuySettingInnerServiceSMO; |
| | | import com.java110.po.groupBuySetting.GroupBuySettingPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("deleteGroupBuySettingBMOImpl") |
| | | public class DeleteGroupBuySettingBMOImpl implements IDeleteGroupBuySettingBMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuySettingInnerServiceSMO groupBuySettingInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param groupBuySettingPo 数据 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> delete(GroupBuySettingPo groupBuySettingPo) { |
| | | |
| | | int flag = groupBuySettingInnerServiceSMOImpl.deleteGroupBuySetting(groupBuySettingPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuySetting.impl; |
| | | |
| | | import com.java110.dto.groupBuySetting.GroupBuySettingDto; |
| | | import com.java110.goods.bmo.groupBuySetting.IGetGroupBuySettingBMO; |
| | | import com.java110.intf.IGroupBuySettingInnerServiceSMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | @Service("getGroupBuySettingBMOImpl") |
| | | public class GetGroupBuySettingBMOImpl implements IGetGroupBuySettingBMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuySettingInnerServiceSMO groupBuySettingInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param groupBuySettingDto |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public ResponseEntity<String> get(GroupBuySettingDto groupBuySettingDto) { |
| | | |
| | | |
| | | int count = groupBuySettingInnerServiceSMOImpl.queryGroupBuySettingsCount(groupBuySettingDto); |
| | | |
| | | List<GroupBuySettingDto> groupBuySettingDtos = null; |
| | | if (count > 0) { |
| | | groupBuySettingDtos = groupBuySettingInnerServiceSMOImpl.queryGroupBuySettings(groupBuySettingDto); |
| | | } else { |
| | | groupBuySettingDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) groupBuySettingDto.getRow()), count, groupBuySettingDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuySetting.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.goods.bmo.groupBuySetting.ISaveGroupBuySettingBMO; |
| | | import com.java110.intf.IGroupBuySettingInnerServiceSMO; |
| | | import com.java110.po.groupBuySetting.GroupBuySettingPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("saveGroupBuySettingBMOImpl") |
| | | public class SaveGroupBuySettingBMOImpl implements ISaveGroupBuySettingBMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuySettingInnerServiceSMO groupBuySettingInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param groupBuySettingPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> save(GroupBuySettingPo groupBuySettingPo) { |
| | | |
| | | groupBuySettingPo.setSettingId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_settingId)); |
| | | int flag = groupBuySettingInnerServiceSMOImpl.saveGroupBuySetting(groupBuySettingPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuySetting.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.goods.bmo.groupBuySetting.IUpdateGroupBuySettingBMO; |
| | | import com.java110.intf.IGroupBuySettingInnerServiceSMO; |
| | | import com.java110.po.groupBuySetting.GroupBuySettingPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("updateGroupBuySettingBMOImpl") |
| | | public class UpdateGroupBuySettingBMOImpl implements IUpdateGroupBuySettingBMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuySettingInnerServiceSMO groupBuySettingInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param groupBuySettingPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> update(GroupBuySettingPo groupBuySettingPo) { |
| | | |
| | | int flag = groupBuySettingInnerServiceSMOImpl.updateGroupBuySetting(groupBuySettingPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.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; |
| | | |
| | | /** |
| | | * 拼团产品组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 拼团产品服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface IGroupBuyProductServiceDao { |
| | | |
| | | |
| | | /** |
| | | * 保存 拼团产品信息 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveGroupBuyProductInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询拼团产品信息(instance过程) |
| | | * 根据bId 查询拼团产品信息 |
| | | * @param info bId 信息 |
| | | * @return 拼团产品信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getGroupBuyProductInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改拼团产品信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateGroupBuyProductInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询拼团产品总数 |
| | | * |
| | | * @param info 拼团产品信息 |
| | | * @return 拼团产品数量 |
| | | */ |
| | | int queryGroupBuyProductsCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.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; |
| | | |
| | | /** |
| | | * 拼团设置组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 拼团设置服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface IGroupBuySettingServiceDao { |
| | | |
| | | |
| | | /** |
| | | * 保存 拼团设置信息 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveGroupBuySettingInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询拼团设置信息(instance过程) |
| | | * 根据bId 查询拼团设置信息 |
| | | * @param info bId 信息 |
| | | * @return 拼团设置信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getGroupBuySettingInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改拼团设置信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateGroupBuySettingInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询拼团设置总数 |
| | | * |
| | | * @param info 拼团设置信息 |
| | | * @return 拼团设置数量 |
| | | */ |
| | | int queryGroupBuySettingsCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.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.goods.dao.IGroupBuyProductServiceDao; |
| | | 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; |
| | | |
| | | /** |
| | | * 拼团产品服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("groupBuyProductServiceDaoImpl") |
| | | //@Transactional |
| | | public class GroupBuyProductServiceDaoImpl extends BaseServiceDao implements IGroupBuyProductServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(GroupBuyProductServiceDaoImpl.class); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存拼团产品信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveGroupBuyProductInfo(Map info) throws DAOException { |
| | | logger.debug("保存拼团产品信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("groupBuyProductServiceDaoImpl.saveGroupBuyProductInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存拼团产品信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询拼团产品信息(instance) |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getGroupBuyProductInfo(Map info) throws DAOException { |
| | | logger.debug("查询拼团产品信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessGroupBuyProductInfos = sqlSessionTemplate.selectList("groupBuyProductServiceDaoImpl.getGroupBuyProductInfo",info); |
| | | |
| | | return businessGroupBuyProductInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改拼团产品信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateGroupBuyProductInfo(Map info) throws DAOException { |
| | | logger.debug("修改拼团产品信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("groupBuyProductServiceDaoImpl.updateGroupBuyProductInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改拼团产品信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询拼团产品数量 |
| | | * @param info 拼团产品信息 |
| | | * @return 拼团产品数量 |
| | | */ |
| | | @Override |
| | | public int queryGroupBuyProductsCount(Map info) { |
| | | logger.debug("查询拼团产品数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessGroupBuyProductInfos = sqlSessionTemplate.selectList("groupBuyProductServiceDaoImpl.queryGroupBuyProductsCount", info); |
| | | if (businessGroupBuyProductInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessGroupBuyProductInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.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.goods.dao.IGroupBuySettingServiceDao; |
| | | 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; |
| | | |
| | | /** |
| | | * 拼团设置服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("groupBuySettingServiceDaoImpl") |
| | | //@Transactional |
| | | public class GroupBuySettingServiceDaoImpl extends BaseServiceDao implements IGroupBuySettingServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(GroupBuySettingServiceDaoImpl.class); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存拼团设置信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveGroupBuySettingInfo(Map info) throws DAOException { |
| | | logger.debug("保存拼团设置信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("groupBuySettingServiceDaoImpl.saveGroupBuySettingInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存拼团设置信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询拼团设置信息(instance) |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getGroupBuySettingInfo(Map info) throws DAOException { |
| | | logger.debug("查询拼团设置信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessGroupBuySettingInfos = sqlSessionTemplate.selectList("groupBuySettingServiceDaoImpl.getGroupBuySettingInfo",info); |
| | | |
| | | return businessGroupBuySettingInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改拼团设置信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateGroupBuySettingInfo(Map info) throws DAOException { |
| | | logger.debug("修改拼团设置信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("groupBuySettingServiceDaoImpl.updateGroupBuySettingInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改拼团设置信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询拼团设置数量 |
| | | * @param info 拼团设置信息 |
| | | * @return 拼团设置数量 |
| | | */ |
| | | @Override |
| | | public int queryGroupBuySettingsCount(Map info) { |
| | | logger.debug("查询拼团设置数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessGroupBuySettingInfos = sqlSessionTemplate.selectList("groupBuySettingServiceDaoImpl.queryGroupBuySettingsCount", info); |
| | | if (businessGroupBuySettingInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessGroupBuySettingInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.smo.impl; |
| | | |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.groupBuyProduct.GroupBuyProductDto; |
| | | import com.java110.goods.dao.IGroupBuyProductServiceDao; |
| | | import com.java110.intf.IGroupBuyProductInnerServiceSMO; |
| | | import com.java110.po.groupBuyProduct.GroupBuyProductPo; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 拼团产品内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class GroupBuyProductInnerServiceSMOImpl extends BaseServiceSMO implements IGroupBuyProductInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuyProductServiceDao groupBuyProductServiceDaoImpl; |
| | | |
| | | |
| | | @Override |
| | | public int saveGroupBuyProduct(@RequestBody GroupBuyProductPo groupBuyProductPo) { |
| | | int saveFlag = 1; |
| | | groupBuyProductServiceDaoImpl.saveGroupBuyProductInfo(BeanConvertUtil.beanCovertMap(groupBuyProductPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int updateGroupBuyProduct(@RequestBody GroupBuyProductPo groupBuyProductPo) { |
| | | int saveFlag = 1; |
| | | groupBuyProductServiceDaoImpl.updateGroupBuyProductInfo(BeanConvertUtil.beanCovertMap(groupBuyProductPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteGroupBuyProduct(@RequestBody GroupBuyProductPo groupBuyProductPo) { |
| | | int saveFlag = 1; |
| | | groupBuyProductPo.setStatusCd("1"); |
| | | groupBuyProductServiceDaoImpl.updateGroupBuyProductInfo(BeanConvertUtil.beanCovertMap(groupBuyProductPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public List<GroupBuyProductDto> queryGroupBuyProducts(@RequestBody GroupBuyProductDto groupBuyProductDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = groupBuyProductDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | groupBuyProductDto.setPage((page - 1) * groupBuyProductDto.getRow()); |
| | | } |
| | | |
| | | List<GroupBuyProductDto> groupBuyProducts = BeanConvertUtil.covertBeanList(groupBuyProductServiceDaoImpl.getGroupBuyProductInfo(BeanConvertUtil.beanCovertMap(groupBuyProductDto)), GroupBuyProductDto.class); |
| | | |
| | | return groupBuyProducts; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryGroupBuyProductsCount(@RequestBody GroupBuyProductDto groupBuyProductDto) { |
| | | return groupBuyProductServiceDaoImpl.queryGroupBuyProductsCount(BeanConvertUtil.beanCovertMap(groupBuyProductDto)); |
| | | } |
| | | |
| | | public IGroupBuyProductServiceDao getGroupBuyProductServiceDaoImpl() { |
| | | return groupBuyProductServiceDaoImpl; |
| | | } |
| | | |
| | | public void setGroupBuyProductServiceDaoImpl(IGroupBuyProductServiceDao groupBuyProductServiceDaoImpl) { |
| | | this.groupBuyProductServiceDaoImpl = groupBuyProductServiceDaoImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.goods.smo.impl; |
| | | |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.groupBuySetting.GroupBuySettingDto; |
| | | import com.java110.goods.dao.IGroupBuySettingServiceDao; |
| | | import com.java110.intf.IGroupBuySettingInnerServiceSMO; |
| | | import com.java110.po.groupBuySetting.GroupBuySettingPo; |
| | | import com.java110.utils.util.BeanConvertUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 拼团设置内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class GroupBuySettingInnerServiceSMOImpl extends BaseServiceSMO implements IGroupBuySettingInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuySettingServiceDao groupBuySettingServiceDaoImpl; |
| | | |
| | | |
| | | @Override |
| | | public int saveGroupBuySetting(@RequestBody GroupBuySettingPo groupBuySettingPo) { |
| | | int saveFlag = 1; |
| | | groupBuySettingServiceDaoImpl.saveGroupBuySettingInfo(BeanConvertUtil.beanCovertMap(groupBuySettingPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int updateGroupBuySetting(@RequestBody GroupBuySettingPo groupBuySettingPo) { |
| | | int saveFlag = 1; |
| | | groupBuySettingServiceDaoImpl.updateGroupBuySettingInfo(BeanConvertUtil.beanCovertMap(groupBuySettingPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteGroupBuySetting(@RequestBody GroupBuySettingPo groupBuySettingPo) { |
| | | int saveFlag = 1; |
| | | groupBuySettingPo.setStatusCd("1"); |
| | | groupBuySettingServiceDaoImpl.updateGroupBuySettingInfo(BeanConvertUtil.beanCovertMap(groupBuySettingPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public List<GroupBuySettingDto> queryGroupBuySettings(@RequestBody GroupBuySettingDto groupBuySettingDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = groupBuySettingDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | groupBuySettingDto.setPage((page - 1) * groupBuySettingDto.getRow()); |
| | | } |
| | | |
| | | List<GroupBuySettingDto> groupBuySettings = BeanConvertUtil.covertBeanList(groupBuySettingServiceDaoImpl.getGroupBuySettingInfo(BeanConvertUtil.beanCovertMap(groupBuySettingDto)), GroupBuySettingDto.class); |
| | | |
| | | return groupBuySettings; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryGroupBuySettingsCount(@RequestBody GroupBuySettingDto groupBuySettingDto) { |
| | | return groupBuySettingServiceDaoImpl.queryGroupBuySettingsCount(BeanConvertUtil.beanCovertMap(groupBuySettingDto)); |
| | | } |
| | | |
| | | public IGroupBuySettingServiceDao getGroupBuySettingServiceDaoImpl() { |
| | | return groupBuySettingServiceDaoImpl; |
| | | } |
| | | |
| | | public void setGroupBuySettingServiceDaoImpl(IGroupBuySettingServiceDao groupBuySettingServiceDaoImpl) { |
| | | this.groupBuySettingServiceDaoImpl = groupBuySettingServiceDaoImpl; |
| | | } |
| | | } |