| New file |
| | |
| | | package com.java110.dto.groupBuyBatch; |
| | | |
| | | 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 GroupBuyBatchDto extends PageDto implements Serializable { |
| | | |
| | | private String batchEndTime; |
| | | private String batchId; |
| | | private String storeId; |
| | | private String settingId; |
| | | private String batchStartTime; |
| | | private String curBatch; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getBatchEndTime() { |
| | | return batchEndTime; |
| | | } |
| | | public void setBatchEndTime(String batchEndTime) { |
| | | this.batchEndTime = batchEndTime; |
| | | } |
| | | public String getBatchId() { |
| | | return batchId; |
| | | } |
| | | public void setBatchId(String batchId) { |
| | | this.batchId = batchId; |
| | | } |
| | | 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 String getBatchStartTime() { |
| | | return batchStartTime; |
| | | } |
| | | public void setBatchStartTime(String batchStartTime) { |
| | | this.batchStartTime = batchStartTime; |
| | | } |
| | | public String getCurBatch() { |
| | | return curBatch; |
| | | } |
| | | public void setCurBatch(String curBatch) { |
| | | this.curBatch = curBatch; |
| | | } |
| | | |
| | | |
| | | 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.groupBuyBatch; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class GroupBuyBatchPo implements Serializable { |
| | | |
| | | private String batchEndTime; |
| | | private String statusCd = "0"; |
| | | private String batchId; |
| | | private String storeId; |
| | | private String settingId; |
| | | private String batchStartTime; |
| | | private String curBatch; |
| | | public String getBatchEndTime() { |
| | | return batchEndTime; |
| | | } |
| | | public void setBatchEndTime(String batchEndTime) { |
| | | this.batchEndTime = batchEndTime; |
| | | } |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | public String getBatchId() { |
| | | return batchId; |
| | | } |
| | | public void setBatchId(String batchId) { |
| | | this.batchId = batchId; |
| | | } |
| | | 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 String getBatchStartTime() { |
| | | return batchStartTime; |
| | | } |
| | | public void setBatchStartTime(String batchStartTime) { |
| | | this.batchStartTime = batchStartTime; |
| | | } |
| | | public String getCurBatch() { |
| | | return curBatch; |
| | | } |
| | | public void setCurBatch(String curBatch) { |
| | | this.curBatch = curBatch; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public static final String CODE_PREFIX_productId = "90"; |
| | | public static final String CODE_PREFIX_valueId = "91"; |
| | | public static final String CODE_PREFIX_groupId = "92"; |
| | | public static final String CODE_PREFIX_batchId = "93"; |
| | | |
| | | |
| | | |
| 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="groupBuyBatchServiceDaoImpl"> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 保存拼团批次信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveGroupBuyBatchInfo" parameterType="Map"> |
| | | insert into group_buy_batch( |
| | | batch_end_time,batch_id,store_id,setting_id,batch_start_time,cur_batch |
| | | ) values ( |
| | | #{batchEndTime},#{batchId},#{storeId},#{settingId},#{batchStartTime},#{curBatch} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询拼团批次信息 add by wuxw 2018-07-03 --> |
| | | <select id="getGroupBuyBatchInfo" parameterType="Map" resultType="Map"> |
| | | select t.batch_end_time,t.batch_end_time batchEndTime,t.status_cd,t.status_cd statusCd,t.batch_id,t.batch_id batchId,t.store_id,t.store_id storeId,t.setting_id,t.setting_id settingId,t.batch_start_time,t.batch_start_time batchStartTime,t.cur_batch,t.cur_batch curBatch |
| | | from group_buy_batch t |
| | | where 1 =1 |
| | | <if test="batchEndTime !=null and batchEndTime != ''"> |
| | | and t.batch_end_time= #{batchEndTime} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="batchId !=null and batchId != ''"> |
| | | and t.batch_id= #{batchId} |
| | | </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> |
| | | <if test="batchStartTime !=null and batchStartTime != ''"> |
| | | and t.batch_start_time= #{batchStartTime} |
| | | </if> |
| | | <if test="curBatch !=null and curBatch != ''"> |
| | | and t.cur_batch= #{curBatch} |
| | | </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="updateGroupBuyBatchInfo" parameterType="Map"> |
| | | update group_buy_batch t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="batchEndTime !=null and batchEndTime != ''"> |
| | | , t.batch_end_time= #{batchEndTime} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | , t.store_id= #{storeId} |
| | | </if> |
| | | <if test="settingId !=null and settingId != ''"> |
| | | , t.setting_id= #{settingId} |
| | | </if> |
| | | <if test="batchStartTime !=null and batchStartTime != ''"> |
| | | , t.batch_start_time= #{batchStartTime} |
| | | </if> |
| | | <if test="curBatch !=null and curBatch != ''"> |
| | | , t.cur_batch= #{curBatch} |
| | | </if> |
| | | where 1=1 <if test="batchId !=null and batchId != ''"> |
| | | and t.batch_id= #{batchId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询拼团批次数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryGroupBuyBatchsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from group_buy_batch t |
| | | where 1 =1 |
| | | <if test="batchEndTime !=null and batchEndTime != ''"> |
| | | and t.batch_end_time= #{batchEndTime} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="batchId !=null and batchId != ''"> |
| | | and t.batch_id= #{batchId} |
| | | </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> |
| | | <if test="batchStartTime !=null and batchStartTime != ''"> |
| | | and t.batch_start_time= #{batchStartTime} |
| | | </if> |
| | | <if test="curBatch !=null and curBatch != ''"> |
| | | and t.cur_batch= #{curBatch} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | { |
| | | "autoMove": true, |
| | | "id": "buyId", |
| | | "name": "groupBuy", |
| | | "desc": "拼团购买", |
| | | "id": "batchId", |
| | | "name": "groupBuyBatch", |
| | | "desc": "拼团批次", |
| | | "shareParam": "storeId", |
| | | "shareColumn": "store_id", |
| | | "shareName": "goods", |
| | | "tableName": "group_buy", |
| | | "tableName": "group_buy_batch", |
| | | "param": { |
| | | "buyId": "buy_id", |
| | | "batchId": "batch_id", |
| | | "storeId": "store_id", |
| | | "productId": "product_id", |
| | | "specId": "spec_id", |
| | | "groupId": "group_id", |
| | | "persionId": "persion_id", |
| | | "persionName": "persion_name", |
| | | "buyCount": "buy_count", |
| | | "groupPrice": "group_price", |
| | | "amount": "amount", |
| | | "state": "state", |
| | | "settingId": "setting_id", |
| | | "batchStartTime": "batch_start_time", |
| | | "batchEndTime": "batch_end_time", |
| | | "curBatch": "cur_batch", |
| | | "statusCd": "status_cd" |
| | | }, |
| | | "required": [ |
| | | { |
| | | "code": "batchId", |
| | | "msg": "批次不能为空" |
| | | "code": "settingId", |
| | | "msg": "设置ID不能为空" |
| | | }, |
| | | { |
| | | "code": "buyCount", |
| | | "msg": "购买数量不能为空" |
| | | "code": "batchStartTime", |
| | | "msg": "开始时间不能为空" |
| | | }, |
| | | { |
| | | "code": "productId", |
| | | "msg": "默认显示不能为空" |
| | | }, |
| | | { |
| | | "code": "specId", |
| | | "msg": "规格不能为空" |
| | | }, |
| | | { |
| | | "code": "persionId", |
| | | "msg": "用户不能为空" |
| | | "code": "batchEndTime", |
| | | "msg": "结束时间不能为空" |
| | | } |
| | | ] |
| | | } |
| New file |
| | |
| | | package com.java110.intf; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.groupBuyBatch.GroupBuyBatchDto; |
| | | import com.java110.po.groupBuyBatch.GroupBuyBatchPo; |
| | | 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 IGroupBuyBatchInnerServiceSMO |
| | | * @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("/groupBuyBatchApi") |
| | | public interface IGroupBuyBatchInnerServiceSMO { |
| | | |
| | | |
| | | @RequestMapping(value = "/saveGroupBuyBatch", method = RequestMethod.POST) |
| | | public int saveGroupBuyBatch(@RequestBody GroupBuyBatchPo groupBuyBatchPo); |
| | | |
| | | @RequestMapping(value = "/updateGroupBuyBatch", method = RequestMethod.POST) |
| | | public int updateGroupBuyBatch(@RequestBody GroupBuyBatchPo groupBuyBatchPo); |
| | | |
| | | @RequestMapping(value = "/deleteGroupBuyBatch", method = RequestMethod.POST) |
| | | public int deleteGroupBuyBatch(@RequestBody GroupBuyBatchPo groupBuyBatchPo); |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * @param groupBuyBatchDto 数据对象分享 |
| | | * @return GroupBuyBatchDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryGroupBuyBatchs", method = RequestMethod.POST) |
| | | List<GroupBuyBatchDto> queryGroupBuyBatchs(@RequestBody GroupBuyBatchDto groupBuyBatchDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param groupBuyBatchDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryGroupBuyBatchsCount", method = RequestMethod.POST) |
| | | int queryGroupBuyBatchsCount(@RequestBody GroupBuyBatchDto groupBuyBatchDto); |
| | | } |
| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.dto.groupBuy.GroupBuyDto; |
| | | import com.java110.dto.groupBuyBatch.GroupBuyBatchDto; |
| | | import com.java110.dto.groupBuyProduct.GroupBuyProductDto; |
| | | import com.java110.dto.groupBuyProductSpec.GroupBuyProductSpecDto; |
| | | import com.java110.dto.groupBuySetting.GroupBuySettingDto; |
| | |
| | | import com.java110.goods.bmo.groupBuy.IGetGroupBuyBMO; |
| | | import com.java110.goods.bmo.groupBuy.ISaveGroupBuyBMO; |
| | | import com.java110.goods.bmo.groupBuy.IUpdateGroupBuyBMO; |
| | | import com.java110.goods.bmo.groupBuyBatch.IDeleteGroupBuyBatchBMO; |
| | | import com.java110.goods.bmo.groupBuyBatch.IGetGroupBuyBatchBMO; |
| | | import com.java110.goods.bmo.groupBuyBatch.ISaveGroupBuyBatchBMO; |
| | | import com.java110.goods.bmo.groupBuyBatch.IUpdateGroupBuyBatchBMO; |
| | | 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.groupBuySetting.ISaveGroupBuySettingBMO; |
| | | import com.java110.goods.bmo.groupBuySetting.IUpdateGroupBuySettingBMO; |
| | | import com.java110.po.groupBuy.GroupBuyPo; |
| | | import com.java110.po.groupBuyBatch.GroupBuyBatchPo; |
| | | import com.java110.po.groupBuyProduct.GroupBuyProductPo; |
| | | import com.java110.po.groupBuyProductSpec.GroupBuyProductSpecPo; |
| | | import com.java110.po.groupBuySetting.GroupBuySettingPo; |
| | |
| | | |
| | | @Autowired |
| | | private IGetGroupBuyProductSpecBMO getGroupBuyProductSpecBMOImpl; |
| | | |
| | | |
| | | @Autowired |
| | | private ISaveGroupBuyBatchBMO saveGroupBuyBatchBMOImpl; |
| | | @Autowired |
| | | private IUpdateGroupBuyBatchBMO updateGroupBuyBatchBMOImpl; |
| | | @Autowired |
| | | private IDeleteGroupBuyBatchBMO deleteGroupBuyBatchBMOImpl; |
| | | |
| | | @Autowired |
| | | private IGetGroupBuyBatchBMO getGroupBuyBatchBMOImpl; |
| | | |
| | | /** |
| | | * 微信保存消息模板 |
| | |
| | | groupBuyProductSpecDto.setStoreId(storeId); |
| | | return getGroupBuyProductSpecBMOImpl.get(groupBuyProductSpecDto); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 微信保存消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /groupBuyBatch/saveGroupBuyBatch |
| | | * @path /app/groupBuyBatch/saveGroupBuyBatch |
| | | */ |
| | | @RequestMapping(value = "/saveGroupBuyBatch", method = RequestMethod.POST) |
| | | public ResponseEntity<String> saveGroupBuyBatch(@RequestBody JSONObject reqJson, @RequestHeader(value = "store-id") String storeId) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "settingId", "请求报文中未包含settingId"); |
| | | Assert.hasKeyAndValue(reqJson, "batchStartTime", "请求报文中未包含batchStartTime"); |
| | | Assert.hasKeyAndValue(reqJson, "batchEndTime", "请求报文中未包含batchEndTime"); |
| | | |
| | | |
| | | GroupBuyBatchPo groupBuyBatchPo = BeanConvertUtil.covertBean(reqJson, GroupBuyBatchPo.class); |
| | | groupBuyBatchPo.setStoreId(storeId); |
| | | return saveGroupBuyBatchBMOImpl.save(groupBuyBatchPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信修改消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /groupBuyBatch/updateGroupBuyBatch |
| | | * @path /app/groupBuyBatch/updateGroupBuyBatch |
| | | */ |
| | | @RequestMapping(value = "/updateGroupBuyBatch", method = RequestMethod.POST) |
| | | public ResponseEntity<String> updateGroupBuyBatch(@RequestBody JSONObject reqJson, @RequestHeader(value = "store-id") String storeId) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "settingId", "请求报文中未包含settingId"); |
| | | Assert.hasKeyAndValue(reqJson, "batchStartTime", "请求报文中未包含batchStartTime"); |
| | | Assert.hasKeyAndValue(reqJson, "batchEndTime", "请求报文中未包含batchEndTime"); |
| | | Assert.hasKeyAndValue(reqJson, "batchId", "batchId不能为空"); |
| | | |
| | | |
| | | GroupBuyBatchPo groupBuyBatchPo = BeanConvertUtil.covertBean(reqJson, GroupBuyBatchPo.class); |
| | | groupBuyBatchPo.setStoreId(storeId); |
| | | return updateGroupBuyBatchBMOImpl.update(groupBuyBatchPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /groupBuyBatch/deleteGroupBuyBatch |
| | | * @path /app/groupBuyBatch/deleteGroupBuyBatch |
| | | */ |
| | | @RequestMapping(value = "/deleteGroupBuyBatch", method = RequestMethod.POST) |
| | | public ResponseEntity<String> deleteGroupBuyBatch(@RequestBody JSONObject reqJson, @RequestHeader(value = "store-id") String storeId) { |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "batchId", "batchId不能为空"); |
| | | |
| | | |
| | | GroupBuyBatchPo groupBuyBatchPo = BeanConvertUtil.covertBean(reqJson, GroupBuyBatchPo.class); |
| | | groupBuyBatchPo.setStoreId(storeId); |
| | | return deleteGroupBuyBatchBMOImpl.delete(groupBuyBatchPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param storeId 小区ID |
| | | * @return |
| | | * @serviceCode /groupBuyBatch/queryGroupBuyBatch |
| | | * @path /app/groupBuyBatch/queryGroupBuyBatch |
| | | */ |
| | | @RequestMapping(value = "/queryGroupBuyBatch", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryGroupBuyBatch(@RequestHeader(value = "store-id") String storeId, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | GroupBuyBatchDto groupBuyBatchDto = new GroupBuyBatchDto(); |
| | | groupBuyBatchDto.setPage(page); |
| | | groupBuyBatchDto.setRow(row); |
| | | groupBuyBatchDto.setStoreId(storeId); |
| | | return getGroupBuyBatchBMOImpl.get(groupBuyBatchDto); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyBatch; |
| | | |
| | | import com.java110.po.groupBuyBatch.GroupBuyBatchPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IDeleteGroupBuyBatchBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改拼团批次 |
| | | * add by wuxw |
| | | * |
| | | * @param groupBuyBatchPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> delete(GroupBuyBatchPo groupBuyBatchPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyBatch; |
| | | |
| | | import com.java110.dto.groupBuyBatch.GroupBuyBatchDto; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IGetGroupBuyBatchBMO { |
| | | |
| | | |
| | | /** |
| | | * 查询拼团批次 |
| | | * add by wuxw |
| | | * |
| | | * @param groupBuyBatchDto |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> get(GroupBuyBatchDto groupBuyBatchDto); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyBatch; |
| | | |
| | | import com.java110.po.groupBuyBatch.GroupBuyBatchPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface ISaveGroupBuyBatchBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加拼团批次 |
| | | * add by wuxw |
| | | * |
| | | * @param groupBuyBatchPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> save(GroupBuyBatchPo groupBuyBatchPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyBatch; |
| | | |
| | | import com.java110.po.groupBuyBatch.GroupBuyBatchPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IUpdateGroupBuyBatchBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改拼团批次 |
| | | * add by wuxw |
| | | * |
| | | * @param groupBuyBatchPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> update(GroupBuyBatchPo groupBuyBatchPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyBatch.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.goods.bmo.groupBuyBatch.IDeleteGroupBuyBatchBMO; |
| | | import com.java110.intf.IGroupBuyBatchInnerServiceSMO; |
| | | import com.java110.po.groupBuyBatch.GroupBuyBatchPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("deleteGroupBuyBatchBMOImpl") |
| | | public class DeleteGroupBuyBatchBMOImpl implements IDeleteGroupBuyBatchBMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuyBatchInnerServiceSMO groupBuyBatchInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param groupBuyBatchPo 数据 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> delete(GroupBuyBatchPo groupBuyBatchPo) { |
| | | |
| | | int flag = groupBuyBatchInnerServiceSMOImpl.deleteGroupBuyBatch(groupBuyBatchPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyBatch.impl; |
| | | |
| | | import com.java110.dto.groupBuyBatch.GroupBuyBatchDto; |
| | | import com.java110.goods.bmo.groupBuyBatch.IGetGroupBuyBatchBMO; |
| | | import com.java110.intf.IGroupBuyBatchInnerServiceSMO; |
| | | 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("getGroupBuyBatchBMOImpl") |
| | | public class GetGroupBuyBatchBMOImpl implements IGetGroupBuyBatchBMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuyBatchInnerServiceSMO groupBuyBatchInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param groupBuyBatchDto |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public ResponseEntity<String> get(GroupBuyBatchDto groupBuyBatchDto) { |
| | | |
| | | |
| | | int count = groupBuyBatchInnerServiceSMOImpl.queryGroupBuyBatchsCount(groupBuyBatchDto); |
| | | |
| | | List<GroupBuyBatchDto> groupBuyBatchDtos = null; |
| | | if (count > 0) { |
| | | groupBuyBatchDtos = groupBuyBatchInnerServiceSMOImpl.queryGroupBuyBatchs(groupBuyBatchDto); |
| | | } else { |
| | | groupBuyBatchDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) groupBuyBatchDto.getRow()), count, groupBuyBatchDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyBatch.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.goods.bmo.groupBuyBatch.ISaveGroupBuyBatchBMO; |
| | | import com.java110.intf.IGroupBuyBatchInnerServiceSMO; |
| | | import com.java110.po.groupBuyBatch.GroupBuyBatchPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("saveGroupBuyBatchBMOImpl") |
| | | public class SaveGroupBuyBatchBMOImpl implements ISaveGroupBuyBatchBMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuyBatchInnerServiceSMO groupBuyBatchInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param groupBuyBatchPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> save(GroupBuyBatchPo groupBuyBatchPo) { |
| | | |
| | | groupBuyBatchPo.setBatchId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_batchId)); |
| | | int flag = groupBuyBatchInnerServiceSMOImpl.saveGroupBuyBatch(groupBuyBatchPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.goods.bmo.groupBuyBatch.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.goods.bmo.groupBuyBatch.IUpdateGroupBuyBatchBMO; |
| | | import com.java110.intf.IGroupBuyBatchInnerServiceSMO; |
| | | import com.java110.po.groupBuyBatch.GroupBuyBatchPo; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("updateGroupBuyBatchBMOImpl") |
| | | public class UpdateGroupBuyBatchBMOImpl implements IUpdateGroupBuyBatchBMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuyBatchInnerServiceSMO groupBuyBatchInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param groupBuyBatchPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> update(GroupBuyBatchPo groupBuyBatchPo) { |
| | | |
| | | int flag = groupBuyBatchInnerServiceSMOImpl.updateGroupBuyBatch(groupBuyBatchPo); |
| | | |
| | | 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 IGroupBuyBatchServiceDao { |
| | | |
| | | |
| | | /** |
| | | * 保存 拼团批次信息 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveGroupBuyBatchInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询拼团批次信息(instance过程) |
| | | * 根据bId 查询拼团批次信息 |
| | | * @param info bId 信息 |
| | | * @return 拼团批次信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getGroupBuyBatchInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改拼团批次信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateGroupBuyBatchInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询拼团批次总数 |
| | | * |
| | | * @param info 拼团批次信息 |
| | | * @return 拼团批次数量 |
| | | */ |
| | | int queryGroupBuyBatchsCount(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.IGroupBuyBatchServiceDao; |
| | | 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("groupBuyBatchServiceDaoImpl") |
| | | //@Transactional |
| | | public class GroupBuyBatchServiceDaoImpl extends BaseServiceDao implements IGroupBuyBatchServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(GroupBuyBatchServiceDaoImpl.class); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存拼团批次信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveGroupBuyBatchInfo(Map info) throws DAOException { |
| | | logger.debug("保存拼团批次信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("groupBuyBatchServiceDaoImpl.saveGroupBuyBatchInfo",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> getGroupBuyBatchInfo(Map info) throws DAOException { |
| | | logger.debug("查询拼团批次信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessGroupBuyBatchInfos = sqlSessionTemplate.selectList("groupBuyBatchServiceDaoImpl.getGroupBuyBatchInfo",info); |
| | | |
| | | return businessGroupBuyBatchInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改拼团批次信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateGroupBuyBatchInfo(Map info) throws DAOException { |
| | | logger.debug("修改拼团批次信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("groupBuyBatchServiceDaoImpl.updateGroupBuyBatchInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改拼团批次信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询拼团批次数量 |
| | | * @param info 拼团批次信息 |
| | | * @return 拼团批次数量 |
| | | */ |
| | | @Override |
| | | public int queryGroupBuyBatchsCount(Map info) { |
| | | logger.debug("查询拼团批次数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessGroupBuyBatchInfos = sqlSessionTemplate.selectList("groupBuyBatchServiceDaoImpl.queryGroupBuyBatchsCount", info); |
| | | if (businessGroupBuyBatchInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessGroupBuyBatchInfos.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.groupBuyBatch.GroupBuyBatchDto; |
| | | import com.java110.goods.dao.IGroupBuyBatchServiceDao; |
| | | import com.java110.intf.IGroupBuyBatchInnerServiceSMO; |
| | | import com.java110.po.groupBuyBatch.GroupBuyBatchPo; |
| | | 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 GroupBuyBatchInnerServiceSMOImpl extends BaseServiceSMO implements IGroupBuyBatchInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IGroupBuyBatchServiceDao groupBuyBatchServiceDaoImpl; |
| | | |
| | | |
| | | @Override |
| | | public int saveGroupBuyBatch(@RequestBody GroupBuyBatchPo groupBuyBatchPo) { |
| | | int saveFlag = 1; |
| | | groupBuyBatchServiceDaoImpl.saveGroupBuyBatchInfo(BeanConvertUtil.beanCovertMap(groupBuyBatchPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int updateGroupBuyBatch(@RequestBody GroupBuyBatchPo groupBuyBatchPo) { |
| | | int saveFlag = 1; |
| | | groupBuyBatchServiceDaoImpl.updateGroupBuyBatchInfo(BeanConvertUtil.beanCovertMap(groupBuyBatchPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteGroupBuyBatch(@RequestBody GroupBuyBatchPo groupBuyBatchPo) { |
| | | int saveFlag = 1; |
| | | groupBuyBatchPo.setStatusCd("1"); |
| | | groupBuyBatchServiceDaoImpl.updateGroupBuyBatchInfo(BeanConvertUtil.beanCovertMap(groupBuyBatchPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public List<GroupBuyBatchDto> queryGroupBuyBatchs(@RequestBody GroupBuyBatchDto groupBuyBatchDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = groupBuyBatchDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | groupBuyBatchDto.setPage((page - 1) * groupBuyBatchDto.getRow()); |
| | | } |
| | | |
| | | List<GroupBuyBatchDto> groupBuyBatchs = BeanConvertUtil.covertBeanList(groupBuyBatchServiceDaoImpl.getGroupBuyBatchInfo(BeanConvertUtil.beanCovertMap(groupBuyBatchDto)), GroupBuyBatchDto.class); |
| | | |
| | | return groupBuyBatchs; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryGroupBuyBatchsCount(@RequestBody GroupBuyBatchDto groupBuyBatchDto) { |
| | | return groupBuyBatchServiceDaoImpl.queryGroupBuyBatchsCount(BeanConvertUtil.beanCovertMap(groupBuyBatchDto)); |
| | | } |
| | | |
| | | public IGroupBuyBatchServiceDao getGroupBuyBatchServiceDaoImpl() { |
| | | return groupBuyBatchServiceDaoImpl; |
| | | } |
| | | |
| | | public void setGroupBuyBatchServiceDaoImpl(IGroupBuyBatchServiceDao groupBuyBatchServiceDaoImpl) { |
| | | this.groupBuyBatchServiceDaoImpl = groupBuyBatchServiceDaoImpl; |
| | | } |
| | | } |