| New file |
| | |
| | | package com.java110.dto.activitiesBeautifulStaff; |
| | | |
| | | 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 ActivitiesBeautifulStaffDto extends PageDto implements Serializable { |
| | | |
| | | private String beId; |
| | | private String workContent; |
| | | private String activitiesNum; |
| | | private String poll; |
| | | private String ruleId; |
| | | private String storeId; |
| | | private String staffId; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getBeId() { |
| | | return beId; |
| | | } |
| | | public void setBeId(String beId) { |
| | | this.beId = beId; |
| | | } |
| | | public String getWorkContent() { |
| | | return workContent; |
| | | } |
| | | public void setWorkContent(String workContent) { |
| | | this.workContent = workContent; |
| | | } |
| | | public String getActivitiesNum() { |
| | | return activitiesNum; |
| | | } |
| | | public void setActivitiesNum(String activitiesNum) { |
| | | this.activitiesNum = activitiesNum; |
| | | } |
| | | public String getPoll() { |
| | | return poll; |
| | | } |
| | | public void setPoll(String poll) { |
| | | this.poll = poll; |
| | | } |
| | | public String getRuleId() { |
| | | return ruleId; |
| | | } |
| | | public void setRuleId(String ruleId) { |
| | | this.ruleId = ruleId; |
| | | } |
| | | public String getStoreId() { |
| | | return storeId; |
| | | } |
| | | public void setStoreId(String storeId) { |
| | | this.storeId = storeId; |
| | | } |
| | | public String getStaffId() { |
| | | return staffId; |
| | | } |
| | | public void setStaffId(String staffId) { |
| | | this.staffId = staffId; |
| | | } |
| | | |
| | | |
| | | 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.activitiesBeautifulStaff; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class ActivitiesBeautifulStaffPo implements Serializable { |
| | | |
| | | private String beId; |
| | | private String workContent; |
| | | private String activitiesNum; |
| | | private String statusCd = "0"; |
| | | private String poll; |
| | | private String ruleId; |
| | | private String storeId; |
| | | private String staffId; |
| | | public String getBeId() { |
| | | return beId; |
| | | } |
| | | public void setBeId(String beId) { |
| | | this.beId = beId; |
| | | } |
| | | public String getWorkContent() { |
| | | return workContent; |
| | | } |
| | | public void setWorkContent(String workContent) { |
| | | this.workContent = workContent; |
| | | } |
| | | public String getActivitiesNum() { |
| | | return activitiesNum; |
| | | } |
| | | public void setActivitiesNum(String activitiesNum) { |
| | | this.activitiesNum = activitiesNum; |
| | | } |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | public String getPoll() { |
| | | return poll; |
| | | } |
| | | public void setPoll(String poll) { |
| | | this.poll = poll; |
| | | } |
| | | public String getRuleId() { |
| | | return ruleId; |
| | | } |
| | | public void setRuleId(String ruleId) { |
| | | this.ruleId = ruleId; |
| | | } |
| | | public String getStoreId() { |
| | | return storeId; |
| | | } |
| | | public void setStoreId(String storeId) { |
| | | this.storeId = storeId; |
| | | } |
| | | public String getStaffId() { |
| | | return staffId; |
| | | } |
| | | public void setStaffId(String staffId) { |
| | | this.staffId = staffId; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | public static final String CODE_PREFIX_titleId = "19"; |
| | | public static final String CODE_PREFIX_userQaId = "20"; |
| | | public static final String CODE_PREFIX_userTitleId = "21"; |
| | | public static final String CODE_PREFIX_beId = "22"; |
| | | |
| | | |
| | | /** |
| 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="activitiesBeautifulStaffServiceDaoImpl"> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 保存活动规则信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveActivitiesBeautifulStaffInfo" parameterType="Map"> |
| | | insert into activities_beautiful_staff( |
| | | be_id,work_content,activities_num,poll,rule_id,store_id,staff_id |
| | | ) values ( |
| | | #{beId},#{workContent},#{activitiesNum},#{poll},#{ruleId},#{storeId},#{staffId} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询活动规则信息 add by wuxw 2018-07-03 --> |
| | | <select id="getActivitiesBeautifulStaffInfo" parameterType="Map" resultType="Map"> |
| | | select t.be_id,t.be_id beId,t.work_content,t.work_content workContent,t.activities_num,t.activities_num activitiesNum,t.status_cd,t.status_cd statusCd,t.poll,t.rule_id,t.rule_id ruleId,t.store_id,t.store_id storeId,t.staff_id,t.staff_id staffId |
| | | from activities_beautiful_staff t |
| | | where 1 =1 |
| | | <if test="beId !=null and beId != ''"> |
| | | and t.be_id= #{beId} |
| | | </if> |
| | | <if test="workContent !=null and workContent != ''"> |
| | | and t.work_content= #{workContent} |
| | | </if> |
| | | <if test="activitiesNum !=null and activitiesNum != ''"> |
| | | and t.activities_num= #{activitiesNum} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="poll !=null and poll != ''"> |
| | | and t.poll= #{poll} |
| | | </if> |
| | | <if test="ruleId !=null and ruleId != ''"> |
| | | and t.rule_id= #{ruleId} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="staffId !=null and staffId != ''"> |
| | | and t.staff_id= #{staffId} |
| | | </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="updateActivitiesBeautifulStaffInfo" parameterType="Map"> |
| | | update activities_beautiful_staff t set t.status_cd = #{statusCd} |
| | | <if test="newBId != null and newBId != ''"> |
| | | ,t.b_id = #{newBId} |
| | | </if> |
| | | <if test="workContent !=null and workContent != ''"> |
| | | , t.work_content= #{workContent} |
| | | </if> |
| | | <if test="activitiesNum !=null and activitiesNum != ''"> |
| | | , t.activities_num= #{activitiesNum} |
| | | </if> |
| | | <if test="poll !=null and poll != ''"> |
| | | , t.poll= #{poll} |
| | | </if> |
| | | <if test="ruleId !=null and ruleId != ''"> |
| | | , t.rule_id= #{ruleId} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | , t.store_id= #{storeId} |
| | | </if> |
| | | <if test="staffId !=null and staffId != ''"> |
| | | , t.staff_id= #{staffId} |
| | | </if> |
| | | where 1=1 <if test="beId !=null and beId != ''"> |
| | | and t.be_id= #{beId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询活动规则数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryActivitiesBeautifulStaffsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from activities_beautiful_staff t |
| | | where 1 =1 |
| | | <if test="beId !=null and beId != ''"> |
| | | and t.be_id= #{beId} |
| | | </if> |
| | | <if test="workContent !=null and workContent != ''"> |
| | | and t.work_content= #{workContent} |
| | | </if> |
| | | <if test="activitiesNum !=null and activitiesNum != ''"> |
| | | and t.activities_num= #{activitiesNum} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="poll !=null and poll != ''"> |
| | | and t.poll= #{poll} |
| | | </if> |
| | | <if test="ruleId !=null and ruleId != ''"> |
| | | and t.rule_id= #{ruleId} |
| | | </if> |
| | | <if test="storeId !=null and storeId != ''"> |
| | | and t.store_id= #{storeId} |
| | | </if> |
| | | <if test="staffId !=null and staffId != ''"> |
| | | and t.staff_id= #{staffId} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | { |
| | | "autoMove": true, |
| | | "id": "ruleId", |
| | | "name": "activitiesRule", |
| | | "id": "beId", |
| | | "name": "activitiesBeautifulStaff", |
| | | "desc": "活动规则", |
| | | "shareParam": "objId", |
| | | "shareColumn": "obj_id", |
| | | "shareParam": "storeId", |
| | | "shareColumn": "store_id", |
| | | "shareName": "user", |
| | | "tableName": "activities_rule", |
| | | "tableName": "activities_beautiful_staff", |
| | | "param": { |
| | | "beId": "be_id", |
| | | "ruleId": "rule_id", |
| | | "ruleName": "rule_name", |
| | | "ruleType": "rule_type", |
| | | "startTime": "start_time", |
| | | "endTime": "end_time", |
| | | "activitiesObj": "activities_obj", |
| | | "remark": "remark", |
| | | "objType": "obj_type", |
| | | "objId": "obj_id", |
| | | "staffId": "staff_id", |
| | | "activitiesNum": "activities_num", |
| | | "storeId": "store_id", |
| | | "workContent": "work_content", |
| | | "poll": "poll", |
| | | "statusCd": "status_cd" |
| | | }, |
| | | "required": [ |
| | | { |
| | | "code": "ruleName", |
| | | "msg": "规则名称不能为空" |
| | | "code": "staffId", |
| | | "msg": "员工不能为空" |
| | | }, |
| | | { |
| | | "code": "ruleType", |
| | | "msg": "规则类型不能为空" |
| | | "code": "activitiesNum", |
| | | "msg": "员工编号不能为空" |
| | | }, |
| | | { |
| | | "code": "startTime", |
| | | "msg": "开始时间不能为空" |
| | | "code": "workContent", |
| | | "msg": "工作内容不能为空" |
| | | }, |
| | | { |
| | | "code": "endTime", |
| | | "msg": "结束时间不能为空" |
| | | }, |
| | | { |
| | | "code": "activitiesObj", |
| | | "msg": "活动对象不能为空" |
| | | }, |
| | | { |
| | | "code": "remark", |
| | | "msg": "活动说明不能为空" |
| | | "code": "ruleId", |
| | | "msg": "活动规则不能为空" |
| | | } |
| | | ] |
| | | } |
| New file |
| | |
| | | package com.java110.intf.user; |
| | | |
| | | import com.java110.config.feign.FeignConfiguration; |
| | | import com.java110.dto.activitiesBeautifulStaff.ActivitiesBeautifulStaffDto; |
| | | import com.java110.po.activitiesBeautifulStaff.ActivitiesBeautifulStaffPo; |
| | | 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 IActivitiesBeautifulStaffInnerServiceSMO |
| | | * @Description 活动规则接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "user-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/activitiesBeautifulStaffApi") |
| | | public interface IActivitiesBeautifulStaffInnerServiceSMO { |
| | | |
| | | |
| | | @RequestMapping(value = "/saveActivitiesBeautifulStaff", method = RequestMethod.POST) |
| | | public int saveActivitiesBeautifulStaff(@RequestBody ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo); |
| | | |
| | | @RequestMapping(value = "/updateActivitiesBeautifulStaff", method = RequestMethod.POST) |
| | | public int updateActivitiesBeautifulStaff(@RequestBody ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo); |
| | | |
| | | @RequestMapping(value = "/deleteActivitiesBeautifulStaff", method = RequestMethod.POST) |
| | | public int deleteActivitiesBeautifulStaff(@RequestBody ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo); |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param activitiesBeautifulStaffDto 数据对象分享 |
| | | * @return ActivitiesBeautifulStaffDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryActivitiesBeautifulStaffs", method = RequestMethod.POST) |
| | | List<ActivitiesBeautifulStaffDto> queryActivitiesBeautifulStaffs(@RequestBody ActivitiesBeautifulStaffDto activitiesBeautifulStaffDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param activitiesBeautifulStaffDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryActivitiesBeautifulStaffsCount", method = RequestMethod.POST) |
| | | int queryActivitiesBeautifulStaffsCount(@RequestBody ActivitiesBeautifulStaffDto activitiesBeautifulStaffDto); |
| | | } |
| New file |
| | |
| | | package com.java110.user.api; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.dto.activitiesBeautifulStaff.ActivitiesBeautifulStaffDto; |
| | | import com.java110.po.activitiesBeautifulStaff.ActivitiesBeautifulStaffPo; |
| | | import com.java110.user.bmo.activitiesBeautifulStaff.IDeleteActivitiesBeautifulStaffBMO; |
| | | import com.java110.user.bmo.activitiesBeautifulStaff.IGetActivitiesBeautifulStaffBMO; |
| | | import com.java110.user.bmo.activitiesBeautifulStaff.ISaveActivitiesBeautifulStaffBMO; |
| | | import com.java110.user.bmo.activitiesBeautifulStaff.IUpdateActivitiesBeautifulStaffBMO; |
| | | 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 = "/activitiesBeautifulStaff") |
| | | public class ActivitiesBeautifulStaffApi { |
| | | |
| | | @Autowired |
| | | private ISaveActivitiesBeautifulStaffBMO saveActivitiesBeautifulStaffBMOImpl; |
| | | @Autowired |
| | | private IUpdateActivitiesBeautifulStaffBMO updateActivitiesBeautifulStaffBMOImpl; |
| | | @Autowired |
| | | private IDeleteActivitiesBeautifulStaffBMO deleteActivitiesBeautifulStaffBMOImpl; |
| | | |
| | | @Autowired |
| | | private IGetActivitiesBeautifulStaffBMO getActivitiesBeautifulStaffBMOImpl; |
| | | |
| | | /** |
| | | * 微信保存消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /activitiesBeautifulStaff/saveActivitiesBeautifulStaff |
| | | * @path /app/activitiesBeautifulStaff/saveActivitiesBeautifulStaff |
| | | */ |
| | | @RequestMapping(value = "/saveActivitiesBeautifulStaff", method = RequestMethod.POST) |
| | | public ResponseEntity<String> saveActivitiesBeautifulStaff(@RequestBody JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId"); |
| | | Assert.hasKeyAndValue(reqJson, "activitiesNum", "请求报文中未包含activitiesNum"); |
| | | Assert.hasKeyAndValue(reqJson, "workContent", "请求报文中未包含workContent"); |
| | | Assert.hasKeyAndValue(reqJson, "ruleId", "请求报文中未包含ruleId"); |
| | | |
| | | |
| | | ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo = BeanConvertUtil.covertBean(reqJson, ActivitiesBeautifulStaffPo.class); |
| | | return saveActivitiesBeautifulStaffBMOImpl.save(activitiesBeautifulStaffPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信修改消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /activitiesBeautifulStaff/updateActivitiesBeautifulStaff |
| | | * @path /app/activitiesBeautifulStaff/updateActivitiesBeautifulStaff |
| | | */ |
| | | @RequestMapping(value = "/updateActivitiesBeautifulStaff", method = RequestMethod.POST) |
| | | public ResponseEntity<String> updateActivitiesBeautifulStaff(@RequestBody JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "staffId", "请求报文中未包含staffId"); |
| | | Assert.hasKeyAndValue(reqJson, "activitiesNum", "请求报文中未包含activitiesNum"); |
| | | Assert.hasKeyAndValue(reqJson, "workContent", "请求报文中未包含workContent"); |
| | | Assert.hasKeyAndValue(reqJson, "ruleId", "请求报文中未包含ruleId"); |
| | | Assert.hasKeyAndValue(reqJson, "beId", "beId不能为空"); |
| | | |
| | | |
| | | ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo = BeanConvertUtil.covertBean(reqJson, ActivitiesBeautifulStaffPo.class); |
| | | return updateActivitiesBeautifulStaffBMOImpl.update(activitiesBeautifulStaffPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param reqJson |
| | | * @return |
| | | * @serviceCode /activitiesBeautifulStaff/deleteActivitiesBeautifulStaff |
| | | * @path /app/activitiesBeautifulStaff/deleteActivitiesBeautifulStaff |
| | | */ |
| | | @RequestMapping(value = "/deleteActivitiesBeautifulStaff", method = RequestMethod.POST) |
| | | public ResponseEntity<String> deleteActivitiesBeautifulStaff(@RequestBody JSONObject reqJson) { |
| | | Assert.hasKeyAndValue(reqJson, "communityId", "小区ID不能为空"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "beId", "beId不能为空"); |
| | | |
| | | |
| | | ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo = BeanConvertUtil.covertBean(reqJson, ActivitiesBeautifulStaffPo.class); |
| | | return deleteActivitiesBeautifulStaffBMOImpl.delete(activitiesBeautifulStaffPo); |
| | | } |
| | | |
| | | /** |
| | | * 微信删除消息模板 |
| | | * |
| | | * @param storeId 小区ID |
| | | * @return |
| | | * @serviceCode /activitiesBeautifulStaff/queryActivitiesBeautifulStaff |
| | | * @path /app/activitiesBeautifulStaff/queryActivitiesBeautifulStaff |
| | | */ |
| | | @RequestMapping(value = "/queryActivitiesBeautifulStaff", method = RequestMethod.GET) |
| | | public ResponseEntity<String> queryActivitiesBeautifulStaff(@RequestHeader(value = "store-id", required = false) String storeId, |
| | | @RequestParam(value = "page") int page, |
| | | @RequestParam(value = "row") int row) { |
| | | ActivitiesBeautifulStaffDto activitiesBeautifulStaffDto = new ActivitiesBeautifulStaffDto(); |
| | | activitiesBeautifulStaffDto.setPage(page); |
| | | activitiesBeautifulStaffDto.setRow(row); |
| | | activitiesBeautifulStaffDto.setStoreId(storeId); |
| | | return getActivitiesBeautifulStaffBMOImpl.get(activitiesBeautifulStaffDto); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.user.bmo.activitiesBeautifulStaff; |
| | | import com.java110.po.activitiesBeautifulStaff.ActivitiesBeautifulStaffPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IDeleteActivitiesBeautifulStaffBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改活动规则 |
| | | * add by wuxw |
| | | * @param activitiesBeautifulStaffPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> delete(ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.user.bmo.activitiesBeautifulStaff; |
| | | import com.java110.dto.activitiesBeautifulStaff.ActivitiesBeautifulStaffDto; |
| | | import org.springframework.http.ResponseEntity; |
| | | public interface IGetActivitiesBeautifulStaffBMO { |
| | | |
| | | |
| | | /** |
| | | * 查询活动规则 |
| | | * add by wuxw |
| | | * @param activitiesBeautifulStaffDto |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> get(ActivitiesBeautifulStaffDto activitiesBeautifulStaffDto); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.user.bmo.activitiesBeautifulStaff; |
| | | |
| | | import com.java110.po.activitiesBeautifulStaff.ActivitiesBeautifulStaffPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | public interface ISaveActivitiesBeautifulStaffBMO { |
| | | |
| | | |
| | | /** |
| | | * 添加活动规则 |
| | | * add by wuxw |
| | | * @param activitiesBeautifulStaffPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> save(ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.user.bmo.activitiesBeautifulStaff; |
| | | import com.java110.po.activitiesBeautifulStaff.ActivitiesBeautifulStaffPo; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | public interface IUpdateActivitiesBeautifulStaffBMO { |
| | | |
| | | |
| | | /** |
| | | * 修改活动规则 |
| | | * add by wuxw |
| | | * @param activitiesBeautifulStaffPo |
| | | * @return |
| | | */ |
| | | ResponseEntity<String> update(ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo); |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.user.bmo.activitiesBeautifulStaff.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.user.IActivitiesBeautifulStaffInnerServiceSMO; |
| | | import com.java110.po.activitiesBeautifulStaff.ActivitiesBeautifulStaffPo; |
| | | import com.java110.user.bmo.activitiesBeautifulStaff.IDeleteActivitiesBeautifulStaffBMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("deleteActivitiesBeautifulStaffBMOImpl") |
| | | public class DeleteActivitiesBeautifulStaffBMOImpl implements IDeleteActivitiesBeautifulStaffBMO { |
| | | |
| | | @Autowired |
| | | private IActivitiesBeautifulStaffInnerServiceSMO activitiesBeautifulStaffInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param activitiesBeautifulStaffPo 数据 |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> delete(ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo) { |
| | | |
| | | int flag = activitiesBeautifulStaffInnerServiceSMOImpl.deleteActivitiesBeautifulStaff(activitiesBeautifulStaffPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.user.bmo.activitiesBeautifulStaff.impl; |
| | | |
| | | import com.java110.dto.activitiesBeautifulStaff.ActivitiesBeautifulStaffDto; |
| | | import com.java110.intf.user.IActivitiesBeautifulStaffInnerServiceSMO; |
| | | import com.java110.user.bmo.activitiesBeautifulStaff.IGetActivitiesBeautifulStaffBMO; |
| | | 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("getActivitiesBeautifulStaffBMOImpl") |
| | | public class GetActivitiesBeautifulStaffBMOImpl implements IGetActivitiesBeautifulStaffBMO { |
| | | |
| | | @Autowired |
| | | private IActivitiesBeautifulStaffInnerServiceSMO activitiesBeautifulStaffInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * |
| | | * |
| | | * @param activitiesBeautifulStaffDto |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | public ResponseEntity<String> get(ActivitiesBeautifulStaffDto activitiesBeautifulStaffDto) { |
| | | |
| | | |
| | | int count = activitiesBeautifulStaffInnerServiceSMOImpl.queryActivitiesBeautifulStaffsCount(activitiesBeautifulStaffDto); |
| | | |
| | | List<ActivitiesBeautifulStaffDto> activitiesBeautifulStaffDtos = null; |
| | | if (count > 0) { |
| | | activitiesBeautifulStaffDtos = activitiesBeautifulStaffInnerServiceSMOImpl.queryActivitiesBeautifulStaffs(activitiesBeautifulStaffDto); |
| | | } else { |
| | | activitiesBeautifulStaffDtos = new ArrayList<>(); |
| | | } |
| | | |
| | | ResultVo resultVo = new ResultVo((int) Math.ceil((double) count / (double) activitiesBeautifulStaffDto.getRow()), count, activitiesBeautifulStaffDtos); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(resultVo.toString(), HttpStatus.OK); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.user.bmo.activitiesBeautifulStaff.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.intf.user.IActivitiesBeautifulStaffInnerServiceSMO; |
| | | import com.java110.po.activitiesBeautifulStaff.ActivitiesBeautifulStaffPo; |
| | | import com.java110.user.bmo.activitiesBeautifulStaff.ISaveActivitiesBeautifulStaffBMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("saveActivitiesBeautifulStaffBMOImpl") |
| | | public class SaveActivitiesBeautifulStaffBMOImpl implements ISaveActivitiesBeautifulStaffBMO { |
| | | |
| | | @Autowired |
| | | private IActivitiesBeautifulStaffInnerServiceSMO activitiesBeautifulStaffInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区信息 |
| | | * |
| | | * @param activitiesBeautifulStaffPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> save(ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo) { |
| | | |
| | | activitiesBeautifulStaffPo.setBeId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_beId)); |
| | | int flag = activitiesBeautifulStaffInnerServiceSMOImpl.saveActivitiesBeautifulStaff(activitiesBeautifulStaffPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.user.bmo.activitiesBeautifulStaff.impl; |
| | | |
| | | import com.java110.core.annotation.Java110Transactional; |
| | | import com.java110.intf.user.IActivitiesBeautifulStaffInnerServiceSMO; |
| | | import com.java110.po.activitiesBeautifulStaff.ActivitiesBeautifulStaffPo; |
| | | import com.java110.user.bmo.activitiesBeautifulStaff.IUpdateActivitiesBeautifulStaffBMO; |
| | | import com.java110.vo.ResultVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service("updateActivitiesBeautifulStaffBMOImpl") |
| | | public class UpdateActivitiesBeautifulStaffBMOImpl implements IUpdateActivitiesBeautifulStaffBMO { |
| | | |
| | | @Autowired |
| | | private IActivitiesBeautifulStaffInnerServiceSMO activitiesBeautifulStaffInnerServiceSMOImpl; |
| | | |
| | | /** |
| | | * @param activitiesBeautifulStaffPo |
| | | * @return 订单服务能够接受的报文 |
| | | */ |
| | | @Java110Transactional |
| | | public ResponseEntity<String> update(ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo) { |
| | | |
| | | int flag = activitiesBeautifulStaffInnerServiceSMOImpl.updateActivitiesBeautifulStaff(activitiesBeautifulStaffPo); |
| | | |
| | | if (flag > 0) { |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功"); |
| | | } |
| | | |
| | | return ResultVo.createResponseEntity(ResultVo.CODE_ERROR, "保存失败"); |
| | | } |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.user.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 IActivitiesBeautifulStaffServiceDao { |
| | | |
| | | |
| | | /** |
| | | * 保存 活动规则信息 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveActivitiesBeautifulStaffInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询活动规则信息(instance过程) |
| | | * 根据bId 查询活动规则信息 |
| | | * @param info bId 信息 |
| | | * @return 活动规则信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getActivitiesBeautifulStaffInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改活动规则信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void updateActivitiesBeautifulStaffInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询活动规则总数 |
| | | * |
| | | * @param info 活动规则信息 |
| | | * @return 活动规则数量 |
| | | */ |
| | | int queryActivitiesBeautifulStaffsCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.user.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.user.dao.IActivitiesBeautifulStaffServiceDao; |
| | | 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("activitiesBeautifulStaffServiceDaoImpl") |
| | | //@Transactional |
| | | public class ActivitiesBeautifulStaffServiceDaoImpl extends BaseServiceDao implements IActivitiesBeautifulStaffServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ActivitiesBeautifulStaffServiceDaoImpl.class); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存活动规则信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveActivitiesBeautifulStaffInfo(Map info) throws DAOException { |
| | | logger.debug("保存活动规则信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("activitiesBeautifulStaffServiceDaoImpl.saveActivitiesBeautifulStaffInfo",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> getActivitiesBeautifulStaffInfo(Map info) throws DAOException { |
| | | logger.debug("查询活动规则信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessActivitiesBeautifulStaffInfos = sqlSessionTemplate.selectList("activitiesBeautifulStaffServiceDaoImpl.getActivitiesBeautifulStaffInfo",info); |
| | | |
| | | return businessActivitiesBeautifulStaffInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改活动规则信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void updateActivitiesBeautifulStaffInfo(Map info) throws DAOException { |
| | | logger.debug("修改活动规则信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("activitiesBeautifulStaffServiceDaoImpl.updateActivitiesBeautifulStaffInfo",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"修改活动规则信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 查询活动规则数量 |
| | | * @param info 活动规则信息 |
| | | * @return 活动规则数量 |
| | | */ |
| | | @Override |
| | | public int queryActivitiesBeautifulStaffsCount(Map info) { |
| | | logger.debug("查询活动规则数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessActivitiesBeautifulStaffInfos = sqlSessionTemplate.selectList("activitiesBeautifulStaffServiceDaoImpl.queryActivitiesBeautifulStaffsCount", info); |
| | | if (businessActivitiesBeautifulStaffInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessActivitiesBeautifulStaffInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.user.smo.impl; |
| | | |
| | | |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.activitiesBeautifulStaff.ActivitiesBeautifulStaffDto; |
| | | import com.java110.intf.user.IActivitiesBeautifulStaffInnerServiceSMO; |
| | | import com.java110.po.activitiesBeautifulStaff.ActivitiesBeautifulStaffPo; |
| | | import com.java110.user.dao.IActivitiesBeautifulStaffServiceDao; |
| | | 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 ActivitiesBeautifulStaffInnerServiceSMOImpl extends BaseServiceSMO implements IActivitiesBeautifulStaffInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IActivitiesBeautifulStaffServiceDao activitiesBeautifulStaffServiceDaoImpl; |
| | | |
| | | |
| | | @Override |
| | | public int saveActivitiesBeautifulStaff(@RequestBody ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo) { |
| | | int saveFlag = 1; |
| | | activitiesBeautifulStaffServiceDaoImpl.saveActivitiesBeautifulStaffInfo(BeanConvertUtil.beanCovertMap(activitiesBeautifulStaffPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int updateActivitiesBeautifulStaff(@RequestBody ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo) { |
| | | int saveFlag = 1; |
| | | activitiesBeautifulStaffServiceDaoImpl.updateActivitiesBeautifulStaffInfo(BeanConvertUtil.beanCovertMap(activitiesBeautifulStaffPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public int deleteActivitiesBeautifulStaff(@RequestBody ActivitiesBeautifulStaffPo activitiesBeautifulStaffPo) { |
| | | int saveFlag = 1; |
| | | activitiesBeautifulStaffPo.setStatusCd("1"); |
| | | activitiesBeautifulStaffServiceDaoImpl.updateActivitiesBeautifulStaffInfo(BeanConvertUtil.beanCovertMap(activitiesBeautifulStaffPo)); |
| | | return saveFlag; |
| | | } |
| | | |
| | | @Override |
| | | public List<ActivitiesBeautifulStaffDto> queryActivitiesBeautifulStaffs(@RequestBody ActivitiesBeautifulStaffDto activitiesBeautifulStaffDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = activitiesBeautifulStaffDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | activitiesBeautifulStaffDto.setPage((page - 1) * activitiesBeautifulStaffDto.getRow()); |
| | | } |
| | | |
| | | List<ActivitiesBeautifulStaffDto> activitiesBeautifulStaffs = BeanConvertUtil.covertBeanList(activitiesBeautifulStaffServiceDaoImpl.getActivitiesBeautifulStaffInfo(BeanConvertUtil.beanCovertMap(activitiesBeautifulStaffDto)), ActivitiesBeautifulStaffDto.class); |
| | | |
| | | return activitiesBeautifulStaffs; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int queryActivitiesBeautifulStaffsCount(@RequestBody ActivitiesBeautifulStaffDto activitiesBeautifulStaffDto) { |
| | | return activitiesBeautifulStaffServiceDaoImpl.queryActivitiesBeautifulStaffsCount(BeanConvertUtil.beanCovertMap(activitiesBeautifulStaffDto)); |
| | | } |
| | | |
| | | public IActivitiesBeautifulStaffServiceDao getActivitiesBeautifulStaffServiceDaoImpl() { |
| | | return activitiesBeautifulStaffServiceDaoImpl; |
| | | } |
| | | |
| | | public void setActivitiesBeautifulStaffServiceDaoImpl(IActivitiesBeautifulStaffServiceDao activitiesBeautifulStaffServiceDaoImpl) { |
| | | this.activitiesBeautifulStaffServiceDaoImpl = activitiesBeautifulStaffServiceDaoImpl; |
| | | } |
| | | } |